@pega/cosmos-react-work 2.0.0-dev.9.4 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  2. package/lib/components/AppAnnouncement/AppAnnouncement.js +5 -7
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  4. package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
  5. package/lib/components/CaseHeader/CaseHeader.js +8 -8
  6. package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
  7. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  8. package/lib/components/CasePreview/CasePreview.js +13 -10
  9. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  10. package/lib/components/CaseSummary/CaseSummary.d.ts +18 -1
  11. package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
  12. package/lib/components/CaseSummary/CaseSummary.js +121 -9
  13. package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
  14. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  15. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +12 -10
  16. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  17. package/lib/components/CaseView/CaseView.d.ts +6 -26
  18. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  19. package/lib/components/CaseView/CaseView.js +136 -183
  20. package/lib/components/CaseView/CaseView.js.map +1 -1
  21. package/lib/components/CaseView/CaseView.styles.d.ts +24 -0
  22. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  23. package/lib/components/CaseView/CaseView.styles.js +111 -0
  24. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  25. package/lib/components/CaseView/MobileCaseView.js +1 -3
  26. package/lib/components/CaseView/MobileCaseView.js.map +1 -1
  27. package/lib/components/CaseView/UtilitiesSummary.js +4 -5
  28. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  29. package/lib/components/CaseView/index.d.ts +2 -1
  30. package/lib/components/CaseView/index.d.ts.map +1 -1
  31. package/lib/components/CaseView/index.js +1 -1
  32. package/lib/components/CaseView/index.js.map +1 -1
  33. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  34. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  35. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +93 -0
  36. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  37. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +43 -0
  38. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  39. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  40. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  41. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  42. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  43. package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
  44. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  45. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  46. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  47. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  48. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  49. package/lib/components/ConfigurableLayout/index.d.ts +3 -0
  50. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  51. package/lib/components/ConfigurableLayout/index.js +3 -0
  52. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  53. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  54. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  55. package/lib/components/ConfigurableLayout/options.js +10 -0
  56. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  57. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
  58. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
  59. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
  60. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
  61. package/lib/components/Confirmation/Confirmation.d.ts +19 -0
  62. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
  63. package/lib/components/Confirmation/Confirmation.js +14 -0
  64. package/lib/components/Confirmation/Confirmation.js.map +1 -0
  65. package/lib/components/Confirmation/index.d.ts +3 -0
  66. package/lib/components/Confirmation/index.d.ts.map +1 -0
  67. package/lib/components/Confirmation/index.js +2 -0
  68. package/lib/components/Confirmation/index.js.map +1 -0
  69. package/lib/components/Details/Details.d.ts +13 -0
  70. package/lib/components/Details/Details.d.ts.map +1 -0
  71. package/lib/components/Details/Details.js +38 -0
  72. package/lib/components/Details/Details.js.map +1 -0
  73. package/lib/components/Details/index.d.ts +4 -0
  74. package/lib/components/Details/index.d.ts.map +1 -0
  75. package/lib/components/Details/index.js +3 -0
  76. package/lib/components/Details/index.js.map +1 -0
  77. package/lib/components/Glimpse/Glimpse.js +1 -2
  78. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  79. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  80. package/lib/components/SearchResults/Filter.js +10 -42
  81. package/lib/components/SearchResults/Filter.js.map +1 -1
  82. package/lib/components/SearchResults/SearchResult.js +1 -4
  83. package/lib/components/SearchResults/SearchResult.js.map +1 -1
  84. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  85. package/lib/components/SearchResults/SearchResults.js +33 -69
  86. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  87. package/lib/components/SearchResults/SearchResults.styles.d.ts +8 -0
  88. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
  89. package/lib/components/SearchResults/SearchResults.styles.js +67 -0
  90. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
  91. package/lib/components/SearchResults/SearchResults.types.d.ts +14 -4
  92. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  93. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  94. package/lib/components/Stages/Stages.d.ts.map +1 -1
  95. package/lib/components/Stages/Stages.js +13 -15
  96. package/lib/components/Stages/Stages.js.map +1 -1
  97. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  98. package/lib/components/Stages/Stages.styles.js +2 -2
  99. package/lib/components/Stages/Stages.styles.js.map +1 -1
  100. package/lib/components/Stages/Steps.d.ts.map +1 -1
  101. package/lib/components/Stages/Steps.js +5 -3
  102. package/lib/components/Stages/Steps.js.map +1 -1
  103. package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
  104. package/lib/components/Stages/StepsContainer.js +4 -6
  105. package/lib/components/Stages/StepsContainer.js.map +1 -1
  106. package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
  107. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  108. package/lib/components/Stakeholders/StakeholderForm.js +49 -0
  109. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  110. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  111. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  112. package/lib/components/Stakeholders/Stakeholders.js +215 -0
  113. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  114. package/lib/components/Stakeholders/Stakeholders.types.d.ts +83 -0
  115. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  116. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  117. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  118. package/lib/components/Stakeholders/index.d.ts +3 -0
  119. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  120. package/lib/components/Stakeholders/index.js +2 -0
  121. package/lib/components/Stakeholders/index.js.map +1 -0
  122. package/lib/components/Tags/Tags.d.ts +34 -0
  123. package/lib/components/Tags/Tags.d.ts.map +1 -0
  124. package/lib/components/Tags/Tags.js +227 -0
  125. package/lib/components/Tags/Tags.js.map +1 -0
  126. package/lib/components/Tags/index.d.ts +3 -0
  127. package/lib/components/Tags/index.d.ts.map +1 -0
  128. package/lib/components/Tags/index.js +2 -0
  129. package/lib/components/Tags/index.js.map +1 -0
  130. package/lib/components/Tasks/TaskList.d.ts +25 -0
  131. package/lib/components/Tasks/TaskList.d.ts.map +1 -0
  132. package/lib/components/Tasks/TaskList.js +25 -0
  133. package/lib/components/Tasks/TaskList.js.map +1 -0
  134. package/lib/components/Tasks/Tasks.d.ts +1 -13
  135. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  136. package/lib/components/Tasks/Tasks.js +9 -28
  137. package/lib/components/Tasks/Tasks.js.map +1 -1
  138. package/lib/components/Tasks/index.d.ts +3 -0
  139. package/lib/components/Tasks/index.d.ts.map +1 -1
  140. package/lib/components/Tasks/index.js +1 -0
  141. package/lib/components/Tasks/index.js.map +1 -1
  142. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  143. package/lib/components/Timeline/Timeline.js +10 -12
  144. package/lib/components/Timeline/Timeline.js.map +1 -1
  145. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  146. package/lib/components/Timeline/Timeline.styles.js +8 -4
  147. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  148. package/lib/components/Timeline/Timeline.types.d.ts +17 -4
  149. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  150. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  151. package/lib/components/Timeline/TimelineItem.d.ts +2 -1
  152. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  153. package/lib/components/Timeline/TimelineItem.js +4 -11
  154. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  155. package/lib/components/Timeline/utils.d.ts +11 -3
  156. package/lib/components/Timeline/utils.d.ts.map +1 -1
  157. package/lib/components/Timeline/utils.js +48 -4
  158. package/lib/components/Timeline/utils.js.map +1 -1
  159. package/lib/index.d.ts +10 -0
  160. package/lib/index.d.ts.map +1 -1
  161. package/lib/index.js +10 -0
  162. package/lib/index.js.map +1 -1
  163. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,UAAU,EAA2C,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,cAAc,EACd,oBAAoB,EACpB,IAAI,EACJ,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAC/C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;wBACI,KAAK,CAAC,IAAI,CAAC,OAAO;;QAElC,oBAAoB;;;GAGzB,CACF,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAmBxD,MAAM,iBAAiB,GAA6D,UAAU,CAC5F,CACE,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,SAAS,EAA2C,EACzF,GAAkC,EAClC,EAAE;IACF,OAAO,CACL,MAAC,IAAI,oBAAK,SAAS,IAAE,EAAE,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,iBAClF,KAAC,cAAc,IACb,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAChC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;oBAC7B,CAAC,CAAC;wBACE,GAAG,KAAK;wBACR,KAAK,EAAE,CACL,KAAC,IAAI,kBAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,MAAM,gBACzB,KAAK,CAAC,KAAK,YACP,CACR;qBACF;oBACH,CAAC,CAAC,KAAK,CACV,WACD;YACF,KAAC,cAAc,IAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,EAAE,eAAe,WAAI,aACvD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { ReactNode, forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Grid,\n FieldValueList,\n StyledFieldValueList,\n Text,\n defaultThemeProp,\n ForwardProps\n} from '@pega/cosmos-react-core';\n\nexport const StyledCaseSummaryFields = styled.div(\n ({ theme }) => css`\n padding: calc(2 * ${theme.base.spacing});\n\n > ${StyledFieldValueList}:first-child {\n grid-template-columns: 16ch auto;\n }\n `\n);\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\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 /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst CaseSummaryFields: FunctionComponent<CaseSummaryFieldsProps & ForwardProps> = forwardRef(\n (\n { primaryFields, secondaryFields, ...restProps }: PropsWithoutRef<CaseSummaryFieldsProps>,\n ref: CaseSummaryFieldsProps['ref']\n ) => {\n return (\n <Grid {...restProps} as={StyledCaseSummaryFields} ref={ref} container={{ rowGap: 2 }}>\n <FieldValueList\n variant='stacked'\n fields={primaryFields.map(field =>\n typeof field.value === 'string'\n ? {\n ...field,\n value: (\n <Text variant='h1' as='span'>\n {field.value}\n </Text>\n )\n }\n : field\n )}\n />\n <FieldValueList variant='inline' fields={secondaryFields} />\n </Grid>\n );\n }\n);\n\nexport default CaseSummaryFields;\n"]}
