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.
Files changed (25) 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/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { storiesOf } from "@storybook/react";
2
2
  import React from "react";
3
- import { Container } from "../../structure/container";
3
+ import { StorySection } from "../../storyUtils";
4
4
  import README from "./README.md";
5
5
  import { DataGraph } from "./index";
6
6
 
@@ -12,73 +12,92 @@ stories.addParameters({
12
12
  },
13
13
  });
14
14
 
15
+ const workspace = {
16
+ apiEndpoint: "http://localhost:3000/api",
17
+ apiEndpointType: "mongoDB" as const,
18
+ };
19
+
15
20
  stories.add("Data Graph", () => {
16
21
  return (
17
- <Container bgColor="bg-white">
18
- <DataGraph
19
- charts={[
20
- {
21
- gridSize: 1,
22
- type: "card",
23
- title: "All Products",
24
- description: "Related to ESH",
25
- spaceId: "esh-products",
26
- query: [],
27
- queryBaseType: "count",
28
- },
29
- {
30
- gridSize: 1,
31
- type: "card",
32
- title: "Price",
33
- description: "Related to ESH",
34
- spaceId: "esh-products",
35
- query: [],
36
- queryBaseType: "sum",
37
- queryAttributeId: ["price"],
38
- },
39
- {
40
- gridSize: 2,
41
- type: "bar",
42
- title: "Price per kg",
43
- description: "Related to ESH",
44
- spaceId: "esh-products",
45
- query: [
46
- { type: "=", queryId: "code", value: "P001" },
47
- { type: "=", queryId: "code", value: "N001" },
48
- { type: "=", queryId: "code", value: "A001" },
49
- ],
50
- queryBaseType: "sum",
51
- queryAttributeId: ["price"],
52
- },
53
- // {
54
- // gridSize: 2,
55
- // type: "radar",
56
- // title: "Price per kg",
57
- // description: "Related to ESH",
58
- // spaceId: "meraque-order",
59
- // query: [
60
- // {
61
- // type: "=",
62
- // queryId: "status",
63
- // value: "Not Completed",
64
- // },
65
- // {
66
- // type: "=",
67
- // queryId: "status",
68
- // value: "Completed",
69
- // },
70
- // ],
71
- // queryBaseType: "sum",
72
- // queryAttributeId: ["cropSprayed", "areaSprayed", "pesticideUsed"],
73
- // queryBaseDateId: "startDate",
74
- // },
75
- ]}
76
- workspace={{
77
- apiEndpoint: "http://localhost:3000/api/data",
78
- assetEndpoint:
79
- "https://firebasestorage.googleapis.com/v0/b/esh-web-dev.appspot.com/o/",
80
- }}
81
- />
82
- </Container>
22
+ <>
23
+ <StorySection
24
+ title="Card Charts"
25
+ description="type='card' renders a stat card. queryBaseType='count' counts records; 'sum' totals a numeric field specified in queryAttributeId. queryBaseDateId enables a date range picker on the card."
26
+ >
27
+ <div className="w-full">
28
+ <DataGraph
29
+ charts={[
30
+ {
31
+ gridSize: 1,
32
+ type: "card",
33
+ title: "Total Products",
34
+ description: "All products in catalogue",
35
+ spaceId: "esh-products",
36
+ query: [],
37
+ queryBaseType: "count",
38
+ },
39
+ {
40
+ gridSize: 1,
41
+ type: "card",
42
+ title: "Total Revenue",
43
+ description: "Sum of all order prices",
44
+ spaceId: "esh-products",
45
+ query: [],
46
+ queryBaseType: "sum",
47
+ queryAttributeId: ["price"],
48
+ queryBaseDateId: "createdAt",
49
+ },
50
+ ]}
51
+ workspace={workspace}
52
+ gridSize={2}
53
+ />
54
+ </div>
55
+ </StorySection>
56
+
57
+ <StorySection
58
+ title="Mixed Dashboard"
59
+ description="Combine multiple chart types in one DataGraph. Each chart's gridSize controls how many columns it spans within the grid."
60
+ >
61
+ <div className="w-full">
62
+ <DataGraph
63
+ charts={[
64
+ {
65
+ gridSize: 1,
66
+ type: "card",
67
+ title: "All Products",
68
+ description: "Total product count",
69
+ spaceId: "esh-products",
70
+ query: [],
71
+ queryBaseType: "count",
72
+ },
73
+ {
74
+ gridSize: 1,
75
+ type: "card",
76
+ title: "Total Price",
77
+ description: "Sum of all prices",
78
+ spaceId: "esh-products",
79
+ query: [],
80
+ queryBaseType: "sum",
81
+ queryAttributeId: ["price"],
82
+ },
83
+ {
84
+ gridSize: 2,
85
+ type: "bar",
86
+ title: "Price per Code",
87
+ spaceId: "esh-products",
88
+ query: [
89
+ { type: "=", queryId: "code", value: "P001" },
90
+ { type: "=", queryId: "code", value: "N001" },
91
+ { type: "=", queryId: "code", value: "A001" },
92
+ ],
93
+ queryBaseType: "sum",
94
+ queryAttributeId: ["price"],
95
+ },
96
+ ]}
97
+ workspace={workspace}
98
+ />
99
+ </div>
100
+ </StorySection>
101
+ </>
83
102
  );
84
103
  });
