@pega/cosmos-react-demos 4.0.0-dev.17.1 → 4.0.0-dev.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jsx/cs/Article/Article.mocks.js +4 -4
- package/jsx/cs/Article/Article.mocks.js.map +1 -1
- package/jsx/cs/Article/Article.stories.d.ts +13 -2
- package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
- package/jsx/cs/Article/Article.stories.jsx +167 -92
- package/jsx/cs/Article/Article.stories.jsx.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.mocks.d.ts +129 -10
- package/jsx/cs/ArticleList/ArticleList.mocks.d.ts.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.mocks.js +362 -50
- package/jsx/cs/ArticleList/ArticleList.mocks.js.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.stories.d.ts +10 -2
- package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.stories.jsx +243 -92
- package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
- package/jsx/social/Chat/Chat.mocks.d.ts.map +1 -1
- package/jsx/social/Chat/Chat.mocks.js +5 -0
- package/jsx/social/Chat/Chat.mocks.js.map +1 -1
- package/jsx/social/Chat/Chat.stories.d.ts +5 -1
- package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
- package/jsx/social/Chat/Chat.stories.jsx +23 -10
- package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
- package/lib/cs/Article/Article.mocks.js +4 -4
- package/lib/cs/Article/Article.mocks.js.map +1 -1
- package/lib/cs/Article/Article.stories.d.ts +13 -2
- package/lib/cs/Article/Article.stories.d.ts.map +1 -1
- package/lib/cs/Article/Article.stories.js +168 -53
- package/lib/cs/Article/Article.stories.js.map +1 -1
- package/lib/cs/ArticleList/ArticleList.mocks.d.ts +129 -10
- package/lib/cs/ArticleList/ArticleList.mocks.d.ts.map +1 -1
- package/lib/cs/ArticleList/ArticleList.mocks.js +362 -50
- package/lib/cs/ArticleList/ArticleList.mocks.js.map +1 -1
- package/lib/cs/ArticleList/ArticleList.stories.d.ts +10 -2
- package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
- package/lib/cs/ArticleList/ArticleList.stories.js +245 -70
- package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
- package/lib/social/Chat/Chat.mocks.d.ts.map +1 -1
- package/lib/social/Chat/Chat.mocks.js +5 -0
- package/lib/social/Chat/Chat.mocks.js.map +1 -1
- package/lib/social/Chat/Chat.stories.d.ts +5 -1
- package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
- package/lib/social/Chat/Chat.stories.js +23 -12
- package/lib/social/Chat/Chat.stories.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import {
|
|
4
|
+
import { registerIcon, createUID, HTML } from '@pega/cosmos-react-core';
|
|
4
5
|
import * as openIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';
|
|
5
6
|
import * as starIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star.icon';
|
|
6
7
|
import * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';
|
|
@@ -17,69 +18,183 @@ export default {
|
|
|
17
18
|
layout: 'fullscreen'
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
|
-
export const ArticleStory = () => {
|
|
21
|
+
export const ArticleStory = (args) => {
|
|
22
|
+
const [feedbackStatus, setFeedbackStatus] = useState();
|
|
23
|
+
const [showFeedbackThanks, setShowFeedbackThanks] = useState(false);
|
|
24
|
+
const [loading, setLoading] = useState(true);
|
|
25
|
+
const { showHeader, backButtonText, showPrimaryActions, showSecondaryActions, showFooter, enableFeedback, showTags, showRelatedLinks, showMoreLikeThis, showAttachments } = args;
|
|
21
26
|
const onBackToArticlesClick = (event) => {
|
|
22
27
|
event.preventDefault();
|
|
23
28
|
};
|
|
29
|
+
const onFeedbackClick = button => {
|
|
30
|
+
if (button === 'like') {
|
|
31
|
+
if (feedbackStatus === 'liked') {
|
|
32
|
+
setFeedbackStatus(undefined);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
setFeedbackStatus('liked');
|
|
36
|
+
setShowFeedbackThanks(true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else if (feedbackStatus === 'disliked') {
|
|
40
|
+
setFeedbackStatus(undefined);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setFeedbackStatus('disliked');
|
|
44
|
+
setShowFeedbackThanks(true);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
setLoading(false);
|
|
50
|
+
}, 2000);
|
|
51
|
+
}, []);
|
|
24
52
|
return (_jsx("div", { style: {
|
|
25
|
-
maxWidth: '
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
id: 'f1a'
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
text: 'Filter 2',
|
|
34
|
-
id: 'f2a'
|
|
53
|
+
maxWidth: '25rem'
|
|
54
|
+
}, children: _jsx(Article, { header: showHeader
|
|
55
|
+
? {
|
|
56
|
+
title: 'Knowledge articles',
|
|
57
|
+
icon: 'book-open'
|
|
35
58
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_jsx(Text, { variant: 'secondary', "aria-label": 'published date', children: ArticleMockData.fullArticleContent.meta.publishedDate }),
|
|
42
|
-
_jsxs(Flex, { container: { gap: 2, alignItems: 'center' }, children: [_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Icon, { name: 'thumbs-up-solid' }), _jsxs(Text, { "aria-label": 'likes', children: ["(", ArticleMockData.fullArticleContent.meta.likes, ")"] })] }), _jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Icon, { name: 'thumbs-down-solid' }), _jsxs(Text, { "aria-label": 'dislikes', children: ["(", ArticleMockData.fullArticleContent.meta.disLikes, ")"] })] })] })
|
|
43
|
-
], footer: _jsx(ArticleFooter, { content: _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Text, { children: "Was this helpful ?" }), " ", _jsx(Button, { children: "Yes" }), " ", _jsx(Button, { children: "No" })] }), tags: [
|
|
44
|
-
{
|
|
45
|
-
id: 'Retail banking',
|
|
46
|
-
tagName: '#Retail_banking'
|
|
47
|
-
},
|
|
59
|
+
: undefined, backNavigation: {
|
|
60
|
+
title: backButtonText,
|
|
61
|
+
onClick: onBackToArticlesClick
|
|
62
|
+
}, primaryActions: showPrimaryActions
|
|
63
|
+
? [
|
|
48
64
|
{
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
icon: 'star',
|
|
66
|
+
label: 'Follow',
|
|
67
|
+
id: createUID(),
|
|
68
|
+
onClick: id => {
|
|
69
|
+
action('Follow')(id);
|
|
70
|
+
}
|
|
51
71
|
},
|
|
52
72
|
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
73
|
+
icon: 'open',
|
|
74
|
+
label: 'Open',
|
|
75
|
+
id: createUID(),
|
|
76
|
+
onClick: id => {
|
|
77
|
+
action('Open')(id);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
: undefined, secondaryActions: showSecondaryActions
|
|
82
|
+
? [
|
|
60
83
|
{
|
|
61
|
-
|
|
62
|
-
|
|
84
|
+
text: 'Send in email',
|
|
85
|
+
id: 'action1',
|
|
86
|
+
onClick: action('Action')
|
|
63
87
|
},
|
|
64
88
|
{
|
|
65
|
-
|
|
66
|
-
|
|
89
|
+
text: 'Send in chat',
|
|
90
|
+
id: 'action2',
|
|
91
|
+
onClick: action('Action')
|
|
67
92
|
}
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
text: 'Filter 1',
|
|
77
|
-
id: 'f1a'
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
text: 'Filter 2',
|
|
81
|
-
id: 'f2a'
|
|
93
|
+
]
|
|
94
|
+
: undefined, content: _jsx(HTML, { content: ArticleMockData.fullArticleContent.content }), title: ArticleMockData.fullArticleContent.header, meta: {
|
|
95
|
+
category: ArticleMockData.fullArticleContent.meta.category,
|
|
96
|
+
publishedDate: ArticleMockData.fullArticleContent.meta.publishedDate,
|
|
97
|
+
feedback: {
|
|
98
|
+
likes: ArticleMockData.fullArticleContent.meta.likes,
|
|
99
|
+
dislikes: ArticleMockData.fullArticleContent.meta.disLikes
|
|
82
100
|
}
|
|
83
|
-
|
|
101
|
+
}, footer: showFooter
|
|
102
|
+
? {
|
|
103
|
+
feedback: enableFeedback
|
|
104
|
+
? {
|
|
105
|
+
showThanksMessage: showFeedbackThanks,
|
|
106
|
+
status: feedbackStatus,
|
|
107
|
+
onFeedbackClick
|
|
108
|
+
}
|
|
109
|
+
: undefined,
|
|
110
|
+
tags: showTags
|
|
111
|
+
? {
|
|
112
|
+
list: [
|
|
113
|
+
{
|
|
114
|
+
id: 'Retail banking',
|
|
115
|
+
tagName: '#Retail_banking'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'Billing',
|
|
119
|
+
tagName: '#Billing'
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: '223444',
|
|
123
|
+
tagName: '#CSR_Skills'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: '223446',
|
|
127
|
+
tagName: '#Premium_Customers'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: '223447',
|
|
131
|
+
tagName: '#Rare_Customers'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: '223448',
|
|
135
|
+
tagName: '#Finance_Customers'
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
onTagClick: action('Tag clicked')
|
|
139
|
+
}
|
|
140
|
+
: undefined,
|
|
141
|
+
relatedLinks: showRelatedLinks
|
|
142
|
+
? [
|
|
143
|
+
{ title: 'Retail banking for beginners', href: 'https://pega.com' },
|
|
144
|
+
{ title: 'How to handle premium customers', href: 'https://pega.com' }
|
|
145
|
+
]
|
|
146
|
+
: undefined,
|
|
147
|
+
relatedArticles: showMoreLikeThis
|
|
148
|
+
? [
|
|
149
|
+
{
|
|
150
|
+
title: 'What are the implications of change in billing cycle',
|
|
151
|
+
onClick: action('Related article'),
|
|
152
|
+
id: createUID()
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
title: 'What is the best billing cycle for premium customers',
|
|
156
|
+
onClick: action('Related article'),
|
|
157
|
+
id: createUID()
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
title: 'How to enable automatic bill payment',
|
|
161
|
+
onClick: action('Related article'),
|
|
162
|
+
id: createUID()
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
: undefined,
|
|
166
|
+
attachments: showAttachments
|
|
167
|
+
? [
|
|
168
|
+
{ name: 'Billing cycle FAQ.doc', onDownload: action('On Download') },
|
|
169
|
+
{ name: 'Training video.mp4', onDownload: action('On Download') },
|
|
170
|
+
{ name: 'Terms and conditions.pdf', onDownload: action('On Download') }
|
|
171
|
+
]
|
|
172
|
+
: undefined
|
|
173
|
+
}
|
|
174
|
+
: undefined, loading: loading }) }));
|
|
175
|
+
};
|
|
176
|
+
ArticleStory.args = {
|
|
177
|
+
showHeader: true,
|
|
178
|
+
backButtonText: 'Back to all articles',
|
|
179
|
+
showPrimaryActions: true,
|
|
180
|
+
showSecondaryActions: true,
|
|
181
|
+
showFooter: true,
|
|
182
|
+
enableFeedback: true,
|
|
183
|
+
showTags: true,
|
|
184
|
+
showRelatedLinks: true,
|
|
185
|
+
showMoreLikeThis: true,
|
|
186
|
+
showAttachments: true
|
|
187
|
+
};
|
|
188
|
+
ArticleStory.argTypes = {
|
|
189
|
+
showHeader: { control: { type: 'boolean' } },
|
|
190
|
+
backButtonText: { control: { type: 'text' } },
|
|
191
|
+
showPrimaryActions: { control: { type: 'boolean' } },
|
|
192
|
+
showSecondaryActions: { control: { type: 'boolean' } },
|
|
193
|
+
showFooter: { control: { type: 'boolean' } },
|
|
194
|
+
enableFeedback: { control: { type: 'boolean' } },
|
|
195
|
+
showTags: { control: { type: 'boolean' } },
|
|
196
|
+
showRelatedLinks: { control: { type: 'boolean' } },
|
|
197
|
+
showMoreLikeThis: { control: { type: 'boolean' } },
|
|
198
|
+
showAttachments: { control: { type: 'boolean' } }
|
|
84
199
|
};
|
|
85
200
|
//# sourceMappingURL=Article.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Article.stories.js","sourceRoot":"","sources":["../../../src/cs/Article/Article.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,iBAAiB,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,mBAAmB,MAAM,0EAA0E,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,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gBAAgB,EAAE;gBAChB;oBACE,IAAI,EAAE,UAAU;oBAChB,EAAE,EAAE,KAAK;iBACV;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,EAAE,EAAE,KAAK;iBACV;aACF,GACD,GACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { MouseEvent } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Meta, Story } from '@storybook/react';\n\nimport { Button, Flex, Icon, registerIcon, Link, Text } from '@pega/cosmos-react-core';\nimport * as openIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';\nimport * as starIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport * as thumbsUpSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/thumbs-up-solid.icon';\nimport * as thumbsDownSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/thumbs-down-solid.icon';\nimport { Article, ArticleFooter } from '@pega/cosmos-react-cs';\n\nimport { ArticleMockData } from './Article.mocks';\n\nregisterIcon(openIcon, starIcon, caretLeftIcon, thumbsUpSolidIcon, thumbsDownSolidIcon);\n\nexport default {\n title: 'Customer Service/Article',\n component: Article,\n subcomponents: { ArticleFooter },\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\nexport const ArticleStory: Story = () => {\n const onBackToArticlesClick = (event: MouseEvent) => {\n event.preventDefault();\n };\n\n return (\n <div\n style={{\n maxWidth: '31.25rem',\n maxHeight: '100vh'\n }}\n >\n <Article\n navigation={\n <Link href='/' onClick={onBackToArticlesClick}>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Icon name='caret-left' />\n <Text>Back to all articles</Text>\n </Flex>\n </Link>\n }\n primaryActions={\n <>\n <Button aria-label='star' variant='simple' icon>\n <Icon name='star' />\n </Button>\n <Button aria-label='open' variant='simple' icon>\n <Icon name='open' />\n </Button>\n </>\n }\n secondaryActions={[\n {\n text: 'Filter 1',\n id: 'f1a'\n },\n {\n text: 'Filter 2',\n id: 'f2a'\n }\n ]}\n content={\n // TODO : Container components need to ensure that html being sent to the __html below needs to be free from XSS attack\n // eslint-disable-next-line react/no-danger\n <div dangerouslySetInnerHTML={{ __html: ArticleMockData.fullArticleContent.content }} />\n }\n skeletonize={false}\n title={ArticleMockData.fullArticleContent.header}\n meta={[\n <Text variant='secondary' aria-label='category'>\n {ArticleMockData.fullArticleContent.meta.category}\n </Text>,\n <Text variant='secondary' aria-label='published date'>\n {ArticleMockData.fullArticleContent.meta.publishedDate}\n </Text>,\n <Flex container={{ gap: 2, alignItems: 'center' }}>\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Icon name='thumbs-up-solid' />\n <Text aria-label='likes'>({ArticleMockData.fullArticleContent.meta.likes})</Text>\n </Flex>\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Icon name='thumbs-down-solid' />\n <Text aria-label='dislikes'>\n ({ArticleMockData.fullArticleContent.meta.disLikes})\n </Text>\n </Flex>\n </Flex>\n ]}\n footer={\n <ArticleFooter\n content={\n <Flex container={{ gap: 1 }}>\n <Text>Was this helpful ?</Text> <Button>Yes</Button> <Button>No</Button>\n </Flex>\n }\n tags={[\n {\n id: 'Retail banking',\n tagName: '#Retail_banking'\n },\n {\n id: 'difficult_customers',\n tagName: '#Difficult_customers'\n },\n {\n id: '223444',\n tagName: '#CSR_Skills'\n },\n {\n id: '223446',\n tagName: '#Premium_Customers'\n },\n {\n id: '223447',\n tagName: '#Rare_Customers'\n },\n {\n id: '223448',\n tagName: '#Finance_Customers'\n }\n ]}\n onTagClick={action('Tag clicked')}\n />\n }\n />\n </div>\n );\n};\n\nexport const ArticleStorySkeletonize: Story = () => {\n const onBackToArticlesClick = (event: MouseEvent) => {\n event.preventDefault();\n };\n\n return (\n <div style={{ maxWidth: '31.25rem', maxHeight: '100vh' }}>\n <Article\n skeletonize\n navigation={\n <Link href='/' onClick={onBackToArticlesClick}>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Icon name='caret-left' />\n <Text>Back to articles</Text>\n </Flex>\n </Link>\n }\n primaryActions={\n <>\n <Button variant='simple' icon>\n <Icon name='star' />\n </Button>\n <Button variant='simple' icon>\n <Icon name='open' />\n </Button>\n </>\n }\n secondaryActions={[\n {\n text: 'Filter 1',\n id: 'f1a'\n },\n {\n text: 'Filter 2',\n id: 'f2a'\n }\n ]}\n />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Article.stories.js","sourceRoot":"","sources":["../../../src/cs/Article/Article.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,iBAAiB,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,mBAAmB,MAAM,0EAA0E,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AAExF,eAAe;IACb,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,OAAO;IAClB,aAAa,EAAE,EAAE,aAAa,EAAE;IAChC,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACM,CAAC;AAeV,MAAM,CAAC,MAAM,YAAY,GAA4B,CAAC,IAAsB,EAAE,EAAE;IAC9E,MA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;IACpD,oBAAoB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACtD,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC5C,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAChD,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC1C,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAClD,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAClD,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CAClD,CAAC","sourcesContent":["import { MouseEvent, useEffect, useState } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Meta, Story } from '@storybook/react';\n\nimport { registerIcon, createUID, HTML } from '@pega/cosmos-react-core';\nimport * as openIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';\nimport * as starIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport * as thumbsUpSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/thumbs-up-solid.icon';\nimport * as thumbsDownSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/thumbs-down-solid.icon';\nimport { Article, ArticleFooter, ArticleFooterProps } from '@pega/cosmos-react-cs';\n\nimport { ArticleMockData } from './Article.mocks';\n\nregisterIcon(openIcon, starIcon, caretLeftIcon, thumbsUpSolidIcon, thumbsDownSolidIcon);\n\nexport default {\n title: 'Customer Service/Article',\n component: Article,\n subcomponents: { ArticleFooter },\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\nexport interface ArticleDemoProps {\n showHeader: boolean;\n backButtonText: string;\n showPrimaryActions: boolean;\n showSecondaryActions: boolean;\n showFooter: boolean;\n enableFeedback: boolean;\n showTags: boolean;\n showRelatedLinks: boolean;\n showMoreLikeThis: boolean;\n showAttachments: boolean;\n}\n\nexport const ArticleStory: Story<ArticleDemoProps> = (args: ArticleDemoProps) => {\n const [feedbackStatus, setFeedbackStatus] =\n useState<Required<ArticleFooterProps>['feedback']['status']>();\n const [showFeedbackThanks, setShowFeedbackThanks] = useState<boolean>(false);\n const [loading, setLoading] = useState<boolean>(true);\n\n const {\n showHeader,\n backButtonText,\n showPrimaryActions,\n showSecondaryActions,\n showFooter,\n enableFeedback,\n showTags,\n showRelatedLinks,\n showMoreLikeThis,\n showAttachments\n } = args;\n\n const onBackToArticlesClick = (event: MouseEvent) => {\n event.preventDefault();\n };\n\n const onFeedbackClick: Required<ArticleFooterProps>['feedback']['onFeedbackClick'] = button => {\n if (button === 'like') {\n if (feedbackStatus === 'liked') {\n setFeedbackStatus(undefined);\n } else {\n setFeedbackStatus('liked');\n setShowFeedbackThanks(true);\n }\n } else if (feedbackStatus === 'disliked') {\n setFeedbackStatus(undefined);\n } else {\n setFeedbackStatus('disliked');\n setShowFeedbackThanks(true);\n }\n };\n\n useEffect(() => {\n setTimeout(() => {\n setLoading(false);\n }, 2000);\n }, []);\n\n return (\n <div\n style={{\n maxWidth: '25rem'\n }}\n >\n <Article\n header={\n showHeader\n ? {\n title: 'Knowledge articles',\n icon: 'book-open'\n }\n : undefined\n }\n backNavigation={{\n title: backButtonText,\n onClick: onBackToArticlesClick\n }}\n primaryActions={\n showPrimaryActions\n ? [\n {\n icon: 'star',\n label: 'Follow',\n id: createUID(),\n onClick: id => {\n action('Follow')(id);\n }\n },\n {\n icon: 'open',\n label: 'Open',\n id: createUID(),\n onClick: id => {\n action('Open')(id);\n }\n }\n ]\n : undefined\n }\n secondaryActions={\n showSecondaryActions\n ? [\n {\n text: 'Send in email',\n id: 'action1',\n onClick: action('Action')\n },\n {\n text: 'Send in chat',\n id: 'action2',\n onClick: action('Action')\n }\n ]\n : undefined\n }\n content={<HTML content={ArticleMockData.fullArticleContent.content} />}\n title={ArticleMockData.fullArticleContent.header}\n meta={{\n category: ArticleMockData.fullArticleContent.meta.category,\n publishedDate: ArticleMockData.fullArticleContent.meta.publishedDate,\n feedback: {\n likes: ArticleMockData.fullArticleContent.meta.likes,\n dislikes: ArticleMockData.fullArticleContent.meta.disLikes\n }\n }}\n footer={\n showFooter\n ? {\n feedback: enableFeedback\n ? {\n showThanksMessage: showFeedbackThanks,\n status: feedbackStatus,\n onFeedbackClick\n }\n : undefined,\n tags: showTags\n ? {\n list: [\n {\n id: 'Retail banking',\n tagName: '#Retail_banking'\n },\n {\n id: 'Billing',\n tagName: '#Billing'\n },\n {\n id: '223444',\n tagName: '#CSR_Skills'\n },\n {\n id: '223446',\n tagName: '#Premium_Customers'\n },\n {\n id: '223447',\n tagName: '#Rare_Customers'\n },\n {\n id: '223448',\n tagName: '#Finance_Customers'\n }\n ],\n onTagClick: action('Tag clicked')\n }\n : undefined,\n relatedLinks: showRelatedLinks\n ? [\n { title: 'Retail banking for beginners', href: 'https://pega.com' },\n { title: 'How to handle premium customers', href: 'https://pega.com' }\n ]\n : undefined,\n relatedArticles: showMoreLikeThis\n ? [\n {\n title: 'What are the implications of change in billing cycle',\n onClick: action('Related article'),\n id: createUID()\n },\n {\n title: 'What is the best billing cycle for premium customers',\n onClick: action('Related article'),\n id: createUID()\n },\n {\n title: 'How to enable automatic bill payment',\n onClick: action('Related article'),\n id: createUID()\n }\n ]\n : undefined,\n attachments: showAttachments\n ? [\n { name: 'Billing cycle FAQ.doc', onDownload: action('On Download') },\n { name: 'Training video.mp4', onDownload: action('On Download') },\n { name: 'Terms and conditions.pdf', onDownload: action('On Download') }\n ]\n : undefined\n }\n : undefined\n }\n loading={loading}\n />\n </div>\n );\n};\n\nArticleStory.args = {\n showHeader: true,\n backButtonText: 'Back to all articles',\n showPrimaryActions: true,\n showSecondaryActions: true,\n showFooter: true,\n enableFeedback: true,\n showTags: true,\n showRelatedLinks: true,\n showMoreLikeThis: true,\n showAttachments: true\n};\n\nArticleStory.argTypes = {\n showHeader: { control: { type: 'boolean' } },\n backButtonText: { control: { type: 'text' } },\n showPrimaryActions: { control: { type: 'boolean' } },\n showSecondaryActions: { control: { type: 'boolean' } },\n showFooter: { control: { type: 'boolean' } },\n enableFeedback: { control: { type: 'boolean' } },\n showTags: { control: { type: 'boolean' } },\n showRelatedLinks: { control: { type: 'boolean' } },\n showMoreLikeThis: { control: { type: 'boolean' } },\n showAttachments: { control: { type: 'boolean' } }\n};\n"]}
|
|
@@ -1,21 +1,140 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
1
|
+
export declare const suggestedMock: {
|
|
2
|
+
count: number;
|
|
3
|
+
articles: ({
|
|
3
4
|
articleId: string;
|
|
4
|
-
|
|
5
|
+
title: string;
|
|
6
|
+
href: string;
|
|
5
7
|
abstract: string;
|
|
6
8
|
meta: {
|
|
7
9
|
category: string;
|
|
8
10
|
publishedDate: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
feedback: {
|
|
12
|
+
likes: number;
|
|
13
|
+
dislikes: number;
|
|
14
|
+
};
|
|
11
15
|
};
|
|
16
|
+
isFollowed: boolean;
|
|
17
|
+
isLiked: boolean;
|
|
18
|
+
quickFilters?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
articleId: string;
|
|
21
|
+
title: string;
|
|
22
|
+
href: string;
|
|
23
|
+
abstract: string;
|
|
24
|
+
meta: {
|
|
25
|
+
category: string;
|
|
26
|
+
publishedDate: string;
|
|
27
|
+
feedback: {
|
|
28
|
+
likes: number;
|
|
29
|
+
dislikes: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
isFollowed: boolean;
|
|
33
|
+
isLiked: boolean;
|
|
34
|
+
quickFilters: {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}[];
|
|
38
|
+
})[];
|
|
39
|
+
};
|
|
40
|
+
export declare const followedMock: {
|
|
41
|
+
count: number;
|
|
42
|
+
articles: ({
|
|
43
|
+
articleId: string;
|
|
44
|
+
title: string;
|
|
45
|
+
href: string;
|
|
46
|
+
abstract: string;
|
|
47
|
+
meta: {
|
|
48
|
+
category: string;
|
|
49
|
+
publishedDate: string;
|
|
50
|
+
feedback: {
|
|
51
|
+
likes: number;
|
|
52
|
+
dislikes: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
isFollowed: boolean;
|
|
56
|
+
isLiked: boolean;
|
|
57
|
+
quickFilters: {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
}[];
|
|
61
|
+
} | {
|
|
62
|
+
articleId: string;
|
|
63
|
+
title: string;
|
|
64
|
+
href: string;
|
|
65
|
+
abstract: string;
|
|
66
|
+
meta: {
|
|
67
|
+
category: string;
|
|
68
|
+
publishedDate: string;
|
|
69
|
+
feedback: {
|
|
70
|
+
likes: number;
|
|
71
|
+
dislikes: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
isFollowed: boolean;
|
|
75
|
+
isLiked: boolean;
|
|
76
|
+
quickFilters?: undefined;
|
|
77
|
+
})[];
|
|
78
|
+
category: ({
|
|
79
|
+
id: string;
|
|
80
|
+
primary: string;
|
|
81
|
+
secondary: string[];
|
|
82
|
+
items: {
|
|
83
|
+
id: string;
|
|
84
|
+
primary: string;
|
|
85
|
+
secondary: string[];
|
|
86
|
+
}[];
|
|
87
|
+
} | {
|
|
88
|
+
id: string;
|
|
89
|
+
primary: string;
|
|
90
|
+
secondary: string[];
|
|
91
|
+
items?: undefined;
|
|
92
|
+
})[];
|
|
93
|
+
sortBy: {
|
|
94
|
+
id: string;
|
|
95
|
+
primary: string;
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
98
|
+
export declare const searchMock: {
|
|
99
|
+
count: number;
|
|
100
|
+
articles: {
|
|
101
|
+
articleId: string;
|
|
102
|
+
title: string;
|
|
103
|
+
href: string;
|
|
104
|
+
abstract: string;
|
|
105
|
+
meta: {
|
|
106
|
+
category: string;
|
|
107
|
+
publishedDate: string;
|
|
108
|
+
feedback: {
|
|
109
|
+
likes: number;
|
|
110
|
+
dislikes: number;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
isFollowed: boolean;
|
|
114
|
+
isLiked: boolean;
|
|
115
|
+
quickFilters: {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
}[];
|
|
12
119
|
}[];
|
|
13
|
-
|
|
120
|
+
category: ({
|
|
121
|
+
id: string;
|
|
122
|
+
primary: string;
|
|
123
|
+
secondary: string[];
|
|
124
|
+
items: {
|
|
125
|
+
id: string;
|
|
126
|
+
primary: string;
|
|
127
|
+
secondary: string[];
|
|
128
|
+
}[];
|
|
129
|
+
} | {
|
|
130
|
+
id: string;
|
|
131
|
+
primary: string;
|
|
132
|
+
secondary: string[];
|
|
133
|
+
items?: undefined;
|
|
134
|
+
})[];
|
|
135
|
+
sortBy: {
|
|
14
136
|
id: string;
|
|
15
|
-
|
|
16
|
-
level: string;
|
|
17
|
-
category: string;
|
|
137
|
+
primary: string;
|
|
18
138
|
}[];
|
|
19
|
-
sortByOptions: string[];
|
|
20
139
|
};
|
|
21
140
|
//# sourceMappingURL=ArticleList.mocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleList.mocks.d.ts","sourceRoot":"","sources":["../../../src/cs/ArticleList/ArticleList.mocks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"ArticleList.mocks.d.ts","sourceRoot":"","sources":["../../../src/cs/ArticleList/ArticleList.mocks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwJzB,CAAC;AACF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHtB,CAAC"}
|