1
+ {"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,UAAU,EAA2C,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AAEjC,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;AAmBxD,MAAM,iBAAiB,GAA6D,UAAU,CAC5F,CACE,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,SAAS,EAA2C,EACzF,GAAkC,EAClC,EAAE;IACF,OAAO,CACL,MAAC,IAAI,OAAK,SAAS,EAAE,EAAE,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAClF,KAAC,cAAc,IAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAE,aAAa,WAAI,EAC3D,KAAC,cAAc,IAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,EAAE,eAAe,WAAI,YACvD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { ReactNode, forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Grid,\n FieldValueList,\n StyledFieldValueList,\n StyledFieldValue,\n calculateFontSize,\n defaultThemeProp,\n ForwardProps,\n FontSize\n} from '@pega/cosmos-react-core';\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 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 /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst CaseSummaryFields: FunctionComponent<CaseSummaryFieldsProps & ForwardProps> = forwardRef(\n (\n { primaryFields, secondaryFields, ...restProps }: PropsWithoutRef<CaseSummaryFieldsProps>,\n ref: CaseSummaryFieldsProps['ref']\n ) => {\n return (\n <Grid {...restProps} as={StyledCaseSummaryFields} ref={ref} container={{ rowGap: 2 }}>\n <FieldValueList variant='stacked' fields={primaryFields} />\n <FieldValueList variant='inline' fields={secondaryFields} />\n </Grid>\n );\n }\n);\n\nexport default CaseSummaryFields;\n"]}
@@ -11,6 +11,8 @@ export interface CaseViewProps extends CaseSummaryProps {
11
11
  utilities?: ReactNode;
12
12
  /** The utilities summary array will be used to render the minimized the utilities card. */
13
13
  utilitiesSummaryItems?: UtilitiesSummaryProps['items'];
14
+ /** Collapses the utilities by default on load */
15
+ defaultCollapsedUtilities?: boolean;
14
16
  /** A region above the center column to display banners. */
15
17
  banners?: ReactNode;
16
18
  /** A region to the right reserved for persistent utilities. */
@@ -19,33 +21,11 @@ export interface CaseViewProps extends CaseSummaryProps {
19
21
  title: string;
20
22
  };
21
23
  /** A region within the center column that is controlled by tabs in CaseSummary. */
22
- tabContent?: ReactNode;
24
+ tabContent?: {
25
+ content: ReactNode;
26
+ id: string;
27
+ }[];
23
28
  }