@@ -4,59 +4,157 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Data Reference
7
+ A searchable select input that fetches its options from a remote data source. Supports single (`reference`) and multi-select (`listReference`) modes, live search, query filtering, and sort.
8
8
 
9
9
  ##### Import
10
10
 
11
11
  ```js
12
12
  import { DataReference } from "blixify-ui-web/components/data/dataReference";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ Single reference select:
18
+
19
+ ```jsx
20
+ const [value, setValue] = useState("");
21
+
22
+ <DataReference
23
+ value={value}
24
+ schema={{
25
+ id: "salesSelected",
26
+ name: "Sales Person",
27
+ type: "reference",
28
+ referenceSpaceId: "salesNameList",
29
+ referenceLabel: "name",
30
+ }}
31
+ devSettings={{
32
+ apiEndpoint: "http://localhost:3000/api",
33
+ apiEndpointType: "mongoDB",
34
+ }}
35
+ lib={{ axios }}
36
+ onChange={(value) => setValue(value)}
37
+ />;
38
+ ```
39
+
40
+ With query filter and sort:
13
41
 
14
- return (
15
- <div className="p-4 rounded-md bg-zinc-700">
16
- <DataReference
17
- value={value}
18
- schema={{
19
- id: "title",
20
- type: "reference",
21
- name: "Reference",
22
- referenceLabel: "title",
23
- referenceSpaceId: "meraque-cycles",
24
- }}
25
- devSettings={{
26
- apiEndpoint: "http://localhost:3000/api/data",
27
- apiEndpointType: "mongoDB",
28
- assetEndpoint:
29
- "https://firebasestorage.googleapis.com/v0/b/esh-web-dev.appspot.com/o/",
30
- }}
31
- lib={{
32
- axios: axios,
33
- }}
34
- onChange={(value) => {
35
- setValue(value);
36
- }}
37
- darkMode
38
- staticDropdown
39
- />
40
- </div>
41
- );
42
+ ```jsx
43
+ <DataReference
44
+ value={value}
45
+ schema={{
46
+ id: "salesSelected",
47
+ name: "Sales Person",
48
+ type: "reference",
49
+ referenceSpaceId: "salesNameList",
50
+ referenceLabel: "name",
51
+ referenceQuery: [{ type: "=", value: "Sales", queryId: "role" }],
52
+ referenceSort: { sortId: "name", type: "asc" },
53
+ }}
54
+ devSettings={{
55
+ apiEndpoint: "http://localhost:3000/api",
56
+ apiEndpointType: "mondayServer",
57
+ }}
58
+ lib={{ axios }}
59
+ onChange={(value) => setValue(value)}
60
+ />
61
+ ```
62
+
63
+ Multi-select (listReference):
64
+
65
+ ```jsx
66
+ const [value, setValue] = useState([]);
67
+
68
+ <DataReference
69
+ value={value}
70
+ schema={{
71
+ id: "assignees",
72
+ name: "Assignees",
73
+ type: "listReference",
74
+ referenceSpaceId: "members",
75
+ referenceLabel: "name",
76
+ }}
77
+ devSettings={{
78
+ apiEndpoint: "http://localhost:3000/api",
79
+ apiEndpointType: "mongoDB",
80
+ }}
81
+ lib={{ axios }}
82
+ onChange={(value) => setValue(value)}
83
+ closeOnClickOutside
84
+ />;
85
+ ```
86
+
87
+ Dark mode with static dropdown:
88
+
89
+ ```jsx
90
+ <div className="p-4 rounded-md bg-zinc-800">
91
+ <DataReference
92
+ value={value}
93
+ schema={{
94
+ id: "title",
95
+ name: "Reference",
96
+ type: "reference",
97
+ referenceSpaceId: "items",
98
+ referenceLabel: "title",
99
+ }}
100
+ devSettings={{
101
+ apiEndpoint: "http://localhost:3000/api",
102
+ apiEndpointType: "mongoDB",
103
+ }}
104
+ lib={{ axios }}
105
+ onChange={(value) => setValue(value)}
106
+ darkMode
107
+ staticDropdown
108
+ />
109
+ </div>
42
110
  ```
43
111
 
44
112
  ##### Required props
45
113
 
46
- | Name | Type | Description |
47
- | ------ | --------------- | ------------------------------------ |
48
- | value | `any` | Value (string or an array of string) |
49
- | schema | `DataStructure` | Refer to DataStructure |
114
+ | Name | Type | Description |
115
+ | -------- | --------------- | --------------------------------------------------------------------------- |
116
+ | `value` | `any` | Current value — a string for `reference`, or `string[]` for `listReference` |
117
+ | `schema` | `DataStructure` | Column definition — see schema fields below |
50
118
 
51
119
  ##### Optional props
52
120
 
53
- | Name | Type | Description |
54
- | ------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
55
- | devSettings | `WorkspaceDevSettings` | Refer WorkspaceDevSettings |
56
- | onChange | `(value: any) => void` | On change callback function |
57
- | lib | `{ axios?: any}` | Additional libraries |
58
- | optional | `boolean` | |
59
- | darkMode | `booelan` | |
60
- | staticDropdown | `booelan` | When `true`, the parent container's height will expand to fit this component. |
61
- | closeOnClickOutside | `booelan` | When `true`, the option container will remain open and close when users clicks outside of the container. Only applies to multi select. |
62
- | subLabel | `string` | Sub Label text for better UI/UX Explanation for the select |
121
+ | Name | Type | Description |
122
+ | --------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------- |
123
+ | `devSettings` | `WorkspaceDevSettings` | API connection settings — see WorkspaceDevSettings below |
124
+ | `lib` | `{ axios?: any }` | Pass your axios instance for making API requests |
125
+ | `onChange` | `(value: any) => void` | Called with the new value when the selection changes |
126
+ | `optional` | `boolean` | When `true`, skips validation on `handleSubmit` |
127
+ | `subLabel` | `string` | Secondary label rendered below the main label for additional context |
128
+ | `darkMode` | `boolean` | Switches the select to a dark theme |
129
+ | `staticDropdown` | `boolean` | When `true`, the parent container expands to fit the open dropdown instead of the dropdown overlapping content below |
130
+ | `closeOnClickOutside` | `boolean` | When `true`, the dropdown closes when the user clicks outside. Applies to `listReference` (multi-select) mode |
131
+
132
+ ##### Schema fields (DataStructure)
133
+
134
+ Only fields relevant to `DataReference` are listed. `type` must be `"reference"` or `"listReference"`.
135
+
136
+ | Name | Type | Description |
137
+ | ------------------------- | -------------------------------- | ----------------------------------------------------------------------------------- |
138
+ | `id` | `string` | Unique field identifier |
139
+ | `name` | `string` | Label displayed above the select |
140
+ | `type` | `"reference" \| "listReference"` | `"reference"` for single select, `"listReference"` for multi-select |
141
+ | `referenceSpaceId` | `string` | The collection/space ID to fetch options from |
142
+ | `referenceLabel` | `string` | The field key in each fetched record to use as the option label |
143
+ | `referenceSecondaryLabel` | `string` | Optional secondary label field shown below the primary label in each option |
144
+ | `referenceQuery` | `Query[]` | Optional filter queries applied when fetching options |
145
+ | `referenceSort` | `Sort` | Optional sort applied when fetching options, e.g. `{ sortId: "name", type: "asc" }` |
146
+ | `placeholder` | `string` | Placeholder text shown when no value is selected |
147
+ | `disabled` | `boolean` | Disables the select input |
148
+ | `optional` | `boolean` | Marks the field as optional in form validation |
149
+
150
+ ##### WorkspaceDevSettings
151
+
152
+ | Name | Type | Description |
153
+ | ------------------ | -------------------------------------------------------------------------- | ---------------------------------- |
154
+ | `apiEndpoint` | `string` | Base URL for the data API |
155
+ | `apiEndpointType` | `"mongoDB" \| "firebase" \| "mongoServer" \| "fbServer" \| "mondayServer"` | The server/DB type driving the API |
156
+ | `apiEndpointToken` | `string` | Auth token for the API endpoint |
157
+ | `apiUserToken` | `string` | Per-user auth token |
158
+ | `assetEndpoint` | `string` | Base URL for asset/file storage |
159
+ | `assetType` | `"firebase" \| "aws"` | Storage provider type |
160
+ | `assetBucket` | `string` | Storage bucket name |
@@ -1,7 +1,8 @@
1
1
  import { storiesOf } from "@storybook/react";
2
2
  import axios from "axios";
3
- import { useState } from "react";
3
+ import React, { useState } from "react";
4
4
  import { DataReference } from "../dataReference/index";
5
+ import { StorySection } from "../../storyUtils";
5
6
  import README from "./README.md";
6
7
 
7
8
  const stories = storiesOf("Data", module);
@@ -12,42 +13,113 @@ stories.addParameters({
12
13
  },
13
14
  });
14
15
 
16
+ const devSettings = {
17
+ apiEndpoint: "http://localhost:3000/api",
18
+ apiEndpointType: "mondayServer" as const,
19
+ };
20
+
15
21
  stories.add("Data Reference", () => {
16
- const [value, setValue] = useState("");
22
+ const [singleValue, setSingleValue] = useState("");
23
+ const [filteredValue, setFilteredValue] = useState("");
24
+ const [multiValue, setMultiValue] = useState<string[]>([]);
17
25
 
18
26
  return (
19
- <div className="p-4 rounded-md bg-zinc-800">
20
- <DataReference
21
- value={value}
22
- subLabel="Testing sublabel"
23
- schema={{
24
- id: "salesSelected",
25
- name: "Referral Sales Person",
26
- type: "reference",
27
- referenceSpaceId: "nonAuthSalesNameList",
28
- referenceLabel: "name",
29
- referenceQuery: [
30
- {
31
- type: "=",
32
- value: "Sales",
33
- queryId: "dup__of_role__1",
34
- },
35
- ],
36
- referenceSort: { sortId: "name", type: "asc" },
37
- }}
38
- devSettings={{
39
- apiEndpoint: `http://localhost:3000/api`,
40
- apiEndpointType: "mondayServer",
41
- }}
42
- lib={{
43
- axios: axios,
44
- }}
45
- onChange={(value) => {
46
- setValue(value);
47
- }}
48
- darkMode
49
- staticDropdown
50
- />
51
- </div>
27
+ <>
28
+ <StorySection
29
+ title="Single Reference"
30
+ description="type='reference' renders a single-select. Options are fetched from the referenceSpaceId collection and labelled by referenceLabel."
31
+ >
32
+ <div className="w-80">
33
+ <DataReference
34
+ value={singleValue}
35
+ schema={{
36
+ id: "salesSelected",
37
+ name: "Sales Person",
38
+ type: "reference",
39
+ referenceSpaceId: "nonAuthSalesNameList",
40
+ referenceLabel: "name",
41
+ }}
42
+ devSettings={devSettings}
43
+ lib={{ axios }}
44
+ onChange={(value) => setSingleValue(value)}
45
+ staticDropdown
46
+ />
47
+ </div>
48
+ </StorySection>
49
+
50
+ <StorySection
51
+ title="With Query Filter & Sort"
52
+ description="referenceQuery filters the fetched options server-side. referenceSort controls the order. subLabel adds a secondary hint below the field label."
53
+ >
54
+ <div className="w-80">
55
+ <DataReference
56
+ value={filteredValue}
57
+ schema={{
58
+ id: "filteredSales",
59
+ name: "Referral Sales Person",
60
+ type: "reference",
61
+ referenceSpaceId: "nonAuthSalesNameList",
62
+ referenceLabel: "name",
63
+ referenceQuery: [
64
+ { type: "=", value: "Sales", queryId: "dup__of_role__1" },
65
+ ],
66
+ referenceSort: { sortId: "name", type: "asc" },
67
+ }}
68
+ devSettings={devSettings}
69
+ lib={{ axios }}
70
+ onChange={(value) => setFilteredValue(value)}
71
+ subLabel="Only Sales role members are shown"
72
+ staticDropdown
73
+ />
74
+ </div>
75
+ </StorySection>
76
+
77
+ <StorySection
78
+ title="Multi-select (listReference)"
79
+ description="type='listReference' enables multi-select — value is a string array. closeOnClickOutside keeps the dropdown open until the user clicks away."
80
+ >
81
+ <div className="w-80">
82
+ <DataReference
83
+ value={multiValue}
84
+ schema={{
85
+ id: "assignees",
86
+ name: "Assignees",
87
+ type: "listReference",
88
+ referenceSpaceId: "nonAuthSalesNameList",
89
+ referenceLabel: "name",
90
+ }}
91
+ devSettings={devSettings}
92
+ lib={{ axios }}
93
+ onChange={(value) => setMultiValue(value)}
94
+ closeOnClickOutside
95
+ staticDropdown
96
+ />
97
+ </div>
98
+ </StorySection>
99
+
100
+ <StorySection
101
+ title="Dark Mode"
102
+ description="Pass darkMode=true for use on dark backgrounds."
103
+ dark
104
+ >
105
+ <div className="w-80">
106
+ <DataReference
107
+ value={singleValue}
108
+ schema={{
109
+ id: "darkSales",
110
+ name: "Sales Person",
111
+ type: "reference",
112
+ referenceSpaceId: "nonAuthSalesNameList",
113
+ referenceLabel: "name",
114
+ }}
115
+ devSettings={devSettings}
116
+ lib={{ axios }}
117
+ onChange={(value) => setSingleValue(value)}
118
+ darkMode
119
+ staticDropdown
120
+ />
121
+ </div>
122
+ </StorySection>
123
+ </>
52
124
  );
