blixify-ui-web-mcp 0.1.3 → 0.1.19
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 +38 -27
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +82 -16
- package/lib/components/action/iconButton/README.md +1 -0
- package/lib/components/action/iconButton/iconButton.stories.tsx +6 -12
- package/lib/components/action/radioList/radioList.stories.tsx +10 -16
- package/lib/components/action/slider/slider.stories.tsx +9 -15
- package/lib/components/action/textButton/textButton.stories.tsx +6 -12
- package/lib/components/action/toggle/toggle.stories.tsx +6 -12
- package/lib/components/advanced/collapse/collapse.stories.tsx +240 -24
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +10 -16
- package/lib/components/advanced/popUp/README.md +33 -7
- package/lib/components/advanced/popUp/popUp.stories.tsx +9 -15
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +36 -16
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +7 -13
- 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 +12 -18
- package/lib/components/chart/barChart/barChart.stories.tsx +12 -18
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +11 -17
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +11 -17
- package/lib/components/chart/card/card.stories.tsx +172 -38
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +10 -16
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +11 -17
- package/lib/components/chart/lineChart/lineChart.stories.tsx +8 -14
- package/lib/components/chart/pieChart/pieChart.stories.tsx +11 -17
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +11 -17
- package/lib/components/chart/radarChart/radarChart.stories.tsx +6 -12
- package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +8 -14
- package/lib/components/chart/statsCard/statsCard.stories.tsx +12 -18
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +11 -17
- package/lib/components/chat/chatAnchor/README.md +7 -0
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +15 -21
- package/lib/components/chat/chatBase/README.md +103 -22
- package/lib/components/chat/chatBase/chatBase.stories.tsx +657 -57
- package/lib/components/chat/chatDashboard/README.md +17 -15
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +358 -46
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +8 -14
- package/lib/components/data/dataReference/dataReference.stories.tsx +9 -15
- package/lib/components/data/dataTemplate/README.md +443 -129
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +10 -15
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +20 -34
- package/lib/components/data/dataWrapper/README.md +207 -84
- package/lib/components/data/dataWrapper/dataWrapper.consumer.stories.tsx +2125 -0
- package/lib/components/data/dataWrapper/dataWrapper.edit.stories.tsx +607 -0
- package/lib/components/data/dataWrapper/dataWrapper.utils.stories.tsx +576 -0
- package/lib/components/data/dataWrapper/dataWrapper.view.stories.tsx +1273 -0
- package/lib/components/data/flexFilter/flexFilter.stories.tsx +171 -0
- package/lib/components/data/queryForm/queryForm.stories.tsx +6 -12
- package/lib/components/data/readQuery/readQuery.stories.tsx +6 -11
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +6 -12
- package/lib/components/data/writeQuery/README.md +21 -10
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +6 -10
- package/lib/components/design/actionSection/actionSection.stories.tsx +10 -14
- package/lib/components/design/banner/banner.stories.tsx +6 -12
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +100 -21
- package/lib/components/design/blogSection/blogSection.stories.tsx +6 -12
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +6 -12
- package/lib/components/design/designList/designList.stories.tsx +6 -12
- package/lib/components/design/faq/faq.stories.tsx +53 -31
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +10 -16
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +6 -12
- package/lib/components/design/footerSection/footerSection.stories.tsx +6 -12
- package/lib/components/design/googleReview/googleReview.stories.tsx +6 -12
- package/lib/components/design/heroSection/heroSection.stories.tsx +10 -16
- package/lib/components/design/iconList/iconList.stories.tsx +6 -12
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +6 -12
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +6 -12
- package/lib/components/design/leftContent/leftContent.stories.tsx +6 -12
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +6 -12
- package/lib/components/design/onboarding/onboarding.stories.tsx +8 -14
- package/lib/components/design/pricing/pricing.stories.tsx +6 -12
- package/lib/components/design/rightContent/rightContent.stories.tsx +6 -12
- package/lib/components/design/sectionList/sectionList.stories.tsx +6 -12
- package/lib/components/design/teams/teams.stories.tsx +6 -12
- package/lib/components/display/alert/alert.stories.tsx +8 -14
- package/lib/components/display/calendar/README.md +49 -0
- package/lib/components/display/calendar/calendar.stories.tsx +78 -35
- package/lib/components/display/clipboard/clipboard.stories.tsx +6 -12
- package/lib/components/display/detailList/detailList.stories.tsx +172 -48
- package/lib/components/display/drawer/README.md +44 -11
- package/lib/components/display/drawer/drawer.stories.tsx +71 -16
- package/lib/components/display/emptyState/emptyState.stories.tsx +47 -15
- package/lib/components/display/feeds/feeds.stories.tsx +6 -12
- package/lib/components/display/flexTable/README.md +11 -7
- package/lib/components/display/flexTable/flexTable.stories.tsx +318 -20
- package/lib/components/display/grid/README.md +29 -30
- package/lib/components/display/grid/grid.stories.tsx +16 -23
- package/lib/components/display/kanban/kanban.stories.tsx +17 -23
- package/lib/components/display/list/README.md +30 -29
- package/lib/components/display/list/list.stories.tsx +11 -17
- package/lib/components/display/loading/loading.stories.tsx +7 -12
- package/lib/components/display/mapView/mapView.stories.tsx +9 -15
- package/lib/components/display/modal/modal.stories.tsx +6 -13
- package/lib/components/display/newCalendar/README.md +163 -0
- package/lib/components/display/newCalendar/newCalendar.stories.tsx +292 -0
- package/lib/components/display/newFeeds/README.md +53 -0
- package/lib/components/display/newFeeds/newFeeds.stories.tsx +104 -0
- package/lib/components/display/newKanban/README.md +25 -0
- package/lib/components/display/newKanban/newKanban.stories.tsx +131 -0
- package/lib/components/display/newList/README.md +30 -0
- package/lib/components/display/newList/newList.stories.tsx +231 -0
- package/lib/components/display/newPagination/README.md +15 -0
- package/lib/components/display/newTable/README.md +121 -0
- package/lib/components/display/newTable/newTable.stories.tsx +551 -0
- package/lib/components/display/notification/notification.stories.tsx +6 -12
- package/lib/components/display/progress/progress.stories.tsx +7 -12
- package/lib/components/display/stepper/README.md +4 -0
- package/lib/components/display/stepper/stepper.stories.tsx +70 -23
- package/lib/components/display/table/README.md +38 -37
- package/lib/components/display/table/table.stories.tsx +34 -36
- package/lib/components/display/tag/tag.stories.tsx +34 -40
- package/lib/components/input/address/address.stories.tsx +12 -18
- package/lib/components/input/canvas/canvas.stories.tsx +12 -18
- package/lib/components/input/checkbox/checkbox.stories.tsx +7 -13
- package/lib/components/input/datePicker/datePicker.stories.tsx +41 -11
- package/lib/components/input/form/form.stories.tsx +11 -17
- package/lib/components/input/markdown/README.md +80 -2
- package/lib/components/input/markdown/markdown.stories.tsx +83 -32
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +52 -24
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +6 -12
- package/lib/components/input/rating/rating.stories.tsx +6 -12
- package/lib/components/input/select/README.md +31 -29
- package/lib/components/input/select/select.stories.tsx +33 -39
- package/lib/components/input/signature/signature.stories.tsx +12 -18
- package/lib/components/input/textArea/textArea.stories.tsx +6 -12
- package/lib/components/input/textInput/textinput.stories.tsx +14 -20
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +143 -19
- package/lib/components/navigation/bars/README.md +27 -0
- package/lib/components/navigation/bars/bars.stories.tsx +56 -19
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +7 -12
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +8 -14
- package/lib/components/navigation/header/header.stories.tsx +33 -21
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +10 -16
- package/lib/components/navigation/tabs/tabs.stories.tsx +10 -16
- package/lib/components/structure/column/column.stories.tsx +10 -15
- package/lib/components/structure/container/container.stories.tsx +8 -13
- package/lib/components/structure/link/link.stories.tsx +11 -17
- package/lib/components/structure/text/text.stories.tsx +12 -17
- package/lib/components/template/authPage/authPage.stories.tsx +6 -5
- package/lib/components/template/calendarView/calendarView.stories.tsx +726 -0
- package/lib/components/template/chatDashboard/chatDashboard.stories.tsx +497 -0
- package/lib/components/template/landingPage/landingPage.stories.tsx +10 -7
- package/lib/components/template/mapLayout/mapLayout.stories.tsx +519 -0
- 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 +384 -524
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +145 -75
- package/lib/mcp/tools/componentsRoot.d.ts +2 -0
- package/lib/mcp/tools/componentsRoot.d.ts.map +1 -0
- package/lib/mcp/tools/componentsRoot.js +59 -0
- package/lib/mcp/tools/componentsRoot.js.map +1 -0
- package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getBackendComponent.js +2 -5
- package/lib/mcp/tools/getBackendComponent.js.map +1 -1
- package/lib/mcp/tools/getComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getComponent.js +2 -5
- package/lib/mcp/tools/getComponent.js.map +1 -1
- package/lib/mcp/tools/listComponents.d.ts.map +1 -1
- package/lib/mcp/tools/listComponents.js +15 -10
- package/lib/mcp/tools/listComponents.js.map +1 -1
- package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -1
- package/lib/mcp/tools/suggestTemplate.js +107 -21
- package/lib/mcp/tools/suggestTemplate.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +0 -831
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useRef, useState } from "react";
|
|
3
|
-
import { BareSignUp } from ".";
|
|
2
|
+
import { BareSignUp as BareSignUpImpl } from ".";
|
|
4
3
|
import { Option, Select } from "../../input/select";
|
|
5
4
|
import { TextInput } from "../../input/textInput";
|
|
6
5
|
import { AvailableProvider } from "../bareSignIn";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
import { StorySection } from "../../storyUtils";
|
|
9
7
|
|
|
10
|
-
const
|
|
8
|
+
const meta = { title: "Auth/Bare Sign Up" };
|
|
9
|
+
export default meta;
|
|
11
10
|
|
|
12
|
-
stories.addParameters({
|
|
13
|
-
readme: {
|
|
14
|
-
content: README,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
11
|
|
|
18
12
|
const genderOptions: Option[] = [
|
|
19
13
|
{ key: "M", label: "Male" },
|
|
20
14
|
{ key: "F", label: "Female" },
|
|
21
15
|
];
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
export const BareSignUp = () => {
|
|
24
18
|
const custFormRef: any = useRef(null);
|
|
25
19
|
const signUpFormRef: any = useRef(null);
|
|
26
20
|
const input1: any = useRef(null);
|
|
@@ -118,7 +112,7 @@ stories.add("Bare Sign Up", () => {
|
|
|
118
112
|
}
|
|
119
113
|
>
|
|
120
114
|
<div className="p-4 w-full max-w-md bg-white rounded-lg shadow-sm border border-gray-100">
|
|
121
|
-
<
|
|
115
|
+
<BareSignUpImpl
|
|
122
116
|
type={signUpType}
|
|
123
117
|
stepIndex={stepIndex}
|
|
124
118
|
handleUpdateStepIndex={setStepIndex}
|
|
@@ -141,7 +135,7 @@ stories.add("Bare Sign Up", () => {
|
|
|
141
135
|
}
|
|
142
136
|
>
|
|
143
137
|
<div className="p-4 w-full max-w-sm bg-white rounded-lg shadow-sm border border-gray-100">
|
|
144
|
-
<
|
|
138
|
+
<BareSignUpImpl
|
|
145
139
|
type={signUpType}
|
|
146
140
|
stepIndex={stepIndex}
|
|
147
141
|
handleUpdateStepIndex={setStepIndex}
|
|
@@ -156,4 +150,4 @@ stories.add("Bare Sign Up", () => {
|
|
|
156
150
|
</StorySection>
|
|
157
151
|
</div>
|
|
158
152
|
);
|
|
159
|
-
}
|
|
153
|
+
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { SignInTemplate } from ".";
|
|
4
3
|
import { AvailableProvider } from "../bareSignIn";
|
|
5
|
-
import README from "./README.md";
|
|
6
4
|
import { StorySection } from "../../storyUtils";
|
|
7
5
|
|
|
8
|
-
const
|
|
6
|
+
const meta = { title: "Auth/Sign In" };
|
|
7
|
+
export default meta;
|
|
9
8
|
|
|
10
|
-
stories.addParameters({
|
|
11
|
-
readme: {
|
|
12
|
-
content: README,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
9
|
|
|
16
10
|
const contactInfo = (
|
|
17
11
|
<>
|
|
@@ -57,7 +51,7 @@ const contactInfo = (
|
|
|
57
51
|
</>
|
|
58
52
|
);
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
export const SignIn = () => {
|
|
61
55
|
const [provider, setProvider] = useState<typeof AvailableProvider>("email");
|
|
62
56
|
|
|
63
57
|
return (
|
|
@@ -117,4 +111,4 @@ stories.add("Sign In", () => {
|
|
|
117
111
|
</StorySection>
|
|
118
112
|
</div>
|
|
119
113
|
);
|
|
120
|
-
}
|
|
114
|
+
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useRef, useState } from "react";
|
|
3
2
|
import { SignUpTemplate } from ".";
|
|
4
3
|
import { Stepper } from "../../display/stepper";
|
|
5
4
|
import { Option, Select } from "../../input/select";
|
|
6
5
|
import { TextInput } from "../../input/textInput";
|
|
7
6
|
import { AvailableProvider } from "../bareSignIn";
|
|
8
|
-
import README from "./README.md";
|
|
9
7
|
import { StorySection } from "../../storyUtils";
|
|
10
8
|
|
|
11
|
-
const
|
|
9
|
+
const meta = { title: "Auth/Sign Up" };
|
|
10
|
+
export default meta;
|
|
12
11
|
|
|
13
|
-
stories.addParameters({
|
|
14
|
-
readme: {
|
|
15
|
-
content: README,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
12
|
|
|
19
13
|
const genderOptions: Option[] = [
|
|
20
14
|
{ key: "M", label: "Male" },
|
|
@@ -33,7 +27,7 @@ const signUpSteps = [
|
|
|
33
27
|
},
|
|
34
28
|
];
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
export const SignUp = () => {
|
|
37
31
|
const custFormRef: any = useRef(null);
|
|
38
32
|
const signUpFormRef: any = useRef(null);
|
|
39
33
|
const input1: any = useRef(null);
|
|
@@ -190,4 +184,4 @@ stories.add("Sign Up", () => {
|
|
|
190
184
|
</StorySection>
|
|
191
185
|
</div>
|
|
192
186
|
);
|
|
193
|
-
}
|
|
187
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
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
|
-
import { AreaChart } from ".";
|
|
4
|
+
import { AreaChart as AreaChartImpl } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
import { StorySection } from "../../storyUtils";
|
|
9
7
|
|
|
10
|
-
const
|
|
8
|
+
const meta = { title: "Chart/Area Chart" };
|
|
9
|
+
export default meta;
|
|
11
10
|
|
|
12
|
-
stories.addParameters({
|
|
13
|
-
readme: {
|
|
14
|
-
content: README,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
11
|
|
|
18
12
|
const stackedAreaSeries = [
|
|
19
13
|
{
|
|
@@ -51,7 +45,7 @@ const rawData = [
|
|
|
51
45
|
{ label: "Banana", value: 55, daysAgo: 28 },
|
|
52
46
|
];
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
export const AreaChart = () => {
|
|
55
49
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
56
50
|
|
|
57
51
|
const chartDummyData = useMemo(() => {
|
|
@@ -86,11 +80,11 @@ stories.add("Area Chart", () => {
|
|
|
86
80
|
}, [handleSetData]);
|
|
87
81
|
|
|
88
82
|
const sevenDaysAgo = new Date();
|
|
89
|
-
sevenDaysAgo.setDate(
|
|
83
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
90
84
|
|
|
91
85
|
const defaultDateRange: RangeInterface = {
|
|
92
86
|
startDate: sevenDaysAgo,
|
|
93
|
-
endDate:
|
|
87
|
+
endDate: dayjs().toDate(),
|
|
94
88
|
isDuration: true,
|
|
95
89
|
};
|
|
96
90
|
|
|
@@ -108,7 +102,7 @@ stories.add("Area Chart", () => {
|
|
|
108
102
|
</>
|
|
109
103
|
}
|
|
110
104
|
>
|
|
111
|
-
<
|
|
105
|
+
<AreaChartImpl
|
|
112
106
|
title="Sales"
|
|
113
107
|
seriesName="Value"
|
|
114
108
|
seriesData={seriesData}
|
|
@@ -132,7 +126,7 @@ stories.add("Area Chart", () => {
|
|
|
132
126
|
</>
|
|
133
127
|
}
|
|
134
128
|
>
|
|
135
|
-
<
|
|
129
|
+
<AreaChartImpl
|
|
136
130
|
title="Sales by Region"
|
|
137
131
|
categories={categories}
|
|
138
132
|
stackedAreaSeries={stackedAreaSeries}
|
|
@@ -158,7 +152,7 @@ stories.add("Area Chart", () => {
|
|
|
158
152
|
}
|
|
159
153
|
dark
|
|
160
154
|
>
|
|
161
|
-
<
|
|
155
|
+
<AreaChartImpl
|
|
162
156
|
title="Sales by Region"
|
|
163
157
|
categories={categories}
|
|
164
158
|
stackedAreaSeries={stackedAreaSeries}
|
|
@@ -185,7 +179,7 @@ stories.add("Area Chart", () => {
|
|
|
185
179
|
</>
|
|
186
180
|
}
|
|
187
181
|
>
|
|
188
|
-
<
|
|
182
|
+
<AreaChartImpl
|
|
189
183
|
title="Sales"
|
|
190
184
|
seriesName="Value"
|
|
191
185
|
seriesData={seriesData}
|
|
@@ -196,4 +190,4 @@ stories.add("Area Chart", () => {
|
|
|
196
190
|
</StorySection>
|
|
197
191
|
</div>
|
|
198
192
|
);
|
|
199
|
-
}
|
|
193
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
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
|
-
import { BarChart } from ".";
|
|
4
|
+
import { BarChart as BarChartImpl } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
import { StorySection } from "../../storyUtils";
|
|
9
7
|
|
|
10
|
-
const
|
|
8
|
+
const meta = { title: "Chart/Bar Chart" };
|
|
9
|
+
export default meta;
|
|
11
10
|
|
|
12
|
-
stories.addParameters({
|
|
13
|
-
readme: {
|
|
14
|
-
content: README,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
11
|
|
|
18
12
|
const stackedSeries = [
|
|
19
13
|
{ name: "Company A", data: [400, 430, 448] },
|
|
@@ -29,7 +23,7 @@ const rawData = [
|
|
|
29
23
|
{ label: "Banana", value: 55, daysAgo: 28 },
|
|
30
24
|
];
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
export const BarChart = () => {
|
|
33
27
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
34
28
|
|
|
35
29
|
const chartDummyData = useMemo(() => {
|
|
@@ -64,11 +58,11 @@ stories.add("Bar Chart", () => {
|
|
|
64
58
|
}, [handleSetData]);
|
|
65
59
|
|
|
66
60
|
const sevenDaysAgo = new Date();
|
|
67
|
-
sevenDaysAgo.setDate(
|
|
61
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
68
62
|
|
|
69
63
|
const defaultDateRange: RangeInterface = {
|
|
70
64
|
startDate: sevenDaysAgo,
|
|
71
|
-
endDate:
|
|
65
|
+
endDate: dayjs().toDate(),
|
|
72
66
|
isDuration: true,
|
|
73
67
|
};
|
|
74
68
|
|
|
@@ -86,7 +80,7 @@ stories.add("Bar Chart", () => {
|
|
|
86
80
|
</>
|
|
87
81
|
}
|
|
88
82
|
>
|
|
89
|
-
<
|
|
83
|
+
<BarChartImpl
|
|
90
84
|
title="Sales"
|
|
91
85
|
seriesName="Value"
|
|
92
86
|
seriesData={seriesData}
|
|
@@ -112,7 +106,7 @@ stories.add("Bar Chart", () => {
|
|
|
112
106
|
</>
|
|
113
107
|
}
|
|
114
108
|
>
|
|
115
|
-
<
|
|
109
|
+
<BarChartImpl
|
|
116
110
|
title="Sales by Company"
|
|
117
111
|
stackedBarSeries={stackedSeries}
|
|
118
112
|
orientation="col"
|
|
@@ -138,7 +132,7 @@ stories.add("Bar Chart", () => {
|
|
|
138
132
|
}
|
|
139
133
|
dark
|
|
140
134
|
>
|
|
141
|
-
<
|
|
135
|
+
<BarChartImpl
|
|
142
136
|
title="Sales by Company"
|
|
143
137
|
stackedBarSeries={stackedSeries}
|
|
144
138
|
orientation="col"
|
|
@@ -171,7 +165,7 @@ stories.add("Bar Chart", () => {
|
|
|
171
165
|
>
|
|
172
166
|
<div className="overflow-x-auto w-full">
|
|
173
167
|
<div className="min-w-[600px]">
|
|
174
|
-
<
|
|
168
|
+
<BarChartImpl
|
|
175
169
|
title=""
|
|
176
170
|
containerStyle="bg-gradient-to-b from-[#4a3aff] to-[#6959ff] rounded-2xl p-6 shadow-lg"
|
|
177
171
|
categories={["May", "Jun", "Jul", "Aug", "Sep", "Oct"]}
|
|
@@ -315,4 +309,4 @@ stories.add("Bar Chart", () => {
|
|
|
315
309
|
</StorySection>
|
|
316
310
|
</div>
|
|
317
311
|
);
|
|
318
|
-
}
|
|
312
|
+
}
|
|
@@ -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
|
-
import { BoxPlotChart } from ".";
|
|
4
|
+
import { BoxPlotChart as BoxPlotChartImpl } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Chart/Box Plot Chart" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
export const BoxPlotChart = () => {
|
|
18
12
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
19
13
|
|
|
20
14
|
const chartDummyData = useMemo(() => {
|
|
@@ -59,12 +53,12 @@ stories.add("Box Plot Chart", () => {
|
|
|
59
53
|
}, [handleSetData]);
|
|
60
54
|
|
|
61
55
|
const sevenDaysAgo = new Date();
|
|
62
|
-
sevenDaysAgo.setDate(
|
|
56
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
63
57
|
|
|
64
58
|
return (
|
|
65
59
|
<>
|
|
66
60
|
<div className="font-medium mb-5">Box Plot Chart</div>
|
|
67
|
-
<
|
|
61
|
+
<BoxPlotChartImpl
|
|
68
62
|
title="Electric Generation Performance"
|
|
69
63
|
seriesName="Journey Performance"
|
|
70
64
|
seriesData={seriesData}
|
|
@@ -72,7 +66,7 @@ stories.add("Box Plot Chart", () => {
|
|
|
72
66
|
dateRangeVisible={true}
|
|
73
67
|
customDate={{
|
|
74
68
|
startDate: sevenDaysAgo,
|
|
75
|
-
endDate:
|
|
69
|
+
endDate: dayjs().toDate(),
|
|
76
70
|
isDuration: true,
|
|
77
71
|
}}
|
|
78
72
|
onChangeDate={handleSetData}
|
|
@@ -82,7 +76,7 @@ stories.add("Box Plot Chart", () => {
|
|
|
82
76
|
xaxisTitle="Quarters"
|
|
83
77
|
/>
|
|
84
78
|
<div className="font-medium my-5">Dark Mode Box Plot Chart</div>
|
|
85
|
-
<
|
|
79
|
+
<BoxPlotChartImpl
|
|
86
80
|
title="Performance Distribution"
|
|
87
81
|
seriesName="Data Distribution"
|
|
88
82
|
seriesData={seriesData}
|
|
@@ -90,7 +84,7 @@ stories.add("Box Plot Chart", () => {
|
|
|
90
84
|
dateRangeVisible={true}
|
|
91
85
|
customDate={{
|
|
92
86
|
startDate: sevenDaysAgo,
|
|
93
|
-
endDate:
|
|
87
|
+
endDate: dayjs().toDate(),
|
|
94
88
|
isDuration: true,
|
|
95
89
|
}}
|
|
96
90
|
onChangeDate={handleSetData}
|
|
@@ -101,4 +95,4 @@ stories.add("Box Plot Chart", () => {
|
|
|
101
95
|
/>
|
|
102
96
|
</>
|
|
103
97
|
);
|
|
104
|
-
}
|
|
98
|
+
}
|
|
@@ -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
|
-
import { BubbleChart } from ".";
|
|
4
|
+
import { BubbleChart as BubbleChartImpl } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Chart/Bubble Chart" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
export const BubbleChart = () => {
|
|
18
12
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
19
13
|
|
|
20
14
|
const chartDummyData = useMemo(() => {
|
|
@@ -99,12 +93,12 @@ stories.add("Bubble Chart", () => {
|
|
|
99
93
|
}, [handleSetData]);
|
|
100
94
|
|
|
101
95
|
const sevenDaysAgo = new Date();
|
|
102
|
-
sevenDaysAgo.setDate(
|
|
96
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
103
97
|
|
|
104
98
|
return (
|
|
105
99
|
<>
|
|
106
100
|
<div className="font-medium mb-5">Bubble Chart</div>
|
|
107
|
-
<
|
|
101
|
+
<BubbleChartImpl
|
|
108
102
|
title="Page Views vs Time Spent"
|
|
109
103
|
seriesName="Pages"
|
|
110
104
|
seriesData={seriesData}
|
|
@@ -112,7 +106,7 @@ stories.add("Bubble Chart", () => {
|
|
|
112
106
|
dateRangeVisible={true}
|
|
113
107
|
customDate={{
|
|
114
108
|
startDate: sevenDaysAgo,
|
|
115
|
-
endDate:
|
|
109
|
+
endDate: dayjs().toDate(),
|
|
116
110
|
isDuration: true,
|
|
117
111
|
}}
|
|
118
112
|
onChangeDate={handleSetData}
|
|
@@ -122,7 +116,7 @@ stories.add("Bubble Chart", () => {
|
|
|
122
116
|
yaxisTitle="Value B"
|
|
123
117
|
/>
|
|
124
118
|
<div className="font-medium my-5">Dark Mode Bubble Chart</div>
|
|
125
|
-
<
|
|
119
|
+
<BubbleChartImpl
|
|
126
120
|
title="Analytics Overview"
|
|
127
121
|
seriesName="Data Points"
|
|
128
122
|
seriesData={seriesData}
|
|
@@ -130,7 +124,7 @@ stories.add("Bubble Chart", () => {
|
|
|
130
124
|
dateRangeVisible={true}
|
|
131
125
|
customDate={{
|
|
132
126
|
startDate: sevenDaysAgo,
|
|
133
|
-
endDate:
|
|
127
|
+
endDate: dayjs().toDate(),
|
|
134
128
|
isDuration: true,
|
|
135
129
|
}}
|
|
136
130
|
onChangeDate={handleSetData}
|
|
@@ -141,4 +135,4 @@ stories.add("Bubble Chart", () => {
|
|
|
141
135
|
/>
|
|
142
136
|
</>
|
|
143
137
|
);
|
|
144
|
-
}
|
|
138
|
+
}
|
|
@@ -1,19 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
ArrowTrendingDownIcon,
|
|
3
|
+
ArrowTrendingUpIcon,
|
|
4
|
+
CurrencyDollarIcon,
|
|
5
|
+
PencilIcon,
|
|
6
|
+
ShoppingCartIcon,
|
|
7
|
+
UserGroupIcon,
|
|
8
|
+
} from "@heroicons/react/24/outline";
|
|
3
9
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
-
import { Card } from ".";
|
|
10
|
+
import { Card as CardImpl } from ".";
|
|
5
11
|
import { RangeInterface } from "../DateRange";
|
|
6
|
-
import
|
|
12
|
+
import { StorySection } from "../../storyUtils";
|
|
7
13
|
|
|
8
|
-
const
|
|
14
|
+
const meta = { title: "Chart/Card" };
|
|
15
|
+
export default meta;
|
|
9
16
|
|
|
10
|
-
stories.addParameters({
|
|
11
|
-
readme: {
|
|
12
|
-
content: README,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
// INFO: small trend-indicator helper for subContent — green for up, red for down
|
|
19
|
+
const TrendIndicator = ({
|
|
20
|
+
delta,
|
|
21
|
+
label = "vs last month",
|
|
22
|
+
}: {
|
|
23
|
+
delta: number;
|
|
24
|
+
label?: string;
|
|
25
|
+
}) => {
|
|
26
|
+
const isUp = delta >= 0;
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
className={`inline-flex items-center gap-1 text-xs font-medium ${
|
|
30
|
+
isUp ? "text-emerald-600" : "text-rose-600"
|
|
31
|
+
}`}
|
|
32
|
+
>
|
|
33
|
+
{isUp ? (
|
|
34
|
+
<ArrowTrendingUpIcon className="h-3.5 w-3.5" />
|
|
35
|
+
) : (
|
|
36
|
+
<ArrowTrendingDownIcon className="h-3.5 w-3.5" />
|
|
37
|
+
)}
|
|
38
|
+
<span>
|
|
39
|
+
{isUp ? "+" : ""}
|
|
40
|
+
{delta}%
|
|
41
|
+
</span>
|
|
42
|
+
{label && <span className="text-gray-400">{label}</span>}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const Card = () => {
|
|
17
48
|
const [countData, setCountData] = useState<number>(0);
|
|
18
49
|
|
|
19
50
|
const stats = useMemo(() => {
|
|
@@ -26,18 +57,9 @@ stories.add("Card", () => {
|
|
|
26
57
|
twentyEightDaysAgo.setDate(customCurrentDate.getDate() - 28);
|
|
27
58
|
|
|
28
59
|
return [
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
stats: 230,
|
|
35
|
-
createdAt: oneDaysAgo,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
stats: 2010,
|
|
39
|
-
createdAt: twentyEightDaysAgo,
|
|
40
|
-
},
|
|
60
|
+
{ stats: 71897, createdAt: sevenDaysAgo },
|
|
61
|
+
{ stats: 230, createdAt: oneDaysAgo },
|
|
62
|
+
{ stats: 2010, createdAt: twentyEightDaysAgo },
|
|
41
63
|
];
|
|
42
64
|
}, []);
|
|
43
65
|
|
|
@@ -59,10 +81,8 @@ stories.add("Card", () => {
|
|
|
59
81
|
dummySeriesData += eachData.stats;
|
|
60
82
|
}
|
|
61
83
|
}
|
|
62
|
-
|
|
63
84
|
return null;
|
|
64
85
|
});
|
|
65
|
-
|
|
66
86
|
setCountData(dummySeriesData);
|
|
67
87
|
},
|
|
68
88
|
[stats]
|
|
@@ -73,17 +93,131 @@ stories.add("Card", () => {
|
|
|
73
93
|
}, [handleSetData]);
|
|
74
94
|
|
|
75
95
|
return (
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
<div className="font-sans p-6">
|
|
97
|
+
<StorySection
|
|
98
|
+
title="size="default" — With Trend Indicator"
|
|
99
|
+
description="Original ~140px-tall card. subContent slot renders below the count — used here for a coloured trend chip."
|
|
100
|
+
>
|
|
101
|
+
<div className="w-full">
|
|
102
|
+
<CardImpl
|
|
103
|
+
icon={<CurrencyDollarIcon className="h-5 w-5 text-white" />}
|
|
104
|
+
title="Total Revenue"
|
|
105
|
+
description="This month"
|
|
106
|
+
count={24500}
|
|
107
|
+
unit="RM"
|
|
108
|
+
subContent={<TrendIndicator delta={12.4} />}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</StorySection>
|
|
112
|
+
|
|
113
|
+
<StorySection
|
|
114
|
+
title="size="default" — DateRange + Tool (Legacy)"
|
|
115
|
+
description="dateRangeVisible adds an inline date picker, tool slot renders top-right (e.g. an edit icon). Matches the original CardStory pattern."
|
|
116
|
+
>
|
|
117
|
+
<div className="w-full">
|
|
118
|
+
<CardImpl
|
|
119
|
+
icon={<UserGroupIcon className="h-5 w-5 text-white" />}
|
|
120
|
+
title="Completed Tasks"
|
|
121
|
+
description="Total task(s)"
|
|
122
|
+
count={countData}
|
|
123
|
+
tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
|
|
124
|
+
dateRangeVisible={true}
|
|
125
|
+
onChangeDate={handleSetData}
|
|
126
|
+
textTruncate={true}
|
|
127
|
+
subContent={
|
|
128
|
+
<TrendIndicator delta={18.6} label="vs previous period" />
|
|
129
|
+
}
|
|
130
|
+
/>
|
|
131
|
+
</div>
|
|
132
|
+
</StorySection>
|
|
133
|
+
|
|
134
|
+
<StorySection
|
|
135
|
+
title="size="compact" — 2-Up KPI Grid"
|
|
136
|
+
description="Stat-first compact layout (~72px). Title small, count is the hero. Designed for 2-up or 4-up grids on mobile dashboards."
|
|
137
|
+
>
|
|
138
|
+
<div className="w-full grid grid-cols-2 gap-3">
|
|
139
|
+
<CardImpl
|
|
140
|
+
size="compact"
|
|
141
|
+
icon={<CurrencyDollarIcon className="h-4 w-4 text-primary-600" />}
|
|
142
|
+
title="Revenue"
|
|
143
|
+
count={24500}
|
|
144
|
+
unit="RM"
|
|
145
|
+
subContent={<TrendIndicator delta={12.4} label="" />}
|
|
146
|
+
/>
|
|
147
|
+
<CardImpl
|
|
148
|
+
size="compact"
|
|
149
|
+
icon={<UserGroupIcon className="h-4 w-4 text-primary-600" />}
|
|
150
|
+
title="Active Users"
|
|
151
|
+
count={1284}
|
|
152
|
+
subContent={<TrendIndicator delta={5.1} label="" />}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
</StorySection>
|
|
156
|
+
|
|
157
|
+
<StorySection
|
|
158
|
+
title="size="compact" — With DateRange Picker"
|
|
159
|
+
description="dateRangeVisible now also renders in compact mode — date picker sits below the stat. CardImpl grows taller than the standard ~72px compact (closer to ~110px) but stays denser than the default."
|
|
160
|
+
>
|
|
161
|
+
<div className="w-full grid grid-cols-2 gap-3">
|
|
162
|
+
<CardImpl
|
|
163
|
+
size="compact"
|
|
164
|
+
icon={<CurrencyDollarIcon className="h-4 w-4 text-primary-600" />}
|
|
165
|
+
title="Revenue"
|
|
166
|
+
count={countData}
|
|
167
|
+
unit="RM"
|
|
168
|
+
dateRangeVisible
|
|
169
|
+
onChangeDate={handleSetData}
|
|
170
|
+
subContent={<TrendIndicator delta={12.4} label="" />}
|
|
171
|
+
/>
|
|
172
|
+
<CardImpl
|
|
173
|
+
size="compact"
|
|
174
|
+
icon={<UserGroupIcon className="h-4 w-4 text-primary-600" />}
|
|
175
|
+
title="Active Users"
|
|
176
|
+
count={1284}
|
|
177
|
+
dateRangeVisible
|
|
178
|
+
onChangeDate={handleSetData}
|
|
179
|
+
subContent={<TrendIndicator delta={5.1} label="" />}
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
</StorySection>
|
|
183
|
+
|
|
184
|
+
<StorySection
|
|
185
|
+
title="size="compact" — 4-Up Mixed Trends"
|
|
186
|
+
description="Mixed up/down trends in a denser grid. Shows how compact cards work for a multi-KPI dashboard glance on mobile."
|
|
187
|
+
>
|
|
188
|
+
<div className="w-full grid grid-cols-2 gap-3">
|
|
189
|
+
<CardImpl
|
|
190
|
+
size="compact"
|
|
191
|
+
icon={<ShoppingCartIcon className="h-4 w-4 text-primary-600" />}
|
|
192
|
+
title="New Orders"
|
|
193
|
+
count={48}
|
|
194
|
+
subContent={<TrendIndicator delta={8.2} label="" />}
|
|
195
|
+
/>
|
|
196
|
+
<CardImpl
|
|
197
|
+
size="compact"
|
|
198
|
+
icon={<UserGroupIcon className="h-4 w-4 text-primary-600" />}
|
|
199
|
+
title="Churn"
|
|
200
|
+
count={3}
|
|
201
|
+
unit="%"
|
|
202
|
+
subContent={<TrendIndicator delta={-1.4} label="" />}
|
|
203
|
+
/>
|
|
204
|
+
<CardImpl
|
|
205
|
+
size="compact"
|
|
206
|
+
icon={<CurrencyDollarIcon className="h-4 w-4 text-primary-600" />}
|
|
207
|
+
title="Avg Order"
|
|
208
|
+
count={510}
|
|
209
|
+
unit="RM"
|
|
210
|
+
subContent={<TrendIndicator delta={-3.2} label="" />}
|
|
211
|
+
/>
|
|
212
|
+
<CardImpl
|
|
213
|
+
size="compact"
|
|
214
|
+
icon={<UserGroupIcon className="h-4 w-4 text-primary-600" />}
|
|
215
|
+
title="Active"
|
|
216
|
+
count={1284}
|
|
217
|
+
subContent={<TrendIndicator delta={5.1} label="" />}
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
</StorySection>
|
|
221
|
+
</div>
|
|
88
222
|
);
|
|
89
|
-
}
|
|
223
|
+
};
|