24
- export declare const StyledCaseViewContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
25
- forceMobile?: boolean | undefined;
26
- isMediumOrAbove?: boolean | undefined;
27
- persistentUtility?: boolean | undefined;
28
- }, never>;
29
- export declare const StyledMobileTabs: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TabsProps & ForwardProps>, import("styled-components").DefaultTheme, {
30
- fullWidth: boolean;
31
- }, never>;
32
- export declare const StyledCaseViewUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
33
- utilitiesShown: boolean;
34
- }, never>;
35
- export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
36
- forceMobile?: boolean | undefined;
37
- isMediumOrAbove?: boolean | undefined;
38
- appshellOffset: number;
39
- offset: number;
40
- }, never>;
41
- export declare const StyledSummaryRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
42
- forceMobile?: boolean | undefined;
43
- desktop?: boolean | undefined;
44
- }, never>;
45
- export declare const StyledCaseDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
46
- export declare const StyledCaseDrawerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
47
- export declare const StyledPersistentUtility: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
48
- export declare const ScrollStick: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
49
29
  declare const CaseView: FC<CaseViewProps & ForwardProps>;
50
30
  export default CaseView;
51
31
  //# sourceMappingURL=CaseView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,EAAE,EAWH,MAAM,OAAO,CAAC;AAGf,OAAO,EASL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAIjC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAyB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2FAA2F;IAC3F,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,mFAAmF;IACnF,UAAU,CAAC,EAAE,SAAS,CAAC;CAMxB;AAED,eAAO,MAAM,qBAAqB;;;;SAoBhC,CAAC;AAEH,eAAO,MAAM,gBAAgB;eAA6B,OAAO;SAQ/D,CAAC;AAcH,eAAO,MAAM,uBAAuB;oBAAgC,OAAO;SAQ1E,CAAC;AAIF,eAAO,MAAM,cAAc;;;oBAGT,MAAM;YACd,MAAM;SAkBd,CAAC;AAIH,eAAO,MAAM,mBAAmB;;;SAsB9B,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;AAEF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CA2U9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,EAAE,EAWH,MAAM,OAAO,CAAC;AAEf,OAAO,EAUL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAMjC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAyB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAe7E,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2FAA2F;IAC3F,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,mFAAmF;IACnF,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAMnD;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAoc9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,133 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext, useEffect, useState, useCallback, useMemo, useRef, useLayoutEffect } from 'react';
3
- import styled, { css } from 'styled-components';
4
- import { Button, Flex, Grid, Icon, TabPanel, useBreakpoint, useScrollStick, defaultThemeProp, Card, Drawer, useI18n, useDirection, Tabs, useConsolidatedRef } from '@pega/cosmos-react-core';
3
+ import { Button, Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, useConsolidatedRef } from '@pega/cosmos-react-core';
5
4
  import AppShellContext from '@pega/cosmos-react-core/lib/components/AppShell/AppShellContext';
5
+ import * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';
6
+ import * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';
6
7
  import CaseSummary from '../CaseSummary';
7
8
  import UtilitiesSummary from './UtilitiesSummary';
