blixify-ui-web-mcp 0.1.1

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 (245) hide show
  1. package/README.md +5 -0
  2. package/lib/components/action/button/README.md +75 -0
  3. package/lib/components/action/button/button.stories.tsx +138 -0
  4. package/lib/components/action/buttonGroup/README.md +79 -0
  5. package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +104 -0
  6. package/lib/components/action/iconButton/README.md +39 -0
  7. package/lib/components/action/iconButton/iconButton.stories.tsx +22 -0
  8. package/lib/components/action/radioList/README.md +98 -0
  9. package/lib/components/action/radioList/radioList.stories.tsx +181 -0
  10. package/lib/components/action/slider/README.md +86 -0
  11. package/lib/components/action/slider/slider.stories.tsx +133 -0
  12. package/lib/components/action/textButton/README.md +34 -0
  13. package/lib/components/action/textButton/textButton.stories.tsx +16 -0
  14. package/lib/components/action/toggle/README.md +39 -0
  15. package/lib/components/action/toggle/toggle.stories.tsx +23 -0
  16. package/lib/components/advanced/collapse/README.md +106 -0
  17. package/lib/components/advanced/collapse/collapse.stories.tsx +165 -0
  18. package/lib/components/advanced/infoWindow/README.md +69 -0
  19. package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +112 -0
  20. package/lib/components/advanced/popUp/README.md +95 -0
  21. package/lib/components/advanced/popUp/popUp.stories.tsx +189 -0
  22. package/lib/components/auth/bareSignIn/README.md +78 -0
  23. package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +141 -0
  24. package/lib/components/auth/bareSignUp/README.md +130 -0
  25. package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +159 -0
  26. package/lib/components/auth/signIn/README.md +53 -0
  27. package/lib/components/auth/signIn/signIn.stories.tsx +120 -0
  28. package/lib/components/auth/signUp/README.md +136 -0
  29. package/lib/components/auth/signUp/signUp.stories.tsx +193 -0
  30. package/lib/components/chart/README.md +13 -0
  31. package/lib/components/chart/areaChart/README.md +133 -0
  32. package/lib/components/chart/areaChart/areaChart.stories.tsx +199 -0
  33. package/lib/components/chart/barChart/README.md +193 -0
  34. package/lib/components/chart/barChart/barChart.stories.tsx +318 -0
  35. package/lib/components/chart/boxPlotChart/README.md +124 -0
  36. package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +104 -0
  37. package/lib/components/chart/bubbleChart/README.md +166 -0
  38. package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +144 -0
  39. package/lib/components/chart/card/README.md +107 -0
  40. package/lib/components/chart/card/card.stories.tsx +89 -0
  41. package/lib/components/chart/ganttChart/README.md +142 -0
  42. package/lib/components/chart/ganttChart/ganttChart.stories.tsx +138 -0
  43. package/lib/components/chart/heatmapChart/README.md +125 -0
  44. package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +106 -0
  45. package/lib/components/chart/lineChart/README.md +140 -0
  46. package/lib/components/chart/lineChart/lineChart.stories.tsx +152 -0
  47. package/lib/components/chart/pieChart/README.md +117 -0
  48. package/lib/components/chart/pieChart/pieChart.stories.tsx +180 -0
  49. package/lib/components/chart/polarAreaChart/README.md +126 -0
  50. package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +106 -0
  51. package/lib/components/chart/radarChart/README.md +57 -0
  52. package/lib/components/chart/radarChart/radarChart.stories.tsx +36 -0
  53. package/lib/components/chart/radialBar/README.md +152 -0
  54. package/lib/components/chart/radialBar/radialChart.stories.tsx +136 -0
  55. package/lib/components/chart/rangeBarChart/README.md +323 -0
  56. package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +208 -0
  57. package/lib/components/chart/statsCard/README.md +97 -0
  58. package/lib/components/chart/statsCard/statsCard.stories.tsx +183 -0
  59. package/lib/components/chart/treemapChart/README.md +142 -0
  60. package/lib/components/chart/treemapChart/treemapChart.stories.tsx +122 -0
  61. package/lib/components/chat/chatAnchor/README.md +113 -0
  62. package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +156 -0
  63. package/lib/components/chat/chatBase/README.md +223 -0
  64. package/lib/components/chat/chatBase/chatBase.stories.tsx +306 -0
  65. package/lib/components/chat/chatDashboard/README.md +161 -0
  66. package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +154 -0
  67. package/lib/components/data/dataGraph/README.md +13 -0
  68. package/lib/components/data/dataGraph/dataGraph.stories.tsx +84 -0
  69. package/lib/components/data/dataReference/README.md +62 -0
  70. package/lib/components/data/dataReference/dataReference.stories.tsx +53 -0
  71. package/lib/components/data/dataTemplate/README.md +903 -0
  72. package/lib/components/data/dataTemplate/dataModule.stories.tsx +196 -0
  73. package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +337 -0
  74. package/lib/components/data/dataWrapper/README.md +1077 -0
  75. package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +831 -0
  76. package/lib/components/data/queryForm/README.md +56 -0
  77. package/lib/components/data/queryForm/queryForm.stories.tsx +85 -0
  78. package/lib/components/data/readQuery/README.md +282 -0
  79. package/lib/components/data/readQuery/readQuery.stories.tsx +256 -0
  80. package/lib/components/data/readQueryHoc/README.md +89 -0
  81. package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +33 -0
  82. package/lib/components/data/writeQuery/README.md +178 -0
  83. package/lib/components/data/writeQuery/writeQuery.stories.tsx +209 -0
  84. package/lib/components/design/actionSection/README.md +47 -0
  85. package/lib/components/design/actionSection/actionSection.stories.tsx +74 -0
  86. package/lib/components/design/banner/README.md +43 -0
  87. package/lib/components/design/banner/banner.stories.tsx +34 -0
  88. package/lib/components/design/bannerAction/README.md +44 -0
  89. package/lib/components/design/bannerAction/bannerAction.stories.tsx +25 -0
  90. package/lib/components/design/blogSection/README.md +111 -0
  91. package/lib/components/design/blogSection/blogSection.stories.tsx +72 -0
  92. package/lib/components/design/carouselSection/README.md +82 -0
  93. package/lib/components/design/carouselSection/carouselSection.stories.tsx +52 -0
  94. package/lib/components/design/designList/README.md +60 -0
  95. package/lib/components/design/designList/designList.stories.tsx +44 -0
  96. package/lib/components/design/faq/README.md +121 -0
  97. package/lib/components/design/faq/faq.stories.tsx +103 -0
  98. package/lib/components/design/fileGrid/README.md +87 -0
  99. package/lib/components/design/fileGrid/fileGrid.stories.tsx +110 -0
  100. package/lib/components/design/fileViewer/README.md +40 -0
  101. package/lib/components/design/fileViewer/fileViewer.stories.tsx +28 -0
  102. package/lib/components/design/footerSection/README.md +62 -0
  103. package/lib/components/design/footerSection/footerSection.stories.tsx +84 -0
  104. package/lib/components/design/googleReview/README.md +45 -0
  105. package/lib/components/design/googleReview/googleReview.stories.tsx +33 -0
  106. package/lib/components/design/heroSection/README.md +48 -0
  107. package/lib/components/design/heroSection/heroSection.stories.tsx +85 -0
  108. package/lib/components/design/iconList/README.md +60 -0
  109. package/lib/components/design/iconList/iconList.stories.tsx +41 -0
  110. package/lib/components/design/imageGallery/README.md +56 -0
  111. package/lib/components/design/imageGallery/imageGallery.stories.tsx +45 -0
  112. package/lib/components/design/imageZoom/README.md +47 -0
  113. package/lib/components/design/imageZoom/imageZoom.stories.tsx +30 -0
  114. package/lib/components/design/leftContent/README.md +47 -0
  115. package/lib/components/design/leftContent/leftContent.stories.tsx +32 -0
  116. package/lib/components/design/logoCloud/README.md +42 -0
  117. package/lib/components/design/logoCloud/logoCloud.stories.tsx +44 -0
  118. package/lib/components/design/onboarding/README.md +100 -0
  119. package/lib/components/design/onboarding/onboarding.stories.tsx +113 -0
  120. package/lib/components/design/pricing/README.md +112 -0
  121. package/lib/components/design/pricing/pricing.stories.tsx +86 -0
  122. package/lib/components/design/rightContent/README.md +47 -0
  123. package/lib/components/design/rightContent/rightContent.stories.tsx +32 -0
  124. package/lib/components/design/sectionList/README.md +51 -0
  125. package/lib/components/design/sectionList/sectionList.stories.tsx +35 -0
  126. package/lib/components/design/teams/README.md +62 -0
  127. package/lib/components/design/teams/teams.stories.tsx +61 -0
  128. package/lib/components/display/alert/README.md +82 -0
  129. package/lib/components/display/alert/alert.stories.tsx +71 -0
  130. package/lib/components/display/calendar/README.md +113 -0
  131. package/lib/components/display/calendar/calendar.stories.tsx +159 -0
  132. package/lib/components/display/clipboard/README.md +36 -0
  133. package/lib/components/display/clipboard/clipboard.stories.tsx +32 -0
  134. package/lib/components/display/detailList/README.md +61 -0
  135. package/lib/components/display/detailList/detailList.stories.tsx +131 -0
  136. package/lib/components/display/drawer/README.md +74 -0
  137. package/lib/components/display/drawer/drawer.stories.tsx +66 -0
  138. package/lib/components/display/emptyState/README.md +38 -0
  139. package/lib/components/display/emptyState/emptyState.stories.tsx +22 -0
  140. package/lib/components/display/feeds/README.md +80 -0
  141. package/lib/components/display/feeds/feeds.stories.tsx +75 -0
  142. package/lib/components/display/flexTable/README.md +160 -0
  143. package/lib/components/display/flexTable/flexTable.stories.tsx +313 -0
  144. package/lib/components/display/grid/README.md +121 -0
  145. package/lib/components/display/grid/grid.stories.tsx +234 -0
  146. package/lib/components/display/kanban/README.md +78 -0
  147. package/lib/components/display/kanban/kanban.stories.tsx +133 -0
  148. package/lib/components/display/list/README.md +109 -0
  149. package/lib/components/display/list/list.stories.tsx +188 -0
  150. package/lib/components/display/loading/README.md +25 -0
  151. package/lib/components/display/loading/loading.stories.tsx +15 -0
  152. package/lib/components/display/mapView/README.md +99 -0
  153. package/lib/components/display/mapView/mapView.stories.tsx +225 -0
  154. package/lib/components/display/modal/README.md +43 -0
  155. package/lib/components/display/modal/modal.stories.tsx +81 -0
  156. package/lib/components/display/notification/README.md +43 -0
  157. package/lib/components/display/notification/notification.stories.tsx +30 -0
  158. package/lib/components/display/progress/README.md +25 -0
  159. package/lib/components/display/progress/progress.stories.tsx +15 -0
  160. package/lib/components/display/stepper/README.md +96 -0
  161. package/lib/components/display/stepper/stepper.stories.tsx +175 -0
  162. package/lib/components/display/table/README.md +176 -0
  163. package/lib/components/display/table/table.stories.tsx +330 -0
  164. package/lib/components/display/tag/README.md +74 -0
  165. package/lib/components/display/tag/tag.stories.tsx +79 -0
  166. package/lib/components/input/address/README.md +132 -0
  167. package/lib/components/input/address/address.stories.tsx +147 -0
  168. package/lib/components/input/canvas/README.md +131 -0
  169. package/lib/components/input/canvas/canvas.stories.tsx +165 -0
  170. package/lib/components/input/checkbox/README.md +61 -0
  171. package/lib/components/input/checkbox/checkbox.stories.tsx +30 -0
  172. package/lib/components/input/datePicker/README.md +124 -0
  173. package/lib/components/input/datePicker/datePicker.stories.tsx +197 -0
  174. package/lib/components/input/form/README.md +55 -0
  175. package/lib/components/input/form/form.stories.tsx +143 -0
  176. package/lib/components/input/markdown/README.md +146 -0
  177. package/lib/components/input/markdown/markdown.stories.tsx +40 -0
  178. package/lib/components/input/monthYearPicker/README.md +69 -0
  179. package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +47 -0
  180. package/lib/components/input/netPromoterScore/README.md +52 -0
  181. package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +30 -0
  182. package/lib/components/input/rating/README.md +51 -0
  183. package/lib/components/input/rating/rating.stories.tsx +30 -0
  184. package/lib/components/input/select/README.md +108 -0
  185. package/lib/components/input/select/select.stories.tsx +286 -0
  186. package/lib/components/input/signature/README.md +106 -0
  187. package/lib/components/input/signature/signature.stories.tsx +188 -0
  188. package/lib/components/input/textArea/README.md +55 -0
  189. package/lib/components/input/textArea/textArea.stories.tsx +30 -0
  190. package/lib/components/input/textInput/README.md +81 -0
  191. package/lib/components/input/textInput/textinput.stories.tsx +231 -0
  192. package/lib/components/input/uploadInput/README.md +134 -0
  193. package/lib/components/input/uploadInput/uploadInput.stories.tsx +193 -0
  194. package/lib/components/navigation/bars/README.md +40 -0
  195. package/lib/components/navigation/bars/bars.stories.tsx +85 -0
  196. package/lib/components/navigation/bottomTab/README.md +53 -0
  197. package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +32 -0
  198. package/lib/components/navigation/breadcrumb/README.md +48 -0
  199. package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +27 -0
  200. package/lib/components/navigation/header/README.md +149 -0
  201. package/lib/components/navigation/header/header.stories.tsx +107 -0
  202. package/lib/components/navigation/leftNav/README.md +91 -0
  203. package/lib/components/navigation/leftNav/leftNav.stories.tsx +106 -0
  204. package/lib/components/navigation/tabs/README.md +75 -0
  205. package/lib/components/navigation/tabs/tabs.stories.tsx +60 -0
  206. package/lib/components/structure/column/README.md +40 -0
  207. package/lib/components/structure/column/column.stories.tsx +26 -0
  208. package/lib/components/structure/container/README.md +34 -0
  209. package/lib/components/structure/container/container.stories.tsx +19 -0
  210. package/lib/components/structure/link/README.md +55 -0
  211. package/lib/components/structure/link/link.stories.tsx +30 -0
  212. package/lib/components/structure/text/README.md +42 -0
  213. package/lib/components/structure/text/text.stories.tsx +39 -0
  214. package/lib/components/template/authPage/authPage.stories.tsx +68 -0
  215. package/lib/components/template/landingPage/landingPage.stories.tsx +288 -0
  216. package/lib/components/template/productListing/productListing.stories.tsx +297 -0
  217. package/lib/components/template/productOverview/productOverview.stories.tsx +194 -0
  218. package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +252 -0
  219. package/lib/components/template/userHomePage/userHomePage.stories.tsx +605 -0
  220. package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +481 -0
  221. package/lib/mcp/server.d.ts +2 -0
  222. package/lib/mcp/server.d.ts.map +1 -0
  223. package/lib/mcp/server.js +33 -0
  224. package/lib/mcp/server.js.map +1 -0
  225. package/lib/mcp/tools/getBackendComponent.d.ts +13 -0
  226. package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -0
  227. package/lib/mcp/tools/getBackendComponent.js +119 -0
  228. package/lib/mcp/tools/getBackendComponent.js.map +1 -0
  229. package/lib/mcp/tools/getComponent.d.ts +17 -0
  230. package/lib/mcp/tools/getComponent.d.ts.map +1 -0
  231. package/lib/mcp/tools/getComponent.js +118 -0
  232. package/lib/mcp/tools/getComponent.js.map +1 -0
  233. package/lib/mcp/tools/listComponents.d.ts +13 -0
  234. package/lib/mcp/tools/listComponents.d.ts.map +1 -0
  235. package/lib/mcp/tools/listComponents.js +113 -0
  236. package/lib/mcp/tools/listComponents.js.map +1 -0
  237. package/lib/mcp/tools/listTemplates.d.ts +13 -0
  238. package/lib/mcp/tools/listTemplates.d.ts.map +1 -0
  239. package/lib/mcp/tools/listTemplates.js +68 -0
  240. package/lib/mcp/tools/listTemplates.js.map +1 -0
  241. package/lib/mcp/tools/suggestTemplate.d.ts +17 -0
  242. package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -0
  243. package/lib/mcp/tools/suggestTemplate.js +212 -0
  244. package/lib/mcp/tools/suggestTemplate.js.map +1 -0
  245. package/package.json +23 -0
