Skip to content

Commit dba0d76

Browse files
Merge pull request #846 from thatblindgeye/iss815
fix(ChatbotFootnote): updated verbiage and combined examples
2 parents d12a7f8 + 4760af5 commit dba0d76

14 files changed

Lines changed: 55 additions & 190 deletions

packages/module/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const ChatbotFooterExample: FunctionComponent = () => {
88
return (
99
<ChatbotFooter>
1010
<MessageBar onSendMessage={handleSend} hasMicrophoneButton hasAttachButton />
11-
<ChatbotFootnote label="ChatBot uses AI. Check for mistakes." />
11+
<ChatbotFootnote label="Always review AI-generated content prior to use." />
1212
</ChatbotFooter>
1313
);
1414
};

packages/module/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@ import { FunctionComponent } from 'react';
22
import { ChatbotFootnote } from '@patternfly/chatbot/dist/dynamic/ChatbotFooter';
33

44
export const FootnoteDemo: FunctionComponent = () => (
5-
<ChatbotFootnote
6-
label="ChatBot uses AI. Check for mistakes."
7-
popover={{
8-
title: 'Verify information',
9-
description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
10-
bannerImage: {
11-
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
12-
alt: 'Example image for footnote popover'
13-
},
14-
cta: {
15-
label: 'Dismiss',
16-
onClick: () => {
17-
alert('Do something!');
5+
<>
6+
<h4>Static text</h4>
7+
<ChatbotFootnote label="Always review AI-generated content prior to use." />
8+
<br />
9+
<h4>With popover</h4>
10+
<ChatbotFootnote
11+
label="Always review AI-generated content prior to use."
12+
popover={{
13+
title: 'Verify information',
14+
description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
15+
bannerImage: {
16+
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
17+
alt: 'Example image for footnote popover'
18+
},
19+
cta: {
20+
label: 'Dismiss',
21+
onClick: () => {
22+
alert('Do something!');
23+
}
24+
},
25+
link: {
26+
label: 'View AI policy',
27+
url: 'https://www.redhat.com/'
1828
}
19-
},
20-
link: {
21-
label: 'View AI policy',
22-
url: 'https://www.redhat.com/'
23-
}
24-
}}
25-
/>
29+
}}
30+
/>
31+
</>
2632
);

packages/module/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,11 @@ In this example, select the respective checkbox to toggle these features:
240240

241241
## Footer
242242

243-
### Footnote with popover
243+
### Footnote
244244

245-
A footnote can be placed in the ChatBot footer to communicate any legal disclaimers or information about the ChatBot.
246-
Footnotes can be static text or a button that opens a popover.
245+
A `<ChatbotFootnote>` can be placed in the ChatBot footer to communicate any legal disclaimers or information about the ChatBot.
246+
247+
To create a static text footnote, pass the `label` property. To create a footnote button that triggers a popover, pass in both the `label` and `popover` properties.
247248

248249
```js file="./ChatbotFootnote.tsx"
249250

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,7 @@ import '@patternfly/react-core/dist/styles/base.css';
3737
import '@patternfly/chatbot/dist/css/main.css';
3838

3939
const footnoteProps = {
40-
label: 'ChatBot uses AI. Check for mistakes.',
41-
popover: {
42-
title: 'Verify information',
43-
description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
44-
bannerImage: {
45-
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
46-
alt: 'Example image for footnote popover'
47-
},
48-
cta: {
49-
label: 'Dismiss',
50-
onClick: () => {
51-
alert('Do something!');
52-
}
53-
},
54-
link: {
55-
label: 'View AI policy',
56-
url: 'https://www.redhat.com/'
57-
}
58-
}
40+
label: 'Always review AI-generated content prior to use.'
5941
};
6042

6143
const markdown = `A paragraph with *emphasis* and **strong importance**.

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export const BasicDemo: FunctionComponent = () => {
273273
}}
274274
onAttachRejected={handleAttachRejected}
275275
/>
276-
<ChatbotFootnote label="ChatBot uses AI. Check for mistakes." />
276+
<ChatbotFootnote label="Always review AI-generated content prior to use." />
277277
</ChatbotFooter>
278278
</FileDropZone>
279279
</Chatbot>

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export const AttachmentMenuDemo: FunctionComponent = () => {
262262
onAttachMenuToggleClick: onToggleClick
263263
}}
264264
/>
265-
<ChatbotFootnote label="ChatBot uses AI. Check for mistakes." />
265+
<ChatbotFootnote label="Always review AI-generated content prior to use." />
266266
</ChatbotFooter>
267267
</>
268268
</FileDropZone>

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,7 @@ import userAvatar from '../Messages/user_avatar.svg';
3333
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
3434

