@veracity/vui 2.26.0-beta.1 → 2.26.0-beta.2
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 +2 -0
- package/dist/cjs/chat/chat.types.d.ts.map +1 -1
- package/dist/cjs/chat/chatInput.js +2 -5
- package/dist/cjs/chat/chatInput.js.map +1 -1
- package/dist/cjs/chat/chatInputButton.js +1 -1
- package/dist/cjs/chat/chatInputButton.js.map +1 -1
- package/dist/cjs/message/consts.d.ts +4 -0
- package/dist/cjs/message/consts.d.ts.map +1 -1
- package/dist/cjs/message/consts.js +5 -1
- package/dist/cjs/message/consts.js.map +1 -1
- package/dist/cjs/message/message.js +1 -1
- package/dist/cjs/message/message.js.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 +2 -0
- package/dist/esm/chat/chat.types.d.ts.map +1 -1
- package/dist/esm/chat/chatInput.js +2 -5
- package/dist/esm/chat/chatInput.js.map +1 -1
- package/dist/esm/chat/chatInputButton.js +1 -1
- package/dist/esm/chat/chatInputButton.js.map +1 -1
- package/dist/esm/message/consts.d.ts +4 -0
- package/dist/esm/message/consts.d.ts.map +1 -1
- package/dist/esm/message/consts.js +4 -0
- package/dist/esm/message/consts.js.map +1 -1
- package/dist/esm/message/message.js +2 -2
- package/dist/esm/message/message.js.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 +3 -0
- package/src/chat/chatInput.tsx +4 -4
- package/src/chat/chatInputButton.tsx +1 -1
- package/src/message/consts.ts +5 -0
- package/src/message/message.tsx +2 -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.2",
|
|
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
|
@@ -17,6 +17,7 @@ export const Chat = vui<'div', ChatProps>((props, ref) => {
|
|
|
17
17
|
children,
|
|
18
18
|
inputStatus = ChatInputStatus.Default,
|
|
19
19
|
messages,
|
|
20
|
+
helpText,
|
|
20
21
|
processingMessage,
|
|
21
22
|
suggestions,
|
|
22
23
|
onNewTopicClick,
|
|
@@ -65,6 +66,7 @@ export const Chat = vui<'div', ChatProps>((props, ref) => {
|
|
|
65
66
|
</Box>
|
|
66
67
|
)}
|
|
67
68
|
<ChatInput
|
|
69
|
+
helpText={helpText}
|
|
68
70
|
onNewTopicClick={onNewTopicClick}
|
|
69
71
|
onSend={onSend}
|
|
70
72
|
onStop={onStop}
|
package/src/chat/chat.types.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type ChatProps = Omit<BoxProps, 'size' | 'variant'> &
|
|
|
16
16
|
inputStatus?: ChatInputStatus
|
|
17
17
|
// An array of chat messages
|
|
18
18
|
messages?: ChatMessageProps[]
|
|
19
|
+
// Optional string indicating a help text
|
|
20
|
+
helpText?: string
|
|
19
21
|
// Optional string indicating a message being processed
|
|
20
22
|
processingMessage?: string
|
|
21
23
|
// An array of suggestion strings
|
|
@@ -33,6 +35,7 @@ export type ChatProps = Omit<BoxProps, 'size' | 'variant'> &
|
|
|
33
35
|
export type ChatInputProps = Omit<BoxProps, 'size' | 'variant'> & {
|
|
34
36
|
placeholder?: string
|
|
35
37
|
status?: ChatInputStatus
|
|
38
|
+
helpText?: string
|
|
36
39
|
/** @default 'Generating message' */
|
|
37
40
|
processingMessage?: string
|
|
38
41
|
onNewTopicClick?: () => void
|
package/src/chat/chatInput.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import ChatInputButton from './chatInputButton'
|
|
|
14
14
|
*/
|
|
15
15
|
export const ChatInput = vui<'input', ChatInputProps>((props, ref) => {
|
|
16
16
|
const {
|
|
17
|
+
helpText,
|
|
17
18
|
placeholder = 'Type your message',
|
|
18
19
|
status = ChatInputStatus.Default,
|
|
19
20
|
processingMessage = 'Generating message',
|
|
@@ -46,7 +47,7 @@ export const ChatInput = vui<'input', ChatInputProps>((props, ref) => {
|
|
|
46
47
|
|
|
47
48
|
return (
|
|
48
49
|
<Box className={cs('vui-chat-input')} justifyContent="space-between" ref={ref} {...styles?.input} {...rest}>
|
|
49
|
-
{!!onNewTopicClick && <Button icon="falPlus" mr={
|
|
50
|
+
{!!onNewTopicClick && <Button icon="falPlus" mr={0.5} onClick={() => onNewTopicClick?.()} />}
|
|
50
51
|
{status === ChatInputStatus.Processing ? (
|
|
51
52
|
<Box borderColor="sandstone.79" borderWidth={1} center justifyContent="flex-start" py={0.5} w="100%">
|
|
52
53
|
<Icon mx={1} name="fadSpinnerThird" pathFill={['blue.40', 'blue.60']} size="lg" variant="spinning" />
|
|
@@ -55,9 +56,8 @@ export const ChatInput = vui<'input', ChatInputProps>((props, ref) => {
|
|
|
55
56
|
) : (
|
|
56
57
|
<Textarea
|
|
57
58
|
disabled={isDisabled}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}}
|
|
59
|
+
helpText={helpText}
|
|
60
|
+
onChange={e => status === ChatInputStatus.Default && setValue(e.target.value)}
|
|
61
61
|
onKeyDown={onKeyDown}
|
|
62
62
|
placeholder={placeholder}
|
|
63
63
|
resize="vertical"
|
|
@@ -12,7 +12,7 @@ export const ChatInputButton = vui<'button', ChatInputButtonProps>((props, ref)
|
|
|
12
12
|
|
|
13
13
|
const icon = status === ChatInputStatus.Processing ? 'falStopCircle' : 'falChevronCircleRight'
|
|
14
14
|
|
|
15
|
-
return <Button icon={icon} onClick={onClick} ref={ref} variant="tertiaryDark" {...styles?.inputButton} />
|
|
15
|
+
return <Button icon={icon} ml={0.5} onClick={onClick} ref={ref} variant="tertiaryDark" {...styles?.inputButton} />
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
ChatInputButton.displayName = 'ChatInputButton'
|
package/src/message/consts.ts
CHANGED
package/src/message/message.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { Box } from '../box'
|
|
|
3
3
|
import { styled, useStyleConfig, vui } from '../core'
|
|
4
4
|
import { Icon } from '../icon'
|
|
5
5
|
import { cs } from '../utils'
|
|
6
|
-
import { iconDictionary, spacingDictionary } from './consts'
|
|
6
|
+
import { avatarStyles, iconDictionary, spacingDictionary } from './consts'
|
|
7
7
|
import { MessageProps } from './message.types'
|
|
8
8
|
|
|
9
9
|
export const MessageBase = styled.divBox`
|
|
@@ -23,7 +23,7 @@ export const Message = vui<'span', MessageProps>((props, ref) => {
|
|
|
23
23
|
) : (
|
|
24
24
|
<Icon mr={`${spacingDictionary[size]}px`} name={iconDictionary[variant]} size={styles.fontSize} />
|
|
25
25
|
)}
|
|
26
|
-
<Box
|
|
26
|
+
<Box size={styles.fontSize} w="100%" {...(avatar ? avatarStyles : undefined)}>
|
|
27
27
|
{children ?? text}
|
|
28
28
|
</Box>
|
|
29
29
|
</Box>
|