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.
- package/lib/components/action/button/README.md +12 -11
- package/lib/components/action/button/button.stories.tsx +4 -10
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +4 -10
- package/lib/components/action/iconButton/iconButton.stories.tsx +4 -10
- package/lib/components/action/radioList/radioList.stories.tsx +4 -10
- package/lib/components/action/slider/slider.stories.tsx +4 -10
- package/lib/components/action/textButton/textButton.stories.tsx +4 -10
- package/lib/components/action/toggle/toggle.stories.tsx +4 -10
- package/lib/components/advanced/collapse/collapse.stories.tsx +4 -10
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +4 -10
- package/lib/components/advanced/popUp/README.md +21 -7
- package/lib/components/advanced/popUp/popUp.stories.tsx +4 -10
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +30 -10
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +4 -10
- package/lib/components/auth/signIn/signIn.stories.tsx +4 -10
- package/lib/components/auth/signUp/signUp.stories.tsx +4 -10
- package/lib/components/chart/areaChart/areaChart.stories.tsx +7 -13
- package/lib/components/chart/barChart/barChart.stories.tsx +7 -13
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +8 -14
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +8 -14
- package/lib/components/chart/card/card.stories.tsx +4 -10
- package/lib/components/chart/ganttChart/README.md +96 -110
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +135 -125
- package/lib/components/chart/heatmapChart/README.md +93 -82
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +122 -84
- package/lib/components/chart/lineChart/lineChart.stories.tsx +4 -10
- package/lib/components/chart/pieChart/pieChart.stories.tsx +4 -10
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +8 -14
- package/lib/components/chart/radarChart/radarChart.stories.tsx +4 -10
- package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +4 -10
- package/lib/components/chart/statsCard/statsCard.stories.tsx +4 -10
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +8 -14
- package/lib/components/chat/chatAnchor/README.md +61 -79
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +13 -19
- package/lib/components/chat/chatBase/README.md +244 -196
- package/lib/components/chat/chatBase/chatBase.stories.tsx +828 -250
- package/lib/components/chat/chatDashboard/README.md +89 -129
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +406 -117
- package/lib/components/data/dataGraph/README.md +135 -1
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +90 -77
- package/lib/components/data/dataReference/README.md +141 -43
- package/lib/components/data/dataReference/dataReference.stories.tsx +111 -45
- package/lib/components/data/dataTemplate/README.md +88 -61
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +4 -10
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +4 -10
- package/lib/components/data/dataWrapper/README.md +48 -46
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +258 -489
- package/lib/components/data/queryForm/queryForm.stories.tsx +4 -10
- package/lib/components/data/readQuery/readQuery.stories.tsx +4 -9
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +4 -10
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +4 -8
- package/lib/components/design/actionSection/actionSection.stories.tsx +6 -10
- package/lib/components/design/banner/banner.stories.tsx +4 -10
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +4 -10
- package/lib/components/design/blogSection/blogSection.stories.tsx +4 -10
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +4 -10
- package/lib/components/design/designList/designList.stories.tsx +4 -10
- package/lib/components/design/faq/faq.stories.tsx +4 -10
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +4 -10
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +4 -10
- package/lib/components/design/footerSection/footerSection.stories.tsx +4 -10
- package/lib/components/design/googleReview/googleReview.stories.tsx +4 -10
- package/lib/components/design/heroSection/heroSection.stories.tsx +4 -10
- package/lib/components/design/iconList/iconList.stories.tsx +4 -10
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +4 -10
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +4 -10
- package/lib/components/design/leftContent/leftContent.stories.tsx +4 -10
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +4 -10
- package/lib/components/design/onboarding/onboarding.stories.tsx +4 -10
- package/lib/components/design/pricing/pricing.stories.tsx +4 -10
- package/lib/components/design/rightContent/rightContent.stories.tsx +4 -10
- package/lib/components/design/sectionList/sectionList.stories.tsx +4 -10
- package/lib/components/design/teams/teams.stories.tsx +4 -10
- package/lib/components/display/alert/alert.stories.tsx +4 -10
- package/lib/components/display/calendar/README.md +49 -0
- package/lib/components/display/calendar/calendar.stories.tsx +71 -28
- package/lib/components/display/clipboard/clipboard.stories.tsx +4 -10
- package/lib/components/display/detailList/detailList.stories.tsx +5 -10
- package/lib/components/display/drawer/drawer.stories.tsx +5 -10
- package/lib/components/display/emptyState/emptyState.stories.tsx +4 -10
- package/lib/components/display/feeds/feeds.stories.tsx +4 -10
- package/lib/components/display/flexTable/README.md +11 -7
- package/lib/components/display/flexTable/flexTable.stories.tsx +114 -11
- package/lib/components/display/grid/README.md +28 -27
- package/lib/components/display/grid/grid.stories.tsx +4 -10
- package/lib/components/display/kanban/kanban.stories.tsx +14 -20
- package/lib/components/display/list/README.md +30 -29
- package/lib/components/display/list/list.stories.tsx +4 -10
- package/lib/components/display/loading/loading.stories.tsx +5 -10
- package/lib/components/display/mapView/mapView.stories.tsx +4 -10
- package/lib/components/display/modal/modal.stories.tsx +4 -11
- package/lib/components/display/notification/notification.stories.tsx +4 -10
- package/lib/components/display/progress/progress.stories.tsx +5 -10
- package/lib/components/display/stepper/stepper.stories.tsx +5 -10
- package/lib/components/display/table/README.md +38 -37
- package/lib/components/display/table/table.stories.tsx +8 -14
- package/lib/components/display/tag/tag.stories.tsx +4 -10
- package/lib/components/input/address/address.stories.tsx +4 -10
- package/lib/components/input/canvas/canvas.stories.tsx +4 -10
- package/lib/components/input/checkbox/checkbox.stories.tsx +4 -10
- package/lib/components/input/datePicker/datePicker.stories.tsx +4 -10
- package/lib/components/input/form/form.stories.tsx +4 -10
- package/lib/components/input/markdown/markdown.stories.tsx +5 -10
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +4 -10
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +4 -10
- package/lib/components/input/rating/rating.stories.tsx +4 -10
- package/lib/components/input/select/README.md +30 -29
- package/lib/components/input/select/select.stories.tsx +4 -10
- package/lib/components/input/signature/signature.stories.tsx +4 -10
- package/lib/components/input/textArea/textArea.stories.tsx +4 -10
- package/lib/components/input/textInput/textinput.stories.tsx +4 -10
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +135 -11
- package/lib/components/navigation/bars/README.md +90 -17
- package/lib/components/navigation/bars/bars.stories.tsx +128 -60
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +5 -10
- package/lib/components/navigation/breadcrumb/README.md +40 -20
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +34 -14
- package/lib/components/navigation/header/README.md +67 -108
- package/lib/components/navigation/header/header.stories.tsx +165 -49
- package/lib/components/navigation/leftNav/README.md +121 -66
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +178 -91
- package/lib/components/navigation/tabs/tabs.stories.tsx +57 -39
- package/lib/components/structure/column/column.stories.tsx +5 -10
- package/lib/components/structure/container/container.stories.tsx +5 -10
- package/lib/components/structure/link/link.stories.tsx +4 -10
- package/lib/components/structure/text/text.stories.tsx +5 -10
- package/lib/components/template/authPage/authPage.stories.tsx +6 -5
- package/lib/components/template/landingPage/landingPage.stories.tsx +8 -6
- package/lib/components/template/productListing/productListing.stories.tsx +7 -13
- package/lib/components/template/productOverview/productOverview.stories.tsx +5 -11
- package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +6 -12
- package/lib/components/template/userHomePage/userHomePage.stories.tsx +7 -6
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +5 -11
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<hr>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A two-panel chat layout with a scrollable conversation list on the left and a `ChatBase` chat window on the right. On mobile, the two panels toggle — the list hides when a conversation is selected and reappears when the user navigates back. The conversation list is sorted and updated automatically as new messages are sent.
|
|
8
8
|
|
|
9
9
|
##### Import
|
|
10
10
|
|
|
@@ -16,146 +16,106 @@ import { ChatDashboard } from "blixify-ui-web/components/chat/chatDashboard";
|
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
const [message, setMessage] = useState("");
|
|
19
|
-
const [
|
|
20
|
-
const [
|
|
19
|
+
const [conversation, setConversation] = useState<Conversation>(conversationList[0]);
|
|
20
|
+
const [conversationList, setConversationList] = useState<Conversation[]>(seedList);
|
|
21
21
|
const [mobileSelectedChat, setMobileSelectedChat] = useState(false);
|
|
22
|
-
const [filteredConversation, setFilteredConversation] =
|
|
23
|
-
useState<Conversation | null>();
|
|
24
|
-
const [conversation, setConversation] = useState<Conversation>({
|
|
25
|
-
id: "",
|
|
26
|
-
members: [],
|
|
27
|
-
messageList: [],
|
|
28
|
-
});
|
|
29
|
-
const [conversationList, setConversationList] = useState<Conversation[]>([]);
|
|
30
|
-
|
|
31
|
-
const handleOnSendMessage = (conversation: Conversation) => {
|
|
32
|
-
setConversation({
|
|
33
|
-
id: conversation.id,
|
|
34
|
-
members: [...conversation.members],
|
|
35
|
-
messageList: [...conversation.messageList],
|
|
36
|
-
});
|
|
37
|
-
setMessage("");
|
|
38
|
-
const dupConvoList = conversationList.map((eachConvo, i) => {
|
|
39
|
-
if (eachConvo.id === conversation.id) {
|
|
40
|
-
return conversation;
|
|
41
|
-
}
|
|
42
|
-
return eachConvo;
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
handleSortConvoList(dupConvoList);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleSortConvoList = (convoList: Conversation[]) => {
|
|
49
|
-
const sortedConvoList = convoList.sort((a, b) => {
|
|
50
|
-
return moment(b.messageList[b.messageList.length - 1].createdAt).diff(
|
|
51
|
-
moment(a.messageList[a.messageList.length - 1].createdAt)
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
setConversationList(sortedConvoList);
|
|
55
|
-
setConversation(sortedConvoList[0]);
|
|
56
|
-
};
|
|
57
22
|
|
|
58
|
-
const
|
|
59
|
-
setIsLoading(true);
|
|
23
|
+
const handleSelectConversation = (id: string) => {
|
|
60
24
|
setMobileSelectedChat(true);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
conversationList.map((eachConversation) => {
|
|
64
|
-
if (eachConversation.id === id) {
|
|
65
|
-
setConversation(eachConversation);
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
});
|
|
69
|
-
}, 1000);
|
|
25
|
+
const found = conversationList.find((c) => c.id === id);
|
|
26
|
+
if (found) setConversation(found);
|
|
70
27
|
};
|
|
71
28
|
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return eachMessage.messageBody
|
|
79
|
-
.toLowerCase()
|
|
80
|
-
.includes(searchMessage.toLowerCase());
|
|
81
|
-
});
|
|
82
|
-
const dupConversation = {
|
|
83
|
-
id: conversation.id,
|
|
84
|
-
members: [...conversation.members],
|
|
85
|
-
messageList: [...dupMessageList],
|
|
86
|
-
};
|
|
87
|
-
setFilteredConversation(dupConversation);
|
|
88
|
-
}
|
|
29
|
+
const handleSendMessage = (updated: Conversation) => {
|
|
30
|
+
setConversation(updated);
|
|
31
|
+
setMessage("");
|
|
32
|
+
setConversationList((prev) =>
|
|
33
|
+
prev.map((c) => (c.id === updated.id ? updated : c))
|
|
34
|
+
);
|
|
89
35
|
};
|
|
90
36
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
bodyElement={renderBodyElement()}
|
|
103
|
-
onChangeMessage={(e) => setMessage(e.target.value)}
|
|
104
|
-
handleSelectedConversation={handleMessageList}
|
|
105
|
-
onSendMessage={handleOnSendMessage}
|
|
106
|
-
onChangeSearch={(e) => setSearch(e.target.value)}
|
|
107
|
-
onSearch={handleOnSearch}
|
|
108
|
-
/>
|
|
37
|
+
// Custom header with a back button for mobile
|
|
38
|
+
const headerElement = (
|
|
39
|
+
<div className="flex items-center h-12 bg-primary-500 text-white px-4">
|
|
40
|
+
<button
|
|
41
|
+
className="sm:hidden mr-2"
|
|
42
|
+
onClick={() => setMobileSelectedChat(false)}
|
|
43
|
+
>
|
|
44
|
+
←
|
|
45
|
+
</button>
|
|
46
|
+
<span>{otherUser?.name}</span>
|
|
47
|
+
</div>
|
|
109
48
|
);
|
|
49
|
+
|
|
50
|
+
<ChatDashboard
|
|
51
|
+
value={message}
|
|
52
|
+
currentUser={currentUser}
|
|
53
|
+
selectedConversation={conversation}
|
|
54
|
+
conversationList={conversationList}
|
|
55
|
+
mobileSelectedChat={mobileSelectedChat}
|
|
56
|
+
sizeClassName="w-64 h-[60vh]"
|
|
57
|
+
chatBaseSizeClassName="w-full h-[60vh]"
|
|
58
|
+
headerElement={headerElement}
|
|
59
|
+
onChangeMessage={(e) => setMessage(e.target.value)}
|
|
60
|
+
onSendMessage={handleSendMessage}
|
|
61
|
+
handleSelectedConversation={handleSelectConversation}
|
|
62
|
+
/>
|
|
110
63
|
```
|
|
111
64
|
|
|
112
65
|
##### Required props
|
|
113
66
|
|
|
114
|
-
| Name
|
|
115
|
-
|
|
|
116
|
-
| value
|
|
117
|
-
| currentUser
|
|
118
|
-
| selectedConversation
|
|
119
|
-
| conversationList
|
|
67
|
+
| Name | Type | Description |
|
|
68
|
+
| ---------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| `value` | `string` | Current message input value |
|
|
70
|
+
| `currentUser` | `User` | The logged-in user — used to identify which side messages appear on and to find the other user in each conversation |
|
|
71
|
+
| `selectedConversation` | `Conversation` | The conversation currently displayed in the chat panel |
|
|
72
|
+
| `conversationList` | `Conversation[]` | All conversations shown in the left panel list |
|
|
73
|
+
| `handleSelectedConversation` | `(id: string) => void` | Called with the conversation `id` when a list item is clicked |
|
|
120
74
|
|
|
121
75
|
##### Optional props
|
|
122
76
|
|
|
123
|
-
| Name
|
|
124
|
-
|
|
|
125
|
-
| mobileSelectedChat
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
| onSearch
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
77
|
+
| Name | Type | Default | Description |
|
|
78
|
+
| ----------------------- | -------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| `mobileSelectedChat` | `boolean` | `false` | When `true`, hides the conversation list and shows the chat panel on mobile. Set to `false` to go back to the list. |
|
|
80
|
+
| `disableMessageInput` | `boolean` | `false` | When `true`, message input is disabled. |
|
|
81
|
+
| `searchMessage` | `string` | — | Current search input value. Pass a filtered conversation to `selectedConversation` to show results. |
|
|
82
|
+
| `headerElement` | `ReactElement` | — | Replaces the default `ChatBase` header. Use this to show the other user's name and a mobile back button. |
|
|
83
|
+
| `bodyElement` | `ReactElement` | — | Replaces the `ChatBase` message list. Useful for showing a loading spinner while fetching messages. |
|
|
84
|
+
| `className` | `string` | — | Tailwind classes for the conversation list panel container |
|
|
85
|
+
| `sizeClassName` | `string` | `h-[75vh]` | Tailwind classes controlling the height/width of the conversation list panel |
|
|
86
|
+
| `chatBaseClassName` | `string` | — | Tailwind classes for the `ChatBase` container |
|
|
87
|
+
| `chatBaseSizeClassName` | `string` | — | Tailwind classes controlling the height/width of the `ChatBase` panel |
|
|
88
|
+
| `onSendMessage` | `(conversation: Conversation) => void` | — | Called with the updated conversation when a message is sent |
|
|
89
|
+
| `onChangeMessage` | `(event: any) => void` | — | Called on every keystroke in the message input |
|
|
90
|
+
| `onSearch` | `(searchMessage: string) => void` | — | Called when the search form is submitted inside `ChatBase` |
|
|
91
|
+
| `onChangeSearch` | `(event: any) => void` | — | Called on every keystroke in the search input inside `ChatBase` |
|
|
92
|
+
| `additionalAction` | `ChatBaseAction[]` | — | Extra items appended to the `⋮` actions menu in the chat panel. Each item requires `text` and `onClick`, with an optional `icon`. |
|
|
93
|
+
|
|
94
|
+
##### Conversation list behaviour
|
|
95
|
+
|
|
96
|
+
Each item in `conversationList` renders the other user's avatar and name (the member whose `id` differs from `currentUser.id`) and the last message body as a preview. Items with a `FileObj` message body show an empty preview string.
|
|
97
|
+
|
|
98
|
+
##### User
|
|
99
|
+
|
|
100
|
+
| Name | Type | Description |
|
|
101
|
+
| ---------- | -------- | ------------------------------------------------- |
|
|
102
|
+
| `id` | `string` | Unique identifier |
|
|
103
|
+
| `name` | `string` | Display name |
|
|
104
|
+
| `imageUrl` | `string` | Avatar URL — shown in the conversation list items |
|
|
105
|
+
|
|
106
|
+
##### Conversation
|
|
107
|
+
|
|
108
|
+
| Name | Type | Description |
|
|
109
|
+
| ------------- | ----------- | ------------------------------------------------------------ |
|
|
110
|
+
| `id` | `string` | Unique conversation identifier |
|
|
111
|
+
| `members` | `User[]` | Participants — must include `currentUser` and one other user |
|
|
112
|
+
| `messageList` | `Message[]` | Ordered list of messages |
|
|
113
|
+
|
|
114
|
+
##### Message
|
|
115
|
+
|
|
116
|
+
| Name | Type | Description |
|
|
117
|
+
| -------------- | ------------------- | ----------------------------------------------------------------- |
|
|
118
|
+
| `sender` | `User` | The user who sent the message. |
|
|
119
|
+
| `messageBody` | `string \| FileObj` | Text content or a file object for image/video messages |
|
|
120
|
+
| `reactElement` | `ReactElement` | Optional — replaces `messageBody` rendering with a custom element |
|
|
121
|
+
| `createdAt` | `Date` | Timestamp |
|