@pega/cosmos-react-work 2.0.0-dev.12.1 → 2.0.0-dev.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/lib/components/CaseHeader/CaseHeader.js +1 -1
  2. package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
  3. package/lib/components/CasePreview/CasePreview.js +6 -6
  4. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  5. package/lib/components/CaseSummary/CaseSummary.d.ts +1 -0
  6. package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
  7. package/lib/components/CaseSummary/CaseSummary.js +7 -8
  8. package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
  9. package/lib/components/CaseView/CaseView.d.ts +6 -1
  10. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  11. package/lib/components/CaseView/CaseView.js +64 -25
  12. package/lib/components/CaseView/CaseView.js.map +1 -1
  13. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  14. package/lib/components/CaseView/CaseView.styles.js +1 -5
  15. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  16. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  17. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  18. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +94 -0
  19. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  20. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +46 -0
  21. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  22. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  23. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  24. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  25. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  26. package/lib/components/ConfigurableLayout/LayoutCell.js +63 -0
  27. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  28. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  29. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  30. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  31. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  32. package/lib/components/ConfigurableLayout/index.d.ts +2 -0
  33. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  34. package/lib/components/ConfigurableLayout/index.js +2 -0
  35. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  36. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  37. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  38. package/lib/components/ConfigurableLayout/options.js +10 -0
  39. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  40. package/lib/components/Details/Details.d.ts +13 -0
  41. package/lib/components/Details/Details.d.ts.map +1 -0
  42. package/lib/components/Details/Details.js +38 -0
  43. package/lib/components/Details/Details.js.map +1 -0
  44. package/lib/components/Details/index.d.ts +4 -0
  45. package/lib/components/Details/index.d.ts.map +1 -0
  46. package/lib/components/Details/index.js +3 -0
  47. package/lib/components/Details/index.js.map +1 -0
  48. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  49. package/lib/components/SearchResults/SearchResults.js +2 -2
  50. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  51. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  52. package/lib/components/Stages/Stages.styles.js +2 -2
  53. package/lib/components/Stages/Stages.styles.js.map +1 -1
  54. package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
  55. package/lib/components/Stages/StepsContainer.js +1 -1
  56. package/lib/components/Stages/StepsContainer.js.map +1 -1
  57. package/lib/components/Stakeholders/StakeholderForm.d.ts +4 -0
  58. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  59. package/lib/components/Stakeholders/StakeholderForm.js +37 -0
  60. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  61. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  62. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  63. package/lib/components/Stakeholders/Stakeholders.js +181 -0
  64. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  65. package/lib/components/Stakeholders/Stakeholders.types.d.ts +42 -0
  66. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  67. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  68. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  69. package/lib/components/Stakeholders/index.d.ts +3 -0
  70. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  71. package/lib/components/Stakeholders/index.js +2 -0
  72. package/lib/components/Stakeholders/index.js.map +1 -0
  73. package/lib/components/Tags/Tags.js +2 -2
  74. package/lib/components/Tags/Tags.js.map +1 -1
  75. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  76. package/lib/components/Timeline/Timeline.styles.js +8 -4
  77. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  78. package/lib/hooks/index.d.ts +2 -0
  79. package/lib/hooks/index.d.ts.map +1 -0
  80. package/lib/hooks/index.js +3 -0
  81. package/lib/hooks/index.js.map +1 -0
  82. package/lib/hooks/useArrangementContainer.d.ts +6 -0
  83. package/lib/hooks/useArrangementContainer.d.ts.map +1 -0
  84. package/lib/hooks/useArrangementContainer.js +25 -0
  85. package/lib/hooks/useArrangementContainer.js.map +1 -0
  86. package/lib/index.d.ts +6 -0
  87. package/lib/index.d.ts.map +1 -1
  88. package/lib/index.js +6 -0
  89. package/lib/index.js.map +1 -1
  90. package/package.json +11 -10
@@ -94,7 +94,7 @@ const CaseHeader = forwardRef(({ caseId, heading, caseLink = { href: '' }, paren
94
94
  visual: action.icon ? _jsx(Icon, { name: action.icon }, void 0) : null
95
95
  };
96
96
  });