3535
const footnoteProps = {
36-
label: 'ChatBot uses AI. Check for mistakes.',
37-
popover: {
38-
title: 'Verify information',
39-
description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
40-
bannerImage: {
41-
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
42-
alt: 'Example image for footnote popover'
43-
},
44-
cta: {
45-
label: 'Dismiss',
46-
onClick: () => {
47-
alert('Do something!');
48-
}
49-
},
50-
link: {
51-
label: 'View AI policy',
52-
url: 'https://www.redhat.com/'
53-
}
54-
}
36+
label: 'Always review AI-generated content prior to use.'
5537
};
5638

5739
const markdown = `A paragraph with *emphasis* and **strong importance**.

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotDisplayMode.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,7 @@ import '@patternfly/react-core/dist/styles/base.css';
5353
import '@patternfly/chatbot/dist/css/main.css';
5454

5555
const footnoteProps = {
56-
label: 'ChatBot uses AI. Check for mistakes.',
57-
popover: {
58-
title: 'Verify accuracy',
59-
description: `While ChatBot strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,
60-
bannerImage: {
61-
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
62-
alt: 'Example image for footnote popover'
63-
},
64-
cta: {
65-
label: 'Got it',
66-
onClick: () => {
67-
alert('Do something!');
68-
}
69-
},
70-
link: {
71-
label: 'Learn more',
72-
url: 'https://www.redhat.com/'
73-
}
74-
}
56+
label: 'Always review AI-generated content prior to use.'
7557
};
7658

7759
const markdown = `A paragraph with *emphasis* and **strong importance**.`;

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,7 @@ import '@patternfly/react-core/dist/styles/base.css';
4646
import '@patternfly/chatbot/dist/css/main.css';
4747

4848
const footnoteProps = {
49-
label: 'ChatBot uses AI. Check for mistakes.',
50-
popover: {
51-
title: 'Verify accuracy',
52-
description: `While ChatBot strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,
53-
bannerImage: {
54-
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
55-
alt: 'Example image for footnote popover'
56-
},
57-
cta: {
58-
label: 'Got it',
59-
onClick: () => {
60-
alert('Do something!');
61-
}
62-
},
63-
link: {
64-
label: 'Learn more',
65-
url: 'https://www.redhat.com/'
66-
}
67-
}
49+
label: 'Always review AI-generated content prior to use.'
6850
};
6951

7052
const markdown = `A paragraph with *emphasis* and **strong importance**.

packages/module/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotScrolling.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,7 @@ import '@patternfly/react-core/dist/styles/base.css';
3636
import '@patternfly/chatbot/dist/css/main.css';
3737

3838
const footnoteProps = {
39-
label: 'ChatBot uses AI. Check for mistakes.',
40-
popover: {
41-
title: 'Verify information',
42-
description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
43-
bannerImage: {
44-
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
45-
alt: 'Example image for footnote popover'
46-
},
47-
cta: {
48-
label: 'Dismiss',
49-
onClick: () => {
50-
alert('Do something!');
51-
}
52-
},
53-
link: {
54-
label: 'View AI policy',
55-
url: 'https://www.redhat.com/'
56-
}
57-
}
39+
label: 'Always review AI-generated content prior to use.'
5840
};
5941

6042
const markdown = `A paragraph with *emphasis* and **strong importance**.

0 commit comments

Comments
 (0)