@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.
Files changed (39) hide show
  1. package/dist/cjs/chat/chat.d.ts.map +1 -1
  2. package/dist/cjs/chat/chat.js +2 -2
  3. package/dist/cjs/chat/chat.js.map +1 -1
  4. package/dist/cjs/chat/chat.types.d.ts +2 -0
  5. package/dist/cjs/chat/chat.types.d.ts.map +1 -1
  6. package/dist/cjs/chat/chatInput.js +2 -5
  7. package/dist/cjs/chat/chatInput.js.map +1 -1
  8. package/dist/cjs/chat/chatInputButton.js +1 -1
  9. package/dist/cjs/chat/chatInputButton.js.map +1 -1
  10. package/dist/cjs/message/consts.d.ts +4 -0
  11. package/dist/cjs/message/consts.d.ts.map +1 -1
  12. package/dist/cjs/message/consts.js +5 -1
  13. package/dist/cjs/message/consts.js.map +1 -1
  14. package/dist/cjs/message/message.js +1 -1
  15. package/dist/cjs/message/message.js.map +1 -1
  16. package/dist/esm/chat/chat.d.ts.map +1 -1
  17. package/dist/esm/chat/chat.js +2 -2
  18. package/dist/esm/chat/chat.js.map +1 -1
  19. package/dist/esm/chat/chat.types.d.ts +2 -0
  20. package/dist/esm/chat/chat.types.d.ts.map +1 -1
  21. package/dist/esm/chat/chatInput.js +2 -5
  22. package/dist/esm/chat/chatInput.js.map +1 -1
  23. package/dist/esm/chat/chatInputButton.js +1 -1
  24. package/dist/esm/chat/chatInputButton.js.map +1 -1
  25. package/dist/esm/message/consts.d.ts +4 -0
  26. package/dist/esm/message/consts.d.ts.map +1 -1
  27. package/dist/esm/message/consts.js +4 -0
  28. package/dist/esm/message/consts.js.map +1 -1
  29. package/dist/esm/message/message.js +2 -2
  30. package/dist/esm/message/message.js.map +1 -1
  31. package/dist/tsconfig.legacy.tsbuildinfo +1 -1
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +1 -1
  34. package/src/chat/chat.tsx +2 -0
  35. package/src/chat/chat.types.ts +3 -0
  36. package/src/chat/chatInput.tsx +4 -4
  37. package/src/chat/chatInputButton.tsx +1 -1
  38. package/src/message/consts.ts +5 -0
  39. 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.1",
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}
@@ -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
@@ -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={1} onClick={() => onNewTopicClick?.()} />}
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
- onChange={e => {
59
- if (status === ChatInputStatus.Default) setValue(e.target.value)
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'
@@ -18,3 +18,8 @@ export const messageColors = {
18
18
  error: 'energyRed.45',
19
19
  success: 'landGreen.35',
20
20
  }
21
+
22
+ export const avatarStyles = {
23
+ mt: '4px',
24
+ color: 'black',
25
+ }
@@ -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 mt={avatar ? '4px' : undefined} size={styles.fontSize} w="100%">
26
+ <Box size={styles.fontSize} w="100%" {...(avatar ? avatarStyles : undefined)}>
27
27
  {children ?? text}
28
28
  </Box>
29
29
  </Box>