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
|
@@ -5,20 +5,14 @@ import {
|
|
|
5
5
|
PencilIcon,
|
|
6
6
|
UserGroupIcon,
|
|
7
7
|
} from "@heroicons/react/24/outline";
|
|
8
|
-
import { storiesOf } from "@storybook/react";
|
|
9
8
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
10
9
|
import { StatsCard } from ".";
|
|
11
10
|
import { StorySection } from "../../storyUtils";
|
|
12
11
|
import { RangeInterface } from "../DateRange";
|
|
13
|
-
import README from "./README.md";
|
|
14
12
|
|
|
15
|
-
const
|
|
13
|
+
const meta = { title: "Chart/Stats Card" };
|
|
14
|
+
export default meta;
|
|
16
15
|
|
|
17
|
-
stories.addParameters({
|
|
18
|
-
readme: {
|
|
19
|
-
content: README,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
16
|
|
|
23
17
|
const baseStats = [
|
|
24
18
|
{
|
|
@@ -50,7 +44,7 @@ const baseStats = [
|
|
|
50
44
|
},
|
|
51
45
|
];
|
|
52
46
|
|
|
53
|
-
|
|
47
|
+
export const StatsCardStory = () => {
|
|
54
48
|
const chartDummyData = useMemo(() => {
|
|
55
49
|
const now = new Date();
|
|
56
50
|
const sevenDaysAgo = new Date();
|
|
@@ -180,4 +174,4 @@ stories.add("Stats Card", () => {
|
|
|
180
174
|
</StorySection>
|
|
181
175
|
</>
|
|
182
176
|
);
|
|
183
|
-
}
|
|
177
|
+
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { PencilIcon } from "@heroicons/react/24/outline";
|
|
2
|
-
import
|
|
3
|
-
import moment from "moment";
|
|
2
|
+
import dayjs from "../../dayjs";
|
|
4
3
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
4
|
import { TreemapChart } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Chart/Treemap Chart" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
export const TreemapChartStory = () => {
|
|
18
12
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
19
13
|
|
|
20
14
|
const chartDummyData = useMemo(() => {
|
|
@@ -79,7 +73,7 @@ stories.add("Treemap Chart", () => {
|
|
|
79
73
|
}, [handleSetData]);
|
|
80
74
|
|
|
81
75
|
const sevenDaysAgo = new Date();
|
|
82
|
-
sevenDaysAgo.setDate(
|
|
76
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
83
77
|
|
|
84
78
|
return (
|
|
85
79
|
<>
|
|
@@ -92,7 +86,7 @@ stories.add("Treemap Chart", () => {
|
|
|
92
86
|
dateRangeVisible={true}
|
|
93
87
|
customDate={{
|
|
94
88
|
startDate: sevenDaysAgo,
|
|
95
|
-
endDate:
|
|
89
|
+
endDate: dayjs().toDate(),
|
|
96
90
|
isDuration: true,
|
|
97
91
|
}}
|
|
98
92
|
onChangeDate={handleSetData}
|
|
@@ -108,7 +102,7 @@ stories.add("Treemap Chart", () => {
|
|
|
108
102
|
dateRangeVisible={true}
|
|
109
103
|
customDate={{
|
|
110
104
|
startDate: sevenDaysAgo,
|
|
111
|
-
endDate:
|
|
105
|
+
endDate: dayjs().toDate(),
|
|
112
106
|
isDuration: true,
|
|
113
107
|
}}
|
|
114
108
|
onChangeDate={handleSetData}
|
|
@@ -119,4 +113,4 @@ stories.add("Treemap Chart", () => {
|
|
|
119
113
|
/>
|
|
120
114
|
</>
|
|
121
115
|
);
|
|
122
|
-
}
|
|
116
|
+
}
|
|
@@ -4,110 +4,92 @@
|
|
|
4
4
|
|
|
5
5
|
<hr>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A floating chat button fixed to the viewport. Clicking it toggles the `ChatBase` panel open/closed with an animated transition. On mobile (< 640px) the chat panel expands to full screen when open.
|
|
8
8
|
|
|
9
9
|
##### Import
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import { ChatAnchor } from "blixify-ui-web/components/chat/chatAnchor";
|
|
13
|
-
import {
|
|
14
|
-
ChatBase,
|
|
15
|
-
Conversation,
|
|
16
|
-
} from "blixify-ui-web/components/chat/chatBase";
|
|
13
|
+
import { Conversation } from "blixify-ui-web/components/chat/chatBase";
|
|
17
14
|
```
|
|
18
15
|
|
|
19
16
|
##### Usage
|
|
20
17
|
|
|
21
18
|
```tsx
|
|
22
|
-
const [
|
|
19
|
+
const [open, setOpen] = useState(false);
|
|
23
20
|
const [message, setMessage] = useState("");
|
|
24
|
-
const [search, setSearch] = useState("");
|
|
25
|
-
const [filteredConversation, setFilteredConversation] =
|
|
26
|
-
useState<Conversation | null>();
|
|
27
21
|
const [conversation, setConversation] = useState<Conversation>({
|
|
28
22
|
id: "1",
|
|
29
23
|
members: [currentUser, botUser],
|
|
30
|
-
messageList: [
|
|
31
|
-
{
|
|
32
|
-
sender: botUser,
|
|
33
|
-
messageBody: "Hi! How can I help you? 🤖",
|
|
34
|
-
createdAt: moment(
|
|
35
|
-
"Fri Nov 03 2023 12:21:14 GMT+0800 (Malaysia Time)"
|
|
36
|
-
).toDate(),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
sender: currentUser,
|
|
40
|
-
messageBody: "Yo, my computer's acting up.",
|
|
41
|
-
createdAt: moment(
|
|
42
|
-
"Fri Nov 03 2023 13:21:14 GMT+0800 (Malaysia Time)"
|
|
43
|
-
).toDate(),
|
|
44
|
-
},
|
|
45
|
-
],
|
|
24
|
+
messageList: [],
|
|
46
25
|
});
|
|
47
26
|
|
|
48
|
-
const handleOnClick = () => setOpenChatBase(!openChatBase);
|
|
49
|
-
|
|
50
|
-
const handleOnSendMessage = (conversation: Conversation) => {
|
|
51
|
-
setConversation(conversation);
|
|
52
|
-
setMessage("");
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const handleOnSearch = (searchMessage: string) => {
|
|
56
|
-
if (searchMessage.length === 0) {
|
|
57
|
-
setSearch("");
|
|
58
|
-
setFilteredConversation(null);
|
|
59
|
-
} else {
|
|
60
|
-
const dupMessageList = conversation.messageList.filter((eachMessage) => {
|
|
61
|
-
return eachMessage.messageBody
|
|
62
|
-
.toLowerCase()
|
|
63
|
-
.includes(searchMessage.toLowerCase());
|
|
64
|
-
});
|
|
65
|
-
const dupConversation = {
|
|
66
|
-
id: conversation.id,
|
|
67
|
-
members: [...conversation.members],
|
|
68
|
-
messageList: [...dupMessageList],
|
|
69
|
-
};
|
|
70
|
-
setFilteredConversation(dupConversation);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const headerElement = (
|
|
75
|
-
<div className="p-2 bg-primary-500 rounded-t-md">
|
|
76
|
-
<img src={Logo} alt="" className="h-12" />
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
|
|
80
27
|
return (
|
|
81
28
|
<ChatAnchor
|
|
82
|
-
open={
|
|
29
|
+
open={open}
|
|
83
30
|
value={message}
|
|
84
31
|
currentUser={currentUser}
|
|
85
|
-
conversation={
|
|
86
|
-
headerElement={
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
32
|
+
conversation={conversation}
|
|
33
|
+
headerElement={
|
|
34
|
+
<div className="p-2 bg-primary-500">
|
|
35
|
+
<img src={Logo} className="h-12" />
|
|
36
|
+
</div>
|
|
37
|
+
}
|
|
38
|
+
onSendMessage={(c) => {
|
|
39
|
+
setConversation(c);
|
|
40
|
+
setMessage("");
|
|
41
|
+
}}
|
|
90
42
|
onChangeMessage={(e) => setMessage(e.target.value)}
|
|
91
|
-
|
|
92
|
-
|
|
43
|
+
onClose={() => setOpen(false)}
|
|
44
|
+
onClick={() => setOpen(!open)}
|
|
93
45
|
className="shadow-lg border border-gray-200"
|
|
94
|
-
|
|
46
|
+
greetingCard
|
|
47
|
+
greetingText="Ask me anything!"
|
|
95
48
|
/>
|
|
96
49
|
);
|
|
97
50
|
```
|
|
98
51
|
|
|
99
52
|
##### Required props
|
|
100
53
|
|
|
101
|
-
| Name
|
|
102
|
-
|
|
|
103
|
-
| onClick
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
| `
|
|
54
|
+
| Name | Type | Description |
|
|
55
|
+
| -------------- | -------------- | ------------------------------------------------------ |
|
|
56
|
+
| `onClick` | `() => void` | Called when the floating anchor button is clicked |
|
|
57
|
+
| `open` | `boolean` | Controls whether the chat panel is visible |
|
|
58
|
+
| `value` | `string` | Current value of the message input |
|
|
59
|
+
| `currentUser` | `User` | The logged-in user (`{ id, name, imageUrl? }`) |
|
|
60
|
+
| `conversation` | `Conversation` | Conversation object containing members and messageList |
|
|
61
|
+
|
|
62
|
+
##### Optional props — ChatAnchor specific
|
|
63
|
+
|
|
64
|
+
| Name | Type | Default | Description |
|
|
65
|
+
| ---------------- | ----------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `positionOffset` | `string` | `"bottom-8 right-8"` | Tailwind classes that control the fixed position of the anchor. Ignored on mobile when open. |
|
|
67
|
+
| `greetingCard` | `boolean` | `false` | When `true`, shows a greeting bubble next to the anchor button while the chat is closed. |
|
|
68
|
+
| `greetingText` | `string` | `"Welcome! How can I help you today?"` | Text displayed inside the greeting card bubble. |
|
|
69
|
+
| `openIcon` | `React.ReactNode` \| `string` | `ChatBubbleOvalLeftIcon` | Icon shown when the chat is closed. A string is treated as an image URL (64×64 rounded circle). |
|
|
70
|
+
| `closeIcon` | `React.ReactNode` \| `string` | `XMarkIcon` | Icon shown when the chat is open. A string is treated as an image URL (64×64 rounded circle). |
|
|
71
|
+
|
|
72
|
+
##### Optional props — inherited from ChatBase
|
|
73
|
+
|
|
74
|
+
| Name | Type | Description |
|
|
75
|
+
| ---------------------- | -------------------------------------- | ------------------------------------------------------------------------------ |
|
|
76
|
+
| `headerElement` | `ReactElement` | Custom header rendered at the top of the chat panel |
|
|
77
|
+
| `bodyElement` | `ReactElement` | Replaces the default message list with a custom element |
|
|
78
|
+
| `footerElement` | `ReactElement` | Rendered below the message list, above the input bar |
|
|
79
|
+
| `additionalAction` | `ChatBaseAction[]` | Extra items added to the actions dropdown menu |
|
|
80
|
+
| `hideAdditionalAction` | `boolean` | Hides the actions dropdown entirely |
|
|
81
|
+
| `disableMessageInput` | `boolean` | Disables the text input |
|
|
82
|
+
| `isLoadingReply` | `boolean` | Shows a typing indicator and disables input while waiting for a reply |
|
|
83
|
+
| `className` | `string` | Extra classes applied to the chat panel container |
|
|
84
|
+
| `sizeClassName` | `string` | Overrides the default panel size (`h-[75vh] w-96` on desktop) |
|
|
85
|
+
| `disableMobileResize` | `boolean` | Prevents the panel from going full screen on mobile |
|
|
86
|
+
| `paddingTop` | `number` | Top padding (px) applied to the chat panel — useful when a sticky bar overlaps |
|
|
87
|
+
| `searchMessage` | `string` | Current search query value |
|
|
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 is submitted |
|
|
91
|
+
| `onChangeSearch` | `(event: any) => void` | Called on every keystroke in the search input |
|
|
92
|
+
| `onClose` | `() => void` | Called when the mobile close button is tapped |
|
|
93
|
+
| `onHiddenChatText` | `boolean` | Hides the text input and file clip icon entirely |
|
|
94
|
+
| `fileUpload` | `FileUpload` | Configuration object for file upload support |
|
|
95
|
+
| `lib` | `{ axios?: any }` | Additional libraries (e.g. axios for file uploads) |
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import moment from "moment";
|
|
1
|
+
import dayjs from "../../dayjs";
|
|
3
2
|
import React, { useState } from "react";
|
|
4
3
|
import { ChatAnchor } from ".";
|
|
5
4
|
import Logo from "../../../assets/logo.png";
|
|
6
5
|
import { Conversation } from "../chatBase";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Chat/Chat Anchor" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
export const ChatAnchorStory = () => {
|
|
18
12
|
const botUser = {
|
|
19
13
|
id: "1",
|
|
20
14
|
name: "Bot",
|
|
@@ -36,14 +30,14 @@ stories.add("Chat Anchor", () => {
|
|
|
36
30
|
{
|
|
37
31
|
sender: botUser,
|
|
38
32
|
messageBody: "Hi! How can I help you? 🤖",
|
|
39
|
-
createdAt:
|
|
33
|
+
createdAt: dayjs(
|
|
40
34
|
"Fri Nov 03 2023 12:21:14 GMT+0800 (Malaysia Time)"
|
|
41
35
|
).toDate(),
|
|
42
36
|
},
|
|
43
37
|
{
|
|
44
38
|
sender: currentUser,
|
|
45
39
|
messageBody: "Yo, my computer's acting up.",
|
|
46
|
-
createdAt:
|
|
40
|
+
createdAt: dayjs(
|
|
47
41
|
"Fri Nov 03 2023 13:21:14 GMT+0800 (Malaysia Time)"
|
|
48
42
|
).toDate(),
|
|
49
43
|
},
|
|
@@ -51,7 +45,7 @@ stories.add("Chat Anchor", () => {
|
|
|
51
45
|
sender: currentUser,
|
|
52
46
|
messageBody:
|
|
53
47
|
"It keeps saying 'Error 404: Coffee not found' when I start it up.",
|
|
54
|
-
createdAt:
|
|
48
|
+
createdAt: dayjs(
|
|
55
49
|
"Fri Nov 03 2023 14:21:14 GMT+0800 (Malaysia Time)"
|
|
56
50
|
).toDate(),
|
|
57
51
|
},
|
|
@@ -59,14 +53,14 @@ stories.add("Chat Anchor", () => {
|
|
|
59
53
|
sender: botUser,
|
|
60
54
|
messageBody:
|
|
61
55
|
"Sounds like a caffeine emergency! Have you tried offering it coffee?",
|
|
62
|
-
createdAt:
|
|
56
|
+
createdAt: dayjs(
|
|
63
57
|
"Fri Nov 03 2023 15:21:14 GMT+0800 (Malaysia Time)"
|
|
64
58
|
).toDate(),
|
|
65
59
|
},
|
|
66
60
|
{
|
|
67
61
|
sender: currentUser,
|
|
68
62
|
messageBody: "Seriously?",
|
|
69
|
-
createdAt:
|
|
63
|
+
createdAt: dayjs(
|
|
70
64
|
"Fri Nov 03 2023 16:21:14 GMT+0800 (Malaysia Time)"
|
|
71
65
|
).toDate(),
|
|
72
66
|
},
|
|
@@ -74,14 +68,14 @@ stories.add("Chat Anchor", () => {
|
|
|
74
68
|
sender: botUser,
|
|
75
69
|
messageBody:
|
|
76
70
|
"Well, computers do like a jolt of energy, but don't spill, that could be 'mocha-nical' trouble!",
|
|
77
|
-
createdAt:
|
|
71
|
+
createdAt: dayjs(
|
|
78
72
|
"Fri Nov 03 2023 17:21:14 GMT+0800 (Malaysia Time)"
|
|
79
73
|
).toDate(),
|
|
80
74
|
},
|
|
81
75
|
{
|
|
82
76
|
sender: currentUser,
|
|
83
77
|
messageBody: "Cringe. I'll give it a shot. Thanks.",
|
|
84
|
-
createdAt:
|
|
78
|
+
createdAt: dayjs(
|
|
85
79
|
"Fri Nov 03 2023 18:21:14 GMT+0800 (Malaysia Time)"
|
|
86
80
|
).toDate(),
|
|
87
81
|
},
|
|
@@ -89,7 +83,7 @@ stories.add("Chat Anchor", () => {
|
|
|
89
83
|
sender: botUser,
|
|
90
84
|
messageBody:
|
|
91
85
|
"Anytime! If it demands a donut, that's on me. Have a brew-tiful day!",
|
|
92
|
-
createdAt:
|
|
86
|
+
createdAt: dayjs(
|
|
93
87
|
"Fri Nov 03 2023 19:21:14 GMT+0800 (Malaysia Time)"
|
|
94
88
|
).toDate(),
|
|
95
89
|
},
|
|
@@ -153,4 +147,4 @@ stories.add("Chat Anchor", () => {
|
|
|
153
147
|
/>
|
|
154
148
|
</div>
|
|
155
149
|
);
|
|
156
|
-
}
|
|
150
|
+
}
|