97
- return (_jsxs(Flex, Object.assign({}, restProps, { as: StyledCaseHeader, container: { gap: 2, alignItems: 'center' }, ref: ref }, { children: [icon && (_jsx(Flex, Object.assign({ container: true, item: { shrink: 0, alignSelf: 'start' }, as: StyledCaseIconWrap }, { children: icon }), void 0)), _jsxs(Flex, Object.assign({ as: StyledCaseHeaderText, container: { direction: 'column-reverse' }, item: { grow: 1, shrink: 0, basis: '0' } }, { children: [_jsx(Text, Object.assign({ variant: 'h1' }, { children: href ? (_jsx(Link, Object.assign({}, restLinkProps, { href: href }, { children: heading }), void 0)) : (heading) }), void 0), _jsx(Breadcrumbs, { path: [...(parentCases || []), { ...restLinkProps, id: caseId, primary: caseId, href }] }, void 0)] }), void 0), _jsxs("div", { children: [onEdit && (_jsx(Button, Object.assign({ icon: true, variant: 'simple', onClick: onEdit, label: t('edit') }, { children: _jsx(Icon, { name: 'pencil' }, void 0) }), void 0)), _jsx(MenuButton, { icon: 'more', iconOnly: true, variant: 'simple', text: t('actions'), menu: {
97
+ return (_jsxs(Flex, Object.assign({}, restProps, { as: StyledCaseHeader, container: { gap: 2, alignItems: 'center' }, ref: ref }, { children: [icon && (_jsx(Flex, Object.assign({ container: true, item: { shrink: 0, alignSelf: 'start' }, as: StyledCaseIconWrap }, { children: icon }), void 0)), _jsxs(Flex, Object.assign({ as: StyledCaseHeaderText, container: { direction: 'column' }, item: { grow: 1, shrink: 0, basis: '0' } }, { children: [_jsx(Text, Object.assign({ variant: 'h1' }, { children: href ? (_jsx(Link, Object.assign({}, restLinkProps, { href: href }, { children: heading }), void 0)) : (heading) }), void 0), _jsx(Breadcrumbs, { path: [...(parentCases || []), { ...restLinkProps, id: caseId, primary: caseId, href }] }, void 0)] }), void 0), _jsxs("div", { children: [onEdit && (_jsx(Button, Object.assign({ icon: true, variant: 'simple', onClick: onEdit, label: t('edit') }, { children: _jsx(Icon, { name: 'pencil' }, void 0) }), void 0)), _jsx(MenuButton, { icon: 'more', iconOnly: true, variant: 'simple', text: t('actions'), menu: {
98
98
  items: followed !== undefined
99
99
  ? [
100
100
  {
@@ -1 +1 @@
1
- {"version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AAC,QAAQ,CAAC;wCAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC;qCAC7C;oCACD,GAAG,SAAS;iCACb;gCACH,CAAC,CAAC,SAAS;4BACf,QAAQ,EAAE,EAAE;yBACb,EACD,OAAO,EACL,eAAe;4BACb,CAAC,CAAC;gCACE,MAAM,EAAE,IAAI;6BACb;4BACH,CAAC,CAAC,SAAS,WAEf,YACE,aACD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, ReactElement, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually, parseToHsl, readableColor, transparentize } from 'polished';\n\nimport {\n Action,\n Breadcrumbs,\n Flex,\n Icon,\n Text,\n StyledBreadcrumbs,\n StyledIcon,\n StyledPopover,\n defaultThemeProp,\n ForwardProps,\n tryCatch,\n calculateFontSize,\n Link,\n StyledButton,\n StyledText,\n MenuItemProps,\n Button,\n MenuButton,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\n\nexport interface CaseHeaderProps {\n /** Any actions that will be used for various actions on the CaseView. */\n actions?: Action[];\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n /**\n * Indicator for the current size of the users screen.\n * @internal\n */\n isMediumOrAbove?: boolean;\n /** A Case ID to display in the heading. */\n caseId: string;\n /** A text region for the title of the CaseView. */\n heading: string;\n /** A set of props including an href that will be forwarded to the case heading and caseId. */\n caseLink?: { href: string } & ForwardProps;\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nexport const StyledCaseHeader = styled.header(({ theme }) => {\n const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));\n\n return css`\n background-color: ${theme.base.palette['brand-primary']};\n color: ${color};\n padding: calc(2 * ${theme.base.spacing});\n position: relative;\n\n ${StyledMenu} {\n color: ${theme.base.palette['foreground-color']};\n z-index: ${theme.base['z-index'].popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nconst StyledCaseIconWrap = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n const borderRadius = theme.base['border-radius'];\n const backgroundColor = tryCatch(() => {\n const { lightness } = parseToHsl(theme.base.palette['brand-primary']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n });\n\n return css`\n background: ${backgroundColor};\n border-radius: calc(${borderRadius} / 2);\n width: calc(5 * ${spacing});\n height: calc(5 * ${spacing});\n ${StyledIcon} {\n font-size: calc(3 * ${spacing});\n margin: auto;\n }\n `;\n});\n\nStyledCaseIconWrap.defaultProps = defaultThemeProp;\n\nconst StyledFollowIconWrap = styled.label`\n font-size: 1.25rem;\n input {\n ${hideVisually}\n }\n\n input:focus + svg {\n box-shadow: ${({ theme }) => theme.base.shadow['focus-inverted']};\n }\n`;\n\nStyledFollowIconWrap.defaultProps = defaultThemeProp;\n\nconst StyledCaseHeaderText = styled.div(({ theme }) => {\n const color = readableColor(theme.base.palette['brand-primary']);\n const transparentColor = tryCatch(() => transparentize(0.2, color));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n word-break: break-word;\n\n ${StyledBreadcrumbs} {\n > a,\n > span,\n > button,\n > svg {\n color: ${transparentColor};\n font-size: ${fontSize.s};\n font-weight: normal;\n }\n\n > a,\n > button {\n &:focus {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n }\n\n ${StyledPopover} {\n color: ${theme.base.palette['foreground-color']};\n }\n }\n\n > ${StyledText} > ${StyledButton} {\n color: ${color};\n }\n `;\n});\n\nStyledCaseHeaderText.defaultProps = defaultThemeProp;\n\nconst CaseHeader: FunctionComponent<CaseHeaderProps & ForwardProps> = forwardRef(\n (\n {\n caseId,\n heading,\n caseLink = { href: '' },\n parentCases,\n isMediumOrAbove = true,\n icon,\n followed,\n onFollowedChange,\n actions = [],\n onEdit,\n ...restProps\n }: PropsWithoutRef<CaseHeaderProps>,\n ref: CaseHeaderProps['ref']\n ) => {\n const { href, ...restLinkProps } = caseLink;\n const t = useI18n();\n const menuItems: MenuItemProps[] = actions.map(action => {\n return {\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n });\n\n return (\n <Flex\n {...restProps}\n as={StyledCaseHeader}\n container={{ gap: 2, alignItems: 'center' }}\n ref={ref}\n >\n {icon && (\n <Flex container item={{ shrink: 0, alignSelf: 'start' }} as={StyledCaseIconWrap}>\n {icon}\n </Flex>\n )}\n <Flex\n as={StyledCaseHeaderText}\n container={{ direction: 'column-reverse' }}\n item={{ grow: 1, shrink: 0, basis: '0' }}\n >\n <Text variant='h1'>\n {href ? (\n <Link {...restLinkProps} href={href}>\n {heading}\n </Link>\n ) : (\n heading\n )}\n </Text>\n <Breadcrumbs\n path={[...(parentCases || []), { ...restLinkProps, id: caseId, primary: caseId, href }]}\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 <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 ...menuItems\n ]\n : menuItems,\n scrollAt: 20\n }}\n popover={\n isMediumOrAbove\n ? {\n portal: true\n }\n : undefined\n }\n />\n </div>\n </Flex>\n );\n }\n);\n\nexport default CaseHeader;\n"]}
1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AC,CAAC,QAAQ,CAAC;wCAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC;qCAC7C;oCACD,GAAG,SAAS;iCACb;gCACH,CAAC,CAAC,SAAS;4BACf,QAAQ,EAAE,EAAE;yBACb,EACD,OAAO,EACL,eAAe;4BACb,CAAC,CAAC;gCACE,MAAM,EAAE,IAAI;6BACb;4BACH,CAAC,CAAC,SAAS,WAEf,YACE,aACD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, ReactElement, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually, parseToHsl, readableColor, transparentize } from 'polished';\n\nimport {\n Action,\n Breadcrumbs,\n Flex,\n Icon,\n Text,\n StyledBreadcrumbs,\n StyledIcon,\n StyledPopover,\n defaultThemeProp,\n ForwardProps,\n tryCatch,\n calculateFontSize,\n Link,\n StyledButton,\n StyledText,\n MenuItemProps,\n Button,\n MenuButton,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';\n\nexport interface CaseHeaderProps {\n /** Any actions that will be used for various actions on the CaseView. */\n actions?: Action[];\n /** A callback for when the edit button is clicked */\n onEdit?: () => void;\n /**\n * Indicator for the current size of the users screen.\n * @internal\n */\n isMediumOrAbove?: boolean;\n /** A Case ID to display in the heading. */\n caseId: string;\n /** A text region for the title of the CaseView. */\n heading: string;\n /** A set of props including an href that will be forwarded to the case heading and caseId. */\n caseLink?: { href: string } & ForwardProps;\n /** A set of Link props representing the case parents, rendered as Breadcrumbs. */\n parentCases?: MenuItemProps[];\n /** An icon to serve as a visual for the CaseView. */\n icon?: ReactElement;\n /** Indicates if the current user is following the case. This should be updated based on onFollowedChange. */\n followed?: boolean;\n /** Called when user chooses to follow or unfollow the case. Use this to update followed. */\n onFollowedChange?: (following: boolean) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nexport const StyledCaseHeader = styled.header(({ theme }) => {\n const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));\n\n return css`\n background-color: ${theme.base.palette['brand-primary']};\n color: ${color};\n padding: calc(2 * ${theme.base.spacing});\n position: relative;\n\n ${StyledMenu} {\n color: ${theme.base.palette['foreground-color']};\n z-index: ${theme.base['z-index'].popover + 1};\n }\n `;\n});\n\nStyledCaseHeader.defaultProps = defaultThemeProp;\n\nconst StyledCaseIconWrap = styled.div(({ theme }) => {\n const spacing = theme.base.spacing;\n const borderRadius = theme.base['border-radius'];\n const backgroundColor = tryCatch(() => {\n const { lightness } = parseToHsl(theme.base.palette['brand-primary']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n });\n\n return css`\n background: ${backgroundColor};\n border-radius: calc(${borderRadius} / 2);\n width: calc(5 * ${spacing});\n height: calc(5 * ${spacing});\n ${StyledIcon} {\n font-size: calc(3 * ${spacing});\n margin: auto;\n }\n `;\n});\n\nStyledCaseIconWrap.defaultProps = defaultThemeProp;\n\nconst StyledFollowIconWrap = styled.label`\n font-size: 1.25rem;\n input {\n ${hideVisually}\n }\n\n input:focus + svg {\n box-shadow: ${({ theme }) => theme.base.shadow['focus-inverted']};\n }\n`;\n\nStyledFollowIconWrap.defaultProps = defaultThemeProp;\n\nconst StyledCaseHeaderText = styled.div(({ theme }) => {\n const color = readableColor(theme.base.palette['brand-primary']);\n const transparentColor = tryCatch(() => transparentize(0.2, color));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n word-break: break-word;\n\n ${StyledBreadcrumbs} {\n > a,\n > span,\n > button,\n > svg {\n color: ${transparentColor};\n font-size: ${fontSize.s};\n font-weight: normal;\n }\n\n > a,\n > button {\n &:focus {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n }\n\n ${StyledPopover} {\n color: ${theme.base.palette['foreground-color']};\n }\n }\n\n > ${StyledText} > ${StyledButton} {\n color: ${color};\n }\n `;\n});\n\nStyledCaseHeaderText.defaultProps = defaultThemeProp;\n\nconst CaseHeader: FunctionComponent<CaseHeaderProps & ForwardProps> = forwardRef(\n (\n {\n caseId,\n heading,\n caseLink = { href: '' },\n parentCases,\n isMediumOrAbove = true,\n icon,\n followed,\n onFollowedChange,\n actions = [],\n onEdit,\n ...restProps\n }: PropsWithoutRef<CaseHeaderProps>,\n ref: CaseHeaderProps['ref']\n ) => {\n const { href, ...restLinkProps } = caseLink;\n const t = useI18n();\n const menuItems: MenuItemProps[] = actions.map(action => {\n return {\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n });\n\n return (\n <Flex\n {...restProps}\n as={StyledCaseHeader}\n container={{ gap: 2, alignItems: 'center' }}\n ref={ref}\n >\n {icon && (\n <Flex container item={{ shrink: 0, alignSelf: 'start' }} 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'>\n {href ? (\n <Link {...restLinkProps} href={href}>\n {heading}\n </Link>\n ) : (\n heading\n )}\n </Text>\n <Breadcrumbs\n path={[...(parentCases || []), { ...restLinkProps, id: caseId, primary: caseId, href }]}\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 <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 ...menuItems\n ]\n : menuItems,\n scrollAt: 20\n }}\n popover={\n isMediumOrAbove\n ? {\n portal: true\n }\n : undefined\n }\n />\n </div>\n </Flex>\n );\n }\n);\n\nexport default CaseHeader;\n"]}
@@ -31,20 +31,20 @@ const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ caseSummaryEl, theme })
31
31
  z-index: calc(${theme.base['z-index'].drawer} + 500);
32
32
 
33
33
  ${StyledCaseView} {
34
- height: calc(100vh - ${theme.base.spacing} - ${theme.base.sizes['touch-mouse']});
34
+ height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});
35
35
 
36
36
  @media (pointer: coarse) {
37
- height: calc(100vh - ${theme.base.spacing} - ${theme.base.sizes['touch-finger']});
37
+ height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});
38
38
  }
39
39
  }
40
40
 
41
41
  ${StyledCaseViewContent} {
42
42
  overflow-y: auto;
43
43
  margin-top: ${`${offsetHeight}px`};
44
- margin-bottom: calc(${theme.base.sizes['touch-mouse']} + ${theme.base.spacing});
44
+ margin-bottom: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});
45
45
 
46
46
  @media (pointer: coarse) {
47
- margin-bottom: calc(${theme.base.sizes['touch-finger']} + ${theme.base.spacing});
47
+ margin-bottom: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});
48
48
  }
49
49
 
50
50
  & > :last-child {
@@ -54,10 +54,10 @@ const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ caseSummaryEl, theme })
54
54
 
55
55
  ${StyledSummaryRegion} {
56
56
  position: fixed;
57
- top: calc(${theme.base.sizes['touch-mouse']} + ${theme.base.spacing});
57
+ top: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});
58
58
 
59
59
  @media (pointer: coarse) {
60
- top: calc(${theme.base.sizes['touch-finger']} + ${theme.base.spacing});
60
+ top: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});
61
61
  }
62
62
  }
63
63
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,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,EAClC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,gBAAgB,EAChC,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,WACd,aACK,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} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Drawer,\n Icon,\n Button,\n Flex,\n tryCatch,\n defaultThemeProp,\n ForwardProps,\n useBreakpoint,\n useElement,\n useDirection\n} from '@pega/cosmos-react-core';\n\nimport CaseView, {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\n\nexport interface CasePreviewProps extends CaseViewProps {\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)<{ caseSummaryEl?: HTMLDivElement }>(\n ({ caseSummaryEl, theme }) => {\n const offsetHeight = caseSummaryEl?.offsetHeight || 0;\n\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.sizes['touch-mouse']});\n\n @media (pointer: coarse) {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base.sizes['touch-finger']});\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n margin-top: ${`${offsetHeight}px`};\n margin-bottom: calc(${theme.base.sizes['touch-mouse']} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n margin-bottom: calc(${theme.base.sizes['touch-finger']} + ${theme.base.spacing});\n }\n\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n\n ${StyledSummaryRegion} {\n position: fixed;\n top: calc(${theme.base.sizes['touch-mouse']} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n top: calc(${theme.base.sizes['touch-finger']} + ${theme.base.spacing});\n }\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 parentCases,\n heading,\n caseLink,\n icon,\n followed,\n onFollowedChange,\n summary,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n ...restProps\n } = props;\n\n const [caseSummaryEl, setCaseSummaryEl] = useElement<HTMLDivElement>();\n const isSmallOrAbove = useBreakpoint('sm');\n const [open, setOpen] = useState(openProp);\n const direction = useDirection();\n\n const closePreview = useCallback(() => {\n setOpen(false);\n }, []);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n return (\n <Drawer\n {...restProps}\n as={StyledPreviewDrawer}\n caseSummaryEl={caseSummaryEl ?? undefined}\n forwardedAs={Flex}\n container={{ direction: 'column' }}\n ref={ref}\n open={open && isSmallOrAbove}\n position='fixed'\n placement={direction.end}\n shadow\n nullWhenClosed\n >\n <StyledPreviewActions>\n <Button variant='simple' icon onClick={closePreview}>\n <Icon name='times' />\n </Button>\n </StyledPreviewActions>\n\n <CaseView\n forceMobile\n caseId={caseId}\n parentCases={parentCases}\n heading={heading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summary={summary}\n caseSummaryRef={setCaseSummaryEl}\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 />\n </Drawer>\n );\n }\n);\n\nexport default CasePreview;\n"]}
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,EACV,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,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAEhB,aAAa,EACb,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,QAAQ,EAAE,EAEf,cAAc,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C;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useState,\n useCallback,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Drawer,\n Icon,\n Button,\n Flex,\n tryCatch,\n defaultThemeProp,\n ForwardProps,\n useBreakpoint,\n useElement,\n useDirection\n} from '@pega/cosmos-react-core';\n\nimport CaseView, {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\n\nexport interface CasePreviewProps extends CaseViewProps {\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)<{ caseSummaryEl?: HTMLDivElement }>(\n ({ caseSummaryEl, theme }) => {\n const offsetHeight = caseSummaryEl?.offsetHeight || 0;\n\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\n ${StyledCaseViewContent} {\n overflow-y: auto;\n margin-top: ${`${offsetHeight}px`};\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 ${StyledSummaryRegion} {\n position: fixed;\n top: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n top: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});\n }\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 parentCases,\n heading,\n caseLink,\n icon,\n followed,\n onFollowedChange,\n summary,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n ...restProps\n } = props;\n\n const [caseSummaryEl, setCaseSummaryEl] = useElement<HTMLDivElement>();\n const isSmallOrAbove = useBreakpoint('sm');\n const [open, setOpen] = useState(openProp);\n const direction = useDirection();\n\n const closePreview = useCallback(() => {\n setOpen(false);\n }, []);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n return (\n <Drawer\n {...restProps}\n as={StyledPreviewDrawer}\n caseSummaryEl={caseSummaryEl ?? undefined}\n forwardedAs={Flex}\n container={{ direction: 'column' }}\n ref={ref}\n open={open && isSmallOrAbove}\n position='fixed'\n placement={direction.end}\n shadow\n nullWhenClosed\n >\n <StyledPreviewActions>\n <Button variant='simple' icon onClick={closePreview}>\n <Icon name='times' />\n </Button>\n </StyledPreviewActions>\n\n <CaseView\n forceMobile\n caseId={caseId}\n parentCases={parentCases}\n heading={heading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summary={summary}\n caseSummaryRef={setCaseSummaryEl}\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 />\n </Drawer>\n );\n }\n);\n\nexport default CasePreview;\n"]}
@@ -29,6 +29,7 @@ declare type AnimationState = 'expanding' | 'expanded' | 'collapsing' | 'collaps
29
29
  export declare const StyledCaseSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
