@pega/cosmos-react-work 4.0.0-dev.12.1 → 4.0.0-dev.13.0

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 (64) hide show
  1. package/lib/components/CasePreview/CasePreview.d.ts +7 -2
  2. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  3. package/lib/components/CasePreview/CasePreview.js +5 -3
  4. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  5. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  6. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  7. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  8. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  9. package/lib/components/CaseView/CaseHeader.d.ts.map +1 -1
  10. package/lib/components/CaseView/CaseHeader.js +4 -4
  11. package/lib/components/CaseView/CaseHeader.js.map +1 -1
  12. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -1
  13. package/lib/components/CaseView/CaseSummary.js +2 -2
  14. package/lib/components/CaseView/CaseSummary.js.map +1 -1
  15. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -1
  16. package/lib/components/CaseView/CaseSummaryFields.js +3 -1
  17. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
  18. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  19. package/lib/components/CaseView/CaseView.js +7 -4
  20. package/lib/components/CaseView/CaseView.js.map +1 -1
  21. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  22. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  23. package/lib/components/CaseView/CaseView.test-ids.js +16 -0
  24. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  25. package/lib/components/CaseView/CaseView.types.d.ts +8 -7
  26. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  27. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  28. package/lib/components/Details/Details.d.ts.map +1 -1
  29. package/lib/components/Details/Details.js +28 -8
  30. package/lib/components/Details/Details.js.map +1 -1
  31. package/lib/components/Details/Details.styles.d.ts +5 -3
  32. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  33. package/lib/components/Details/Details.styles.js +20 -95
  34. package/lib/components/Details/Details.styles.js.map +1 -1
  35. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  36. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +7 -10
  37. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  38. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +2 -1
  39. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  40. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +42 -40
  41. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  42. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +4 -0
  43. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -1
  44. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -1
  45. package/lib/components/Predictions/Predictions.d.ts.map +1 -1
  46. package/lib/components/Predictions/Predictions.js +7 -8
  47. package/lib/components/Predictions/Predictions.js.map +1 -1
  48. package/lib/components/Tasks/TaskList.d.ts +4 -4
  49. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  50. package/lib/components/Tasks/TaskList.js +9 -6
  51. package/lib/components/Tasks/TaskList.js.map +1 -1
  52. package/lib/components/Tasks/Tasks.d.ts +2 -2
  53. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  54. package/lib/components/Tasks/Tasks.js +5 -3
  55. package/lib/components/Tasks/Tasks.js.map +1 -1
  56. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  57. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  58. package/lib/components/Tasks/Tasks.test-ids.js +9 -0
  59. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  60. package/package.json +2 -2
  61. package/lib/components/Predictions/Predictions.styles.d.ts +0 -3
  62. package/lib/components/Predictions/Predictions.styles.d.ts.map +0 -1
  63. package/lib/components/Predictions/Predictions.styles.js +0 -24
  64. package/lib/components/Predictions/Predictions.styles.js.map +0 -1
@@ -1,7 +1,12 @@
1
1
  import { FunctionComponent, Ref } from 'react';
2
- import { ForwardProps, BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';
2
+ import { ForwardProps, BaseProps, TestIdProp, NoChildrenProp } from '@pega/cosmos-react-core';
3
3
  import { CaseViewProps } from '../CaseView';
4
- export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'caseLink' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, BaseProps {
4
+ import { CaseViewContextValue } from '../CaseView/CaseView.types';
5
+ export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, TestIdProp, BaseProps {
6
+ /**
7
+ * A set of props including an href that will be forwarded to the case preview's heading and subheading.
8
+ */
9
+ caseLink?: CaseViewContextValue['caseLink'];
5
10
  /** If true, the Case Preview will be visible. */
6
11
  open: boolean;
7
12
  /** Callback fired before Case Preview opens. */
@@ -1 +1 @@
1
- {"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAKJ,MAAM,OAAO,CAAC;AAIf,OAAO,EAQL,YAAY,EAMZ,SAAS,EACT,cAAc,EACf,MAAM,yBAAyB,CAAC;AAGjC,OAAiB,EACf,aAAa,EAKd,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,UAAU,GACV,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,uBAAuB,CAC1B,EACD,cAAc,EACd,SAAS;IACX,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAuED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAiGnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAKJ,MAAM,OAAO,CAAC;AAIf,OAAO,EAQL,YAAY,EAMZ,SAAS,EACT,UAAU,EACV,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAGjC,OAAiB,EACf,aAAa,EAKd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,uBAAuB,CAC1B,EACD,cAAc,EACd,UAAU,EACV,SAAS;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAuED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAsGnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useCallback, useEffect, useContext } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import { readableColor } from 'polished';
5
- import { Drawer, Icon, registerIcon, Button, Flex, tryCatch, defaultThemeProp, useBreakpoint, useElement, useDirection, useI18n, AppShellContext } from '@pega/cosmos-react-core';
5
+ import { Drawer, Icon, registerIcon, Button, Flex, tryCatch, defaultThemeProp, useBreakpoint, useElement, useDirection, useI18n, AppShellContext, useTestIds } from '@pega/cosmos-react-core';
6
6
  import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
7
7
  import CaseView, { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledSummaryRegion } from '../CaseView';
8
+ import { getCasePreviewTestIds } from './CasePreview.test-ids';
8
9
  registerIcon(timesIcon);
9
10
  const StyledPreviewHeader = styled.div(({ theme }) => {
10
11
  return css `
@@ -60,7 +61,8 @@ const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {
60
61
  });
61
62
  StyledPreviewDrawer.defaultProps = defaultThemeProp;
62
63
  const CasePreview = forwardRef((props, ref) => {
63
- const { open: openProp, caseId, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, ...restProps } = props;
64
+ const { testId, open: openProp, caseId, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, ...restProps } = props;
65
+ const testIds = useTestIds(testId, getCasePreviewTestIds);
64
66
  const t = useI18n();
65
67
  const { previewTriggerRef } = useContext(AppShellContext);
66
68
  const [closeButtonEl, setCloseButtonEl] = useElement();
@@ -79,7 +81,7 @@ const CasePreview = forwardRef((props, ref) => {
79
81
  closeButtonEl.focus();
80
82
  }
81
83
  }, [openProp, closeButtonEl]);
82
- return (_jsxs(Drawer, { ...restProps, as: StyledPreviewDrawer, role: 'complementary', forwardedAs: Flex, container: { direction: 'column' }, ref: ref, open: open && isSmallOrAbove, position: 'fixed', placement: direction.end, "aria-label": t('preview_of_noun', [heading]), shadow: true, nullWhenClosed: true, children: [_jsx(StyledPreviewActions, { children: _jsx(Button, { variant: 'simple', icon: true, onClick: closePreview, ref: setCloseButtonEl, label: t('close_preview'), children: _jsx(Icon, { name: 'times' }) }) }), _jsx(CaseView, { caseId: caseId, parentCases: parentCases, heading: heading, subheading: subheading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, summaryFields: summaryFields, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners, onEdit: onEdit, isPreview: true })] }));
84
+ return (_jsxs(Drawer, { "data-testid": testIds.root, ...restProps, as: StyledPreviewDrawer, role: 'complementary', forwardedAs: Flex, container: { direction: 'column' }, ref: ref, open: open && isSmallOrAbove, position: 'fixed', placement: direction.end, "aria-label": t('preview_of_noun', [heading]), shadow: true, nullWhenClosed: true, children: [_jsx(StyledPreviewActions, { children: _jsx(Button, { "data-testid": testIds.close, variant: 'simple', icon: true, onClick: closePreview, ref: setCloseButtonEl, label: t('close_preview'), children: _jsx(Icon, { name: 'times' }) }) }), _jsx(CaseView, { caseId: caseId, parentCases: parentCases, heading: heading, subheading: subheading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, summaryFields: summaryFields, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners, onEdit: onEdit, isPreview: true })] }));
83
85
  });
84
86
  export default CasePreview;
85
87
  //# sourceMappingURL=CasePreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAIV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAEhB,aAAa,EACb,UAAU,E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AE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,SACT,IACK,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useContext\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Drawer,\n Icon,\n registerIcon,\n Button,\n Flex,\n tryCatch,\n defaultThemeProp,\n ForwardProps,\n useBreakpoint,\n useElement,\n useDirection,\n useI18n,\n AppShellContext,\n BaseProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\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 | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n >,\n NoChildrenProp,\n BaseProps {\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** Callback fired before Case Preview opens. */\n onBeforeOpen?: () => void;\n /** Callback fired after Case Preview opens. */\n onAfterOpen?: () => void;\n /** Callback fired before Case Preview closes. */\n onBeforeClose?: () => void;\n /** Callback fired after Case Preview closes. */\n onAfterClose?: () => void;\n /** Callback fired when a click action occurs outside of the Case Preview. */\n onOuterClick?: () => void;\n /** Reference to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledPreviewHeader = styled.div(({ theme }) => {\n return css`\n z-index: ${theme.base['z-index'].drawer};\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledPreviewHeader.defaultProps = defaultThemeProp;\n\nconst StyledPreviewActions = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'brand-primary': brandPrimary }\n }\n }\n }) => {\n const buttonColor = tryCatch(() => readableColor(brandPrimary));\n\n return css`\n background-color: ${brandPrimary};\n padding: ${spacing} calc(2 * ${spacing}) 0;\n\n button {\n color: ${buttonColor};\n }\n `;\n }\n);\n\nStyledPreviewActions.defaultProps = defaultThemeProp;\n\nconst StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {\n return css`\n height: calc(100vh - var(--appshell-offset, 0rem));\n top: var(--appshell-offset, 0);\n z-index: calc(${theme.base['z-index'].drawer} + 500);\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n\n @media (pointer: coarse) {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});\n }\n\n ${StyledSummaryRegion} {\n position: relative;\n top: 0;\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n margin-bottom: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n margin-bottom: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});\n }\n\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledPreviewDrawer.defaultProps = defaultThemeProp;\n\nconst CasePreview: FunctionComponent<CasePreviewProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) => {\n const {\n open: openProp,\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n ...restProps\n } = props;\n const t = useI18n();\n const { previewTriggerRef } = useContext(AppShellContext);\n const [closeButtonEl, setCloseButtonEl] = useElement<HTMLButtonElement>();\n const isSmallOrAbove = useBreakpoint('sm');\n const [open, setOpen] = useState(openProp);\n const direction = useDirection();\n\n const closePreview = useCallback(() => {\n setOpen(false);\n previewTriggerRef.current?.focus();\n }, []);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (openProp && closeButtonEl) {\n closeButtonEl.focus();\n }\n }, [openProp, closeButtonEl]);\n\n return (\n <Drawer\n {...restProps}\n as={StyledPreviewDrawer}\n role='complementary'\n forwardedAs={Flex}\n container={{ direction: 'column' }}\n ref={ref}\n open={open && isSmallOrAbove}\n position='fixed'\n placement={direction.end}\n aria-label={t('preview_of_noun', [heading])}\n shadow\n nullWhenClosed\n >\n <StyledPreviewActions>\n <Button\n variant='simple'\n icon\n onClick={closePreview}\n ref={setCloseButtonEl}\n label={t('close_preview')}\n >\n <Icon name='times' />\n </Button>\n </StyledPreviewActions>\n\n <CaseView\n caseId={caseId}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summaryFields={summaryFields}\n tabs={tabs}\n stages={stages}\n tasks={tasks}\n tabContent={tabContent}\n utilities={utilities}\n utilitiesSummaryItems={utilitiesSummaryItems}\n actions={actions}\n banners={banners}\n onEdit={onEdit}\n isPreview\n />\n </Drawer>\n );\n }\n);\n\nexport default CasePreview;\n"]}
1
+ {"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.t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EAAE,SAAS,CAAC,GAAG,gBACZ,CAAC,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC,EAC3C,MAAM,QACN,cAAc,mBAEd,KAAC,oBAAoB,cACnB,KAAC,MAAM,mBACQ,OAAO,CAAC,KAAK,EAC1B,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC,YAEzB,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,GACY,EAEvB,KAAC,QAAQ,IACP,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,SACT,IACK,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect,\n useContext\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Drawer,\n Icon,\n registerIcon,\n Button,\n Flex,\n tryCatch,\n defaultThemeProp,\n ForwardProps,\n useBreakpoint,\n useElement,\n useDirection,\n useI18n,\n AppShellContext,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n useTestIds\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\nimport { CaseViewContextValue } from '../CaseView/CaseView.types';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n >,\n NoChildrenProp,\n TestIdProp,\n BaseProps {\n /**\n * A set of props including an href that will be forwarded to the case preview's heading and subheading.\n */\n caseLink?: CaseViewContextValue['caseLink'];\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** Callback fired before Case Preview opens. */\n onBeforeOpen?: () => void;\n /** Callback fired after Case Preview opens. */\n onAfterOpen?: () => void;\n /** Callback fired before Case Preview closes. */\n onBeforeClose?: () => void;\n /** Callback fired after Case Preview closes. */\n onAfterClose?: () => void;\n /** Callback fired when a click action occurs outside of the Case Preview. */\n onOuterClick?: () => void;\n /** Reference to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledPreviewHeader = styled.div(({ theme }) => {\n return css`\n z-index: ${theme.base['z-index'].drawer};\n background-color: ${theme.base.palette['primary-background']};\n `;\n});\n\nStyledPreviewHeader.defaultProps = defaultThemeProp;\n\nconst StyledPreviewActions = styled.div(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'brand-primary': brandPrimary }\n }\n }\n }) => {\n const buttonColor = tryCatch(() => readableColor(brandPrimary));\n\n return css`\n background-color: ${brandPrimary};\n padding: ${spacing} calc(2 * ${spacing}) 0;\n\n button {\n color: ${buttonColor};\n }\n `;\n }\n);\n\nStyledPreviewActions.defaultProps = defaultThemeProp;\n\nconst StyledPreviewDrawer = styled(StyledCaseDrawer)(({ theme }) => {\n return css`\n height: calc(100vh - var(--appshell-offset, 0rem));\n top: var(--appshell-offset, 0);\n z-index: calc(${theme.base['z-index'].drawer} + 500);\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n\n @media (pointer: coarse) {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});\n }\n\n ${StyledSummaryRegion} {\n position: relative;\n top: 0;\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n margin-bottom: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n margin-bottom: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});\n }\n\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledPreviewDrawer.defaultProps = defaultThemeProp;\n\nconst CasePreview: FunctionComponent<CasePreviewProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) => {\n const {\n testId,\n open: openProp,\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const t = useI18n();\n const { previewTriggerRef } = useContext(AppShellContext);\n const [closeButtonEl, setCloseButtonEl] = useElement<HTMLButtonElement>();\n const isSmallOrAbove = useBreakpoint('sm');\n const [open, setOpen] = useState(openProp);\n const direction = useDirection();\n\n const closePreview = useCallback(() => {\n setOpen(false);\n previewTriggerRef.current?.focus();\n }, []);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (openProp && closeButtonEl) {\n closeButtonEl.focus();\n }\n }, [openProp, closeButtonEl]);\n\n return (\n <Drawer\n data-testid={testIds.root}\n {...restProps}\n as={StyledPreviewDrawer}\n role='complementary'\n forwardedAs={Flex}\n container={{ direction: 'column' }}\n ref={ref}\n open={open && isSmallOrAbove}\n position='fixed'\n placement={direction.end}\n aria-label={t('preview_of_noun', [heading])}\n shadow\n nullWhenClosed\n >\n <StyledPreviewActions>\n <Button\n data-testid={testIds.close}\n variant='simple'\n icon\n onClick={closePreview}\n ref={setCloseButtonEl}\n label={t('close_preview')}\n >\n <Icon name='times' />\n </Button>\n </StyledPreviewActions>\n\n <CaseView\n caseId={caseId}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summaryFields={summaryFields}\n tabs={tabs}\n stages={stages}\n tasks={tasks}\n tabContent={tabContent}\n utilities={utilities}\n utilitiesSummaryItems={utilitiesSummaryItems}\n actions={actions}\n banners={banners}\n onEdit={onEdit}\n isPreview\n />\n </Drawer>\n );\n }\n);\n\nexport default CasePreview;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getCasePreviewTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["close"]>;
2
+ //# sourceMappingURL=CasePreview.test-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CasePreview.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,0GAAoD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { createTestIds } from '@pega/cosmos-react-core';
2
+ export const getCasePreviewTestIds = createTestIds('case-preview', ['close']);
3
+ //# sourceMappingURL=CasePreview.test-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CasePreview.test-ids.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,cAAc,EAAE,CAAC,OAAO,CAAU,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getCasePreviewTestIds = createTestIds('case-preview', ['close'] as const);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AA8B/C,QAAA,MAAM,UAAU,EAAE,EAsIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AA8B/C,QAAA,MAAM,UAAU,EAAE,EAmJjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -8,7 +8,7 @@ import { useCaseViewContext } from './CaseView.context';
8
8
  registerIcon(pencilIcon, moreIcon);
