reachat 0.0.1 → 1.0.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/README.md +84 -39
- package/dist/{Sessions.d.ts → Chat.d.ts} +23 -17
- package/dist/ChatContext.d.ts +16 -0
- package/dist/ChatInput.d.ts +42 -0
- package/dist/Markdown/CodeHighlighter.d.ts +9 -0
- package/dist/Markdown/Markdown.d.ts +11 -0
- package/dist/Markdown/Table.d.ts +5 -0
- package/dist/Markdown/index.d.ts +4 -0
- package/dist/Markdown/plugins/index.d.ts +1 -0
- package/dist/Markdown/plugins/remarkCve.d.ts +1 -0
- package/dist/SessionMessages/MessageActions.d.ts +45 -0
- package/dist/SessionMessages/MessageFile.d.ts +14 -0
- package/dist/SessionMessages/MessageFiles.d.ts +11 -0
- package/dist/SessionMessages/MessageQuestion.d.ts +9 -0
- package/dist/SessionMessages/MessageResponse.d.ts +13 -0
- package/dist/SessionMessages/MessageSource.d.ts +10 -0
- package/dist/SessionMessages/MessageSources.d.ts +11 -0
- package/dist/SessionMessages/SessionEmpty.d.ts +6 -0
- package/dist/SessionMessages/SessionMessage.d.ts +15 -0
- package/dist/SessionMessages/SessionMessagePanel.d.ts +3 -0
- package/dist/SessionMessages/SessionMessages.d.ts +23 -0
- package/dist/SessionMessages/SessionMessagesHeader.d.ts +3 -0
- package/dist/SessionMessages/index.d.ts +12 -0
- package/dist/SessionsList/NewSessionButton.d.ts +10 -0
- package/dist/SessionsList/SessionGroups.d.ts +10 -0
- package/dist/SessionsList/SessionListItem.d.ts +22 -0
- package/dist/SessionsList/SessionsGroup.d.ts +10 -0
- package/dist/SessionsList/SessionsList.d.ts +3 -0
- package/dist/SessionsList/index.d.ts +5 -0
- package/dist/docs.json +1379 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +758 -131
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +737 -120
- package/dist/index.umd.cjs.map +1 -1
- package/dist/theme.d.ts +70 -1
- package/dist/types.d.ts +71 -17
- package/dist/utils.d.ts +7 -0
- package/dist/utils.spec.d.ts +1 -0
- package/package.json +31 -19
- package/dist/SessionInput.d.ts +0 -22
- package/dist/SessionListItem.d.ts +0 -11
- package/dist/SessionMessage.d.ts +0 -10
- package/dist/SessionMessages.d.ts +0 -9
- package/dist/SessionsList.d.ts +0 -11
- package/dist/useLlm.d.ts +0 -3
package/README.md
CHANGED
|
@@ -1,41 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img width="650" src=".storybook/logo.png">
|
|
3
|
+
<br />
|
|
4
|
+
Building Blocks for LLM UI
|
|
5
|
+
<br /><br />
|
|
6
|
+
<a href="https://github.com/reaviz/reachat/actions/workflows/build.yml">
|
|
7
|
+
<img src="https://github.com/reaviz/reachat/actions/workflows/build.yml/badge.svg" />
|
|
8
|
+
</a>
|
|
9
|
+
|
|
10
|
+
<a href="https://npm.im/reachat" target="_blank">
|
|
11
|
+
<img src="https://img.shields.io/npm/v/reachat.svg" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://npm.im/reachat" target="_blank">
|
|
14
|
+
<img src="https://badgen.net/npm/dw/reachat" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://github.com/reaviz/reachat/blob/master/LICENSE">
|
|
17
|
+
<img src="https://badgen.now.sh/badge/license/apache2" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/reaviz/reachat">
|
|
20
|
+
<img alt="GitHub stars" src="https://img.shields.io/github/stars/reaviz/reachat?style=social" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://discord.gg/tt8wGExq35" target="_blank">
|
|
23
|
+
<img src="https://img.shields.io/discord/773948315037073409?label=discord" />
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
reachat is a UI library for building chat experiences. No more manually coding
|
|
30
|
+
all the components required to build LLM uis manually. Customize each component and
|
|
31
|
+
theme via Tailwind.
|
|
32
|
+
|
|
33
|
+
## 🚀 Quick Links
|
|
34
|
+
- Checkout the [docs and demos](https://reachat.dev)
|
|
35
|
+
- Checkout the [storybook demos](https://storybook.reachat.dev)
|
|
36
|
+
- Learn about updates from the [changelog](CHANGELOG.md)
|
|
37
|
+
|
|
38
|
+
## 💎 Other Projects
|
|
39
|
+
|
|
40
|
+
- [Reaflow](https://reaflow.dev?utm=reagraph) - Open-source library for workflow and diagram graphs.
|
|
41
|
+
- [Reablocks](https://reablocks.dev?utm=reagraph) - Open-source component library for React based on Tailwind.
|
|
42
|
+
- [Reaviz](https://reaviz.dev?utm=reagraph) - Open-source library for data visualizations for React.
|
|
43
|
+
- [Reagraph](https://reagraph.dev?utm=reaviz) - Open-source library for large webgl based network graphs.
|
|
44
|
+
|
|
45
|
+
## 🪄 Features
|
|
46
|
+
- Markdown Rendering
|
|
47
|
+
- GFM Styling
|
|
48
|
+
- Code Highlighting
|
|
49
|
+
- Tables
|
|
50
|
+
- JSON
|
|
51
|
+
- Lists
|
|
52
|
+
- Embeds ( Youtube )
|
|
53
|
+
- remark plugin support
|
|
54
|
+
- File Uploads
|
|
55
|
+
- Message Sources
|
|
56
|
+
- Animations
|
|
57
|
+
- Conversation Pagination
|
|
58
|
+
- Smart/Dynamic Grouping of Sessions
|
|
14
59
|
- Keyboard shortcuts
|
|
60
|
+
- Animations via Framer Motion
|
|
15
61
|
- Tailwind for Themeing
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- https://github.com/shinomakoi/AI-Messenger - Supports EXLv2 and LLava
|
|
62
|
+
- Customizable via Slots
|
|
63
|
+
|
|
64
|
+
## 📦 Install
|
|
65
|
+
|
|
66
|
+
To use reachat in your project, install it via npm/yarn:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
npm i reachat --save
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 🔭 Development
|
|
73
|
+
|
|
74
|
+
If you want to run reachat locally, its super easy!
|
|
75
|
+
|
|
76
|
+
- Clone the repository
|
|
77
|
+
- `npm i`
|
|
78
|
+
- `npm start`
|
|
79
|
+
- Browser opens to Storybook page
|
|
80
|
+
|
|
81
|
+
## ❤️ Contributors & Credits
|
|
82
|
+
|
|
83
|
+
Thanks to all our contributors!
|
|
84
|
+
|
|
85
|
+
<a href="https://github.com/reaviz/reaviz/graphs/contributors"><img src="https://opencollective.com/reaviz/contributors.svg?width=890" /></a>
|
|
86
|
+
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { CSSProperties, FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { Session } from './types';
|
|
3
|
+
import { ChatTheme } from './theme';
|
|
4
|
+
import { PluggableList } from 'react-markdown/lib';
|
|
3
5
|
|
|
4
|
-
export interface
|
|
6
|
+
export interface ChatProps extends PropsWithChildren {
|
|
7
|
+
/**
|
|
8
|
+
* The style to apply to the root element.
|
|
9
|
+
*/
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* The class name to apply to the root element.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
5
15
|
/**
|
|
6
16
|
* The type of prompt to display. Companion prompts are smaller and are
|
|
7
17
|
* meant to be displayed alongside other content. Full prompts are larger
|
|
8
18
|
* and are meant to be displayed on their own.
|
|
9
19
|
*/
|
|
10
|
-
viewType
|
|
20
|
+
viewType?: 'companion' | 'console';
|
|
11
21
|
/**
|
|
12
22
|
* The list of sessions to display.
|
|
13
23
|
*/
|
|
@@ -17,17 +27,17 @@ export interface SessionsProps {
|
|
|
17
27
|
*/
|
|
18
28
|
activeSessionId?: string;
|
|
19
29
|
/**
|
|
20
|
-
*
|
|
30
|
+
* Custom theme for the chat.
|
|
21
31
|
*/
|
|
22
|
-
|
|
32
|
+
theme?: ChatTheme;
|
|
23
33
|
/**
|
|
24
|
-
*
|
|
34
|
+
* Remark plugins to apply to the request/response.
|
|
25
35
|
*/
|
|
26
|
-
|
|
36
|
+
remarkPlugins?: PluggableList[];
|
|
27
37
|
/**
|
|
28
|
-
*
|
|
38
|
+
* Whether to display a loading state.
|
|
29
39
|
*/
|
|
30
|
-
|
|
40
|
+
isLoading?: boolean;
|
|
31
41
|
/**
|
|
32
42
|
* Callback function to handle when a session is selected.
|
|
33
43
|
*/
|
|
@@ -37,12 +47,8 @@ export interface SessionsProps {
|
|
|
37
47
|
*/
|
|
38
48
|
onDeleteSession?: (sessionId: string) => void;
|
|
39
49
|
/**
|
|
40
|
-
* Callback function to handle
|
|
41
|
-
*/
|
|
42
|
-
onSendMessage?: (message: string) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Callback function to handle stopping the current action.
|
|
50
|
+
* Callback function to handle creating a new session.
|
|
45
51
|
*/
|
|
46
|
-
|
|
52
|
+
onNewSession?: () => void;
|
|
47
53
|
}
|
|
48
|
-
export declare const
|
|
54
|
+
export declare const Chat: FC<ChatProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Session } from './types';
|
|
2
|
+
import { ChatTheme } from './theme';
|
|
3
|
+
import { PluggableList } from 'react-markdown/lib';
|
|
4
|
+
|
|
5
|
+
export interface ChatContextProps {
|
|
6
|
+
sessions: Session[];
|
|
7
|
+
activeSessionId: string | null;
|
|
8
|
+
theme?: ChatTheme;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
activeSession?: Session | null;
|
|
11
|
+
remarkPlugins?: PluggableList[];
|
|
12
|
+
selectSession?: (sessionId: string) => void;
|
|
13
|
+
deleteSession?: (sessionId: string) => void;
|
|
14
|
+
createSession?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const ChatContext: import('react').Context<ChatContextProps>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ChatInputProps {
|
|
4
|
+
/**
|
|
5
|
+
* Default value for the input field.
|
|
6
|
+
*/
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Allowed file types for upload.
|
|
10
|
+
*/
|
|
11
|
+
allowedFiles?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Placeholder text for the input field.
|
|
14
|
+
*/
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Icon to show for send.
|
|
18
|
+
*/
|
|
19
|
+
sendIcon?: ReactElement;
|
|
20
|
+
/**
|
|
21
|
+
* Icon to show for send.
|
|
22
|
+
*/
|
|
23
|
+
stopIcon?: ReactElement;
|
|
24
|
+
/**
|
|
25
|
+
* Icon to show for attach.
|
|
26
|
+
*/
|
|
27
|
+
attachIcon?: ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function to handle sending a new message.
|
|
30
|
+
*/
|
|
31
|
+
onSendMessage?: (message: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Callback function to handle stopping the current action.
|
|
34
|
+
*/
|
|
35
|
+
onStopMessage?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Callback function to handle file upload.
|
|
38
|
+
*/
|
|
39
|
+
onFileUpload?: (file: File) => void;
|
|
40
|
+
}
|
|
41
|
+
export declare const ChatInput: FC<ChatInputProps>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CodeHighlighterProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* The class name to apply to the code block.
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const CodeHighlighter: FC<CodeHighlighterProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { PluggableList } from 'react-markdown/lib';
|
|
3
|
+
|
|
4
|
+
interface MarkdownWrapperProps extends PropsWithChildren {
|
|
5
|
+
/**
|
|
6
|
+
* Remark plugins to apply to the markdown content.
|
|
7
|
+
*/
|
|
8
|
+
remarkPlugins?: PluggableList[];
|
|
9
|
+
}
|
|
10
|
+
export declare const Markdown: FC<MarkdownWrapperProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React, FC, PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const TableComponent: FC<PropsWithChildren<React.HTMLAttributes<HTMLTableElement>>>;
|
|
4
|
+
export declare const TableHeaderCell: FC<PropsWithChildren<React.HTMLAttributes<HTMLTableHeaderCellElement>>>;
|
|
5
|
+
export declare const TableDataCell: FC<PropsWithChildren<React.HTMLAttributes<HTMLTableDataCellElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './remarkCve';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function remarkCve(): (tree: any, _file: any) => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MessageActionsProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* Question to be copied
|
|
6
|
+
*/
|
|
7
|
+
question: string;
|
|
8
|
+
/**
|
|
9
|
+
* Response to be copied
|
|
10
|
+
*/
|
|
11
|
+
response?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Icon to show for copy.
|
|
14
|
+
*/
|
|
15
|
+
copyIcon?: ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* Icon to show for thumbs up.
|
|
18
|
+
*/
|
|
19
|
+
thumbsUpIcon?: ReactElement;
|
|
20
|
+
/**
|
|
21
|
+
* Icon to show for thumbs down.
|
|
22
|
+
*/
|
|
23
|
+
thumbsDownIcon?: ReactElement;
|
|
24
|
+
/**
|
|
25
|
+
* Icon to show for refresh.
|
|
26
|
+
*/
|
|
27
|
+
refreshIcon?: ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function to handle copying.
|
|
30
|
+
*/
|
|
31
|
+
onCopy?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Callback function to handle upvoting.
|
|
34
|
+
*/
|
|
35
|
+
onUpvote?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Callback function to handle downvoting.
|
|
38
|
+
*/
|
|
39
|
+
onDownvote?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback function to handle refreshing.
|
|
42
|
+
*/
|
|
43
|
+
onRefresh?: () => void;
|
|
44
|
+
}
|
|
45
|
+
export declare const MessageActions: FC<MessageActionsProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
import { ConversationFile } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface MessageFileProps extends ConversationFile {
|
|
5
|
+
/**
|
|
6
|
+
* Icon to show for delete.
|
|
7
|
+
*/
|
|
8
|
+
fileIcon?: ReactElement;
|
|
9
|
+
/**
|
|
10
|
+
* Limit for the name.
|
|
11
|
+
*/
|
|
12
|
+
limit?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const MessageFile: FC<MessageFileProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConversationFile } from '../types';
|
|
2
|
+
import { FC, PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
interface MessageFilesProps extends PropsWithChildren {
|
|
5
|
+
/**
|
|
6
|
+
* Files to render.
|
|
7
|
+
*/
|
|
8
|
+
files: ConversationFile[];
|
|
9
|
+
}
|
|
10
|
+
export declare const MessageFiles: FC<MessageFilesProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MessageResponseProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* Response to render.
|
|
6
|
+
*/
|
|
7
|
+
response: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the response is loading.
|
|
10
|
+
*/
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const MessageResponse: FC<MessageResponseProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ConversationSource } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface MessageSourceProps extends ConversationSource {
|
|
5
|
+
/**
|
|
6
|
+
* Limit for the title.
|
|
7
|
+
*/
|
|
8
|
+
limit?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const MessageSource: FC<MessageSourceProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConversationSource } from '../types';
|
|
2
|
+
import { FC, PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
interface MessageSourcesProps extends PropsWithChildren {
|
|
5
|
+
/**
|
|
6
|
+
* Sources to render.
|
|
7
|
+
*/
|
|
8
|
+
sources: ConversationSource[];
|
|
9
|
+
}
|
|
10
|
+
export declare const MessageSources: FC<MessageSourcesProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { Conversation } from '../types';
|
|
3
|
+
|
|
4
|
+
interface SessionMessageProps extends PropsWithChildren {
|
|
5
|
+
/**
|
|
6
|
+
* Conversation to render.
|
|
7
|
+
*/
|
|
8
|
+
conversation: Conversation;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the message is the last one in the list.
|
|
11
|
+
*/
|
|
12
|
+
isLast?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const SessionMessage: FC<SessionMessageProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { Conversation } from '../types';
|
|
3
|
+
|
|
4
|
+
interface SessionMessagesProps {
|
|
5
|
+
/**
|
|
6
|
+
* Content to display when there are no sessions selected or a new session is started.
|
|
7
|
+
*/
|
|
8
|
+
newSessionContent?: string | ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Limit the number of results returned. Clientside pagination.
|
|
11
|
+
*/
|
|
12
|
+
limit?: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* Text to display for the show more button.
|
|
15
|
+
*/
|
|
16
|
+
showMoreText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Render function for the session messages.
|
|
19
|
+
*/
|
|
20
|
+
children?: (conversations: Conversation[]) => ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare const SessionMessages: React.FC<SessionMessagesProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './SessionEmpty';
|
|
2
|
+
export * from './SessionMessagesHeader';
|
|
3
|
+
export * from './SessionMessagePanel';
|
|
4
|
+
export * from './SessionMessage';
|
|
5
|
+
export * from './SessionMessages';
|
|
6
|
+
export * from './MessageSource';
|
|
7
|
+
export * from './MessageActions';
|
|
8
|
+
export * from './MessageFile';
|
|
9
|
+
export * from './MessageFiles';
|
|
10
|
+
export * from './MessageQuestion';
|
|
11
|
+
export * from './MessageResponse';
|
|
12
|
+
export * from './MessageSources';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface NewSessionButtonProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* Text for the new session button.
|
|
6
|
+
*/
|
|
7
|
+
newSessionText?: string | ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const NewSessionButton: FC<NewSessionButtonProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { GroupedSessions } from '../utils';
|
|
3
|
+
|
|
4
|
+
export interface SessionGroupsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Render function for the session groups.
|
|
7
|
+
*/
|
|
8
|
+
children: (groups: GroupedSessions[]) => ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const SessionGroups: FC<SessionGroupsProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Session } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface SessionListItemProps extends PropsWithChildren {
|
|
5
|
+
/**
|
|
6
|
+
* Session to display.
|
|
7
|
+
*/
|
|
8
|
+
session: Session;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates whether the session is deletable.
|
|
11
|
+
*/
|
|
12
|
+
deletable?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Icon to show for delete.
|
|
15
|
+
*/
|
|
16
|
+
deleteIcon?: ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* Limit for the ellipsis.
|
|
19
|
+
*/
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const SessionListItem: FC<SessionListItemProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface SessionsGroupProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* Heading for the session group.
|
|
6
|
+
*/
|
|
7
|
+
heading?: string | ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const SessionsGroup: FC<SessionsGroupProps>;
|
|
10
|
+
export {};
|