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,7 +4,7 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Chat Dashboard
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 [search, setSearch] = useState("");
20
- const [isLoading, setIsLoading] = useState(false);
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 handleMessageList = (id: string) => {
59
- setIsLoading(true);
23
+ const handleSelectConversation = (id: string) => {
60
24
  setMobileSelectedChat(true);
61
- setTimeout(() => {
62
- setIsLoading(false);
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 handleOnSearch = (searchMessage: string) => {
73
- if (searchMessage.length === 0) {
74
- setSearch("");
75
- setFilteredConversation(null);
76
- } else {
77
- const dupMessageList = conversation.messageList.filter((eachMessage) => {
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
- return (
92
- <ChatDashboard
93
- value={message}
94
- searchMessage={search}
95
- currentUser={currentUser}
96
- selectedConversation={filteredConversation ?? conversation}
97
- conversationList={conversationList}
98
- mobileSelectedChat={mobileSelectedChat}
99
- sizeClassName="w-full h-[50vh] sm:h-[50vh]"
100
- chatBaseSizeClassName="w-full h-[50vh] sm:h-[50vh]"
101
- headerElement={renderHeaderElement()}
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 | Type | Description |
115
- | -------------------- | ---------------- | --------------------------------------- |
116
- | value | `string` | Message input text |
117
- | currentUser | `User` | User Object |
118
- | selectedConversation | `Conversation` | Selected Conversation Object to display |
119
- | conversationList | `Conversation[]` | List of Conversation Objects |
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 | Type | Default | Description |
124
- | -------------------------- | -------------------- | ------------------------------- | --------------------------------- |
125
- | mobileSelectedChat | `boolean` | false | Mobile state for selected chat |
126
- | searchMessage | `string` | "" | Search input text |
127
- | headerElement | `React Element` | null | Replaces default component Header |
128
- | bodyElement | `React Element` | null | Replaces default component Body |
129
- | className | `tailwind classname` | "" | For component container |
130
- | sizeClassName | `tailwind classname` | "" | For component size |
131
- | chatBaseClassName | `tailwind classname` | "" | For Chat Base component container |
132
- | chatBaseSizeClassName | `tailwind classname` | "" | For Chat Base component size |
133
- | onSendMessage | `function` | `(event: any) => {}` | To send message |
134
- | onChangeMessage | `function` | `(event: any) => {}` | To type in message input |
135
- | onChangeSearch | `function` | `(event: any) => {}` | To type in search input |
136
- | onSearch | `function` | `(searchMessage: string) => {}` | To search in messages |
137
- | handleSelectedConversation | `function` | `(id: string) => {}` | Display selected conversation |
138
-
139
- ##### Interface User
140
-
141
- | Name | Type | Description |
142
- | ---------- | -------- | ----------------- |
143
- | `id` | `string` | Required id |
144
- | `name` | `string` | Required name |
145
- | `imageUrl` | `string` | Optional imageURL |
146
-
147
- ##### Interface Conversation
148
-
149
- | Name | Type | Description |
150
- | ------------- | ----------- | ------------------------- |
151
- | `id` | `string` | Required id |
152
- | `members` | `User[]` | Required list of Users |
153
- | `messageList` | `Message[]` | Required list of Messages |
154
-
155
- ##### Interface Message
156
-
157
- | Name | Type | Description |
158
- | ------------- | -------- | -------------------- |
159
- | `sender` | `User` | Required User |
160
- | `messageBody` | `string` | Required messageBody |
161
- | `createdAt` | `Date` | Required date |
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 |