blixify-ui-web-mcp 0.1.2 → 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.
- package/lib/components/chart/ganttChart/README.md +96 -110
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +132 -116
- package/lib/components/chart/heatmapChart/README.md +93 -82
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +118 -74
- package/lib/components/chat/chatAnchor/README.md +61 -79
- package/lib/components/chat/chatBase/README.md +166 -199
- package/lib/components/chat/chatBase/chatBase.stories.tsx +243 -265
- package/lib/components/chat/chatDashboard/README.md +87 -129
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +84 -107
- package/lib/components/data/dataGraph/README.md +135 -1
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +86 -67
- package/lib/components/data/dataReference/README.md +141 -43
- package/lib/components/data/dataReference/dataReference.stories.tsx +107 -35
- package/lib/components/data/dataWrapper/README.md +2 -1
- package/lib/components/display/table/README.md +1 -1
- package/lib/components/navigation/bars/README.md +90 -17
- package/lib/components/navigation/bars/bars.stories.tsx +125 -51
- package/lib/components/navigation/breadcrumb/README.md +40 -20
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +30 -4
- package/lib/components/navigation/header/README.md +67 -108
- package/lib/components/navigation/header/header.stories.tsx +143 -39
- package/lib/components/navigation/leftNav/README.md +121 -66
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +176 -83
- package/lib/components/navigation/tabs/tabs.stories.tsx +53 -29
- package/package.json +1 -1
|
@@ -4,100 +4,82 @@
|
|
|
4
4
|
|
|
5
5
|
<hr>
|
|
6
6
|
|
|
7
|
-
A
|
|
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/
|
|
12
|
+
import { GanttChart } from "blixify-ui-web/components/chart/ganttChart";
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
##### Usage
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
const [ganttTasks, setGanttTasks] = useState<any[]>([]);
|
|
17
|
+
Read mode (display only):
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
```jsx
|
|
20
|
+
const [tasks, setTasks] = useState([
|
|
21
21
|
{
|
|
22
22
|
id: "task1",
|
|
23
|
-
name: "
|
|
24
|
-
start: new Date(
|
|
25
|
-
end: new Date(
|
|
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(
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
112
|
-
|
|
|
113
|
-
| `tasks`
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
| `
|
|
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, {
|
|
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
|
-
|
|
16
|
-
|
|
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
|
-
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
|
|
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
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<
|
|
98
|
-
title="
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
});
|