@pega/cosmos-react-work 10.0.0-build.2.9 → 10.0.0-build.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +8 -4
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +12 -5
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.test-ids.d.ts +2 -0
- package/lib/components/AppAnnouncement/AppAnnouncement.test-ids.d.ts.map +1 -0
- package/lib/components/AppAnnouncement/AppAnnouncement.test-ids.js +8 -0
- package/lib/components/AppAnnouncement/AppAnnouncement.test-ids.js.map +1 -0
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +4 -9
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +5 -4
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/lib/components/Details/Details.d.ts.map +1 -1
- package/lib/components/Details/Details.js +8 -3
- package/lib/components/Details/Details.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +1 -1
- package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +17 -9
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +2 -0
- package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.js +4 -4
- package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.d.ts.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.js +20 -10
- package/lib/components/Shortcuts/Shortcuts.js.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.styles.d.ts +1 -0
- package/lib/components/Shortcuts/Shortcuts.styles.d.ts.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.styles.js +6 -1
- package/lib/components/Shortcuts/Shortcuts.styles.js.map +1 -1
- package/lib/components/Tags/Tags.js +1 -1
- package/lib/components/Tags/Tags.js.map +1 -1
- package/lib/components/Tasks/TaskCard.js +1 -1
- package/lib/components/Tasks/TaskCard.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
|
-
import type { BaseProps, ForwardRefForwardPropsComponent, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface AppAnnouncementProps extends BaseProps, NoChildrenProp {
|
|
2
|
+
import type { BaseProps, ForwardRefForwardPropsComponent, NoChildrenProp, TestIdProp } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface AppAnnouncementProps extends BaseProps, NoChildrenProp, TestIdProp {
|
|
4
4
|
/** Heading text for the announcement. */
|
|
5
5
|
heading?: string;
|
|
6
6
|
/** Description text for the announcement. */
|
|
@@ -11,6 +11,8 @@ export interface AppAnnouncementProps extends BaseProps, NoChildrenProp {
|
|
|
11
11
|
whatsNewLink?: string;
|
|
12
12
|
/** Content to populate the announcement button. */
|
|
13
13
|
whatsNewText?: string;
|
|
14
|
+
/** When provided, the heading renders as a link to this URL and the What's new button is hidden. */
|
|
15
|
+
headingUrl?: string;
|
|
14
16
|
/** An image source for the decorative background. */
|
|
15
17
|
image?: string;
|
|
16
18
|
/**
|
|
@@ -23,6 +25,8 @@ export interface AppAnnouncementProps extends BaseProps, NoChildrenProp {
|
|
|
23
25
|
}
|
|
24
26
|
export declare const StyledAppAnnouncementContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
27
|
export declare const StyledAppAnnouncement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, Pick<AppAnnouncementProps, "image" | "fitToParent">>> & string;
|
|
26
|
-
declare const
|
|
27
|
-
|
|
28
|
+
declare const _default: ForwardRefForwardPropsComponent<AppAnnouncementProps> & {
|
|
29
|
+
getTestIds: (testIdProp?: TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "dismiss", "whats-new"]>;
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
28
32
|
//# sourceMappingURL=AppAnnouncement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAiBlD,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACd,UAAU,EACX,MAAM,yBAAyB,CAAC;AAOjC,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc,EAAE,UAAU;IACjF,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oGAAoG;IACpG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAaD,eAAO,MAAM,4BAA4B,6NAiCvC,CAAC;AAIH,eAAO,MAAM,qBAAqB,kRA4EhC,CAAC;;;;AAsFH,wBAAuE"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Button, StyledButton, Text, Icon, registerIcon, useI18n, defaultThemeProp, useDirection, calculateForegroundColor, HTML } from '@pega/cosmos-react-core';
|
|
4
|
+
import { Button, StyledButton, Text, Icon, registerIcon, useI18n, defaultThemeProp, useDirection, calculateForegroundColor, HTML, useTestIds, withTestIds } from '@pega/cosmos-react-core';
|
|
5
5
|
import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
6
|
+
import { getAppAnnouncementTestIds } from './AppAnnouncement.test-ids';
|
|
6
7
|
registerIcon(timesIcon);
|
|
7
8
|
const StyledDismissButton = styled.button `
|
|
8
9
|
font-size: 1.25rem;
|
|
9
10
|
border: none;
|
|
10
11
|
`;
|
|
12
|
+
const StyledHeadingLink = styled(Button) `
|
|
13
|
+
color: inherit;
|
|
14
|
+
`;
|
|
15
|
+
StyledHeadingLink.defaultProps = defaultThemeProp;
|
|
11
16
|
export const StyledAppAnnouncementContent = styled.div(props => {
|
|
12
17
|
const { theme: { base: { spacing } } } = props;
|
|
13
18
|
return css `
|
|
@@ -105,12 +110,14 @@ export const StyledAppAnnouncement = styled.article(props => {
|
|
|
105
110
|
StyledAppAnnouncement.defaultProps = defaultThemeProp;
|
|
106
111
|
const AppAnnouncement = forwardRef(function AppAnnouncement(props, ref) {
|
|
107
112
|
const t = useI18n();
|
|
108
|
-
const { heading, description, details, whatsNewLink, whatsNewText = t('app_announcement_whats_new_button_label'), image, onDismiss, ...restProps } = props;
|
|
109
|
-
|
|
113
|
+
const { heading, description, details, whatsNewLink, whatsNewText = t('app_announcement_whats_new_button_label'), headingUrl, image, onDismiss, testId, ...restProps } = props;
|
|
114
|
+
const testIds = useTestIds(testId, getAppAnnouncementTestIds);
|
|
115
|
+
const resolvedHeading = heading || t('app_announcement_details_list_header');
|
|
116
|
+
return (_jsxs(StyledAppAnnouncement, { "data-testid": testIds.root, ...restProps, ref: ref, image: image, children: [onDismiss && (_jsx(Button, { as: StyledDismissButton, variant: 'simple', icon: true, onClick: onDismiss, "aria-label": t('app_announcement_dismiss_button_label_a11y'), children: _jsx(Icon, { name: 'times' }) })), _jsx(Text, { variant: 'h2', "data-testid": testIds.heading, children: headingUrl ? (_jsx(StyledHeadingLink, { variant: 'link', href: headingUrl, target: '_blank', rel: 'noopener noreferrer', children: resolvedHeading })) : (resolvedHeading) }), _jsxs("div", { children: [_jsxs(StyledAppAnnouncementContent, { children: [description && _jsx(HTML, { as: 'p', content: description, "data-testid": testIds.description }), !!details?.length && (_jsx("ul", { children: details.map((item, index) => {
|
|
110
117
|
return (
|
|
111
118
|
// eslint-disable-next-line react/no-array-index-key
|
|
112
119
|
_jsx("li", { children: _jsx(HTML, { content: item }) }, index));
|
|
113
|
-
}) }))] }), whatsNewLink && (_jsx(Button, { variant: 'secondary', href: whatsNewLink, target: '_blank', children: whatsNewText }))] })] }));
|
|
120
|
+
}) }))] }), !headingUrl && whatsNewLink && (_jsx(Button, { variant: 'secondary', href: whatsNewLink, target: '_blank', "data-testid": testIds.whatsNew, children: whatsNewText }))] })] }));
|
|
114
121
|
});
|
|
115
|
-
export default AppAnnouncement;
|
|
122
|
+
export default withTestIds(AppAnnouncement, getAppAnnouncementTestIds);
|
|
116
123
|
//# sourceMappingURL=AppAnnouncement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAMjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,YAAY,CAAC,SAAS,CAAC,CAAC;AAwBxB,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAA;;;CAGxC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC7D,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,CAAA;;;qCAGyB,OAAO;+BACb,OAAO;+BACP,OAAO;;;;;;;;uCAQC,OAAO;;;;uCAIP,OAAO;;;;;4BAKlB,OAAO;;;GAGhC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,4BAA4B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAEjD,KAAK,CAAC,EAAE;IACR,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EACzB,UAAU,EAAE,EACV,IAAI,E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GACd,CACV,EACD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,OAAO,IAAI,CAAC,CAAC,sCAAsC,CAAC,GAAQ,EAChF,0BACE,MAAC,4BAA4B,eAC1B,WAAW,IAAI,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,WAAW,GAAI,EACpD,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,CACpB,uBACG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;oCAC3B,OAAO;oCACL,oDAAoD;oCACpD,uBACE,KAAC,IAAI,IAAC,OAAO,EAAE,IAAI,GAAI,IADhB,KAAK,CAET,CACN,CAAC;gCACJ,CAAC,CAAC,GACC,CACN,IAC4B,EAC9B,YAAY,IAAI,CACf,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAC,QAAQ,YAC5D,YAAY,GACN,CACV,IACG,IACgB,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n StyledButton,\n Text,\n Icon,\n registerIcon,\n useI18n,\n defaultThemeProp,\n useDirection,\n calculateForegroundColor,\n HTML\n} from '@pega/cosmos-react-core';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nregisterIcon(timesIcon);\n\nexport interface AppAnnouncementProps extends BaseProps, NoChildrenProp {\n /** Heading text for the announcement. */\n heading?: string;\n /** Description text for the announcement. */\n description?: string;\n /** Announcement details to be displayed in form of bulleted list. */\n details?: string[];\n /** Url to open with What's new link. */\n whatsNewLink?: string;\n /** Content to populate the announcement button. */\n whatsNewText?: string;\n /** An image source for the decorative background. */\n image?: string;\n /**\n * Whether to fit AppAnnouncement widget in the parent element.\n */\n fitToParent?: boolean;\n /** Callback when user dismisses the announcements. */\n onDismiss?: () => void;\n ref?: Ref<HTMLElement>;\n}\n\nconst StyledDismissButton = styled.button`\n font-size: 1.25rem;\n border: none;\n`;\n\nexport const StyledAppAnnouncementContent = styled.div(props => {\n const {\n theme: {\n base: { spacing }\n }\n } = props;\n\n return css`\n max-height: 12rem;\n overflow-y: auto;\n margin-block-start: calc(1.5 * ${spacing});\n margin-inline: calc(-2 * ${spacing});\n padding-inline: calc(2 * ${spacing});\n\n p,\n ul {\n line-height: 1.4;\n }\n\n ul {\n padding-inline-start: calc(2 * ${spacing});\n }\n\n p + ul {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n li {\n &:not(:last-child) {\n margin-block-end: ${spacing};\n }\n }\n `;\n});\n\nStyledAppAnnouncementContent.defaultProps = defaultThemeProp;\n\nexport const StyledAppAnnouncement = styled.article<\n Pick<AppAnnouncementProps, 'image' | 'fitToParent'>\n>(props => {\n const {\n theme: {\n base: { shadow, spacing },\n components: {\n card: { 'border-radius': borderRadius },\n announcement: { background, 'foreground-color': foregroundColor }\n }\n },\n image\n } = props;\n\n const { end } = useDirection();\n const color = calculateForegroundColor(background, foregroundColor);\n\n return css`\n padding: calc(2 * ${spacing});\n background: ${background};\n border-radius: ${borderRadius};\n color: ${color};\n position: relative;\n\n ${props.fitToParent && 'block-size: 100%;'};\n\n &::after {\n background: url('${image}') no-repeat;\n background-position: ${end} bottom;\n background-size: contain;\n background-origin: content-box;\n opacity: 0.2;\n content: '';\n display: block;\n position: absolute;\n width: 50%;\n height: 100%;\n inset-inline-end: 0;\n bottom: 0;\n padding: calc(2 * ${spacing});\n }\n\n h2 {\n position: relative;\n z-index: 2;\n }\n\n ${StyledDismissButton} {\n position: absolute;\n top: 0.75rem;\n inset-inline-end: 0.75rem;\n color: inherit;\n z-index: 3;\n &:enabled:hover {\n background: #ffffff19;\n }\n &:enabled:focus-visible {\n box-shadow: ${shadow.focus};\n }\n }\n\n > div {\n position: relative;\n z-index: 2;\n\n ${StyledButton} {\n margin-top: calc(2 * ${spacing});\n white-space: normal;\n\n &:enabled:focus-visible,\n &:not([disabled]):focus-visible {\n box-shadow: ${shadow.focus};\n }\n }\n }\n `;\n});\n\nStyledAppAnnouncement.defaultProps = defaultThemeProp;\n\nconst AppAnnouncement: ForwardRefForwardPropsComponent<AppAnnouncementProps> = forwardRef(\n function AppAnnouncement(\n props: PropsWithoutRef<AppAnnouncementProps>,\n ref: AppAnnouncementProps['ref']\n ) {\n const t = useI18n();\n const {\n heading,\n description,\n details,\n whatsNewLink,\n whatsNewText = t('app_announcement_whats_new_button_label'),\n image,\n onDismiss,\n ...restProps\n } = props;\n\n return (\n <StyledAppAnnouncement {...restProps} ref={ref} image={image}>\n {onDismiss && (\n <Button\n as={StyledDismissButton}\n variant='simple'\n icon\n onClick={onDismiss}\n aria-label={t('app_announcement_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </Button>\n )}\n <Text variant='h2'>{heading || t('app_announcement_details_list_header')}</Text>\n <div>\n <StyledAppAnnouncementContent>\n {description && <HTML as='p' content={description} />}\n {!!details?.length && (\n <ul>\n {details.map((item, index) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <li key={index}>\n <HTML content={item} />\n </li>\n );\n })}\n </ul>\n )}\n </StyledAppAnnouncementContent>\n {whatsNewLink && (\n <Button variant='secondary' href={whatsNewLink} target='_blank'>\n {whatsNewText}\n </Button>\n )}\n </div>\n </StyledAppAnnouncement>\n );\n }\n);\n\nexport default AppAnnouncement;\n"]}
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,E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AI,EAAC,OAAO,GAAG,GACd,CACV,EACD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,iBAAc,OAAO,CAAC,OAAO,YAC5C,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,iBAAiB,IAChB,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,UAAU,EAChB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,YAExB,eAAe,GACE,CACrB,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,GACI,EACP,0BACE,MAAC,4BAA4B,eAC1B,WAAW,IAAI,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,WAAW,iBAAe,OAAO,CAAC,WAAW,GAAI,EACtF,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,CACpB,uBACG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;oCAC3B,OAAO;oCACL,oDAAoD;oCACpD,uBACE,KAAC,IAAI,IAAC,OAAO,EAAE,IAAI,GAAI,IADhB,KAAK,CAET,CACN,CAAC;gCACJ,CAAC,CAAC,GACC,CACN,IAC4B,EAC9B,CAAC,UAAU,IAAI,YAAY,IAAI,CAC9B,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAC,QAAQ,iBACF,OAAO,CAAC,QAAQ,YAE5B,YAAY,GACN,CACV,IACG,IACgB,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n StyledButton,\n Text,\n Icon,\n registerIcon,\n useI18n,\n defaultThemeProp,\n useDirection,\n calculateForegroundColor,\n HTML,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp,\n TestIdProp\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport { getAppAnnouncementTestIds } from './AppAnnouncement.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface AppAnnouncementProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** Heading text for the announcement. */\n heading?: string;\n /** Description text for the announcement. */\n description?: string;\n /** Announcement details to be displayed in form of bulleted list. */\n details?: string[];\n /** Url to open with What's new link. */\n whatsNewLink?: string;\n /** Content to populate the announcement button. */\n whatsNewText?: string;\n /** When provided, the heading renders as a link to this URL and the What's new button is hidden. */\n headingUrl?: string;\n /** An image source for the decorative background. */\n image?: string;\n /**\n * Whether to fit AppAnnouncement widget in the parent element.\n */\n fitToParent?: boolean;\n /** Callback when user dismisses the announcements. */\n onDismiss?: () => void;\n ref?: Ref<HTMLElement>;\n}\n\nconst StyledDismissButton = styled.button`\n font-size: 1.25rem;\n border: none;\n`;\n\nconst StyledHeadingLink = styled(Button)`\n color: inherit;\n`;\n\nStyledHeadingLink.defaultProps = defaultThemeProp;\n\nexport const StyledAppAnnouncementContent = styled.div(props => {\n const {\n theme: {\n base: { spacing }\n }\n } = props;\n\n return css`\n max-height: 12rem;\n overflow-y: auto;\n margin-block-start: calc(1.5 * ${spacing});\n margin-inline: calc(-2 * ${spacing});\n padding-inline: calc(2 * ${spacing});\n\n p,\n ul {\n line-height: 1.4;\n }\n\n ul {\n padding-inline-start: calc(2 * ${spacing});\n }\n\n p + ul {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n li {\n &:not(:last-child) {\n margin-block-end: ${spacing};\n }\n }\n `;\n});\n\nStyledAppAnnouncementContent.defaultProps = defaultThemeProp;\n\nexport const StyledAppAnnouncement = styled.article<\n Pick<AppAnnouncementProps, 'image' | 'fitToParent'>\n>(props => {\n const {\n theme: {\n base: { shadow, spacing },\n components: {\n card: { 'border-radius': borderRadius },\n announcement: { background, 'foreground-color': foregroundColor }\n }\n },\n image\n } = props;\n\n const { end } = useDirection();\n const color = calculateForegroundColor(background, foregroundColor);\n\n return css`\n padding: calc(2 * ${spacing});\n background: ${background};\n border-radius: ${borderRadius};\n color: ${color};\n position: relative;\n\n ${props.fitToParent && 'block-size: 100%;'};\n\n &::after {\n background: url('${image}') no-repeat;\n background-position: ${end} bottom;\n background-size: contain;\n background-origin: content-box;\n opacity: 0.2;\n content: '';\n display: block;\n position: absolute;\n width: 50%;\n height: 100%;\n inset-inline-end: 0;\n bottom: 0;\n padding: calc(2 * ${spacing});\n }\n\n h2 {\n position: relative;\n z-index: 2;\n }\n\n ${StyledDismissButton} {\n position: absolute;\n top: 0.75rem;\n inset-inline-end: 0.75rem;\n color: inherit;\n z-index: 3;\n &:enabled:hover {\n background: #ffffff19;\n }\n &:enabled:focus-visible {\n box-shadow: ${shadow.focus};\n }\n }\n\n > div {\n position: relative;\n z-index: 2;\n\n ${StyledButton} {\n margin-top: calc(2 * ${spacing});\n white-space: normal;\n\n &:enabled:focus-visible,\n &:not([disabled]):focus-visible {\n box-shadow: ${shadow.focus};\n }\n }\n }\n `;\n});\n\nStyledAppAnnouncement.defaultProps = defaultThemeProp;\n\nconst AppAnnouncement: ForwardRefForwardPropsComponent<AppAnnouncementProps> = forwardRef(\n function AppAnnouncement(\n props: PropsWithoutRef<AppAnnouncementProps>,\n ref: AppAnnouncementProps['ref']\n ) {\n const t = useI18n();\n const {\n heading,\n description,\n details,\n whatsNewLink,\n whatsNewText = t('app_announcement_whats_new_button_label'),\n headingUrl,\n image,\n onDismiss,\n testId,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getAppAnnouncementTestIds);\n\n const resolvedHeading = heading || t('app_announcement_details_list_header');\n\n return (\n <StyledAppAnnouncement data-testid={testIds.root} {...restProps} ref={ref} image={image}>\n {onDismiss && (\n <Button\n as={StyledDismissButton}\n variant='simple'\n icon\n onClick={onDismiss}\n aria-label={t('app_announcement_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </Button>\n )}\n <Text variant='h2' data-testid={testIds.heading}>\n {headingUrl ? (\n <StyledHeadingLink\n variant='link'\n href={headingUrl}\n target='_blank'\n rel='noopener noreferrer'\n >\n {resolvedHeading}\n </StyledHeadingLink>\n ) : (\n resolvedHeading\n )}\n </Text>\n <div>\n <StyledAppAnnouncementContent>\n {description && <HTML as='p' content={description} data-testid={testIds.description} />}\n {!!details?.length && (\n <ul>\n {details.map((item, index) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <li key={index}>\n <HTML content={item} />\n </li>\n );\n })}\n </ul>\n )}\n </StyledAppAnnouncementContent>\n {!headingUrl && whatsNewLink && (\n <Button\n variant='secondary'\n href={whatsNewLink}\n target='_blank'\n data-testid={testIds.whatsNew}\n >\n {whatsNewText}\n </Button>\n )}\n </div>\n </StyledAppAnnouncement>\n );\n }\n);\n\nexport default withTestIds(AppAnnouncement, getAppAnnouncementTestIds);\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const getAppAnnouncementTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "description", "dismiss", "whats-new"]>;
|
|
2
|
+
//# sourceMappingURL=AppAnnouncement.test-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,uLAK3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.test-ids.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC,kBAAkB,EAAE;IACzE,SAAS;IACT,aAAa;IACb,SAAS;IACT,WAAW;CACH,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getAppAnnouncementTestIds = createTestIds('app-announcement', [\n 'heading',\n 'description',\n 'dismiss',\n 'whats-new'\n] as const);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAelD,OAAO,KAAK,EACV,+BAA+B,EAC/B,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQvE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,OAAO,GACP,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,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAC1C,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;;;;
|
|
1
|
+
{"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAelD,OAAO,KAAK,EACV,+BAA+B,EAC/B,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQvE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,OAAO,GACP,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,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAC1C,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;;;;AAwOD,wBAA+D"}
|
|
@@ -20,25 +20,20 @@ const StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
${StyledCaseView} {
|
|
23
|
-
height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});
|
|
24
23
|
z-index: 1;
|
|
25
24
|
|
|
26
|
-
@media (pointer: coarse) {
|
|
27
|
-
height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
${StyledSummaryRegion} {
|
|
31
26
|
position: relative;
|
|
32
27
|
top: 0;
|
|
28
|
+
|
|
29
|
+
@media (min-height: ${theme.base.breakpoints.sm}) {
|
|
30
|
+
position: sticky;
|
|
31
|
+
}
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
${StyledCaseViewContent} {
|
|
37
36
|
overflow-y: auto;
|
|
38
|
-
|
|
39
|
-
& > :last-child {
|
|
40
|
-
padding-bottom: calc(2 * ${theme.base.spacing});
|
|
41
|
-
}
|
|
42
37
|
}
|
|
43
38
|
|
|
44
39
|
${StyledGenAICoachContainer} {
|
|
@@ -1 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qB,CAAC,CAAC","sourcesContent":["import { forwardRef, useEffect, useState, useRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n registerIcon,\n defaultThemeProp,\n useBreakpoint,\n useI18n,\n useTestIds,\n withTestIds,\n ErrorState,\n useConsolidatedRef,\n StyledPreviewDrawer,\n usePreviewManager\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n ErrorStateProps,\n PreviewMethods\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, { StyledCaseView, StyledCaseViewContent, StyledSummaryRegion } from '../CaseView';\nimport type { CaseViewProps } from '../CaseView';\nimport type { CaseViewContextValue } from '../CaseView/CaseView.types';\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\nimport { StyledSummaryPrimaryList, StyledSummarySecondaryList } from '../CaseView/CaseView.styles';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'color'\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 /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */\n caseLink?: CaseViewContextValue['caseLink'];\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** If true, the Case Preview will render in a progress state. */\n progress?: boolean;\n /** If true, the Case Preview will render in an error state. */\n error?: boolean;\n /** Callback fired when \"Try again\" button is clicked in an error state. */\n onErrorRetry?: ErrorStateProps['onRetry'];\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 StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n padding: unset;\n }\n\n ${StyledSummarySecondaryList} {\n padding-block-start: unset;\n padding-inline: unset;\n }\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n z-index: 1;\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\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n\n ${StyledGenAICoachContainer} {\n width: unset;\n min-width: unset;\n }\n `;\n});\n\nStyledCasePreviewDrawer.defaultProps = defaultThemeProp;\n\ntype CasePreviewContentProps = Pick<\n CasePreviewProps,\n | 'error'\n | 'onErrorRetry'\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'color'\n | 'followed'\n | 'onFollowedChange'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n | 'actions'\n | 'onEdit'\n>;\n\nconst CasePreviewContent = ({\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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}: CasePreviewContentProps) => {\n const t = useI18n();\n\n if (error) {\n return <ErrorState message={t('preview_error')} onRetry={onErrorRetry} />;\n }\n\n return (\n <CaseView\n caseId={caseId}\n caseType={caseType}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n color={color}\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 );\n};\n\nconst CasePreview: ForwardRefForwardPropsComponent<CasePreviewProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n progress,\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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 onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const { createPreview } = usePreviewManager();\n const previewMethodsRef = useRef<PreviewMethods | undefined>(undefined);\n const previewRef = useConsolidatedRef(ref);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const [open, setOpen] = useState(openProp);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (open && isSmallOrAbove) {\n const contentProps = {\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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 };\n\n const metadata = {\n previewProps: {\n testId: testIds.root,\n previewLabel: typeof heading === 'string' ? heading : heading?.text,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose: () => {\n onAfterClose?.();\n setOpen(false);\n if (previewMethodsRef.current) {\n previewMethodsRef.current.unmountPreview();\n previewMethodsRef.current = undefined;\n }\n },\n as: StyledCasePreviewDrawer,\n ref: previewRef,\n progress,\n ...restProps\n }\n };\n if (previewMethodsRef.current) {\n previewMethodsRef.current.updatePreview(contentProps, metadata);\n } else {\n previewMethodsRef.current = createPreview(CasePreviewContent, contentProps, metadata);\n }\n } else if (!open) {\n // This branch is needed for controlled component via open prop\n previewMethodsRef.current = undefined;\n }\n }, [open, progress, error, tabs, banners, utilities, utilitiesSummaryItems, isSmallOrAbove]);\n\n return null;\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,6BAA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AY,EAAE,QAAQ,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACjB,+DAA+D;YAC/D,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;QACxC,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC,CAAC;IAE7F,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useEffect, useState, useRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n registerIcon,\n defaultThemeProp,\n useBreakpoint,\n useI18n,\n useTestIds,\n withTestIds,\n ErrorState,\n useConsolidatedRef,\n StyledPreviewDrawer,\n usePreviewManager\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n ErrorStateProps,\n PreviewMethods\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, { StyledCaseView, StyledCaseViewContent, StyledSummaryRegion } from '../CaseView';\nimport type { CaseViewProps } from '../CaseView';\nimport type { CaseViewContextValue } from '../CaseView/CaseView.types';\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\nimport { StyledSummaryPrimaryList, StyledSummarySecondaryList } from '../CaseView/CaseView.styles';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'color'\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 /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */\n caseLink?: CaseViewContextValue['caseLink'];\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** If true, the Case Preview will render in a progress state. */\n progress?: boolean;\n /** If true, the Case Preview will render in an error state. */\n error?: boolean;\n /** Callback fired when \"Try again\" button is clicked in an error state. */\n onErrorRetry?: ErrorStateProps['onRetry'];\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 StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n padding: unset;\n }\n\n ${StyledSummarySecondaryList} {\n padding-block-start: unset;\n padding-inline: unset;\n }\n\n ${StyledCaseView} {\n z-index: 1;\n\n ${StyledSummaryRegion} {\n position: relative;\n top: 0;\n\n @media (min-height: ${theme.base.breakpoints.sm}) {\n position: sticky;\n }\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n }\n\n ${StyledGenAICoachContainer} {\n width: unset;\n min-width: unset;\n }\n `;\n});\n\nStyledCasePreviewDrawer.defaultProps = defaultThemeProp;\n\ntype CasePreviewContentProps = Pick<\n CasePreviewProps,\n | 'error'\n | 'onErrorRetry'\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'color'\n | 'followed'\n | 'onFollowedChange'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n | 'actions'\n | 'onEdit'\n>;\n\nconst CasePreviewContent = ({\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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}: CasePreviewContentProps) => {\n const t = useI18n();\n\n if (error) {\n return <ErrorState message={t('preview_error')} onRetry={onErrorRetry} />;\n }\n\n return (\n <CaseView\n caseId={caseId}\n caseType={caseType}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n color={color}\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 );\n};\n\nconst CasePreview: ForwardRefForwardPropsComponent<CasePreviewProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n progress,\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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 onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const { createPreview } = usePreviewManager();\n const previewMethodsRef = useRef<PreviewMethods | undefined>(undefined);\n const previewRef = useConsolidatedRef(ref);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const [open, setOpen] = useState(openProp);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (open && isSmallOrAbove) {\n const contentProps = {\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\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 };\n\n const metadata = {\n previewProps: {\n testId: testIds.root,\n previewLabel: typeof heading === 'string' ? heading : heading?.text,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose: () => {\n onAfterClose?.();\n setOpen(false);\n if (previewMethodsRef.current) {\n previewMethodsRef.current.unmountPreview();\n previewMethodsRef.current = undefined;\n }\n },\n as: StyledCasePreviewDrawer,\n ref: previewRef,\n progress,\n ...restProps\n }\n };\n if (previewMethodsRef.current) {\n previewMethodsRef.current.updatePreview(contentProps, metadata);\n } else {\n previewMethodsRef.current = createPreview(CasePreviewContent, contentProps, metadata);\n }\n } else if (!open) {\n // This branch is needed for controlled component via open prop\n previewMethodsRef.current = undefined;\n }\n }, [open, progress, error, tabs, banners, utilities, utilitiesSummaryItems, isSmallOrAbove]);\n\n return null;\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA0CtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAsC5G,eAAO,MAAM,oBAAoB,GAC/B,OAAO,YAAY,EACnB,OAAO,MAAM,GAAG,SAAS,KACxB,MAAM,GAAG,SAKX,CAAC;AAyEF,eAAO,MAAM,wBAAwB;cACzB,OAAO;;2BAjES,CA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;AAIF,eAAO,MAAM,sBAAsB;;yLAAiB,CAAC;AAErD,eAAO,MAAM,mCAAmC;;2BAO9C,CAAC;AAMH,eAAO,MAAM,eAAe,6NAsC1B,CAAC;AAIH,eAAO,MAAM,aAAa,6NA+DzB,CAAC;AAIF,eAAO,MAAM,gBAAgB;oBACX,oBAAoB,CAAC,eAAe,CAAC;wBACjC,OAAO;YAuB3B,CAAC;AAIH,eAAO,MAAM,uBAAuB,6NAwBnC,CAAC;AAIF,eAAO,MAAM,uBAAuB;gCAA4C,OAAO;YAatF,CAAC;AAIF,eAAO,MAAM,yBAAyB,6NAQpC,CAAC;AAIH,eAAO,MAAM,uBAAuB,6NAIlC,CAAC;AAIH,eAAO,MAAM,WAAW,6NAGvB,CAAC;AAEF,eAAO,MAAM,cAAc,6NA4F1B,CAAC;AAIF,eAAO,MAAM,qBAAqB;;yLAMjC,CAAC;AAIF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;sSAsB5B,CAAC;AAIH,eAAO,MAAM,sBAAsB,6NAAe,CAAC;AAEnD,eAAO,MAAM,kBAAkB,kaAoC7B,CAAC"}
|
|
@@ -612,9 +612,10 @@ export const StyledWorkArea = styled.div(({ theme: { base: { palette: { 'border-
|
|
|
612
612
|
}
|
|
613
613
|
return css `
|
|
614
614
|
grid-area: work-area;
|
|
615
|
-
|
|
615
|
+
margin-block: calc(2 * ${spacing});
|
|
616
|
+
padding-inline: calc(2 * ${spacing});
|
|
616
617
|
@media (width < ${breakpoints.sm}) {
|
|
617
|
-
padding: calc(
|
|
618
|
+
padding-inline: calc(0.75 * ${spacing});
|
|
618
619
|
}
|
|
619
620
|
|
|
620
621
|
/* Prevents unnecessary gap when case view has neither stages nor assignments */
|
|
@@ -626,7 +627,7 @@ export const StyledWorkArea = styled.div(({ theme: { base: { palette: { 'border-
|
|
|
626
627
|
|
|
627
628
|
${aboveMD &&
|
|
628
629
|
css `
|
|
629
|
-
padding:
|
|
630
|
+
padding-inline: 0;
|
|
630
631
|
|
|
631
632
|
/* This is required to make scrollStick work. */
|
|
632
633
|
${!isPreview &&
|
|
@@ -815,7 +816,7 @@ StyledSummary.defaultProps = defaultThemeProp;
|
|
|
815
816
|
export const StyledCaseDrawer = styled.div(({ previewActive, utilitiesExpanded, theme }) => {
|
|
816
817
|
return css `
|
|
817
818
|
background-color: ${theme.base.palette['primary-background']};
|
|
818
|
-
height: calc(100dvh - var(--appshell-
|
|
819
|
+
height: calc(100dvh - var(--appshell-top-offset, 0rem) - var(--appshell-bottom-offset, 0rem));
|
|
819
820
|
inset-block-start: var(--appshell-top-offset, 0);
|
|
820
821
|
z-index: ${theme.base['z-index'].drawer - 1};
|
|
821
822
|
max-width: ${resizeDrawerMinWidth};
|