@pega/cosmos-react-work 3.0.0-dev.14.0 → 3.0.0-dev.15.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/Stages/StageGlimpse.d.ts +10 -0
- package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
- package/lib/components/Stages/StageGlimpse.js +11 -0
- package/lib/components/Stages/StageGlimpse.js.map +1 -0
- package/lib/components/Stages/Stages.d.ts +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +105 -112
- package/lib/components/Stages/Stages.js.map +1 -1
- package/lib/components/Stages/Stages.styles.d.ts +4 -7
- package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
- package/lib/components/Stages/Stages.styles.js +169 -186
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/Stages.types.d.ts +19 -4
- package/lib/components/Stages/Stages.types.d.ts.map +1 -1
- package/lib/components/Stages/Stages.types.js.map +1 -1
- package/package.json +5 -2
- package/lib/components/Stages/Steps.d.ts +0 -8
- package/lib/components/Stages/Steps.d.ts.map +0 -1
- package/lib/components/Stages/Steps.js +0 -12
- package/lib/components/Stages/Steps.js.map +0 -1
- package/lib/components/Stages/StepsContainer.d.ts +0 -8
- package/lib/components/Stages/StepsContainer.d.ts.map +0 -1
- package/lib/components/Stages/StepsContainer.js +0 -11
- package/lib/components/Stages/StepsContainer.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { Action } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StageProps } from './Stages.types';
|
|
4
|
+
export interface StageGlimpseProps {
|
|
5
|
+
stage: StageProps;
|
|
6
|
+
actions?: Action[];
|
|
7
|
+
}
|
|
8
|
+
declare const StageGlimpse: FunctionComponent<StageGlimpseProps>;
|
|
9
|
+
export default StageGlimpse;
|
|
10
|
+
//# sourceMappingURL=StageGlimpse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageGlimpse.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StageGlimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,MAAM,EAA8C,MAAM,yBAAyB,CAAC;AAG7F,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA6BtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Actions, Flex, registerIcon, Text, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
+
import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
|
|
4
|
+
import { StyledDateTimeDisplay, StyledStep, StyledStepsContainer } from './Stages.styles';
|
|
5
|
+
registerIcon(checkIcon);
|
|
6
|
+
const StageGlimpse = ({ stage, actions }) => {
|
|
7
|
+
const t = useI18n();
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'start' }, children: [_jsxs("div", { children: [_jsx(Text, { variant: 'h2', children: stage.name }), stage.date ? (_jsx(StyledDateTimeDisplay, { value: stage.date, variant: 'relative', format: 'short' })) : (t('not_started'))] }), actions && actions.length > 0 && _jsx(Actions, { items: actions, iconOnly: true })] }), stage.steps && (_jsx(StyledStepsContainer, { children: stage.steps.map(({ id, name, completed }) => (_jsx(Flex, { as: StyledStep, container: { gap: 0.5 }, completed: completed, children: _jsx("div", { children: name }) }, id))) }))] }));
|
|
9
|
+
};
|
|
10
|
+
export default StageGlimpse;
|
|
11
|
+
//# sourceMappingURL=StageGlimpse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageGlimpse.js","sourceRoot":"","sources":["../../../src/components/Stages/StageGlimpse.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAU,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAG1F,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE1F,YAAY,CAAC,SAAS,CAAC,CAAC;AAOxB,MAAM,YAAY,GAAyC,CAAC,EAC1D,KAAK,EACL,OAAO,EACW,EAAE,EAAE;IACtB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,8BACE,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,aAC1D,0BACE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,CAAC,IAAI,GAAQ,EACrC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACZ,KAAC,qBAAqB,IAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAC,UAAU,EAAC,MAAM,EAAC,OAAO,GAAG,CAC/E,CAAC,CAAC,CAAC,CACF,CAAC,CAAC,aAAa,CAAC,CACjB,IACG,EACL,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAG,IACjE,EACN,KAAK,CAAC,KAAK,IAAI,CACd,KAAC,oBAAoB,cAClB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAC5C,KAAC,IAAI,IAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAW,SAAS,EAAE,SAAS,YAC1E,wBAAM,IAAI,GAAO,IADiC,EAAE,CAE/C,CACR,CAAC,GACmB,CACxB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport { Action, Actions, Flex, registerIcon, Text, useI18n } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport { StageProps } from './Stages.types';\nimport { StyledDateTimeDisplay, StyledStep, StyledStepsContainer } from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nexport interface StageGlimpseProps {\n stage: StageProps;\n actions?: Action[];\n}\n\nconst StageGlimpse: FunctionComponent<StageGlimpseProps> = ({\n stage,\n actions\n}: StageGlimpseProps) => {\n const t = useI18n();\n return (\n <>\n <Flex container={{ justify: 'between', alignItems: 'start' }}>\n <div>\n <Text variant='h2'>{stage.name}</Text>\n {stage.date ? (\n <StyledDateTimeDisplay value={stage.date} variant='relative' format='short' />\n ) : (\n t('not_started')\n )}\n </div>\n {actions && actions.length > 0 && <Actions items={actions} iconOnly />}\n </Flex>\n {stage.steps && (\n <StyledStepsContainer>\n {stage.steps.map(({ id, name, completed }) => (\n <Flex as={StyledStep} container={{ gap: 0.5 }} key={id} completed={completed}>\n <div>{name}</div>\n </Flex>\n ))}\n </StyledStepsContainer>\n )}\n </>\n );\n};\n\nexport default StageGlimpse;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import { StagesProps } from './Stages.types';
|
|
3
|
+
import type { StagesProps } from './Stages.types';
|
|
4
4
|
declare const Stages: FunctionComponent<StagesProps & ForwardProps>;
|
|
5
5
|
export default Stages;
|
|
6
6
|
//# sourceMappingURL=Stages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Stages.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAIL,YAAY,EAiBb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAYlD,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CAiMzD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,129 +1,122 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import { useState, useRef, useEffect, useContext,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect, useContext, forwardRef, Fragment } from 'react';
|
|
3
3
|
import { remToPx } from 'polished';
|
|
4
|
-
import { Icon, registerIcon, Flex, useElement, useOuterEvent,
|
|
4
|
+
import { Icon, registerIcon, Flex, useElement, useOuterEvent, useI18n, Button, ModalManagerContext, Modal, useBreakpoint, debounce, useTheme, useEscape, useConsolidatedRef, CardFooter, Card, useUID, Progress } from '@pega/cosmos-react-core';
|
|
5
5
|
import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
7
|
+
import StageGlimpse from './StageGlimpse';
|
|
8
|
+
import { StyledInnerStage, StyledPopoverContent, StyledStage, StyledStagePopover, StyledStages } from './Stages.styles';
|
|
9
|
+
registerIcon(checkIcon, timesIcon);
|
|
10
|
+
const Stages = forwardRef(({ current, stages, caseTitle, onLoadStage, ...restProps }, ref) => {
|
|
11
11
|
const t = useI18n();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const [
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const activeStageEl = stagesRefs.current[activeStageIndex];
|
|
19
|
-
const { create } = useContext(ModalManagerContext);
|
|
12
|
+
const stagesRef = useConsolidatedRef(ref);
|
|
13
|
+
const currentStageRef = useRef(null);
|
|
14
|
+
const [focusedStageIndex, setFocusedStageIndex] = useState(undefined);
|
|
15
|
+
const focusedStageRef = useRef(null);
|
|
16
|
+
const { create: createModal } = useContext(ModalManagerContext);
|
|
17
|
+
const modalMethods = useRef();
|
|
20
18
|
const [popoverEl, setPopoverRef] = useElement();
|
|
21
19
|
const [showPopover, setShowPopover] = useState(false);
|
|
22
|
-
const popoverContentRef = useRef(null);
|
|
23
20
|
const isSmallOrAbove = useBreakpoint('sm');
|
|
24
|
-
const focusableElements = getFocusables(popoverContentRef);
|
|
25
21
|
const [compressedView, setCompressedView] = useState(false);
|
|
26
22
|
const [minExpandedWidth, setMinExpandedWidth] = useState(0);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
setCompressedView(false);
|
|
30
|
-
}, 100));
|
|
31
|
-
const theme = useTheme();
|
|
32
|
-
const intersectionObserver = new IntersectionObserver(entries => {
|
|
33
|
-
if (entries[0].intersectionRatio < 1) {
|
|
34
|
-
if (stagesEl)
|
|
35
|
-
setMinExpandedWidth(Math.max(minExpandedWidth, stagesEl.offsetWidth + 1));
|
|
36
|
-
setCompressedView(true);
|
|
37
|
-
}
|
|
38
|
-
}, { root: currentStageButtonEl, rootMargin: `0px -${remToPx(theme.base.spacing)}`, threshold: 1 });
|
|
23
|
+
const { base: { spacing: themeSpacing } } = useTheme();
|
|
24
|
+
const popoverId = useUID();
|
|
39
25
|
useEffect(() => {
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [stagesEl, currentStageNameEl, compressedView]);
|
|
49
|
-
useOuterEvent('mousedown', [popoverEl, activeStageEl], e => {
|
|
50
|
-
if (showPopover) {
|
|
51
|
-
setShowPopover(false);
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const onMouseDown = (ev) => {
|
|
56
|
-
if (!showPopover)
|
|
57
|
-
ev.preventDefault();
|
|
58
|
-
};
|
|
59
|
-
const onKeyDown = useCallback(({ key }) => {
|
|
60
|
-
if (key === 'Escape') {
|
|
61
|
-
setShowPopover(false);
|
|
62
|
-
activeStageEl?.focus();
|
|
63
|
-
}
|
|
64
|
-
}, [activeStageEl]);
|
|
65
|
-
const onKeyDownPopover = useCallback((event) => {
|
|
66
|
-
if (event.key === 'Tab' && event.shiftKey) {
|
|
67
|
-
const firstFocusable = focusableElements[0];
|
|
68
|
-
if (document.activeElement === firstFocusable) {
|
|
69
|
-
stagesRefs.current[activeStageIndex + 1]?.focus();
|
|
70
|
-
setShowPopover(false);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (event.key === 'Tab' && !event.shiftKey) {
|
|
74
|
-
const lastFocusable = focusableElements[focusableElements.length - 1];
|
|
75
|
-
if (document.activeElement === lastFocusable) {
|
|
76
|
-
activeStageEl?.focus();
|
|
77
|
-
setShowPopover(false);
|
|
26
|
+
if (stagesRef.current && currentStageRef.current) {
|
|
27
|
+
if (compressedView) {
|
|
28
|
+
const resizeObserver = new ResizeObserver(debounce((entries) => {
|
|
29
|
+
if (entries[0].contentRect.width > minExpandedWidth)
|
|
30
|
+
setCompressedView(false);
|
|
31
|
+
}, 100));
|
|
32
|
+
resizeObserver.observe(stagesRef.current);
|
|
33
|
+
return () => resizeObserver.disconnect();
|
|
78
34
|
}
|
|
35
|
+
const intersectionObserver = new IntersectionObserver(entries => {
|
|
36
|
+
if (entries[0].intersectionRatio < 1) {
|
|
37
|
+
if (stagesRef.current)
|
|
38
|
+
setMinExpandedWidth(Math.max(minExpandedWidth, stagesRef.current.offsetWidth + 1));
|
|
39
|
+
setCompressedView(true);
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
root: currentStageRef.current,
|
|
43
|
+
rootMargin: `0px -${remToPx(themeSpacing)}`,
|
|
44
|
+
threshold: 1
|
|
45
|
+
});
|
|
46
|
+
intersectionObserver.observe(currentStageRef.current.children[0]);
|
|
47
|
+
return () => intersectionObserver.disconnect();
|
|
79
48
|
}
|
|
80
|
-
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const [requestDismiss, setRequestDismiss] = useState(false);
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
if (requestDismiss) {
|
|
94
|
-
setShowPopover(false);
|
|
95
|
-
activeStageEl?.focus();
|
|
96
|
-
setRequestDismiss(false);
|
|
97
|
-
}
|
|
98
|
-
}, [activeStageEl, requestDismiss]);
|
|
99
|
-
const RenderModal = ({ heading = t('lifecycle', [caseTitle || 'Case']) }) => {
|
|
100
|
-
return (_jsx(Modal, { ...restProps, heading: heading, onRequestDismiss: () => setRequestDismiss(true), children: stages.map((stage, id) => (_jsx(StepsContainer, { currentStage: [stage] }, id.toString()))) }));
|
|
101
|
-
};
|
|
49
|
+
}, [themeSpacing, minExpandedWidth, compressedView]);
|
|
50
|
+
useOuterEvent('mousedown', [popoverEl, focusedStageRef], () => {
|
|
51
|
+
setShowPopover(false);
|
|
52
|
+
});
|
|
53
|
+
useEscape(() => {
|
|
54
|
+
setShowPopover(false);
|
|
55
|
+
focusedStageRef.current?.focus();
|
|
56
|
+
}, stagesRef);
|
|
57
|
+
const stagesToLoad = onLoadStage
|
|
58
|
+
? stages.filter(stage => !Array.isArray(stage.steps)).map(stage => stage.id)
|
|
59
|
+
: [];
|
|
102
60
|
const openModal = () => {
|
|
103
61
|
setShowPopover(false);
|
|
104
|
-
|
|
62
|
+
if (stagesToLoad.length > 0)
|
|
63
|
+
onLoadStage?.(stagesToLoad);
|
|
64
|
+
modalMethods.current = createModal(Modal, {
|
|
65
|
+
heading: caseTitle
|
|
66
|
+
? t('stages_case_lifecycle', [caseTitle])
|
|
67
|
+
: t('stages_default_case_lifecycle'),
|
|
68
|
+
progress: stagesToLoad.length > 0,
|
|
69
|
+
children: stages.map(stage => _jsx(StageGlimpse, { stage: stage }, stage.id)),
|
|
70
|
+
onAfterClose: () => {
|
|
71
|
+
focusedStageRef.current?.focus();
|
|
72
|
+
modalMethods.current = undefined;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
105
75
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
modalMethods.current?.update({
|
|
78
|
+
progress: stagesToLoad.length > 0,
|
|
79
|
+
children: stages.map(stage => _jsx(StageGlimpse, { stage: stage }, stage.id))
|
|
80
|
+
});
|
|
81
|
+
}, [stagesToLoad.length]);
|
|
82
|
+
return (_jsx(Flex, { ...restProps, container: true, as: StyledStages, ref: stagesRef, role: 'region', "aria-label": t('stages_label'), children: stages.map((stage, index) => {
|
|
83
|
+
const isCurrent = stage.id === current;
|
|
84
|
+
let stageStatusText = t(stage.completed ? 'completed' : 'not_started');
|
|
85
|
+
if (isCurrent)
|
|
86
|
+
stageStatusText = t('current');
|
|
87
|
+
const hasToLoad = stagesToLoad.includes(stage.id);
|
|
88
|
+
return (_jsxs(Fragment, { children: [_jsxs(Flex, { container: { justify: 'center', alignItems: 'center' }, as: StyledStage, item: { grow: compressedView && !isCurrent ? 0 : 1, shrink: 1 }, "aria-current": isCurrent ? 'step' : undefined, "aria-label": t('stages_stage_label', [stage.name, stageStatusText]), ref: isCurrent ? currentStageRef : undefined, onClick: () => {
|
|
89
|
+
if (isSmallOrAbove) {
|
|
90
|
+
if (hasToLoad)
|
|
91
|
+
onLoadStage?.([stage.id]);
|
|
92
|
+
setShowPopover(prevShowPopover => !prevShowPopover);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
openModal();
|
|
96
|
+
}
|
|
97
|
+
}, onFocus: (e) => {
|
|
98
|
+
setShowPopover(false);
|
|
99
|
+
setFocusedStageIndex(index);
|
|
100
|
+
focusedStageRef.current = e.currentTarget;
|
|
101
|
+
}, "aria-expanded": showPopover && isSmallOrAbove, "aria-controls": showPopover ? popoverId : undefined, children: [stage.completed && _jsx(Icon, { name: 'check' }), !(stage.completed && compressedView) && (_jsx(StyledInnerStage, { ellipsis: isCurrent && compressedView, children: !isCurrent && compressedView ? index + 1 : stage.name }))] }), focusedStageIndex === index && showPopover && isSmallOrAbove && (_jsx(StyledStagePopover, { target: focusedStageRef.current, ref: setPopoverRef, arrow: true, placement: 'bottom-start', modifiers: [
|
|
102
|
+
{
|
|
103
|
+
name: 'flip',
|
|
104
|
+
options: {
|
|
105
|
+
fallbackPlacements: ['bottom-end', 'right', 'left']
|
|
106
|
+
}
|
|
124
107
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
108
|
+
], id: popoverId, "aria-busy": hasToLoad, children: _jsxs(Card, { children: [_jsx(StyledPopoverContent, { children: !hasToLoad ? (_jsx(StageGlimpse, { stage: stage, actions: [
|
|
109
|
+
{
|
|
110
|
+
id: 'close',
|
|
111
|
+
text: t('close'),
|
|
112
|
+
icon: 'times',
|
|
113
|
+
onClick: () => {
|
|
114
|
+
setShowPopover(false);
|
|
115
|
+
focusedStageRef.current?.focus();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
] })) : (_jsx(Progress, { placement: 'local', message: t('loading') })) }), _jsx(CardFooter, { children: _jsx(Button, { variant: 'secondary', onClick: openModal, children: t('stages_see_full_lifecycle') }) })] }) }))] }, stage.id));
|
|
119
|
+
}) }));
|
|
120
|
+
});
|
|
128
121
|
export default Stages;
|
|
129
122
|
//# sourceMappingURL=Stages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EAEJ,UAAU,EACV,aAAa,EACb,OAAO,EACP,OAAO,EACP,MAAM,EACN,mBAAmB,EAEnB,KAAK,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAG1F,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAElG,YAAY,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,MAAM,GAAkD,CAAC,KAAkB,EAAE,EAAE;IACnF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,UAAU,EAAkB,CAAC;IAC7D,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,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AC,EAAE,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAC/C,CACpB,KAvBI,SAAS,KAAK,CAAC,EAAE,EAAE,CAwBnB,CACR,CAAC,GACG,EACP,KAAC,IAAI,IAAC,GAAG,EAAE,iBAAiB,YAC1B,MAAC,OAAO,IACN,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,WAAW,IAAI,cAAc,EACnC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC5C,EAAE,EAAC,IAAI,EACP,GAAG,EAAE,aAAa,EAClB,KAAK,QACL,SAAS,EAAC,cAAc,EACxB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE;wBACT;4BACE,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE;gCACP,kBAAkB,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC;6BACpD;yBACF;qBACF,aAED,KAAC,cAAc,IAAC,YAAY,EAAE,CAAC,cAAc,CAAC,GAAI,EAClD,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,SAAS,YAC3C,CAAC,CAAC,0BAA0B,CAAC,GACvB,IACD,GACL,IACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent, useState, useRef, useEffect, useContext, useCallback } from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Icon,\n registerIcon,\n Flex,\n ForwardProps,\n useElement,\n useOuterEvent,\n Popover,\n useI18n,\n Button,\n ModalManagerContext,\n ModalProps,\n Modal,\n getFocusables,\n useBreakpoint,\n debounce,\n useTheme\n} from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport { StagesProps } from './Stages.types';\nimport StepsContainer from './StepsContainer';\nimport { StyledInnerStage, StyledStage, StyledStagePopover, StyledStages } from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nconst Stages: FunctionComponent<StagesProps & ForwardProps> = (props: StagesProps) => {\n const { current, stages, caseTitle, ...restProps } = props;\n const t = useI18n();\n\n const [stagesEl, setStagesEl] = useElement<HTMLDivElement>();\n const [currentStageNameEl, setCurrentStageNameEl] = useElement<HTMLSpanElement>();\n const [currentStageButtonEl, setCurrentStageButtonEl] = useElement<HTMLButtonElement>();\n\n const [activeStageIndex, setActiveStageIndex] = useState<number>(0);\n const activeStageObj = stages[activeStageIndex];\n const stagesRefs = useRef<HTMLElement[]>([]);\n const activeStageEl = stagesRefs.current[activeStageIndex];\n const { create } = useContext(ModalManagerContext);\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [showPopover, setShowPopover] = useState(false);\n const popoverContentRef = useRef(null);\n const isSmallOrAbove = useBreakpoint('sm');\n const focusableElements = getFocusables(popoverContentRef);\n\n const [compressedView, setCompressedView] = useState(false);\n const [minExpandedWidth, setMinExpandedWidth] = useState(0);\n\n const resizeObserver = new ResizeObserver(\n debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minExpandedWidth) setCompressedView(false);\n }, 100)\n );\n\n const theme = useTheme();\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (stagesEl) setMinExpandedWidth(Math.max(minExpandedWidth, stagesEl.offsetWidth + 1));\n setCompressedView(true);\n }\n },\n { root: currentStageButtonEl, rootMargin: `0px -${remToPx(theme.base.spacing)}`, threshold: 1 }\n );\n\n useEffect(() => {\n if (stagesEl && currentStageNameEl) {\n intersectionObserver.observe(currentStageNameEl as Element);\n resizeObserver.observe(stagesEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [stagesEl, currentStageNameEl, compressedView]);\n\n useOuterEvent('mousedown', [popoverEl, activeStageEl], e => {\n if (showPopover) {\n setShowPopover(false);\n e.preventDefault();\n }\n });\n\n const onMouseDown = (ev: React.MouseEvent<HTMLElement>) => {\n if (!showPopover) ev.preventDefault();\n };\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === 'Escape') {\n setShowPopover(false);\n activeStageEl?.focus();\n }\n },\n [activeStageEl]\n );\n\n const onKeyDownPopover = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Tab' && event.shiftKey) {\n const firstFocusable = focusableElements[0];\n\n if (document.activeElement === firstFocusable) {\n stagesRefs.current[activeStageIndex + 1]?.focus();\n setShowPopover(false);\n }\n }\n\n if (event.key === 'Tab' && !event.shiftKey) {\n const lastFocusable = focusableElements[focusableElements.length - 1];\n\n if (document.activeElement === lastFocusable) {\n activeStageEl?.focus();\n setShowPopover(false);\n }\n }\n },\n [activeStageEl, focusableElements, activeStageIndex]\n );\n\n useEffect(() => {\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [onKeyDown]);\n\n useEffect(() => {\n if (focusableElements.length) focusableElements[0].focus();\n }, [popoverEl]);\n\n const [requestDismiss, setRequestDismiss] = useState(false);\n\n useEffect(() => {\n if (requestDismiss) {\n setShowPopover(false);\n activeStageEl?.focus();\n setRequestDismiss(false);\n }\n }, [activeStageEl, requestDismiss]);\n\n const RenderModal = ({\n heading = t('lifecycle', [caseTitle || 'Case'])\n }: Partial<ModalProps>) => {\n return (\n <Modal {...restProps} heading={heading} onRequestDismiss={() => setRequestDismiss(true)}>\n {stages.map((stage, id) => (\n <StepsContainer currentStage={[stage]} key={id.toString()} />\n ))}\n </Modal>\n );\n };\n\n const openModal = () => {\n setShowPopover(false);\n create(RenderModal);\n };\n\n const isCurrent = (stageId: string) => current === stageId;\n\n return (\n <>\n <Flex container as={StyledStages} ref={setStagesEl} {...restProps}>\n {stages.map((stage, index) => (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledStage}\n item={{ grow: compressedView && !isCurrent(stage.id) ? 0 : 1, shrink: 1 }}\n aria-current={isCurrent(stage.id) ? 'step' : undefined}\n aria-label={`Stage ${stage.name}`}\n key={`stage-${stage.id}`}\n ref={(el: HTMLButtonElement) => {\n stagesRefs.current[index] = el;\n if (isCurrent(stage.id)) setCurrentStageButtonEl(el);\n }}\n onMouseDown={onMouseDown}\n onClick={() => {\n setActiveStageIndex(index);\n if (isSmallOrAbove) {\n setShowPopover(!showPopover);\n } else {\n openModal();\n }\n }}\n >\n {stage.complete && <Icon name='check' />}\n {!(stage.complete && compressedView) && (\n <StyledInnerStage\n ref={isCurrent(stage.id) ? setCurrentStageNameEl : undefined}\n ellipsis={isCurrent(stage.id) && compressedView}\n >\n {!isCurrent(stage.id) && compressedView ? index + 1 : stage.name}\n </StyledInnerStage>\n )}\n </Flex>\n ))}\n </Flex>\n <Flex ref={popoverContentRef}>\n <Popover\n as={StyledStagePopover}\n show={showPopover && isSmallOrAbove}\n target={stagesRefs.current[activeStageIndex]}\n id='id'\n ref={setPopoverRef}\n arrow\n placement='bottom-start'\n onKeyDown={onKeyDownPopover}\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['bottom-end', 'right', 'left']\n }\n }\n ]}\n >\n <StepsContainer currentStage={[activeStageObj]} />\n <Button variant='secondary' onClick={openModal}>\n {t('stage_see_full_lifecycle')}\n </Button>\n </Popover>\n </Flex>\n </>\n );\n};\n\nexport default Stages;\n"]}
|
|
1
|
+
{"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAU,EAGV,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EAEJ,UAAU,EACV,aAAa,EACb,OAAO,EACP,MAAM,EACN,mBAAmB,EACnB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAA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,KAAK,IAAI,WAAW,IAAI,cAAc,IAAI,CAC/D,KAAC,kBAAkB,IACjB,MAAM,EAAE,eAAe,CAAC,OAAO,EAC/B,GAAG,EAAE,aAAa,EAClB,KAAK,QACL,SAAS,EAAC,cAAc,EACxB,SAAS,EAAE;4BACT;gCACE,IAAI,EAAE,MAAM;gCACZ,OAAO,EAAE;oCACP,kBAAkB,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC;iCACpD;6BACF;yBACF,EACD,EAAE,EAAE,SAAS,eACF,SAAS,YAEpB,MAAC,IAAI,eACH,KAAC,oBAAoB,cAClB,CAAC,SAAS,CAAC,CAAC,CAAC,CACZ,KAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;4CACP;gDACE,EAAE,EAAE,OAAO;gDACX,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC;gDAChB,IAAI,EAAE,OAAO;gDACb,OAAO,EAAE,GAAG,EAAE;oDACZ,cAAc,CAAC,KAAK,CAAC,CAAC;oDACtB,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;gDACnC,CAAC;6CACF;yCACF,GACD,CACH,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,GAAI,CACtD,GACoB,EACvB,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,SAAS,YAC3C,CAAC,CAAC,2BAA2B,CAAC,GACxB,GACE,IACR,GACY,CACtB,KA5EY,KAAK,CAAC,EAAE,CA6EZ,CACZ,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n FunctionComponent,\n useState,\n useRef,\n useEffect,\n useContext,\n forwardRef,\n FocusEvent,\n PropsWithoutRef,\n Fragment\n} from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Icon,\n registerIcon,\n Flex,\n ForwardProps,\n useElement,\n useOuterEvent,\n useI18n,\n Button,\n ModalManagerContext,\n Modal,\n useBreakpoint,\n debounce,\n useTheme,\n useEscape,\n useConsolidatedRef,\n CardFooter,\n Card,\n useUID,\n Progress,\n ModalMethods\n} from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport type { StagesProps } from './Stages.types';\nimport StageGlimpse from './StageGlimpse';\nimport {\n StyledInnerStage,\n StyledPopoverContent,\n StyledStage,\n StyledStagePopover,\n StyledStages\n} from './Stages.styles';\n\nregisterIcon(checkIcon, timesIcon);\n\nconst Stages: FunctionComponent<StagesProps & ForwardProps> = forwardRef(\n (\n { current, stages, caseTitle, onLoadStage, ...restProps }: PropsWithoutRef<StagesProps>,\n ref: StagesProps['ref']\n ) => {\n const t = useI18n();\n\n const stagesRef = useConsolidatedRef(ref);\n const currentStageRef = useRef<HTMLButtonElement>(null);\n const [focusedStageIndex, setFocusedStageIndex] = useState<number | undefined>(undefined);\n const focusedStageRef = useRef<HTMLButtonElement | null>(null);\n\n const { create: createModal } = useContext(ModalManagerContext);\n const modalMethods = useRef<ModalMethods>();\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [showPopover, setShowPopover] = useState(false);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const [compressedView, setCompressedView] = useState(false);\n const [minExpandedWidth, setMinExpandedWidth] = useState(0);\n\n const {\n base: { spacing: themeSpacing }\n } = useTheme();\n\n const popoverId = useUID();\n\n useEffect(() => {\n if (stagesRef.current && currentStageRef.current) {\n if (compressedView) {\n const resizeObserver = new ResizeObserver(\n debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minExpandedWidth) setCompressedView(false);\n }, 100)\n );\n resizeObserver.observe(stagesRef.current);\n return () => resizeObserver.disconnect();\n }\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (stagesRef.current)\n setMinExpandedWidth(Math.max(minExpandedWidth, stagesRef.current.offsetWidth + 1));\n setCompressedView(true);\n }\n },\n {\n root: currentStageRef.current,\n rootMargin: `0px -${remToPx(themeSpacing)}`,\n threshold: 1\n }\n );\n\n intersectionObserver.observe(currentStageRef.current.children[0]);\n\n return () => intersectionObserver.disconnect();\n }\n }, [themeSpacing, minExpandedWidth, compressedView]);\n\n useOuterEvent('mousedown', [popoverEl, focusedStageRef], () => {\n setShowPopover(false);\n });\n\n useEscape(() => {\n setShowPopover(false);\n focusedStageRef.current?.focus();\n }, stagesRef);\n\n const stagesToLoad = onLoadStage\n ? stages.filter(stage => !Array.isArray(stage.steps)).map(stage => stage.id)\n : [];\n\n const openModal = () => {\n setShowPopover(false);\n if (stagesToLoad.length > 0) onLoadStage?.(stagesToLoad);\n modalMethods.current = createModal(Modal, {\n heading: caseTitle\n ? t('stages_case_lifecycle', [caseTitle])\n : t('stages_default_case_lifecycle'),\n progress: stagesToLoad.length > 0,\n children: stages.map(stage => <StageGlimpse stage={stage} key={stage.id} />),\n onAfterClose: () => {\n focusedStageRef.current?.focus();\n modalMethods.current = undefined;\n }\n });\n };\n\n useEffect(() => {\n modalMethods.current?.update({\n progress: stagesToLoad.length > 0,\n children: stages.map(stage => <StageGlimpse stage={stage} key={stage.id} />)\n });\n }, [stagesToLoad.length]);\n\n return (\n <Flex\n {...restProps}\n container\n as={StyledStages}\n ref={stagesRef}\n role='region'\n aria-label={t('stages_label')}\n >\n {stages.map((stage, index) => {\n const isCurrent = stage.id === current;\n let stageStatusText = t(stage.completed ? 'completed' : 'not_started');\n if (isCurrent) stageStatusText = t('current');\n const hasToLoad = stagesToLoad.includes(stage.id);\n return (\n <Fragment key={stage.id}>\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledStage}\n item={{ grow: compressedView && !isCurrent ? 0 : 1, shrink: 1 }}\n aria-current={isCurrent ? 'step' : undefined}\n aria-label={t('stages_stage_label', [stage.name, stageStatusText])}\n ref={isCurrent ? currentStageRef : undefined}\n onClick={() => {\n if (isSmallOrAbove) {\n if (hasToLoad) onLoadStage?.([stage.id]);\n setShowPopover(prevShowPopover => !prevShowPopover);\n } else {\n openModal();\n }\n }}\n onFocus={(e: FocusEvent) => {\n setShowPopover(false);\n setFocusedStageIndex(index);\n focusedStageRef.current = e.currentTarget as HTMLButtonElement;\n }}\n aria-expanded={showPopover && isSmallOrAbove}\n aria-controls={showPopover ? popoverId : undefined}\n >\n {stage.completed && <Icon name='check' />}\n {!(stage.completed && compressedView) && (\n <StyledInnerStage ellipsis={isCurrent && compressedView}>\n {!isCurrent && compressedView ? index + 1 : stage.name}\n </StyledInnerStage>\n )}\n </Flex>\n {focusedStageIndex === index && showPopover && isSmallOrAbove && (\n <StyledStagePopover\n target={focusedStageRef.current}\n ref={setPopoverRef}\n arrow\n placement='bottom-start'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['bottom-end', 'right', 'left']\n }\n }\n ]}\n id={popoverId}\n aria-busy={hasToLoad}\n >\n <Card>\n <StyledPopoverContent>\n {!hasToLoad ? (\n <StageGlimpse\n stage={stage}\n actions={[\n {\n id: 'close',\n text: t('close'),\n icon: 'times',\n onClick: () => {\n setShowPopover(false);\n focusedStageRef.current?.focus();\n }\n }\n ]}\n />\n ) : (\n <Progress placement='local' message={t('loading')} />\n )}\n </StyledPopoverContent>\n <CardFooter>\n <Button variant='secondary' onClick={openModal}>\n {t('stages_see_full_lifecycle')}\n </Button>\n </CardFooter>\n </Card>\n </StyledStagePopover>\n )}\n </Fragment>\n );\n })}\n </Flex>\n );\n }\n);\n\nexport default Stages;\n"]}
|
|
@@ -3,14 +3,11 @@ export declare const StyledInnerStage: import("styled-components").StyledCompone
|
|
|
3
3
|
ellipsis?: boolean | undefined;
|
|
4
4
|
}, never>;
|
|
5
5
|
export declare const StyledStage: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const StyledStagePopover: import("styled-components").StyledComponent<"
|
|
6
|
+
export declare const StyledStagePopover: import("styled-components").StyledComponent<(<Modifiers extends string = string>(props: import("@pega/cosmos-react-core").PopoverProps<Modifiers> & import("@pega/cosmos-react-core").ForwardProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null), import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export declare const StyledStepsContainer: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
|
|
8
8
|
export declare const StyledStep: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {
|
|
9
|
-
|
|
9
|
+
completed: boolean;
|
|
10
10
|
}, never>;
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
complete: boolean;
|
|
14
|
-
}, never>;
|
|
15
|
-
export declare const StyledDateTimeDisplay: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
export declare const StyledPopoverContent: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardContentProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const StyledDateTimeDisplay: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").DateTimeDisplayProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
16
13
|
//# sourceMappingURL=Stages.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY,yGAMvB,CAAC;AAIH,eAAO,MAAM,gBAAgB;;SAW3B,CAAC;AAEH,eAAO,MAAM,WAAW,4GAoLvB,CAAC;AAIF,eAAO,MAAM,kBAAkB,6VAE9B,CAAC;AAIF,eAAO,MAAM,oBAAoB,wGAS/B,CAAC;AAIH,eAAO,MAAM,UAAU;eAA0B,OAAO;SAsCtD,CAAC;AAIH,eAAO,MAAM,oBAAoB,0OAEhC,CAAC;AAIF,eAAO,MAAM,qBAAqB,8OAMhC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import { rgba as polishedRgba } from 'polished';
|
|
3
|
+
import { calculateFontSize, CardContent, DateTimeDisplay, defaultThemeProp, Popover, StyledIcon, tryCatch, useDirection } from '@pega/cosmos-react-core';
|
|
3
4
|
export const StyledStages = styled.div(props => {
|
|
4
5
|
return css `
|
|
5
6
|
background-color: ${props.theme.base.palette['primary-background']};
|
|
@@ -20,195 +21,189 @@ export const StyledInnerStage = styled.span(props => {
|
|
|
20
21
|
`}
|
|
21
22
|
`;
|
|
22
23
|
});
|
|
23
|
-
export const StyledStage = styled.button(({ theme: { base: { spacing, palette, 'hit-area': hitArea,
|
|
24
|
-
const activeColor = palette.interactive;
|
|
25
|
-
const baseBorderColor = palette['border-line'];
|
|
24
|
+
export const StyledStage = styled.button(({ theme: { base: { spacing, palette, 'hit-area': hitArea, transparency, 'border-radius': borderRadius } } }) => {
|
|
26
25
|
const thinBorderWidth = '0.0625rem';
|
|
27
26
|
const thickBorderWidth = '0.125rem';
|
|
28
|
-
const
|
|
29
|
-
const
|
|
27
|
+
const { rtl } = useDirection();
|
|
28
|
+
const borderShadow = tryCatch(() => polishedRgba(palette['border-line'], 1));
|
|
30
29
|
return css `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@media (pointer: coarse) {
|
|
45
|
-
height: ${hitArea['finger-min']};
|
|
46
|
-
padding-inline-start: calc(2.25 * ${spacing});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
${StyledIcon} {
|
|
50
|
-
margin-inline-end: 0.25rem;
|
|
51
|
-
color: ${palette.success};
|
|
30
|
+
/* stylelint-disable no-descending-specificity */
|
|
31
|
+
background-color: inherit;
|
|
32
|
+
color: ${palette['foreground-color']};
|
|
33
|
+
outline: none;
|
|
34
|
+
border-color: transparent;
|
|
35
|
+
border-width: ${thinBorderWidth} 0;
|
|
36
|
+
border-style: solid;
|
|
37
|
+
position: relative;
|
|
38
|
+
height: calc(4 * ${spacing});
|
|
39
|
+
min-width: calc(5.25 * ${spacing});
|
|
40
|
+
padding-inline-start: calc(2 * ${spacing});
|
|
41
|
+
padding-inline-end: ${spacing};
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
@media (pointer: coarse) {
|
|
44
|
+
height: ${hitArea['finger-min']};
|
|
45
|
+
padding-inline-start: calc(2.25 * ${spacing});
|
|
55
46
|
}
|
|
56
|
-
}
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&:first-child {
|
|
63
|
-
border-top-${start}-radius: ${borderRadius};
|
|
64
|
-
border-bottom-${start}-radius: ${borderRadius};
|
|
65
|
-
border-inline-start-width: ${thinBorderWidth};
|
|
66
|
-
padding-inline-start: calc(${spacing});
|
|
67
|
-
}
|
|
48
|
+
${StyledIcon} {
|
|
49
|
+
color: ${palette.success};
|
|
68
50
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
padding-inline-end: calc(${spacing});
|
|
74
|
-
min-width: calc(6.25 * ${spacing});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&:not(:first-child)::before {
|
|
78
|
-
content: '';
|
|
79
|
-
position: absolute;
|
|
80
|
-
display: block;
|
|
81
|
-
width: calc(2.25 * ${spacing});
|
|
82
|
-
height: calc(2.25 * ${spacing});
|
|
83
|
-
left: calc(-1.125 * ${spacing});
|
|
84
|
-
right: calc(-1.125 * ${spacing});
|
|
85
|
-
background-color: transparent;
|
|
86
|
-
border-style: solid;
|
|
87
|
-
border-color: ${baseBorderColor};
|
|
88
|
-
border-inline-end-width: ${thinBorderWidth};
|
|
89
|
-
border-inline-start-width: 0;
|
|
90
|
-
border-top-width: ${rtl ? 0 : thinBorderWidth};
|
|
91
|
-
border-bottom-width: ${rtl ? thinBorderWidth : 0};
|
|
92
|
-
transform: rotateZ(45deg) skew(15deg, 15deg);
|
|
51
|
+
& ~ ${StyledInnerStage} {
|
|
52
|
+
margin-inline-start: 0.25rem;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
93
55
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
height: calc(2.875 * ${spacing});
|
|
97
|
-
left: calc(-1.375 * ${spacing});
|
|
98
|
-
right: calc(-1.375 * ${spacing});
|
|
99
|
-
transform: rotateZ(45deg) skew(20deg, 20deg);
|
|
56
|
+
${StyledInnerStage} {
|
|
57
|
+
opacity: ${transparency['transparent-2']};
|
|
100
58
|
}
|
|
101
|
-
}
|
|
102
59
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
60
|
+
&:first-of-type {
|
|
61
|
+
border-start-start-radius: ${borderRadius};
|
|
62
|
+
border-end-start-radius: ${borderRadius};
|
|
63
|
+
border-inline-start-width: ${thinBorderWidth};
|
|
64
|
+
padding-inline-start: ${spacing};
|
|
107
65
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
66
|
+
&:active {
|
|
67
|
+
padding-inline-start: ${spacing};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:focus {
|
|
71
|
+
border-inline-start-width: ${thickBorderWidth};
|
|
72
|
+
padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});
|
|
73
|
+
}
|
|
111
74
|
}
|
|
112
|
-
}
|
|
113
75
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
border-color: ${activeColor};
|
|
121
|
-
}
|
|
76
|
+
&:last-of-type {
|
|
77
|
+
border-start-end-radius: ${borderRadius};
|
|
78
|
+
border-end-end-radius: ${borderRadius};
|
|
79
|
+
border-inline-end-width: ${thinBorderWidth};
|
|
80
|
+
padding-inline-end: ${spacing};
|
|
81
|
+
min-width: calc(6.25 * ${spacing});
|
|
122
82
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
83
|
+
&:active {
|
|
84
|
+
border-inline-end-width: ${thinBorderWidth};
|
|
85
|
+
padding-inline-end: ${spacing};
|
|
86
|
+
}
|
|
126
87
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
88
|
+
&:focus {
|
|
89
|
+
border-inline-end-width: ${thickBorderWidth};
|
|
90
|
+
padding-inline-end: calc(${spacing} - ${thinBorderWidth});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
133
93
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
94
|
+
&:not(:first-of-type)::before,
|
|
95
|
+
&:not(:last-of-type)::after {
|
|
96
|
+
content: '';
|
|
97
|
+
position: absolute;
|
|
98
|
+
display: block;
|
|
99
|
+
width: calc(2.25 * ${spacing});
|
|
100
|
+
height: calc(2.25 * ${spacing});
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
border-style: solid;
|
|
103
|
+
border-color: ${palette['border-line']};
|
|
104
|
+
border-inline-end-width: ${thinBorderWidth};
|
|
105
|
+
border-inline-start-width: 0;
|
|
106
|
+
border-top-width: ${rtl ? 0 : thinBorderWidth};
|
|
107
|
+
border-bottom-width: ${rtl ? thinBorderWidth : 0};
|
|
108
|
+
transform: rotateZ(45deg) skew(15deg, 15deg);
|
|
138
109
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
110
|
+
@media (pointer: coarse) {
|
|
111
|
+
width: calc(2.875 * ${spacing});
|
|
112
|
+
height: calc(2.875 * ${spacing});
|
|
113
|
+
transform: rotateZ(45deg) skew(20deg, 20deg);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
143
116
|
|
|
144
|
-
|
|
145
|
-
|
|
117
|
+
&:not(:first-of-type)::before {
|
|
118
|
+
inset-inline-start: calc(-1.125 * ${spacing});
|
|
146
119
|
|
|
147
|
-
|
|
148
|
-
|
|
120
|
+
@media (pointer: coarse) {
|
|
121
|
+
inset-inline-start: calc(-1.375 * ${spacing});
|
|
122
|
+
}
|
|
149
123
|
}
|
|
150
|
-
}
|
|
151
124
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
border-top-width: ${rtl ? 0 : thinBorderWidth};
|
|
156
|
-
border-bottom-width: ${rtl ? thinBorderWidth : 0};
|
|
157
|
-
}
|
|
125
|
+
&:not(:last-of-type)::after {
|
|
126
|
+
inset-inline-end: calc(-1.125 * ${spacing});
|
|
127
|
+
z-index: 1;
|
|
158
128
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
129
|
+
@media (pointer: coarse) {
|
|
130
|
+
inset-inline-end: calc(-1.375 * ${spacing});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
163
133
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
134
|
+
&:hover,
|
|
135
|
+
&:hover::before,
|
|
136
|
+
&:hover::after {
|
|
137
|
+
border-color: ${palette['border-line']};
|
|
138
|
+
}
|
|
168
139
|
|
|
169
|
-
|
|
170
|
-
|
|
140
|
+
&:focus,
|
|
141
|
+
&:active,
|
|
142
|
+
&:focus::before,
|
|
143
|
+
&:active::before,
|
|
144
|
+
&:focus::after,
|
|
145
|
+
&:active::after {
|
|
146
|
+
border-color: ${palette.interactive};
|
|
147
|
+
}
|
|
171
148
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
opacity: 1;
|
|
149
|
+
&:focus {
|
|
150
|
+
border-width: ${thickBorderWidth} 0;
|
|
175
151
|
}
|
|
176
152
|
|
|
177
|
-
&:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
153
|
+
&:focus::before,
|
|
154
|
+
&:focus::after {
|
|
155
|
+
z-index: 1;
|
|
156
|
+
border-inline-end-width: ${thickBorderWidth};
|
|
157
|
+
border-top-width: ${rtl ? 0 : thickBorderWidth};
|
|
158
|
+
border-bottom-width: ${rtl ? thickBorderWidth : 0};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:focus::before {
|
|
162
|
+
pointer-events: none;
|
|
181
163
|
}
|
|
164
|
+
|
|
182
165
|
&:active {
|
|
166
|
+
border-width: ${thinBorderWidth} 0;
|
|
167
|
+
|
|
183
168
|
${StyledInnerStage} {
|
|
184
169
|
opacity: ${transparency['transparent-3']};
|
|
185
170
|
}
|
|
186
171
|
}
|
|
187
|
-
}
|
|
188
172
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
173
|
+
&:active::before,
|
|
174
|
+
&:active::after {
|
|
175
|
+
border-inline-end-width: ${thinBorderWidth};
|
|
176
|
+
border-top-width: ${rtl ? 0 : thinBorderWidth};
|
|
177
|
+
border-bottom-width: ${rtl ? thinBorderWidth : 0};
|
|
178
|
+
}
|
|
192
179
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
180
|
+
&[aria-current] {
|
|
181
|
+
${StyledInnerStage} {
|
|
182
|
+
font-weight: bold;
|
|
183
|
+
opacity: 1;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:hover {
|
|
187
|
+
${StyledInnerStage} {
|
|
188
|
+
opacity: ${transparency['transparent-2']};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&[aria-current]::after {
|
|
194
|
+
filter: drop-shadow(0.0625rem -0.0625rem 0.125rem ${borderShadow});
|
|
195
|
+
}
|
|
196
|
+
`;
|
|
197
197
|
});
|
|
198
198
|
StyledStage.defaultProps = defaultThemeProp;
|
|
199
|
-
export const StyledStagePopover = styled
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
white-space: pre-line;
|
|
203
|
-
width: 18rem;
|
|
204
|
-
`;
|
|
205
|
-
});
|
|
199
|
+
export const StyledStagePopover = styled(Popover) `
|
|
200
|
+
width: 36ch;
|
|
201
|
+
`;
|
|
206
202
|
StyledStagePopover.defaultProps = defaultThemeProp;
|
|
207
203
|
export const StyledStepsContainer = styled.ol(({ theme }) => {
|
|
208
204
|
return css `
|
|
209
205
|
list-style-type: none;
|
|
210
|
-
margin
|
|
211
|
-
margin-bottom: calc(2.5 * ${theme.base.spacing});
|
|
206
|
+
margin: calc(1.5 * ${theme.base.spacing}) 0;
|
|
212
207
|
|
|
213
208
|
&:empty {
|
|
214
209
|
margin-bottom: 0;
|
|
@@ -216,11 +211,9 @@ export const StyledStepsContainer = styled.ol(({ theme }) => {
|
|
|
216
211
|
`;
|
|
217
212
|
});
|
|
218
213
|
StyledStepsContainer.defaultProps = defaultThemeProp;
|
|
219
|
-
export const StyledStep = styled.li(({
|
|
220
|
-
const iconColor =
|
|
221
|
-
const
|
|
222
|
-
const iconMargin = complete ? 0 : '0.3rem';
|
|
223
|
-
const textOpacity = complete ? theme.base.transparency['transparent-3'] : 1;
|
|
214
|
+
export const StyledStep = styled.li(({ completed, theme }) => {
|
|
215
|
+
const iconColor = encodeURIComponent(completed ? theme.base.palette.success : theme.base.palette['foreground-color']);
|
|
216
|
+
const textOpacity = completed ? theme.base.transparency['transparent-2'] : 1;
|
|
224
217
|
return css `
|
|
225
218
|
border-radius: 0;
|
|
226
219
|
margin-bottom: calc(${theme.base.spacing});
|
|
@@ -230,46 +223,36 @@ export const StyledStep = styled.li(({ complete, theme }) => {
|
|
|
230
223
|
margin-bottom: 0;
|
|
231
224
|
}
|
|
232
225
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
226
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
227
|
+
&::before {
|
|
228
|
+
content: '\u00b7';
|
|
229
|
+
font-weight: 800;
|
|
230
|
+
width: 1rem;
|
|
231
|
+
text-align: center;
|
|
232
|
+
flex-shrink: 0;
|
|
238
233
|
}
|
|
239
234
|
|
|
240
|
-
${
|
|
235
|
+
${completed &&
|
|
236
|
+
css `
|
|
237
|
+
&::before {
|
|
238
|
+
/* cSpell:disable-next-line */
|
|
239
|
+
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25' fill='${iconColor}'%3E%3Cpath d='M3.5328125,10.8960938 C3.5328125,10.8960938 10.0460938,17.3617188 10.0460938,17.3617188 C10.0460938,17.3617188 22.4984375,4 22.4984375,4 C22.4984375,4 23.9828125,5.484375 23.9828125,5.484375 C23.9828125,5.484375 10.09375,20.2351562 10.09375,20.2351562 C10.09375,20.2351562 2,12.3804687 2,12.3804687 C2,12.3804687 3.5328125,10.8960937 3.5328125,10.8960937 L3.5328125,10.8960938 Z'/%3E%3C/svg%3E");
|
|
240
|
+
margin-block-start: calc(0.25 * ${theme.base.spacing});
|
|
241
|
+
}
|
|
242
|
+
`}
|
|
243
|
+
/* stylelint-enable no-duplicate-selectors */
|
|
244
|
+
|
|
245
|
+
div {
|
|
241
246
|
opacity: ${textOpacity};
|
|
242
247
|
}
|
|
243
248
|
`;
|
|
244
249
|
});
|
|
245
250
|
StyledStep.defaultProps = defaultThemeProp;
|
|
246
|
-
export const
|
|
247
|
-
|
|
248
|
-
position: relative;
|
|
251
|
+
export const StyledPopoverContent = styled(CardContent) `
|
|
252
|
+
min-height: 6rem;
|
|
249
253
|
`;
|
|
250
|
-
|
|
251
|
-
export const
|
|
252
|
-
const textOpacity = complete ? theme.base.transparency['transparent-2'] : 1;
|
|
253
|
-
return css `
|
|
254
|
-
display: flex;
|
|
255
|
-
width: 100%;
|
|
256
|
-
text-align: start;
|
|
257
|
-
overflow: hidden;
|
|
258
|
-
white-space: nowrap;
|
|
259
|
-
text-overflow: ellipsis;
|
|
260
|
-
|
|
261
|
-
${StyledIcon} {
|
|
262
|
-
color: ${theme.base.palette.success};
|
|
263
|
-
margin-inline-end: ${theme.base.spacing};
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
${StyledText} {
|
|
267
|
-
opacity: ${textOpacity};
|
|
268
|
-
}
|
|
269
|
-
`;
|
|
270
|
-
});
|
|
271
|
-
StyledInnerStep.defaultProps = defaultThemeProp;
|
|
272
|
-
export const StyledDateTimeDisplay = styled.span(({ theme }) => {
|
|
254
|
+
StyledPopoverContent.defaultProps = defaultThemeProp;
|
|
255
|
+
export const StyledDateTimeDisplay = styled(DateTimeDisplay)(({ theme }) => {
|
|
273
256
|
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
274
257
|
return css `
|
|
275
258
|
font-size: ${fontSize.xs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC7C,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBACjD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAEnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,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GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;sBACf,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU;;CAEpE,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAwB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACxF,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,GAAG,CAAA;;;;;;;;MAQN,UAAU;eACD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;2BACd,KAAK,CAAC,IAAI,CAAC,OAAO;;;MAGvC,UAAU;iBACC,WAAW;;GAEzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACtF,OAAO,GAAG,CAAA;iBACK,QAAQ,CAAC,EAAE;eACb,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledIcon,\n StyledText,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.div(props => {\n return css`\n background-color: ${props.theme.base.palette['primary-background']};\n border-radius: ${props.theme.base['border-radius']};\n width: 100%;\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button(\n ({\n theme: {\n base: {\n spacing,\n palette,\n 'hit-area': hitArea,\n shadow,\n transparency,\n 'border-radius': borderRadius\n }\n }\n }) => {\n const activeColor = palette.interactive;\n const baseBorderColor = palette['border-line'];\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const baseTransparency = transparency['transparent-2'];\n const { rtl, start, end } = useDirection();\n\n return css`\n /* stylelint-disable no-descending-specificity */\n background-color: inherit;\n color: ${palette['foreground-color']};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n min-width: calc(5.25 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n\n @media (pointer: coarse) {\n height: ${hitArea['finger-min']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n margin-inline-end: 0.25rem;\n color: ${palette.success};\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n\n &:first-child {\n border-top-${start}-radius: ${borderRadius};\n border-bottom-${start}-radius: ${borderRadius};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child {\n border-top-${end}-radius: ${borderRadius};\n border-bottom-${end}-radius: ${borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n min-width: calc(6.25 * ${spacing});\n }\n\n &:not(:first-child)::before {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n left: calc(-1.125 * ${spacing});\n right: calc(-1.125 * ${spacing});\n background-color: transparent;\n border-style: solid;\n border-color: ${baseBorderColor};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n left: calc(-1.375 * ${spacing});\n right: calc(-1.375 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n &:hover,\n &:hover::before {\n border-color: ${baseBorderColor};\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: 1;\n }\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus + &::before,\n &:active + &::before {\n border-color: ${activeColor};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus + &::before {\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${rtl ? 0 : thickBorderWidth};\n border-bottom-width: ${rtl ? thickBorderWidth : 0};\n }\n\n &:first-child:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n\n &:last-child:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active + &::before {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n }\n\n &:first-child:active {\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n }\n\n &[aria-current] {\n z-index: 2;\n\n ${StyledInnerStage} {\n font-weight: bold;\n opacity: 1;\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n }\n &:active {\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n }\n\n &[aria-current] + &::before {\n box-shadow: ${shadow.low};\n }\n\n &[aria-current] + &:focus::before {\n box-shadow: none;\n }\n `;\n }\n);\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStagePopover = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n white-space: pre-line;\n width: 18rem;\n `;\n});\n\nStyledStagePopover.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin-top: calc(1.5 * ${theme.base.spacing});\n margin-bottom: calc(2.5 * ${theme.base.spacing});\n\n &:empty {\n margin-bottom: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ complete: boolean }>(({ complete, theme }) => {\n const iconColor = complete ? theme.base.palette.success : theme.base.palette['foreground-color'];\n const iconWidth = complete ? '1.125rem' : '0.3rem';\n const iconMargin = complete ? 0 : '0.3rem';\n const textOpacity = complete ? theme.base.transparency['transparent-3'] : 1;\n\n return css`\n border-radius: 0;\n margin-bottom: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${StyledIcon} {\n margin-inline-end: calc(${theme.base.spacing});\n color: ${iconColor};\n width: ${iconWidth};\n margin-inline-start: ${iconMargin};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledSteps = styled.div`\n background-color: ${props => props.theme.components.card.background};\n position: relative;\n`;\n\nStyledSteps.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStep = styled.span<{ complete: boolean }>(({ complete, theme }) => {\n const textOpacity = complete ? theme.base.transparency['transparent-2'] : 1;\n return css`\n display: flex;\n width: 100%;\n text-align: start;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n ${StyledIcon} {\n color: ${theme.base.palette.success};\n margin-inline-end: ${theme.base.spacing};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledInnerStep.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,QAAQ,EACR,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC7C,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBACjD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAEnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,I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AAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba as polishedRgba } from 'polished';\n\nimport {\n calculateFontSize,\n CardContent,\n DateTimeDisplay,\n defaultThemeProp,\n Popover,\n StyledIcon,\n tryCatch,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.div(props => {\n return css`\n background-color: ${props.theme.base.palette['primary-background']};\n border-radius: ${props.theme.base['border-radius']};\n width: 100%;\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button(\n ({\n theme: {\n base: { spacing, palette, 'hit-area': hitArea, transparency, 'border-radius': borderRadius }\n }\n }) => {\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const { rtl } = useDirection();\n const borderShadow = tryCatch(() => polishedRgba(palette['border-line'], 1));\n\n return css`\n /* stylelint-disable no-descending-specificity */\n background-color: inherit;\n color: ${palette['foreground-color']};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n min-width: calc(5.25 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n\n @media (pointer: coarse) {\n height: ${hitArea['finger-min']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n color: ${palette.success};\n\n & ~ ${StyledInnerStage} {\n margin-inline-start: 0.25rem;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-2']};\n }\n\n &:first-of-type {\n border-start-start-radius: ${borderRadius};\n border-end-start-radius: ${borderRadius};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: ${spacing};\n\n &:active {\n padding-inline-start: ${spacing};\n }\n\n &:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n }\n\n &:last-of-type {\n border-start-end-radius: ${borderRadius};\n border-end-end-radius: ${borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: ${spacing};\n min-width: calc(6.25 * ${spacing});\n\n &:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: ${spacing};\n }\n\n &:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n }\n\n &:not(:first-of-type)::before,\n &:not(:last-of-type)::after {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n background-color: transparent;\n border-style: solid;\n border-color: ${palette['border-line']};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n &:not(:first-of-type)::before {\n inset-inline-start: calc(-1.125 * ${spacing});\n\n @media (pointer: coarse) {\n inset-inline-start: calc(-1.375 * ${spacing});\n }\n }\n\n &:not(:last-of-type)::after {\n inset-inline-end: calc(-1.125 * ${spacing});\n z-index: 1;\n\n @media (pointer: coarse) {\n inset-inline-end: calc(-1.375 * ${spacing});\n }\n }\n\n &:hover,\n &:hover::before,\n &:hover::after {\n border-color: ${palette['border-line']};\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus::after,\n &:active::after {\n border-color: ${palette.interactive};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus::after {\n z-index: 1;\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${rtl ? 0 : thickBorderWidth};\n border-bottom-width: ${rtl ? thickBorderWidth : 0};\n }\n\n &:focus::before {\n pointer-events: none;\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active::after {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n }\n\n &[aria-current] {\n ${StyledInnerStage} {\n font-weight: bold;\n opacity: 1;\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-2']};\n }\n }\n }\n\n &[aria-current]::after {\n filter: drop-shadow(0.0625rem -0.0625rem 0.125rem ${borderShadow});\n }\n `;\n }\n);\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStagePopover = styled(Popover)`\n width: 36ch;\n`;\n\nStyledStagePopover.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin: calc(1.5 * ${theme.base.spacing}) 0;\n\n &:empty {\n margin-bottom: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ completed: boolean }>(({ completed, theme }) => {\n const iconColor = encodeURIComponent(\n completed ? theme.base.palette.success : theme.base.palette['foreground-color']\n );\n const textOpacity = completed ? theme.base.transparency['transparent-2'] : 1;\n\n return css`\n border-radius: 0;\n margin-bottom: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n /* stylelint-disable no-duplicate-selectors */\n &::before {\n content: '\\u00b7';\n font-weight: 800;\n width: 1rem;\n text-align: center;\n flex-shrink: 0;\n }\n\n ${completed &&\n css`\n &::before {\n /* cSpell:disable-next-line */\n content: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25' fill='${iconColor}'%3E%3Cpath d='M3.5328125,10.8960938 C3.5328125,10.8960938 10.0460938,17.3617188 10.0460938,17.3617188 C10.0460938,17.3617188 22.4984375,4 22.4984375,4 C22.4984375,4 23.9828125,5.484375 23.9828125,5.484375 C23.9828125,5.484375 10.09375,20.2351562 10.09375,20.2351562 C10.09375,20.2351562 2,12.3804687 2,12.3804687 C2,12.3804687 3.5328125,10.8960937 3.5328125,10.8960937 L3.5328125,10.8960938 Z'/%3E%3C/svg%3E\");\n margin-block-start: calc(0.25 * ${theme.base.spacing});\n }\n `}\n /* stylelint-enable no-duplicate-selectors */\n\n div {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledPopoverContent = styled(CardContent)`\n min-height: 6rem;\n`;\n\nStyledPopoverContent.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled(DateTimeDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
2
|
import { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
3
|
export interface StepProps {
|
|
4
|
+
/** Step name - either text or link. */
|
|
4
5
|
name: ReactNode;
|
|
5
|
-
|
|
6
|
+
/** Flag determining whether step has been completed. */
|
|
7
|
+
completed: boolean;
|
|
8
|
+
/** Unique step identifier. */
|
|
6
9
|
id: string;
|
|
7
10
|
}
|
|
8
11
|
export interface StageProps {
|
|
12
|
+
/** Stage name. */
|
|
9
13
|
name: string;
|
|
14
|
+
/** Unique identifier. */
|
|
10
15
|
id: string;
|
|
16
|
+
/** Date of completion. Accepts date object, ISO string or timestamp. */
|
|
11
17
|
date?: Date | string | number;
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
/** Flag determining whether the stage is completed. */
|
|
19
|
+
completed: boolean;
|
|
20
|
+
/** Steps data defined in this stage. The stage is treated as not loaded if undefined. */
|
|
14
21
|
steps?: StepProps[];
|
|
15
22
|
}
|
|
16
23
|
export interface StagesProps extends BaseProps, NoChildrenProp {
|
|
@@ -18,6 +25,14 @@ export interface StagesProps extends BaseProps, NoChildrenProp {
|
|
|
18
25
|
stages: StageProps[];
|
|
19
26
|
/** Current stage id. */
|
|
20
27
|
current: string;
|
|
28
|
+
/** Case title (label) */
|
|
21
29
|
caseTitle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Callback invoked when stage details are requested to show.
|
|
32
|
+
* @param stages stages' ids requested to load details for.
|
|
33
|
+
*/
|
|
34
|
+
onLoadStage?: (stages: StageProps['id'][]) => void;
|
|
35
|
+
/** Ref to the stages container. */
|
|
36
|
+
ref?: Ref<HTMLDivElement>;
|
|
22
37
|
}
|
|
23
38
|
//# sourceMappingURL=Stages.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.types.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Stages.types.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,uDAAuD;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D,6DAA6D;IAC7D,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;IACnD,mCAAmC;IACnC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.types.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode } from 'react';\n\nimport { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface StepProps {\n name: ReactNode;\n
|
|
1
|
+
{"version":3,"file":"Stages.types.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref } from 'react';\n\nimport { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface StepProps {\n /** Step name - either text or link. */\n name: ReactNode;\n /** Flag determining whether step has been completed. */\n completed: boolean;\n /** Unique step identifier. */\n id: string;\n}\n\nexport interface StageProps {\n /** Stage name. */\n name: string;\n /** Unique identifier. */\n id: string;\n /** Date of completion. Accepts date object, ISO string or timestamp. */\n date?: Date | string | number;\n /** Flag determining whether the stage is completed. */\n completed: boolean;\n /** Steps data defined in this stage. The stage is treated as not loaded if undefined. */\n steps?: StepProps[];\n}\n\nexport interface StagesProps extends BaseProps, NoChildrenProp {\n /** List of objects describing each stage and their state. */\n stages: StageProps[];\n /** Current stage id. */\n current: string;\n /** Case title (label) */\n caseTitle?: string;\n /**\n * Callback invoked when stage details are requested to show.\n * @param stages stages' ids requested to load details for.\n */\n onLoadStage?: (stages: StageProps['id'][]) => void;\n /** Ref to the stages container. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-work",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.15.0",
|
|
4
4
|
"author": "Pegasystems",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "3.0.0-dev.
|
|
23
|
+
"@pega/cosmos-react-core": "3.0.0-dev.15.0",
|
|
24
24
|
"@types/react": "^16.14.24 || ^17.0.38",
|
|
25
25
|
"@types/react-dom": "^16.9.14 || ^17.0.11",
|
|
26
26
|
"@types/styled-components": "^5.1.7",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"@storybook/react": "^6.4.19",
|
|
39
39
|
"@storybook/testing-react": "^1.2.4",
|
|
40
40
|
"@storybook/theming": "^6.4.19",
|
|
41
|
+
"@testing-library/jest-dom": "^5.16.2",
|
|
42
|
+
"@testing-library/react": "^12.1.3",
|
|
43
|
+
"@testing-library/user-event": "^13.5.0",
|
|
41
44
|
"enzyme": "^3.11.0",
|
|
42
45
|
"typescript": "~4.6.2"
|
|
43
46
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAcxC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Icon, registerIcon, Text, Grid } from '@pega/cosmos-react-core';
|
|
3
|
-
import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
|
|
4
|
-
import * as circleSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/circle-solid.icon';
|
|
5
|
-
import { StyledStep, StyledStepsContainer } from './Stages.styles';
|
|
6
|
-
registerIcon(checkIcon, circleSolidIcon);
|
|
7
|
-
const Steps = ({ steps }) => {
|
|
8
|
-
return (_jsx(StyledStepsContainer, { children: steps &&
|
|
9
|
-
steps.map(({ id, name, complete }) => (_jsx(StyledStep, { complete: complete, children: _jsxs(Grid, { container: { cols: '1.625rem 1fr' }, children: [_jsx(Icon, { name: complete ? 'check' : 'circle-solid' }), _jsx(Text, { children: name })] }) }, id))) }));
|
|
10
|
-
};
|
|
11
|
-
export default Steps;
|
|
12
|
-
//# sourceMappingURL=Steps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAC1F,OAAO,KAAK,eAAe,MAAM,qEAAqE,CAAC;AAGvG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,YAAY,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;AAMzC,MAAM,KAAK,GAAkC,CAAC,EAAE,KAAK,EAA+B,EAAE,EAAE;IACtF,OAAO,CACL,KAAC,oBAAoB,cAClB,KAAK;YACJ,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpC,KAAC,UAAU,IAAU,QAAQ,EAAE,QAAQ,YACrC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,aACvC,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,GAAI,EACnD,KAAC,IAAI,cAAE,IAAI,GAAQ,IACd,IAJQ,EAAE,CAKN,CACd,CAAC,GACiB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { PropsWithoutRef, FunctionComponent } from 'react';\n\nimport { Icon, registerIcon, Text, Grid } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\nimport * as circleSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/circle-solid.icon';\n\nimport { StepProps } from './Stages.types';\nimport { StyledStep, StyledStepsContainer } from './Stages.styles';\n\nregisterIcon(checkIcon, circleSolidIcon);\n\ninterface StepsProps {\n steps?: StepProps[];\n}\n\nconst Steps: FunctionComponent<StepsProps> = ({ steps }: PropsWithoutRef<StepsProps>) => {\n return (\n <StyledStepsContainer>\n {steps &&\n steps.map(({ id, name, complete }) => (\n <StyledStep key={id} complete={complete}>\n <Grid container={{ cols: '1.625rem 1fr' }}>\n <Icon name={complete ? 'check' : 'circle-solid'} />\n <Text>{name}</Text>\n </Grid>\n </StyledStep>\n ))}\n </StyledStepsContainer>\n );\n};\n\nexport default Steps;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { StagesProps } from './Stages.types';
|
|
3
|
-
export interface StepsContainerProps {
|
|
4
|
-
currentStage: StagesProps['stages'];
|
|
5
|
-
}
|
|
6
|
-
declare const StepsContainer: FunctionComponent<StepsContainerProps>;
|
|
7
|
-
export default StepsContainer;
|
|
8
|
-
//# sourceMappingURL=StepsContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACrC;AAED,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAqB1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex, Icon, registerIcon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';
|
|
3
|
-
import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
|
|
4
|
-
import Steps from './Steps';
|
|
5
|
-
import { StyledDateTimeDisplay, StyledInnerStep, StyledSteps } from './Stages.styles';
|
|
6
|
-
registerIcon(checkIcon);
|
|
7
|
-
const StepsContainer = ({ currentStage }) => {
|
|
8
|
-
return (_jsxs(Flex, { as: StyledSteps, container: { direction: 'column' }, item: { grow: 1 }, children: [_jsxs(StyledInnerStep, { complete: currentStage[0]?.complete, children: [currentStage[0]?.complete && _jsx(Icon, { name: 'check' }), _jsx(Text, { variant: 'h2', children: currentStage[0]?.name })] }), currentStage[0]?.date && (_jsx(DateTimeDisplay, { as: StyledDateTimeDisplay, value: currentStage[0]?.date, variant: 'relative', format: 'short' })), _jsx(Steps, { steps: currentStage[0].steps })] }));
|
|
9
|
-
};
|
|
10
|
-
export default StepsContainer;
|
|
11
|
-
//# sourceMappingURL=StepsContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepsContainer.js","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtF,YAAY,CAAC,SAAS,CAAC,CAAC;AAMxB,MAAM,cAAc,GAA2C,CAAC,EAC9D,YAAY,EACyB,EAAE,EAAE;IACzC,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAC1E,MAAC,eAAe,IAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,aACjD,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,EACnD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,GAAQ,IACjC,EACjB,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CACxB,KAAC,eAAe,IACd,EAAE,EAAE,qBAAqB,EACzB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAC5B,OAAO,EAAC,UAAU,EAClB,MAAM,EAAC,OAAO,GACd,CACH,EAED,KAAC,KAAK,IAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,GAAI,IAClC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { Flex, Icon, registerIcon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport Steps from './Steps';\nimport { StagesProps } from './Stages.types';\nimport { StyledDateTimeDisplay, StyledInnerStep, StyledSteps } from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nexport interface StepsContainerProps {\n currentStage: StagesProps['stages'];\n}\n\nconst StepsContainer: FunctionComponent<StepsContainerProps> = ({\n currentStage\n}: PropsWithoutRef<StepsContainerProps>) => {\n return (\n <Flex as={StyledSteps} container={{ direction: 'column' }} item={{ grow: 1 }}>\n <StyledInnerStep complete={currentStage[0]?.complete}>\n {currentStage[0]?.complete && <Icon name='check' />}\n <Text variant='h2'>{currentStage[0]?.name}</Text>\n </StyledInnerStep>\n {currentStage[0]?.date && (\n <DateTimeDisplay\n as={StyledDateTimeDisplay}\n value={currentStage[0]?.date}\n variant='relative'\n format='short'\n />\n )}\n\n <Steps steps={currentStage[0].steps} />\n </Flex>\n );\n};\n\nexport default StepsContainer;\n"]}
|