blixify-ui-web-mcp 0.1.1 → 0.1.3

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 (28) hide show
  1. package/lib/components/chart/ganttChart/README.md +96 -110
  2. package/lib/components/chart/ganttChart/ganttChart.stories.tsx +132 -116
  3. package/lib/components/chart/heatmapChart/README.md +93 -82
  4. package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +118 -74
  5. package/lib/components/chat/chatAnchor/README.md +61 -79
  6. package/lib/components/chat/chatBase/README.md +166 -199
  7. package/lib/components/chat/chatBase/chatBase.stories.tsx +243 -265
  8. package/lib/components/chat/chatDashboard/README.md +87 -129
  9. package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +84 -107
  10. package/lib/components/data/dataGraph/README.md +135 -1
  11. package/lib/components/data/dataGraph/dataGraph.stories.tsx +86 -67
  12. package/lib/components/data/dataReference/README.md +141 -43
  13. package/lib/components/data/dataReference/dataReference.stories.tsx +107 -35
  14. package/lib/components/data/dataWrapper/README.md +2 -1
  15. package/lib/components/display/table/README.md +1 -1
  16. package/lib/components/navigation/bars/README.md +90 -17
  17. package/lib/components/navigation/bars/bars.stories.tsx +125 -51
  18. package/lib/components/navigation/breadcrumb/README.md +40 -20
  19. package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +30 -4
  20. package/lib/components/navigation/header/README.md +67 -108
  21. package/lib/components/navigation/header/header.stories.tsx +143 -39
  22. package/lib/components/navigation/leftNav/README.md +121 -66
  23. package/lib/components/navigation/leftNav/leftNav.stories.tsx +176 -83
  24. package/lib/components/navigation/tabs/tabs.stories.tsx +53 -29
  25. package/lib/mcp/server.d.ts +1 -0
  26. package/lib/mcp/server.js +1 -0
  27. package/lib/mcp/server.js.map +1 -1
  28. package/package.json +1 -1
@@ -4,220 +4,187 @@
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 (image/video), a loading reply indicator, 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
+ User,
17
+ } from "blixify-ui-web/components/chat/chatBase";
13
18
  ```
14
19
 
15
20
  ##### Usage
16
21
 
17
- ```tsx
22
+ Basic chat:
23
+
24
+ ```jsx
18
25
  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
- };
66
-
67
- const handleOnClearMessage = () => {
68
- setFilteredConversation(null);
69
- setConversation({
26
+ const [conversation, setConversation] =
27
+ useState <
28
+ Conversation >
29
+ {
70
30
  id: "1",
71
31
  members: [currentUser, botUser],
72
- messageList: [],
73
- });
74
- };
75
-
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();
103
-
104
- const additionalAction: ChatBaseAction[] = [
105
- {
106
- text: "Clear",
107
- onClick: handleOnClearMessage,
108
- icon: <TrashIcon className="w-3 h-3" aria-hidden="true" />,
109
- },
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
- );
32
+ messageList: [
33
+ {
34
+ sender: botUser,
35
+ messageBody: "Hi! How can I help?",
36
+ createdAt: new Date(),
37
+ },
38
+ ],
39
+ };
40
+
41
+ <ChatBase
42
+ open
43
+ value={message}
44
+ currentUser={currentUser}
45
+ conversation={conversation}
46
+ onSendMessage={(updated) => {
47
+ setConversation(updated);
48
+ setMessage("");
49
+ }}
50
+ onChangeMessage={(e) => setMessage(e.target.value)}
51
+ sizeClassName="h-[500px] w-96"
52
+ disableMobileResize
53
+ />;
54
+ ```
55
+
56
+ With search:
57
+
58
+ ```jsx
59
+ <ChatBase
60
+ open
61
+ value={message}
62
+ currentUser={currentUser}
63
+ conversation={filteredConversation ?? conversation}
64
+ searchMessage={search}
65
+ onSearch={(q) => { /* filter conversation.messageList */ }}
66
+ onChangeSearch={(e) => setSearch(e.target.value)}
67
+ onSendMessage={...}
68
+ onChangeMessage={...}
69
+ />
70
+ ```
71
+
72
+ With file upload:
73
+
74
+ ```jsx
75
+ <ChatBase
76
+ open
77
+ value={message}
78
+ currentUser={currentUser}
79
+ conversation={conversation}
80
+ fileUpload={{
81
+ allowFileUpload: true,
82
+ file,
83
+ acceptFileType: ".jpg,.jpeg,.png,.mp4,.webm",
84
+ onChangeUpload: (e) => setFile(e.target.files[0]),
85
+ onSendUpload: (conversation) => { /* append file message */ },
86
+ }}
87
+ onSendMessage={...}
88
+ onChangeMessage={...}
89
+ />
90
+ ```
91
+
92
+ With loading reply indicator:
93
+
94
+ ```jsx
95
+ <ChatBase
96
+ open
97
+ value={message}
98
+ currentUser={currentUser}
99
+ conversation={conversation}
100
+ isLoadingReply={waitingForBot}
101
+ onSendMessage={...}
102
+ onChangeMessage={...}
103
+ />
132
104
  ```
133
105
 
134
106
  ##### Required props
135
107
 
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 |
108
+ | Name | Type | Description |
109
+ | -------------- | -------------- | -------------------------------------------------------------------- |
110
+ | `open` | `boolean` | When `false`, the component renders nothing |
111
+ | `value` | `string` | Current message input value |
112
+ | `currentUser` | `User` | The logged-in user — used to determine which side messages appear on |
113
+ | `conversation` | `Conversation` | The conversation to display — see Conversation below |
142
114
 