8
- export const StyledCaseViewContent = styled.div(({ theme, forceMobile, isMediumOrAbove, persistentUtility }) => {
9
- return css `
10
- padding: calc(2 * ${theme.base.spacing});
11
-
12
- ${persistentUtility &&
13
- isMediumOrAbove &&
14
- css `
15
- margin-inline-start: calc(2 * ${theme.base.spacing});
16
- `}
17
-
18
- ${!forceMobile &&
19
- isMediumOrAbove &&
20
- css `
21
- padding: calc(2 * ${theme.base.spacing}) 0;
22
- `}
23
- `;
24
- });
25
- export const StyledMobileTabs = styled(Tabs)(({ theme, fullWidth }) => {
26
- return css `
27
- border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
28
- ${fullWidth &&
29
- css `
30
- margin: 0 calc(-2 * ${theme.base.spacing});
31
- `}
32
- `;
33
- });
34
- StyledMobileTabs.defaultProps = defaultThemeProp;
35
- const StyledUtilToggle = styled.button(({ theme }) => {
36
- return css `
37
- align-self: flex-end;
38
- color: ${theme.base.palette['foreground-color']};
39
- margin-inline-end: 0.375rem;
40
- `;
41
- });
42
- StyledUtilToggle.defaultProps = defaultThemeProp;
43
- export const StyledCaseViewUtilities = styled.div(({ utilitiesShown, theme }) => {
44
- return css `
45
- width: ${utilitiesShown ? '25rem' : 'auto'};
46
- height: max-content;
47
- padding: calc(2 * ${theme.base.spacing}) 0 calc(2 * ${theme.base.spacing});
48
- `;
49
- });
50
- StyledCaseViewUtilities.defaultProps = defaultThemeProp;
51
- export const StyledCaseView = styled.div(({ theme, forceMobile, isMediumOrAbove, appshellOffset, offset }) => {
52
- return css `
53
- --case-view-header-offset: ${offset}px;
54
- --appshell-offset: ${appshellOffset}px;
55
- --case-view-content-height: calc(100vh - var(--case-view-header-offset));
56
- min-height: calc(100vh - var(---appshell-offset));
57
- position: relative;
58
- background-color: ${theme.base.palette['app-background']};
59
-
60
- > :last-child {
61
- ${!forceMobile &&
62
- isMediumOrAbove &&
63
- css `
64
- margin-inline-end: calc(2 * ${theme.base.spacing});
65
- `}
66
- }
67
- `;
68
- });
69
- StyledCaseView.defaultProps = defaultThemeProp;
70
- export const StyledSummaryRegion = styled.div(({ theme, forceMobile, desktop }) => {
71
- return css `
72
- position: sticky;
73
- top: var(--appshell-offset);
74
- width: 100%;
75
- background-color: ${theme.base.palette['primary-background']};
76
- overflow: auto;
77
-
78
- ${(forceMobile || !desktop) &&
79
- css `
80
- z-index: ${theme.base['z-index'].popover + 1};
81
- `}
82
-
83
- ${!forceMobile &&
84
- desktop &&
85
- css `
86
- height: var(--case-view-content-height);
87
- `}
88
- `;
89
- });
90
- StyledSummaryRegion.defaultProps = defaultThemeProp;
91
- export const StyledCaseDrawer = styled.div(({ theme }) => {
92
- return css `
93
- min-width: 21.875rem;
94
- max-width: 31.25rem;
95
- width: calc((100vw - 31.25rem) / 10 + 21.875rem);
96
- background-color: ${theme.base.palette['primary-background']};
97
- height: var(--case-view-content-height);
98
- top: var(--case-view-header-offset);
99
- z-index: ${theme.base['z-index'].drawer - 1};
100
- `;
101
- });
102
- StyledCaseDrawer.defaultProps = defaultThemeProp;
103
- export const StyledCaseDrawerContent = styled.div(({ theme }) => {
104
- return css `
105
- background-color: ${theme.base.palette['app-background']};
106
- padding: calc(2 * ${theme.base.spacing});
107
- height: 100%;
108
- overflow: auto;
109
- `;
110
- });
111
- StyledCaseDrawerContent.defaultProps = defaultThemeProp;
112
- export const StyledPersistentUtility = styled.div(() => {
113
- return css `
114
- height: var(--case-view-content-height);
115
- max-width: 60ch;
116
- overflow: auto;
117
- position: sticky;
118
- top: var(--case-view-header-offset);
119
- `;
120
- });
121
- StyledPersistentUtility.defaultProps = defaultThemeProp;
122
- export const ScrollStick = styled.div `
123
- position: sticky;
124
- top: 0;
125
- `;
9
+ import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledCaseViewContent, StyledPersistentUtility, StyledSummaryRegion, StyledCaseViewUtilities, StyledMobileTabs, StyledUtilToggle } from './CaseView.styles';
10
+ registerIcon(moveRightSolidIcon, moveLeftSolidIcon);
126
11
  const CaseView = (props) => {
127
- const { caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, caseSummaryRef, tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick }, stages, tasks, tabContent: tabContentProp, utilities, utilitiesSummaryItems, actions, onEdit, banners, persistentUtility, forceMobile, ...restProps } = props;
12
+ const { caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, caseSummaryRef, tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick }, stages, tasks, tabContent: tabContentProp = [], utilities, utilitiesSummaryItems, defaultCollapsedUtilities = false, actions, onEdit, banners, persistentUtility, forceMobile, ...restProps } = props;
128
13
  const t = useI18n();