30
30
  fixedWidth?: string | undefined;
31
31
  }, never>;
32
+ export declare const StyledCaseSummaryInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
32
33
  declare const CaseSummary: FunctionComponent<CaseSummaryProps & ForwardProps>;
33
34
  export default CaseSummary;
34
35
  //# sourceMappingURL=CaseSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,SAAS,EACT,GAAG,EACH,UAAU,EAIX,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,GAAG,EACH,YAAY,EASb,MAAM,yBAAyB,CAAC;AAEjC,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,sEAAsE;IACtE,OAAO,EAAE,SAAS,CAAC;IACnB,qFAAqF;IACrF,IAAI,EAAE;Q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AW,gBAAiB,SAAQ,eAAe;IACvD,sEAAsE;IACtE,OAAO,EAAE,SAAS,CAAC;IACnB,qFAAqF;IACrF,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC;QACzF,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAWF,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzD,yDAAyD;IACzD,SAAS,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,aAAK,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;AAE5E,eAAO,MAAM,iBAAiB;;SAkB5B,CAAC;AAEH,eAAO,MAAM,qBAAqB,yGAGjC,CAAC;AAsCF,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAmKnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -8,7 +8,7 @@ export const StyledCaseSummary = styled.div(({ fixedWidth }) => {
8
8
  position: relative;
