@pega/cosmos-react-cs 2.1.6 → 2.1.7
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/Article/Article.d.ts +32 -0
- package/lib/components/Article/Article.d.ts.map +1 -0
- package/lib/components/Article/Article.js +51 -0
- package/lib/components/Article/Article.js.map +1 -0
- package/lib/components/Article/ArticleFooter.d.ts +19 -0
- package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
- package/lib/components/Article/ArticleFooter.js +40 -0
- package/lib/components/Article/ArticleFooter.js.map +1 -0
- package/lib/components/Article/ArticleSkeleton.d.ts +8 -0
- package/lib/components/Article/ArticleSkeleton.d.ts.map +1 -0
- package/lib/components/Article/ArticleSkeleton.js +15 -0
- package/lib/components/Article/ArticleSkeleton.js.map +1 -0
- package/lib/components/Article/index.d.ts +6 -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 +17 -0
- package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.js +65 -0
- package/lib/components/ArticleList/ArticleList.js.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts +20 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.js +68 -0
- package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts +14 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.js +30 -0
- package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
- package/lib/components/ArticleList/SummarySkeleton.d.ts +7 -0
- package/lib/components/ArticleList/SummarySkeleton.d.ts.map +1 -0
- package/lib/components/ArticleList/SummarySkeleton.js +9 -0
- package/lib/components/ArticleList/SummarySkeleton.js.map +1 -0
- package/lib/components/ArticleList/index.d.ts +7 -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/CSCaseView/CSCaseView.d.ts +9 -0
- package/lib/components/CSCaseView/CSCaseView.d.ts.map +1 -0
- package/lib/components/CSCaseView/CSCaseView.js +16 -0
- package/lib/components/CSCaseView/CSCaseView.js.map +1 -0
- package/lib/components/CSCaseView/index.d.ts +3 -0
- package/lib/components/CSCaseView/index.d.ts.map +1 -0
- package/lib/components/CSCaseView/index.js +2 -0
- package/lib/components/CSCaseView/index.js.map +1 -0
- package/lib/components/CallControlPanel/Call.d.ts +6 -0
- package/lib/components/CallControlPanel/Call.d.ts.map +1 -0
- package/lib/components/CallControlPanel/Call.js +142 -0
- package/lib/components/CallControlPanel/Call.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.d.ts +6 -0
- package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.js +68 -0
- package/lib/components/CallControlPanel/CallControlPanel.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts +15 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.js +118 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +112 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.js +2 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts +19 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.js +74 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.js.map +1 -0
- package/lib/components/CallControlPanel/CallTransfer.d.ts +19 -0
- package/lib/components/CallControlPanel/CallTransfer.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallTransfer.js +121 -0
- package/lib/components/CallControlPanel/CallTransfer.js.map +1 -0
- package/lib/components/CallControlPanel/CalleePicker.d.ts +20 -0
- package/lib/components/CallControlPanel/CalleePicker.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CalleePicker.js +61 -0
- package/lib/components/CallControlPanel/CalleePicker.js.map +1 -0
- package/lib/components/CallControlPanel/ContactsList.d.ts +23 -0
- package/lib/components/CallControlPanel/ContactsList.d.ts.map +1 -0
- package/lib/components/CallControlPanel/ContactsList.js +88 -0
- package/lib/components/CallControlPanel/ContactsList.js.map +1 -0
- package/lib/components/CallControlPanel/DTMFKeypad.d.ts +11 -0
- package/lib/components/CallControlPanel/DTMFKeypad.d.ts.map +1 -0
- package/lib/components/CallControlPanel/DTMFKeypad.js +23 -0
- package/lib/components/CallControlPanel/DTMFKeypad.js.map +1 -0
- package/lib/components/CallControlPanel/StopWatch.d.ts +9 -0
- package/lib/components/CallControlPanel/StopWatch.d.ts.map +1 -0
- package/lib/components/CallControlPanel/StopWatch.js +28 -0
- package/lib/components/CallControlPanel/StopWatch.js.map +1 -0
- package/lib/components/CallControlPanel/index.d.ts +5 -0
- package/lib/components/CallControlPanel/index.d.ts.map +1 -0
- package/lib/components/CallControlPanel/index.js +4 -0
- package/lib/components/CallControlPanel/index.js.map +1 -0
- package/lib/components/CallControlPanel/utils.d.ts +7 -0
- package/lib/components/CallControlPanel/utils.d.ts.map +1 -0
- package/lib/components/CallControlPanel/utils.js +35 -0
- package/lib/components/CallControlPanel/utils.js.map +1 -0
- package/lib/components/DialPad/DialPad.d.ts +16 -0
- package/lib/components/DialPad/DialPad.d.ts.map +1 -0
- package/lib/components/DialPad/DialPad.js +33 -0
- package/lib/components/DialPad/DialPad.js.map +1 -0
- package/lib/components/DialPad/DialPad.types.d.ts +33 -0
- package/lib/components/DialPad/DialPad.types.d.ts.map +1 -0
- package/lib/components/DialPad/DialPad.types.js +2 -0
- package/lib/components/DialPad/DialPad.types.js.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.d.ts +12 -0
- package/lib/components/DialPad/DialPadKeyboard.d.ts.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.js +87 -0
- package/lib/components/DialPad/DialPadKeyboard.js.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.d.ts +5 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.d.ts.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.js +76 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.js.map +1 -0
- package/lib/components/DialPad/KeyboardNavigation.d.ts +6 -0
- package/lib/components/DialPad/KeyboardNavigation.d.ts.map +1 -0
- package/lib/components/DialPad/KeyboardNavigation.js +156 -0
- package/lib/components/DialPad/KeyboardNavigation.js.map +1 -0
- package/lib/components/DialPad/index.d.ts +3 -0
- package/lib/components/DialPad/index.d.ts.map +1 -0
- package/lib/components/DialPad/index.js +2 -0
- package/lib/components/DialPad/index.js.map +1 -0
- package/lib/components/DialPad/utils.d.ts +4 -0
- package/lib/components/DialPad/utils.d.ts.map +1 -0
- package/lib/components/DialPad/utils.js +7 -0
- package/lib/components/DialPad/utils.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js +75 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +142 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +31 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
- package/lib/components/IntelligentGuidance/index.d.ts +3 -0
- package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/index.js +2 -0
- package/lib/components/IntelligentGuidance/index.js.map +1 -0
- package/lib/components/InteractionNotification/InteractionNotification.d.ts +26 -0
- package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -0
- package/lib/components/InteractionNotification/InteractionNotification.js +78 -0
- package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -0
- package/lib/components/InteractionNotification/index.d.ts +2 -0
- package/lib/components/InteractionNotification/index.d.ts.map +1 -0
- package/lib/components/InteractionNotification/index.js +2 -0
- package/lib/components/InteractionNotification/index.js.map +1 -0
- package/lib/components/InteractionTimer/InteractionTimer.d.ts +29 -0
- package/lib/components/InteractionTimer/InteractionTimer.d.ts.map +1 -0
- package/lib/components/InteractionTimer/InteractionTimer.js +72 -0
- package/lib/components/InteractionTimer/InteractionTimer.js.map +1 -0
- package/lib/components/InteractionTimer/index.d.ts +2 -0
- package/lib/components/InteractionTimer/index.d.ts.map +1 -0
- package/lib/components/InteractionTimer/index.js +2 -0
- package/lib/components/InteractionTimer/index.js.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.d.ts +6 -0
- package/lib/components/TaskManager/Picker/Picker.d.ts.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.js +171 -0
- package/lib/components/TaskManager/Picker/Picker.js.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.types.d.ts +27 -0
- package/lib/components/TaskManager/Picker/Picker.types.d.ts.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.types.js +2 -0
- package/lib/components/TaskManager/Picker/Picker.types.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.context.d.ts +5 -0
- package/lib/components/TaskManager/TaskManager.context.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.context.js +3 -0
- package/lib/components/TaskManager/TaskManager.context.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.d.ts +6 -0
- package/lib/components/TaskManager/TaskManager.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.js +76 -0
- package/lib/components/TaskManager/TaskManager.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.styles.d.ts +20 -0
- package/lib/components/TaskManager/TaskManager.styles.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.styles.js +232 -0
- package/lib/components/TaskManager/TaskManager.styles.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.types.d.ts +74 -0
- package/lib/components/TaskManager/TaskManager.types.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.types.js +2 -0
- package/lib/components/TaskManager/TaskManager.types.js.map +1 -0
- package/lib/components/TaskManager/TaskManagerTabs.d.ts +6 -0
- package/lib/components/TaskManager/TaskManagerTabs.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManagerTabs.js +159 -0
- package/lib/components/TaskManager/TaskManagerTabs.js.map +1 -0
- package/lib/components/TaskManager/TaskView.d.ts +6 -0
- package/lib/components/TaskManager/TaskView.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskView.js +10 -0
- package/lib/components/TaskManager/TaskView.js.map +1 -0
- package/lib/components/TaskManager/index.d.ts +5 -0
- package/lib/components/TaskManager/index.d.ts.map +1 -0
- package/lib/components/TaskManager/index.js +4 -0
- package/lib/components/TaskManager/index.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, FunctionComponent } from 'react';
|
|
2
|
+
import { MenuItemProps, BaseProps, ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
+
import ArticleFooter from './ArticleFooter';
|
|
4
|
+
export interface BaseArticleProps extends BaseProps, NoChildrenProp {
|
|
5
|
+
/** Navigation elements */
|
|
6
|
+
navigation?: ReactNode;
|
|
7
|
+
/** Primary actions which needs to be displayed with an icon */
|
|
8
|
+
primaryActions?: ReactNode;
|
|
9
|
+
/** Secondary actions that needs to be pushed under more icon */
|
|
10
|
+
secondaryActions?: {
|
|
11
|
+
id: MenuItemProps['id'];
|
|
12
|
+
text: MenuItemProps['primary'];
|
|
13
|
+
}[];
|
|
14
|
+
/** Article title */
|
|
15
|
+
title: string;
|
|
16
|
+
/** Array of meta data rendered through MetaList component */
|
|
17
|
+
meta?: (ReactElement | string)[];
|
|
18
|
+
/** Article content */
|
|
19
|
+
content: ReactNode;
|
|
20
|
+
/** Footer */
|
|
21
|
+
footer?: ReactElement<typeof ArticleFooter>;
|
|
22
|
+
/** Prop to check visibility of skeleton */
|
|
23
|
+
skeletonize: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare type ArticleProps = (BaseArticleProps & {
|
|
26
|
+
skeletonize?: false;
|
|
27
|
+
}) | (Partial<BaseArticleProps> & {
|
|
28
|
+
skeletonize: true;
|
|
29
|
+
});
|
|
30
|
+
declare const Article: FunctionComponent<ArticleProps & ForwardProps>;
|
|
31
|
+
export default Article;
|
|
32
|
+
//# sourceMappingURL=Article.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Article.d.ts","sourceRoot":"","sources":["../../../src/components/Article/Article.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EACL,aAAa,EAOb,SAAS,EACT,YAAY,EACZ,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACjE,0BAA0B;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,gEAAgE;IAChE,gBAAgB,CAAC,EAAE;QACjB,EAAE,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KAChC,EAAE,CAAC;IACJ,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,IAAI,CAAC,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,sBAAsB;IACtB,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa;IACb,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;IAC5C,2CAA2C;IAC3C,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,oBAAY,YAAY,GACpB,CAAC,gBAAgB,GAAG;IAAE,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAC5C,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAiDxD,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAkE3D,CAAC;AAMF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { Flex, LineSkeleton, MenuButton, MetaList, Text, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
4
|
+
import ArticleSkeleton from './ArticleSkeleton';
|
|
5
|
+
const StyledArticleWrapper = styled.div(props => {
|
|
6
|
+
const { theme } = props;
|
|
7
|
+
return css `
|
|
8
|
+
background: ${theme.base.palette['primary-background']};
|
|
9
|
+
padding: calc(1.5 * ${theme.base.spacing});
|
|
10
|
+
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
11
|
+
max-height: inherit;
|
|
12
|
+
`;
|
|
13
|
+
});
|
|
14
|
+
const StyledArticleHeader = styled.header `
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
`;
|
|
17
|
+
const StyledArticleContent = styled.div(props => {
|
|
18
|
+
const { theme, theme: { base: { spacing } } } = props;
|
|
19
|
+
return css `
|
|
20
|
+
flex-grow: 1;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
padding: 0 calc(1.5 * ${spacing});
|
|
23
|
+
margin: 0 calc(-1.5 * ${spacing});
|
|
24
|
+
|
|
25
|
+
/* TODO - We need to think of handling this such way RTE content is not impacted with the styles inside styles/GlobalStyle.tsx */
|
|
26
|
+
ul,
|
|
27
|
+
ol {
|
|
28
|
+
padding-left: calc(3 * ${spacing});
|
|
29
|
+
}
|
|
30
|
+
a {
|
|
31
|
+
color: ${theme.components.link.color};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
});
|
|
35
|
+
StyledArticleContent.defaultProps = defaultThemeProp;
|
|
36
|
+
StyledArticleWrapper.defaultProps = defaultThemeProp;
|
|
37
|
+
const Locale = {
|
|
38
|
+
// FIXME: TR
|
|
39
|
+
moreActions: 'More actions'
|
|
40
|
+
};
|
|
41
|
+
const Article = (props) => {
|
|
42
|
+
const { meta, title, navigation, content, primaryActions, secondaryActions, footer, skeletonize, ...restProps } = props;
|
|
43
|
+
return (_jsxs(Flex, { container: { direction: 'column', gap: 1 }, as: StyledArticleWrapper, ...restProps, children: [(navigation || primaryActions || secondaryActions) && (_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Flex, { container: true, item: { grow: 1 }, children: navigation }, void 0), _jsxs(Flex, { container: { alignItems: 'center' }, children: [primaryActions, secondaryActions && (_jsx(MenuButton, { variant: 'simple', text: Locale.moreActions, icon: 'more', iconOnly: true, menu: {
|
|
44
|
+
items: secondaryActions.map(({ text, ...rest }) => ({ ...rest, primary: text }))
|
|
45
|
+
} }, void 0))] }, void 0)] }, void 0)), title ? (_jsx(Flex, { container: true, as: StyledArticleHeader, children: _jsx(Text, { variant: 'h3', children: title }, void 0) }, void 0)) : (skeletonize && _jsx(LineSkeleton, { width: 'l' }, void 0)), meta && meta.length > 0 ? (_jsx(Flex, { container: true, item: { shrink: 0 }, children: _jsx(MetaList, { items: meta }, void 0) }, void 0)) : (skeletonize && (_jsxs(Flex, { container: true, children: [_jsx(LineSkeleton, { width: 's' }, void 0), _jsx(LineSkeleton, { width: 's' }, void 0), _jsx(LineSkeleton, { width: 's' }, void 0)] }, void 0))), skeletonize ? (_jsx(StyledArticleContent, { children: _jsx(ArticleSkeleton, {}, void 0) }, void 0)) : (_jsx(StyledArticleContent, { children: content }, void 0)), footer] }, void 0));
|
|
46
|
+
};
|
|
47
|
+
Article.defaultProps = {
|
|
48
|
+
skeletonize: false
|
|
49
|
+
};
|
|
50
|
+
export default Article;
|
|
51
|
+
//# sourceMappingURL=Article.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Article.js","sourceRoot":"","sources":["../../../src/components/Article/Article.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAIjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AA4BhD,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC9C,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,OAAO,GAAG,CAAA;kBACM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;0BAChC,KAAK,CAAC,IAAI,CAAC,OAAO;gCACZ,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAExD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH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G;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { ReactElement, ReactNode, FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n MenuItemProps,\n Flex,\n LineSkeleton,\n MenuButton,\n MetaList,\n Text,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport ArticleFooter from './ArticleFooter';\nimport ArticleSkeleton from './ArticleSkeleton';\n\nexport interface BaseArticleProps extends BaseProps, NoChildrenProp {\n /** Navigation elements */\n navigation?: ReactNode;\n /** Primary actions which needs to be displayed with an icon */\n primaryActions?: ReactNode;\n /** Secondary actions that needs to be pushed under more icon */\n secondaryActions?: {\n id: MenuItemProps['id'];\n text: MenuItemProps['primary'];\n }[];\n /** Article title */\n title: string;\n /** Array of meta data rendered through MetaList component */\n meta?: (ReactElement | string)[];\n /** Article content */\n content: ReactNode;\n /** Footer */\n footer?: ReactElement<typeof ArticleFooter>;\n /** Prop to check visibility of skeleton */\n skeletonize: boolean;\n}\n\nexport type ArticleProps =\n | (BaseArticleProps & { skeletonize?: false })\n | (Partial<BaseArticleProps> & { skeletonize: true });\n\nconst StyledArticleWrapper = styled.div(props => {\n const { theme } = props;\n return css`\n background: ${theme.base.palette['primary-background']};\n padding: calc(1.5 * ${theme.base.spacing});\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n max-height: inherit;\n `;\n});\n\nconst StyledArticleHeader = styled.header`\n flex-shrink: 0;\n`;\n\nconst StyledArticleContent = styled.div(props => {\n const {\n theme,\n theme: {\n base: { spacing }\n }\n } = props;\n\n return css`\n flex-grow: 1;\n overflow-y: auto;\n padding: 0 calc(1.5 * ${spacing});\n margin: 0 calc(-1.5 * ${spacing});\n\n /* TODO - We need to think of handling this such way RTE content is not impacted with the styles inside styles/GlobalStyle.tsx */\n ul,\n ol {\n padding-left: calc(3 * ${spacing});\n }\n a {\n color: ${theme.components.link.color};\n }\n `;\n});\n\nStyledArticleContent.defaultProps = defaultThemeProp;\nStyledArticleWrapper.defaultProps = defaultThemeProp;\n\nconst Locale = {\n // FIXME: TR\n moreActions: 'More actions'\n};\n\nconst Article: FunctionComponent<ArticleProps & ForwardProps> = (props: ArticleProps) => {\n const {\n meta,\n title,\n navigation,\n content,\n primaryActions,\n secondaryActions,\n footer,\n skeletonize,\n ...restProps\n } = props;\n\n return (\n <Flex container={{ direction: 'column', gap: 1 }} as={StyledArticleWrapper} {...restProps}>\n {(navigation || primaryActions || secondaryActions) && (\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Flex container item={{ grow: 1 }}>\n {navigation}\n </Flex>\n <Flex container={{ alignItems: 'center' }}>\n {primaryActions}\n {secondaryActions && (\n <MenuButton\n variant='simple'\n text={Locale.moreActions}\n icon='more'\n iconOnly\n menu={{\n items: secondaryActions.map(({ text, ...rest }) => ({ ...rest, primary: text }))\n }}\n />\n )}\n </Flex>\n </Flex>\n )}\n {title ? (\n <Flex container as={StyledArticleHeader}>\n <Text variant='h3'>{title}</Text>\n </Flex>\n ) : (\n skeletonize && <LineSkeleton width='l' />\n )}\n {meta && meta.length > 0 ? (\n <Flex container item={{ shrink: 0 }}>\n <MetaList items={meta} />\n </Flex>\n ) : (\n skeletonize && (\n <Flex container>\n <LineSkeleton width='s' />\n <LineSkeleton width='s' />\n <LineSkeleton width='s' />\n </Flex>\n )\n )}\n {skeletonize ? (\n <StyledArticleContent>\n <ArticleSkeleton />\n </StyledArticleContent>\n ) : (\n <StyledArticleContent>{content}</StyledArticleContent>\n )}\n {footer}\n </Flex>\n );\n};\n\nArticle.defaultProps = {\n skeletonize: false\n};\n\nexport default Article;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode, FunctionComponent } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface ArticleTag {
|
|
4
|
+
/** Tag name */
|
|
5
|
+
tagName: string;
|
|
6
|
+
/** Tag id. If not set tagName is treated as id */
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ArticleFooterProps extends BaseProps {
|
|
10
|
+
/** Article tags */
|
|
11
|
+
tags?: ArticleTag[];
|
|
12
|
+
/** Callback that triggers on click of tag */
|
|
13
|
+
onTagClick?: (id: ArticleTag['id']) => void;
|
|
14
|
+
/** Footer content */
|
|
15
|
+
content?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare const ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps>;
|
|
18
|
+
export default ArticleFooter;
|
|
19
|
+
//# sourceMappingURL=ArticleFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleFooter.d.ts","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAA2B,MAAM,OAAO,CAAC;AAG9E,OAAO,EAA+B,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG/F,MAAM,WAAW,UAAU;IACzB,eAAe;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,mBAAmB;IACnB,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC5C,qBAAqB;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AA6BD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAyCvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Flex, Tag, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
import { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';
|
|
6
|
+
const StyledArticleFooter = styled.div(({ theme }) => {
|
|
7
|
+
return css `
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
&::before {
|
|
10
|
+
content: '';
|
|
11
|
+
display: block;
|
|
12
|
+
background: ${theme.base.palette['border-line']};
|
|
13
|
+
height: 0.0625rem;
|
|
14
|
+
margin-bottom: calc(2 * ${theme.base.spacing});
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
});
|
|
18
|
+
StyledArticleFooter.defaultProps = defaultThemeProp;
|
|
19
|
+
const StyledTags = styled.div(({ theme }) => {
|
|
20
|
+
return css `
|
|
21
|
+
padding: calc(0.25 * ${theme.base.spacing});
|
|
22
|
+
margin: 0 calc(-0.5 * ${theme.base.spacing});
|
|
23
|
+
& > ${StyledTag} {
|
|
24
|
+
margin: calc(0.25 * ${theme.base.spacing});
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
});
|
|
28
|
+
StyledTags.defaultProps = defaultThemeProp;
|
|
29
|
+
const ArticleFooter = (props) => {
|
|
30
|
+
const { content, tags, onTagClick, ...restProps } = props;
|
|
31
|
+
const onTagClickHandler = useCallback((event) => {
|
|
32
|
+
onTagClick?.(event.currentTarget.dataset.tagId);
|
|
33
|
+
}, [onTagClick]);
|
|
34
|
+
return (_jsxs(Flex, { as: StyledArticleFooter, container: {
|
|
35
|
+
direction: 'column',
|
|
36
|
+
gap: 2
|
|
37
|
+
}, ...restProps, children: [content, tags && (_jsx(Flex, { container: { wrap: 'wrap' }, as: StyledTags, children: tags.map(tag => (_jsx(Tag, { tabIndex: 0, type: 'pill', variant: 'light', "data-tag-id": tag.id, onClick: onTagClickHandler, rel: 'tag', children: tag.tagName }, tag.id))) }, void 0))] }, void 0));
|
|
38
|
+
};
|
|
39
|
+
export default ArticleFooter;
|
|
40
|
+
//# sourceMappingURL=ArticleFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleFooter.js","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA4C,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,gBAAgB,EAA2B,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AAkB9E,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;;;;oBAKQ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;gCAErB,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1C,OAAO,GAAG,CAAA;2BACe,KAAK,CAAC,IAAI,CAAC,OAAO;4BACjB,KAAK,CAAC,IAAI,CAAC,OAAO;UACpC,SAAS;4BACS,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,aAAa,GAAyD,CAC1E,KAAyB,EACzB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1D,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,KAA8B,EAAE,EAAE;QACjC,UAAU,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,KAAM,CAAC,CAAC;IACnD,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAE,mBAAmB,EACvB,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,GAAG,EAAE,CAAC;SACP,KACG,SAAS,aAEZ,OAAO,EACP,IAAI,IAAI,CACP,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,UAAU,YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACf,KAAC,GAAG,IACF,QAAQ,EAAE,CAAC,EACX,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,OAAO,iBAEF,GAAG,CAAC,EAAE,EACnB,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAC,KAAK,YAER,GAAG,CAAC,OAAO,IALP,GAAG,CAAC,EAAE,CAMP,CACP,CAAC,WACG,CACR,YACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { ReactNode, FunctionComponent, MouseEvent, useCallback } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, Tag, defaultThemeProp, BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';\n\nexport interface ArticleTag {\n /** Tag name */\n tagName: string;\n /** Tag id. If not set tagName is treated as id */\n id: string;\n}\n\nexport interface ArticleFooterProps extends BaseProps {\n /** Article tags */\n tags?: ArticleTag[];\n /** Callback that triggers on click of tag */\n onTagClick?: (id: ArticleTag['id']) => void;\n /** Footer content */\n content?: ReactNode;\n}\n\nconst StyledArticleFooter = styled.div(({ theme }) => {\n return css`\n flex-shrink: 0;\n &::before {\n content: '';\n display: block;\n background: ${theme.base.palette['border-line']};\n height: 0.0625rem;\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledArticleFooter.defaultProps = defaultThemeProp;\n\nconst StyledTags = styled.div(({ theme }) => {\n return css`\n padding: calc(0.25 * ${theme.base.spacing});\n margin: 0 calc(-0.5 * ${theme.base.spacing});\n & > ${StyledTag} {\n margin: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledTags.defaultProps = defaultThemeProp;\n\nconst ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps> = (\n props: ArticleFooterProps\n) => {\n const { content, tags, onTagClick, ...restProps } = props;\n\n const onTagClickHandler = useCallback(\n (event: MouseEvent<HTMLElement>) => {\n onTagClick?.(event.currentTarget.dataset.tagId!);\n },\n [onTagClick]\n );\n\n return (\n <Flex\n as={StyledArticleFooter}\n container={{\n direction: 'column',\n gap: 2\n }}\n {...restProps}\n >\n {content}\n {tags && (\n <Flex container={{ wrap: 'wrap' }} as={StyledTags}>\n {tags.map(tag => (\n <Tag\n tabIndex={0}\n type='pill'\n variant='light'\n key={tag.id}\n data-tag-id={tag.id}\n onClick={onTagClickHandler}\n rel='tag'\n >\n {tag.tagName}\n </Tag>\n ))}\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default ArticleFooter;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface ArticleSkeletonProps extends BaseProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const StyledArticleSkeleton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
declare const ArticleSkeleton: FunctionComponent<ArticleSkeletonProps & ForwardProps>;
|
|
7
|
+
export default ArticleSkeleton;
|
|
8
|
+
//# sourceMappingURL=ArticleSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/Article/ArticleSkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAKL,SAAS,EACT,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,oBAAqB,SAAQ,SAAS;CAAG;AAE1D,eAAO,MAAM,qBAAqB,yGAAe,CAAC;AAElD,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAqB3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Flex, LineSkeleton, ParagraphSkeleton } from '@pega/cosmos-react-core';
|
|
4
|
+
export const StyledArticleSkeleton = styled.div ``;
|
|
5
|
+
const ArticleSkeleton = (props) => {
|
|
6
|
+
const numberOfLines = 18;
|
|
7
|
+
return (_jsx(StyledArticleSkeleton, { ...props, "aria-disabled": 'true', children: _jsx(ParagraphSkeleton, { children: Array.from({ length: numberOfLines }, (_, i) => {
|
|
8
|
+
const lines = i % 3 === 0 ? ['s', 'm'] : ['s', 's', 's'];
|
|
9
|
+
return (_jsx(Flex, { container: { alignItems: 'center' }, children: lines.map((size, j) => (
|
|
10
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
11
|
+
_jsx(LineSkeleton, { width: size }, j))) }, i));
|
|
12
|
+
}) }, void 0) }, void 0));
|
|
13
|
+
};
|
|
14
|
+
export default ArticleSkeleton;
|
|
15
|
+
//# sourceMappingURL=ArticleSkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleSkeleton.js","sourceRoot":"","sources":["../../../src/components/Article/ArticleSkeleton.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,IAAI,EACJ,YAAY,EAEZ,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAElD,MAAM,eAAe,GAA2D,CAC9E,KAA2B,EAC3B,EAAE;IACF,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,OAAO,CACL,KAAC,qBAAqB,OAAK,KAAK,mBAAgB,MAAM,YACpD,KAAC,iBAAiB,cACf,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC9C,MAAM,KAAK,GAAiC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;gBACvF,OAAO,CACL,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,YACtC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;oBACtB,oDAAoD;oBACpD,KAAC,YAAY,IAAC,KAAK,EAAE,IAAI,IAAO,CAAC,CAAI,CACtC,CAAC,IAJ4C,CAAC,CAK1C,CACR,CAAC;YACJ,CAAC,CAAC,WACgB,WACE,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Flex,\n LineSkeleton,\n LineSkeletonProps,\n ParagraphSkeleton,\n BaseProps,\n ForwardProps\n} from '@pega/cosmos-react-core';\n\nexport interface ArticleSkeletonProps extends BaseProps {}\n\nexport const StyledArticleSkeleton = styled.div``;\n\nconst ArticleSkeleton: FunctionComponent<ArticleSkeletonProps & ForwardProps> = (\n props: ArticleSkeletonProps\n) => {\n const numberOfLines = 18;\n return (\n <StyledArticleSkeleton {...props} aria-disabled='true'>\n <ParagraphSkeleton>\n {Array.from({ length: numberOfLines }, (_, i) => {\n const lines: LineSkeletonProps['width'][] = i % 3 === 0 ? ['s', 'm'] : ['s', 's', 's'];\n return (\n <Flex container={{ alignItems: 'center' }} key={i}>\n {lines.map((size, j) => (\n // eslint-disable-next-line react/no-array-index-key\n <LineSkeleton width={size} key={j} />\n ))}\n </Flex>\n );\n })}\n </ParagraphSkeleton>\n </StyledArticleSkeleton>\n );\n};\n\nexport default ArticleSkeleton;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default } from './Article';
|
|
2
|
+
export { default as ArticleFooter } from './ArticleFooter';
|
|
3
|
+
export { ArticleTag } from './ArticleFooter';
|
|
4
|
+
export { ArticleProps } from './Article';
|
|
5
|
+
export { ArticleFooterProps } from './ArticleFooter';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Article/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Article/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { default } from './Article';\nexport { default as ArticleFooter } from './ArticleFooter';\nexport { ArticleTag } from './ArticleFooter';\nexport { ArticleProps } from './Article';\nexport { ArticleFooterProps } from './ArticleFooter';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode, ReactElement, Ref } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import ArticleListHeader from './ArticleListHeader';
|
|
4
|
+
export interface ArticleListProps extends BaseProps {
|
|
5
|
+
/** Search/filtering criteria for article list */
|
|
6
|
+
header?: ReactElement<typeof ArticleListHeader>;
|
|
7
|
+
/** Content for article list */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Prop to check visibility of skeleton */
|
|
10
|
+
skeletonize: boolean;
|
|
11
|
+
/** Footer for article list */
|
|
12
|
+
footer?: ReactNode;
|
|
13
|
+
ref?: Ref<HTMLDivElement>;
|
|
14
|
+
}
|
|
15
|
+
declare const ArticleList: FunctionComponent<ArticleListProps & ForwardProps>;
|
|
16
|
+
export default ArticleList;
|
|
17
|
+
//# sourceMappingURL=ArticleList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleList.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EAEZ,GAAG,EAEJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAmC,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGnG,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAGpD,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,iDAAiD;IACjD,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAChD,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2CAA2C;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AA2DD,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CA0CnE,CAAC;AAIF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Flex, useI18n, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
import { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';
|
|
6
|
+
import SummarySkeleton from './SummarySkeleton';
|
|
7
|
+
const defaultProps = {};
|
|
8
|
+
const StyledSummaryList = styled.ul ``;
|
|
9
|
+
const StyledArticleList = styled.div(props => {
|
|
10
|
+
const { theme } = props;
|
|
11
|
+
return css `
|
|
12
|
+
max-height: inherit;
|
|
13
|
+
overflow: auto;
|
|
14
|
+
padding: 0 calc(2 * ${theme.base.spacing});
|
|
15
|
+
background: ${theme.base.palette['primary-background']};
|
|
16
|
+
border-radius: ${theme.components.card['border-radius']};
|
|
17
|
+
${StyledCard} {
|
|
18
|
+
margin-bottom: calc(2 * ${theme.base.spacing});
|
|
19
|
+
}
|
|
20
|
+
${StyledSummaryList} {
|
|
21
|
+
flex-grow: 1;
|
|
22
|
+
margin: 0 0 ${theme.base.spacing} 0;
|
|
23
|
+
list-style-type: none;
|
|
24
|
+
> li:not(:last-child) {
|
|
25
|
+
border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
26
|
+
border-radius: 0;
|
|
27
|
+
padding-bottom: ${theme.base.spacing};
|
|
28
|
+
margin-bottom: ${theme.base.spacing};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
});
|
|
33
|
+
StyledArticleList.defaultProps = defaultThemeProp;
|
|
34
|
+
const StyledArticleListHeader = styled.div(props => {
|
|
35
|
+
const { theme } = props;
|
|
36
|
+
return css `
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
position: sticky;
|
|
39
|
+
top: 0;
|
|
40
|
+
background: ${theme.base.palette['primary-background']};
|
|
41
|
+
padding: calc(2 * ${theme.base.spacing}) 0 0 0;
|
|
42
|
+
z-index: 2;
|
|
43
|
+
`;
|
|
44
|
+
});
|
|
45
|
+
StyledArticleListHeader.defaultProps = defaultThemeProp;
|
|
46
|
+
const StyledArticleListFooter = styled.div(props => {
|
|
47
|
+
const { theme } = props;
|
|
48
|
+
return css `
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
position: sticky;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
background: ${theme.base.palette['primary-background']};
|
|
53
|
+
padding: ${theme.base.spacing} 0;
|
|
54
|
+
z-index: 2;
|
|
55
|
+
`;
|
|
56
|
+
});
|
|
57
|
+
StyledArticleListFooter.defaultProps = defaultThemeProp;
|
|
58
|
+
const ArticleList = forwardRef((props, ref) => {
|
|
59
|
+
const { header, children, skeletonize, footer, ...restProps } = props;
|
|
60
|
+
const t = useI18n();
|
|
61
|
+
return (_jsxs(Flex, { container: { direction: 'column' }, as: StyledArticleList, "aria-label": t('article_list_label_a11y'), ref: ref, ...restProps, children: [header && (_jsx(Flex, { container: true, as: StyledArticleListHeader, "aria-label": t('article_list_filter_label_a11y'), children: header }, void 0)), _jsx(Flex, { container: { direction: 'column' }, as: StyledSummaryList, role: 'feed', children: skeletonize ? (_jsxs(_Fragment, { children: [_jsx(SummarySkeleton, {}, void 0), _jsx(SummarySkeleton, {}, void 0), _jsx(SummarySkeleton, {}, void 0)] }, void 0)) : (children) }, void 0), footer && (_jsx(Flex, { container: true, as: StyledArticleListFooter, children: footer }, void 0))] }, void 0));
|
|
62
|
+
});
|
|
63
|
+
ArticleList.defaultProps = defaultProps;
|
|
64
|
+
export default ArticleList;
|
|
65
|
+
//# sourceMappingURL=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,eAAe,aAAG,EACnB,KAAC,eAAe,aAAG,EACnB,KAAC,eAAe,aAAG,YAClB,CACJ,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,WACI,EACN,MAAM,IAAI,CACT,KAAC,IAAI,IAAC,SAAS,QAAC,EAAE,EAAE,uBAAuB,YACxC,MAAM,WACF,CACR,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["import {\n FunctionComponent,\n ReactNode,\n ReactElement,\n forwardRef,\n Ref,\n PropsWithoutRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, useI18n, defaultThemeProp, BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';\n\nimport ArticleListHeader from './ArticleListHeader';\nimport SummarySkeleton from './SummarySkeleton';\n\nexport interface ArticleListProps extends BaseProps {\n /** Search/filtering criteria for article list */\n header?: ReactElement<typeof ArticleListHeader>;\n /** Content for article list */\n children?: ReactNode;\n /** Prop to check visibility of skeleton */\n skeletonize: boolean;\n /** Footer for article list */\n footer?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst defaultProps: Partial<ArticleListProps> = {};\nconst StyledSummaryList = styled.ul``;\nconst StyledArticleList = styled.div(props => {\n const { theme } = props;\n return css`\n max-height: inherit;\n overflow: auto;\n padding: 0 calc(2 * ${theme.base.spacing});\n background: ${theme.base.palette['primary-background']};\n border-radius: ${theme.components.card['border-radius']};\n ${StyledCard} {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledSummaryList} {\n flex-grow: 1;\n margin: 0 0 ${theme.base.spacing} 0;\n list-style-type: none;\n > li:not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: 0;\n padding-bottom: ${theme.base.spacing};\n margin-bottom: ${theme.base.spacing};\n }\n }\n `;\n});\n\nStyledArticleList.defaultProps = defaultThemeProp;\n\nconst StyledArticleListHeader = styled.div(props => {\n const { theme } = props;\n return css`\n flex-shrink: 0;\n position: sticky;\n top: 0;\n background: ${theme.base.palette['primary-background']};\n padding: calc(2 * ${theme.base.spacing}) 0 0 0;\n z-index: 2;\n `;\n});\n\nStyledArticleListHeader.defaultProps = defaultThemeProp;\n\nconst StyledArticleListFooter = styled.div(props => {\n const { theme } = props;\n return css`\n flex-shrink: 0;\n position: sticky;\n bottom: 0;\n background: ${theme.base.palette['primary-background']};\n padding: ${theme.base.spacing} 0;\n z-index: 2;\n `;\n});\n\nStyledArticleListFooter.defaultProps = defaultThemeProp;\n\nconst ArticleList: FunctionComponent<ArticleListProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ArticleListProps>, ref: Ref<HTMLDivElement>) => {\n const { header, children, skeletonize, footer, ...restProps } = props;\n\n const t = useI18n();\n\n return (\n <Flex\n container={{ direction: 'column' }}\n as={StyledArticleList}\n aria-label={t('article_list_label_a11y')}\n ref={ref}\n {...restProps}\n >\n {header && (\n <Flex\n container\n as={StyledArticleListHeader}\n aria-label={t('article_list_filter_label_a11y')}\n >\n {header}\n </Flex>\n )}\n <Flex container={{ direction: 'column' }} as={StyledSummaryList} role='feed'>\n {skeletonize ? (\n <>\n <SummarySkeleton />\n <SummarySkeleton />\n <SummarySkeleton />\n </>\n ) : (\n children\n )}\n </Flex>\n {footer && (\n <Flex container as={StyledArticleListFooter}>\n {footer}\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nArticleList.defaultProps = defaultProps;\n\nexport default ArticleList;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode, EventHandler, MouseEvent, ReactElement } from 'react';
|
|
2
|
+
import { SearchInput, BaseProps, AsProp, Action, Icon } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface ArticleListHeaderProps extends BaseProps, AsProp {
|
|
4
|
+
/** Header Icon and Text */
|
|
5
|
+
icon?: ReactElement<typeof Icon>;
|
|
6
|
+
headerText: string;
|
|
7
|
+
/** Primary data: Drop in elements related to search or filtering of articles */
|
|
8
|
+
primary: {
|
|
9
|
+
search: ReactElement<typeof SearchInput>;
|
|
10
|
+
followedFilter?: ReactElement;
|
|
11
|
+
actions?: Action[];
|
|
12
|
+
};
|
|
13
|
+
/** Any other filter components to be passed */
|
|
14
|
+
secondary?: ReactNode;
|
|
15
|
+
/** Callback that triggers on enter */
|
|
16
|
+
onSubmit?: EventHandler<MouseEvent>;
|
|
17
|
+
}
|
|
18
|
+
declare const ArticleListHeader: FunctionComponent<ArticleListHeaderProps>;
|
|
19
|
+
export default ArticleListHeader;
|
|
20
|
+
//# sourceMappingURL=ArticleListHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleListHeader.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG7F,OAAO,EAKL,WAAW,EAEX,SAAS,EACT,MAAM,EACN,MAAM,EACN,IAAI,EAGL,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,sBAAuB,SAAQ,SAAS,EAAE,MAAM;IAC/D,2BAA2B;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IAEnB,gFAAgF;IAChF,OAAO,EAAE;QACP,MAAM,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;QACzC,cAAc,CAAC,EAAE,YAAY,CAAC;QAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,+CAA+C;IAC/C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;CACrC;AA2DD,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,CA+ChE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { Button, Flex, Form, MenuButton, useI18n, Text, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledFormContent } from '@pega/cosmos-react-core/lib/components/Form/Form';
|
|
5
|
+
const StyledArticleHeader = styled.div(({ theme }) => {
|
|
6
|
+
return css `
|
|
7
|
+
width: 100%;
|
|
8
|
+
gap: 0;
|
|
9
|
+
|
|
10
|
+
button[type='submit'] {
|
|
11
|
+
height: 0;
|
|
12
|
+
min-height: 0;
|
|
13
|
+
width: 0.0625rem;
|
|
14
|
+
clip-path: inset(50%);
|
|
15
|
+
clip: rect(0, 0, 0, 0);
|
|
16
|
+
margin: 0;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
padding: 0;
|
|
19
|
+
border: 0;
|
|
20
|
+
}
|
|
21
|
+
> div:last-child {
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${StyledFormContent} {
|
|
26
|
+
gap: ${theme.base.spacing};
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
});
|
|
30
|
+
StyledArticleHeader.defaultProps = defaultThemeProp;
|
|
31
|
+
const StyledSecondaryContainer = styled(Flex) `
|
|
32
|
+
margin: 0.5rem 0;
|
|
33
|
+
& > * {
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
/* This below style will be removed once we have margin auto support from Flex
|
|
38
|
+
component */
|
|
39
|
+
const StyledHeaderActions = styled.div `
|
|
40
|
+
margin-left: auto;
|
|
41
|
+
|
|
42
|
+
.radio-check {
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
const StyledArticleListHeaderText = styled(Text) `
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
flex: 1;
|
|
51
|
+
`;
|
|
52
|
+
const Locale = {
|
|
53
|
+
// FIXME: TR
|
|
54
|
+
moreActions: 'More actions'
|
|
55
|
+
};
|
|
56
|
+
const ArticleListHeader = (props) => {
|
|
57
|
+
const { as = Form, primary, secondary, onSubmit, icon, headerText, ...restProps } = props;
|
|
58
|
+
const t = useI18n();
|
|
59
|
+
return (_jsxs(StyledArticleHeader, { as: as, actions: _jsx(Button, { type: 'submit', "aria-hidden": 'true', tabIndex: '-1', children: t('article_list_header_submit_label') }, void 0), role: 'search', onSubmit: (ev) => {
|
|
60
|
+
ev.preventDefault();
|
|
61
|
+
if (onSubmit)
|
|
62
|
+
onSubmit(ev);
|
|
63
|
+
}, ...restProps, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [icon, _jsx(StyledArticleListHeaderText, { variant: 'h2', children: headerText }, void 0), primary.actions && (_jsx(MenuButton, { variant: 'simple', text: Locale.moreActions, icon: 'more', iconOnly: true, menu: {
|
|
64
|
+
items: primary.actions.map(({ text, ...rest }) => ({ ...rest, primary: text }))
|
|
65
|
+
} }, void 0))] }, void 0), _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Flex, { item: { grow: 1 }, children: primary.search }, void 0), _jsx(Flex, { container: true, as: StyledHeaderActions, children: primary.followedFilter }, void 0)] }, void 0), secondary && (_jsx(StyledSecondaryContainer, { container: { gap: 1 }, children: secondary }, void 0))] }, void 0));
|
|
66
|
+
};
|
|
67
|
+
export default ArticleListHeader;
|
|
68
|
+
//# sourceMappingURL=ArticleListHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleListHeader.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList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andler, MouseEvent, ReactElement } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Flex,\n Form,\n MenuButton,\n SearchInput,\n useI18n,\n BaseProps,\n AsProp,\n Action,\n Icon,\n Text,\n defaultThemeProp\n} from '@pega/cosmos-react-core';\nimport { StyledFormContent } from '@pega/cosmos-react-core/lib/components/Form/Form';\n\nexport interface ArticleListHeaderProps extends BaseProps, AsProp {\n /** Header Icon and Text */\n icon?: ReactElement<typeof Icon>;\n headerText: string;\n\n /** Primary data: Drop in elements related to search or filtering of articles */\n primary: {\n search: ReactElement<typeof SearchInput>;\n followedFilter?: ReactElement;\n actions?: Action[];\n };\n /** Any other filter components to be passed */\n secondary?: ReactNode;\n /** Callback that triggers on enter */\n onSubmit?: EventHandler<MouseEvent>;\n}\n\nconst StyledArticleHeader = styled.div(({ theme }) => {\n return css`\n width: 100%;\n gap: 0;\n\n button[type='submit'] {\n height: 0;\n min-height: 0;\n width: 0.0625rem;\n clip-path: inset(50%);\n clip: rect(0, 0, 0, 0);\n margin: 0;\n overflow: hidden;\n padding: 0;\n border: 0;\n }\n > div:last-child {\n margin: 0;\n }\n\n ${StyledFormContent} {\n gap: ${theme.base.spacing};\n }\n `;\n});\n\nStyledArticleHeader.defaultProps = defaultThemeProp;\n\nconst StyledSecondaryContainer = styled(Flex)`\n margin: 0.5rem 0;\n & > * {\n flex-grow: 1;\n }\n`;\n\n/* This below style will be removed once we have margin auto support from Flex\ncomponent */\nconst StyledHeaderActions = styled.div`\n margin-left: auto;\n\n .radio-check {\n margin: 0;\n }\n`;\n\nconst StyledArticleListHeaderText = styled(Text)`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n flex: 1;\n`;\n\nconst Locale = {\n // FIXME: TR\n moreActions: 'More actions'\n};\n\nconst ArticleListHeader: FunctionComponent<ArticleListHeaderProps> = (\n props: ArticleListHeaderProps\n) => {\n const { as = Form, primary, secondary, onSubmit, icon, headerText, ...restProps } = props;\n const t = useI18n();\n\n return (\n <StyledArticleHeader\n as={as}\n actions={\n <Button type='submit' aria-hidden='true' tabIndex='-1'>\n {t('article_list_header_submit_label')}\n </Button>\n }\n role='search'\n onSubmit={(ev: MouseEvent) => {\n ev.preventDefault();\n if (onSubmit) onSubmit(ev);\n }}\n {...restProps}\n >\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {icon}\n <StyledArticleListHeaderText variant='h2'>{headerText}</StyledArticleListHeaderText>\n {primary.actions && (\n <MenuButton\n variant='simple'\n text={Locale.moreActions}\n icon='more'\n iconOnly\n menu={{\n items: primary.actions.map(({ text, ...rest }) => ({ ...rest, primary: text }))\n }}\n />\n )}\n </Flex>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Flex item={{ grow: 1 }}>{primary.search}</Flex>\n <Flex container as={StyledHeaderActions}>\n {primary.followedFilter}\n </Flex>\n </Flex>\n {secondary && (\n <StyledSecondaryContainer container={{ gap: 1 }}>{secondary}</StyledSecondaryContainer>\n )}\n </StyledArticleHeader>\n );\n};\n\nexport default ArticleListHeader;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FunctionComponent, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { Link, Text, BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface ArticleSummaryProps extends BaseProps {
|
|
4
|
+
/** Article summary title */
|
|
5
|
+
header?: ReactElement<typeof Text> | ReactElement<typeof Link>;
|
|
6
|
+
/** Summary of the article */
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
/** Array of meta data rendered through MetaList component */
|
|
9
|
+
meta?: (ReactElement | string)[];
|
|
10
|
+
articleID: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps>;
|
|
13
|
+
export default ArticleSummary;
|
|
14
|
+
//# sourceMappingURL=ArticleSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EAIL,IAAI,EAEJ,IAAI,EACJ,SAAS,EACT,YAAY,EAEb,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IAC/D,6BAA6B;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAezE,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { CardContent, CardFooter, CardHeader, MetaList, StyledText } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';
|
|
5
|
+
import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
|
|
6
|
+
import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
|
|
7
|
+
import { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';
|
|
8
|
+
const defaultProps = {};
|
|
9
|
+
const ArticleCard = styled(StyledCard) `
|
|
10
|
+
&&& {
|
|
11
|
+
> ${StyledCardHeader}, > ${StyledCardContent}, > ${StyledCardFooter} {
|
|
12
|
+
padding-left: 0;
|
|
13
|
+
padding-right: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
> ${StyledCardContent} > ${StyledText} {
|
|
17
|
+
display: -webkit-box;
|
|
18
|
+
-webkit-line-clamp: 3;
|
|
19
|
+
-webkit-box-orient: vertical;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const ArticleSummary = (props) => {
|
|
25
|
+
const { header, content, meta, articleID, ...restProps } = props;
|
|
26
|
+
return (_jsxs(ArticleCard, { as: 'li', role: 'article', ...restProps, children: [header ? _jsx(CardHeader, { children: header }, void 0) : null, _jsx(CardContent, { children: content }, void 0), meta && (_jsx(CardFooter, { children: _jsx(MetaList, { items: meta }, void 0) }, void 0))] }, articleID));
|
|
27
|
+
};
|
|
28
|
+
ArticleSummary.defaultProps = defaultProps;
|
|
29
|
+
export default ArticleSummary;
|
|
30
|
+
//# sourceMappingURL=ArticleSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleSummary.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EAEV,QAAQ,EAIR,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAY1F,MAAM,YAAY,GAAiC,EAAE,CAAC;AAEtD,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;QAE9B,gBAAgB,OAAO,iBAAiB,OAAO,gBAAgB;;;;;QAK/D,iBAAiB,MAAM,UAAU;;;;;;;CAOxC,CAAC;AAEF,MAAM,cAAc,GAA0D,CAC5E,KAA0B,EAC1B,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACjE,OAAO,CACL,MAAC,WAAW,IAAC,EAAE,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,KAAqB,SAAS,aAC9D,MAAM,CAAC,CAAC,CAAC,KAAC,UAAU,cAAE,MAAM,WAAc,CAAC,CAAC,CAAC,IAAI,EAClD,KAAC,WAAW,cAAE,OAAO,WAAe,EACnC,IAAI,IAAI,CACP,KAAC,UAAU,cACT,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,WAAI,WACd,CACd,KAPsC,SAAS,CAQpC,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;AAE3C,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, ReactElement, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport {\n CardContent,\n CardFooter,\n CardHeader,\n Link,\n MetaList,\n Text,\n BaseProps,\n ForwardProps,\n StyledText\n} from '@pega/cosmos-react-core';\nimport { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';\n\nexport interface ArticleSummaryProps extends BaseProps {\n /** Article summary title */\n header?: ReactElement<typeof Text> | ReactElement<typeof Link>;\n /** Summary of the article */\n content: ReactNode;\n /** Array of meta data rendered through MetaList component */\n meta?: (ReactElement | string)[];\n articleID: string;\n}\n\nconst defaultProps: Partial<ArticleSummaryProps> = {};\n\nconst ArticleCard = styled(StyledCard)`\n &&& {\n > ${StyledCardHeader}, > ${StyledCardContent}, > ${StyledCardFooter} {\n padding-left: 0;\n padding-right: 0;\n }\n\n > ${StyledCardContent} > ${StyledText} {\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n }\n`;\n\nconst ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps> = (\n props: ArticleSummaryProps\n) => {\n const { header, content, meta, articleID, ...restProps } = props;\n return (\n <ArticleCard as='li' role='article' key={articleID} {...restProps}>\n {header ? <CardHeader>{header}</CardHeader> : null}\n <CardContent>{content}</CardContent>\n {meta && (\n <CardFooter>\n <MetaList items={meta} />\n </CardFooter>\n )}\n </ArticleCard>\n );\n};\n\nArticleSummary.defaultProps = defaultProps;\n\nexport default ArticleSummary;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
export interface SummarySkeletonProps extends BaseProps {
|
|
4
|
+
}
|
|
5
|
+
declare const SummarySkeleton: FunctionComponent<SummarySkeletonProps & ForwardProps>;
|
|
6
|
+
export default SummarySkeleton;
|
|
7
|
+
//# sourceMappingURL=SummarySkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SummarySkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/SummarySkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAIL,SAAS,EACT,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,oBAAqB,SAAQ,SAAS;CAAG;AAE1D,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAwB3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, LineSkeleton, ParagraphSkeleton } from '@pega/cosmos-react-core';
|
|
3
|
+
const SummarySkeleton = (props) => {
|
|
4
|
+
return (_jsxs(Flex, { as: 'li', container: {
|
|
5
|
+
direction: 'column'
|
|
6
|
+
}, ...props, "aria-disabled": 'true', children: [_jsx(LineSkeleton, { variant: 'link', width: 'l' }, void 0), _jsxs(ParagraphSkeleton, { children: [_jsx(LineSkeleton, {}, void 0), _jsx(LineSkeleton, { width: 's' }, void 0)] }, void 0), _jsxs(Flex, { container: { alignItems: 'center' }, children: [_jsx(LineSkeleton, { width: 's' }, void 0), _jsx(LineSkeleton, { width: 's' }, void 0), _jsx(LineSkeleton, { width: 's' }, void 0)] }, void 0)] }, void 0));
|
|
7
|
+
};
|
|
8
|
+
export default SummarySkeleton;
|
|
9
|
+
//# sourceMappingURL=SummarySkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SummarySkeleton.js","sourceRoot":"","sources":["../../../src/components/ArticleList/SummarySkeleton.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,eAAe,GAA2D,CAC9E,KAA2B,EAC3B,EAAE;IACF,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAC,IAAI,EACP,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;SACpB,KACG,KAAK,mBACK,MAAM,aAEpB,KAAC,YAAY,IAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAC,GAAG,WAAG,EACzC,MAAC,iBAAiB,eAChB,KAAC,YAAY,aAAG,EAChB,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,WAAG,YACR,EACpB,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aACvC,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,WAAG,EAC1B,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,WAAG,EAC1B,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,WAAG,YACrB,YACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport {\n Flex,\n LineSkeleton,\n ParagraphSkeleton,\n BaseProps,\n ForwardProps\n} from '@pega/cosmos-react-core';\n\nexport interface SummarySkeletonProps extends BaseProps {}\n\nconst SummarySkeleton: FunctionComponent<SummarySkeletonProps & ForwardProps> = (\n props: SummarySkeletonProps\n) => {\n return (\n <Flex\n as='li'\n container={{\n direction: 'column'\n }}\n {...props}\n aria-disabled='true'\n >\n <LineSkeleton variant='link' width='l' />\n <ParagraphSkeleton>\n <LineSkeleton />\n <LineSkeleton width='s' />\n </ParagraphSkeleton>\n <Flex container={{ alignItems: 'center' }}>\n <LineSkeleton width='s' />\n <LineSkeleton width='s' />\n <LineSkeleton width='s' />\n </Flex>\n </Flex>\n );\n};\n\nexport default SummarySkeleton;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default } from './ArticleList';
|
|
2
|
+
export { ArticleListProps } from './ArticleList';
|
|
3
|
+
export { default as ArticleSummary } from './ArticleSummary';
|
|
4
|
+
export { ArticleSummaryProps } from './ArticleSummary';
|
|
5
|
+
export { default as ArticleListHeader } from './ArticleListHeader';
|
|
6
|
+
export { ArticleListHeaderProps } from './ArticleListHeader';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { default } from './ArticleList';\nexport { ArticleListProps } from './ArticleList';\nexport { default as ArticleSummary } from './ArticleSummary';\nexport { ArticleSummaryProps } from './ArticleSummary';\nexport { default as ArticleListHeader } from './ArticleListHeader';\nexport { ArticleListHeaderProps } from './ArticleListHeader';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { CaseViewProps } from '@pega/cosmos-react-work';
|
|
4
|
+
export interface CSCaseViewProps extends CaseViewProps {
|
|
5
|
+
intelligentGuidance?: JSX.Element;
|
|
6
|
+
}
|
|
7
|
+
declare const CSCaseView: FC<CSCaseViewProps & ForwardProps>;
|
|
8
|
+
export default CSCaseView;
|
|
9
|
+
//# sourceMappingURL=CSCaseView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CSCaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CSCaseView/CSCaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoC,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAY,aAAa,EAAuB,MAAM,yBAAyB,CAAC;AAEvF,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,mBAAmB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACnC;AAUD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,YAAY,CAYlD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { CaseView, StyledSummaryRegion } from '@pega/cosmos-react-work';
|
|
5
|
+
const StyledCSCaseView = styled(CaseView)(({ theme }) => {
|
|
6
|
+
return css `
|
|
7
|
+
${StyledSummaryRegion} {
|
|
8
|
+
padding-block-end: calc(${theme.base.spacing} + 3rem);
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
});
|
|
12
|
+
const CSCaseView = forwardRef(({ intelligentGuidance, ...restProps }, ref) => {
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledCSCaseView, { ...restProps, ref: ref }, void 0), intelligentGuidance] }, void 0));
|
|
14
|
+
});
|
|
15
|
+
export default CSCaseView;
|
|
16
|
+
//# sourceMappingURL=CSCaseView.js.map
|