blixify-ui-web-mcp 0.1.1 → 0.1.3

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 (28) hide show
  1. package/lib/components/chart/ganttChart/README.md +96 -110
  2. package/lib/components/chart/ganttChart/ganttChart.stories.tsx +132 -116
  3. package/lib/components/chart/heatmapChart/README.md +93 -82
  4. package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +118 -74
  5. package/lib/components/chat/chatAnchor/README.md +61 -79
  6. package/lib/components/chat/chatBase/README.md +166 -199
  7. package/lib/components/chat/chatBase/chatBase.stories.tsx +243 -265
  8. package/lib/components/chat/chatDashboard/README.md +87 -129
  9. package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +84 -107
  10. package/lib/components/data/dataGraph/README.md +135 -1
  11. package/lib/components/data/dataGraph/dataGraph.stories.tsx +86 -67
  12. package/lib/components/data/dataReference/README.md +141 -43
  13. package/lib/components/data/dataReference/dataReference.stories.tsx +107 -35
  14. package/lib/components/data/dataWrapper/README.md +2 -1
  15. package/lib/components/display/table/README.md +1 -1
  16. package/lib/components/navigation/bars/README.md +90 -17
  17. package/lib/components/navigation/bars/bars.stories.tsx +125 -51
  18. package/lib/components/navigation/breadcrumb/README.md +40 -20
  19. package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +30 -4
  20. package/lib/components/navigation/header/README.md +67 -108
  21. package/lib/components/navigation/header/header.stories.tsx +143 -39
  22. package/lib/components/navigation/leftNav/README.md +121 -66
  23. package/lib/components/navigation/leftNav/leftNav.stories.tsx +176 -83
  24. package/lib/components/navigation/tabs/tabs.stories.tsx +53 -29
  25. package/lib/mcp/server.d.ts +1 -0
  26. package/lib/mcp/server.js +1 -0
  27. package/lib/mcp/server.js.map +1 -1
  28. package/package.json +1 -1
@@ -4,100 +4,82 @@
4
4
 
5
5
  <hr>
6
6
 
7
- A Gantt chart component for displaying project timelines and task management. e.g: Project schedules, task dependencies, and progress tracking
7
+ A horizontal range bar chart for visualising project timelines. Supports read-only display, an editable write mode with an inline task table, date range filtering, dark mode, and click callbacks.
8
8
 
9
9
  ##### Import
10
10
 
11
11
  ```js
12
- import { GanttChart } from "blixify-ui-web/lib";
12
+ import { GanttChart } from "blixify-ui-web/components/chart/ganttChart";
13
13
  ```
14
14
 
15
15
  ##### Usage
16
16
 
