@pega/cosmos-react-work 2.0.0-dev.2.1 → 2.0.0-dev.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +13 -17
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts +5 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.js +39 -15
- package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts +5 -5
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +17 -16
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.d.ts +20 -8
- package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.js +121 -14
- package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js +14 -12
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts +6 -19
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +173 -189
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +24 -0
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.styles.js +111 -0
- package/lib/components/CaseView/CaseView.styles.js.map +1 -0
- package/lib/components/CaseView/MobileCaseView.d.ts +1 -0
- package/lib/components/CaseView/MobileCaseView.d.ts.map +1 -1
- package/lib/components/CaseView/MobileCaseView.js +3 -6
- package/lib/components/CaseView/MobileCaseView.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +8 -10
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
- package/lib/components/CaseView/index.d.ts +2 -1
- package/lib/components/CaseView/index.d.ts.map +1 -1
- package/lib/components/CaseView/index.js +1 -1
- package/lib/components/CaseView/index.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js +93 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +43 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
- package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
- package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
- package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/defaults.js +4 -0
- package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
- package/lib/components/ConfigurableLayout/index.d.ts +3 -0
- package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/index.js +3 -0
- package/lib/components/ConfigurableLayout/index.js.map +1 -0
- package/lib/components/ConfigurableLayout/options.d.ts +10 -0
- package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/options.js +10 -0
- package/lib/components/ConfigurableLayout/options.js.map +1 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
- package/lib/components/Confirmation/Confirmation.d.ts +19 -0
- package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
- package/lib/components/Confirmation/Confirmation.js +14 -0
- package/lib/components/Confirmation/Confirmation.js.map +1 -0
- package/lib/components/Confirmation/index.d.ts +3 -0
- package/lib/components/Confirmation/index.d.ts.map +1 -0
- package/lib/components/Confirmation/index.js +2 -0
- package/lib/components/Confirmation/index.js.map +1 -0
- package/lib/components/Details/Details.d.ts +13 -0
- package/lib/components/Details/Details.d.ts.map +1 -0
- package/lib/components/Details/Details.js +38 -0
- package/lib/components/Details/Details.js.map +1 -0
- package/lib/components/Details/index.d.ts +4 -0
- package/lib/components/Details/index.d.ts.map +1 -0
- package/lib/components/Details/index.js +3 -0
- package/lib/components/Details/index.js.map +1 -0
- package/lib/components/Glimpse/Glimpse.d.ts +2 -2
- package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
- package/lib/components/Glimpse/Glimpse.js +3 -6
- package/lib/components/Glimpse/Glimpse.js.map +1 -1
- package/lib/components/SearchResults/Filter.d.ts.map +1 -1
- package/lib/components/SearchResults/Filter.js +15 -48
- package/lib/components/SearchResults/Filter.js.map +1 -1
- package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResult.js +2 -8
- package/lib/components/SearchResults/SearchResult.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.js +44 -101
- package/lib/components/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.styles.d.ts +8 -0
- package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResults.styles.js +67 -0
- package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.types.d.ts +14 -4
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +31 -36
- package/lib/components/Stages/Stages.js.map +1 -1
- package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
- package/lib/components/Stages/Stages.styles.js +22 -28
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/Steps.d.ts.map +1 -1
- package/lib/components/Stages/Steps.js +7 -7
- package/lib/components/Stages/Steps.js.map +1 -1
- package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
- package/lib/components/Stages/StepsContainer.js +5 -9
- package/lib/components/Stages/StepsContainer.js.map +1 -1
- package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
- package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
- package/lib/components/Stakeholders/StakeholderForm.js +47 -0
- package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.js +215 -0
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +78 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
- package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
- package/lib/components/Stakeholders/index.d.ts +3 -0
- package/lib/components/Stakeholders/index.d.ts.map +1 -0
- package/lib/components/Stakeholders/index.js +2 -0
- package/lib/components/Stakeholders/index.js.map +1 -0
- package/lib/components/Tags/Tags.d.ts +34 -0
- package/lib/components/Tags/Tags.d.ts.map +1 -0
- package/lib/components/Tags/Tags.js +227 -0
- package/lib/components/Tags/Tags.js.map +1 -0
- package/lib/components/Tags/index.d.ts +3 -0
- package/lib/components/Tags/index.d.ts.map +1 -0
- package/lib/components/Tags/index.js +2 -0
- package/lib/components/Tags/index.js.map +1 -0
- package/lib/components/Tasks/TaskList.d.ts +25 -0
- package/lib/components/Tasks/TaskList.d.ts.map +1 -0
- package/lib/components/Tasks/TaskList.js +25 -0
- package/lib/components/Tasks/TaskList.js.map +1 -0
- package/lib/components/Tasks/Tasks.d.ts +2 -14
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +17 -39
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/lib/components/Tasks/index.d.ts +3 -0
- package/lib/components/Tasks/index.d.ts.map +1 -1
- package/lib/components/Tasks/index.js +1 -0
- package/lib/components/Tasks/index.js.map +1 -1
- package/lib/components/Timeline/Timeline.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.js +13 -29
- package/lib/components/Timeline/Timeline.js.map +1 -1
- package/lib/components/Timeline/Timeline.styles.d.ts +9 -5
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.styles.js +107 -50
- package/lib/components/Timeline/Timeline.styles.js.map +1 -1
- package/lib/components/Timeline/Timeline.types.d.ts +18 -5
- package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.types.js.map +1 -1
- package/lib/components/Timeline/TimelineItem.d.ts +5 -3
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +15 -32
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/components/Timeline/utils.d.ts +11 -3
- package/lib/components/Timeline/utils.d.ts.map +1 -1
- package/lib/components/Timeline/utils.js +48 -4
- package/lib/components/Timeline/utils.js.map +1 -1
- package/lib/index.d.ts +10 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/package.json +14 -14
- package/lib/components/CaseActions/CaseActions.d.ts +0 -12
- package/lib/components/CaseActions/CaseActions.d.ts.map +0 -1
- package/lib/components/CaseActions/CaseActions.js +0 -15
- package/lib/components/CaseActions/CaseActions.js.map +0 -1
- package/lib/components/CaseActions/index.d.ts +0 -4
- package/lib/components/CaseActions/index.d.ts.map +0 -1
- package/lib/components/CaseActions/index.js +0 -3
- package/lib/components/CaseActions/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EASL,SAAS,EACT,YAAY,EAEb,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAOD,eAAO,MAAM,qBAAqB,+HAoFhC,CAAC;AAIH,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CA+C3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import styled, { css } from 'styled-components';
|
|
3
4
|
import { readableColor } from 'polished';
|
|
4
|
-
import { Button, StyledButton, Text, Icon, useI18n, tryCatch, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
import { Button, StyledButton, Text, Icon, registerIcon, useI18n, tryCatch, defaultThemeProp, useDirection } from '@pega/cosmos-react-core';
|
|
6
|
+
import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
7
|
+
registerIcon(timesIcon);
|
|
5
8
|
const StyledDismissButton = styled.button `
|
|
6
9
|
font-size: 1.25rem;
|
|
7
10
|
border: none;
|
|
8
11
|
`;
|
|
9
12
|
export const StyledAppAnnouncement = styled.article(props => {
|
|
10
|
-
const { theme: { base: { palette: { 'brand-primary': brandBackground }, shadow, spacing
|
|
11
|
-
const
|
|
13
|
+
const { theme: { base: { palette: { 'brand-primary': brandBackground }, shadow, spacing }, components: { card: { 'border-radius': borderRadius } } }, image } = props;
|
|
14
|
+
const { end } = useDirection();
|
|
12
15
|
const color = tryCatch(() => readableColor(brandBackground));
|
|
13
16
|
return css `
|
|
14
17
|
padding: calc(2 * ${spacing});
|
|
@@ -19,7 +22,7 @@ export const StyledAppAnnouncement = styled.article(props => {
|
|
|
19
22
|
|
|
20
23
|
&::after {
|
|
21
24
|
background: url('${image}') no-repeat;
|
|
22
|
-
background-position: ${
|
|
25
|
+
background-position: ${end} bottom;
|
|
23
26
|
background-size: contain;
|
|
24
27
|
background-origin: content-box;
|
|
25
28
|
opacity: 0.2;
|
|
@@ -28,7 +31,7 @@ export const StyledAppAnnouncement = styled.article(props => {
|
|
|
28
31
|
position: absolute;
|
|
29
32
|
width: 50%;
|
|
30
33
|
height: 100%;
|
|
31
|
-
|
|
34
|
+
inset-inline-end: 0;
|
|
32
35
|
bottom: 0;
|
|
33
36
|
padding: calc(2 * ${spacing});
|
|
34
37
|
}
|
|
@@ -42,7 +45,7 @@ export const StyledAppAnnouncement = styled.article(props => {
|
|
|
42
45
|
${StyledDismissButton} {
|
|
43
46
|
position: absolute;
|
|
44
47
|
top: 0.75rem;
|
|
45
|
-
|
|
48
|
+
inset-inline-end: 0.75rem;
|
|
46
49
|
color: inherit;
|
|
47
50
|
z-index: 3;
|
|
48
51
|
&:enabled:hover {
|
|
@@ -80,16 +83,9 @@ export const StyledAppAnnouncement = styled.article(props => {
|
|
|
80
83
|
StyledAppAnnouncement.defaultProps = defaultThemeProp;
|
|
81
84
|
const AppAnnouncement = forwardRef(({ heading, description, details, whatsNewLink, image, onDismiss, ...restProps }, ref) => {
|
|
82
85
|
const t = useI18n();
|
|
83
|
-
return (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
React.createElement(Text, { variant: 'h2' }, heading || t('app_announcement_details_list_header')),
|
|
87
|
-
React.createElement("div", null,
|
|
88
|
-
description && React.createElement("p", null, description),
|
|
89
|
-
details && (React.createElement("ul", null, details.map((item, index) => {
|
|
90
|
-
return React.createElement("li", { key: index.toString() }, item);
|
|
91
|
-
}))),
|
|
92
|
-
whatsNewLink && (React.createElement(Button, { variant: 'secondary', href: whatsNewLink, target: '_blank' }, t('app_announcement_whats_new_button_label'))))));
|
|
86
|
+
return (_jsxs(StyledAppAnnouncement, { ...restProps, ref: ref, heading: heading, 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' }, void 0) }, void 0)), _jsx(Text, { variant: 'h2', children: heading || t('app_announcement_details_list_header') }, void 0), _jsxs("div", { children: [description && _jsx("p", { children: description }, void 0), details && (_jsx("ul", { children: details.map((item, index) => {
|
|
87
|
+
return _jsx("li", { children: item }, index.toString());
|
|
88
|
+
}) }, void 0)), whatsNewLink && (_jsx(Button, { variant: 'secondary', href: whatsNewLink, target: '_blank', children: t('app_announcement_whats_new_button_label') }, void 0))] }, void 0)] }, void 0));
|
|
93
89
|
});
|
|
94
90
|
export default AppAnnouncement;
|
|
95
91
|
//# sourceMappingURL=AppAnnouncement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../src/components/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,gBAAgB,EAGhB,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,YAAY,CAAC,SAAS,CAAC,CAAC;AA8BxB,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAA;;;CAGxC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAAuB,KAAK,CAAC,EAAE;IAChF,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,eAAe,EAAE,eAAe,EAAE,EAC7C,MAAM,EACN,OAAO,EACR,EACD,UAAU,EAAE,EACV,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,EACxC,EACF,EACD,KAAK,EACN,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,K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,EAAE;4BAC3B,OAAO,uBAA4B,IAAI,IAAvB,KAAK,CAAC,QAAQ,EAAE,CAAa,CAAC;wBAChD,CAAC,CAAC,WACC,CACN,EACA,YAAY,IAAI,CACf,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAC,QAAQ,YAC5D,CAAC,CAAC,yCAAyC,CAAC,WACtC,CACV,YACG,YACgB,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n StyledButton,\n Text,\n Icon,\n registerIcon,\n useI18n,\n tryCatch,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n useDirection\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 {\n /**\n * Heading text for the announcement.\n */\n heading?: string;\n /**\n * Description text for the announcement.\n */\n description?: string;\n /**\n * Announcement details to be displayed in form of bulleted list.\n */\n details?: string[];\n /**\n * Url to open with What's new link.\n */\n whatsNewLink?: string;\n /**\n * An image source for the decorative background.\n */\n image?: string;\n /**\n * Callback when user dismisses the announcements.\n */\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 StyledAppAnnouncement = styled.article<AppAnnouncementProps>(props => {\n const {\n theme: {\n base: {\n palette: { 'brand-primary': brandBackground },\n shadow,\n spacing\n },\n components: {\n card: { 'border-radius': borderRadius }\n }\n },\n image\n } = props;\n\n const { end } = useDirection();\n const color = tryCatch(() => readableColor(brandBackground));\n\n return css`\n padding: calc(2 * ${spacing});\n background: ${brandBackground};\n border-radius: ${borderRadius};\n color: ${color};\n position: relative;\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 margin-bottom: ${spacing};\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 {\n box-shadow: ${shadow['focus-inverted']};\n }\n }\n\n > div {\n width: 75%;\n position: relative;\n z-index: 2;\n\n p,\n ul {\n padding-top: calc(2 * ${spacing});\n }\n\n ul {\n padding-inline-start: calc(2 * ${spacing});\n }\n\n ${StyledButton} {\n margin-top: calc(2 * ${spacing});\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${shadow['focus-inverted']};\n }\n }\n }\n `;\n});\n\nStyledAppAnnouncement.defaultProps = defaultThemeProp;\n\nconst AppAnnouncement: FunctionComponent<AppAnnouncementProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n description,\n details,\n whatsNewLink,\n image,\n onDismiss,\n ...restProps\n }: PropsWithoutRef<AppAnnouncementProps>,\n ref: AppAnnouncementProps['ref']\n ) => {\n const t = useI18n();\n\n return (\n <StyledAppAnnouncement {...restProps} ref={ref} heading={heading} 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 {description && <p>{description}</p>}\n {details && (\n <ul>\n {details.map((item, index) => {\n return <li key={index.toString()}>{item}</li>;\n })}\n </ul>\n )}\n {whatsNewLink && (\n <Button variant='secondary' href={whatsNewLink} target='_blank'>\n {t('app_announcement_whats_new_button_label')}\n </Button>\n )}\n </div>\n </StyledAppAnnouncement>\n );\n }\n);\n\nexport default AppAnnouncement;\n"]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { FunctionComponent, ReactElement, Ref } from 'react';
|
|
2
|
-
import { ForwardProps, MenuItemProps } from '@pega/cosmos-react-core';
|
|
2
|
+
import { Action, ForwardProps, MenuItemProps } from '@pega/cosmos-react-core';
|
|
3
3
|
export interface CaseHeaderProps {
|
|
4
|
+
/** Any actions that will be used for various actions on the CaseView. */
|
|
5
|
+
actions?: Action[];
|
|
6
|
+
/** A callback for when the edit button is clicked */
|
|
7
|
+
onEdit?: () => void;
|
|
4
8
|
/** A Case ID to display in the heading. */
|
|
5
9
|
caseId: string;
|
|
6
10
|
/** A text region for the title of the CaseView. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAmB,MAAM,OAAO,CAAC;AAI1F,OAAO,EACL,MAAM,EAUN,YAAY,EAMZ,aAAa,EAId,MAAM,yBAAyB,CAAC;AAOjC,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAMpB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,YAAY,CAAC;IAC3C,kFAAkF;IAClF,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,qDAAqD;IACrD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,4GAc3B,CAAC;AA4EH,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CA8FjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import styled, { css } from 'styled-components';
|
|
3
4
|
import { hideVisually, parseToHsl, readableColor, transparentize } from 'polished';
|
|
4
|
-
import { Breadcrumbs, Flex, Icon, Text, StyledBreadcrumbs, StyledIcon, StyledPopover, defaultThemeProp,
|
|
5
|
+
import { Breadcrumbs, Flex, Icon, registerIcon, Text, StyledBreadcrumbs, StyledIcon, StyledPopover, defaultThemeProp, tryCatch, calculateFontSize, Link, StyledButton, StyledText, Button, MenuButton, useI18n } from '@pega/cosmos-react-core';
|
|
6
|
+
import { StyledMenu } from '@pega/cosmos-react-core/lib/components/Menu/Menu.styles';
|
|
7
|
+
import * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';
|
|
8
|
+
import * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';
|
|
9
|
+
registerIcon(pencilIcon, moreIcon);
|
|
5
10
|
export const StyledCaseHeader = styled.header(({ theme }) => {
|
|
6
11
|
const color = tryCatch(() => readableColor(theme.base.palette['brand-primary']));
|
|
7
12
|
return css `
|
|
8
13
|
background-color: ${theme.base.palette['brand-primary']};
|
|
9
14
|
color: ${color};
|
|
10
15
|
padding: calc(2 * ${theme.base.spacing});
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
${StyledMenu} {
|
|
19
|
+
color: ${theme.base.palette['foreground-color']};
|
|
20
|
+
z-index: ${theme.base['z-index'].popover + 1};
|
|
21
|
+
}
|
|
11
22
|
`;
|
|
12
23
|
});
|
|
13
24
|
StyledCaseHeader.defaultProps = defaultThemeProp;
|
|
@@ -76,20 +87,33 @@ const StyledCaseHeaderText = styled.div(({ theme }) => {
|
|
|
76
87
|
`;
|
|
77
88
|
});
|
|
78
89
|
StyledCaseHeaderText.defaultProps = defaultThemeProp;
|
|
79
|
-
const CaseHeader = forwardRef(({ caseId, heading, caseLink = { href: '' }, parentCases, icon, followed, onFollowedChange, ...restProps }, ref) => {
|
|
80
|
-
const t = useI18n();
|
|
90
|
+
const CaseHeader = forwardRef(({ caseId, heading, caseLink = { href: '' }, parentCases, isMediumOrAbove = true, icon, followed, onFollowedChange, actions = [], onEdit, ...restProps }, ref) => {
|
|
81
91
|
const { href, ...restLinkProps } = caseLink;
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
const t = useI18n();
|
|
93
|
+
const menuItems = actions.map(action => {
|
|
94
|
+
return {
|
|
95
|
+
...action,
|
|
96
|
+
primary: action.text,
|
|
97
|
+
visual: action.icon ? _jsx(Icon, { name: action.icon }, void 0) : null
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
return (_jsxs(Flex, { ...restProps, as: StyledCaseHeader, container: { gap: 2, alignItems: 'start' }, ref: ref, children: [icon && (_jsx(Flex, { container: true, item: { shrink: 0 }, as: StyledCaseIconWrap, children: icon }, void 0)), _jsxs(Flex, { as: StyledCaseHeaderText, container: { direction: 'column' }, item: { grow: 1, shrink: 0, basis: '0' }, children: [_jsx(Text, { variant: 'h1', children: href ? (_jsx(Link, { ...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, { 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: {
|
|
101
|
+
items: followed !== undefined
|
|
102
|
+
? [
|
|
103
|
+
{
|
|
104
|
+
id: 'follow',
|
|
105
|
+
primary: followed ? t('unfollow') : t('follow'),
|
|
106
|
+
onClick: () => onFollowedChange?.(!followed)
|
|
107
|
+
},
|
|
108
|
+
...menuItems
|
|
109
|
+
]
|
|
110
|
+
: menuItems,
|
|
111
|
+
scrollAt: 20
|
|
112
|
+
}, popover: isMediumOrAbove
|
|
113
|
+
? {
|
|
114
|
+
portal: true
|
|
115
|
+
}
|
|
116
|
+
: undefined }, void 0)] }, void 0)] }, void 0));
|
|
93
117
|
});
|
|
94
118
|
export default CaseHeader;
|
|
95
119
|
//# sourceMappingURL=CaseHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../src/components/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,UAAU,EAMX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEnF,OAAO,EACL,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,OAAO,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C/C,oBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,oBAAoB;YACzD,gBAAgB,IAAI,CACnB,+BACE,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,QAAQ,gBACL,CAAC,CAAC,iCAAiC,CAAC,GAChD,CACH;YACD,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAI,CAC3C,CACR,CACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import React, {\n useCallback,\n forwardRef,\n ChangeEvent,\n FunctionComponent,\n ReactElement,\n Ref,\n PropsWithoutRef\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually, parseToHsl, readableColor, transparentize } from 'polished';\n\nimport {\n Breadcrumbs,\n Flex,\n Icon,\n Text,\n StyledBreadcrumbs,\n StyledIcon,\n StyledPopover,\n defaultThemeProp,\n useI18n,\n ForwardProps,\n tryCatch,\n calculateFontSize,\n Link,\n StyledButton,\n StyledText,\n MenuItemProps\n} from '@pega/cosmos-react-core';\n\nexport interface CaseHeaderProps {\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 `;\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 icon,\n followed,\n onFollowedChange,\n ...restProps\n }: PropsWithoutRef<CaseHeaderProps>,\n ref: CaseHeaderProps['ref']\n ) => {\n const t = useI18n();\n const { href, ...restLinkProps } = caseLink;\n\n const handleFollowedChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onFollowedChange?.(e.target.checked);\n },\n [onFollowedChange]\n );\n\n return (\n <Flex\n {...restProps}\n as={StyledCaseHeader}\n container={{ itemGap: 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 {(followed !== undefined || onFollowedChange) && (\n <Flex item={{ alignSelf: 'start' }} as={StyledFollowIconWrap}>\n {onFollowedChange && (\n <input\n type='checkbox'\n onChange={handleFollowedChange}\n checked={followed}\n aria-label={t('follow_case_checkbox_label_a11y')}\n />\n )}\n <Icon name={followed ? 'star-solid' : 'star'} />\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default CaseHeader;\n"]}
|
|
1
|
+
{"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../src/components/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyD,MAAM,OAAO,CAAC;AAC1F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEnF,OAAO,EAEL,WAAW,EACX,IAAI,EACJ,IA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CAAC,CAAC;gCACE,MAAM,EAAE,IAAI;6BACb;4BACH,CAAC,CAAC,SAAS,WAEf,YACE,YACD,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 registerIcon,\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';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nregisterIcon(pencilIcon, moreIcon);\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: 'start' }}\n ref={ref}\n >\n {icon && (\n <Flex container item={{ shrink: 0 }} as={StyledCaseIconWrap}>\n {icon}\n </Flex>\n )}\n <Flex\n as={StyledCaseHeaderText}\n container={{ direction: 'column' }}\n item={{ grow: 1, shrink: 0, basis: '0' }}\n >\n <Text variant='h1'>\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"]}
|
|
@@ -5,15 +5,15 @@ export interface CasePreviewProps extends CaseViewProps {
|
|
|
5
5
|
/** If true, the Case Preview will be visible. */
|
|
6
6
|
open: boolean;
|
|
7
7
|
/** Callback fired before Case Preview opens. */
|
|
8
|
-
onBeforeOpen
|
|
8
|
+
onBeforeOpen?: () => void;
|
|
9
9
|
/** Callback fired after Case Preview opens. */
|
|
10
|
-
onAfterOpen
|
|
10
|
+
onAfterOpen?: () => void;
|
|
11
11
|
/** Callback fired before Case Preview closes. */
|
|
12
|
-
onBeforeClose
|
|
12
|
+
onBeforeClose?: () => void;
|
|
13
13
|
/** Callback fired after Case Preview closes. */
|
|
14
|
-
onAfterClose
|
|
14
|
+
onAfterClose?: () => void;
|
|
15
15
|
/** Callback fired when a click action occurs outside of the Case Preview. */
|
|
16
|
-
onOuterClick
|
|
16
|
+
onOuterClick?: () => void;
|
|
17
17
|
/** Reference to the wrapping element. */
|
|
18
18
|
ref?: Ref<HTMLDivElement>;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAIf,OAAO,EAQL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAGjC,OAAiB,EACf,aAAa,EAKd,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAgFD,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAiFnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
2
3
|
import styled, { css } from 'styled-components';
|
|
3
4
|
import { readableColor } from 'polished';
|
|
4
|
-
import { Drawer, Icon, Button, Flex, tryCatch, defaultThemeProp, useBreakpoint,
|
|
5
|
+
import { Drawer, Icon, registerIcon, Button, Flex, tryCatch, defaultThemeProp, useBreakpoint, useElement, useDirection } from '@pega/cosmos-react-core';
|
|
6
|
+
import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
5
7
|
import CaseView, { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledSummaryRegion } from '../CaseView';
|
|
8
|
+
registerIcon(timesIcon);
|
|
6
9
|
const StyledPreviewHeader = styled.div(({ theme }) => {
|
|
7
10
|
return css `
|
|
8
11
|
z-index: ${theme.base['z-index'].drawer};
|
|
@@ -23,25 +26,27 @@ const StyledPreviewActions = styled.div(({ theme: { base: { spacing, palette: {
|
|
|
23
26
|
});
|
|
24
27
|
StyledPreviewActions.defaultProps = defaultThemeProp;
|
|
25
28
|
const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ caseSummaryEl, theme }) => {
|
|
26
|
-
const offsetHeight =
|
|
29
|
+
const offsetHeight = caseSummaryEl?.offsetHeight || 0;
|
|
27
30
|
return css `
|
|
31
|
+
height: calc(100vh - var(--appshell-offset, 0rem));
|
|
32
|
+
top: var(--appshell-offset, 0);
|
|
28
33
|
z-index: calc(${theme.base['z-index'].drawer} + 500);
|
|
29
34
|
|
|
30
35
|
${StyledCaseView} {
|
|
31
|
-
height: calc(100vh - ${theme.base.spacing} - ${theme.base
|
|
36
|
+
height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});
|
|
32
37
|
|
|
33
38
|
@media (pointer: coarse) {
|
|
34
|
-
height: calc(100vh - ${theme.base.spacing} - ${theme.base
|
|
39
|
+
height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
${StyledCaseViewContent} {
|
|
39
44
|
overflow-y: auto;
|
|
40
45
|
margin-top: ${`${offsetHeight}px`};
|
|
41
|
-
margin-bottom: calc(${theme.base
|
|
46
|
+
margin-bottom: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});
|
|
42
47
|
|
|
43
48
|
@media (pointer: coarse) {
|
|
44
|
-
margin-bottom: calc(${theme.base
|
|
49
|
+
margin-bottom: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
& > :last-child {
|
|
@@ -51,32 +56,28 @@ const StyledPreviewDrawer = styled(StyledCaseDrawer)(({ caseSummaryEl, theme })
|
|
|
51
56
|
|
|
52
57
|
${StyledSummaryRegion} {
|
|
53
58
|
position: fixed;
|
|
54
|
-
top: calc(${theme.base
|
|
59
|
+
top: calc(${theme.base['hit-area']['mouse-min']} + ${theme.base.spacing});
|
|
55
60
|
|
|
56
61
|
@media (pointer: coarse) {
|
|
57
|
-
top: calc(${theme.base
|
|
62
|
+
top: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
65
|
`;
|
|
61
66
|
});
|
|
62
67
|
StyledPreviewDrawer.defaultProps = defaultThemeProp;
|
|
63
68
|
const CasePreview = forwardRef((props, ref) => {
|
|
64
|
-
const { open: openProp, caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, ...restProps } = props;
|
|
69
|
+
const { open: openProp, caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, ...restProps } = props;
|
|
65
70
|
const [caseSummaryEl, setCaseSummaryEl] = useElement();
|
|
66
71
|
const isSmallOrAbove = useBreakpoint('sm');
|
|
67
72
|
const [open, setOpen] = useState(openProp);
|
|
68
|
-
const
|
|
73
|
+
const direction = useDirection();
|
|
69
74
|
const closePreview = useCallback(() => {
|
|
70
75
|
setOpen(false);
|
|
71
76
|
}, []);
|
|
72
77
|
useEffect(() => {
|
|
73
78
|
setOpen(openProp);
|
|
74
79
|
}, [openProp]);
|
|
75
|
-
return (
|
|
76
|
-
React.createElement(StyledPreviewActions, null,
|
|
77
|
-
React.createElement(Button, { variant: 'simple', icon: true, onClick: closePreview },
|
|
78
|
-
React.createElement(Icon, { name: 'times' }))),
|
|
79
|
-
React.createElement(CaseView, { forceMobile: true, caseId: caseId, parentCases: parentCases, heading: heading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, summary: summary, caseSummaryRef: setCaseSummaryEl, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners })));
|
|
80
|
+
return (_jsxs(Drawer, { ...restProps, as: StyledPreviewDrawer, caseSummaryEl: caseSummaryEl ?? undefined, forwardedAs: Flex, container: { direction: 'column' }, ref: ref, open: open && isSmallOrAbove, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, children: [_jsx(StyledPreviewActions, { children: _jsx(Button, { variant: 'simple', icon: true, onClick: closePreview, children: _jsx(Icon, { name: 'times' }, void 0) }, void 0) }, void 0), _jsx(CaseView, { forceMobile: true, caseId: caseId, parentCases: parentCases, heading: heading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, summary: summary, caseSummaryRef: setCaseSummaryEl, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners, onEdit: onEdit }, void 0)] }, void 0));
|
|
80
81
|
});
|
|
81
82
|
export default CasePreview;
|
|
82
83
|
//# sourceMappingURL=CasePreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAEhB,aAAa,EACb,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,QAAQ,EAAE,EAEf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,YAAY,CAAC,SAAS,CAAC,CAAC;AAmBxB,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM;wBACnB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBA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AAE,EAAE,mBAAmB,EACvB,aAAa,EAAE,aAAa,IAAI,SAAS,EACzC,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,IAAI,cAAc,EAC5B,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,SAAS,CAAC,GAAG,EACxB,MAAM,QACN,cAAc,mBAEd,KAAC,oBAAoB,cACnB,KAAC,MAAM,IAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,QAAC,OAAO,EAAE,YAAY,YACjD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,WACd,WACY,EAEvB,KAAC,QAAQ,IACP,WAAW,QACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,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,YACK,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 registerIcon,\n Button,\n Flex,\n tryCatch,\n defaultThemeProp,\n ForwardProps,\n useBreakpoint,\n useElement,\n useDirection\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledSummaryRegion\n} from '../CaseView';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps 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"]}
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, Ref, MouseEvent
|
|
1
|
+
import { FunctionComponent, ReactNode, Ref, MouseEvent } from 'react';
|
|
2
2
|
import { Tab, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import { CaseHeaderProps } from '../CaseHeader';
|
|
4
|
-
import { CaseActionsProps } from '../CaseActions';
|
|
5
4
|
export interface CaseSummaryProps extends CaseHeaderProps {
|
|
6
|
-
/** A region to hold any buttons that will be used for various actions on the CaseView. */
|
|
7
|
-
actions?: CaseActionsProps['actions'];
|
|
8
5
|
/** A region to display any summary information about the CaseView. */
|
|
9
6
|
summary: ReactNode;
|
|
10
7
|
/** An object handling the rendering and functionality of the Tabs in CaseSummary. */
|
|
11
8
|
tabs: {
|
|
12
9
|
items: Tab[];
|
|
13
|
-
onClick(id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>)
|
|
10
|
+
onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
14
11
|
currentTabId: string;
|
|
15
12
|
};
|
|
16
|
-
/**
|
|
17
|
-
|
|
13
|
+
/** The fixed width string is needed for the expandable and collapsible header. */
|
|
14
|
+
fixedWidth?: string;
|
|
15
|
+
/** A boolean that toggles the collapsible feature of the case summary. */
|
|
16
|
+
collapsible?: boolean;
|
|
17
|
+
onBeforeCollapse?: () => void;
|
|
18
|
+
onAfterCollapse?: () => void;
|
|
19
|
+
onBeforeExpand?: () => void;
|
|
20
|
+
onAfterExpand?: () => void;
|
|
21
|
+
/** A callback that will return the animation state of the case summary. */
|
|
22
|
+
onAnimationStateChange?: (state: AnimationState) => void;
|
|
23
|
+
/** Ref for the header element inside the Case Summary */
|
|
24
|
+
headerRef?: Ref<HTMLDivElement>;
|
|
18
25
|
/** Ref for the wrapping element. */
|
|
19
26
|
ref?: Ref<HTMLDivElement>;
|
|
20
27
|
}
|
|
21
|
-
|
|
28
|
+
declare type AnimationState = 'expanding' | 'expanded' | 'collapsing' | 'collapsed';
|
|
29
|
+
export declare const StyledCaseSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
30
|
+
expanded?: boolean | undefined;
|
|
31
|
+
fixedWidth?: string | undefined;
|
|
32
|
+
}, never>;
|
|
33
|
+
export declare const StyledCaseSummaryInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
34
|
declare const CaseSummary: FunctionComponent<CaseSummaryProps & ForwardProps>;
|
|
23
35
|
export default CaseSummary;
|
|
24
36
|
//# sourceMappingURL=CaseSummary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,
|
|
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,EAUb,MAAM,yBAAyB,CAAC;AAGjC,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,sEAAsE;IACtE,OAAO,EAAE,SAAS,CAAC;IACnB,qFAAqF;IACrF,IAAI,EAAE;QACJ,KAAK,EAAE,GAAG,EAAE,CAAC;QACb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