9
9
  width: ${fixedWidth || 'auto'};
10
10
  max-width: ${fixedWidth ? 'none' : '100%'};
11
- min-height: 100%;
11
+ height: 100%;
12
12
 
13
13
  &:hover {
14
14
  &::after {
@@ -22,6 +22,10 @@ export const StyledCaseSummary = styled.div(({ fixedWidth }) => {
22
22
  }
23
23
  `;
24
24
  });
25
+ export const StyledCaseSummaryInfo = styled.div `
26
+ overflow: auto;
27
+ flex: 1;
28
+ `;
25
29
  const StyledExpandCollapse = styled.div(({ animationState }) => {
26
30
  const expandingOrCollapsing = ['expanding', 'collapsing'].includes(animationState);
27
31
  return css `
@@ -34,12 +38,7 @@ const StyledExpandCollapseButton = styled(Button)(({ theme, expanded, headerHeig
34
38
  border-radius: ${expanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};
35
39
  box-shadow: ${theme.base.shadow.high};
36
40
  border: none;
37
- display: 'flex';
38
41
  opacity: ${visible ? '1' : '0'};
39
- align-items: center;
40
- justify-content: center;
41
- min-height: 1.5rem;
42
- min-width: 1.5rem;
43
42
  position: ${animationState === 'collapsing' ? 'fixed' : 'absolute'};
44
43
  inset-inline-start: ${expanded ? 'calc(100% - 0.75rem)' : 0};
45
44
  top: calc(calc(${headerHeight}px / 2) - 0.75rem);
@@ -105,7 +104,7 @@ const CaseSummary = forwardRef((props, ref) => {
105
104
  ? expandOrCollapseNoun
106
105
  : undefined, "aria-label": ['expanding', 'collapsing'].includes(animationState)
107
106
  ? expandOrCollapseNoun
108
- : undefined, visible: showExpandCollapse || !collapsed || focusWithin, tabIndex: 0, icon: true, ref: expandCollapseBtnRef }, { children: _jsx(Icon, { name: 'arrow-micro-left' }, void 0) }), void 0), _jsx(ExpandCollapse, Object.assign({ dimension: 'width', min: isMediumOrAbove || !collapsed ? fixedWidth : '100%', max: '100%', collapsed: collapsed, onBeforeExpand: () => {
107
+ : undefined, visible: showExpandCollapse || !collapsed || focusWithin, tabIndex: 0, icon: true, compact: true, ref: expandCollapseBtnRef }, { children: _jsx(Icon, { name: 'arrow-micro-left' }, void 0) }), void 0), _jsx(ExpandCollapse, Object.assign({ dimension: 'width', min: isMediumOrAbove || !collapsed ? fixedWidth : '100%', max: '100%', collapsed: collapsed, onBeforeExpand: () => {
109
108
  setAnimStateAndUpdateParent('collapsing');
110
109
  onBeforeCollapse?.();
111
110
  }, onAfterExpand: () => {
@@ -117,7 +116,7 @@ const CaseSummary = forwardRef((props, ref) => {
117
116
  }, onAfterCollapse: () => {
118
117
  setAnimStateAndUpdateParent('expanded');
119
118
  onAfterExpand?.();
120
- }, as: StyledExpandCollapse, animationState: animationState, ref: headerRef }, { children: _jsx(CaseHeader, Object.assign({}, caseHeaderProps), void 0) }), void 0)] }, void 0)) : (_jsx(CaseHeader, Object.assign({}, caseHeaderProps), void 0)), isMediumOrAbove && summary, showTabs && isMediumOrAbove && (_jsx(Tabs, { type: 'vertical', tabs: tabs.items, onTabClick: tabs.onClick, currentTabId: tabs.currentTabId }, void 0))] }), void 0));
119
+ }, as: StyledExpandCollapse, animationState: animationState, ref: headerRef }, { children: _jsx(CaseHeader, Object.assign({}, caseHeaderProps), void 0) }), void 0)] }, void 0)) : (_jsx(CaseHeader, Object.assign({}, caseHeaderProps), void 0)), _jsxs(StyledCaseSummaryInfo, { children: [isMediumOrAbove && summary, showTabs && isMediumOrAbove && (_jsx(Tabs, { type: 'vertical', tabs: tabs.items, onTabClick: tabs.onClick, currentTabId: tabs.currentTabId }, void 0))] }, void 0)] }), void 0));
121
120
  });
122
121
  export default CaseSummary;
