blixify-ui-web-mcp 0.1.2 → 0.1.18

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 (135) hide show
  1. package/lib/components/action/button/README.md +12 -11
  2. package/lib/components/action/button/button.stories.tsx +4 -10
  3. package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +4 -10
  4. package/lib/components/action/iconButton/iconButton.stories.tsx +4 -10
  5. package/lib/components/action/radioList/radioList.stories.tsx +4 -10
  6. package/lib/components/action/slider/slider.stories.tsx +4 -10
  7. package/lib/components/action/textButton/textButton.stories.tsx +4 -10
  8. package/lib/components/action/toggle/toggle.stories.tsx +4 -10
  9. package/lib/components/advanced/collapse/collapse.stories.tsx +4 -10
  10. package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +4 -10
  11. package/lib/components/advanced/popUp/README.md +21 -7
  12. package/lib/components/advanced/popUp/popUp.stories.tsx +4 -10
  13. package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +30 -10
  14. package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +4 -10
  15. package/lib/components/auth/signIn/signIn.stories.tsx +4 -10
  16. package/lib/components/auth/signUp/signUp.stories.tsx +4 -10
  17. package/lib/components/chart/areaChart/areaChart.stories.tsx +7 -13
  18. package/lib/components/chart/barChart/barChart.stories.tsx +7 -13
  19. package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +8 -14
  20. package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +8 -14
  21. package/lib/components/chart/card/card.stories.tsx +4 -10
  22. package/lib/components/chart/ganttChart/README.md +96 -110
  23. package/lib/components/chart/ganttChart/ganttChart.stories.tsx +135 -125
  24. package/lib/components/chart/heatmapChart/README.md +93 -82
  25. package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +122 -84
  26. package/lib/components/chart/lineChart/lineChart.stories.tsx +4 -10
  27. package/lib/components/chart/pieChart/pieChart.stories.tsx +4 -10
  28. package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +8 -14
  29. package/lib/components/chart/radarChart/radarChart.stories.tsx +4 -10
  30. package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
  31. package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +4 -10
  32. package/lib/components/chart/statsCard/statsCard.stories.tsx +4 -10
  33. package/lib/components/chart/treemapChart/treemapChart.stories.tsx +8 -14
  34. package/lib/components/chat/chatAnchor/README.md +61 -79
  35. package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +13 -19
  36. package/lib/components/chat/chatBase/README.md +244 -196
  37. package/lib/components/chat/chatBase/chatBase.stories.tsx +828 -250
  38. package/lib/components/chat/chatDashboard/README.md +89 -129
  39. package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +406 -117
  40. package/lib/components/data/dataGraph/README.md +135 -1
  41. package/lib/components/data/dataGraph/dataGraph.stories.tsx +90 -77
  42. package/lib/components/data/dataReference/README.md +141 -43
  43. package/lib/components/data/dataReference/dataReference.stories.tsx +111 -45
  44. package/lib/components/data/dataTemplate/README.md +88 -61
  45. package/lib/components/data/dataTemplate/dataModule.stories.tsx +4 -10
  46. package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +4 -10
  47. package/lib/components/data/dataWrapper/README.md +48 -46
  48. package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +258 -489
  49. package/lib/components/data/queryForm/queryForm.stories.tsx +4 -10
  50. package/lib/components/data/readQuery/readQuery.stories.tsx +4 -9
  51. package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +4 -10
  52. package/lib/components/data/writeQuery/writeQuery.stories.tsx +4 -8
  53. package/lib/components/design/actionSection/actionSection.stories.tsx +6 -10
  54. package/lib/components/design/banner/banner.stories.tsx +4 -10
  55. package/lib/components/design/bannerAction/bannerAction.stories.tsx +4 -10
  56. package/lib/components/design/blogSection/blogSection.stories.tsx +4 -10
  57. package/lib/components/design/carouselSection/carouselSection.stories.tsx +4 -10
  58. package/lib/components/design/designList/designList.stories.tsx +4 -10
  59. package/lib/components/design/faq/faq.stories.tsx +4 -10
  60. package/lib/components/design/fileGrid/fileGrid.stories.tsx +4 -10
  61. package/lib/components/design/fileViewer/fileViewer.stories.tsx +4 -10
  62. package/lib/components/design/footerSection/footerSection.stories.tsx +4 -10
  63. package/lib/components/design/googleReview/googleReview.stories.tsx +4 -10
  64. package/lib/components/design/heroSection/heroSection.stories.tsx +4 -10
  65. package/lib/components/design/iconList/iconList.stories.tsx +4 -10
  66. package/lib/components/design/imageGallery/imageGallery.stories.tsx +4 -10
  67. package/lib/components/design/imageZoom/imageZoom.stories.tsx +4 -10
  68. package/lib/components/design/leftContent/leftContent.stories.tsx +4 -10
  69. package/lib/components/design/logoCloud/logoCloud.stories.tsx +4 -10
  70. package/lib/components/design/onboarding/onboarding.stories.tsx +4 -10
  71. package/lib/components/design/pricing/pricing.stories.tsx +4 -10
  72. package/lib/components/design/rightContent/rightContent.stories.tsx +4 -10
  73. package/lib/components/design/sectionList/sectionList.stories.tsx +4 -10
  74. package/lib/components/design/teams/teams.stories.tsx +4 -10
  75. package/lib/components/display/alert/alert.stories.tsx +4 -10
  76. package/lib/components/display/calendar/README.md +49 -0
  77. package/lib/components/display/calendar/calendar.stories.tsx +71 -28
  78. package/lib/components/display/clipboard/clipboard.stories.tsx +4 -10
  79. package/lib/components/display/detailList/detailList.stories.tsx +5 -10
  80. package/lib/components/display/drawer/drawer.stories.tsx +5 -10
  81. package/lib/components/display/emptyState/emptyState.stories.tsx +4 -10
  82. package/lib/components/display/feeds/feeds.stories.tsx +4 -10
  83. package/lib/components/display/flexTable/README.md +11 -7
  84. package/lib/components/display/flexTable/flexTable.stories.tsx +114 -11
  85. package/lib/components/display/grid/README.md +28 -27
  86. package/lib/components/display/grid/grid.stories.tsx +4 -10
  87. package/lib/components/display/kanban/kanban.stories.tsx +14 -20
  88. package/lib/components/display/list/README.md +30 -29
  89. package/lib/components/display/list/list.stories.tsx +4 -10
  90. package/lib/components/display/loading/loading.stories.tsx +5 -10
  91. package/lib/components/display/mapView/mapView.stories.tsx +4 -10
  92. package/lib/components/display/modal/modal.stories.tsx +4 -11
  93. package/lib/components/display/notification/notification.stories.tsx +4 -10
  94. package/lib/components/display/progress/progress.stories.tsx +5 -10
  95. package/lib/components/display/stepper/stepper.stories.tsx +5 -10
  96. package/lib/components/display/table/README.md +38 -37
  97. package/lib/components/display/table/table.stories.tsx +8 -14
  98. package/lib/components/display/tag/tag.stories.tsx +4 -10
  99. package/lib/components/input/address/address.stories.tsx +4 -10
  100. package/lib/components/input/canvas/canvas.stories.tsx +4 -10
  101. package/lib/components/input/checkbox/checkbox.stories.tsx +4 -10
  102. package/lib/components/input/datePicker/datePicker.stories.tsx +4 -10
  103. package/lib/components/input/form/form.stories.tsx +4 -10
  104. package/lib/components/input/markdown/markdown.stories.tsx +5 -10
  105. package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +4 -10
  106. package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +4 -10
  107. package/lib/components/input/rating/rating.stories.tsx +4 -10
  108. package/lib/components/input/select/README.md +30 -29
  109. package/lib/components/input/select/select.stories.tsx +4 -10
  110. package/lib/components/input/signature/signature.stories.tsx +4 -10
  111. package/lib/components/input/textArea/textArea.stories.tsx +4 -10
  112. package/lib/components/input/textInput/textinput.stories.tsx +4 -10
  113. package/lib/components/input/uploadInput/uploadInput.stories.tsx +135 -11
  114. package/lib/components/navigation/bars/README.md +90 -17
  115. package/lib/components/navigation/bars/bars.stories.tsx +128 -60
  116. package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +5 -10
  117. package/lib/components/navigation/breadcrumb/README.md +40 -20
  118. package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +34 -14
  119. package/lib/components/navigation/header/README.md +67 -108
  120. package/lib/components/navigation/header/header.stories.tsx +165 -49
  121. package/lib/components/navigation/leftNav/README.md +121 -66
  122. package/lib/components/navigation/leftNav/leftNav.stories.tsx +178 -91
  123. package/lib/components/navigation/tabs/tabs.stories.tsx +57 -39
  124. package/lib/components/structure/column/column.stories.tsx +5 -10
  125. package/lib/components/structure/container/container.stories.tsx +5 -10
  126. package/lib/components/structure/link/link.stories.tsx +4 -10
  127. package/lib/components/structure/text/text.stories.tsx +5 -10
  128. package/lib/components/template/authPage/authPage.stories.tsx +6 -5
  129. package/lib/components/template/landingPage/landingPage.stories.tsx +8 -6
  130. package/lib/components/template/productListing/productListing.stories.tsx +7 -13
  131. package/lib/components/template/productOverview/productOverview.stories.tsx +5 -11
  132. package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +6 -12
  133. package/lib/components/template/userHomePage/userHomePage.stories.tsx +7 -6
  134. package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +5 -11
  135. package/package.json +1 -1
