@pega/cosmos-react-work 4.0.0-dev.9.0 → 4.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +7 -21
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +3 -2
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/AppAnnouncement/index.d.ts +1 -1
- package/lib/components/AppAnnouncement/index.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/index.js.map +1 -1
- package/lib/components/Article/Article.d.ts +49 -0
- package/lib/components/Article/Article.d.ts.map +1 -0
- package/lib/components/Article/Article.js +73 -0
- package/lib/components/Article/Article.js.map +1 -0
- package/lib/components/Article/ArticleFooter.d.ts +40 -0
- package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
- package/lib/components/Article/ArticleFooter.js +54 -0
- package/lib/components/Article/ArticleFooter.js.map +1 -0
- package/lib/components/Article/ArticleMeta.d.ts +13 -0
- package/lib/components/Article/ArticleMeta.d.ts.map +1 -0
- package/lib/components/Article/ArticleMeta.js +24 -0
- package/lib/components/Article/ArticleMeta.js.map +1 -0
- package/lib/components/Article/index.d.ts +5 -0
- package/lib/components/Article/index.d.ts.map +1 -0
- package/lib/components/Article/index.js +3 -0
- package/lib/components/Article/index.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.d.ts +6 -0
- package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.js +137 -0
- package/lib/components/ArticleList/ArticleList.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts +87 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.js +2 -0
- package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
- package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
- package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleListFilter.js +61 -0
- package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.js +20 -0
- package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.js +56 -0
- package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
- package/lib/components/ArticleList/index.d.ts +6 -0
- package/lib/components/ArticleList/index.d.ts.map +1 -0
- package/lib/components/ArticleList/index.js +4 -0
- package/lib/components/ArticleList/index.js.map +1 -0
- package/lib/components/Assignments/Assignments.d.ts +21 -0
- package/lib/components/Assignments/Assignments.d.ts.map +1 -0
- package/lib/components/Assignments/Assignments.js +20 -0
- package/lib/components/Assignments/Assignments.js.map +1 -0
- package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
- package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
- package/lib/components/Assignments/Assignments.styles.js +41 -0
- package/lib/components/Assignments/Assignments.styles.js.map +1 -0
- package/lib/components/Assignments/index.d.ts +2 -0
- package/lib/components/Assignments/index.d.ts.map +1 -0
- package/lib/components/Assignments/index.js +2 -0
- package/lib/components/Assignments/index.js.map +1 -0
- package/lib/components/CasePreview/CasePreview.d.ts +9 -4
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +7 -10
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
- package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
- package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
- package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
- package/lib/components/CasePreview/index.d.ts +1 -1
- package/lib/components/CasePreview/index.d.ts.map +1 -1
- package/lib/components/CasePreview/index.js.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +119 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
- package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
- package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
- package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
- package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
- package/lib/components/CaseView/CaseSummary.d.ts.map +1 -1
- package/lib/components/CaseView/CaseSummary.js +9 -4
- package/lib/components/CaseView/CaseSummary.js.map +1 -1
- package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/CaseView/CaseSummaryFields.js +12 -3
- package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts +4 -2
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +174 -67
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +45 -22
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +298 -79
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
- package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.test-ids.js +17 -0
- package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
- package/lib/components/CaseView/CaseView.types.d.ts +23 -24
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.types.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +4 -8
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
- package/lib/components/CaseView/index.d.ts +1 -6
- package/lib/components/CaseView/index.d.ts.map +1 -1
- package/lib/components/CaseView/index.js +0 -4
- package/lib/components/CaseView/index.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +1 -3
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -1
- package/lib/components/ConfigurableLayout/index.d.ts +1 -1
- package/lib/components/ConfigurableLayout/index.d.ts.map +1 -1
- package/lib/components/ConfigurableLayout/index.js.map +1 -1
- package/lib/components/Confirmation/Confirmation.d.ts +1 -1
- package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/Confirmation/Confirmation.js +20 -5
- package/lib/components/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/Confirmation/index.d.ts +1 -1
- package/lib/components/Confirmation/index.d.ts.map +1 -1
- package/lib/components/Confirmation/index.js.map +1 -1
- package/lib/components/Details/Details.d.ts +8 -4
- package/lib/components/Details/Details.d.ts.map +1 -1
- package/lib/components/Details/Details.js +33 -21
- package/lib/components/Details/Details.js.map +1 -1
- package/lib/components/Details/Details.styles.d.ts +7 -4
- package/lib/components/Details/Details.styles.d.ts.map +1 -1
- package/lib/components/Details/Details.styles.js +46 -101
- package/lib/components/Details/Details.styles.js.map +1 -1
- package/lib/components/Details/Details.test-ids.d.ts +2 -0
- package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
- package/lib/components/Details/Details.test-ids.js +9 -0
- package/lib/components/Details/Details.test-ids.js.map +1 -0
- package/lib/components/Glimpse/Glimpse.d.ts +10 -10
- package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
- package/lib/components/Glimpse/Glimpse.js +7 -17
- package/lib/components/Glimpse/Glimpse.js.map +1 -1
- package/lib/components/Glimpse/index.d.ts +1 -1
- package/lib/components/Glimpse/index.d.ts.map +1 -1
- package/lib/components/Glimpse/index.js +0 -1
- package/lib/components/Glimpse/index.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js +38 -27
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +3 -2
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +137 -81
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +9 -9
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -1
- package/lib/components/IntelligentGuidance/index.d.ts +1 -1
- package/lib/components/IntelligentGuidance/index.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/index.js.map +1 -1
- package/lib/components/Predictions/Predictions.d.ts +6 -0
- package/lib/components/Predictions/Predictions.d.ts.map +1 -0
- package/lib/components/Predictions/Predictions.js +68 -0
- package/lib/components/Predictions/Predictions.js.map +1 -0
- package/lib/components/Predictions/Predictions.types.d.ts +23 -0
- package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
- package/lib/components/Predictions/Predictions.types.js +2 -0
- package/lib/components/Predictions/Predictions.types.js.map +1 -0
- package/lib/components/Predictions/index.d.ts +3 -0
- package/lib/components/Predictions/index.d.ts.map +1 -0
- package/lib/components/Predictions/index.js +2 -0
- package/lib/components/Predictions/index.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.js +1 -1
- package/lib/components/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.d.ts +5 -5
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
- package/lib/components/SearchResults/index.d.ts +1 -1
- package/lib/components/SearchResults/index.d.ts.map +1 -1
- package/lib/components/SearchResults/index.js.map +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +8 -8
- 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 +0 -2
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/index.d.ts +1 -1
- package/lib/components/Stages/index.d.ts.map +1 -1
- package/lib/components/Stages/index.js.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.js +3 -3
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +5 -13
- package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -1
- package/lib/components/Stakeholders/index.d.ts +1 -1
- package/lib/components/Stakeholders/index.d.ts.map +1 -1
- package/lib/components/Stakeholders/index.js.map +1 -1
- package/lib/components/Tags/Tags.d.ts +1 -1
- package/lib/components/Tags/Tags.d.ts.map +1 -1
- package/lib/components/Tags/Tags.js +5 -21
- package/lib/components/Tags/Tags.js.map +1 -1
- package/lib/components/Tags/index.d.ts +2 -1
- package/lib/components/Tags/index.d.ts.map +1 -1
- package/lib/components/Tags/index.js.map +1 -1
- package/lib/components/Tasks/TaskList.d.ts +18 -7
- package/lib/components/Tasks/TaskList.d.ts.map +1 -1
- package/lib/components/Tasks/TaskList.js +48 -10
- package/lib/components/Tasks/TaskList.js.map +1 -1
- package/lib/components/Tasks/Tasks.d.ts +21 -15
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +9 -9
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
- package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
- package/lib/components/Tasks/Tasks.test-ids.js +5 -0
- package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
- package/lib/components/Tasks/index.d.ts +3 -5
- 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 +15 -13
- package/lib/components/Timeline/Timeline.js.map +1 -1
- package/lib/components/Timeline/Timeline.styles.d.ts +4 -5
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.styles.js +28 -53
- package/lib/components/Timeline/Timeline.styles.js.map +1 -1
- package/lib/components/Timeline/Timeline.types.d.ts +8 -8
- 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.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +19 -7
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/components/Timeline/TimelineToolbar.js +1 -1
- package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
- package/lib/components/Timeline/index.d.ts +1 -1
- package/lib/components/Timeline/index.d.ts.map +1 -1
- package/lib/components/Timeline/index.js.map +1 -1
- package/lib/components/Timeline/utils.d.ts +1 -0
- package/lib/components/Timeline/utils.d.ts.map +1 -1
- package/lib/components/Timeline/utils.js +12 -0
- package/lib/components/Timeline/utils.js.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/package.json +14 -14
- package/lib/components/CaseView/CaseHeader.d.ts.map +0 -1
- package/lib/components/CaseView/CaseHeader.js +0 -49
- package/lib/components/CaseView/CaseHeader.js.map +0 -1
- package/lib/components/CaseView/MobileCaseView.d.ts +0 -13
- package/lib/components/CaseView/MobileCaseView.d.ts.map +0 -1
- package/lib/components/CaseView/MobileCaseView.js +0 -25
- package/lib/components/CaseView/MobileCaseView.js.map +0 -1
- /package/lib/components/CaseView/{CaseHeader.d.ts → CaseHeader/CaseHeader.d.ts} +0 -0
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import { Icon,
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
registerIcon(polarisSolidIcon);
|
|
7
|
-
const IntelligentGuidance = forwardRef(({ items, heading, isCollapsed, onExpandCollapse, ...restProps }, ref) => {
|
|
3
|
+
import { Icon, useI18n, useAfterInitialEffect, Text, Tabs, CardHeader, TabPanel, Flex, Count, Actions } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledIntelligentGuidanceList, StyledIntelligentGuidance, StyledNew, StyledBorderLine } from './IntelligentGuidance.styles';
|
|
5
|
+
const IntelligentGuidance = forwardRef(function IntelligentGuidance({ items, previousItems, heading, isCollapsed, onExpandCollapse, ...restProps }, ref) {
|
|
8
6
|
const t = useI18n();
|
|
9
|
-
const
|
|
10
|
-
const summaryListRef = useRef(null);
|
|
7
|
+
const headerRef = useRef(null);
|
|
11
8
|
const toggleButtonRef = useRef(null);
|
|
12
|
-
const
|
|
9
|
+
const [currentTab, setCurrentTab] = useState('current');
|
|
10
|
+
const listItems = (currentTab === 'current' ? items : previousItems ?? []).map(item => {
|
|
13
11
|
return {
|
|
14
12
|
id: item.id,
|
|
15
13
|
visual: _jsx(Icon, { name: item.icon }),
|
|
16
|
-
primary: item.label,
|
|
17
|
-
secondary: item.type,
|
|
14
|
+
primary: (_jsxs(_Fragment, { children: [item.label, item.new && (_jsxs(_Fragment, { children: [_jsx(StyledNew, { children: t('new') }), _jsx(StyledBorderLine, {})] }))] })),
|
|
15
|
+
secondary: _jsx(Text, { variant: 'secondary', children: item.type }),
|
|
16
|
+
contextualLabel: item.label,
|
|
18
17
|
actions: item.onDismiss
|
|
19
18
|
? [
|
|
20
19
|
{
|
|
21
|
-
text: t('
|
|
20
|
+
text: t('dismiss'),
|
|
22
21
|
id: item.id,
|
|
23
22
|
icon: 'times',
|
|
24
23
|
onClick: (id, e) => {
|
|
@@ -42,10 +41,10 @@ const IntelligentGuidance = forwardRef(({ items, heading, isCollapsed, onExpandC
|
|
|
42
41
|
});
|
|
43
42
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
44
43
|
useLayoutEffect(() => {
|
|
45
|
-
if (
|
|
46
|
-
setHeaderHeight(
|
|
44
|
+
if (headerRef.current) {
|
|
45
|
+
setHeaderHeight(headerRef.current?.offsetHeight || 0);
|
|
47
46
|
}
|
|
48
|
-
}, [
|
|
47
|
+
}, [headerRef.current]);
|
|
49
48
|
// FIXME: This is a hack to get the Tooltip to reset its position when the list is toggled.
|
|
50
49
|
useAfterInitialEffect(() => {
|
|
51
50
|
if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {
|
|
@@ -55,18 +54,30 @@ const IntelligentGuidance = forwardRef(({ items, heading, isCollapsed, onExpandC
|
|
|
55
54
|
}, 1000);
|
|
56
55
|
}
|
|
57
56
|
}, [isCollapsed]);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
const intelligentGuidanceList = (_jsx(StyledIntelligentGuidanceList, { items: listItems, noItemsText: t('no_recommendations') }));
|
|
58
|
+
return (_jsxs(StyledIntelligentGuidance, { ...restProps, ref: ref, role: 'region', "aria-live": 'polite', "aria-relevant": 'all', isCollapsed: isCollapsed, hasItems: !!items.length, style: { '--headerHeight': `${headerHeight}px` }, children: [_jsxs(CardHeader, { ref: headerRef, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Text, { variant: 'h2', children: heading }), _jsx(Count, { children: items.length + (previousItems?.length ?? 0) })] }), _jsx(Actions, { items: [
|
|
59
|
+
{
|
|
60
|
+
text: t(isCollapsed ? 'expand' : 'collapse'),
|
|
61
|
+
id: 'IntelligentGuidanceButton',
|
|
62
|
+
icon: 'caret-down',
|
|
63
|
+
'aria-label': isCollapsed
|
|
64
|
+
? t('expand_noun', [heading])
|
|
65
|
+
: t('collapse_noun', [heading]),
|
|
66
|
+
onClick: onExpandCollapse,
|
|
67
|
+
ref: toggleButtonRef
|
|
68
|
+
}
|
|
69
|
+
] })] }), previousItems ? (_jsxs(_Fragment, { children: [_jsx(Tabs, { tabs: [
|
|
70
|
+
{
|
|
71
|
+
id: 'current',
|
|
72
|
+
name: t('current'),
|
|
73
|
+
count: items.filter(item => item.new).length || undefined
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'previous',
|
|
77
|
+
name: t('previous'),
|
|
78
|
+
count: previousItems.filter(item => item.new).length || undefined
|
|
79
|
+
}
|
|
80
|
+
], currentTabId: currentTab, onTabClick: setCurrentTab }), _jsx(TabPanel, { tabId: currentTab, children: intelligentGuidanceList })] })) : (intelligentGuidanceList)] }));
|
|
70
81
|
});
|
|
71
82
|
export default IntelligentGuidance;
|
|
72
83
|
//# sourceMappingURL=IntelligentGuidance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentGuidance.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IntelligentGuidance.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,eAAe,EACf,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EAEJ,OAAO,EACP,qBAAqB,EACrB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,EACR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,SAAS,EACT,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,MAAM,mBAAmB,GAA+D,UAAU,CAChG,SAAS,mBAAmB,CAC1B,EACE,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,GAAG,SAAS,EAC8B,EAC5C,GAAoC;IAEpC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAExD,MAAM,SAAS,GAAsB,CACnC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,IAAI,EAAE,CACvD,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACX,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,MAAM,EAAE,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;YACjC,OAAO,EAAE,CACP,8BACG,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,GAAG,IAAI,CACX,8BACE,KAAC,SAAS,cAAE,CAAC,CAAC,KAAK,CAAC,GAAa,E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ClB,YAAY,EAAE,WAAW;oCACvB,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,CAAC;oCAC7B,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,CAAC;gCACjC,OAAO,EAAE,gBAAgB;gCACzB,GAAG,EAAE,eAAe;6BACrB;yBACF,GACD,IACS,EACZ,aAAa,CAAC,CAAC,CAAC,CACf,8BACE,KAAC,IAAI,IACH,IAAI,EAAE;4BACJ;gCACE,EAAE,EAAE,SAAS;gCACb,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC;gCAClB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,SAAS;6BAC1D;4BACD;gCACE,EAAE,EAAE,UAAU;gCACd,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC;gCACnB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,SAAS;6BAClE;yBACF,EACD,YAAY,EAAE,UAAU,EACxB,UAAU,EAAE,aAAa,GACzB,EACF,KAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YAAG,uBAAuB,GAAY,IAChE,CACJ,CAAC,CAAC,CAAC,CACF,uBAAuB,CACxB,IACyB,CAC7B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import {\n CSSProperties,\n forwardRef,\n FunctionComponent,\n KeyboardEvent,\n PropsWithoutRef,\n useLayoutEffect,\n useRef,\n useState\n} from 'react';\n\nimport {\n ForwardProps,\n Icon,\n SummaryListItem,\n useI18n,\n useAfterInitialEffect,\n Text,\n Tabs,\n CardHeader,\n TabPanel,\n Flex,\n Count,\n Actions\n} from '@pega/cosmos-react-core';\n\nimport {\n StyledIntelligentGuidanceList,\n StyledIntelligentGuidance,\n StyledNew,\n StyledBorderLine\n} from './IntelligentGuidance.styles';\nimport type IntelligentGuidanceProps from './IntelligentGuidance.types';\n\nconst IntelligentGuidance: FunctionComponent<IntelligentGuidanceProps & ForwardProps> = forwardRef(\n function IntelligentGuidance(\n {\n items,\n previousItems,\n heading,\n isCollapsed,\n onExpandCollapse,\n ...restProps\n }: PropsWithoutRef<IntelligentGuidanceProps>,\n ref: IntelligentGuidanceProps['ref']\n ) {\n const t = useI18n();\n const headerRef = useRef<HTMLDivElement>(null);\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const [currentTab, setCurrentTab] = useState('current');\n\n const listItems: SummaryListItem[] = (\n currentTab === 'current' ? items : previousItems ?? []\n ).map(item => {\n return {\n id: item.id,\n visual: <Icon name={item.icon} />,\n primary: (\n <>\n {item.label}\n {item.new && (\n <>\n <StyledNew>{t('new')}</StyledNew>\n {/* Can remove StyledBorderLine when Firefox supports :has selector. */}\n <StyledBorderLine />\n </>\n )}\n </>\n ),\n secondary: <Text variant='secondary'>{item.type}</Text>,\n contextualLabel: item.label,\n actions: item.onDismiss\n ? [\n {\n text: t('dismiss'),\n id: item.id,\n icon: 'times',\n onClick: (id, e) => {\n e.stopPropagation();\n item.onDismiss?.(id, e);\n }\n }\n ]\n : undefined,\n container: { colGap: 1 },\n role: 'button',\n tabIndex: 0,\n 'aria-label': t('continue_label_a11y', [item.label]),\n onClick: item.onClick,\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n item.onClick(e);\n }\n }\n };\n });\n\n const [headerHeight, setHeaderHeight] = useState(0);\n\n useLayoutEffect(() => {\n if (headerRef.current) {\n setHeaderHeight(headerRef.current?.offsetHeight || 0);\n }\n }, [headerRef.current]);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the list is toggled.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 1000);\n }\n }, [isCollapsed]);\n\n const intelligentGuidanceList = (\n <StyledIntelligentGuidanceList items={listItems} noItemsText={t('no_recommendations')} />\n );\n\n return (\n <StyledIntelligentGuidance\n {...restProps}\n ref={ref}\n role='region'\n aria-live='polite'\n aria-relevant='all'\n isCollapsed={isCollapsed}\n hasItems={!!items.length}\n style={{ '--headerHeight': `${headerHeight}px` } as CSSProperties}\n >\n <CardHeader ref={headerRef}>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Text variant='h2'>{heading}</Text>\n <Count>{items.length + (previousItems?.length ?? 0)}</Count>\n </Flex>\n <Actions\n items={[\n {\n text: t(isCollapsed ? 'expand' : 'collapse'),\n id: 'IntelligentGuidanceButton',\n icon: 'caret-down',\n 'aria-label': isCollapsed\n ? t('expand_noun', [heading])\n : t('collapse_noun', [heading]),\n onClick: onExpandCollapse,\n ref: toggleButtonRef\n }\n ]}\n />\n </CardHeader>\n {previousItems ? (\n <>\n <Tabs\n tabs={[\n {\n id: 'current',\n name: t('current'),\n count: items.filter(item => item.new).length || undefined\n },\n {\n id: 'previous',\n name: t('previous'),\n count: previousItems.filter(item => item.new).length || undefined\n }\n ]}\n currentTabId={currentTab}\n onTabClick={setCurrentTab}\n />\n <TabPanel tabId={currentTab}>{intelligentGuidanceList}</TabPanel>\n </>\n ) : (\n intelligentGuidanceList\n )}\n </StyledIntelligentGuidance>\n );\n }\n);\n\nexport default IntelligentGuidance;\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export declare const StyledNew: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledBorderLine: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
1
3
|
export declare const StyledIntelligentGuidanceList: import("styled-components").StyledComponent<import("react").FC<import("@pega/cosmos-react-core").SummaryListProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
-
export declare const StyledIntelligentGuidanceButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
4
|
export interface StyledIntelligentGuidanceProps {
|
|
4
5
|
isCollapsed: boolean;
|
|
5
6
|
hasItems: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const StyledIntelligentGuidance: import("styled-components").StyledComponent<"
|
|
8
|
+
export declare const StyledIntelligentGuidance: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, Partial<import("@pega/cosmos-react-core").CardProps> & StyledIntelligentGuidanceProps, never>;
|
|
8
9
|
//# sourceMappingURL=IntelligentGuidance.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentGuidance.styles.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntelligentGuidance.styles.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.styles.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,SAAS,mOAmBpB,CAAC;AAIH,eAAO,MAAM,gBAAgB,0GAe3B,CAAC;AAIH,eAAO,MAAM,6BAA6B,2NA6ExC,CAAC;AAIH,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,yBAAyB,gMAyFrC,CAAC"}
|
|
@@ -1,65 +1,93 @@
|
|
|
1
|
-
import styled, { css
|
|
2
|
-
import { lighten } from 'polished';
|
|
3
|
-
import {
|
|
4
|
-
import { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { lighten, readableColor, rgba, transparentize } from 'polished';
|
|
3
|
+
import { defaultThemeProp, StyledButton, StyledCard, StyledFlex, StyledIcon, StyledEmptyState, SummaryList, StyledText, tryCatch, StyledSummaryItem, StyledVisual, readableHue, Text, calculateFontSize, StyledSecondary } from '@pega/cosmos-react-core';
|
|
5
4
|
import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
|
|
6
|
-
import {
|
|
5
|
+
import { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs';
|
|
6
|
+
import { StyledTab } from '@pega/cosmos-react-core/lib/components/Tabs/Tab';
|
|
7
|
+
import { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';
|
|
7
8
|
const itemIconSize = '2rem';
|
|
9
|
+
export const StyledNew = styled(Text)(({ theme }) => {
|
|
10
|
+
const readableBackground = readableHue(theme.base.palette['brand-primary'], theme.base.palette['primary-background']);
|
|
11
|
+
const readableTextColor = readableColor(readableBackground);
|
|
12
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
13
|
+
return css `
|
|
14
|
+
position: absolute;
|
|
15
|
+
inset-block-start: 0;
|
|
16
|
+
inset-inline-start: 0;
|
|
17
|
+
text-transform: uppercase;
|
|
18
|
+
background-color: ${readableBackground};
|
|
19
|
+
color: ${readableTextColor};
|
|
20
|
+
padding-inline: calc(0.75 * ${theme.base.spacing});
|
|
21
|
+
font-size: ${fontSize.xxs};
|
|
22
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
23
|
+
`;
|
|
24
|
+
});
|
|
25
|
+
StyledNew.defaultProps = defaultThemeProp;
|
|
26
|
+
export const StyledBorderLine = styled.span(({ theme }) => {
|
|
27
|
+
const readableBackground = readableHue(theme.base.palette['brand-primary'], theme.base.palette['primary-background']);
|
|
28
|
+
return css `
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset-block-start: 0;
|
|
31
|
+
inset-inline-start: 0;
|
|
32
|
+
content: '';
|
|
33
|
+
background-color: ${readableBackground};
|
|
34
|
+
height: 100%;
|
|
35
|
+
width: 0.125rem;
|
|
36
|
+
`;
|
|
37
|
+
});
|
|
38
|
+
StyledBorderLine.defaultProps = defaultThemeProp;
|
|
8
39
|
export const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) => {
|
|
40
|
+
const color = theme.base.palette.light;
|
|
9
41
|
const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
|
|
10
42
|
const hoverColor = tryCatch(() => lighten(0.05, theme.components['app-shell'].nav['background-color']));
|
|
43
|
+
const secondaryColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-2']));
|
|
44
|
+
const scrollbarColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-3']));
|
|
11
45
|
return css `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@media (min-width: ${theme.base.breakpoints.lg}) {
|
|
18
|
-
min-width: 23rem;
|
|
19
|
-
max-width: 23rem;
|
|
20
|
-
}
|
|
21
|
-
&:not(& &) {
|
|
22
|
-
background-color: ${theme.components['app-shell'].nav['background-color']};
|
|
23
|
-
}
|
|
24
|
-
${StyledCardHeader} {
|
|
25
|
-
&:not(${StyledCard} ${StyledCard} > &) {
|
|
26
|
-
padding: ${theme.base.spacing};
|
|
27
|
-
}
|
|
28
|
-
${StyledFlex} > ${StyledIcon} {
|
|
29
|
-
width: ${itemIconSize};
|
|
30
|
-
height: ${itemIconSize};
|
|
31
|
-
padding: calc(0.75 * ${theme.base.spacing});
|
|
32
|
-
border-radius: calc(3 * ${theme.base['border-radius']});
|
|
33
|
-
background-color: ${theme.base.palette.success};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
${StyledSummaryListContent} {
|
|
37
|
-
&:not(${StyledCard} ${StyledCard} > &) {
|
|
38
|
-
padding: 0;
|
|
39
|
-
}
|
|
46
|
+
max-height: min(calc(100vh - var(--headerHeight) - 4ch), 21ch);
|
|
47
|
+
overflow: auto;
|
|
48
|
+
|
|
49
|
+
::-webkit-scrollbar-thumb {
|
|
50
|
+
box-shadow: inset 0 0 0.125rem 0.25rem ${scrollbarColor};
|
|
40
51
|
}
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
|
|
53
|
+
::-webkit-scrollbar-thumb:hover {
|
|
54
|
+
box-shadow: inset 0 0 0.125rem 0.25rem ${secondaryColor};
|
|
43
55
|
}
|
|
56
|
+
|
|
57
|
+
${theme.base.animation.timing.ease};
|
|
58
|
+
|
|
44
59
|
${StyledSummaryItem} {
|
|
60
|
+
position: relative;
|
|
45
61
|
padding: ${theme.base.spacing};
|
|
46
|
-
border-top: ${theme.components.button['border-width']} solid ${borderColor};
|
|
47
62
|
outline: none;
|
|
63
|
+
|
|
64
|
+
&:not(:first-of-type) {
|
|
65
|
+
border-top: ${theme.components.button['border-width']} solid ${borderColor};
|
|
66
|
+
}
|
|
67
|
+
|
|
48
68
|
${StyledVisual} ${StyledIcon} {
|
|
49
69
|
width: ${itemIconSize};
|
|
50
70
|
height: ${itemIconSize};
|
|
51
71
|
padding: calc(0.75 * ${theme.base.spacing});
|
|
52
72
|
}
|
|
73
|
+
|
|
53
74
|
${StyledButton} {
|
|
54
75
|
visibility: hidden;
|
|
55
76
|
}
|
|
77
|
+
|
|
78
|
+
${StyledSecondary} ${StyledText} {
|
|
79
|
+
color: ${secondaryColor};
|
|
80
|
+
}
|
|
81
|
+
|
|
56
82
|
&:not(:last-child) {
|
|
57
83
|
border-bottom: none;
|
|
58
84
|
}
|
|
85
|
+
|
|
59
86
|
&:hover {
|
|
60
87
|
background-color: ${hoverColor};
|
|
61
88
|
cursor: pointer;
|
|
62
89
|
}
|
|
90
|
+
|
|
63
91
|
&:hover,
|
|
64
92
|
&:focus,
|
|
65
93
|
&:focus-within {
|
|
@@ -72,70 +100,98 @@ export const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) =>
|
|
|
72
100
|
box-shadow: ${theme.base.shadow['focus-inset']};
|
|
73
101
|
}
|
|
74
102
|
}
|
|
103
|
+
|
|
75
104
|
${StyledEmptyState} {
|
|
76
|
-
padding-
|
|
105
|
+
padding-block: ${theme.base.spacing};
|
|
77
106
|
${StyledIcon}, ${StyledText} {
|
|
78
|
-
color: ${
|
|
107
|
+
color: ${color};
|
|
79
108
|
}
|
|
80
109
|
}
|
|
81
110
|
`;
|
|
82
111
|
});
|
|
83
112
|
StyledIntelligentGuidanceList.defaultProps = defaultThemeProp;
|
|
84
|
-
export const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
width: 4rem;
|
|
90
|
-
height: 4rem;
|
|
91
|
-
svg {
|
|
92
|
-
width: 2.25rem;
|
|
93
|
-
height: 2.25rem;
|
|
94
|
-
}
|
|
95
|
-
${StyledCount} {
|
|
96
|
-
position: absolute;
|
|
97
|
-
right: 0;
|
|
98
|
-
top: 0;
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
|
-
});
|
|
102
|
-
StyledIntelligentGuidanceButton.defaultProps = defaultThemeProp;
|
|
103
|
-
const slideIn = keyframes `
|
|
104
|
-
0% {
|
|
105
|
-
transform: translateY(100%);
|
|
106
|
-
}
|
|
107
|
-
100% {
|
|
108
|
-
transform: translateY(0);
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
111
|
-
export const StyledIntelligentGuidance = styled.div(({ theme, isCollapsed }) => {
|
|
113
|
+
export const StyledIntelligentGuidance = styled(StyledCard)(({ theme, isCollapsed }) => {
|
|
114
|
+
const color = theme.base.palette.light;
|
|
115
|
+
const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
|
|
116
|
+
const tabPrimaryColor = theme.base.colors.blue.light;
|
|
117
|
+
const lightenedTabColor = tryCatch(() => transparentize(0.3, tabPrimaryColor)) ?? '';
|
|
112
118
|
return css `
|
|
113
119
|
position: fixed;
|
|
114
120
|
inset-inline-start: calc(2 * ${theme.base.spacing} + var(--appshell-horizontal-offset, 0rem));
|
|
115
121
|
transition: inset-inline-start ${theme.base.animation.speed}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
bottom: 0;
|
|
120
|
-
}
|
|
122
|
+
${theme.base.animation.timing.ease},
|
|
123
|
+
transform calc(4 * ${theme.base.animation.speed}) ${theme.base.animation.timing.ease};
|
|
124
|
+
bottom: 0;
|
|
121
125
|
z-index: ${theme.base['z-index'].popover};
|
|
122
|
-
|
|
126
|
+
min-width: 20rem;
|
|
127
|
+
max-width: 20rem;
|
|
128
|
+
color: ${color};
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
box-shadow: ${theme.base.shadow.low};
|
|
131
|
+
|
|
132
|
+
@media (min-width: ${theme.base.breakpoints.lg}) {
|
|
133
|
+
min-width: 23rem;
|
|
134
|
+
max-width: 23rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
${isCollapsed &&
|
|
138
|
+
css `
|
|
139
|
+
transform: translateY(calc(100% - var(--headerHeight)));
|
|
140
|
+
`}
|
|
141
|
+
|
|
142
|
+
&:not(& &) {
|
|
143
|
+
background-color: ${theme.components['app-shell'].nav['background-color']};
|
|
123
144
|
border-bottom-left-radius: 0;
|
|
124
145
|
border-bottom-right-radius: 0;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
${
|
|
128
|
-
css `
|
|
129
|
-
transform: translateY(calc(100% - var(--headerHeight)));
|
|
130
|
-
`}
|
|
131
|
-
${StyledCardHeader} ${StyledButton} {
|
|
146
|
+
}
|
|
147
|
+
${StyledCardHeader} {
|
|
148
|
+
& ${StyledButton} {
|
|
132
149
|
transition: transform calc(2 * ${theme.base.animation.speed})
|
|
133
150
|
${theme.base.animation.timing.ease};
|
|
134
151
|
transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};
|
|
135
152
|
}
|
|
153
|
+
|
|
154
|
+
&:not(${StyledCard} ${StyledCard} > &) {
|
|
155
|
+
padding: ${theme.base.spacing};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
${StyledFlex} > ${StyledIcon} {
|
|
159
|
+
width: ${itemIconSize};
|
|
160
|
+
height: ${itemIconSize};
|
|
161
|
+
padding: calc(0.75 * ${theme.base.spacing});
|
|
162
|
+
border-radius: calc(3 * ${theme.base['border-radius']});
|
|
163
|
+
background-color: ${theme.base.palette.success};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
${StyledTabs} {
|
|
168
|
+
padding-inline: ${theme.base.spacing};
|
|
169
|
+
border-block: 0.0625rem solid ${borderColor};
|
|
170
|
+
${StyledTab} {
|
|
171
|
+
flex: 1;
|
|
172
|
+
justify-content: center;
|
|
173
|
+
${StyledCount} {
|
|
174
|
+
background-color: ${theme.base.palette.urgent};
|
|
175
|
+
}
|
|
176
|
+
span {
|
|
177
|
+
color: ${color};
|
|
178
|
+
}
|
|
179
|
+
::after {
|
|
180
|
+
background-color: ${lightenedTabColor};
|
|
181
|
+
}
|
|
182
|
+
&[aria-selected='true'] {
|
|
183
|
+
span:not(${StyledCount}) {
|
|
184
|
+
color: ${tabPrimaryColor};
|
|
185
|
+
}
|
|
186
|
+
::after {
|
|
187
|
+
background-color: ${tabPrimaryColor};
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
136
191
|
}
|
|
137
|
-
|
|
138
|
-
|
|
192
|
+
|
|
193
|
+
${StyledButton}:enabled:focus {
|
|
194
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
139
195
|
}
|
|
140
196
|
`;
|
|
141
197
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentGuidance.styles.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,MAAM,EACN,gBAA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,WAAW,EAAE,EAAE,EAAE;IACzB,OAAO,GAAG,CAAA;;qCAEuB,KAAK,CAAC,IAAI,CAAC,OAAO;uCAChB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;UACvD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;gBAC1B,WAAW,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;2BACzC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;;;iBAGnC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO;QACtC,6BAA6B,QAAQ,6BAA6B,IAAI,6BAA6B;;;yCAGlE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;YACvD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;UAClC,WAAW;QACb,GAAG,CAAA;;SAEF;UACC,gBAAgB,IAAI,YAAY;2CACC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;cACvD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;uBACvB,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW;;;QAG5D,+BAA+B;qBAClB,OAAO,aAAa,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;;KAE9D,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, keyframes } from 'styled-components';\nimport { lighten } from 'polished';\n\nimport {\n Button,\n defaultThemeProp,\n StyledButton,\n StyledCard,\n StyledFlex,\n StyledIcon,\n StyledEmptyState,\n SummaryList,\n StyledText,\n tryCatch,\n StyledSummaryItem,\n StyledVisual\n} from '@pega/cosmos-react-core';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledSummaryListContent } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';\n\nconst itemIconSize = '2rem';\n\nexport const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const hoverColor = tryCatch(() =>\n lighten(0.05, theme.components['app-shell'].nav['background-color'])\n );\n return css`\n min-width: 20rem;\n max-width: 20rem;\n color: ${theme.base.palette.light};\n overflow: hidden;\n box-shadow: ${theme.base.shadow.low};\n @media (min-width: ${theme.base.breakpoints.lg}) {\n min-width: 23rem;\n max-width: 23rem;\n }\n &:not(& &) {\n background-color: ${theme.components['app-shell'].nav['background-color']};\n }\n ${StyledCardHeader} {\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing};\n }\n ${StyledFlex} > ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n border-radius: calc(3 * ${theme.base['border-radius']});\n background-color: ${theme.base.palette.success};\n }\n }\n ${StyledSummaryListContent} {\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: 0;\n }\n }\n ${StyledButton}:enabled:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n ${StyledSummaryItem} {\n padding: ${theme.base.spacing};\n border-top: ${theme.components.button['border-width']} solid ${borderColor};\n outline: none;\n ${StyledVisual} ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n }\n ${StyledButton} {\n visibility: hidden;\n }\n &:not(:last-child) {\n border-bottom: none;\n }\n &:hover {\n background-color: ${hoverColor};\n cursor: pointer;\n }\n &:hover,\n &:focus,\n &:focus-within {\n ${StyledButton} {\n visibility: visible;\n }\n }\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n ${StyledEmptyState} {\n padding-bottom: ${theme.base.spacing};\n ${StyledIcon}, ${StyledText} {\n color: ${theme.base.palette.light};\n }\n }\n `;\n});\n\nStyledIntelligentGuidanceList.defaultProps = defaultThemeProp;\n\nexport const StyledIntelligentGuidanceButton = styled(Button)(({ theme }) => {\n return css`\n box-shadow: ${theme.base.shadow.low};\n color: ${theme.base.palette.light};\n background-color: ${theme.base.palette.success};\n width: 4rem;\n height: 4rem;\n svg {\n width: 2.25rem;\n height: 2.25rem;\n }\n ${StyledCount} {\n position: absolute;\n right: 0;\n top: 0;\n }\n `;\n});\n\nStyledIntelligentGuidanceButton.defaultProps = defaultThemeProp;\n\nconst slideIn = keyframes`\n 0% {\n transform: translateY(100%);\n }\n 100% {\n transform: translateY(0);\n }\n`;\n\nexport interface StyledIntelligentGuidanceProps {\n isCollapsed: boolean;\n hasItems: boolean;\n}\n\nexport const StyledIntelligentGuidance = styled.div<StyledIntelligentGuidanceProps>(\n ({ theme, isCollapsed }) => {\n return css`\n position: fixed;\n inset-inline-start: calc(2 * ${theme.base.spacing} + var(--appshell-horizontal-offset, 0rem));\n transition: inset-inline-start ${theme.base.animation.speed}\n ${theme.base.animation.timing.ease};\n bottom: ${isCollapsed ? `calc(2 * ${theme.base.spacing}) ` : 0};\n @media (min-width: ${theme.base.breakpoints.md}) {\n bottom: 0;\n }\n z-index: ${theme.base['z-index'].popover};\n ${StyledIntelligentGuidanceList}:not(${StyledIntelligentGuidanceList} ${StyledIntelligentGuidanceList}) {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n transition: transform calc(4 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n ${isCollapsed &&\n css`\n transform: translateY(calc(100% - var(--headerHeight)));\n `}\n ${StyledCardHeader} ${StyledButton} {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};\n }\n }\n ${StyledIntelligentGuidanceButton} {\n animation: ${slideIn} calc(4 * ${theme.base.animation.speed});\n }\n `;\n }\n);\n\nStyledIntelligentGuidance.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"IntelligentGuidance.styles.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAElF,MAAM,YAAY,GAAG,MAAM,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,MAAM,kBAAkB,GAAG,WAAW,CACpC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EACnC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CACzC,CAAC;IACF,MAAM,iBAAiB,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,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AAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;;;;QAIhD,UAAU;0BACQ,KAAK,CAAC,IAAI,CAAC,OAAO;wCACJ,WAAW;UACzC,SAAS;;;YAGP,WAAW;gCACS,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;;;qBAGpC,KAAK;;;gCAGM,iBAAiB;;;uBAG1B,WAAW;uBACX,eAAe;;;kCAGJ,eAAe;;;;;;QAMzC,YAAY;sBACE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;KAExC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { lighten, readableColor, rgba, transparentize } from 'polished';\n\nimport {\n defaultThemeProp,\n StyledButton,\n StyledCard,\n StyledFlex,\n StyledIcon,\n StyledEmptyState,\n SummaryList,\n StyledText,\n tryCatch,\n StyledSummaryItem,\n StyledVisual,\n readableHue,\n Text,\n calculateFontSize,\n StyledSecondary\n} from '@pega/cosmos-react-core';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs';\nimport { StyledTab } from '@pega/cosmos-react-core/lib/components/Tabs/Tab';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\n\nconst itemIconSize = '2rem';\n\nexport const StyledNew = styled(Text)(({ theme }) => {\n const readableBackground = readableHue(\n theme.base.palette['brand-primary'],\n theme.base.palette['primary-background']\n );\n const readableTextColor = readableColor(readableBackground);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n text-transform: uppercase;\n background-color: ${readableBackground};\n color: ${readableTextColor};\n padding-inline: calc(0.75 * ${theme.base.spacing});\n font-size: ${fontSize.xxs};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledNew.defaultProps = defaultThemeProp;\n\nexport const StyledBorderLine = styled.span(({ theme }) => {\n const readableBackground = readableHue(\n theme.base.palette['brand-primary'],\n theme.base.palette['primary-background']\n );\n\n return css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n content: '';\n background-color: ${readableBackground};\n height: 100%;\n width: 0.125rem;\n `;\n});\n\nStyledBorderLine.defaultProps = defaultThemeProp;\n\nexport const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) => {\n const color = theme.base.palette.light;\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const hoverColor = tryCatch(() =>\n lighten(0.05, theme.components['app-shell'].nav['background-color'])\n );\n const secondaryColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-2']));\n const scrollbarColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-3']));\n\n return css`\n max-height: min(calc(100vh - var(--headerHeight) - 4ch), 21ch);\n overflow: auto;\n\n ::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 0.125rem 0.25rem ${scrollbarColor};\n }\n\n ::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 0.125rem 0.25rem ${secondaryColor};\n }\n\n ${theme.base.animation.timing.ease};\n\n ${StyledSummaryItem} {\n position: relative;\n padding: ${theme.base.spacing};\n outline: none;\n\n &:not(:first-of-type) {\n border-top: ${theme.components.button['border-width']} solid ${borderColor};\n }\n\n ${StyledVisual} ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n }\n\n ${StyledButton} {\n visibility: hidden;\n }\n\n ${StyledSecondary} ${StyledText} {\n color: ${secondaryColor};\n }\n\n &:not(:last-child) {\n border-bottom: none;\n }\n\n &:hover {\n background-color: ${hoverColor};\n cursor: pointer;\n }\n\n &:hover,\n &:focus,\n &:focus-within {\n ${StyledButton} {\n visibility: visible;\n }\n }\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n\n ${StyledEmptyState} {\n padding-block: ${theme.base.spacing};\n ${StyledIcon}, ${StyledText} {\n color: ${color};\n }\n }\n `;\n});\n\nStyledIntelligentGuidanceList.defaultProps = defaultThemeProp;\n\nexport interface StyledIntelligentGuidanceProps {\n isCollapsed: boolean;\n hasItems: boolean;\n}\n\nexport const StyledIntelligentGuidance = styled(StyledCard)<StyledIntelligentGuidanceProps>(\n ({ theme, isCollapsed }) => {\n const color = theme.base.palette.light;\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const tabPrimaryColor = theme.base.colors.blue.light;\n const lightenedTabColor = tryCatch(() => transparentize(0.3, tabPrimaryColor)) ?? '';\n\n return css`\n position: fixed;\n inset-inline-start: calc(2 * ${theme.base.spacing} + var(--appshell-horizontal-offset, 0rem));\n transition: inset-inline-start ${theme.base.animation.speed}\n ${theme.base.animation.timing.ease},\n transform calc(4 * ${theme.base.animation.speed}) ${theme.base.animation.timing.ease};\n bottom: 0;\n z-index: ${theme.base['z-index'].popover};\n min-width: 20rem;\n max-width: 20rem;\n color: ${color};\n overflow: hidden;\n box-shadow: ${theme.base.shadow.low};\n\n @media (min-width: ${theme.base.breakpoints.lg}) {\n min-width: 23rem;\n max-width: 23rem;\n }\n\n ${isCollapsed &&\n css`\n transform: translateY(calc(100% - var(--headerHeight)));\n `}\n\n &:not(& &) {\n background-color: ${theme.components['app-shell'].nav['background-color']};\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n ${StyledCardHeader} {\n & ${StyledButton} {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};\n }\n\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing};\n }\n\n ${StyledFlex} > ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n border-radius: calc(3 * ${theme.base['border-radius']});\n background-color: ${theme.base.palette.success};\n }\n }\n\n ${StyledTabs} {\n padding-inline: ${theme.base.spacing};\n border-block: 0.0625rem solid ${borderColor};\n ${StyledTab} {\n flex: 1;\n justify-content: center;\n ${StyledCount} {\n background-color: ${theme.base.palette.urgent};\n }\n span {\n color: ${color};\n }\n ::after {\n background-color: ${lightenedTabColor};\n }\n &[aria-selected='true'] {\n span:not(${StyledCount}) {\n color: ${tabPrimaryColor};\n }\n ::after {\n background-color: ${tabPrimaryColor};\n }\n }\n }\n }\n\n ${StyledButton}:enabled:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n }\n);\n\nStyledIntelligentGuidance.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -5,24 +5,24 @@ export interface IntelligentGuidanceItemProps {
|
|
|
5
5
|
id: string;
|
|
6
6
|
/** The label text of the item. */
|
|
7
7
|
label: string;
|
|
8
|
-
/**
|
|
9
|
-
* Name of the icon (to be selected from default Pega icon set)
|
|
10
|
-
*/
|
|
8
|
+
/** Name of the icon (to be selected from default Pega icon set) */
|
|
11
9
|
icon: IconProps['name'];
|
|
12
10
|
/** Represents the type of task */
|
|
13
11
|
type: string;
|
|
14
|
-
/**
|
|
15
|
-
* Click handler for the action button.
|
|
16
|
-
*/
|
|
12
|
+
/** Click handler for the action button. */
|
|
17
13
|
onClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Dismiss handler for the action button.
|
|
20
|
-
*/
|
|
14
|
+
/** Dismiss handler for the action button. */
|
|
21
15
|
onDismiss?: (id: IntelligentGuidanceItemProps['id'], e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>) => void;
|
|
16
|
+
/** Flag that indicates if item is new
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
new?: boolean;
|
|
22
20
|
}
|
|
23
21
|
export default interface IntelligentGuidanceProps extends BaseProps, NoChildrenProp {
|
|
24
22
|
/** List of guidance items. */
|
|
25
23
|
items: IntelligentGuidanceItemProps[];
|
|
24
|
+
/** List of guidance previous items. */
|
|
25
|
+
previousItems?: IntelligentGuidanceItemProps[];
|
|
26
26
|
/** Header text. */
|
|
27
27
|
heading: string;
|
|
28
28
|
/** Flag that indicates if intelligent guidance is collapsed */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentGuidance.types.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC3C,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd
|
|
1
|
+
{"version":3,"file":"IntelligentGuidance.types.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC3C,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;IACjD,6CAA6C;IAC7C,SAAS,CAAC,EAAE,CACV,EAAE,EAAE,4BAA4B,CAAC,IAAI,CAAC,EACtC,CAAC,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC,KACpE,IAAI,CAAC;IACV;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,wBAAyB,SAAQ,SAAS,EAAE,cAAc;IACjF,8BAA8B;IAC9B,KAAK,EAAE,4BAA4B,EAAE,CAAC;IACtC,uCAAuC;IACvC,aAAa,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC/C,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentGuidance.types.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, KeyboardEvent, Ref } from 'react';\n\nimport { BaseProps, IconProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface IntelligentGuidanceItemProps {\n /** Unique id for item */\n id: string;\n /** The label text of the item. */\n label: string;\n
|
|
1
|
+
{"version":3,"file":"IntelligentGuidance.types.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, KeyboardEvent, Ref } from 'react';\n\nimport { BaseProps, IconProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface IntelligentGuidanceItemProps {\n /** Unique id for item */\n id: string;\n /** The label text of the item. */\n label: string;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon: IconProps['name'];\n /** Represents the type of task */\n type: string;\n /** Click handler for the action button. */\n onClick: (e: MouseEvent | KeyboardEvent) => void;\n /** Dismiss handler for the action button. */\n onDismiss?: (\n id: IntelligentGuidanceItemProps['id'],\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n /** Flag that indicates if item is new\n * @default false\n */\n new?: boolean;\n}\n\nexport default interface IntelligentGuidanceProps extends BaseProps, NoChildrenProp {\n /** List of guidance items. */\n items: IntelligentGuidanceItemProps[];\n /** List of guidance previous items. */\n previousItems?: IntelligentGuidanceItemProps[];\n /** Header text. */\n heading: string;\n /** Flag that indicates if intelligent guidance is collapsed */\n isCollapsed: boolean;\n /** Callback when expand/collapse button is clicked */\n onExpandCollapse: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,YAAY,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { default } from './IntelligentGuidance';\nexport { default as IntelligentGuidanceProps } from './IntelligentGuidance.types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { default } from './IntelligentGuidance';\nexport type { default as IntelligentGuidanceProps } from './IntelligentGuidance.types';\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import PredictionsProps from './Predictions.types';
|
|
4
|
+
declare const Predictions: FunctionComponent<PredictionsProps & ForwardProps>;
|
|
5
|
+
export default Predictions;
|
|
6
|
+
//# sourceMappingURL=Predictions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Predictions.d.ts","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,YAAY,EAab,MAAM,yBAAyB,CAAC;AAIjC,OAAO,gBAAoC,MAAM,qBAAqB,CAAC;AA6FvE,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAqCnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|