123
122
  //# sourceMappingURL=CaseSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAMV,QAAQ,EACR,SAAS,EACT,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,IAAI,EAGJ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,IAAI,EACJ,OAAO,EACP,cAAc,EACd,MAAM,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EAAE,GAAG,EAAE;4BAClB,2BAA2B,CAAC,WAAW,CAAC,CAAC;4BACzC,eAAe,EAAE,EAAE,CAAC;wBACtB,CAAC,EACD,gBAAgB,EAAE,GAAG,EAAE;4BACrB,2BAA2B,CAAC,WAAW,CAAC,CAAC;4BACzC,cAAc,EAAE,EAAE,CAAC;wBACrB,CAAC,EACD,eAAe,EAAE,GAAG,EAAE;4BACpB,2BAA2B,CAAC,UAAU,CAAC,CAAC;4BACxC,aAAa,EAAE,EAAE,CAAC;wBACpB,CAAC,EACD,EAAE,EAAE,oBAAoB,EACxB,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,SAAS,gBAEd,KAAC,UAAU,oBAAK,eAAe,UAAI,YACpB,YAChB,CACJ,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,oBAAK,eAAe,UAAI,CACpC,EAEA,eAAe,IAAI,OAAO,EAE1B,QAAQ,IAAI,eAAe,IAAI,CAC9B,KAAC,IAAI,IACH,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,WAC/B,CACH,aACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n Ref,\n MouseEvent,\n useState,\n useEffect,\n useRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Tabs,\n Tab,\n ForwardProps,\n ExpandCollapse,\n defaultThemeProp,\n useConsolidatedRef,\n Icon,\n useI18n,\n useFocusWithin,\n Button,\n StyledIcon\n} from '@pega/cosmos-react-core';\n\nimport CaseHeader, { CaseHeaderProps } from '../CaseHeader';\n\nexport interface CaseSummaryProps extends CaseHeaderProps {\n /** A region to display any summary information about the CaseView. */\n summary: ReactNode;\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n /**\n * Forces rendering in the mobile layout, regardless of screen size.\n * @internal\n */\n forceMobile?: boolean;\n /**\n * Indicator for a desktop size.\n * @internal\n */\n desktop?: boolean;\n /** The fixed width string is needed for the expandable and collapsible header. */\n fixedWidth?: string;\n /** A boolean that toggles the collapsible feature of the case summary. */\n collapsible?: boolean;\n onBeforeCollapse?: () => void;\n onAfterCollapse?: () => void;\n onBeforeExpand?: () => void;\n onAfterExpand?: () => void;\n /** A callback that will return the animation state of the case summary. */\n onAnimationStateChange?: (state: AnimationState) => void;\n /** Ref for the header element inside the Case Summary */\n headerRef?: Ref<HTMLDivElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype AnimationState = 'expanding' | 'expanded' | 'collapsing' | 'collapsed';\n\nexport const StyledCaseSummary = styled.div<{ fixedWidth?: string }>(({ fixedWidth }) => {\n return css`\n position: relative;\n width: ${fixedWidth || 'auto'};\n max-width: ${fixedWidth ? 'none' : '100%'};\n min-height: 100%;\n\n &:hover {\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n inset-inline-start: 100%;\n width: 0.75rem;\n }\n }\n `;\n});\n\nconst StyledExpandCollapse = styled.div<{ animationState: AnimationState }>(\n ({ animationState }) => {\n const expandingOrCollapsing = ['expanding', 'collapsing'].includes(animationState);\n return css`\n position: ${expandingOrCollapsing ? 'fixed' : 'relative'};\n top: ${expandingOrCollapsing ? 'var(--appshell-offset, 0)' : 0};\n `;\n }\n);\n\nconst StyledExpandCollapseButton = styled(Button)<{\n expanded: boolean;\n headerHeight: number;\n animationState: AnimationState;\n visible: boolean;\n}>(({ theme, expanded, headerHeight, animationState, visible }) => {\n return css`\n border-radius: ${expanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};\n box-shadow: ${theme.base.shadow.high};\n border: none;\n display: 'flex';\n opacity: ${visible ? '1' : '0'};\n align-items: center;\n justify-content: center;\n min-height: 1.5rem;\n min-width: 1.5rem;\n position: ${animationState === 'collapsing' ? 'fixed' : 'absolute'};\n inset-inline-start: ${expanded ? 'calc(100% - 0.75rem)' : 0};\n top: calc(calc(${headerHeight}px / 2) - 0.75rem);\n z-index: 1;\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n transform: rotate(${expanded ? '0' : '180deg'});\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nconst CaseSummary: FunctionComponent<CaseSummaryProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CaseSummaryProps>, ref: CaseSummaryProps['ref']) => {\n const {\n icon,\n heading,\n caseId,\n caseLink,\n parentCases,\n followed,\n onFollowedChange,\n actions,\n onEdit,\n summary,\n tabs,\n forceMobile,\n collapsible = false,\n desktop = true,\n fixedWidth,\n onBeforeCollapse,\n onAfterCollapse,\n onBeforeExpand,\n onAfterExpand,\n onAnimationStateChange,\n headerRef: caseSummaryHeaderRef,\n ...restProps\n } = props;\n\n const [showExpandCollapse, setShowExpandCollapse] = useState(false);\n const expandCollapseBtnRef = useRef<HTMLButtonElement>(null);\n const [collapsed, setCollapsed] = useState(true);\n const isMediumOrAbove = !forceMobile && desktop;\n const [animationState, setAnimationState] = useState('expanded');\n const [collapsedHeight, setCollapsedHeight] = useState(0);\n const caseSummaryRef = useConsolidatedRef(ref);\n const focusWithin = useFocusWithin<HTMLDivElement>([caseSummaryRef.current]);\n const t = useI18n();\n\n const setAnimStateAndUpdateParent = (state: AnimationState) => {\n setAnimationState(state);\n onAnimationStateChange?.(state);\n };\n\n const headerRef = useConsolidatedRef<HTMLDivElement>(caseSummaryHeaderRef);\n\n const showTabs = (isMediumOrAbove && tabs.items.length > 1) || !isMediumOrAbove;\n\n const caseHeaderProps = {\n actions,\n onEdit,\n isMediumOrAbove,\n caseId,\n parentCases,\n heading,\n caseLink,\n icon,\n followed,\n onFollowedChange,\n style: {\n maxHeight: ['expanding', 'collapsed', 'collapsing'].includes(animationState)\n ? `${collapsedHeight}px`\n : 'auto'\n }\n };\n\n useEffect(() => {\n if (['expanded'].includes(animationState)) {\n setCollapsedHeight(headerRef.current?.offsetHeight || 0);\n }\n }, [animationState, headerRef.current]);\n\n const expandOrCollapseNoun = collapsed ? t('collapse_noun') : t('expand_noun');\n\n return (\n <Flex\n as={StyledCaseSummary}\n fixedWidth={fixedWidth}\n container={{ direction: 'column' }}\n item={{ shrink: 0 }}\n ref={caseSummaryRef}\n style={{\n marginTop: ['collapsing', 'expanding'].includes(animationState)\n ? `${collapsedHeight}px`\n : 0\n }}\n onMouseEnter={() => {\n setShowExpandCollapse(true);\n }}\n onMouseLeave={() => {\n setShowExpandCollapse(false);\n }}\n {...restProps}\n >\n {collapsible ? (\n <>\n <StyledExpandCollapseButton\n onClick={() => setCollapsed(!collapsed)}\n expanded={collapsed}\n headerHeight={collapsedHeight}\n animationState={animationState}\n label={\n ['expanded', 'collapsed'].includes(animationState)\n ? expandOrCollapseNoun\n : undefined\n }\n aria-label={\n ['expanding', 'collapsing'].includes(animationState)\n ? expandOrCollapseNoun\n : undefined\n }\n visible={showExpandCollapse || !collapsed || focusWithin}\n tabIndex={0}\n icon\n ref={expandCollapseBtnRef}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseButton>\n <ExpandCollapse\n dimension='width'\n min={isMediumOrAbove || !collapsed ? fixedWidth : '100%'}\n max='100%'\n collapsed={collapsed}\n onBeforeExpand={() => {\n setAnimStateAndUpdateParent('collapsing');\n onBeforeCollapse?.();\n }}\n onAfterExpand={() => {\n setAnimStateAndUpdateParent('collapsed');\n onAfterCollapse?.();\n }}\n onBeforeCollapse={() => {\n setAnimStateAndUpdateParent('expanding');\n onBeforeExpand?.();\n }}\n onAfterCollapse={() => {\n setAnimStateAndUpdateParent('expanded');\n onAfterExpand?.();\n }}\n as={StyledExpandCollapse}\n animationState={animationState}\n ref={headerRef}\n >\n <CaseHeader {...caseHeaderProps} />\n </ExpandCollapse>\n </>\n ) : (\n <CaseHeader {...caseHeaderProps} />\n )}\n\n {isMediumOrAbove && summary}\n\n {showTabs && isMediumOrAbove && (\n <Tabs\n type='vertical'\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </Flex>\n );\n }\n);\n\nexport default CaseSummary;\n"]}