17
- ```jsx
18
- const [ganttTasks, setGanttTasks] = useState<any[]>([]);
17
+ Read mode (display only):
19
18
 
20
- const sampleTasks = [
19
+ ```jsx
20
+ const [tasks, setTasks] = useState([
21
21
  {
22
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
23
+ name: "Planning",
24
+ start: new Date("2024-01-01"),
25
+ end: new Date("2024-01-05"),
29
26
  },
30
27
  {
31
28
  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
29
  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"],
30
+ start: new Date("2024-01-05"),
31
+ end: new Date("2024-01-15"),
49
32
  },
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
- );
33
+ ]);
34
+
35
+ <GanttChart
36
+ title="Project Timeline"
37
+ tasks={tasks}
38
+ showTooltip={true}
39
+ showDataLabel={true}
40
+ dateRangeVisible={true}
41
+ onClick={(taskId, taskName) => console.log(taskId, taskName)}
42
+ />;
43
+ ```
44
+
45
+ Write mode (editable table + chart):
46
+
47
+ ```jsx
48
+ <GanttChart
49
+ title="Project Timeline"
50
+ tasks={tasks}
51
+ mode="write"
52
+ label="Tasks"
53
+ onTaskChange={(updatedTasks) => setTasks(updatedTasks)}
54
+ onClick={(taskId, taskName) => console.log(taskId, taskName)}
55
+ />
56
+ ```
57
+
58
+ Dark mode:
59
+
60
+ ```jsx
61
+ <GanttChart
62
+ title="Sprint"
63
+ tasks={tasks}
64
+ darkMode={true}
65
+ darkModeBg="bg-gray-900"
66
+ borderColor="#374151"
67
+ enableGradient={true}
68
+ colors={["#3B82F6", "#10B981", "#F59E0B"]}
69
+ />
70
+ ```
71
+
72
+ Chart only (no card wrapper):
73
+
74
+ ```jsx
75
+ <GanttChart
76
+ title="Minimal"
77
+ tasks={tasks}
78
+ chartOnly={true}
79
+ containerStyle="h-64 w-full"
80
+ showDataLabel={false}
81
+ showToolbar={false}
82
+ />
101
83
  ```
102
84
 
103
85
  ##### Required props
@@ -108,35 +90,39 @@ return (
108
90
 
109
91
  ##### Optional props
110
92
 
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 |
93
+ | Name | Type | Default | Description |
94
+ | ------------------ | -------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
95
+ | `tasks` | `GanttTask[]` | `[]` | Array of task objects to render on the chart |
96
+ | `mode` | `"read" \| "write"` | `"read"` | `"write"` renders an editable table above the chart where tasks can be added, edited, and deleted |
97
+ | `label` | `string` | — | Field label shown above the chart in write mode |
98
+ | `labelExtra` | `ReactElement` | — | Extra element rendered next to the label |
99
+ | `infoElement` | `ReactElement` | — | Content for an info popover shown via a question mark icon next to the label |
100
+ | `onClick` | `(taskId: string, taskName: string) => void` | — | Called when a task bar is clicked |
101
+ | `onTaskChange` | `(tasks: GanttTask[]) => void` | — | Called with the updated task array when tasks are added, edited, or deleted. Required when `mode="write"`. |
102
+ | `showGrid` | `boolean` | `true` | Show or hide chart grid lines |
103
+ | `showTooltip` | `boolean` | `true` | Show or hide the hover tooltip with task name, start, end, and duration |
104
+ | `showDataLabel` | `boolean` | `true` | Show or hide the task name label inside each bar |
105
+ | `showToolbar` | `boolean` | `true` | Show or hide the ApexCharts toolbar (download, zoom, etc.) |
106
+ | `borderColor` | `string` | `#e7e7e7` | Grid line border color |
107
+ | `colors` | `string[]` | — | Color array applied per task in order. Falls back to localStorage `localChartColors` then ApexCharts defaults |
108
+ | `enableGradient` | `boolean` | `false` | Applies a gradient fill to task bars |
109
+ | `darkMode` | `boolean` | `false` | Switches axis labels and text to white |
110
+ | `darkModeBg` | `string` | `bg-gray-900` | Tailwind bg class for the card background in dark mode |
111
+ | `dateRangeVisible` | `boolean` | `false` | Shows a date range picker below the chart |
112
+ | `customDate` | `RangeInterface` | — | Pre-selected date range passed to the date range picker |
113
+ | `onChangeDate` | `(date?: RangeInterface) => void` | — | Called when the date range picker value changes |
114
+ | `chartSize` | `number` | `400` | Chart height in pixels |
115
+ | `chartOnly` | `boolean` | `false` | Renders only the chart with no card wrapper. Use `containerStyle` to size the container. |
116
+ | `containerStyle` | `string` | — | Tailwind classes applied to the outer container |
117
+ | `tool` | `ReactElement` | — | Extra element rendered in the top-right of the chart header (e.g. an icon button) |
118
+ | `minInterval` | `number` | — | Minimum interval for the date range picker |
119
+
120
+ ##### GanttTask
121
+
122
+ | Name | Type | Description |
123
+ | ------- | -------- | ---------------------------------------------- |
124
+ | `id` | `string` | Unique identifier for the task |
125
+ | `name` | `string` | Display name shown on the bar and in the table |
126
+ | `start` | `Date` | Task start date |
127
+ | `end` | `Date` | Task end date |
128
+ | `color` | `string` | Optional per-task color override |
@@ -1,7 +1,7 @@
1
- import { CalendarIcon } from "@heroicons/react/24/outline";
2
1
  import { storiesOf } from "@storybook/react";
3
- import React, { useCallback, useState } from "react";
2
+ import React, { useState } from "react";
4
3
  import { GanttChart } from ".";
4
+ import { StorySection } from "../../storyUtils";
5
5
  import README from "./README.md";
6
6
 
7
7
  const stories = storiesOf("Chart", module);
@@ -12,127 +12,143 @@ stories.addParameters({
12
12
  },
13
13
  });
14
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
- ]);
15
+ const today = new Date();
16
+ const day = 24 * 60 * 60 * 1000;
65
17
 