9
9
  const CaseHeader = () => {
10
10
  const t = useI18n();
11
- const { caseId, icon, heading, subheading, actions, caseLink, parentCases, onEdit, followed, onFollowedChange, promotedActions, summaryId, summaryExpanded, onToggleSummary, isPreview, aboveMD, persistentUtility } = useCaseViewContext();
11
+ const { testIds, caseId, icon, heading, subheading, actions, caseLink, parentCases, onEdit, followed, onFollowedChange, promotedActions, summaryId, summaryExpanded, onToggleSummary, isPreview, aboveMD, persistentUtility } = useCaseViewContext();
12
12
  const caseActions = actions
13
13
  ? actions.map(action => {
14
14
  return {
@@ -28,10 +28,10 @@ const CaseHeader = () => {
28
28
  }, 0);
29
29
  }
30
30
  }, [summaryExpanded]);
31
- return (_jsxs("div", { children: [_jsxs(Flex, { as: StyledCaseHeader, container: { gap: 2, alignItems: 'start' }, children: [!isPreview && aboveMD && onToggleSummary && !persistentUtility && (_jsx(StyledExpandCollapseButton, { ref: toggleButtonRef, onClick: onToggleSummary, label: t(summaryExpanded ? 'collapse_summary' : 'expand_summary'), icon: true, compact: true, "aria-expanded": summaryExpanded ? 'true' : 'false', "aria-controls": summaryId, children: _jsx(Icon, { name: 'arrow-micro-left' }) })), icon && (_jsx(Flex, { container: true, item: { shrink: 0 }, as: StyledCaseIconWrap, children: icon })), _jsxs(Flex, { as: StyledCaseHeaderText, container: { direction: 'column' }, item: { grow: 1, shrink: 0, basis: '0' }, children: [_jsx(Text, { variant: 'h1', children: caseLink ? _jsx(Link, { ...caseLink, children: heading }) : heading }), subheading && (!parentCases || subheading !== caseId) && (_jsx(StyledSubheading, { children: subheading })), parentCases && (_jsx(Breadcrumbs, { forwardedAs: 'p', path: [
31
+ return (_jsxs("div", { children: [_jsxs(Flex, { as: StyledCaseHeader, container: { gap: 2, alignItems: 'start' }, children: [!isPreview && aboveMD && onToggleSummary && !persistentUtility && (_jsx(StyledExpandCollapseButton, { ref: toggleButtonRef, onClick: onToggleSummary, label: t(summaryExpanded ? 'collapse_summary' : 'expand_summary'), icon: true, compact: true, "aria-expanded": summaryExpanded ? 'true' : 'false', "aria-controls": summaryId, children: _jsx(Icon, { name: 'arrow-micro-left' }) })), icon && (_jsx(Flex, { container: true, item: { shrink: 0 }, as: StyledCaseIconWrap, children: icon })), _jsxs(Flex, { as: StyledCaseHeaderText, container: { direction: 'column' }, item: { grow: 1, shrink: 0, basis: '0' }, children: [_jsx(Text, { "data-testid": testIds.heading, variant: 'h1', children: caseLink ? _jsx(Link, { ...caseLink, children: heading }) : heading }), subheading && (!parentCases || subheading !== caseId) && (_jsx(StyledSubheading, { "data-testid": testIds.subheading, children: subheading })), parentCases && (_jsx(Breadcrumbs, { forwardedAs: 'p', path: [
32
32
  ...parentCases,
33
33
  { ...caseLink, id: caseId, primary: caseId, href: caseLink?.href }
34
- ] }))] }), _jsxs("div", { children: [onEdit && (_jsx(Button, { icon: true, variant: 'simple', onClick: onEdit, label: t('edit'), children: _jsx(Icon, { name: 'pencil' }) })), caseActions && (_jsx(MenuButton, { icon: 'more', iconOnly: true, variant: 'simple', text: t('actions'), menu: {
34
+ ] }))] }), _jsxs("div", { children: [onEdit && (_jsx(Button, { "data-testid": testIds.edit, icon: true, variant: 'simple', onClick: onEdit, label: t('edit'), children: _jsx(Icon, { name: 'pencil' }) })), caseActions && (_jsx(MenuButton, { "data-testid": testIds.actions, icon: 'more', iconOnly: true, variant: 'simple', text: t('actions'), menu: {
35
35
  items: followed !== undefined
36
36
  ? [
37
37
  {
@@ -43,7 +43,7 @@ const CaseHeader = () => {
43
43
  ]
44
44
  : caseActions,
45
45
  scrollAt: 20
46
- } }))] })] }), promotedActions && promotedActions.length > 0 ? (_jsx(Flex, { as: StyledPromotedActions, container: { wrap: 'wrap', gap: 1, pad: [1, 2] }, children: promotedActions.map(promotedAction => (_jsx(Button, { variant: 'secondary', onClick: (e) => promotedAction.onClick?.(promotedAction.id, e), children: promotedAction.text }))) })) : null] }));
46
+ } }))] })] }), promotedActions && promotedActions.length > 0 ? (_jsx(Flex, { "data-testid": testIds.promotedActions, as: StyledPromotedActions, container: { wrap: 'wrap', gap: 1, pad: [1, 2] }, children: promotedActions.map(({ id, text, onClick }) => (_jsx(Button, { variant: 'secondary', onClick: (e) => onClick?.(id, e), children: text }, text))) })) : null] }));
47
47
  };
48
48
  export default CaseHeader;
49
49
  //# sourceMappingURL=CaseHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EACL,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EAEJ,MAAM,EACN,UAAU,EACV,OAAO,EACP,q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,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YAC9E,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CACrC,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAC5C,cAAc,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC,YAG/C,cAAc,CAAC,IAAI,GACb,CACV,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, MouseEvent, useRef } from 'react';\n\nimport {\n Breadcrumbs,\n Flex,\n Icon,\n registerIcon,\n Text,\n Link,\n MenuItemProps,\n Button,\n MenuButton,\n useI18n,\n useAfterInitialEffect\n} from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseIconWrap,\n StyledCaseHeaderText,\n StyledPromotedActions,\n StyledExpandCollapseButton,\n StyledSubheading\n} from './CaseView.styles';\nimport { useCaseViewContext } from './CaseView.context';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n\n const {\n caseId,\n icon,\n heading,\n subheading,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryId,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveMD,\n persistentUtility\n } = useCaseViewContext();\n\n const caseActions: MenuItemProps[] | undefined = actions\n ? actions.map(action => {\n return {\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n })\n : undefined;\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n return (\n <div>\n <Flex as={StyledCaseHeader} container={{ gap: 2, alignItems: 'start' }}>\n {!isPreview && aboveMD && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n aria-expanded={summaryExpanded ? 'true' : 'false'}\n aria-controls={summaryId}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseButton>\n )}\n\n {icon && (\n <Flex container item={{ shrink: 0 }} as={StyledCaseIconWrap}>\n {icon}\n </Flex>\n )}\n <Flex\n as={StyledCaseHeaderText}\n container={{ direction: 'column' }}\n item={{ grow: 1, shrink: 0, basis: '0' }}\n >\n <Text variant='h1'>{caseLink ? <Link {...caseLink}>{heading}</Link> : heading}</Text>\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading>{subheading}</StyledSubheading>\n )}\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n { ...caseLink, id: caseId, primary: caseId, href: caseLink?.href }\n ]}\n />\n )}\n </Flex>\n <div>\n {onEdit && (\n <Button icon variant='simple' onClick={onEdit} label={t('edit')}>\n <Icon name='pencil' />\n </Button>\n )}\n\n {caseActions && (\n <MenuButton\n icon='more'\n iconOnly\n variant='simple'\n text={t('actions')}\n menu={{\n items:\n followed !== undefined\n ? [\n {\n id: 'follow',\n primary: followed ? t('unfollow') : t('follow'),\n onClick: () => onFollowedChange?.(!followed)\n },\n ...caseActions\n ]\n : caseActions,\n scrollAt: 20\n }}\n />\n )}\n </div>\n </Flex>\n\n {promotedActions && promotedActions.length > 0 ? (\n <Flex as={StyledPromotedActions} container={{ wrap: 'wrap', gap: 1, pad: [1, 2] }}>\n {promotedActions.map(promotedAction => (\n <Button\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n >\n {promotedAction.text}\n </Button>\n ))}\n </Flex>\n ) : null}\n </div>\n );\n};\n\nexport default CaseHeader;\n"]}
1
+ {"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EACL,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EAEJ,MAAM,EACN,UAAU,EACV,OAAO,EACP,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEnC,MAAM,UAAU,GAAO,GAAG,EAAE;IAC1B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,eAAe,EACf,eAAe,EACf,SAAS,EACT,OAAO,EACP,iBAAiB,EAClB,GAAG,kBAAkB,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAgC,OAAO;QACtD,CAAC,CAAC,OAAO,CAAC,GAAG,CA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AAC,SAAS,CAAC,EAClB,IAAI,EAAE;oCACJ,KAAK,EACH,QAAQ,KAAK,SAAS;wCACpB,CAAC,CAAC;4CACE;gDACE,EAAE,EAAE,QAAQ;gDACZ,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;gDAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC;6CAC7C;4CACD,GAAG,WAAW;yCACf;wCACH,CAAC,CAAC,WAAW;oCACjB,QAAQ,EAAE,EAAE;iCACb,GACD,CACH,IACG,IACD,EAEN,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC/C,KAAC,IAAI,mBACU,OAAO,CAAC,eAAe,EACpC,EAAE,EAAE,qBAAqB,EACzB,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YAE/C,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC9C,KAAC,MAAM,IAEL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,YAE9D,IAAI,IAJA,IAAI,CAKF,CACV,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, MouseEvent, useRef } from 'react';\n\nimport {\n Breadcrumbs,\n Flex,\n Icon,\n registerIcon,\n Text,\n Link,\n MenuItemProps,\n Button,\n MenuButton,\n useI18n,\n useAfterInitialEffect\n} from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseIconWrap,\n StyledCaseHeaderText,\n StyledPromotedActions,\n StyledExpandCollapseButton,\n StyledSubheading\n} from './CaseView.styles';\nimport { useCaseViewContext } from './CaseView.context';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n\n const {\n testIds,\n caseId,\n icon,\n heading,\n subheading,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryId,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveMD,\n persistentUtility\n } = useCaseViewContext();\n\n const caseActions: MenuItemProps[] | undefined = actions\n ? actions.map(action => {\n return {\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n })\n : undefined;\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n return (\n <div>\n <Flex as={StyledCaseHeader} container={{ gap: 2, alignItems: 'start' }}>\n {!isPreview && aboveMD && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n aria-expanded={summaryExpanded ? 'true' : 'false'}\n aria-controls={summaryId}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseButton>\n )}\n\n {icon && (\n <Flex container item={{ shrink: 0 }} as={StyledCaseIconWrap}>\n {icon}\n </Flex>\n )}\n <Flex\n as={StyledCaseHeaderText}\n container={{ direction: 'column' }}\n item={{ grow: 1, shrink: 0, basis: '0' }}\n >\n <Text data-testid={testIds.heading} variant='h1'>\n {caseLink ? <Link {...caseLink}>{heading}</Link> : heading}\n </Text>\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading data-testid={testIds.subheading}>{subheading}</StyledSubheading>\n )}\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n { ...caseLink, id: caseId, primary: caseId, href: caseLink?.href }\n ]}\n />\n )}\n </Flex>\n <div>\n {onEdit && (\n <Button\n data-testid={testIds.edit}\n icon\n variant='simple'\n onClick={onEdit}\n label={t('edit')}\n >\n <Icon name='pencil' />\n </Button>\n )}\n\n {caseActions && (\n <MenuButton\n data-testid={testIds.actions}\n icon='more'\n iconOnly\n variant='simple'\n text={t('actions')}\n menu={{\n items:\n followed !== undefined\n ? [\n {\n id: 'follow',\n primary: followed ? t('unfollow') : t('follow'),\n onClick: () => onFollowedChange?.(!followed)\n },\n ...caseActions\n ]\n : caseActions,\n scrollAt: 20\n }}\n />\n )}\n </div>\n </Flex>\n\n {promotedActions && promotedActions.length > 0 ? (\n <Flex\n data-testid={testIds.promotedActions}\n as={StyledPromotedActions}\n container={{ wrap: 'wrap', gap: 1, pad: [1, 2] }}\n >\n {promotedActions.map(({ id, text, onClick }) => (\n <Button\n key={text}\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick?.(id, e)}\n >\n {text}\n </Button>\n ))}\n </Flex>\n ) : null}\n </div>\n );\n};\n\nexport default CaseHeader;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAW3B,QAAA,MAAM,WAAW,EAAE,EAuBlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAW3B,QAAA,MAAM,WAAW,EAAE,EAwBlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -6,8 +6,8 @@ import { StyledCaseSummary, StyledCaseSummaryInfo } from './CaseView.styles';
6
6
  import { useCaseViewContext } from './CaseView.context';
7
7
  registerIcon(arrowMicroLeftIcon);
8
8
  const CaseSummary = () => {
9
- const { summary, summaryExpanded, tabs, aboveMD, isPreview } = useCaseViewContext();
10
- return (_jsxs(Flex, { as: StyledCaseSummary, container: { direction: 'column' }, item: { shrink: 0 }, children: [_jsx(CaseHeader, {}), aboveMD && !isPreview && summaryExpanded && (summary || tabs.items.length > 1) && (_jsxs(StyledCaseSummaryInfo, { children: [summary, tabs.items.length > 1 && (_jsx(Tabs, { type: 'vertical', tabs: tabs.items, onTabClick: tabs.onClick, currentTabId: tabs.currentTabId }))] }))] }));
9
+ const { testIds, summary, summaryExpanded, tabs, aboveMD, isPreview } = useCaseViewContext();
10
+ return (_jsxs(Flex, { as: StyledCaseSummary, container: { direction: 'column' }, item: { shrink: 0 }, children: [_jsx(CaseHeader, {}), aboveMD && !isPreview && summaryExpanded && (summary || tabs.items.length > 1) && (_jsxs(StyledCaseSummaryInfo, { children: [summary, tabs.items.length > 1 && (_jsx(Tabs, { "data-testid": testIds.tabs, type: 'vertical', tabs: tabs.items, onTabClick: tabs.onClick, currentTabId: tabs.currentTabId }))] }))] }));
11
11
  };
12
12
  export default CaseSummary;
13
13
  //# sourceMappingURL=CaseSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAE9G,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAEjC,MAAM,WAAW,GAAO,GAAG,EAAE;IAC3B,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAEpF,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAClF,KAAC,UAAU,KAAG,EAEb,OAAO,IAAI,CAAC,SAAS,IAAI,eAAe,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACjF,MAAC,qBAAqB,eACnB,OAAO,EAEP,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,KAAC,IAAI,IACH,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACH,IACqB,CACzB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FC } from 'react';\n\nimport { Flex, Tabs, registerIcon } from '@pega/cosmos-react-core';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport CaseHeader from './CaseHeader';\nimport { StyledCaseSummary, StyledCaseSummaryInfo } from './CaseView.styles';\nimport { useCaseViewContext } from './CaseView.context';\n\nregisterIcon(arrowMicroLeftIcon);\n\nconst CaseSummary: FC = () => {\n const { summary, summaryExpanded, tabs, aboveMD, isPreview } = useCaseViewContext();\n\n return (\n <Flex as={StyledCaseSummary} container={{ direction: 'column' }} item={{ shrink: 0 }}>\n <CaseHeader />\n\n {aboveMD && !isPreview && summaryExpanded && (summary || tabs.items.length > 1) && (\n <StyledCaseSummaryInfo>\n {summary}\n\n {tabs.items.length > 1 && (\n <Tabs\n type='vertical'\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </StyledCaseSummaryInfo>\n )}\n </Flex>\n );\n};\n\nexport default CaseSummary;\n"]}
1
+ {"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAE9G,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAEjC,MAAM,WAAW,GAAO,GAAG,EAAE;IAC3B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE7F,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAClF,KAAC,UAAU,KAAG,EAEb,OAAO,IAAI,CAAC,SAAS,IAAI,eAAe,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACjF,MAAC,qBAAqB,eACnB,OAAO,EAEP,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,KAAC,IAAI,mBACU,OAAO,CAAC,IAAI,EACzB,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACH,IACqB,CACzB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FC } from 'react';\n\nimport { Flex, Tabs, registerIcon } from '@pega/cosmos-react-core';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport CaseHeader from './CaseHeader';\nimport { StyledCaseSummary, StyledCaseSummaryInfo } from './CaseView.styles';\nimport { useCaseViewContext } from './CaseView.context';\n\nregisterIcon(arrowMicroLeftIcon);\n\nconst CaseSummary: FC = () => {\n const { testIds, summary, summaryExpanded, tabs, aboveMD, isPreview } = useCaseViewContext();\n\n return (\n <Flex as={StyledCaseSummary} container={{ direction: 'column' }} item={{ shrink: 0 }}>\n <CaseHeader />\n\n {aboveMD && !isPreview && summaryExpanded && (summary || tabs.items.length > 1) && (\n <StyledCaseSummaryInfo>\n {summary}\n\n {tabs.items.length > 1 && (\n <Tabs\n data-testid={testIds.tabs}\n type='vertical'\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </StyledCaseSummaryInfo>\n )}\n </Flex>\n );\n};\n\nexport default CaseSummary;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummaryFields.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAmB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAQ,YAAY,EAAW,MAAM,yBAAyB,CAAC;AAOtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,GAAG,YAAY,CAwBhE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"CaseSummaryFields.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAmB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAQ,YAAY,EAAW,MAAM,yBAAyB,CAAC;AAOtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,GAAG,YAAY,CA6BhE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Grid, useI18n } from '@pega/cosmos-react-core';
3
3
  import { StyledCaseSummaryFields, StyledSummaryPrimaryList, StyledSummarySecondaryList } from './CaseView.styles';
4
+ import { useCaseViewContext } from './CaseView.context';
4
5
  const CaseSummaryFields = ({ primary, secondary }) => {
5
6
  const t = useI18n();
6
- return (_jsxs(Grid, { as: StyledCaseSummaryFields, container: { rowGap: 2 }, children: [primary && (_jsx(StyledSummaryPrimaryList, { variant: 'stacked', fields: primary, "aria-label": t('primary_summary_fields') })), secondary && (_jsx(StyledSummarySecondaryList, { variant: 'inline', fields: secondary, "aria-label": t('summary_fields') }))] }));
7
+ const { testIds } = useCaseViewContext();
8
+ return (_jsxs(Grid, { "data-testid": testIds.summaryFields, as: StyledCaseSummaryFields, container: { rowGap: 2 }, children: [primary && (_jsx(StyledSummaryPrimaryList, { variant: 'stacked', fields: primary, "aria-label": t('primary_summary_fields') })), secondary && (_jsx(StyledSummarySecondaryList, { variant: 'inline', fields: secondary, "aria-label": t('summary_fields') }))] }));
7
9
  };
8
10
  export default CaseSummaryFields;
9
11
  //# sourceMappingURL=CaseSummaryFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAG3B,MAAM,iBAAiB,GAA8C,CAAC,EACpE,OAAO,EACP,SAAS,EAC+B,EAAE,EAAE;IAC5C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,uBAAuB,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aACxD,OAAO,IAAI,CACV,KAAC,wBAAwB,IACvB,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,OAAO,gBACH,CAAC,CAAC,wBAAwB,CAAC,GACvC,CACH,EACA,SAAS,IAAI,CACZ,KAAC,0BAA0B,IACzB,OAAO,EAAC,QAAQ,EAChB,MAAM,EAAE,SAAS,gBACL,CAAC,CAAC,gBAAgB,CAAC,GAC/B,CACH,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FC, PropsWithoutRef } from 'react';\n\nimport { Grid, ForwardProps, useI18n } from '@pega/cosmos-react-core';\n\nimport {\n StyledCaseSummaryFields,\n StyledSummaryPrimaryList,\n StyledSummarySecondaryList\n} from './CaseView.styles';\nimport { CaseSummaryFieldsProps } from './CaseView.types';\n\nconst CaseSummaryFields: FC<CaseSummaryFieldsProps & ForwardProps> = ({\n primary,\n secondary\n}: PropsWithoutRef<CaseSummaryFieldsProps>) => {\n const t = useI18n();\n\n return (\n <Grid as={StyledCaseSummaryFields} container={{ rowGap: 2 }}>\n {primary && (\n <StyledSummaryPrimaryList\n variant='stacked'\n fields={primary}\n aria-label={t('primary_summary_fields')}\n />\n )}\n {secondary && (\n <StyledSummarySecondaryList\n variant='inline'\n fields={secondary}\n aria-label={t('summary_fields')}\n />\n )}\n </Grid>\n );\n};\n\nexport default CaseSummaryFields;\n"]}
1
+ {"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,iBAAiB,GAA8C,CAAC,EACpE,OAAO,EACP,SAAS,EAC+B,EAAE,EAAE;IAC5C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAEzC,OAAO,CACL,MAAC,IAAI,mBACU,OAAO,CAAC,aAAa,EAClC,EAAE,EAAE,uBAAuB,EAC3B,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAEvB,OAAO,IAAI,CACV,KAAC,wBAAwB,IACvB,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,OAAO,gBACH,CAAC,CAAC,wBAAwB,CAAC,GACvC,CACH,EACA,SAAS,IAAI,CACZ,KAAC,0BAA0B,IACzB,OAAO,EAAC,QAAQ,EAChB,MAAM,EAAE,SAAS,gBACL,CAAC,CAAC,gBAAgB,CAAC,GAC/B,CACH,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FC, PropsWithoutRef } from 'react';\n\nimport { Grid, ForwardProps, useI18n } from '@pega/cosmos-react-core';\n\nimport {\n StyledCaseSummaryFields,\n StyledSummaryPrimaryList,\n StyledSummarySecondaryList\n} from './CaseView.styles';\nimport { CaseSummaryFieldsProps } from './CaseView.types';\nimport { useCaseViewContext } from './CaseView.context';\n\nconst CaseSummaryFields: FC<CaseSummaryFieldsProps & ForwardProps> = ({\n primary,\n secondary\n}: PropsWithoutRef<CaseSummaryFieldsProps>) => {\n const t = useI18n();\n const { testIds } = useCaseViewContext();\n\n return (\n <Grid\n data-testid={testIds.summaryFields}\n as={StyledCaseSummaryFields}\n container={{ rowGap: 2 }}\n >\n {primary && (\n <StyledSummaryPrimaryList\n variant='stacked'\n fields={primary}\n aria-label={t('primary_summary_fields')}\n />\n )}\n {secondary && (\n <StyledSummarySecondaryList\n variant='inline'\n fields={secondary}\n aria-label={t('summary_fields')}\n />\n )}\n </Grid>\n );\n};\n\nexport default CaseSummaryFields;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAyD,MAAM,OAAO,CAAC;AAElF,OAAO,EAUL,YAAY,EAWb,MAAM,yBAAyB,CAAC;AAkBjC,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMvE,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CA+e9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAyD,MAAM,OAAO,CAAC;AAElF,OAAO,EAUL,YAAY,EAYb,MAAM,yBAAyB,CAAC;AAkBjC,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOvE,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAggB9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useLayoutEffect, useState } from 'react';
3
- import { Button, Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, Tabs, useAfterInitialEffect, windowIsAvailable, focusHeadingOrContainer, useConfiguration } from '@pega/cosmos-react-core';
3
+ import { Button, Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, Tabs, useAfterInitialEffect, windowIsAvailable, focusHeadingOrContainer, useConfiguration, useTestIds } from '@pega/cosmos-react-core';
4
4
  import * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';
5
5
  import * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';
6
6
  import CaseSummary from './CaseSummary';
@@ -8,8 +8,9 @@ import UtilitiesSummary from './UtilitiesSummary';
8
8
  import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledWorkArea, StyledPersistentUtility, StyledSummary, StyledSummaryTabContent, StyledUtilities, StyledUtilToggle } from './CaseView.styles';
9
9
  import CaseViewContext from './CaseView.context';
10
10
  import CaseSummaryFields from './CaseSummaryFields';
11
+ import { getCaseViewTestIds } from './CaseView.test-ids';
11
12
  registerIcon(moveRightSolidIcon, moveLeftSolidIcon);
12
- const CaseView = ({
13
+ const CaseView = ({ testId,
13
14
  // Case data mostly visually related to the case header
14
15
  caseId, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, onEdit, actions, promotedActions,
15
16
  // Summary content and state props
@@ -22,6 +23,7 @@ banners, stages, tasks, tabContent: tabContentProp = [],
22
23
  utilities, utilitiesSummaryItems, utilitiesExpanded: utilitiesExpandedProp = true, onToggleUtilities,
23
24
  // Etc...
24
25
  persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
26
+ const testIds = useTestIds(testId, getCaseViewTestIds);
25
27
  const summary = useMemo(() => {
26
28
  return _jsx(CaseSummaryFields, { ...summaryFields });
27
29
  }, [summaryFields]);
@@ -253,6 +255,7 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
253
255
  // CaseView context value
254
256
  // Choosing not to memo for now due to extent of deps and how often they change. Optimize as needed.
255
257
  const ctxValue = {
258
+ testIds,
256
259
  caseId,
257
260
  heading,
258
261
  subheading,
@@ -282,7 +285,7 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
282
285
  aboveXL: xlOrAbove
283
286
  };
284
287
  // Here we go...
285
- return (_jsxs(_Fragment, { children: [_jsx(CaseViewContext.Provider, { value: ctxValue, children: _jsxs(Grid, { as: StyledCaseView, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'case-view' }, ...restProps, children: [_jsx(Grid
288
+ return (_jsxs(_Fragment, { children: [_jsx(CaseViewContext.Provider, { value: ctxValue, children: _jsxs(Grid, { "data-testid": testIds.root, ...restProps, as: StyledCaseView, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'case-view' }, children: [_jsx(Grid
286
289
  // Used for aria-controls on the toggle button
287
290
  , {
288
291
  // Used for aria-controls on the toggle button
@@ -290,7 +293,7 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
290
293
  direction: 'column',
291
294
  alignContent: 'start',
292
295
  rowGap: 2
293
- }, as: StyledWorkArea, persistentUtility: Boolean(persistentUtility), children: [banners && _jsx("div", { children: banners }), stages && _jsx("div", { children: stages }), tasks && _jsx("div", { children: tasks }), (!mdOrAbove || (persistentUtility && !xlOrAbove) || !summaryExpanded) && (_jsx(Tabs, { tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId })), _jsx("div", { ref: setTabContentEl, children: tabContent?.map(({ id, content }) => (_jsx(TabPanel, { currentTabId: currentTabId, tabId: id, children: content }, id))) })] }), persistentUtility && mdOrAbove && (_jsx(Grid, { as: StyledPersistentUtility, item: { area: 'persistentUtility' }, children: persistentUtility.content })), utilities && mdOrAbove && !lgOrAbove && utilitiesExpanded && (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesExpanded, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, id: utilitiesDrawerId, children: [_jsx(Flex, { container: { justify: 'end' }, children: _jsx(Button, { "aria-expanded": utilitiesExpanded ? 'true' : 'false', "aria-controls": utilitiesDrawerId, variant: 'simple', icon: true, onClick: onToggleUtilities, as: StyledUtilToggle, label: t('collapse_utilities_panel'), children: _jsx(Icon, { name: `move-${direction.end}-solid` }) }) }), utilities] }) })), utilities && mdOrAbove && (_jsxs(Grid, { ref: (el) => {
296
+ }, as: StyledWorkArea, persistentUtility: Boolean(persistentUtility), children: [banners && _jsx("div", { "data-testid": testIds.banners, children: banners }), stages && _jsx("div", { "data-testid": testIds.stages, children: stages }), tasks && _jsx("div", { "data-testid": testIds.tasks, children: tasks }), (!mdOrAbove || (persistentUtility && !xlOrAbove) || !summaryExpanded) && (_jsx(Tabs, { "data-testid": testIds.tabs, tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId })), _jsx("div", { ref: setTabContentEl, children: tabContent?.map(({ id, content }) => (_jsx(TabPanel, { "data-testid": currentTabId === id ? testIds.tabContent : undefined, currentTabId: currentTabId, tabId: id, children: content }, id))) })] }), persistentUtility && mdOrAbove && (_jsx(Grid, { as: StyledPersistentUtility, item: { area: 'persistentUtility' }, children: persistentUtility.content })), utilities && mdOrAbove && !lgOrAbove && utilitiesExpanded && (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesExpanded, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, id: utilitiesDrawerId, children: [_jsx(Flex, { container: { justify: 'end' }, children: _jsx(Button, { "aria-expanded": utilitiesExpanded ? 'true' : 'false', "aria-controls": utilitiesDrawerId, variant: 'simple', icon: true, onClick: onToggleUtilities, as: StyledUtilToggle, label: t('collapse_utilities_panel'), children: _jsx(Icon, { name: `move-${direction.end}-solid` }) }) }), utilities] }) })), utilities && mdOrAbove && (_jsxs(Grid, { "data-testid": testIds.utilities, ref: (el) => {
294
297
  if (el)
295
298
  (scrollStickOptions.current?.elements).push(el);
296
299
  }, as: StyledUtilities, container: {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,UAAU,EAEV,IAAI,EACJ,MAAM,EACN,OAAO,EACP,YAAY,EACZ,IAAI,EAEJ,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAC9G,OAAO,KAAK,iBAAiB,MAAM,wEAAwE,CAAC;AAE5G,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,YAAY,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;AAEpD,MAAM,QAAQ,GAAqC,CAAC;AAClD,uDAAuD;A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Content":["import { FC, useEffect, useMemo, useRef, useLayoutEffect, useState } from 'react';\n\nimport {\n Button,\n Flex,\n Grid,\n Icon,\n registerIcon,\n TabPanel,\n useBreakpoint,\n useScrollStick,\n useElement,\n ForwardProps,\n Card,\n Drawer,\n useI18n,\n useDirection,\n Tabs,\n TabsProps,\n useAfterInitialEffect,\n windowIsAvailable,\n focusHeadingOrContainer,\n useConfiguration\n} from '@pega/cosmos-react-core';\nimport { ScrollStickOptions } from '@pega/cosmos-react-core/lib/hooks/useScrollStick';\nimport * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';\nimport * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';\n\nimport CaseSummary from './CaseSummary';\nimport UtilitiesSummary from './UtilitiesSummary';\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCaseView,\n StyledWorkArea,\n StyledPersistentUtility,\n StyledSummary,\n StyledSummaryTabContent,\n StyledUtilities,\n StyledUtilToggle\n} from './CaseView.styles';\nimport { CaseViewContextValue, CaseViewProps } from './CaseView.types';\nimport CaseViewContext from './CaseView.context';\nimport CaseSummaryFields from './CaseSummaryFields';\n\nregisterIcon(moveRightSolidIcon, moveLeftSolidIcon);\n\nconst CaseView: FC<CaseViewProps & ForwardProps> = ({\n // Case data mostly visually related to the case header\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n onEdit,\n actions,\n promotedActions,\n\n // Summary content and state props\n summaryFields,\n summaryExpanded: summaryExpandedProp = true,\n onToggleSummary,\n\n // Case tabs\n tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick },\n\n // Workarea related content props\n banners,\n stages,\n tasks,\n tabContent: tabContentProp = [],\n\n // Utilities content and state props\n utilities,\n utilitiesSummaryItems,\n utilitiesExpanded: utilitiesExpandedProp = true,\n onToggleUtilities,\n\n // Etc...\n persistentUtility,\n intelligentGuidance,\n isPreview = false,\n ...restProps\n}: CaseViewProps) => {\n const summary = useMemo(() => {\n return <CaseSummaryFields {...summaryFields} />;\n }, [summaryFields]);\n\n // General util hooks\n const t = useI18n();\n const direction = useDirection();\n const { loadedRef } = useConfiguration();\n\n // Element refs\n const caseViewRef = useRef<HTMLDivElement>(null);\n const summaryRef = useRef<HTMLDivElement>(null);\n\n // Tab content\n const [tabContentEl, setTabContentEl] = useElement<HTMLElement>(null);\n\n // Breakpoint booleans\n const mdOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });\n const lgOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });\n const xlOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });\n\n // DOM ids\n const summaryTabId = `summary-${caseId}`;\n const utilitiesTabId = `utilities-${caseId}`;\n const persistentUtilityTabId = `persistent-utility-${caseId}`;\n const summaryId = `summary-${caseId}`;\n const utilitiesId = `utilities-${caseId}`;\n const utilitiesDrawerId = `utilities-drawer-${caseId}`;\n\n // Summary state handling\n let summaryExpanded = !isPreview && !!summaryExpandedProp;\n\n if (persistentUtility) {\n summaryExpanded = xlOrAbove;\n }\n\n // Focus heading on initial mount\n useEffect(() => {\n if (!caseViewRef.current) return;\n\n if (loadedRef.current) {\n focusHeadingOrContainer(caseViewRef.current, heading);\n } else {\n loadedRef.current = true;\n }\n }, [caseId]);\n\n // Utilities state handling\n\n // Used in coordination with a layoutEffect below to determine the utilities state on initial render.\n // Attempted with a ref but it did not work. Using state and enforcing a render in addition to the change render for lgOrAbove seems to fix...\n const [obeyUtilitiesExpandedProp, setObeyUtilitiesExpandedProp] = useState(lgOrAbove);\n\n // Allow the utilitiesExpandedProp to drive the utilities' state after the initial render\n useLayoutEffect(() => {\n if (lgOrAbove) setObeyUtilitiesExpandedProp(true);\n }, [lgOrAbove]);\n\n // Tracks whether a resize forced the onToggleUtilities to close the utilities when it's a drawer\n const utilitiesToggledByResize = useRef(false);\n\n // If the initial render is within the MD size, where the utility drawer renders, it must begin collapsed\n const utilitiesExpanded = obeyUtilitiesExpandedProp ? utilitiesExpandedProp : false;\n\n // Handles utilities state based on breakpoint changes.\n useAfterInitialEffect(() => {\n // If we change into the MD breakpoint range and the utilities state is expanded call the toggle prop to collapse it with controlled state\n if (mdOrAbove && !lgOrAbove && utilitiesExpandedProp) {\n onToggleUtilities?.();\n utilitiesToggledByResize.current = true;\n }\n\n if (lgOrAbove) {\n if (utilitiesToggledByResize.current && !utilitiesExpandedProp) {\n onToggleUtilities?.();\n }\n\n utilitiesToggledByResize.current = false;\n }\n // Purposely not listing utilitiesExpanded as a dependency as it is not a trigger and will be captured when BPs change\n }, [mdOrAbove, lgOrAbove]);\n\n // Generate the tab items based on props and viewport conditions\n const tabItems: TabsProps['tabs'] = useMemo(() => {\n const summaryTab = { id: summaryTabId, name: t('summary') };\n if (mdOrAbove) {\n return !summaryExpanded || (persistentUtility && !xlOrAbove)\n ? [summaryTab, ...tabItemsProp]\n : tabItemsProp;\n }\n const utilityTabs = [];\n if (utilities) utilityTabs.push({ id: utilitiesTabId, name: t('utilities') });\n if (persistentUtility && !mdOrAbove) {\n utilityTabs.push({ id: persistentUtilityTabId, name: persistentUtility.title });\n }\n\n return [summaryTab, ...tabItemsProp, ...utilityTabs];\n }, [\n mdOrAbove,\n xlOrAbove,\n summaryTabId,\n utilitiesTabId,\n persistentUtilityTabId,\n utilities,\n persistentUtility,\n tabItemsProp,\n summaryExpanded\n ]);\n\n // Setup tab content\n const tabContent = useMemo(() => {\n const summaryTabContent = {\n id: summaryTabId,\n content: (\n <Card>\n <StyledSummaryTabContent>{summary}</StyledSummaryTabContent>\n </Card>\n )\n };\n\n if (mdOrAbove) {\n return !summaryExpanded || (persistentUtility && !xlOrAbove)\n ? [summaryTabContent, ...tabContentProp]\n : tabContentProp;\n }\n\n const utilityTabs = [];\n\n if (utilities) {\n utilityTabs.push({\n id: utilitiesTabId,\n content: <Flex container={{ direction: 'column', gap: 2 }}>{utilities}</Flex>\n });\n }\n\n if (persistentUtility) {\n utilityTabs.push({ id: persistentUtilityTabId, content: persistentUtility?.content });\n }\n\n return [summaryTabContent, ...tabContentProp, ...utilityTabs];\n }, [\n summaryTabId,\n summary,\n mdOrAbove,\n summaryExpanded,\n persistentUtility,\n xlOrAbove,\n tabContentProp,\n utilities,\n utilitiesTabId,\n persistentUtilityTabId\n ]);\n\n // Grid layout props\n let caseViewGridContainer = {\n cols: 'minmax(0, 1fr)',\n colGap: 0,\n rows: 'minmax(0, max-content) auto',\n areas: `\n \"summary\"\n \"work-area\"\n `\n };\n\n const sharedGridProps = {\n colGap: 2,\n rows: caseViewGridContainer.rows\n };\n\n if (persistentUtility) {\n if (xlOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, max-content) minmax(0, 1fr) repeat(2, minmax(0, max-content))',\n areas: '\"summary work-area persistentUtility utilities\"'\n };\n } else if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, 1fr) repeat(2, minmax(0, max-content))',\n areas: `\n \"summary summary summary\"\n \"work-area persistentUtility utilities\"\n `\n };\n }\n } else if (summaryExpanded) {\n if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content)',\n areas: '\"summary work-area utilities\"'\n };\n }\n } else if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, 1fr) minmax(0, max-content)',\n areas: `\n \"summary summary\"\n \"work-area utilities\"\n `\n };\n }\n\n // Apply sticky columns\n const scrollStickOptions = useRef<ScrollStickOptions & { elements: HTMLElement[] }>({\n elements: []\n });\n\n const stickOffset = useMemo(() => {\n if (windowIsAvailable && caseViewRef.current) {\n return parseFloat(\n window.getComputedStyle(caseViewRef.current).getPropertyValue('--appshell-offset')\n );\n }\n\n return 0;\n }, [caseViewRef.current]);\n\n useScrollStick(\n // isMediumOrAbove means side by side columns | | |\n mdOrAbove ? { ...scrollStickOptions.current, offset: stickOffset } : undefined\n );\n\n useEffect(() => {\n if (isPreview) {\n onTabClick(summaryTabId);\n }\n }, []);\n\n useEffect(() => {\n if (\n mdOrAbove &&\n summaryExpanded &&\n !persistentUtility &&\n (currentTabId === summaryTabId || currentTabId === utilitiesTabId)\n ) {\n onTabClick(tabItemsProp[0]?.id);\n }\n }, [mdOrAbove, summaryExpanded]);\n\n useEffect(() => {\n if (persistentUtility && currentTabId === persistentUtilityTabId) onTabClick(summaryTabId);\n }, [persistentUtility]);\n\n // Handles scrolling to tab content for newly clicked tab\n useEffect(() => {\n if (!tabContentEl) return;\n const scrollPos = window.scrollY;\n const windowHeight = document.documentElement.clientHeight;\n const bottomPos = scrollPos + windowHeight * 0.8;\n const tabContentPos = tabContentEl.offsetTop;\n if (tabContentPos > bottomPos) {\n const top = tabContentPos - windowHeight * 0.2;\n window.scrollTo({ top, behavior: 'smooth' });\n }\n }, [currentTabId]);\n\n // We need a css variable for the height of the case summary when it is collapsed into a header like layout\n useLayoutEffect(() => {\n if (!caseViewRef.current || !summaryRef.current) return;\n\n caseViewRef.current.style.setProperty(\n '--summary-height',\n `${!summaryExpanded ? summaryRef.current.offsetHeight : 0}px`\n );\n }, [summaryExpanded]);\n\n // CaseView context value\n // Choosing not to memo for now due to extent of deps and how often they change. Optimize as needed.\n const ctxValue: CaseViewContextValue = {\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 items: tabItems,\n onClick: onTabClick,\n currentTabId\n },\n persistentUtility,\n intelligentGuidance,\n summaryId,\n summaryExpanded,\n utilitiesExpanded,\n onToggleSummary,\n isPreview,\n aboveMD: mdOrAbove,\n aboveLG: lgOrAbove,\n aboveXL: xlOrAbove\n };\n\n // Here we go...\n return (\n <>\n <CaseViewContext.Provider value={ctxValue}>\n {/* Root element */}\n <Grid\n as={StyledCaseView}\n ref={caseViewRef}\n container={caseViewGridContainer}\n item={{ area: 'case-view' }}\n {...restProps}\n >\n {/* Summary */}\n <Grid\n // Used for aria-controls on the toggle button\n id={summaryId}\n as={StyledSummary}\n item={{ area: 'summary' }}\n desktop={mdOrAbove && (!persistentUtility || xlOrAbove) && !summaryExpanded}\n isLargeOrAbove={lgOrAbove}\n ref={summaryRef}\n >\n <CaseSummary />\n </Grid>\n\n {/* Work area */}\n <Flex\n container={{\n direction: 'column',\n alignContent: 'start',\n rowGap: 2\n }}\n as={StyledWorkArea}\n persistentUtility={Boolean(persistentUtility)}\n >\n {banners && <div>{banners}</div>}\n {stages && <div>{stages}</div>}\n {tasks && <div>{tasks}</div>}\n\n {(!mdOrAbove || (persistentUtility && !xlOrAbove) || !summaryExpanded) && (\n <Tabs tabs={tabItems} onTabClick={onTabClick} currentTabId={currentTabId} />\n )}\n\n <div ref={setTabContentEl}>\n {tabContent?.map(({ id, content }) => (\n <TabPanel currentTabId={currentTabId} tabId={id} key={id}>\n {content}\n </TabPanel>\n ))}\n </div>\n </Flex>\n\n {/* Persistent utility column */}\n {persistentUtility && mdOrAbove && (\n <Grid as={StyledPersistentUtility} item={{ area: 'persistentUtility' }}>\n {persistentUtility.content}\n </Grid>\n )}\n\n {/* Utility drawer */}\n {utilities && mdOrAbove && !lgOrAbove && utilitiesExpanded && (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={direction.end}\n shadow\n nullWhenClosed\n hasPersistentUtility={!!persistentUtility}\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n id={utilitiesDrawerId}\n >\n <Flex container={{ justify: 'end' }}>\n <Button\n aria-expanded={utilitiesExpanded ? 'true' : 'false'}\n aria-controls={utilitiesDrawerId}\n variant='simple'\n icon\n onClick={onToggleUtilities}\n as={StyledUtilToggle}\n label={t('collapse_utilities_panel')}\n >\n <Icon name={`move-${direction.end}-solid`} />\n </Button>\n </Flex>\n {utilities}\n </Flex>\n </Drawer>\n )}\n\n {/* Utilities */}\n {utilities && mdOrAbove && (\n <Grid\n ref={(el: HTMLDivElement) => {\n if (el) (scrollStickOptions.current?.elements).push(el);\n }}\n as={StyledUtilities}\n container={{\n cols: 'minmax(0, 1fr)',\n rowGap: 2,\n pad: [2, 0, 2]\n }}\n item={{\n area: 'utilities'\n }}\n >\n <Flex container={{ justify: utilitiesExpanded ? 'end' : 'center' }}>\n <Button\n aria-expanded={utilitiesExpanded ? 'true' : 'false'}\n aria-controls={lgOrAbove ? utilitiesId : utilitiesDrawerId}\n variant='simple'\n icon\n onClick={() => {\n if (!obeyUtilitiesExpandedProp && utilitiesExpandedProp) {\n setObeyUtilitiesExpandedProp(true);\n } else {\n onToggleUtilities?.();\n }\n }}\n as={StyledUtilToggle}\n label={t(\n utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel'\n )}\n >\n <Icon\n name={`move-${utilitiesExpanded ? direction.end : direction.start}-solid`}\n />\n </Button>\n </Flex>\n\n {lgOrAbove && utilitiesExpanded && (\n <Flex container={{ direction: 'column', gap: 2 }} id={utilitiesId}>\n {utilities}\n </Flex>\n )}\n\n {(!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) && (\n <UtilitiesSummary\n items={utilitiesSummaryItems}\n onClick={onToggleUtilities}\n aria-expanded={utilitiesExpanded ? 'true' : 'false'}\n aria-controls={lgOrAbove ? utilitiesId : utilitiesDrawerId}\n />\n )}\n </Grid>\n )}\n </Grid>\n </CaseViewContext.Provider>\n {intelligentGuidance}\n </>\n );\n};\n\nexport default CaseView;\n"]}
1
+ {"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,U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AO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE;4CACZ,IAAI,CAAC,yBAAyB,IAAI,qBAAqB,EAAE;gDACvD,4BAA4B,CAAC,IAAI,CAAC,CAAC;6CACpC;iDAAM;gDACL,iBAAiB,EAAE,EAAE,CAAC;6CACvB;wCACH,CAAC,EACD,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,CAAC,CACN,iBAAiB,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,wBAAwB,CAC1E,YAED,KAAC,IAAI,IACH,IAAI,EAAE,QAAQ,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ,GACzE,GACK,GACJ,EAEN,SAAS,IAAI,iBAAiB,IAAI,CACjC,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,WAAW,YAC9D,SAAS,GACL,CACR,EAEA,CAAC,CAAC,iBAAiB,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CACpD,KAAC,gBAAgB,IACf,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,iBAAiB,mBACX,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBACpC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,GAC1D,CACH,IACI,CACR,IACI,GACkB,EAC1B,mBAAmB,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FC, useEffect, useMemo, useRef, useLayoutEffect, useState } from 'react';\n\nimport {\n Button,\n Flex,\n Grid,\n Icon,\n registerIcon,\n TabPanel,\n useBreakpoint,\n useScrollStick,\n useElement,\n ForwardProps,\n Card,\n Drawer,\n useI18n,\n useDirection,\n Tabs,\n TabsProps,\n useAfterInitialEffect,\n windowIsAvailable,\n focusHeadingOrContainer,\n useConfiguration,\n useTestIds\n} from '@pega/cosmos-react-core';\nimport { ScrollStickOptions } from '@pega/cosmos-react-core/lib/hooks/useScrollStick';\nimport * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';\nimport * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';\n\nimport CaseSummary from './CaseSummary';\nimport UtilitiesSummary from './UtilitiesSummary';\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCaseView,\n StyledWorkArea,\n StyledPersistentUtility,\n StyledSummary,\n StyledSummaryTabContent,\n StyledUtilities,\n StyledUtilToggle\n} from './CaseView.styles';\nimport { CaseViewContextValue, CaseViewProps } from './CaseView.types';\nimport CaseViewContext from './CaseView.context';\nimport CaseSummaryFields from './CaseSummaryFields';\nimport { getCaseViewTestIds } from './CaseView.test-ids';\n\nregisterIcon(moveRightSolidIcon, moveLeftSolidIcon);\n\nconst CaseView: FC<CaseViewProps & ForwardProps> = ({\n testId,\n\n // Case data mostly visually related to the case header\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n onEdit,\n actions,\n promotedActions,\n\n // Summary content and state props\n summaryFields,\n summaryExpanded: summaryExpandedProp = true,\n onToggleSummary,\n\n // Case tabs\n tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick },\n\n // Workarea related content props\n banners,\n stages,\n tasks,\n tabContent: tabContentProp = [],\n\n // Utilities content and state props\n utilities,\n utilitiesSummaryItems,\n utilitiesExpanded: utilitiesExpandedProp = true,\n onToggleUtilities,\n\n // Etc...\n persistentUtility,\n intelligentGuidance,\n isPreview = false,\n ...restProps\n}: CaseViewProps) => {\n const testIds = useTestIds(testId, getCaseViewTestIds);\n\n const summary = useMemo(() => {\n return <CaseSummaryFields {...summaryFields} />;\n }, [summaryFields]);\n\n // General util hooks\n const t = useI18n();\n const direction = useDirection();\n const { loadedRef } = useConfiguration();\n\n // Element refs\n const caseViewRef = useRef<HTMLDivElement>(null);\n const summaryRef = useRef<HTMLDivElement>(null);\n\n // Tab content\n const [tabContentEl, setTabContentEl] = useElement<HTMLElement>(null);\n\n // Breakpoint booleans\n const mdOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });\n const lgOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });\n const xlOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });\n\n // DOM ids\n const summaryTabId = `summary-${caseId}`;\n const utilitiesTabId = `utilities-${caseId}`;\n const persistentUtilityTabId = `persistent-utility-${caseId}`;\n const summaryId = `summary-${caseId}`;\n const utilitiesId = `utilities-${caseId}`;\n const utilitiesDrawerId = `utilities-drawer-${caseId}`;\n\n // Summary state handling\n let summaryExpanded = !isPreview && !!summaryExpandedProp;\n\n if (persistentUtility) {\n summaryExpanded = xlOrAbove;\n }\n\n // Focus heading on initial mount\n useEffect(() => {\n if (!caseViewRef.current) return;\n\n if (loadedRef.current) {\n focusHeadingOrContainer(caseViewRef.current, heading);\n } else {\n loadedRef.current = true;\n }\n }, [caseId]);\n\n // Utilities state handling\n\n // Used in coordination with a layoutEffect below to determine the utilities state on initial render.\n // Attempted with a ref but it did not work. Using state and enforcing a render in addition to the change render for lgOrAbove seems to fix...\n const [obeyUtilitiesExpandedProp, setObeyUtilitiesExpandedProp] = useState(lgOrAbove);\n\n // Allow the utilitiesExpandedProp to drive the utilities' state after the initial render\n useLayoutEffect(() => {\n if (lgOrAbove) setObeyUtilitiesExpandedProp(true);\n }, [lgOrAbove]);\n\n // Tracks whether a resize forced the onToggleUtilities to close the utilities when it's a drawer\n const utilitiesToggledByResize = useRef(false);\n\n // If the initial render is within the MD size, where the utility drawer renders, it must begin collapsed\n const utilitiesExpanded = obeyUtilitiesExpandedProp ? utilitiesExpandedProp : false;\n\n // Handles utilities state based on breakpoint changes.\n useAfterInitialEffect(() => {\n // If we change into the MD breakpoint range and the utilities state is expanded call the toggle prop to collapse it with controlled state\n if (mdOrAbove && !lgOrAbove && utilitiesExpandedProp) {\n onToggleUtilities?.();\n utilitiesToggledByResize.current = true;\n }\n\n if (lgOrAbove) {\n if (utilitiesToggledByResize.current && !utilitiesExpandedProp) {\n onToggleUtilities?.();\n }\n\n utilitiesToggledByResize.current = false;\n }\n // Purposely not listing utilitiesExpanded as a dependency as it is not a trigger and will be captured when BPs change\n }, [mdOrAbove, lgOrAbove]);\n\n // Generate the tab items based on props and viewport conditions\n const tabItems: TabsProps['tabs'] = useMemo(() => {\n const summaryTab = { id: summaryTabId, name: t('summary') };\n if (mdOrAbove) {\n return !summaryExpanded || (persistentUtility && !xlOrAbove)\n ? [summaryTab, ...tabItemsProp]\n : tabItemsProp;\n }\n const utilityTabs = [];\n if (utilities) utilityTabs.push({ id: utilitiesTabId, name: t('utilities') });\n if (persistentUtility && !mdOrAbove) {\n utilityTabs.push({ id: persistentUtilityTabId, name: persistentUtility.title });\n }\n\n return [summaryTab, ...tabItemsProp, ...utilityTabs];\n }, [\n mdOrAbove,\n xlOrAbove,\n summaryTabId,\n utilitiesTabId,\n persistentUtilityTabId,\n utilities,\n persistentUtility,\n tabItemsProp,\n summaryExpanded\n ]);\n\n // Setup tab content\n const tabContent = useMemo(() => {\n const summaryTabContent = {\n id: summaryTabId,\n content: (\n <Card>\n <StyledSummaryTabContent>{summary}</StyledSummaryTabContent>\n </Card>\n )\n };\n\n if (mdOrAbove) {\n return !summaryExpanded || (persistentUtility && !xlOrAbove)\n ? [summaryTabContent, ...tabContentProp]\n : tabContentProp;\n }\n\n const utilityTabs = [];\n\n if (utilities) {\n utilityTabs.push({\n id: utilitiesTabId,\n content: <Flex container={{ direction: 'column', gap: 2 }}>{utilities}</Flex>\n });\n }\n\n if (persistentUtility) {\n utilityTabs.push({ id: persistentUtilityTabId, content: persistentUtility?.content });\n }\n\n return [summaryTabContent, ...tabContentProp, ...utilityTabs];\n }, [\n summaryTabId,\n summary,\n mdOrAbove,\n summaryExpanded,\n persistentUtility,\n xlOrAbove,\n tabContentProp,\n utilities,\n utilitiesTabId,\n persistentUtilityTabId\n ]);\n\n // Grid layout props\n let caseViewGridContainer = {\n cols: 'minmax(0, 1fr)',\n colGap: 0,\n rows: 'minmax(0, max-content) auto',\n areas: `\n \"summary\"\n \"work-area\"\n `\n };\n\n const sharedGridProps = {\n colGap: 2,\n rows: caseViewGridContainer.rows\n };\n\n if (persistentUtility) {\n if (xlOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, max-content) minmax(0, 1fr) repeat(2, minmax(0, max-content))',\n areas: '\"summary work-area persistentUtility utilities\"'\n };\n } else if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, 1fr) repeat(2, minmax(0, max-content))',\n areas: `\n \"summary summary summary\"\n \"work-area persistentUtility utilities\"\n `\n };\n }\n } else if (summaryExpanded) {\n if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content)',\n areas: '\"summary work-area utilities\"'\n };\n }\n } else if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, 1fr) minmax(0, max-content)',\n areas: `\n \"summary summary\"\n \"work-area utilities\"\n `\n };\n }\n\n // Apply sticky columns\n const scrollStickOptions = useRef<ScrollStickOptions & { elements: HTMLElement[] }>({\n elements: []\n });\n\n const stickOffset = useMemo(() => {\n if (windowIsAvailable && caseViewRef.current) {\n return parseFloat(\n window.getComputedStyle(caseViewRef.current).getPropertyValue('--appshell-offset')\n );\n }\n\n return 0;\n }, [caseViewRef.current]);\n\n useScrollStick(\n // isMediumOrAbove means side by side columns | | |\n mdOrAbove ? { ...scrollStickOptions.current, offset: stickOffset } : undefined\n );\n\n useEffect(() => {\n if (isPreview) {\n onTabClick(summaryTabId);\n }\n }, []);\n\n useEffect(() => {\n if (\n mdOrAbove &&\n summaryExpanded &&\n !persistentUtility &&\n (currentTabId === summaryTabId || currentTabId === utilitiesTabId)\n ) {\n onTabClick(tabItemsProp[0]?.id);\n }\n }, [mdOrAbove, summaryExpanded]);\n\n useEffect(() => {\n if (persistentUtility && currentTabId === persistentUtilityTabId) onTabClick(summaryTabId);\n }, [persistentUtility]);\n\n // Handles scrolling to tab content for newly clicked tab\n useEffect(() => {\n if (!tabContentEl) return;\n const scrollPos = window.scrollY;\n const windowHeight = document.documentElement.clientHeight;\n const bottomPos = scrollPos + windowHeight * 0.8;\n const tabContentPos = tabContentEl.offsetTop;\n if (tabContentPos > bottomPos) {\n const top = tabContentPos - windowHeight * 0.2;\n window.scrollTo({ top, behavior: 'smooth' });\n }\n }, [currentTabId]);\n\n // We need a css variable for the height of the case summary when it is collapsed into a header like layout\n useLayoutEffect(() => {\n if (!caseViewRef.current || !summaryRef.current) return;\n\n caseViewRef.current.style.setProperty(\n '--summary-height',\n `${!summaryExpanded ? summaryRef.current.offsetHeight : 0}px`\n );\n }, [summaryExpanded]);\n\n // CaseView context value\n // Choosing not to memo for now due to extent of deps and how often they change. Optimize as needed.\n const ctxValue: CaseViewContextValue = {\n testIds,\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 items: tabItems,\n onClick: onTabClick,\n currentTabId\n },\n persistentUtility,\n intelligentGuidance,\n summaryId,\n summaryExpanded,\n utilitiesExpanded,\n onToggleSummary,\n isPreview,\n aboveMD: mdOrAbove,\n aboveLG: lgOrAbove,\n aboveXL: xlOrAbove\n };\n\n // Here we go...\n return (\n <>\n <CaseViewContext.Provider value={ctxValue}>\n {/* Root element */}\n <Grid\n data-testid={testIds.root}\n {...restProps}\n as={StyledCaseView}\n ref={caseViewRef}\n container={caseViewGridContainer}\n item={{ area: 'case-view' }}\n >\n {/* Summary */}\n <Grid\n // Used for aria-controls on the toggle button\n id={summaryId}\n as={StyledSummary}\n item={{ area: 'summary' }}\n desktop={mdOrAbove && (!persistentUtility || xlOrAbove) && !summaryExpanded}\n isLargeOrAbove={lgOrAbove}\n ref={summaryRef}\n >\n <CaseSummary />\n </Grid>\n\n {/* Work area */}\n <Flex\n container={{\n direction: 'column',\n alignContent: 'start',\n rowGap: 2\n }}\n as={StyledWorkArea}\n persistentUtility={Boolean(persistentUtility)}\n >\n {banners && <div data-testid={testIds.banners}>{banners}</div>}\n {stages && <div data-testid={testIds.stages}>{stages}</div>}\n {tasks && <div data-testid={testIds.tasks}>{tasks}</div>}\n\n {(!mdOrAbove || (persistentUtility && !xlOrAbove) || !summaryExpanded) && (\n <Tabs\n data-testid={testIds.tabs}\n tabs={tabItems}\n onTabClick={onTabClick}\n currentTabId={currentTabId}\n />\n )}\n\n <div ref={setTabContentEl}>\n {tabContent?.map(({ id, content }) => (\n <TabPanel\n data-testid={currentTabId === id ? testIds.tabContent : undefined}\n currentTabId={currentTabId}\n tabId={id}\n key={id}\n >\n {content}\n </TabPanel>\n ))}\n </div>\n </Flex>\n\n {/* Persistent utility column */}\n {persistentUtility && mdOrAbove && (\n <Grid as={StyledPersistentUtility} item={{ area: 'persistentUtility' }}>\n {persistentUtility.content}\n </Grid>\n )}\n\n {/* Utility drawer */}\n {utilities && mdOrAbove && !lgOrAbove && utilitiesExpanded && (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={direction.end}\n shadow\n nullWhenClosed\n hasPersistentUtility={!!persistentUtility}\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n id={utilitiesDrawerId}\n >\n <Flex container={{ justify: 'end' }}>\n <Button\n aria-expanded={utilitiesExpanded ? 'true' : 'false'}\n aria-controls={utilitiesDrawerId}\n variant='simple'\n icon\n onClick={onToggleUtilities}\n as={StyledUtilToggle}\n label={t('collapse_utilities_panel')}\n >\n <Icon name={`move-${direction.end}-solid`} />\n </Button>\n </Flex>\n {utilities}\n </Flex>\n </Drawer>\n )}\n\n {/* Utilities */}\n {utilities && mdOrAbove && (\n <Grid\n data-testid={testIds.utilities}\n ref={(el: HTMLDivElement) => {\n if (el) (scrollStickOptions.current?.elements).push(el);\n }}\n as={StyledUtilities}\n container={{\n cols: 'minmax(0, 1fr)',\n rowGap: 2,\n pad: [2, 0, 2]\n }}\n item={{\n area: 'utilities'\n }}\n >\n <Flex container={{ justify: utilitiesExpanded ? 'end' : 'center' }}>\n <Button\n aria-expanded={utilitiesExpanded ? 'true' : 'false'}\n aria-controls={lgOrAbove ? utilitiesId : utilitiesDrawerId}\n variant='simple'\n icon\n onClick={() => {\n if (!obeyUtilitiesExpandedProp && utilitiesExpandedProp) {\n setObeyUtilitiesExpandedProp(true);\n } else {\n onToggleUtilities?.();\n }\n }}\n as={StyledUtilToggle}\n label={t(\n utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel'\n )}\n >\n <Icon\n name={`move-${utilitiesExpanded ? direction.end : direction.start}-solid`}\n />\n </Button>\n </Flex>\n\n {lgOrAbove && utilitiesExpanded && (\n <Flex container={{ direction: 'column', gap: 2 }} id={utilitiesId}>\n {utilities}\n </Flex>\n )}\n\n {(!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) && (\n <UtilitiesSummary\n items={utilitiesSummaryItems}\n onClick={onToggleUtilities}\n aria-expanded={utilitiesExpanded ? 'true' : 'false'}\n aria-controls={lgOrAbove ? utilitiesId : utilitiesDrawerId}\n />\n )}\n </Grid>\n )}\n </Grid>\n </CaseViewContext.Provider>\n {intelligentGuidance}\n </>\n );\n};\n\nexport default CaseView;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getCaseViewTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "subheading", "edit", "actions", "promoted-actions", "summary-fields", "banners", "stages", "tasks", "tabs", "tab-content", "utilities"]>;
2
+ //# sourceMappingURL=CaseView.test-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaseView.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,qPAapB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { createTestIds } from '@pega/cosmos-react-core';
2
+ export const getCaseViewTestIds = createTestIds('case-view', [
3
+ 'heading',
4
+ 'subheading',
5
+ 'edit',
6
+ 'actions',
7
+ 'promoted-actions',
8
+ 'summary-fields',
9
+ 'banners',
10
+ 'stages',
11
+ 'tasks',
12
+ 'tabs',
13
+ 'tab-content',
14
+ 'utilities'
15
+ ]);
16
+ //# sourceMappingURL=CaseView.test-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaseView.test-ids.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC,WAAW,EAAE;IAC3D,SAAS;IACT,YAAY;IACZ,MAAM;IACN,SAAS;IACT,kBAAkB;IAClB,gBAAgB;IAChB,SAAS;IACT,QAAQ;IACR,OAAO;IACP,MAAM;IACN,aAAa;IACb,WAAW;CACH,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getCaseViewTestIds = createTestIds('case-view', [\n 'heading',\n 'subheading',\n 'edit',\n 'actions',\n 'promoted-actions',\n 'summary-fields',\n 'banners',\n 'stages',\n 'tasks',\n 'tabs',\n 'tab-content',\n 'utilities'\n] as const);\n"]}
@@ -1,5 +1,6 @@
1
1
  import { ReactElement, ReactNode, MouseEvent } from 'react';
2
- import { Tab, NoChildrenProp, FieldValueListItemProps, ForwardProps, MenuItemProps, Action, BaseProps, OmitStrict, RequireAtLeastOne } from '@pega/cosmos-react-core';
2
+ import { Tab, NoChildrenProp, FieldValueListItemProps, ForwardProps, MenuItemProps, Action, BaseProps, TestIdProp, OmitStrict, RequireAtLeastOne } from '@pega/cosmos-react-core';
3
+ import type { getCaseViewTestIds } from './CaseView.test-ids';
3
4
  export interface SummaryField extends OmitStrict<FieldValueListItemProps, 'value'> {
4
5
  value: FieldValueListItemProps['value'];
5
6
  }
@@ -7,17 +8,13 @@ export type CaseSummaryFieldsProps = RequireAtLeastOne<{
7
8
  primary?: SummaryField[];
8
9
  secondary?: SummaryField[];
9
10
  }>;
10
- export interface CaseViewProps extends NoChildrenProp, BaseProps {
11
+ export interface CaseViewProps extends NoChildrenProp, BaseProps, TestIdProp {
11
12
  /** A unique identifier for the case instance. */
12
13
  caseId: string;
13
14
  /** Text to quickly identify a case instance. */
14
15
  heading: string;
15
16
  /** Supplemental text to identify a case instance. */
16
17
  subheading?: string;
17
- /** A set of props including an href that will be forwarded to the case heading and caseId. */
18
- caseLink?: {
19
- href: string;
20
- } & ForwardProps;
21
18
  /** A set of Link props representing the case parents, rendered as Breadcrumbs. */
22
19
  parentCases?: MenuItemProps[];
23
20
  /** An icon to serve as a visual for the CaseView. */
@@ -87,12 +84,16 @@ export interface CaseViewProps extends NoChildrenProp, BaseProps {
87
84
  */
88
85
  onToggleUtilities?: () => void;
89
86
  }
90
- export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'caseLink' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'tabs' | 'summaryExpanded' | 'onToggleSummary' | 'utilitiesExpanded' | 'persistentUtility' | 'intelligentGuidance'> {
87
+ export interface CaseViewContextValue extends Pick<CaseViewProps, 'caseId' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'tabs' | 'summaryExpanded' | 'onToggleSummary' | 'utilitiesExpanded' | 'persistentUtility' | 'intelligentGuidance'> {
88
+ testIds: ReturnType<typeof getCaseViewTestIds>;
91
89
  summaryId: string;
92
90
  summary: ReactNode;
93
91
  aboveMD: boolean;
94
92
  aboveLG: boolean;
95
93
  aboveXL: boolean;
96
94
  isPreview: boolean;
95
+ caseLink?: {
96
+ href: string;
97
+ } & ForwardProps;
97
98
  }
98
99
  //# sourceMappingURL=CaseView.types.d.ts.map