@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
declare const useTrackWrappedRegions: (regionElArray: (HTMLElement | null)[], disabled?: boolean | undefined) => {
|
|
3
|
+
containerRef: Ref<HTMLElement | null>;
|
|
4
|
+
regionWrappedStates: boolean[];
|
|
5
|
+
};
|
|
6
|
+
export default useTrackWrappedRegions;
|
|
7
|
+
//# sourceMappingURL=useTrackWrappedRegions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrackWrappedRegions.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/useTrackWrappedRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAIzD,QAAA,MAAM,sBAAsB,kBACX,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE;kBAEpB,IAAI,WAAW,GAAG,IAAI,CAAC;yBAAuB,OAAO,EAAE;CA2CzE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useRef, useEffect, useState } from 'react';
|
|
2
|
+
import { debounce } from '@pega/cosmos-react-core';
|
|
3
|
+
const useTrackWrappedRegions = (regionElArray, disabled) => {
|
|
4
|
+
const containerRef = useRef(null);
|
|
5
|
+
const [regionWrappedStates, setRegionWrappedStates] = useState(new Array(regionElArray.length).fill(false));
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (disabled)
|
|
8
|
+
return;
|
|
9
|
+
let isMounted = true;
|
|
10
|
+
const observer = new ResizeObserver(debounce(entries => {
|
|
11
|
+
if (isMounted) {
|
|
12
|
+
const containerWidth = entries[0].contentRect.width;
|
|
13
|
+
const newWrappedStates = [...regionWrappedStates];
|
|
14
|
+
regionElArray.forEach((regionEl, index) => {
|
|
15
|
+
const regionWidth = regionEl?.getBoundingClientRect().width;
|
|
16
|
+
if (regionWidth !== undefined && regionWidth >= containerWidth) {
|
|
17
|
+
newWrappedStates[index] = true;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
newWrappedStates[index] = false;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
setRegionWrappedStates(newWrappedStates);
|
|
24
|
+
}
|
|
25
|
+
}, 100));
|
|
26
|
+
if (containerRef.current && regionElArray.length) {
|
|
27
|
+
observer.observe(containerRef.current);
|
|
28
|
+
}
|
|
29
|
+
return () => {
|
|
30
|
+
isMounted = false;
|
|
31
|
+
observer.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, [containerRef, regionElArray]);
|
|
34
|
+
return { containerRef, regionWrappedStates };
|
|
35
|
+
};
|
|
36
|
+
export default useTrackWrappedRegions;
|
|
37
|
+
//# sourceMappingURL=useTrackWrappedRegions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrackWrappedRegions.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/useTrackWrappedRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAO,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,sBAAsB,GAAG,CAC7B,aAAqC,EACrC,QAAkB,EACyD,EAAE;IAC7E,MAAM,YAAY,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAC5D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AAe,sBAAsB,CAAC","sourcesContent":["import { useRef, useEffect, useState, Ref } from 'react';\n\nimport { debounce } from '@pega/cosmos-react-core';\n\nconst useTrackWrappedRegions = (\n regionElArray: (HTMLElement | null)[],\n disabled?: boolean\n): { containerRef: Ref<HTMLElement | null>; regionWrappedStates: boolean[] } => {\n const containerRef = useRef<HTMLElement | null>(null);\n const [regionWrappedStates, setRegionWrappedStates] = useState(\n new Array(regionElArray.length).fill(false)\n );\n\n useEffect(() => {\n if (disabled) return;\n\n let isMounted = true;\n\n const observer = new ResizeObserver(\n debounce(entries => {\n if (isMounted) {\n const containerWidth = entries[0].contentRect.width;\n const newWrappedStates = [...regionWrappedStates];\n\n regionElArray.forEach((regionEl, index) => {\n const regionWidth = regionEl?.getBoundingClientRect().width;\n\n if (regionWidth !== undefined && regionWidth >= containerWidth) {\n newWrappedStates[index] = true;\n } else {\n newWrappedStates[index] = false;\n }\n });\n\n setRegionWrappedStates(newWrappedStates);\n }\n }, 100)\n );\n\n if (containerRef.current && regionElArray.length) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n isMounted = false;\n observer.disconnect();\n };\n }, [containerRef, regionElArray]);\n\n return { containerRef, regionWrappedStates };\n};\n\nexport default useTrackWrappedRegions;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode, Ref } from 'react';
|
|
2
|
+
import { ForwardProps, UnorderedListProps } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface ConfirmationProps {
|
|
4
|
+
/** The title of the confirmation */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Region for a Field Value List component */
|
|
7
|
+
details: ReactNode;
|
|
8
|
+
/** Array of React nodes to be put into a list */
|
|
9
|
+
whatsNext?: UnorderedListProps['items'];
|
|
10
|
+
/** Region for a Tasks component */
|
|
11
|
+
tasks?: ReactNode;
|
|
12
|
+
/** Called when the done/close button is clicked */
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
/** Ref for the wrapping element. */
|
|
15
|
+
ref?: Ref<HTMLElement>;
|
|
16
|
+
}
|
|
17
|
+
declare const Confirmation: FunctionComponent<ConfirmationProps & ForwardProps>;
|
|
18
|
+
export default Confirmation;
|
|
19
|
+
//# sourceMappingURL=Confirmation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Confirmation.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAGL,YAAY,EAOZ,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAQjC,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,EAAE,SAAS,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAwCrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Card, CardContent, Flex, Text, useI18n, UnorderedList, Button, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
const StyledWhatsNextList = styled(UnorderedList) `
|
|
6
|
+
padding-inline-start: 0;
|
|
7
|
+
`;
|
|
8
|
+
StyledWhatsNextList.defaultProps = defaultThemeProp;
|
|
9
|
+
const Confirmation = forwardRef(({ title, details, whatsNext, tasks, onClose, ...restProps }, ref) => {
|
|
10
|
+
const t = useI18n();
|
|
11
|
+
return (_jsx(Card, { ...restProps, ref: ref, children: _jsx(CardContent, { children: _jsxs(Flex, { container: { gap: 3, direction: 'column' }, children: [_jsx(Text, { variant: 'h2', children: title }, void 0), _jsxs(Flex, { container: { gap: 1, direction: 'column' }, children: [_jsx(Text, { variant: 'h3', children: t('confirmation_details') }, void 0), details] }, void 0), whatsNext && (_jsxs(Flex, { container: { gap: 1, direction: 'column' }, children: [_jsx(Text, { variant: 'h3', children: t('confirmation_whats_next') }, void 0), _jsx(StyledWhatsNextList, { items: whatsNext, as: StyledWhatsNextList }, void 0)] }, void 0)), tasks && (_jsxs(Flex, { container: { gap: 1, direction: 'column' }, children: [_jsx(Text, { variant: 'h3', children: t('confirmation_open_tasks') }, void 0), tasks] }, void 0)), onClose && (_jsx(Flex, { container: { justify: 'end' }, children: _jsx(Button, { onClick: onClose, variant: 'primary', children: t('done') }, void 0) }, void 0))] }, void 0) }, void 0) }, void 0));
|
|
12
|
+
});
|
|
13
|
+
export default Confirmation;
|
|
14
|
+
//# sourceMappingURL=Confirmation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/components/Confirmation/Confirmation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsD,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,IAAI,EACJ,WAAW,EAEX,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,MAAM,EACN,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;CAEhD,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAiBpD,MAAM,YA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AO,EAAC,SAAS,YACxC,CAAC,CAAC,MAAM,CAAC,WACH,WACJ,CACR,YACI,WACK,WACT,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Card,\n CardContent,\n ForwardProps,\n Flex,\n Text,\n useI18n,\n UnorderedList,\n Button,\n defaultThemeProp,\n UnorderedListProps\n} from '@pega/cosmos-react-core';\n\nconst StyledWhatsNextList = styled(UnorderedList)`\n padding-inline-start: 0;\n`;\n\nStyledWhatsNextList.defaultProps = defaultThemeProp;\n\nexport interface ConfirmationProps {\n /** The title of the confirmation */\n title: string;\n /** Region for a Field Value List component */\n details: ReactNode;\n /** Array of React nodes to be put into a list */\n whatsNext?: UnorderedListProps['items'];\n /** Region for a Tasks component */\n tasks?: ReactNode;\n /** Called when the done/close button is clicked */\n onClose?: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nconst Confirmation: FunctionComponent<ConfirmationProps & ForwardProps> = forwardRef(\n (\n { title, details, whatsNext, tasks, onClose, ...restProps }: PropsWithoutRef<ConfirmationProps>,\n ref\n ) => {\n const t = useI18n();\n\n return (\n <Card {...restProps} ref={ref}>\n <CardContent>\n <Flex container={{ gap: 3, direction: 'column' }}>\n <Text variant='h2'>{title}</Text>\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h3'>{t('confirmation_details')}</Text>\n {details}\n </Flex>\n {whatsNext && (\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h3'>{t('confirmation_whats_next')}</Text>\n <StyledWhatsNextList items={whatsNext} as={StyledWhatsNextList} />\n </Flex>\n )}\n {tasks && (\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h3'>{t('confirmation_open_tasks')}</Text>\n {tasks}\n </Flex>\n )}\n {onClose && (\n <Flex container={{ justify: 'end' }}>\n <Button onClick={onClose} variant='primary'>\n {t('done')}\n </Button>\n </Flex>\n )}\n </Flex>\n </CardContent>\n </Card>\n );\n }\n);\n\nexport default Confirmation;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Confirmation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Confirmation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default } from './Confirmation';\nexport { ConfirmationProps } from './Confirmation';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { FieldValueListProps, ForwardProps, BaseProps } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface DetailsProps extends BaseProps {
|
|
4
|
+
/** The set of field values to render in the Highlighted Data list. */
|
|
5
|
+
highlightedFields?: FieldValueListProps['fields'];
|
|
6
|
+
/** List of React components below the highlighted data and line seperation. */
|
|
7
|
+
regions?: [ReactNode] | [ReactNode, ReactNode] | [ReactNode, ReactNode, ReactNode];
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledDetails: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
export declare const StyledHighlightedFields: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
declare const Details: FunctionComponent<DetailsProps & ForwardProps>;
|
|
12
|
+
export default Details;
|
|
13
|
+
//# sourceMappingURL=Details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,EAKL,mBAAmB,EACnB,YAAY,EACZ,SAAS,EAGV,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;CACpF;AAED,eAAO,MAAM,aAAa,yGAAe,CAAC;AAE1C,eAAO,MAAM,uBAAuB,yGAmBlC,CAAC;AAIH,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CA4B3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { Grid, defaultThemeProp, FieldValueList, StyledFieldValueList, calculateFontSize } from '@pega/cosmos-react-core';
|
|
4
|
+
export const StyledDetails = styled.div ``;
|
|
5
|
+
export const StyledHighlightedFields = styled.div(({ theme }) => {
|
|
6
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
7
|
+
return css `
|
|
8
|
+
${StyledFieldValueList} {
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr));
|
|
11
|
+
padding-block-end: calc(1.5 * ${theme.base.spacing});
|
|
12
|
+
border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
13
|
+
column-gap: calc(5 * ${theme.base.spacing});
|
|
14
|
+
dd {
|
|
15
|
+
font-size: ${fontSize[theme.components.text.h1['font-size']]};
|
|
16
|
+
font-weight: ${theme.components.text.h1['font-weight']};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& + div {
|
|
21
|
+
padding-block-start: calc(1.5 * ${theme.base.spacing});
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
});
|
|
25
|
+
StyledHighlightedFields.defaultProps = defaultThemeProp;
|
|
26
|
+
const Details = ({ highlightedFields, regions }) => {
|
|
27
|
+
return (_jsxs(StyledDetails, { children: [highlightedFields && (_jsx(StyledHighlightedFields, { children: _jsx(FieldValueList, { variant: 'stacked', fields: highlightedFields }, void 0) }, void 0)), regions && regions.length > 0 && (_jsx(Grid, { container: {
|
|
28
|
+
cols: 'repeat(auto-fit, minmax(30ch, 1fr))',
|
|
29
|
+
alignItems: 'start',
|
|
30
|
+
alignContent: 'start',
|
|
31
|
+
gap: 2
|
|
32
|
+
}, children: regions?.map((colItem, i) => {
|
|
33
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
34
|
+
return _jsx("div", { children: colItem }, i);
|
|
35
|
+
}) }, void 0))] }, void 0));
|
|
36
|
+
};
|
|
37
|
+
export default Details;
|
|
38
|
+
//# sourceMappingURL=Details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Details.js","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EAIpB,iBAAiB,EAElB,MAAM,yBAAyB,CAAC;AASjC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,iBA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ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Grid,\n defaultThemeProp,\n FieldValueList,\n StyledFieldValueList,\n FieldValueListProps,\n ForwardProps,\n BaseProps,\n calculateFontSize,\n FontSize\n} from '@pega/cosmos-react-core';\n\nexport interface DetailsProps extends BaseProps {\n /** The set of field values to render in the Highlighted Data list. */\n highlightedFields?: FieldValueListProps['fields'];\n /** List of React components below the highlighted data and line seperation. */\n regions?: [ReactNode] | [ReactNode, ReactNode] | [ReactNode, ReactNode, ReactNode];\n}\n\nexport const StyledDetails = styled.div``;\n\nexport const StyledHighlightedFields = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n ${StyledFieldValueList} {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr));\n padding-block-end: calc(1.5 * ${theme.base.spacing});\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n column-gap: calc(5 * ${theme.base.spacing});\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n }\n\n & + div {\n padding-block-start: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledHighlightedFields.defaultProps = defaultThemeProp;\n\nconst Details: FunctionComponent<DetailsProps & ForwardProps> = ({\n highlightedFields,\n regions\n}: DetailsProps) => {\n return (\n <StyledDetails>\n {highlightedFields && (\n <StyledHighlightedFields>\n <FieldValueList variant='stacked' fields={highlightedFields} />\n </StyledHighlightedFields>\n )}\n {regions && regions.length > 0 && (\n <Grid\n container={{\n cols: 'repeat(auto-fit, minmax(30ch, 1fr))',\n alignItems: 'start',\n alignContent: 'start',\n gap: 2\n }}\n >\n {regions?.map((colItem, i) => {\n // eslint-disable-next-line react/no-array-index-key\n return <div key={i}>{colItem}</div>;\n })}\n </Grid>\n )}\n </StyledDetails>\n );\n};\n\nexport default Details;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Details';\nexport { DetailsProps } from './Details';\nexport { StyledDetails, StyledHighlightedFields } from './Details';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FunctionComponent, Ref } from 'react';
|
|
2
2
|
import { BaseProps, FieldValueListProps, ForwardProps, MenuItemProps } from '@pega/cosmos-react-core';
|
|
3
3
|
export interface GlimpseProps extends BaseProps {
|
|
4
4
|
/** The unique id for the operator. */
|
|
@@ -14,7 +14,7 @@ export interface GlimpseProps extends BaseProps {
|
|
|
14
14
|
/** Ref for the wrapping element. */
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
}
|
|
17
|
-
export declare const StyledGlimpse: import("styled-components").StyledComponent<
|
|
17
|
+
export declare const StyledGlimpse: import("styled-components").StyledComponent<FunctionComponent<import("@pega/cosmos-react-core").CardProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
18
18
|
declare const Glimpse: FunctionComponent<GlimpseProps & ForwardProps>;
|
|
19
19
|
export default Glimpse;
|
|
20
20
|
//# sourceMappingURL=Glimpse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Glimpse.d.ts","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Glimpse.d.ts","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EACL,SAAS,EAMT,mBAAmB,EACnB,YAAY,EACZ,aAAa,EAId,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,mEAAmE;IACnE,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,qDAAqD;IACrD,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,iLAUxB,CAAC;AAIH,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAsB3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
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 { Card, CardContent, CardHeader, defaultThemeProp, FieldValueList, MetaList, StyledFieldValueList, SummaryItem } from '@pega/cosmos-react-core';
|
|
4
5
|
import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
|
|
@@ -15,11 +16,7 @@ export const StyledGlimpse = styled(Card)(({ theme }) => {
|
|
|
15
16
|
});
|
|
16
17
|
StyledGlimpse.defaultProps = defaultThemeProp;
|
|
17
18
|
const Glimpse = forwardRef(({ primary, visual, secondary = [], fields = [] }, ref) => {
|
|
18
|
-
return (
|
|
19
|
-
React.createElement(CardHeader, null,
|
|
20
|
-
React.createElement(SummaryItem, { primary: primary, secondary: React.createElement(MetaList, { items: secondary }), visual: visual })),
|
|
21
|
-
!!fields.length && (React.createElement(CardContent, null,
|
|
22
|
-
React.createElement(FieldValueList, { fields: fields })))));
|
|
19
|
+
return (_jsxs(StyledGlimpse, { ref: ref, children: [_jsx(CardHeader, { children: _jsx(SummaryItem, { primary: primary, secondary: _jsx(MetaList, { items: secondary }, void 0), visual: visual }, void 0) }, void 0), !!fields.length && (_jsx(CardContent, { children: _jsx(FieldValueList, { fields: fields }, void 0) }, void 0))] }, void 0));
|
|
23
20
|
});
|
|
24
21
|
export default Glimpse;
|
|
25
22
|
//# sourceMappingURL=Glimpse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Glimpse.js","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Glimpse.js","sourceRoot":"","sources":["../../../src/components/Glimpse/Glimpse.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,cAAc,EAId,QAAQ,EACR,oBAAoB,EACpB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAiB5F,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,OAAO,GAAG,CAAA;MACN,iBAAiB;oCACa,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;MAG/D,oBAAoB;gCACM,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,OAAO,GAAmD,UAAU,CACxE,CACE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAiC,EAC/E,GAAwB,EACxB,EAAE;IACF,OAAO,CACL,MAAC,aAAa,IAAC,GAAG,EAAE,GAAG,aACrB,KAAC,UAAU,cACT,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,WAAI,EACzC,MAAM,EAAE,MAAM,WACd,WACS,EACZ,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAClB,KAAC,WAAW,cACV,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,WAAI,WACtB,CACf,YACa,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n BaseProps,\n Card,\n CardContent,\n CardHeader,\n defaultThemeProp,\n FieldValueList,\n FieldValueListProps,\n ForwardProps,\n MenuItemProps,\n MetaList,\n StyledFieldValueList,\n SummaryItem\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\n\nexport interface GlimpseProps extends BaseProps {\n /** The unique id for the operator. */\n id: string;\n /** The primary piece of item information as a string. */\n primary: MenuItemProps['primary'];\n /** Secondary info about an item. Useful for additional metadata or context. */\n secondary?: MenuItemProps['secondary'];\n /** A visual to assist identifying an item. e.g. Avatar or Icon. */\n visual?: MenuItemProps['visual'];\n /** The set of field values to render in the list. */\n fields?: FieldValueListProps['fields'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledGlimpse = styled(Card)(({ theme }) => {\n return css`\n ${StyledCardContent} {\n border-top: solid 0.0625rem ${theme.base.palette['border-line']};\n }\n\n ${StyledFieldValueList} {\n padding-top: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledGlimpse.defaultProps = defaultThemeProp;\n\nconst Glimpse: FunctionComponent<GlimpseProps & ForwardProps> = forwardRef(\n (\n { primary, visual, secondary = [], fields = [] }: PropsWithoutRef<GlimpseProps>,\n ref: GlimpseProps['ref']\n ) => {\n return (\n <StyledGlimpse ref={ref}>\n <CardHeader>\n <SummaryItem\n primary={primary}\n secondary={<MetaList items={secondary} />}\n visual={visual}\n />\n </CardHeader>\n {!!fields.length && (\n <CardContent>\n <FieldValueList fields={fields} />\n </CardContent>\n )}\n </StyledGlimpse>\n );\n }\n);\n\nexport default Glimpse;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/Filter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/Filter.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAyB,MAAM,uBAAuB,CAAC;AAK/F,UAAU,oBAAoB;IAC5B,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,aAAa,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACrD;AAED,QAAA,MAAM,MAAM,kEAMT,WAAW,GAAG,oBAAoB,KAAG,WA6EvC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Button, Checkbox, CheckboxGroup, ExpandCollapse, Flex, Icon,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
border-bottom: 0.0625rem solid ${base.palette['border-line']};
|
|
8
|
-
padding-bottom: calc(${base.spacing} * 2);
|
|
9
|
-
margin-bottom: calc(${base.spacing} * 2);
|
|
10
|
-
|
|
11
|
-
> :last-child > :first-child {
|
|
12
|
-
padding-block-start: ${base.spacing};
|
|
13
|
-
}
|
|
14
|
-
`;
|
|
15
|
-
});
|
|
16
|
-
const FilterButton = styled(Button)(({ theme: { base } }) => {
|
|
17
|
-
const fontSize = calculateFontSize(base['font-size'], base['font-scale']);
|
|
18
|
-
return css `
|
|
19
|
-
font-size: ${fontSize.xl};
|
|
20
|
-
|
|
21
|
-
${StyledIcon} {
|
|
22
|
-
transition: transform ${base.animation.speed} ${base.animation.timing.ease};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&[aria-expanded='true'] ${StyledIcon} {
|
|
26
|
-
transform: rotate(0);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&[aria-expanded='false'] ${StyledIcon} {
|
|
30
|
-
transform: rotate(-90deg);
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
});
|
|
34
|
-
FilterButton.defaultProps = defaultThemeProp;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Button, Checkbox, CheckboxGroup, ExpandCollapse, Flex, Icon, registerIcon, RadioButton, RadioButtonGroup, Text, useI18n } from '@pega/cosmos-react-core';
|
|
4
|
+
import * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';
|
|
5
|
+
import { StyledFilter, StyledFilterButton } from './SearchResults.styles';
|
|
6
|
+
registerIcon(caretDownIcon);
|
|
35
7
|
const Filter = ({ onFilterChange, onClearFilter, name, expanded = true, ...control }) => {
|
|
36
8
|
const t = useI18n();
|
|
37
9
|
const [filterExpanded, setFilterExpanded] = useState(expanded);
|
|
38
10
|
let filterControl;
|
|
39
11
|
let filterActive = false;
|
|
12
|
+
// eslint-disable-next-line sonarjs/no-small-switch
|
|
40
13
|
switch (control.type) {
|
|
41
14
|
case 'select': {
|
|
42
15
|
const { selectType, items } = control;
|
|
@@ -46,33 +19,27 @@ const Filter = ({ onFilterChange, onClearFilter, name, expanded = true, ...contr
|
|
|
46
19
|
SelectFilterGroup = RadioButtonGroup;
|
|
47
20
|
SelectFilter = RadioButton;
|
|
48
21
|
}
|
|
49
|
-
filterControl = (
|
|
22
|
+
filterControl = (_jsx(SelectFilterGroup, { label: name, labelHidden: true, onChange: e => {
|
|
50
23
|
const item = items.find((x) => x.id === e.target.id);
|
|
51
24
|
if (!item)
|
|
52
25
|
return;
|
|
53
26
|
const newItem = { ...item, checked: !item.checked };
|
|
54
|
-
onFilterChange
|
|
27
|
+
onFilterChange?.({
|
|
55
28
|
name,
|
|
56
29
|
type: control.type,
|
|
57
30
|
value: newItem
|
|
58
31
|
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
32
|
+
}, children: control.items.map((filterOption) => {
|
|
33
|
+
if (filterOption.checked)
|
|
34
|
+
filterActive = true;
|
|
35
|
+
return (_jsx(SelectFilter, { id: filterOption.id, name: filterOption.name, label: filterOption.label, checked: filterOption.checked }, filterOption.id));
|
|
36
|
+
}) }, void 0));
|
|
64
37
|
break;
|
|
65
38
|
}
|
|
66
39
|
default:
|
|
67
40
|
filterControl = null;
|
|
68
41
|
}
|
|
69
|
-
return (
|
|
70
|
-
React.createElement(Flex, { container: { justify: 'between' } },
|
|
71
|
-
React.createElement(Flex, { as: FilterButton, container: { itemGap: 1, alignItems: 'center' }, variant: 'text', onClick: () => setFilterExpanded(curr => !curr), "aria-expanded": filterExpanded, "aria-label": t(filterExpanded ? 'collapse_noun' : 'expand_noun', name) },
|
|
72
|
-
React.createElement(Icon, { name: 'caret-down' }),
|
|
73
|
-
React.createElement(Text, { variant: 'h3', as: 'span' }, name)),
|
|
74
|
-
filterActive && (React.createElement(Button, { variant: 'link', onClick: () => onClearFilter === null || onClearFilter === void 0 ? void 0 : onClearFilter(name) }, t('clear')))),
|
|
75
|
-
React.createElement(ExpandCollapse, { collapsed: !filterExpanded }, filterControl)));
|
|
42
|
+
return (_jsxs(StyledFilter, { children: [_jsxs(Flex, { container: { justify: 'between' }, children: [_jsxs(Flex, { as: StyledFilterButton, container: { gap: 1, alignItems: 'center' }, variant: 'text', onClick: () => setFilterExpanded(curr => !curr), "aria-expanded": filterExpanded, "aria-label": t(filterExpanded ? 'collapse_noun' : 'expand_noun', [name]), children: [_jsx(Icon, { name: 'caret-down' }, void 0), _jsx(Text, { variant: 'h3', as: 'span', children: name }, void 0)] }, void 0), filterActive && (_jsx(Button, { variant: 'link', onClick: () => onClearFilter?.(name), children: t('clear') }, void 0))] }, void 0), _jsx(ExpandCollapse, { collapsed: !filterExpanded, children: filterControl }, void 0)] }, void 0));
|
|
76
43
|
};
|
|
77
44
|
export default Filter;
|
|
78
45
|
//# sourceMappingURL=Filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../src/components/SearchResults/Filter.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../src/components/SearchResults/Filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,IAAI,EACJ,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAGnG,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,YAAY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;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { useState } from 'react';\n\nimport {\n Button,\n Checkbox,\n CheckboxGroup,\n ExpandCollapse,\n Flex,\n Icon,\n registerIcon,\n RadioButton,\n RadioButtonGroup,\n Text,\n useI18n\n} from '@pega/cosmos-react-core';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\n\nimport { FilterProps, SearchResultsProps, SelectFilterItemProps } from './SearchResults.types';\nimport { StyledFilter, StyledFilterButton } from './SearchResults.styles';\n\nregisterIcon(caretDownIcon);\n\ninterface FilterComponentProps {\n onFilterChange?: SearchResultsProps['onFilterChange'];\n onClearFilter?: SearchResultsProps['onClearFilter'];\n}\n\nconst Filter = ({\n onFilterChange,\n onClearFilter,\n name,\n expanded = true,\n ...control\n}: FilterProps & FilterComponentProps): JSX.Element => {\n const t = useI18n();\n const [filterExpanded, setFilterExpanded] = useState(expanded);\n\n let filterControl;\n let filterActive = false;\n // eslint-disable-next-line sonarjs/no-small-switch\n switch (control.type) {\n case 'select': {\n const { selectType, items } = control;\n let SelectFilterGroup = CheckboxGroup;\n let SelectFilter = Checkbox;\n if (selectType === 'single-select') {\n SelectFilterGroup = RadioButtonGroup;\n SelectFilter = RadioButton;\n }\n filterControl = (\n <SelectFilterGroup\n label={name}\n labelHidden\n onChange={e => {\n const item = items.find((x: SelectFilterItemProps) => x.id === e.target.id);\n if (!item) return;\n const newItem = { ...item, checked: !item.checked };\n\n onFilterChange?.({\n name,\n type: control.type,\n value: newItem\n });\n }}\n >\n {control.items.map((filterOption: SelectFilterItemProps) => {\n if (filterOption.checked) filterActive = true;\n return (\n <SelectFilter\n key={filterOption.id}\n id={filterOption.id}\n name={filterOption.name}\n label={filterOption.label}\n checked={filterOption.checked}\n />\n );\n })}\n </SelectFilterGroup>\n );\n break;\n }\n default:\n filterControl = null;\n }\n\n return (\n <StyledFilter>\n <Flex container={{ justify: 'between' }}>\n <Flex\n as={StyledFilterButton}\n container={{ gap: 1, alignItems: 'center' }}\n variant='text'\n onClick={() => setFilterExpanded(curr => !curr)}\n aria-expanded={filterExpanded}\n aria-label={t(filterExpanded ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Icon name='caret-down' />\n <Text variant='h3' as='span'>\n {name}\n </Text>\n </Flex>\n {filterActive && (\n <Button variant='link' onClick={() => onClearFilter?.(name)}>\n {t('clear')}\n </Button>\n )}\n </Flex>\n <ExpandCollapse collapsed={!filterExpanded}>{filterControl}</ExpandCollapse>\n </StyledFilter>\n );\n};\n\nexport default Filter;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResult.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchResult.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAmB1D,QAAA,MAAM,YAAY,2CAMf,iBAAiB,KAAG,WAetB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { defaultThemeProp, Text, MetaList, Link, Flex, StyledPopover, calculateFontSize } from '@pega/cosmos-react-core';
|
|
4
4
|
const StyledSearchResult = styled.article(({ theme }) => {
|
|
@@ -15,13 +15,7 @@ const StyledDescription = styled(Text) `
|
|
|
15
15
|
word-break: break-word;
|
|
16
16
|
`;
|
|
17
17
|
const SearchResult = ({ id, title, link, description, meta = [] }) => {
|
|
18
|
-
return (
|
|
19
|
-
React.createElement(Flex, { container: { direction: 'column-reverse' } },
|
|
20
|
-
React.createElement(Text, { variant: 'h2' },
|
|
21
|
-
React.createElement(Link, { ...link }, title)),
|
|
22
|
-
React.createElement(Text, { variant: 'secondary', as: 'div' }, id)),
|
|
23
|
-
description && React.createElement(StyledDescription, { forwardedAs: 'p' }, description),
|
|
24
|
-
!!meta.length && React.createElement(MetaList, { items: meta })));
|
|
18
|
+
return (_jsxs(Flex, { as: StyledSearchResult, container: { direction: 'column', gap: 1 }, children: [_jsxs(Flex, { container: { direction: 'column-reverse' }, children: [_jsx(Text, { variant: 'h2', children: _jsx(Link, { ...link, children: title }, void 0) }, void 0), _jsx(Text, { variant: 'secondary', as: 'div', children: id }, void 0)] }, void 0), description && _jsx(StyledDescription, { forwardedAs: 'p', children: description }, void 0), !!meta.length && _jsx(MetaList, { items: meta }, void 0)] }, void 0));
|
|
25
19
|
};
|
|
26
20
|
export default SearchResult;
|
|
27
21
|
//# sourceMappingURL=SearchResult.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResult.js","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SearchResult.js","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResult.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;SACH,aAAa;mBACH,QAAQ,CAAC,CAAC;qBACR,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM;;GAElD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EACpB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GAAG,EAAE,EACS,EAAe,EAAE;IACnC,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aACtE,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAC9C,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAChB,KAAC,IAAI,OAAK,IAAI,YAAG,KAAK,WAAQ,WACzB,EACP,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,EAAC,EAAE,EAAC,KAAK,YAC/B,EAAE,WACE,YACF,EACN,WAAW,IAAI,KAAC,iBAAiB,IAAC,WAAW,EAAC,GAAG,YAAE,WAAW,WAAqB,EACnF,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,WAAI,YACtC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Text,\n MetaList,\n Link,\n Flex,\n StyledPopover,\n calculateFontSize\n} from '@pega/cosmos-react-core';\n\nimport { SearchResultProps } from './SearchResults.types';\n\nconst StyledSearchResult = styled.article(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n h2 ${StyledPopover} {\n font-size: ${fontSize.s};\n font-weight: ${theme.base['font-weight'].normal};\n }\n `;\n});\n\nStyledSearchResult.defaultProps = defaultThemeProp;\n\nconst StyledDescription = styled(Text)`\n word-break: break-word;\n`;\n\nconst SearchResult = ({\n id,\n title,\n link,\n description,\n meta = []\n}: SearchResultProps): JSX.Element => {\n return (\n <Flex as={StyledSearchResult} container={{ direction: 'column', gap: 1 }}>\n <Flex container={{ direction: 'column-reverse' }}>\n <Text variant='h2'>\n <Link {...link}>{title}</Link>\n </Text>\n <Text variant='secondary' as='div'>\n {id}\n </Text>\n </Flex>\n {description && <StyledDescription forwardedAs='p'>{description}</StyledDescription>}\n {!!meta.length && <MetaList items={meta} />}\n </Flex>\n );\n};\n\nexport default SearchResult;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAML,YAAY,EAcb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EACL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AA2E/B,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAgMvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|