@@ -0,0 +1,142 @@
1
+ # Gantt Chart
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ A Gantt chart component for displaying project timelines and task management. e.g: Project schedules, task dependencies, and progress tracking
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { GanttChart } from "blixify-ui-web/lib";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ ```jsx
18
+ const [ganttTasks, setGanttTasks] = useState<any[]>([]);
19
+
20
+ const sampleTasks = [
21
+ {
22
+ id: "task1",
23
+ name: "Project Planning",
24
+ start: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000),
25
+ end: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000),
26
+ duration: 2,
27
+ progress: 100,
28
+ color: "#008FFB", // Individual task color
29
+ },
30
+ {
31
+ id: "task2",
32
+ name: "Design Phase",
33
+ start: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000),
34
+ end: new Date(Date.now() + 2 * 24 * 60 * 60 * 1000),
35
+ duration: 5,
36
+ progress: 75,
37
+ color: "#00E396", // Individual task color
38
+ dependencies: ["task1"],
39
+ },
40
+ {
41
+ id: "task3",
42
+ name: "Development",
43
+ start: new Date(),
44
+ end: new Date(Date.now() + 10 * 24 * 60 * 60 * 1000),
45
+ duration: 10,
46
+ progress: 40,
47
+ color: "#FEB019", // Individual task color
48
+ dependencies: ["task2"],
49
+ },
50
+ ];
51
+
52
+ const handleTaskClick = useCallback((taskId: string, taskName: string) => {
53
+ console.log(`Clicked task: ${taskName} (ID: ${taskId})`);
54
+ }, []);
55
+
56
+ useEffect(() => {
57
+ setGanttTasks(sampleTasks);
58
+ }, []);
59
+
60
+ return (
61
+ <>
62
+ <div className="font-medium mb-5">Gantt Chart</div>
63
+ <GanttChart
64
+ title="Project Timeline"
65
+ tasks={ganttTasks}
66
+ tool={<CalendarIcon className="h-4 w-4 text-primary-600" />}
67
+ dateRangeVisible={true}
68
+ customDate={{
69
+ startDate: sevenDaysAgo,
70
+ endDate: fourteenDaysFromNow,
71
+ isDuration: true,
72
+ }}
73
+ onChangeDate={handleDateRangeChange}
74
+ onClick={handleTaskClick}
75
+ showDataLabel={true}
76
+ showTooltip={true}
77
+ colors={["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"]}
78
+ />
79
+
80
+ {/*
81
+ Color mapping:
82
+ - Task 1 (Project Planning) → #008FFB (first color)
83
+ - Task 2 (Design Phase) → #00E396 (second color)
84
+ - Task 3 (Development) → #FEB019 (third color)
85
+ - Task 4 (Testing) → #FF4560 (fourth color)
86
+ - Task 5 (Deployment) → #775DD0 (fifth color)
87
+ */}
88
+
89
+ <div className="font-medium my-5">Dark Mode Gantt Chart</div>
90
+ <GanttChart
91
+ title="Development Sprint"
92
+ tasks={ganttTasks.slice(1, 3)}
93
+ onClick={handleTaskClick}
94
+ darkMode={true}
95
+ darkModeBg="bg-gradient-to-r from-slate-700 to-gray-900"
96
+ enableGradient={true}
97
+ colors={["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6"]}
98
+ />
99
+ </>
100
+ );
101
+ ```
102
+
103
+ ##### Required props
104
+
105
+ | Name | Type | Description |
106
+ | ------- | -------- | ------------------ |
107
+ | `title` | `string` | Title of the chart |
108
+
109
+ ##### Optional props
110
+
111
+ | Name | Type | Default | Description |
112
+ | --------------- | --------------- | ----------- | ---------------------------------------------------------------------------------- |
113
+ | `tasks` | `GanttTask[]` | `[]` | Array of task objects for timeline visualization |
114
+ | `series` | `GanttSeries[]` | `[]` | Alternative series format for advanced usage |
115
+ | `duration` | `object` | `undefined` | Overall project duration with startDate and endDate |
116
+ | `showGrid` | `boolean` | `true` | Show/hide grid lines |
117
+ | `showTooltip` | `boolean` | `true` | Enable/disable tooltips |
118
+ | `showDataLabel` | `boolean` | `true` | Show/hide data labels |
119
+ | `showToolbar` | `boolean` | `true` | Show/hide chart toolbar |
120
+ | `borderColor` | `string` | `#e7e7e7` | Custom border color |
121
+ | `colors` | `string[]` | `undefined` | Array of colors - first task uses first color, second task uses second color, etc. |
122
+ | `onClick` | `function` | `undefined` | Callback when task is clicked |
123
+
124
+ ##### GanttTask props
125
+
126
+ | Name | Type | Description |
127
+ | -------------- | ---------- | ------------------------------------ |
128
+ | `id` | `string` | Unique identifier for the task |
129
+ | `name` | `string` | Display name of the task |
130
+ | `start` | `Date` | Task start date |
131
+ | `end` | `Date` | Task end date |
132
+ | `duration` | `number` | Duration in days (optional) |
133
+ | `progress` | `number` | Progress percentage 0-100 |
134
+ | `dependencies` | `string[]` | Array of dependent task IDs |
135
+ | `color` | `string` | Custom color for the task (optional) |
136
+
137
+ ##### GanttSeries props
138
+
139
+ | Name | Type | Description |
140
+ | ------ | -------- | ----------------------------- |
141
+ | `name` | `string` | Series name |
142
+ | `data` | `array` | Array of timeline data points |
@@ -0,0 +1,138 @@
1
+ import { CalendarIcon } from "@heroicons/react/24/outline";
2
+ import { storiesOf } from "@storybook/react";
3
+ import React, { useCallback, useState } from "react";
4
+ import { GanttChart } from ".";
5
+ import README from "./README.md";
6
+
7
+ const stories = storiesOf("Chart", module);
8
+
9
+ stories.addParameters({
10
+ readme: {
11
+ content: README,
12
+ },
13
+ });
14
+
15
+ stories.add("Gantt Chart", () => {
16
+ const today = new Date();
17
+ const oneDay = 24 * 60 * 60 * 1000;
18
+
19
+ const [ganttTasks, setGanttTasks] = useState<any[]>([
20
+ {
21
+ id: "task1",
22
+ name: "Project Planning",
23
+ start: new Date(today.getTime() - 5 * oneDay),
24
+ end: new Date(today.getTime() - 3 * oneDay),
25
+ duration: 2,
26
+ progress: 100,
27
+ },
28
+ {
29
+ id: "task2",
30
+ name: "Design Phase",
31
+ start: new Date(today.getTime() - 3 * oneDay),
32
+ end: new Date(today.getTime() + 2 * oneDay),
33
+ duration: 5,
34
+ progress: 75,
35
+ dependencies: ["task1"],
36
+ },
37
+ {
38
+ id: "task3",
39
+ name: "Development",
40
+ start: new Date(today.getTime()),
41
+ end: new Date(today.getTime() + 10 * oneDay),
42
+ duration: 10,
43
+ progress: 40,
44
+ dependencies: ["task2"],
45
+ },
46
+ {
47
+ id: "task4",
48
+ name: "Testing",
49
+ start: new Date(today.getTime() + 8 * oneDay),
50
+ end: new Date(today.getTime() + 12 * oneDay),
51
+ duration: 4,
52
+ progress: 0,
53
+ dependencies: ["task3"],
54
+ },
55
+ {
56
+ id: "task5",
57
+ name: "Deployment",
58
+ start: new Date(today.getTime() + 12 * oneDay),
59
+ end: new Date(today.getTime() + 14 * oneDay),
60
+ duration: 2,
61
+ progress: 0,
62
+ dependencies: ["task4"],
63
+ },
64
+ ]);
65
+
66
+ const handleTaskClick = useCallback((taskId: string, taskName: string) => {
67
+ console.log(`Clicked task: ${taskName} (ID: ${taskId})`);
68
+ }, []);
69
+
70
+ const handleTaskChange = useCallback((tasks: any[]) => {
71
+ setGanttTasks(tasks);
72
+ console.log(`Tasks updated: ${tasks.length} tasks`);
73
+ }, []);
74
+
75
+ return (
76
+ <>
77
+ <div className="font-medium mb-5">
78
+ Gantt Chart - Write Mode (Editable)
79
+ </div>
80
+ <GanttChart
81
+ title="Project Management Dashboard"
82
+ tasks={ganttTasks}
83
+ mode="write"
84
+ tool={<CalendarIcon className="h-4 w-4 text-primary-600" />}
85
+ dateRangeVisible={true}
86
+ onClick={handleTaskClick}
87
+ onTaskChange={handleTaskChange}
88
+ showDataLabel={true}
89
+ showTooltip={true}
90
+ showGrid={true}
91
+ showToolbar={true}
92
+ colors={["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"]}
93
+ />
94
+ <div className="font-medium mb-5">
95
+ Gantt Chart (Individual Task Colors)
96
+ </div>
97
+ <GanttChart
98
+ title="Project Timeline"
99
+ tasks={ganttTasks}
100
+ tool={<CalendarIcon className="h-4 w-4 text-primary-600" />}
101
+ dateRangeVisible={true}
102
+ onClick={handleTaskClick}
103
+ showDataLabel={true}
104
+ showTooltip={true}
105
+ showGrid={true}
106
+ showToolbar={true}
107
+ colors={["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"]}
108
+ />
109
+
110
+ <div className="font-medium my-5">Dark Mode Gantt Chart</div>
111
+ <GanttChart
112
+ title="Development Sprint"
113
+ tasks={ganttTasks.slice(1, 4)}
114
+ tool={<CalendarIcon className="h-4 w-4 text-primary-600" />}
115
+ onClick={handleTaskClick}
116
+ showDataLabel={true}
117
+ showTooltip={true}
118
+ darkMode={true}
119
+ darkModeBg="bg-gradient-to-r from-slate-700 to-gray-900"
120
+ borderColor="#374151"
121
+ enableGradient={true}
122
+ colors={["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6"]}
123
+ />
124
+
125
+ <div className="font-medium my-5">Chart Only Mode</div>
126
+ <GanttChart
127
+ title="Minimal Gantt"
128
+ tasks={ganttTasks.slice(0, 3)}
129
+ chartOnly={true}
130
+ containerStyle="h-64 w-full"
131
+ showDataLabel={false}
132
+ showToolbar={false}
133
+ onClick={handleTaskClick}
134
+ colors={["#3B82F6", "#10B981", "#F59E0B"]}
135
+ />
136
+ </>
137
+ );
138
+ });
@@ -0,0 +1,125 @@
1
+ # Heatmap Chart
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ A heatmap chart component for displaying data density and patterns. e.g: User activity across different time periods
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { HeatmapChart } from "blixify-ui-web/lib";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ ```jsx
18
+ const multiSeriesData = [
19
+ {
20
+ name: "Metric1",
21
+ data: [
22
+ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160,
23
+ 170, 180,
24
+ ],
25
+ },
26
+ {
27
+ name: "Metric2",
28
+ data: [
29
+ 15, 25, 35, 45, 55, 65, 75, 85, 95, 105, 115, 125, 135, 145, 155, 165,
30
+ 175, 185,
31
+ ],
32
+ },
33
+ {
34
+ name: "Metric3",
35
+ data: [
36
+ 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170,
37
+ 180, 190,
38
+ ],
39
+ },
40
+ {
41
+ name: "Metric4",
42
+ data: [
43
+ 25, 35, 45, 55, 65, 75, 85, 95, 105, 115, 125, 135, 145, 155, 165, 175,
44
+ 185, 195,
45
+ ],
46
+ },
47
+ {
48
+ name: "Metric5",
49
+ data: [
50
+ 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180,
51
+ 190, 200,
52
+ ],
53
+ },
54
+ ];
55
+
56
+ const categories = [
57
+ "Jan",
58
+ "Feb",
59
+ "Mar",
60
+ "Apr",
61
+ "May",
62
+ "Jun",
63
+ "Jul",
64
+ "Aug",
65
+ "Sep",
66
+ "Oct",
67
+ "Nov",
68
+ "Dec",
69
+ "Q1",
70
+ "Q2",
71
+ "Q3",
72
+ "Q4",
73
+ "Y1",
74
+ "Y2",
75
+ ];
76
+
77
+ return (
78
+ <>
79
+ <div className="font-medium mb-5">Multi-Series Heatmap Chart</div>
80
+ <HeatmapChart
81
+ title="Metrics Heatmap"
82
+ multiSeriesData={multiSeriesData}
83
+ categories={categories}
84
+ tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
85
+ showDataLabel={true}
86
+ newTabUrl="https://www.google.com/"
87
+ />
88
+
89
+ <div className="font-medium my-5">Dark Mode Heatmap Chart</div>
90
+ <HeatmapChart
91
+ title="Activity Distribution"
92
+ multiSeriesData={multiSeriesData}
93
+ categories={categories}
94
+ tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
95
+ showDataLabel={true}
96
+ darkMode={true}
97
+ darkModeBg="bg-gradient-to-r from-slate-700 to-gray-900"
98
+ borderColor=""
99
+ />
100
+ </>
101
+ );
102
+ ```
103
+
104
+ ##### Required props
105
+
106
+ | Name | Type | Description |
107
+ | ------- | -------- | ------------------ |
108
+ | `title` | `string` | Title of the chart |
109
+
110
+ ##### Optional props
111
+
112
+ | Name | Type | Default | Description |
113
+ | ----------------- | -------------- | ------- | ------------------------------------------ |
114
+ | `multiSeriesData` | `SeriesItem[]` | `[]` | Multi-series data with name and data array |
115
+ | `categories` | `string[]` | `[]` | X-axis categories for multi-series format |
116
+ | `showToolbar` | `boolean` | `false` | |
117
+ | `showDataLabel` | `boolean` | `true` | |
118
+ | `newTabUrl` | `string` | "" | set URL for create hyperlinks |
119
+
120
+ ##### Series Item props
121
+
122
+ | Name | Type | Description |
123
+ | ------ | ---------- | ------------- |
124
+ | `name` | `string` | Name of data |
125
+ | `data` | `number[]` | Value of data |
@@ -0,0 +1,106 @@
1
+ import { PencilIcon } from "@heroicons/react/24/outline";
2
+ import { storiesOf } from "@storybook/react";
3
+ import React, { useMemo } from "react";
4
+ import { HeatmapChart } from ".";
5
+ import README from "./README.md";
6
+
7
+ const stories = storiesOf("Chart", module);
8
+
9
+ stories.addParameters({
10
+ readme: {
11
+ content: README,
12
+ },
13
+ });
14
+
15
+ // Utility function to generate random data
16
+ const generateData = (
17
+ count: number,
18
+ options: { min: number; max: number }
19
+ ): number[] => {
20
+ const data: number[] = [];
21
+ for (let i = 0; i < count; i++) {
22
+ data.push(
23
+ Math.floor(Math.random() * (options.max - options.min + 1)) + options.min
24
+ );
25
+ }
26
+ return data;
27
+ };
28
+
29
+ stories.add("Heatmap Chart", () => {
30
+ // Multi-series data example
31
+ const multiSeriesData = useMemo(
32
+ () => [
33
+ {
34
+ name: "Metric1",
35
+ data: generateData(18, { min: 0, max: 90 }),
36
+ },
37
+ {
38
+ name: "Metric2",
39
+ data: generateData(18, { min: 0, max: 90 }),
40
+ },
41
+ {
42
+ name: "Metric3",
43
+ data: generateData(18, { min: 0, max: 90 }),
44
+ },
45
+ {
46
+ name: "Metric4",
47
+ data: generateData(18, { min: 0, max: 90 }),
48
+ },
49
+ {
50
+ name: "Metric5",
51
+ data: generateData(18, { min: 0, max: 90 }),
52
+ },
53
+ ],
54
+ []
55
+ );
56
+
57
+ const categories = useMemo(
58
+ () => [
59
+ "Jan",
60
+ "Feb",
61
+ "Mar",
62
+ "Apr",
63
+ "May",
64
+ "Jun",
65
+ "Jul",
66
+ "Aug",
67
+ "Sep",
68
+ "Oct",
69
+ "Nov",
70
+ "Dec",
71
+ "Q1",
72
+ "Q2",
73
+ "Q3",
74
+ "Q4",
75
+ "Y1",
76
+ "Y2",
77
+ ],
78
+ []
79
+ );
80
+
81
+ return (
82
+ <>
83
+ <div className="font-medium mb-5">Multi-Series Heatmap Chart</div>
84
+ <HeatmapChart
85
+ title="Metrics Heatmap"
86
+ multiSeriesData={multiSeriesData}
87
+ categories={categories}
88
+ tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
89
+ showDataLabel={true}
90
+ newTabUrl="https://www.google.com/"
91
+ />
92
+
93
+ <div className="font-medium my-5">Dark Mode Heatmap Chart</div>
94
+ <HeatmapChart
95
+ title="Activity Distribution"
96
+ multiSeriesData={multiSeriesData}
97
+ categories={categories}
98
+ tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
99
+ showDataLabel={true}
100
+ darkMode={true}
101
+ darkModeBg="bg-gradient-to-r from-slate-700 to-gray-900"
102
+ borderColor=""
103
+ />
104
+ </>
105
+ );
106
+ });
@@ -0,0 +1,140 @@
1
+ # Line Chart
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ A line (or area) chart for displaying trends over time. Supports single and multi-line series, a brush/zoom controller, dark mode, and custom annotation labels.
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { LineChart } from "blixify-ui-web/chart/lineChart";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ Single line:
18
+
19
+ ```jsx
20
+ <LineChart
21
+ title="Sales of the Year"
22
+ categories={["Jan", "Feb", "Mar"]}
23
+ seriesData={[12, 60, 14]}
24
+ seriesName="Value"
25
+ xaxisTitle="Month"
26
+ yaxisTitle="Value"
27
+ dateRangeVisible={true}
28
+ onChangeDate={handleSetData}
29
+ />
30
+ ```
31
+
32
+ Multi-line with brush controller:
33
+
34
+ ```jsx
35
+ <LineChart
36
+ title="Temperature"
37
+ categories={["Jan", "Feb", "Mar", "Apr"]}
38
+ multiLineSeries={[
39
+ { name: "High", data: [30, 33, 29, 35] },
40
+ { name: "Low", data: [12, 14, 10, 16] },
41
+ ]}
42
+ xaxisTitle="Month"
43
+ yaxisTitle="°C"
44
+ chartId="tempChart"
45
+ chartController={true}
46
+ decimalPlaces={1}
47
+ />
48
+ ```
49
+
50
+ Line only (no area fill):
51
+
52
+ ```jsx
53
+ <LineChart
54
+ title="Revenue"
55
+ categories={["Q1", "Q2", "Q3"]}
56
+ seriesData={[100, 150, 130]}
57
+ xaxisTitle="Quarter"
58
+ yaxisTitle="Revenue"
59
+ disableAreaChart={true}
60
+ hideShadow={true}
61
+ />
62
+ ```
63
+
64
+ ##### Required props
65
+
66
+ | Name | Type | Description |
67
+ | ------------ | ---------------------- | ------------------------------- |
68
+ | `title` | `string` | Title shown in the chart header |
69
+ | `categories` | `string[] \| number[]` | X-axis category labels |
70
+ | `xaxisTitle` | `string` | X-axis title text |
71
+ | `yaxisTitle` | `string` | Y-axis title text |
72
+
73
+ ##### Chart props
74
+
75
+ | Name | Type | Default | Description |
76
+ | ---------------------- | ---------------------------------------- | ----------- | ----------------------------------------------------------------------- |
77
+ | `seriesData` | `number[]` | — | Single-series Y values, aligned to `categories` |
78
+ | `seriesName` | `string` | — | Tooltip label for single-series mode |
79
+ | `seriesUnit` | `string` | `""` | Unit appended to tooltip values |
80
+ | `multiLineSeries` | `SeriesItem[]` | — | Multi-line data — array of `{ name, data: number[] }` |
81
+ | `showDataLabels` | `boolean` | `false` | Show value labels on each data point |
82
+ | `showToolbar` | `boolean` | `false` | Show the ApexCharts toolbar |
83
+ | `disableAreaChart` | `boolean` | `false` | Render a pure line without the area fill |
84
+ | `disableTooltip` | `boolean` | `false` | Disable hover tooltips |
85
+ | `disableZoom` | `boolean` | `false` | Disable zoom interaction |
86
+ | `chartController` | `boolean` | `false` | Render a brush/zoom controller below the main chart. Requires `chartId` |
87
+ | `chartId` | `string` | `"chart1"` | ID linking the main chart to its controller |
88
+ | `controllerTickAmount` | `number` | — | Tick count on the controller's X-axis |
89
+ | `chartHeight` | `number` | `300` | Main chart height in pixels |
90
+ | `tickAmount` | `number` | `15` | Number of X-axis ticks shown |
91
+ | `yMin` | `number` | — | Minimum Y-axis value |
92
+ | `decimalPlaces` | `number` | — | Decimal places for Y-axis labels. Defaults to `Math.ceil()` if not set |
93
+ | `lineStroke` | `string` | `"smooth"` | ApexCharts stroke curve type (e.g. `"straight"`, `"stepline"`) |
94
+ | `borderColor` | `string` | `"#e7e7e7"` | Grid line colour. Pass `""` to remove |
95
+ | `hideShadow` | `boolean` | `false` | Remove the drop shadow from the line |
96
+ | `hideWhiteDot` | `boolean` | `false` | Hide the marker dot on each data point |
97
+ | `hideGrid` | `boolean` | `false` | Hide chart grid lines |
98
+ | `hideOriginBorder` | `boolean` | `false` | Hide the default y=0 annotation line |
99
+ | `showYAxisBorder` | `boolean` | `false` | Show the Y-axis border line |
100
+ | `xaxisTitlePosition` | `number` | `80` | `offsetY` for the X-axis title |
101
+ | `legendPosition` | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` | Legend placement |
102
+ | `newTabUrl` | `string` | — | Makes the chart title a link that opens in a new tab |
103
+ | `onClick` | `(value: any) => void` | — | Called when a data point is clicked |
104
+ | `dataLabels` | `DataLabel[]` | — | Annotation labels at specific coordinates |
105
+
106
+ ##### ChartUtils props (shared across all chart components)
107
+
108
+ | Name | Type | Default | Description |
109
+ | ------------------ | --------------------------------------- | --------------- | ----------------------------------------------------------------------- |
110
+ | `tool` | `ReactElement` | — | Icon or element in the top-right of the chart header |
111
+ | `dateRangeVisible` | `boolean` | `false` | Shows a date range picker below the chart |
112
+ | `customDate` | `RangeInterface` | — | Initial date range for the picker |
113
+ | `onChangeDate` | `(customDate?: RangeInterface) => void` | — | Called when the user applies a new date range |
114
+ | `colors` | `string[]` | — | Series colour palette. Falls back to `localChartColors` in localStorage |
115
+ | `darkMode` | `boolean` | `false` | Switches to dark theme |
116
+ | `darkModeBg` | `string` | `"bg-gray-900"` | Tailwind classes for the dark mode background |
117
+ | `enableGradient` | `boolean` | `false` | Fill the area under the line with a gradient |
118
+ | `chartOnly` | `boolean` | `false` | Render only the canvas — no title, tool, or date range bar |
119
+ | `chartSize` | `number` | `280` | Chart height in pixels (overridden by `chartHeight` when set) |
120
+ | `containerStyle` | `string` | — | Tailwind classes applied to the outer container |
121
+ | `minInterval` | `number` | `60` | Time picker interval in minutes |
122
+
123
+ ##### SeriesItem (multi-line)
124
+
125
+ | Name | Type | Description |
126
+ | ------ | ---------- | ------------------------------------- |
127
+ | `name` | `string` | Series name shown in the legend |
128
+ | `data` | `number[]` | Y values aligned to `categories` |
129
+ | `unit` | `string` | Unit appended to this series' tooltip |
130
+
131
+ ##### DataLabel
132
+
133
+ | Name | Type | Description |
134
+ | --------- | -------- | ----------------------------------------------------- |
135
+ | `x` | `string` | Category to anchor the label to |
136
+ | `y` | `number` | Y value to anchor the label to |
137
+ | `name` | `string` | Label text |
138
+ | `offsetY` | `number` | Vertical offset (negative = above the point) |
139
+ | `offsetX` | `number` | Horizontal offset |
140
+ | `style` | `object` | `{ color, fontSize, fontWeight, background, border }` |