53
125
  });
@@ -397,7 +397,8 @@ bareSettings={{
397
397
  <span className="text-sm text-gray-500">{item.status}</span>
398
398
  </li>
399
399
  ))}
400
- </ul>
400
+ </ul>,
401
+ viewSettings={{ listImage: "image" }} // Pass in image column ID (or just "image") for bareListComponent to replace the ddefault UI
401
402
  ),
402
403
 
403
404
  // Always-on filter applied to every list fetch (e.g. scope to current user)
@@ -98,7 +98,7 @@ Page pagination with grouped headers and dark mode:
98
98
  | `cursor` | `string \| Date` | `""` | Pass a non-empty value while more pages exist; pass `""` on the last page. Required when `paginationType="cursor"` |
99
99
  | `size` | `number` | — | Total record count. Required when `paginationType="page"` to calculate page count |
100
100
  | `hidePagination` | `boolean` | `false` | Hide the pagination bar |
101
- | `fixedPagination` | `boolean` | — | Fix the pagination bar to the bottom of the viewport |
101
+ | `fixedPagination` | `boolean` | — | Fixes the pagination bar to the bottom of the viewport when the user scrolls past it |
102
102
  | `showId` | `boolean` | — | Include the `id` field in rendered row data |
103
103
  | `disableEllipsisOnLongWord` | `boolean` | — | When `true`, long text wraps instead of being truncated with an ellipsis |
104
104
  | `className` | `string` | — | Tailwind classes applied to the outer container |