1
+ {"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAMV,QAAQ,EACR,SAAS,EACT,MAAM,EACP,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,IAAI,EAGJ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,IAAI,EACJ,OAAO,EACP,cAAc,EACd,MAAM,EACN,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,UAA+B,MAAM,eAAe,CAAC;AAuC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAA0B,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACtF,OAAO,GAAG,CAAA;;aAEC,UAAU,IAAI,MAAM;iBAChB,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;;;;;;;;;;;;;GAa1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG9C,CAAC;AAEF,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CACrC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;IACrB,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACnF,OAAO,GAAG,CAAA;kBACI,qBAAqB,CAAC,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AAO,EAE1B,QAAQ,IAAI,eAAe,IAAI,CAC9B,KAAC,IAAI,IACH,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,WAC/B,CACH,YACqB,aACnB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n Ref,\n MouseEvent,\n useState,\n useEffect,\n useRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Tabs,\n Tab,\n ForwardProps,\n ExpandCollapse,\n defaultThemeProp,\n useConsolidatedRef,\n Icon,\n useI18n,\n useFocusWithin,\n Button,\n StyledIcon\n} from '@pega/cosmos-react-core';\n\nimport CaseHeader, { CaseHeaderProps } from '../CaseHeader';\n\nexport interface CaseSummaryProps extends CaseHeaderProps {\n /** A region to display any summary information about the CaseView. */\n summary: ReactNode;\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n /**\n * Forces rendering in the mobile layout, regardless of screen size.\n * @internal\n */\n forceMobile?: boolean;\n /**\n * Indicator for a desktop size.\n * @internal\n */\n desktop?: boolean;\n /** The fixed width string is needed for the expandable and collapsible header. */\n fixedWidth?: string;\n /** A boolean that toggles the collapsible feature of the case summary. */\n collapsible?: boolean;\n onBeforeCollapse?: () => void;\n onAfterCollapse?: () => void;\n onBeforeExpand?: () => void;\n onAfterExpand?: () => void;\n /** A callback that will return the animation state of the case summary. */\n onAnimationStateChange?: (state: AnimationState) => void;\n /** Ref for the header element inside the Case Summary */\n headerRef?: Ref<HTMLDivElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype AnimationState = 'expanding' | 'expanded' | 'collapsing' | 'collapsed';\n\nexport const StyledCaseSummary = styled.div<{ fixedWidth?: string }>(({ fixedWidth }) => {\n return css`\n position: relative;\n width: ${fixedWidth || 'auto'};\n max-width: ${fixedWidth ? 'none' : '100%'};\n height: 100%;\n\n &:hover {\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n inset-inline-start: 100%;\n width: 0.75rem;\n }\n }\n `;\n});\n\nexport const StyledCaseSummaryInfo = styled.div`\n overflow: auto;\n flex: 1;\n`;\n\nconst StyledExpandCollapse = styled.div<{ animationState: AnimationState }>(\n ({ animationState }) => {\n const expandingOrCollapsing = ['expanding', 'collapsing'].includes(animationState);\n return css`\n position: ${expandingOrCollapsing ? 'fixed' : 'relative'};\n top: ${expandingOrCollapsing ? 'var(--appshell-offset, 0)' : 0};\n `;\n }\n);\n\nconst StyledExpandCollapseButton = styled(Button)<{\n expanded: boolean;\n headerHeight: number;\n animationState: AnimationState;\n visible: boolean;\n}>(({ theme, expanded, headerHeight, animationState, visible }) => {\n return css`\n border-radius: ${expanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};\n box-shadow: ${theme.base.shadow.high};\n border: none;\n opacity: ${visible ? '1' : '0'};\n position: ${animationState === 'collapsing' ? 'fixed' : 'absolute'};\n inset-inline-start: ${expanded ? 'calc(100% - 0.75rem)' : 0};\n top: calc(calc(${headerHeight}px / 2) - 0.75rem);\n z-index: 1;\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n transform: rotate(${expanded ? '0' : '180deg'});\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nconst CaseSummary: FunctionComponent<CaseSummaryProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CaseSummaryProps>, ref: CaseSummaryProps['ref']) => {\n const {\n icon,\n heading,\n caseId,\n caseLink,\n parentCases,\n followed,\n onFollowedChange,\n actions,\n onEdit,\n summary,\n tabs,\n forceMobile,\n collapsible = false,\n desktop = true,\n fixedWidth,\n onBeforeCollapse,\n onAfterCollapse,\n onBeforeExpand,\n onAfterExpand,\n onAnimationStateChange,\n headerRef: caseSummaryHeaderRef,\n ...restProps\n } = props;\n\n const [showExpandCollapse, setShowExpandCollapse] = useState(false);\n const expandCollapseBtnRef = useRef<HTMLButtonElement>(null);\n const [collapsed, setCollapsed] = useState(true);\n const isMediumOrAbove = !forceMobile && desktop;\n const [animationState, setAnimationState] = useState('expanded');\n const [collapsedHeight, setCollapsedHeight] = useState(0);\n const caseSummaryRef = useConsolidatedRef(ref);\n const focusWithin = useFocusWithin<HTMLDivElement>([caseSummaryRef.current]);\n const t = useI18n();\n\n const setAnimStateAndUpdateParent = (state: AnimationState) => {\n setAnimationState(state);\n onAnimationStateChange?.(state);\n };\n\n const headerRef = useConsolidatedRef<HTMLDivElement>(caseSummaryHeaderRef);\n\n const showTabs = (isMediumOrAbove && tabs.items.length > 1) || !isMediumOrAbove;\n\n const caseHeaderProps = {\n actions,\n onEdit,\n isMediumOrAbove,\n caseId,\n parentCases,\n heading,\n caseLink,\n icon,\n followed,\n onFollowedChange,\n style: {\n maxHeight: ['expanding', 'collapsed', 'collapsing'].includes(animationState)\n ? `${collapsedHeight}px`\n : 'auto'\n }\n };\n\n useEffect(() => {\n if (['expanded'].includes(animationState)) {\n setCollapsedHeight(headerRef.current?.offsetHeight || 0);\n }\n }, [animationState, headerRef.current]);\n\n const expandOrCollapseNoun = collapsed ? t('collapse_noun') : t('expand_noun');\n\n return (\n <Flex\n as={StyledCaseSummary}\n fixedWidth={fixedWidth}\n container={{ direction: 'column' }}\n item={{ shrink: 0 }}\n ref={caseSummaryRef}\n style={{\n marginTop: ['collapsing', 'expanding'].includes(animationState)\n ? `${collapsedHeight}px`\n : 0\n }}\n onMouseEnter={() => {\n setShowExpandCollapse(true);\n }}\n onMouseLeave={() => {\n setShowExpandCollapse(false);\n }}\n {...restProps}\n >\n {collapsible ? (\n <>\n <StyledExpandCollapseButton\n onClick={() => setCollapsed(!collapsed)}\n expanded={collapsed}\n headerHeight={collapsedHeight}\n animationState={animationState}\n label={\n ['expanded', 'collapsed'].includes(animationState)\n ? expandOrCollapseNoun\n : undefined\n }\n aria-label={\n ['expanding', 'collapsing'].includes(animationState)\n ? expandOrCollapseNoun\n : undefined\n }\n visible={showExpandCollapse || !collapsed || focusWithin}\n tabIndex={0}\n icon\n compact\n ref={expandCollapseBtnRef}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseButton>\n <ExpandCollapse\n dimension='width'\n min={isMediumOrAbove || !collapsed ? fixedWidth : '100%'}\n max='100%'\n collapsed={collapsed}\n onBeforeExpand={() => {\n setAnimStateAndUpdateParent('collapsing');\n onBeforeCollapse?.();\n }}\n onAfterExpand={() => {\n setAnimStateAndUpdateParent('collapsed');\n onAfterCollapse?.();\n }}\n onBeforeCollapse={() => {\n setAnimStateAndUpdateParent('expanding');\n onBeforeExpand?.();\n }}\n onAfterCollapse={() => {\n setAnimStateAndUpdateParent('expanded');\n onAfterExpand?.();\n }}\n as={StyledExpandCollapse}\n animationState={animationState}\n ref={headerRef}\n >\n <CaseHeader {...caseHeaderProps} />\n </ExpandCollapse>\n </>\n ) : (\n <CaseHeader {...caseHeaderProps} />\n )}\n <StyledCaseSummaryInfo>\n {isMediumOrAbove && summary}\n\n {showTabs && isMediumOrAbove && (\n <Tabs\n type='vertical'\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </StyledCaseSummaryInfo>\n </Flex>\n );\n }\n);\n\nexport default CaseSummary;\n"]}
@@ -11,6 +11,8 @@ export interface CaseViewProps extends CaseSummaryProps {
11
11
  utilities?: ReactNode;
12
12
  /** The utilities summary array will be used to render the minimized the utilities card. */
13
13
  utilitiesSummaryItems?: UtilitiesSummaryProps['items'];
14
+ /** Collapses the utilities by default on load */
15
+ defaultCollapsedUtilities?: boolean;
14
16
  /** A region above the center column to display banners. */
15
17
  banners?: ReactNode;
16
18
  /** A region to the right reserved for persistent utilities. */
@@ -19,7 +21,10 @@ export interface CaseViewProps extends CaseSummaryProps {
19
21
  title: string;
20
22
  };
21
23
  /** A region within the center column that is controlled by tabs in CaseSummary. */
22
- tabContent?: ReactNode;
24
+ tabContent?: {
25
+ content: ReactNode;
26
+ id: string;
27
+ }[];
23
28
  }