66
- const handleTaskClick = useCallback((taskId: string, taskName: string) => {
67
- console.log(`Clicked task: ${taskName} (ID: ${taskId})`);
68
- }, []);
18
+ const baseTasks = [
19
+ {
20
+ id: "task1",
21
+ name: "Planning",
22
+ start: new Date(today.getTime() - 5 * day),
23
+ end: new Date(today.getTime() - 3 * day),
24
+ },
25
+ {
26
+ id: "task2",
27
+ name: "Design",
28
+ start: new Date(today.getTime() - 3 * day),
29
+ end: new Date(today.getTime() + 2 * day),
30
+ },
31
+ {
32
+ id: "task3",
33
+ name: "Development",
34
+ start: new Date(today.getTime()),
35
+ end: new Date(today.getTime() + 10 * day),
36
+ },
37
+ {
38
+ id: "task4",
39
+ name: "Testing",
40
+ start: new Date(today.getTime() + 8 * day),
41
+ end: new Date(today.getTime() + 12 * day),
42
+ },
43
+ {
44
+ id: "task5",
45
+ name: "Deployment",
46
+ start: new Date(today.getTime() + 12 * day),
47
+ end: new Date(today.getTime() + 14 * day),
48
+ },
49
+ ];
69
50
 
70
- const handleTaskChange = useCallback((tasks: any[]) => {
71
- setGanttTasks(tasks);
72
- console.log(`Tasks updated: ${tasks.length} tasks`);
73
- }, []);
51
+ stories.add("Gantt Chart", () => {
52
+ const [tasks, setTasks] = useState(baseTasks);
74
53
 
75
54
  return (
76
55
  <>
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
- />
56
+ <StorySection
57
+ title="Read Mode"
58
+ description="Default display mode. Renders a horizontal range bar chart. Each task in the tasks array becomes one bar. colors are applied per task in order."
59
+ >
60
+ <div className="w-full">
61
+ <GanttChart
62
+ title="Project Timeline"
63
+ tasks={tasks}
64
+ showGrid={true}
65
+ showTooltip={true}
66
+ showDataLabel={true}
67
+ showToolbar={true}
68
+ onClick={(taskId, taskName) =>
69
+ alert(`Clicked: ${taskName} (${taskId})`)
70
+ }
71
+ colors={["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"]}
72
+ />
73
+ </div>
74
+ </StorySection>
75
+
76
+ <StorySection
77
+ title="Write Mode"
78
+ description="mode='write' renders an editable table above the chart. Tasks can be added, edited inline, and deleted. onTaskChange is called with the updated task array on every change."
79
+ >
80
+ <div className="w-full">
81
+ <GanttChart
82
+ title="Project Timeline"
83
+ label="Tasks"
84
+ tasks={tasks}
85
+ mode="write"
86
+ onTaskChange={(updated) => setTasks(updated)}
87
+ onClick={(taskId, taskName) =>
88
+ alert(`Clicked: ${taskName} (${taskId})`)
89
+ }
90
+ showGrid={true}
91
+ showTooltip={true}
92
+ showDataLabel={true}
93
+ colors={["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"]}
94
+ />
95
+ </div>
96
+ </StorySection>
97
+
98
+ <StorySection
99
+ title="Date Range Picker"
100
+ description="dateRangeVisible=true shows a date range picker below the chart. Pass customDate to pre-select a range and onChangeDate to handle updates."
101
+ >
102
+ <div className="w-full">
103
+ <GanttChart
104
+ title="Project Timeline"
105
+ tasks={tasks}
106
+ dateRangeVisible={true}
107
+ showTooltip={true}
108
+ showDataLabel={true}
109
+ onChangeDate={(range) => console.log("Date range changed", range)}
110
+ colors={["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"]}
111
+ />
112
+ </div>
113
+ </StorySection>
109
114
 
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
- />
115
+ <StorySection
116
+ title="Dark Mode"
117
+ description="darkMode=true switches axis labels and text to white. darkModeBg sets the card background. enableGradient applies a gradient fill to bars."
118
+ dark
119
+ >
120
+ <div className="w-full">
121
+ <GanttChart
122
+ title="Development Sprint"
123
+ tasks={tasks.slice(1, 4)}
124
+ darkMode={true}
125
+ darkModeBg="bg-gray-900"
126
+ borderColor="#374151"
127
+ enableGradient={true}
128
+ showTooltip={true}
129
+ showDataLabel={true}
130
+ colors={["#3B82F6", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6"]}
131
+ />
132
+ </div>
133
+ </StorySection>
124
134
 
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
- />
135
+ <StorySection
136
+ title="Chart Only"
137
+ description="chartOnly=true strips the card wrapper and renders just the chart. Use containerStyle to control the dimensions."
138
+ >
139
+ <div className="w-full h-64">
140
+ <GanttChart
141
+ title="Minimal"
142
+ tasks={tasks.slice(0, 3)}
143
+ chartOnly={true}
144
+ containerStyle="h-64 w-full"
145
+ showDataLabel={false}
146
+ showToolbar={false}
147
+ showTooltip={true}
148
+ colors={["#008FFB", "#00E396", "#FEB019"]}
149
+ />
150
+ </div>
151
+ </StorySection>
136
152
  </>
137
153
  );
138
154
  });