143
115
  ##### Optional props
144
116
 
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 |
117
+ | Name | Type | Default | Description |
118
+ | ---------------------- | -------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------- |
119
+ | `fileUpload` | `FileUpload` | — | Enables file upload — see FileUpload below |
120
+ | `searchMessage` | `string` | — | Current search input value. Pass the filtered conversation to `conversation` to show results. |
121
+ | `headerElement` | `ReactElement` | — | Replaces the default blue "Chat" header bar |
122
+ | `bodyElement` | `ReactElement` | — | Replaces the default message list. Useful for loading states. |
123
+ | `footerElement` | `ReactElement` | — | Rendered above the message input. Useful for limit warnings or disclaimers. |
124
+ | `additionalAction` | `ChatBaseAction[]` | — | Extra items added to the ⋮ actions dropdown — see ChatBaseAction below |
125
+ | `hideAdditionalAction` | `boolean` | `false` | Hides the ⋮ actions dropdown entirely |
126
+ | `disableMessageInput` | `boolean` | `false` | Disables the message text input |
127
+ | `isLoadingReply` | `boolean` | `false` | Shows an animated typing indicator above the input and disables the input |
128
+ | `onHiddenChatText` | `boolean` | `false` | Hides the text input and paperclip icon. Useful when the input is managed externally. |
129
+ | `disableMobileResize` | `boolean` | `false` | Prevents the component from expanding to full screen on mobile |
130
+ | `sizeClassName` | `string` | `h-full w-full sm:h-[75vh] sm:w-96` | Tailwind classes controlling the component dimensions |
131
+ | `className` | `string` | — | Additional Tailwind classes applied to the outer container |
132
+ | `paddingTop` | `number` | `0` | Top padding in pixels. Used to offset the actions menu in mobile app layouts. |
133
+ | `onSendMessage` | `(conversation: Conversation) => void` | — | Called with the updated conversation (including the new message) when send is triggered |
134
+ | `onChangeMessage` | `(event: any) => void` | — | Called on every keystroke in the message input |
135
+ | `onSearch` | `(searchMessage: string) => void` | — | Called when the search form is submitted |
136
+ | `onChangeSearch` | `(event: any) => void` | — | Called on every keystroke in the search input |
137
+ | `onClose` | `() => void` | — | Called when the mobile close (✕) button is tapped |
138
+ | `lib` | `{ axios?: any }` | — | Pass axios for file upload operations |
139
+
140
+ ##### FileUpload
141
+
142
+ | Name | Type | Description |
143
+ | ----------------- | -------------------------------------- | ----------------------------------------------------------------------------------------- |
144
+ | `allowFileUpload` | `boolean` | Shows the paperclip button to trigger file selection |
145
+ | `file` | `string \| File \| any` | Currently selected file |
146
+ | `maxFileSize` | `number` | Maximum file size in MB. Defaults to `15`. |
147
+ | `acceptFileType` | `string` | Comma-separated accepted extensions, e.g. `".jpg,.png,.mp4"` |
148
+ | `onChangeUpload` | `(event: any) => void` | Called when a file is selected via the file input |
149
+ | `onSendUpload` | `(conversation: Conversation) => void` | Called with the current conversation when the send button is clicked with a file selected |
150
+
151
+ ##### ChatBaseAction
152
+
153
+ | Name | Type | Description |
154
+ | --------- | ------------- | ---------------------------------------- |
155
+ | `text` | `string` | Label shown in the dropdown item |
156
+ | `onClick` | `() => void` | Called when the dropdown item is clicked |
157
+ | `icon` | `JSX.Element` | Icon rendered to the left of the label |
158
+
159
+ ##### Conversation
160
+
161
+ | Name | Type | Description |
162
+ | ------------- | ----------- | -------------------------------- |
163
+ | `id` | `string` | Unique conversation identifier |
164
+ | `members` | `User[]` | Participants in the conversation |
165
+ | `messageList` | `Message[]` | Ordered list of messages |
166
+
167
+ ##### Message
168
+
169
+ | Name | Type | Description |
170
+ | -------------- | ------------------- | ---------------------------------------------------------------------------------------------- |
171
+ | `sender` | `User` | The user who sent the message |
172
+ | `messageBody` | `string \| FileObj` | Text content (supports markdown for received messages) or a `FileObj` for image/video messages |
173
+ | `reactElement` | `ReactElement` | Optional — replaces `messageBody` rendering with a custom element |
174
+ | `createdAt` | `Date` | Timestamp shown below the message bubble |
175
+
176
+ ##### User
177
+
178
+ | Name | Type | Description |
179
+ | ---------- | -------- | -------------------------------------------------- |
180
+ | `id` | `string` | Unique user identifier |
181
+ | `name` | `string` | Display name shown above received message bubbles |
182
+ | `imageUrl` | `string` | Optional avatar URL. Falls back to a default icon. |
183
+
184
+ ##### FileObj
185
+
186
+ | Name | Type | Description |
187
+ | ---------- | -------- | ---------------------------------------------- |
188
+ | `fileName` | `string` | File URL or path |
189
+ | `token` | `string` | Unique file token |
190
+ | `type` | `string` | MIME type, e.g. `"image/png"` or `"video/mp4"` |