@stack-spot/ai-chat-widget 1.18.0-beta.0 → 1.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.18.0-beta.0",
3
+ "version": "1.18.0-beta.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import { Box, Flex, IconBox, Text } from '@citric/core'
1
+ import { Flex, IconBox, Image, Text } from '@citric/core'
2
2
  import { ArrowRight, Circle, Search, Times } from '@citric/icons'
3
3
  import { Avatar, IconButton } from '@citric/ui'
4
4
  import { Placeholder } from '@stack-spot/portal-components/Placeholder'
@@ -12,7 +12,14 @@ import { ComponentNavigator, ComponentNavigatorProps, NavigationItem, Navigation
12
12
  import { IconInput } from './IconInput'
13
13
  import { ListGroup } from './ListGroup'
14
14
 
15
- export const CardSpace = ({ onClick, name, icon }: { onClick: VoidFunction, name: string, icon: React.ReactElement }) =>
15
+ interface CardSpaceProps {
16
+ onClick: VoidFunction,
17
+ name: string,
18
+ icon: React.ReactElement,
19
+ logoUrl?: string | null,
20
+ }
21
+
22
+ export const CardSpace = ({ onClick, name, icon, logoUrl }: CardSpaceProps) =>
16
23
  <Flex
17
24
  onClick={onClick}
18
25
  flex={1}
@@ -24,13 +31,11 @@ export const CardSpace = ({ onClick, name, icon }: { onClick: VoidFunction, name
24
31
  p={3}
25
32
  sx={{ cursor: 'pointer' }}
26
33
  >
27
- <Flex alignContent="center" alignItems="center" sx={{ gap: '8px' }} >
28
- <Avatar size="xxs" appearance="square" sx={{ bg: 'light.600', r: 'xxs' }}>
29
- <IconBox>
30
- {icon}
31
- </IconBox>
34
+ <Flex alignContent="center" alignItems="center" sx={{ gap: '8px', m: 1 }} >
35
+ <Avatar size="xxs" appearance="square" sx={{ bg: 'light.600', r: 'xxs' }}>
36
+ {logoUrl ? <Image src={logoUrl} /> : <IconBox> {icon} </IconBox>}
32
37
  </Avatar>
33
- <Text>{name}</Text>
38
+ <Text appearance="body2">{name}</Text>
34
39
  </Flex>
35
40
  <IconButton><ArrowRight /></IconButton>
36
41
  </Flex>
@@ -85,17 +90,15 @@ const WorkspaceSourcesTab = ({ visibility, onClick }: WorkspaceSourcesTabProps)
85
90
  )
86
91
 
87
92
  return (
88
- <>
89
- <Box w={12}>
90
- <IconInput icon={<Search />} value={filter} onChange={setFilter} className="search" />
91
- </Box>
93
+ <Flex w={12} sx={{ gap: '16px' }} flexDirection="column">
94
+ <IconInput icon={<Search />} value={filter} onChange={setFilter} className="search" />
92
95
  {!!filtered.length &&
93
96
  <ListGroup
94
97
  list={filtered}
95
98
  keygen={w => w.id}
96
99
  onClick={onClick}
97
100
  style={{ gap: '6px', display: 'flex', flexDirection: 'column' }}
98
- renderLabel={w => <CardSpace name={w.name} icon={<Circle />} onClick={() => onClick(w)} />}
101
+ renderLabel={w => <CardSpace name={w.name} logoUrl={w.logo} icon={<Circle />} onClick={() => onClick(w)} />}
99
102
  renderDescription={w => w.description}
100
103
  renderAfterElement={(w) =>
101
104
  <ButtonFavorite favorite={{ idOrSlug: w?.id, listFavorites, onAddFavorite, onRemoveFavorite }} />}
@@ -109,7 +112,7 @@ const WorkspaceSourcesTab = ({ visibility, onClick }: WorkspaceSourcesTabProps)
109
112
  {!!workspaces.length && !filtered.length &&
110
113
  <Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} className="no-data-placeholder" />}
111
114
  {!workspaces.length && <Placeholder title={t.noData} description={t.noDataDescription} />}
112
- </>
115
+ </Flex>
113
116
  )
114
117
  }
115
118
 
@@ -126,7 +129,6 @@ const WorkspaceHeader = <T extends NavigationMap, K extends keyof T>({ data }: {
126
129
  </Flex>
127
130
  }
128
131
 
129
-
130
132
  interface WorkspaceTabNavigatorProps {
131
133
  getNavigateParam: (workspace: WorkspaceResponse) => NavigationItem<NavigationMap, string>,
132
134
  visibility?: WorkspaceVisibilityLevelEnum,
@@ -16,14 +16,15 @@ import { StacksTab } from '../Stacks'
16
16
  const SpaceCard = ({ workspaceId }: { workspaceId: string }) => {
17
17
  const workspace = workspaceAiClient.workspaceAi.useQuery({ id: workspaceId })
18
18
  return <Flex flexDirection="column" sx={{ gap: '8px' }}>
19
- <Flex alignItems="center" sx={{ gap: '4px' }}>
20
- {workspace.logo
21
- ? <Image src={workspace.logo} />
22
- : <Avatar size="xxs" appearance="square" sx={{ bg: 'light.500' }}><IconBox><Circle /></IconBox></Avatar>}
23
- <Text appearance="body2" weight="medium">{workspace.name} </Text>
19
+ <Flex flexDirection="column" sx={{ gap: '4px' }}>
20
+ <Flex alignContent="center" alignItems="center" sx={{ gap: '8px', m: 1 }} >
21
+ <Avatar size="xxs" appearance="square" sx={{ bg: 'light.600', r: 'xxs' }}>
22
+ {workspace.logo ? <Image src={workspace.logo} /> : <IconBox> <Circle /> </IconBox>}
23
+ </Avatar>
24
+ <Text appearance="body2" weight="medium">{workspace.name} </Text>
25
+ </Flex>
26
+ <Text colorScheme="light.700">{workspace.description}</Text>
24
27
  </Flex>
25
-
26
- <Text colorScheme="light.700">{workspace.description}</Text>
27
28
  </Flex>
28
29
  }
29
30