@@ -4,220 +4,268 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Chat Base
7
+ A chat window component with message bubbles, markdown rendering for received messages, message search, file upload (images, videos, PDFs, and other documents), a loading reply indicator, tool report logs, tool call chips, and customisable header/footer/body slots.
8
8
 
9
9
  ##### Import
10
10
 
11
11
  ```js
12
- import { ChatBase } from "blixify-ui-web/components/chat/chatBase";
12
+ import {
13
+ ChatBase,
14
+ Conversation,
15
+ Message,
16
+ ToolReport,
17
+ ToolCall,
18
+ User,
19
+ } from "blixify-ui-web/components/chat/chatBase";
13
20
  ```
14
21
 
15
22
  ##### Usage
16
23
 
17
- ```tsx
18
- const [message, setMessage] = useState("");
19
- const [search, setSearch] = useState("");
20
- const [filteredConversation, setFilteredConversation] =
21
- useState<Conversation | null>();
22
- const [conversation, setConversation] = useState<Conversation>({
23
- id: "1",
24
- members: [currentUser, botUser],
25
- messageList: [
26
- {
27
- sender: botUser,
28
- messageBody: "Hi! How can I help you? 🤖",
29
- createdAt: moment(
30
- "Fri Nov 03 2023 12:21:14 GMT+0800 (Malaysia Time)"
31
- ).toDate(),
32
- },
33
- {
34
- sender: currentUser,
35
- messageBody: "Yo, my computer's acting up.",
36
- createdAt: moment(
37
- "Fri Nov 03 2023 13:21:14 GMT+0800 (Malaysia Time)"
38
- ).toDate(),
39
- },
40
- ],
41
- });
42
-
43
- const handleOnSendMessage = (conversation: Conversation) => {
44
- setConversation(conversation);
45
- setMessage("");
46
- };
47
-
48
- const handleOnSearch = (searchMessage: string) => {
49
- if (searchMessage.length === 0) {
50
- setSearch("");
51
- setFilteredConversation(null);
52
- } else {
53
- const dupMessageList = conversation.messageList.filter((eachMessage) => {
54
- return eachMessage.messageBody
55
- .toLowerCase()
56
- .includes(searchMessage.toLowerCase());
57
- });
58
- const dupConversation = {
59
- id: conversation.id,
60
- members: [...conversation.members],
61
- messageList: [...dupMessageList],
62
- };
63
- setFilteredConversation(dupConversation);
64
- }
65
- };
24
+ Basic chat:
66
25
 
67
- const handleOnClearMessage = () => {
68
- setFilteredConversation(null);
69
- setConversation({
26
+ ```jsx
27
+ const [message, setMessage] = useState("");
28
+ const [conversation, setConversation] =
29
+ useState <
30
+ Conversation >
31
+ {
70
32
  id: "1",
71
33
  members: [currentUser, botUser],
72
- messageList: [],
73
- });
74
- };
34
+ messageList: [
35
+ {
36
+ sender: botUser,
37
+ messageBody: "Hi! How can I help?",
38
+ createdAt: new Date(),
39
+ },
40
+ ],
41
+ };
42
+
43
+ <ChatBase
44
+ open
45
+ value={message}
46
+ currentUser={currentUser}
47
+ conversation={conversation}
48
+ onSendMessage={(updated) => {
49
+ setConversation(updated);
50
+ setMessage("");
51
+ }}
52
+ onChangeMessage={(e) => setMessage(e.target.value)}
53
+ sizeClassName="h-[500px] w-96"
54
+ disableMobileResize
55
+ />;
56
+ ```
75
57
 
76
- const headerElement = (
77
- <div className="p-2 bg-primary-500 rounded-t-md">
78
- <img src={Logo} alt="" className="h-12" />
79
- </div>
80
- );
81
-
82
- const renderFooterElement = () => {
83
- if (conversation.messageList.length >= messageLimit)
84
- return (
85
- <div className="p-2">
86
- <div className="p-2 bg-primary-50 border border-primary-300 rounded-md shadow-md text-xs">
87
- <p>
88
- You have reached the message limit of: {messageLimit}
89
- <br />
90
- Clear previous messages to send a new one.
91
- </p>
92
- <TextButton
93
- text="Clear now"
94
- onClick={handleOnClearMessage}
95
- className="mt-2"
96
- />
97
- </div>
98
- </div>
99
- );
100
- else return <></>;
101
- };
102
- const footerElement = renderFooterElement();
58
+ With search:
59
+
60
+ ```jsx
61
+ <ChatBase
62
+ open
63
+ value={message}
64
+ currentUser={currentUser}
65
+ conversation={filteredConversation ?? conversation}
66
+ searchMessage={search}
67
+ onSearch={(q) => { /* filter conversation.messageList */ }}
68
+ onChangeSearch={(e) => setSearch(e.target.value)}
69
+ onSendMessage={...}
70
+ onChangeMessage={...}
71
+ />
72
+ ```
103
73
 
104
- const additionalAction: ChatBaseAction[] = [
105
- {
106
- text: "Clear",
107
- onClick: handleOnClearMessage,
108
- icon: <TrashIcon className="w-3 h-3" aria-hidden="true" />,
74
+ With file upload:
75
+
76
+ ```jsx
77
+ <ChatBase
78
+ open
79
+ value={message}
80
+ currentUser={currentUser}
81
+ conversation={conversation}
82
+ fileUpload={{
83
+ allowFileUpload: true,
84
+ file,
85
+ acceptFileType: ".jpg,.jpeg,.png,.mp4,.webm,.pdf,.docx",
86
+ onChangeUpload: (e) => setFile(e.target.files[0]),
87
+ onSendUpload: (conversation, file) => { /* handle upload */ },
88
+ }}
89
+ onSendMessage={...}
90
+ onChangeMessage={...}
91
+ />
92
+ ```
93
+
94
+ With loading reply indicator:
95
+
96
+ ```jsx
97
+ <ChatBase
98
+ open
99
+ value={message}
100
+ currentUser={currentUser}
101
+ conversation={conversation}
102
+ isLoadingReply={waitingForBot}
103
+ onSendMessage={...}
104
+ onChangeMessage={...}
105
+ />
106
+ ```
107
+
108
+ With tool report (shows model + tool call status above an assistant message):
109
+
110
+ ```jsx
111
+ const assistantMessage: Message = {
112
+ sender: botUser,
113
+ messageBody: "Your order is out for delivery.",
114
+ createdAt: new Date(),
115
+ toolReport: {
116
+ model: "gemini-2.0-flash",
117
+ tools: [
118
+ { content: "search_orders", request: {}, response: {}, status: "done" },
119
+ {
120
+ content: "fetch_delivery_status",
121
+ request: {},
122
+ response: {},
123
+ status: "done",
124
+ },
125
+ ],
109
126
  },
110
- ];
111
-
112
- return (
113
- <ChatBase
114
- open
115
- value={message}
116
- currentUser={currentUser}
117
- conversation={filteredConversation ?? conversation}
118
- headerElement={headerElement}
119
- footerElement={footerElement}
120
- additionalAction={additionalAction}
121
- searchMessage={search}
122
- onChangeSearch={(e) => setSearch(e.target.value)}
123
- onSendMessage={handleOnSendMessage}
124
- onChangeMessage={(e) => setMessage(e.target.value)}
125
- onSearch={handleOnSearch}
126
- className="border border-gray-200 shadow-lg w-96"
127
- disableMobileResize
128
- disableMessageInput={conversation.messageList.length >= messageLimit}
129
- onHiddenChatText={true}
130
- />
131
- );
127
+ };
128
+ ```
129
+
130
+ Status dot colours: `"pending"` → yellow pulsing, `"done"` → green, `"error"` → red.
131
+
132
+ With tool call chips (for AI pipelines that log tool invocations as separate messages):
133
+
134
+ ```jsx
135
+ // Messages where author === "tool" should set isToolCall: true.
136
+ // They render as a small centred chip instead of a chat bubble.
137
+ const toolCallMessage: Message = {
138
+ sender: botUser,
139
+ messageBody: "fetch_policy_details",
140
+ createdAt: new Date(),
141
+ isToolCall: true,
142
+ };
132
143
  ```
133
144
 
134
145
  ##### Required props
135
146
 
136
- | Name | Type | Description |
137
- | ------------ | -------------- | -------------------------------- |
138
- | open | `boolean` | Visibility of ChatBase component |
139
- | value | `string` | Message input text |
140
- | currentUser | `User` | User Object |
141
- | conversation | `Conversation` | Conversation Object |
147
+ | Name | Type | Description |
148
+ | -------------- | -------------- | -------------------------------------------------------------------- |
149
+ | `open` | `boolean` | When `false`, the component renders nothing |
150
+ | `value` | `string` | Current message input value |
151
+ | `currentUser` | `User` | The logged-in user — used to determine which side messages appear on |
152
+ | `conversation` | `Conversation` | The conversation to display — see Conversation below |
142
153
 
143
154
  ##### Optional props
144
155
 
145
- | Name | Type | Default | Description |
146
- | ------------------- | -------------------- | ---------- | -------------------------------------------------------------------------------------- |
147
- | searchMessage | `string` | "" | Search input text |
148
- | headerElement | `React Element` | null | Replaces default component Header |
149
- | bodyElement | `React Element` | null | Replaces default component Body |
150
- | footerElement | `React Element` | null | Footer element that floats above message input |
151
- | additionalAction | `ChatBaseAction[]` | null | Additional buttons to be place within action dropdown in top right corner |
152
- | disableMessageInput | `boolean` | null | When true, message input is disabled |
153
- | isLoadingReply | `boolean` | null | When true, loading indicator appears above message input and message input is disabled |
154
- | className | `tailwind classname` | "" | For component container |
155
- | sizeClassName | `tailwind classname` | "" | For component size |
156
- | paddingTop | `Padding top | "" | For mobile applications |
157
- | disableMobileResize | `boolean` | null | When true, mobile resize is disabled |
158
- | onSendMessage | `function` | `() => {}` | To send message |
159
- | onChangeMessage | `function` | `() => {}` | To type in message input |
160
- | onSearch | `function` | `() => {}` | To search in messages |
161
- | onChangeSearch | `function` | `() => {}` | To type in search input |
162
- | onClose | `function` | `() => {}` | To close ChatBase component - Only available on mobile |
163
- | onHiddenChatText | `boolean` | `true` | To hide the chat text and Paper Clip Icon |
164
-
165
- ##### Interface FileUpload
166
-
167
- | Name | Type | Description |
168
- | ----------------- | -------------------------------------- | ---------------------------------------------------------------------- |
169
- | `allowFileUpload` | `boolean` | When true, users are able to upload image and video |
170
- | `file` | `string \| File \| any` | Image / video file |
171
- | `maxFileSize?` | `number` | Maximum file size |
172
- | `acceptFileType?` | `string` | Accepted file types (eg. ".jpg,.jpeg,.png,.svg,.tiff,.mp4,.webm,.ogg") |
173
- | `onChangeUpload` | `(event: any) => void` | Function to change file in file upload input |
174
- | `onSendUpload` | `(conversation: Conversation) => void` | Function to upload file |
175
-
176
- ##### Interface FileObj
177
-
178
- | Name | Type | Description |
179
- | ---------- | -------- | --------------------------- |
180
- | `fileName` | `string` | File name |
181
- | `token` | `string` | File token |
182
- | `type` | `string` | File type (eg. "image/png") |
183
-
184
- ##### Interface Conversation
185
-
186
- | Name | Type | Description |
187
- | ------------- | ----------- | ------------------------- |
188
- | `id` | `string` | Required id |
189
- | `members` | `User[]` | Required list of Users |
190
- | `messageList` | `Message[]` | Required list of Messages |
191
-
192
- ##### Interface User
193
-
194
- | Name | Type | Description |
195
- | ---------- | -------- | ----------------- |
196
- | `id` | `string` | Required id |
197
- | `name` | `string` | Required name |
198
- | `imageUrl` | `string` | Optional imageURL |
199
-
200
- ##### Interface Conversation
201
-
202
- | Name | Type | Description |
203
- | ------------- | ----------- | ------------------------- |
204
- | `id` | `string` | Required id |
205
- | `members` | `User[]` | Required list of Users |
206
- | `messageList` | `Message[]` | Required list of Messages |
207
-
208
- ##### Interface Message
209
-
210
- | Name | Type | Description |
211
- | ------------- | --------------- | ------------- |
212
- | `sender` | `User` | Required User |
213
- | `messageBody` | `string` | messageBody |
214
- | `reactElemet` | `React Element` | React Element |
215
- | `createdAt` | `Date` | Required date |
216
-
217
- ##### Interface ChatBaseAction
218
-
219
- | Name | Type | Description |
220
- | --------- | ------------- | ------------------------- |
221
- | `text` | `string` | Required text |
222
- | `onClick` | `() => void` | Required onClick function |
223
- | `icon` | `JSX.Element` | Required icon |
156
+ | Name | Type | Default | Description |
157
+ | ---------------------- | -------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------- |
158
+ | `fileUpload` | `FileUpload` | — | Enables file upload — see FileUpload below |
159
+ | `searchMessage` | `string` | — | Current search input value. Pass the filtered conversation to `conversation` to show results. |
160
+ | `headerElement` | `ReactElement` | — | Replaces the default blue "Chat" header bar |
161
+ | `bodyElement` | `ReactElement` | — | Replaces the default message list. Useful for loading states. |
162
+ | `footerElement` | `ReactElement` | — | Rendered above the message input. Useful for limit warnings or disclaimers. |
163
+ | `additionalAction` | `ChatBaseAction[]` | — | Extra items added to the ⋮ actions dropdown — see ChatBaseAction below |
164
+ | `hideAdditionalAction` | `boolean` | `false` | Hides the ⋮ actions dropdown entirely |
165
+ | `disableMessageInput` | `boolean` | `false` | Disables the message text input |
166
+ | `isLoadingReply` | `boolean` | `false` | Shows an animated typing indicator above the input and disables the input |
167
+ | `onHiddenChatText` | `boolean` | `false` | Hides the text input and paperclip icon. Useful when the input is managed externally. |
168
+ | `disableMobileResize` | `boolean` | `false` | Prevents the component from expanding to full screen on mobile |
169
+ | `sizeClassName` | `string` | `h-full w-full sm:h-[75vh] sm:w-96` | Tailwind classes controlling the component dimensions |
170
+ | `className` | `string` | — | Additional Tailwind classes applied to the outer container |
171
+ | `paddingTop` | `number` | `0` | Top padding in pixels. Used to offset the actions menu in mobile app layouts. |
172
+ | `inputActions` | `ReactElement[]` | — | Extra icon buttons rendered in the input row between the paperclip and the send button |
173
+ | `onSendMessage` | `(conversation: Conversation) => void` | — | Called with the updated conversation (including the new message) when send is triggered |
174
+ | `onChangeMessage` | `(event: any) => void` | — | Called on every keystroke in the message input |
175
+ | `onSearch` | `(searchMessage: string) => void` | — | Called when the search form is submitted |
176
+ | `onChangeSearch` | `(event: any) => void` | — | Called on every keystroke in the search input |
177
+ | `onClose` | `() => void` | — | Called when the mobile close (✕) button is tapped |
178
+ | `lib` | `{ axios?: any }` | — | Pass axios for file upload operations |
179
+
180
+ ##### FileUpload
181
+
182
+ | Name | Type | Description |
183
+ | ----------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
184
+ | `allowFileUpload` | `boolean` | Shows the paperclip button to trigger file selection |
185
+ | `hasFiles` | `boolean` | Tells the component files are selected — shows the send button and triggers `onSendMessage` on send |
186
+ | `multiple` | `boolean` | Allows picking multiple files at once |
187
+ | `acceptFileType` | `string` | Comma-separated accepted extensions, e.g. `".jpg,.png,.mp4,.pdf,.docx"`. Defaults to images only if omitted. |
188
+ | `onChangeUpload` | `(event: any) => void` | Called when files are selected via the file input. Consumer extracts files from `event.target.files` and manages their own `File[]` state |
189
+
190
+ ##### File rendering in message bubbles
191
+
192
+ | File type | Behaviour |
193
+ | ----------------- | ---------------------------------------------------------------------------------------------------- |
194
+ | `image/*` | Renders as an inline image. Click to open a full-size preview modal. Hover to download. |
195
+ | `video/*` | Renders as an inline video player. Hover to download. |
196
+ | `application/pdf` | Renders as a document icon + filename. Click to open a PDF preview modal. Download link shown below. |
197
+ | Other | Renders as a document icon + filename with a "Cannot preview" label. Download link shown below. |
198
+
199
+ ##### ChatBaseAction
200
+
201
+ | Name | Type | Description |
202
+ | --------- | ------------- | ---------------------------------------- |
203
+ | `text` | `string` | Label shown in the dropdown item |
204
+ | `onClick` | `() => void` | Called when the dropdown item is clicked |
205
+ | `icon` | `JSX.Element` | Icon rendered to the left of the label |
206
+
207
+ ##### Conversation
208
+
209
+ | Name | Type | Description |
210
+ | ------------- | ----------- | -------------------------------- |
211
+ | `id` | `string` | Unique conversation identifier |
212
+ | `members` | `User[]` | Participants in the conversation |
213
+ | `messageList` | `Message[]` | Ordered list of messages |
214
+
215
+ ##### Message
216
+
217
+ | Name | Type | Description |
218
+ | -------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------- |
219
+ | `sender` | `User` | The user who sent the message |
220
+ | `messageBody` | `string \| FileObj` | Text content (supports markdown for received messages) or a `FileObj` for image, video, PDF, or document messages |
221
+ | `reactElement` | `ReactElement` | Optional — replaces `messageBody` rendering with a custom element |
222
+ | `createdAt` | `Date` | Timestamp shown below the message bubble |
223
+ | `toolReport` | `ToolReport` | Optional — renders a compact tool log panel above the message body (see ToolReport below) |
224
+ | `isToolCall` | `boolean` | Optional — renders the message as a centred chip instead of a chat bubble (see Tool Calls) |
225
+
226
+ ##### ToolReport
227
+
228
+ Attach to an assistant `Message` to show which model and tools were used to produce the reply.
229
+
230
+ | Name | Type | Description |
231
+ | ------- | ------------ | ------------------------------------ |
232
+ | `model` | `string` | Optional model name shown at the top |
233
+ | `tools` | `ToolCall[]` | List of tool calls and their status |
234
+
235
+ ##### ToolCall
236
+
237
+ | Name | Type | Description |
238
+ | ---------- | -------------------------------- | -------------------------------------------------------------------------------- |
239
+ | `content` | `string` | Tool name displayed in the summary row |
240
+ | `request` | `string \| any` | Request payload — shown in the expandable details panel |
241
+ | `response` | `any` | Response payload — shown in the expandable details panel |
242
+ | `status` | `"pending" \| "done" \| "error"` | Dot colour: yellow pulsing (pending), green (done), red (error). Default pending |
243
+
244
+ ##### Tool Calls
245
+
246
+ When an AI pipeline stores tool invocations as separate messages (e.g. `author: "tool"` in a database), set `isToolCall: true` on those messages. They render as small centred chips between conversation bubbles — visually distinct from user/assistant messages.
247
+
248
+ ```jsx
249
+ const messages = chatList.map((chat) => ({
250
+ sender: chat.author === "assistant" ? botUser : userObj,
251
+ messageBody: chat.content,
252
+ createdAt: new Date(chat.createdAt),
253
+ isToolCall: chat.author === "tool",
254
+ }));
255
+ ```
256
+
257
+ ##### User
258
+
259
+ | Name | Type | Description |
260
+ | ---------- | -------- | -------------------------------------------------- |
261
+ | `id` | `string` | Unique user identifier |
262
+ | `name` | `string` | Display name shown above received message bubbles |
263
+ | `imageUrl` | `string` | Optional avatar URL. Falls back to a default icon. |
264
+
265
+ ##### FileObj
266
+
267
+ | Name | Type | Description |
268
+ | ---------- | -------- | ----------------------------------------------------------------- |
269
+ | `fileName` | `string` | File URL or path |
270
+ | `token` | `string` | Unique file token — also used as the display name in the bubble |
271
+ | `type` | `string` | MIME type, e.g. `"image/png"`, `"video/mp4"`, `"application/pdf"` |