129
14
  const caseViewRef = useRef(null);
130
15
  const caseViewSummaryRef = useConsolidatedRef(caseSummaryRef);
16
+ const caseSummaryHeaderRef = useRef(null);
17
+ const caseViewSummaryContainerRef = useRef(null);
18
+ const [tabContentEl, setTabContentEl] = useElement(null);
131
19
  let isExtraLargeOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });
132
20
  let isLargeOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });
133
21
  let isMediumOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });
@@ -137,26 +25,29 @@ const CaseView = (props) => {
137
25
  isMediumOrAbove = false;
138
26
  }
139
27
  const { headerEl } = useContext(AppShellContext);
140
- const getOffsets = () => {
141
- var _a;
142
- const appshellHeaderHeight = (headerEl === null || headerEl === void 0 ? void 0 : headerEl.offsetHeight) || 0;
143
- const summaryHeight = !isMediumOrAbove || persistentUtility ? ((_a = caseViewSummaryRef === null || caseViewSummaryRef === void 0 ? void 0 : caseViewSummaryRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0 : 0;
144
- return {
145
- sticky: appshellHeaderHeight + summaryHeight,
146
- appshellHeader: appshellHeaderHeight,
147
- summary: summaryHeight
148
- };
149
- };
150
- const [offsets, setOffsets] = useState(getOffsets);
28
+ const [summaryAnimationState, setSummaryAnimationState] = useState('expanded');
151
29
  const summaryTabId = `summary-${caseId}`;
152
30
  const utilitiesTabId = `utilities-${caseId}`;
153
31
  const persistentUtilityTabId = `persistent-utility-${caseId}`;
154
- const [utilitiesShown, setUtilitiesShown] = useState(isLargeOrAbove);
155
- const [userUtilState, setUserUtilState] = useState();
32
+ const [utilitiesShown, setUtilitiesShown] = useState(isLargeOrAbove && !defaultCollapsedUtilities);
33
+ const initialUserUtilState = defaultCollapsedUtilities ? 'hidden' : undefined;
34
+ const [userUtilState, setUserUtilState] = useState(initialUserUtilState);
35
+ const [summaryPanelCollapsed, setSummaryPanelCollapsed] = useState(false);
156
36
  const hasSideBySideColumns = isMediumOrAbove;
157
37
  const scrollStickOptions = useRef({
158
38
  elements: []
159
39
  });
40
+ const getOffsets = () => {
41
+ const appshellHeaderHeight = headerEl?.offsetHeight || 0;
42
+ const summaryHeight = !isMediumOrAbove || (persistentUtility && !isExtraLargeOrAbove) || summaryPanelCollapsed
43
+ ? caseViewSummaryRef?.current?.offsetHeight || 0
44
+ : 0;
45
+ return {
46
+ sticky: appshellHeaderHeight + summaryHeight,
47
+ summary: summaryHeight
48
+ };
49
+ };
50
+ const [offsets, setOffsets] = useState(getOffsets);
160
51
  useScrollStick(hasSideBySideColumns ? { ...scrollStickOptions.current, offset: offsets.sticky } : undefined);
161
52
  const toggleUtilities = useCallback((e) => {
162
53
  if (e.type === 'keydown' && e.key !== 'Enter') {
@@ -169,7 +60,7 @@ const CaseView = (props) => {
169
60
  }, []);
170
61
  useLayoutEffect(() => {
171
62
  setOffsets(getOffsets());
172
- }, [isExtraLargeOrAbove, isLargeOrAbove, isMediumOrAbove, headerEl]);
63
+ }, [isExtraLargeOrAbove, isLargeOrAbove, isMediumOrAbove, headerEl, summaryPanelCollapsed]);
173
64
  useEffect(() => {
174
65
  if (isLargeOrAbove) {
175
66
  setUtilitiesShown(userUtilState !== 'hidden');
@@ -179,52 +70,88 @@ const CaseView = (props) => {
179
70
  }
180
71
  }, [isLargeOrAbove]);
181
72
  useEffect(() => {
182
- var _a;
183
- if (isMediumOrAbove && !persistentUtility) {
184
- if (currentTabId === summaryTabId || currentTabId === utilitiesTabId)
185
- onTabClick((_a = tabItemsProp[0]) === null || _a === void 0 ? void 0 : _a.id);
73
+ if (isMediumOrAbove &&
74
+ !summaryPanelCollapsed &&
75
+ !persistentUtility &&
76
+ (currentTabId === summaryTabId || currentTabId === utilitiesTabId)) {
77
+ onTabClick(tabItemsProp[0]?.id);
186
78
  }
187
- }, [isMediumOrAbove, onTabClick, currentTabId, summaryTabId, utilitiesTabId]);
79
+ }, [
80
+ isMediumOrAbove,
81
+ onTabClick,
82
+ currentTabId,
83
+ summaryTabId,
84
+ utilitiesTabId,
85
+ summaryPanelCollapsed
86
+ ]);
188
87
  useEffect(() => {
189
88
  if ((isMediumOrAbove && !isLargeOrAbove && utilities) || persistentUtility)
190
89
  setUtilitiesShown(false);
191
90
  }, [isMediumOrAbove, utilities]);
192
91
  useEffect(() => {
193
- if (persistentUtility) {
194
- if (currentTabId === persistentUtilityTabId)
195
- onTabClick(summaryTabId);
196
- }
92
+ if (persistentUtility && currentTabId === persistentUtilityTabId)
93
+ onTabClick(summaryTabId);
197
94
  }, [persistentUtility]);
198
95
  const tabItems = useMemo(() => {
96
+ const summaryTab = { id: summaryTabId, name: 'Summary' };
199
97
  if (isMediumOrAbove)
200
- return persistentUtility
201
- ? [{ id: summaryTabId, name: 'Summary' }, ...tabItemsProp]
98
+ return summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove)
99
+ ? [summaryTab, ...tabItemsProp]
202
100
  : tabItemsProp;
203
101
  const utilityTabs = [];
204
102
  if (utilities)
205
103
  utilityTabs.push({ id: utilitiesTabId, name: 'Utilities' });
206
104
  if (persistentUtility && !isMediumOrAbove)
207
105
  utilityTabs.push({ id: persistentUtilityTabId, name: persistentUtility.title });
208
- return [{ id: summaryTabId, name: 'Summary' }, ...tabItemsProp, ...utilityTabs];
106
+ return [summaryTab, ...tabItemsProp, ...utilityTabs];
209
107
  }, [
210
108
  isMediumOrAbove,
109
+ isExtraLargeOrAbove,
211
110
  summaryTabId,
212
111
  utilitiesTabId,
213
112
  persistentUtilityTabId,
214
113
  utilities,
215
114
  persistentUtility,
216
- tabItemsProp
115
+ tabItemsProp,
116
+ summaryPanelCollapsed
217
117
  ]);
218
- const tabContent = useMemo(() => {
219
- if (currentTabId === summaryTabId)
220
- return _jsx(Card, { children: summary }, void 0);
221
- if (currentTabId === utilitiesTabId) {
222
- return _jsx(Flex, Object.assign({ container: { direction: 'column', gap: 2 } }, { children: utilities }), void 0);
118
+ useEffect(() => {
119
+ if (!tabContentEl)
120
+ return;
121
+ const scrollPos = window.scrollY;
122
+ const windowHeight = document.documentElement.clientHeight;
123
+ const bottomPos = scrollPos + windowHeight * 0.8;
124
+ const tabContentPos = tabContentEl.offsetTop;
125
+ if (tabContentPos > bottomPos) {
126
+ const top = tabContentPos - windowHeight * 0.2;
127
+ window.scrollTo({ top, behavior: 'smooth' });
223
128
  }
224
- if (currentTabId === persistentUtilityTabId)
225
- return persistentUtility === null || persistentUtility === void 0 ? void 0 : persistentUtility.content;
226
- return tabContentProp;
227
- }, [currentTabId, tabContentProp, summary, summaryTabId, utilities, utilitiesTabId]);
129
+ }, [currentTabId]);
130
+ const tabContent = useMemo(() => {
131
+ const summaryTabContent = { id: summaryTabId, content: _jsx(Card, { children: summary }, void 0) };
132
+ if (isMediumOrAbove)
133
+ return summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove)
134
+ ? [summaryTabContent, ...tabContentProp]
135
+ : tabContentProp;
136
+ const utilityTabs = [];
137
+ if (utilities)
138
+ utilityTabs.push({
139
+ id: utilitiesTabId,
140
+ content: _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: utilities }, void 0)
141
+ });
142
+ if (persistentUtility)
143
+ utilityTabs.push({ id: persistentUtilityTabId, content: persistentUtility?.content });
144
+ return [summaryTabContent, ...tabContentProp, ...utilityTabs];
145
+ }, [
146
+ currentTabId,
147
+ tabContentProp,
148
+ summary,
149
+ summaryTabId,
150
+ utilities,
151
+ utilitiesTabId,
152
+ isMediumOrAbove,
153
+ isExtraLargeOrAbove
154
+ ]);
228
155
  const direction = useDirection();
