|
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | 4 | import { RichTextSendBox as RichTextSendBoxComponent } from '@internal/react-components'; |
5 | | -import { Title, Description, Props, Heading, Canvas } from '@storybook/addon-docs'; |
| 5 | +import { Title, Description, Props, Heading, Canvas, Source } from '@storybook/addon-docs'; |
6 | 6 | import { Meta } from '@storybook/react/types-6-0'; |
7 | 7 | import React from 'react'; |
8 | 8 | import { DetailedBetaBanner } from '../../BetaBanners/DetailedBetaBanner'; |
9 | 9 | import { COMPONENT_FOLDER_PREFIX } from '../../constants'; |
10 | 10 | import { hiddenControl } from '../../controlsUtils'; |
| 11 | +import { RichTextSendBoxExample } from './snippets/RichTextSendBox.snippet'; |
11 | 12 | import { RichTextSendBoxAttachmentUploadsExample } from './snippets/RichTextSendBoxAttachmentUploads.snippet'; |
| 13 | +import { RichTextSendBoxWithSystemMessageExample } from './snippets/RichTextSendBoxWithSystemMessage.snippet'; |
12 | 14 |
|
| 15 | +const RichTextSendBoxExampleText = require('!!raw-loader!./snippets/RichTextSendBox.snippet.tsx').default; |
13 | 16 | const RichTextSendBoxAttachmentUploadsExampleText = |
14 | 17 | require('!!raw-loader!./snippets/RichTextSendBoxAttachmentUploads.snippet.tsx').default; |
| 18 | +const RichTextSendBoxWithSystemMessageExampleText = |
| 19 | + require('!!raw-loader!./snippets/RichTextSendBoxWithSystemMessage.snippet.tsx').default; |
| 20 | + |
| 21 | +const importStatement = `import { RichTextSendBox } from '@azure/communication-react';`; |
15 | 22 |
|
16 | 23 | const getDocs: () => JSX.Element = () => { |
17 | 24 | return ( |
18 | 25 | <> |
19 | 26 | <Title>RichTextSendBox</Title> |
20 | | - <Description> |
21 | | - Component for typing and sending messages. RichTextSendBox has a callback for sending typing notification when |
22 | | - user starts entering text. It also supports an optional message below the text input field. |
23 | | - </Description> |
| 27 | + <Description>Component for composing messages with rich text formatting.</Description> |
| 28 | + |
| 29 | + <Heading>Importing</Heading> |
| 30 | + <Source code={importStatement} /> |
| 31 | + |
| 32 | + <Heading>Example</Heading> |
| 33 | + <Canvas mdxSource={RichTextSendBoxExampleText}> |
| 34 | + <RichTextSendBoxExample /> |
| 35 | + </Canvas> |
| 36 | + |
| 37 | + <Heading>Add a system message</Heading> |
| 38 | + <Description>To add a system message, use the systemMessage property like in the example below.</Description> |
| 39 | + <Canvas mdxSource={RichTextSendBoxWithSystemMessageExampleText}> |
| 40 | + <RichTextSendBoxWithSystemMessageExample /> |
| 41 | + </Canvas> |
24 | 42 |
|
25 | 43 | <Heading>Display File Uploads</Heading> |
26 | 44 | <DetailedBetaBanner /> |
|
0 commit comments