24
29
  declare const CaseView: FC<CaseViewProps & ForwardProps>;
25
30
  export default CaseView;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,EAAE,EAWH,MAAM,OAAO,CAAC;AAEf,OAAO,EAQL,YAAY,EAMb,MAAM,yBAAyB,CAAC;AAIjC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAyB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAa7E,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2FAA2F;IAC3F,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,mFAAmF;IACnF,UAAU,CAAC,EAAE,SAAS,CAAC;CAMxB;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAqY9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,EAAE,EAWH,MAAM,OAAO,CAAC;AAEf,OAAO,EASL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAIjC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAyB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAa7E,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2FAA2F;IAC3F,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,mFAAmF;IACnF,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAMnD;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CA6b9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,17 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext, useEffect, useState, useCallback, useMemo, useRef, useLayoutEffect } from 'react';
3
- import { Button, Flex, Grid, Icon, TabPanel, useBreakpoint, useScrollStick, Card, Drawer, useI18n, useDirection, useConsolidatedRef } from '@pega/cosmos-react-core';
3
+ import { Button, Flex, Grid, Icon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, useConsolidatedRef } from '@pega/cosmos-react-core';
4
4
  import AppShellContext from '@pega/cosmos-react-core/lib/components/AppShell/AppShellContext';
5
5
  import CaseSummary from '../CaseSummary';
6
6
  import UtilitiesSummary from './UtilitiesSummary';
7
7
  import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledCaseViewContent, StyledPersistentUtility, StyledSummaryRegion, StyledCaseViewUtilities, StyledMobileTabs, StyledUtilToggle } from './CaseView.styles';
8
8
  const CaseView = (props) => {
9
- const { caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, caseSummaryRef, tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick }, stages, tasks, tabContent: tabContentProp, utilities, utilitiesSummaryItems, actions, onEdit, banners, persistentUtility, forceMobile, ...restProps } = props;
9
+ const { caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, caseSummaryRef, tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick }, stages, tasks, tabContent: tabContentProp = [], utilities, utilitiesSummaryItems, defaultCollapsedUtilities = false, actions, onEdit, banners, persistentUtility, forceMobile, ...restProps } = props;
10
10
  const t = useI18n();
11
11
  const caseViewRef = useRef(null);
12
12
  const caseViewSummaryRef = useConsolidatedRef(caseSummaryRef);
13
13
  const caseSummaryHeaderRef = useRef(null);
14
14
  const caseViewSummaryContainerRef = useRef(null);
15
+ const [tabContentEl, setTabContentEl] = useElement(null);
15
16
  let isExtraLargeOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });
16
17
  let isLargeOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });
17
18
  let isMediumOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });
@@ -36,8 +37,9 @@ const CaseView = (props) => {
36
37
  const summaryTabId = `summary-${caseId}`;
37
38
  const utilitiesTabId = `utilities-${caseId}`;
38
39
  const persistentUtilityTabId = `persistent-utility-${caseId}`;
39
- const [utilitiesShown, setUtilitiesShown] = useState(isLargeOrAbove);
40
- const [userUtilState, setUserUtilState] = useState();
40
+ const [utilitiesShown, setUtilitiesShown] = useState(isLargeOrAbove && !defaultCollapsedUtilities);
41
+ const initialUserUtilState = defaultCollapsedUtilities ? 'hidden' : undefined;
42
+ const [userUtilState, setUserUtilState] = useState(initialUserUtilState);
41
43
  const [summaryPanelCollapsed, setSummaryPanelCollapsed] = useState(false);
42
44
  const hasSideBySideColumns = isMediumOrAbove;
43
45
  const scrollStickOptions = useRef({
@@ -66,11 +68,19 @@ const CaseView = (props) => {
66
68
  }, [isLargeOrAbove]);
67
69
  useEffect(() => {
68
70
  if (isMediumOrAbove &&
71
+ !summaryPanelCollapsed &&
69
72
  !persistentUtility &&
70
73
  (currentTabId === summaryTabId || currentTabId === utilitiesTabId)) {
71
74
  onTabClick(tabItemsProp[0]?.id);
72
75
  }
73
- }, [isMediumOrAbove, onTabClick, currentTabId, summaryTabId, utilitiesTabId]);
76
+ }, [
77
+ isMediumOrAbove,
78
+ onTabClick,
79
+ currentTabId,
80
+ summaryTabId,
81
+ utilitiesTabId,
82
+ summaryPanelCollapsed
83
+ ]);
74
84
  useEffect(() => {
75
85
  if ((isMediumOrAbove && !isLargeOrAbove && utilities) || persistentUtility)
76
86
  setUtilitiesShown(false);
@@ -80,18 +90,20 @@ const CaseView = (props) => {
80
90
  onTabClick(summaryTabId);
81
91
  }, [persistentUtility]);
82
92
  const tabItems = useMemo(() => {
93
+ const summaryTab = { id: summaryTabId, name: 'Summary' };
83
94
  if (isMediumOrAbove)
84
- return persistentUtility || summaryPanelCollapsed
85
- ? [{ id: summaryTabId, name: 'Summary' }, ...tabItemsProp]
95
+ return summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove)
96
+ ? [summaryTab, ...tabItemsProp]
86
97
  : tabItemsProp;
87
98
  const utilityTabs = [];
88
99
  if (utilities)
89
100
  utilityTabs.push({ id: utilitiesTabId, name: 'Utilities' });
90
101
  if (persistentUtility && !isMediumOrAbove)
91
102
  utilityTabs.push({ id: persistentUtilityTabId, name: persistentUtility.title });
92
- return [{ id: summaryTabId, name: 'Summary' }, ...tabItemsProp, ...utilityTabs];
103
+ return [summaryTab, ...tabItemsProp, ...utilityTabs];
93
104
  }, [
94
105
  isMediumOrAbove,
106
+ isExtraLargeOrAbove,
95
107
  summaryTabId,
96
108
  utilitiesTabId,
97
109
  persistentUtilityTabId,
@@ -100,16 +112,43 @@ const CaseView = (props) => {
100
112
  tabItemsProp,
101
113
  summaryPanelCollapsed
102
114
  ]);
103
- const tabContent = useMemo(() => {
104
- if (currentTabId === summaryTabId)
105
- return _jsx(Card, { children: summary }, void 0);
106
- if (currentTabId === utilitiesTabId) {
107
- return _jsx(Flex, Object.assign({ container: { direction: 'column', gap: 2 } }, { children: utilities }), void 0);
115
+ useEffect(() => {
116
+ if (!tabContentEl)
117
+ return;
118
+ const scrollPos = window.scrollY;
119
+ const windowHeight = document.documentElement.clientHeight;
120
+ const bottomPos = scrollPos + windowHeight * 0.8;
121
+ const tabContentPos = tabContentEl.offsetTop;
122
+ if (tabContentPos > bottomPos) {
123
+ const top = tabContentPos - windowHeight * 0.2;
124
+ window.scrollTo({ top, behavior: 'smooth' });
108
125
  }
109
- if (currentTabId === persistentUtilityTabId)
110
- return persistentUtility?.content;
111
- return tabContentProp;
112
- }, [currentTabId, tabContentProp, summary, summaryTabId, utilities, utilitiesTabId]);
126
+ }, [currentTabId]);
127
+ const tabContent = useMemo(() => {
128
+ const summaryTabContent = { id: summaryTabId, content: _jsx(Card, { children: summary }, void 0) };
129
+ if (isMediumOrAbove)
130
+ return summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove)
131
+ ? [summaryTabContent, ...tabContentProp]
132
+ : tabContentProp;
133
+ const utilityTabs = [];
134
+ if (utilities)
135
+ utilityTabs.push({
136
+ id: utilitiesTabId,
137
+ content: _jsx(Flex, Object.assign({ container: { direction: 'column', gap: 2 } }, { children: utilities }), void 0)
138
+ });
139
+ if (persistentUtility)
140
+ utilityTabs.push({ id: persistentUtilityTabId, content: persistentUtility?.content });
141
+ return [summaryTabContent, ...tabContentProp, ...utilityTabs];
142
+ }, [
143
+ currentTabId,
144
+ tabContentProp,
145
+ summary,
146
+ summaryTabId,
147
+ utilities,
148
+ utilitiesTabId,
149
+ isMediumOrAbove,
150
+ isExtraLargeOrAbove
151
+ ]);
113
152
  const direction = useDirection();
114
153
  const utilitiesIcon = utilitiesShown
115
154
  ? `move-${direction.end}-solid`
@@ -192,9 +231,9 @@ const CaseView = (props) => {
192
231
  }, item: { area: 'content' }, as: StyledCaseViewContent, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove, persistentUtility: Boolean(persistentUtility), style: {
193
232
  transform: ['collapsing', 'expanding'].includes(summaryAnimationState)
194
233
  ? `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
195
- : 'translate(0, 0)',
196
- marginInlineStart: summaryPanelCollapsed ? '1rem' : 0
197
- } }, { children: [banners && _jsx("div", { children: banners }, void 0), stages && _jsx("div", { children: stages }, void 0), tasks && _jsx("div", { children: tasks }, void 0), (!isMediumOrAbove || persistentUtility || summaryPanelCollapsed) && (_jsx(StyledMobileTabs, { type: 'horizontal', tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId, fullWidth: !isMediumOrAbove }, void 0)), currentTabId ? _jsx(TabPanel, Object.assign({ tabId: currentTabId }, { children: tabContent }), void 0) : tabContent] }), void 0), persistentUtility && isMediumOrAbove && (_jsx(Grid, Object.assign({ as: StyledPersistentUtility, item: { area: 'persistentUtility' } }, { children: persistentUtility.content }), void 0)), !isLargeOrAbove && (_jsx(Drawer, Object.assign({ as: StyledCaseDrawer, open: utilitiesShown && isMediumOrAbove, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility }, { children: _jsxs(Flex, Object.assign({ as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 } }, { children: [_jsx(Flex, Object.assign({ container: { justify: 'end' } }, { children: _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t('collapse_noun', t('utilities_panel')) }, { children: _jsx(Icon, { name: `move-${direction.end}-solid` }, void 0) }), void 0) }), void 0), utilities] }), void 0) }), void 0)), utilities && isMediumOrAbove && (_jsxs(Grid, Object.assign({ ref: (el) => {
234
+ : undefined,
235
+ marginInlineStart: summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove) ? '1rem' : 0
236
+ } }, { children: [banners && _jsx("div", { children: banners }, void 0), stages && _jsx("div", { children: stages }, void 0), tasks && _jsx("div", { children: tasks }, void 0), (!isMediumOrAbove || persistentUtility || summaryPanelCollapsed) && (_jsx(StyledMobileTabs, { type: 'horizontal', tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId, fullWidth: !isMediumOrAbove }, void 0)), _jsx("div", Object.assign({ ref: setTabContentEl }, { children: tabContent?.map(({ id, content }) => (_jsx(TabPanel, Object.assign({ currentTabId: currentTabId, tabId: id }, { children: content }), id))) }), void 0)] }), void 0), persistentUtility && isMediumOrAbove && (_jsx(Grid, Object.assign({ as: StyledPersistentUtility, item: { area: 'persistentUtility' } }, { children: persistentUtility.content }), void 0)), !isLargeOrAbove && (_jsx(Drawer, Object.assign({ as: StyledCaseDrawer, open: utilitiesShown && isMediumOrAbove, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility }, { children: _jsxs(Flex, Object.assign({ as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 } }, { children: [_jsx(Flex, Object.assign({ container: { justify: 'end' } }, { children: _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t('collapse_noun', t('utilities_panel')) }, { children: _jsx(Icon, { name: `move-${direction.end}-solid` }, void 0) }), void 0) }), void 0), utilities] }), void 0) }), void 0)), utilities && isMediumOrAbove && (_jsxs(Grid, Object.assign({ ref: (el) => {
198
237
  if (el)
199
238
  (scrollStickOptions.current?.elements).push(el);
200
239
  }, as: StyledCaseViewUtilities, container: {
@@ -202,11 +241,11 @@ const CaseView = (props) => {
202
241
  rowGap: 2
203
242
  }, item: {
204
243
  area: 'utilities'
205
- }, utilitiesShown: utilitiesShown && isLargeOrAbove, style: {
206
- transform: ['collapsing', 'expanding'].includes(summaryAnimationState)
207
- ? `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
208
- : 'translate(0, 0)'
209
- } }, { children: [_jsx(Flex, Object.assign({ container: { justify: utilitiesShown ? 'end' : 'center' } }, { children: _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t(utilitiesShown ? 'collapse_noun' : 'expand_noun', t('utilities_panel')) }, { children: _jsx(Icon, { name: utilitiesIcon }, void 0) }), void 0) }), void 0), _jsx(Flex, Object.assign({ container: utilitiesShown && isLargeOrAbove ? { direction: 'column', gap: 2 } : false, hidden: !utilitiesShown || !isLargeOrAbove }, { children: utilities }), void 0), (!utilitiesShown || (isMediumOrAbove && !isLargeOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems || [], onClick: toggleUtilities, onKeyDown: toggleUtilities }, void 0))] }), void 0))] }), void 0));
244
+ }, utilitiesShown: utilitiesShown && isLargeOrAbove, style: ['collapsing', 'expanding'].includes(summaryAnimationState)
245
+ ? {
246
+ transform: `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
247
+ }
248
+ : undefined }, { children: [_jsx(Flex, Object.assign({ container: { justify: utilitiesShown ? 'end' : 'center' } }, { children: _jsx(Button, Object.assign({ variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t(utilitiesShown ? 'collapse_noun' : 'expand_noun', t('utilities_panel')) }, { children: _jsx(Icon, { name: utilitiesIcon }, void 0) }), void 0) }), void 0), _jsx(Flex, Object.assign({ container: utilitiesShown && isLargeOrAbove ? { direction: 'column', gap: 2 } : false, hidden: !utilitiesShown || !isLargeOrAbove }, { children: utilities }), void 0), (!utilitiesShown || (isMediumOrAbove && !isLargeOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems || [], onClick: toggleUtilities, onKeyDown: toggleUtilities }, void 0))] }), void 0))] }), void 0));
210
249
  };
211
250
  export default CaseView;
212
251
  //# sourceMappingURL=CaseView.js.map