229
156
  const utilitiesIcon = utilitiesShown
230
157
  ? `move-${direction.end}-solid`
@@ -235,29 +162,33 @@ const CaseView = (props) => {
235
162
  rows: 'minmax(0, max-content) auto',
236
163
  areas: '"case-nav" "content"'
237
164
  };
238
- if (!forceMobile && !persistentUtility) {
239
- const areas = `"case-nav content utilities"`;
240
- if (isLargeOrAbove) {
165
+ let fixedSummaryWidth = '100%';
166
+ if (!forceMobile && !persistentUtility && !summaryPanelCollapsed) {
167
+ fixedSummaryWidth = isLargeOrAbove ? '25rem' : '22rem';
168
+ if (isLargeOrAbove || isMediumOrAbove) {
241
169
  caseViewGridContainer = {
242
- cols: '25rem minmax(0, 1fr) minmax(0, max-content)',
170
+ cols: 'minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content)',
243
171
  colGap: 2,
244
172
  rows: caseViewGridContainer.rows,
245
- areas
173
+ areas: '"case-nav content utilities"'
246
174
  };
247
175
  }
248
- else if (isMediumOrAbove) {
176
+ }
177
+ else if (summaryPanelCollapsed) {
178
+ if (isLargeOrAbove || isMediumOrAbove) {
249
179
  caseViewGridContainer = {
250
- cols: '22rem minmax(0, 1fr) minmax(0, max-content)',
180
+ cols: 'minmax(0, 1fr) minmax(0, max-content)',
251
181
  colGap: 2,
252
182
  rows: caseViewGridContainer.rows,
253
- areas
183
+ areas: '"case-nav case-nav" "content utilities"'
254
184
  };
255
185
  }
256
186
  }
257
187
  else if (persistentUtility) {
258
188
  if (isExtraLargeOrAbove) {
189
+ fixedSummaryWidth = '25rem';
259
190
  caseViewGridContainer = {
260
- cols: '22rem minmax(0, 1fr) repeat(2, minmax(0, max-content))',
191
+ cols: 'minmax(0, max-content) minmax(0, 1fr) repeat(2, minmax(0, max-content))',
261
192
  colGap: 2,
262
193
  rows: caseViewGridContainer.rows,
263
194
  areas: '"case-nav content persistentUtility utilities"'
@@ -272,35 +203,57 @@ const CaseView = (props) => {
272
203
  };
273
204
  }
274
205
  }
275
- return (_jsxs(Grid, Object.assign({ as: StyledCaseView, appshellOffset: offsets.appshellHeader, offset: persistentUtility && isExtraLargeOrAbove ? offsets.appshellHeader : offsets.sticky, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'caseView' }, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove }, restProps, { children: [_jsx(Grid, Object.assign({ as: StyledSummaryRegion, item: { area: 'case-nav' }, forceMobile: forceMobile, desktop: isMediumOrAbove && (!persistentUtility || isExtraLargeOrAbove) }, { children: _jsx(CaseSummary, { ref: caseViewSummaryRef, caseId: caseId, heading: heading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, parentCases: parentCases, summary: summary, actions: actions, onEdit: onEdit, tabs: {
206
+ const animateSummaryPanel = (type) => {
207
+ if (type === 'close') {
208
+ const animation = [{ width: fixedSummaryWidth }, { width: 0 }];
209
+ caseViewSummaryContainerRef.current?.animate(animation, 250);
210
+ }
211
+ else {
212
+ const animation = [{ width: 0 }, { width: isLargeOrAbove ? '25rem' : '22rem' }];
213
+ caseViewSummaryContainerRef.current?.animate(animation, 250);
214
+ }
215
+ };
216
+ return (_jsxs(Grid, { as: StyledCaseView, stickyOffset: offsets.sticky, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'caseView' }, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove, ...restProps, children: [_jsx(Grid, { as: StyledSummaryRegion, item: { area: 'case-nav' }, forceMobile: forceMobile, desktop: isMediumOrAbove && (!persistentUtility || isExtraLargeOrAbove) && !summaryPanelCollapsed, isLargeOrAbove: isLargeOrAbove, ref: caseViewSummaryContainerRef, style: ['collapsing', 'expanding'].includes(summaryAnimationState)
217
+ ? {
218
+ overflow: 'hidden'
219
+ }
220
+ : undefined, children: _jsx(CaseSummary, { ref: caseViewSummaryRef, headerRef: caseSummaryHeaderRef, caseId: caseId, heading: heading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, parentCases: parentCases, summary: summary, actions: actions, onEdit: onEdit, tabs: {
276
221
  items: tabItems,
277
222
  onClick: onTabClick,
278
223
  currentTabId
279
- }, forceMobile: forceMobile, desktop: (isMediumOrAbove && !persistentUtility) || isExtraLargeOrAbove }, void 0) }), void 0),
280
- _jsxs(Grid, Object.assign({ container: {
224
+ }, forceMobile: forceMobile, desktop: ((isMediumOrAbove && !persistentUtility) || isExtraLargeOrAbove) &&
225
+ !summaryPanelCollapsed, fixedWidth: isMediumOrAbove ? fixedSummaryWidth : undefined, collapsible: isMediumOrAbove && !persistentUtility, collapsed: summaryPanelCollapsed, onBeforeCollapse: () => {
226
+ animateSummaryPanel('close');
227
+ }, onAfterCollapse: () => setSummaryPanelCollapsed(true), onBeforeExpand: () => {
228
+ animateSummaryPanel('open');
229
+ setSummaryPanelCollapsed(false);
230
+ }, onAnimationStateChange: setSummaryAnimationState }, void 0) }, void 0), _jsxs(Grid, { container: {
281
231
  cols: 'minmax(0, 1fr)',
282
232
  alignContent: 'start',
283
233
  rowGap: 2
284
- }, item: { area: 'content' }, as: StyledCaseViewContent, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove, persistentUtility: Boolean(persistentUtility) }, { children: [banners && _jsx("div", { children: banners }, void 0),
285
- stages && _jsx("div", { children: stages }, void 0),
286
- tasks && _jsx("div", { children: tasks }, void 0),
287
- (!isMediumOrAbove || persistentUtility) && (_jsx(StyledMobileTabs, { type: 'horizontal', tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId, fullWidth: !isMediumOrAbove }, void 0)),
288
- currentTabId ? _jsx(TabPanel, Object.assign({ tabId: currentTabId }, { children: tabContent }), void 0) : tabContent] }), void 0),
289
- persistentUtility && isMediumOrAbove && (_jsx(Grid, Object.assign({ as: StyledPersistentUtility, item: { area: 'persistentUtility' } }, { children: persistentUtility.content }), void 0)),
290
- !isLargeOrAbove && (_jsx(Drawer, Object.assign({ as: StyledCaseDrawer, open: utilitiesShown && isMediumOrAbove, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility }, { children: _jsxs(Flex, Object.assign({ as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 } }, { children: [_jsx(Flex, Object.assign({ container: { justify: 'end' } }, { children: _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, "aria-label": t('collapse_noun', t('utilities_panel')) }, { children: _jsx(Icon, { name: `move-${direction.end}-solid` }, void 0) }), void 0) }), void 0),
291
- utilities] }), void 0) }), void 0)),
292
- utilities && isMediumOrAbove && (_jsxs(Grid, Object.assign({ ref: (el) => {
293
- var _a;
234
+ }, item: { area: 'content' }, as: StyledCaseViewContent, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove, persistentUtility: Boolean(persistentUtility), style: {
235
+ transform: ['collapsing', 'expanding'].includes(summaryAnimationState)
236
+ ? `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
237
+ : undefined,
238
+ marginInlineStart: (summaryPanelCollapsed && isMediumOrAbove) ||
239
+ (persistentUtility && !isExtraLargeOrAbove)
240
+ ? '1rem'
241
+ : 0
242
+ }, children: [banners && _jsx("div", { children: banners }, void 0), stages && _jsx("div", { children: stages }, void 0), tasks && _jsx("div", { children: tasks }, void 0), (!isMediumOrAbove ||
243
+ (persistentUtility && !isExtraLargeOrAbove) ||
244
+ summaryPanelCollapsed) && (_jsx(StyledMobileTabs, { type: 'horizontal', tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId }, void 0)), _jsx("div", { ref: setTabContentEl, children: tabContent?.map(({ id, content }) => (_jsx(TabPanel, { currentTabId: currentTabId, tabId: id, children: content }, id))) }, void 0)] }, void 0), persistentUtility && isMediumOrAbove && (_jsx(Grid, { as: StyledPersistentUtility, item: { area: 'persistentUtility' }, children: persistentUtility.content }, void 0)), !isLargeOrAbove && (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesShown && isMediumOrAbove, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, children: [_jsx(Flex, { container: { justify: 'end' }, children: _jsx(Button, { variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t('collapse_utilities_panel'), children: _jsx(Icon, { name: `move-${direction.end}-solid` }, void 0) }, void 0) }, void 0), utilities] }, void 0) }, void 0)), utilities && isMediumOrAbove && (_jsxs(Grid, { ref: (el) => {
294
245
  if (el)
295
- ((_a = scrollStickOptions.current) === null || _a === void 0 ? void 0 : _a.elements).push(el);
246
+ (scrollStickOptions.current?.elements).push(el);
296
247
  }, as: StyledCaseViewUtilities, container: {
297
248
  cols: 'minmax(0, 1fr)',
298
249
  rowGap: 2
299
250
  }, item: {
300
251
  area: 'utilities'
301
- }, utilitiesShown: utilitiesShown && isLargeOrAbove }, { children: [_jsx(Flex, Object.assign({ container: { justify: utilitiesShown ? 'end' : 'center' } }, { children: _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t(utilitiesShown ? 'collapse_noun' : 'expand_noun', t('utilities_panel')) }, { children: _jsx(Icon, { name: utilitiesIcon }, void 0) }), void 0) }), void 0),
302
- _jsx(Flex, Object.assign({ container: utilitiesShown && isLargeOrAbove ? { direction: 'column', gap: 2 } : false, hidden: !utilitiesShown || !isLargeOrAbove }, { children: utilities }), void 0),
303
- (!utilitiesShown || (isMediumOrAbove && !isLargeOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems || [], onClick: toggleUtilities, onKeyDown: toggleUtilities }, void 0))] }), void 0))] }), void 0));
252
+ }, utilitiesShown: utilitiesShown && isLargeOrAbove, style: ['collapsing', 'expanding'].includes(summaryAnimationState)
253
+ ? {
254
+ transform: `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
255
+ }
256
+ : undefined, children: [_jsx(Flex, { container: { justify: utilitiesShown ? 'end' : 'center' }, children: _jsx(Button, { variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t(utilitiesShown ? 'collapse_utilities_panel' : 'expand_utilities_panel'), children: _jsx(Icon, { name: utilitiesIcon }, void 0) }, void 0) }, void 0), _jsx(Flex, { container: utilitiesShown && isLargeOrAbove ? { direction: 'column', gap: 2 } : undefined, hidden: !utilitiesShown || !isLargeOrAbove, children: utilities }, void 0), (!utilitiesShown || (isMediumOrAbove && !isLargeOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems || [], onClick: toggleUtilities, onKeyDown: toggleUtilities }, void 0))] }, void 0))] }, void 0));
304
257
  };
305
258
  export default CaseView;
306
259
  //# sourceMappingURL=CaseView.js.map