@veracity/vui 2.26.0-beta.5 → 2.26.0-beta.6
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/dist/cjs/chat/chat.d.ts.map +1 -1
- package/dist/cjs/chat/chat.js +2 -2
- package/dist/cjs/chat/chat.js.map +1 -1
- package/dist/cjs/chat/chat.types.d.ts +22 -6
- package/dist/cjs/chat/chat.types.d.ts.map +1 -1
- package/dist/cjs/chat/chat.types.js.map +1 -1
- package/dist/cjs/chat/chatMessage.d.ts +2 -2
- package/dist/cjs/chat/chatMessage.d.ts.map +1 -1
- package/dist/cjs/chat/chatMessage.js.map +1 -1
- package/dist/cjs/chat/theme.d.ts +2 -1
- package/dist/cjs/chat/theme.d.ts.map +1 -1
- package/dist/cjs/chat/theme.js +1 -2
- package/dist/cjs/chat/theme.js.map +1 -1
- package/dist/cjs/theme/components.d.ts +2 -1
- package/dist/cjs/theme/components.d.ts.map +1 -1
- package/dist/cjs/theme/defaultTheme.d.ts +2 -1
- package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
- package/dist/esm/chat/chat.d.ts.map +1 -1
- package/dist/esm/chat/chat.js +2 -2
- package/dist/esm/chat/chat.js.map +1 -1
- package/dist/esm/chat/chat.types.d.ts +22 -6
- package/dist/esm/chat/chat.types.d.ts.map +1 -1
- package/dist/esm/chat/chat.types.js.map +1 -1
- package/dist/esm/chat/chatMessage.d.ts +2 -2
- package/dist/esm/chat/chatMessage.d.ts.map +1 -1
- package/dist/esm/chat/chatMessage.js.map +1 -1
- package/dist/esm/chat/theme.d.ts +2 -1
- package/dist/esm/chat/theme.d.ts.map +1 -1
- package/dist/esm/chat/theme.js +1 -2
- package/dist/esm/chat/theme.js.map +1 -1
- package/dist/esm/theme/components.d.ts +2 -1
- package/dist/esm/theme/components.d.ts.map +1 -1
- package/dist/esm/theme/defaultTheme.d.ts +2 -1
- package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
- package/dist/tsconfig.legacy.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/chat/chat.tsx +2 -0
- package/src/chat/chat.types.ts +22 -16
- package/src/chat/chatMessage.tsx +2 -3
- package/src/chat/theme.ts +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.26.0-beta.
|
|
3
|
+
"version": "2.26.0-beta.6",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
package/src/chat/chat.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export const Chat = vui<'div', ChatProps>((props, ref) => {
|
|
|
18
18
|
inputStatus = ChatInputStatus.Default,
|
|
19
19
|
messages,
|
|
20
20
|
helpText,
|
|
21
|
+
maxTextareaHeight = 120,
|
|
21
22
|
processingMessage,
|
|
22
23
|
suggestions,
|
|
23
24
|
onNewTopicClick,
|
|
@@ -67,6 +68,7 @@ export const Chat = vui<'div', ChatProps>((props, ref) => {
|
|
|
67
68
|
)}
|
|
68
69
|
<ChatInput
|
|
69
70
|
helpText={helpText}
|
|
71
|
+
maxTextareaHeight={maxTextareaHeight}
|
|
70
72
|
onNewTopicClick={onNewTopicClick}
|
|
71
73
|
onSend={onSend}
|
|
72
74
|
onStop={onStop}
|
package/src/chat/chat.types.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AvatarProps } from '../avatar'
|
|
2
1
|
import { BoxProps } from '../box'
|
|
3
2
|
import { ButtonProps } from '../button'
|
|
4
3
|
import { MessageProps } from '../message'
|
|
@@ -12,45 +11,52 @@ export enum ChatInputStatus {
|
|
|
12
11
|
|
|
13
12
|
export type ChatProps = Omit<BoxProps, 'size' | 'variant'> &
|
|
14
13
|
ThemingProps<'Chat'> & {
|
|
15
|
-
|
|
14
|
+
/** Status of the chat input @default 'default' */
|
|
16
15
|
inputStatus?: ChatInputStatus
|
|
17
|
-
|
|
18
|
-
messages?:
|
|
19
|
-
|
|
16
|
+
/** An array of chat messages */
|
|
17
|
+
messages?: MessageProps[]
|
|
18
|
+
/** Optional string indicating a help text */
|
|
20
19
|
helpText?: string
|
|
21
|
-
|
|
20
|
+
/** Max height for the textarea @default 120 */
|
|
21
|
+
maxTextareaHeight?: number
|
|
22
|
+
/** Optional string indicating a message being processed */
|
|
22
23
|
processingMessage?: string
|
|
23
|
-
|
|
24
|
+
/** An array of suggestion strings */
|
|
24
25
|
suggestions?: string[]
|
|
25
|
-
|
|
26
|
+
/** Callback function for when a new topic is clicked */
|
|
26
27
|
onNewTopicClick?: () => void
|
|
27
|
-
|
|
28
|
+
/** Callback function for when a suggestion is clicked */
|
|
28
29
|
onSuggestionClick?: (suggestion: string) => void
|
|
29
|
-
|
|
30
|
+
/** Optional callback function for sending a message */
|
|
30
31
|
onSend?: (message: string) => void
|
|
31
|
-
|
|
32
|
+
/** Optional callback function for stopping an action */
|
|
32
33
|
onStop?: () => void
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export type ChatInputProps = Omit<BoxProps, 'size' | 'variant'> & {
|
|
37
|
+
/** Placeholder text for the input */
|
|
36
38
|
placeholder?: string
|
|
39
|
+
/** Status of the chat input */
|
|
37
40
|
status?: ChatInputStatus
|
|
41
|
+
/** Optional string indicating a help text */
|
|
38
42
|
helpText?: string
|
|
39
|
-
/** @default 120 */
|
|
43
|
+
/** Max height for the textarea @default 120 */
|
|
40
44
|
maxTextareaHeight?: number
|
|
41
45
|
/** @default 'Generating message' */
|
|
42
46
|
processingMessage?: string
|
|
47
|
+
/** Callback function for when a new topic is clicked */
|
|
43
48
|
onNewTopicClick?: () => void
|
|
49
|
+
/** Optional callback function for sending a message */
|
|
44
50
|
onSend?: (message: string) => void
|
|
51
|
+
/** Optional callback function for stopping an action */
|
|
45
52
|
onStop?: () => void
|
|
46
53
|
}
|
|
47
54
|
|
|
48
55
|
export type ChatInputButtonProps = Omit<ButtonProps, 'size'> & {
|
|
56
|
+
/** Status of the chat input */
|
|
49
57
|
status?: ChatInputStatus
|
|
58
|
+
/** Callback function for sending a message */
|
|
50
59
|
onSend?: () => void
|
|
60
|
+
/** Callback function for stopping an action */
|
|
51
61
|
onStop?: () => void
|
|
52
62
|
}
|
|
53
|
-
|
|
54
|
-
export type ChatMessageProps = MessageProps & {
|
|
55
|
-
avatar?: AvatarProps
|
|
56
|
-
}
|
package/src/chat/chatMessage.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AvatarProps } from '../avatar'
|
|
2
2
|
import { useStyleConfig, vui } from '../core'
|
|
3
|
-
import Message from '../message'
|
|
3
|
+
import Message, { MessageProps } from '../message'
|
|
4
4
|
import { cs } from '../utils'
|
|
5
|
-
import { ChatMessageProps } from './chat.types'
|
|
6
5
|
|
|
7
6
|
const defaultAvatar: AvatarProps = {
|
|
8
7
|
variant: 'solidDarkBlue',
|
|
@@ -12,7 +11,7 @@ const defaultAvatar: AvatarProps = {
|
|
|
12
11
|
/**
|
|
13
12
|
* Displays a chat interface with messages and actions.
|
|
14
13
|
*/
|
|
15
|
-
export const ChatMessage = vui<'div',
|
|
14
|
+
export const ChatMessage = vui<'div', MessageProps>((props, ref) => {
|
|
16
15
|
const styles = useStyleConfig('Chat', props)
|
|
17
16
|
const { avatar = defaultAvatar, ...rest } = props
|
|
18
17
|
|
package/src/chat/theme.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const baseStyle = {
|
|
2
2
|
chat: { flexDirection: 'column', w: '100%', height: '100%' },
|
|
3
|
-
messages: { flexDirection: 'column', overflowY: 'auto' },
|
|
3
|
+
messages: { flexDirection: 'column', overflowY: 'auto', position: 'relative', w: '100%' },
|
|
4
4
|
suggestions: { display: 'block', textAlign: 'right', width: '100%' },
|
|
5
|
-
input: {},
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
const defaultProps = {}
|