blixify-ui-web-mcp 0.1.2 → 0.1.18

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 (135) hide show
  1. package/lib/components/action/button/README.md +12 -11
  2. package/lib/components/action/button/button.stories.tsx +4 -10
  3. package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +4 -10
  4. package/lib/components/action/iconButton/iconButton.stories.tsx +4 -10
  5. package/lib/components/action/radioList/radioList.stories.tsx +4 -10
  6. package/lib/components/action/slider/slider.stories.tsx +4 -10
  7. package/lib/components/action/textButton/textButton.stories.tsx +4 -10
  8. package/lib/components/action/toggle/toggle.stories.tsx +4 -10
  9. package/lib/components/advanced/collapse/collapse.stories.tsx +4 -10
  10. package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +4 -10
  11. package/lib/components/advanced/popUp/README.md +21 -7
  12. package/lib/components/advanced/popUp/popUp.stories.tsx +4 -10
  13. package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +30 -10
  14. package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +4 -10
  15. package/lib/components/auth/signIn/signIn.stories.tsx +4 -10
  16. package/lib/components/auth/signUp/signUp.stories.tsx +4 -10
  17. package/lib/components/chart/areaChart/areaChart.stories.tsx +7 -13
  18. package/lib/components/chart/barChart/barChart.stories.tsx +7 -13
  19. package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +8 -14
  20. package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +8 -14
  21. package/lib/components/chart/card/card.stories.tsx +4 -10
  22. package/lib/components/chart/ganttChart/README.md +96 -110
  23. package/lib/components/chart/ganttChart/ganttChart.stories.tsx +135 -125
  24. package/lib/components/chart/heatmapChart/README.md +93 -82
  25. package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +122 -84
  26. package/lib/components/chart/lineChart/lineChart.stories.tsx +4 -10
  27. package/lib/components/chart/pieChart/pieChart.stories.tsx +4 -10
  28. package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +8 -14
  29. package/lib/components/chart/radarChart/radarChart.stories.tsx +4 -10
  30. package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
  31. package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +4 -10
  32. package/lib/components/chart/statsCard/statsCard.stories.tsx +4 -10
  33. package/lib/components/chart/treemapChart/treemapChart.stories.tsx +8 -14
  34. package/lib/components/chat/chatAnchor/README.md +61 -79
  35. package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +13 -19
  36. package/lib/components/chat/chatBase/README.md +244 -196
  37. package/lib/components/chat/chatBase/chatBase.stories.tsx +828 -250
  38. package/lib/components/chat/chatDashboard/README.md +89 -129
  39. package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +406 -117
  40. package/lib/components/data/dataGraph/README.md +135 -1
  41. package/lib/components/data/dataGraph/dataGraph.stories.tsx +90 -77
  42. package/lib/components/data/dataReference/README.md +141 -43
  43. package/lib/components/data/dataReference/dataReference.stories.tsx +111 -45
  44. package/lib/components/data/dataTemplate/README.md +88 -61
  45. package/lib/components/data/dataTemplate/dataModule.stories.tsx +4 -10
  46. package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +4 -10
  47. package/lib/components/data/dataWrapper/README.md +48 -46
  48. package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +258 -489
  49. package/lib/components/data/queryForm/queryForm.stories.tsx +4 -10
  50. package/lib/components/data/readQuery/readQuery.stories.tsx +4 -9
  51. package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +4 -10
  52. package/lib/components/data/writeQuery/writeQuery.stories.tsx +4 -8
  53. package/lib/components/design/actionSection/actionSection.stories.tsx +6 -10
  54. package/lib/components/design/banner/banner.stories.tsx +4 -10
  55. package/lib/components/design/bannerAction/bannerAction.stories.tsx +4 -10
  56. package/lib/components/design/blogSection/blogSection.stories.tsx +4 -10
  57. package/lib/components/design/carouselSection/carouselSection.stories.tsx +4 -10
  58. package/lib/components/design/designList/designList.stories.tsx +4 -10
  59. package/lib/components/design/faq/faq.stories.tsx +4 -10
  60. package/lib/components/design/fileGrid/fileGrid.stories.tsx +4 -10
  61. package/lib/components/design/fileViewer/fileViewer.stories.tsx +4 -10
  62. package/lib/components/design/footerSection/footerSection.stories.tsx +4 -10
  63. package/lib/components/design/googleReview/googleReview.stories.tsx +4 -10
  64. package/lib/components/design/heroSection/heroSection.stories.tsx +4 -10
  65. package/lib/components/design/iconList/iconList.stories.tsx +4 -10
  66. package/lib/components/design/imageGallery/imageGallery.stories.tsx +4 -10
  67. package/lib/components/design/imageZoom/imageZoom.stories.tsx +4 -10
  68. package/lib/components/design/leftContent/leftContent.stories.tsx +4 -10
  69. package/lib/components/design/logoCloud/logoCloud.stories.tsx +4 -10
  70. package/lib/components/design/onboarding/onboarding.stories.tsx +4 -10
  71. package/lib/components/design/pricing/pricing.stories.tsx +4 -10
  72. package/lib/components/design/rightContent/rightContent.stories.tsx +4 -10
  73. package/lib/components/design/sectionList/sectionList.stories.tsx +4 -10
  74. package/lib/components/design/teams/teams.stories.tsx +4 -10
  75. package/lib/components/display/alert/alert.stories.tsx +4 -10
  76. package/lib/components/display/calendar/README.md +49 -0
  77. package/lib/components/display/calendar/calendar.stories.tsx +71 -28
  78. package/lib/components/display/clipboard/clipboard.stories.tsx +4 -10
  79. package/lib/components/display/detailList/detailList.stories.tsx +5 -10
  80. package/lib/components/display/drawer/drawer.stories.tsx +5 -10
  81. package/lib/components/display/emptyState/emptyState.stories.tsx +4 -10
  82. package/lib/components/display/feeds/feeds.stories.tsx +4 -10
  83. package/lib/components/display/flexTable/README.md +11 -7
  84. package/lib/components/display/flexTable/flexTable.stories.tsx +114 -11
  85. package/lib/components/display/grid/README.md +28 -27
  86. package/lib/components/display/grid/grid.stories.tsx +4 -10
  87. package/lib/components/display/kanban/kanban.stories.tsx +14 -20
  88. package/lib/components/display/list/README.md +30 -29
  89. package/lib/components/display/list/list.stories.tsx +4 -10
  90. package/lib/components/display/loading/loading.stories.tsx +5 -10
  91. package/lib/components/display/mapView/mapView.stories.tsx +4 -10
  92. package/lib/components/display/modal/modal.stories.tsx +4 -11
  93. package/lib/components/display/notification/notification.stories.tsx +4 -10
  94. package/lib/components/display/progress/progress.stories.tsx +5 -10
  95. package/lib/components/display/stepper/stepper.stories.tsx +5 -10
  96. package/lib/components/display/table/README.md +38 -37
  97. package/lib/components/display/table/table.stories.tsx +8 -14
  98. package/lib/components/display/tag/tag.stories.tsx +4 -10
  99. package/lib/components/input/address/address.stories.tsx +4 -10
  100. package/lib/components/input/canvas/canvas.stories.tsx +4 -10
  101. package/lib/components/input/checkbox/checkbox.stories.tsx +4 -10
  102. package/lib/components/input/datePicker/datePicker.stories.tsx +4 -10
  103. package/lib/components/input/form/form.stories.tsx +4 -10
  104. package/lib/components/input/markdown/markdown.stories.tsx +5 -10
  105. package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +4 -10
  106. package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +4 -10
  107. package/lib/components/input/rating/rating.stories.tsx +4 -10
  108. package/lib/components/input/select/README.md +30 -29
  109. package/lib/components/input/select/select.stories.tsx +4 -10
  110. package/lib/components/input/signature/signature.stories.tsx +4 -10
  111. package/lib/components/input/textArea/textArea.stories.tsx +4 -10
  112. package/lib/components/input/textInput/textinput.stories.tsx +4 -10
  113. package/lib/components/input/uploadInput/uploadInput.stories.tsx +135 -11
  114. package/lib/components/navigation/bars/README.md +90 -17
  115. package/lib/components/navigation/bars/bars.stories.tsx +128 -60
  116. package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +5 -10
  117. package/lib/components/navigation/breadcrumb/README.md +40 -20
  118. package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +34 -14
  119. package/lib/components/navigation/header/README.md +67 -108
  120. package/lib/components/navigation/header/header.stories.tsx +165 -49
  121. package/lib/components/navigation/leftNav/README.md +121 -66
  122. package/lib/components/navigation/leftNav/leftNav.stories.tsx +178 -91
  123. package/lib/components/navigation/tabs/tabs.stories.tsx +57 -39
  124. package/lib/components/structure/column/column.stories.tsx +5 -10
  125. package/lib/components/structure/container/container.stories.tsx +5 -10
  126. package/lib/components/structure/link/link.stories.tsx +4 -10
  127. package/lib/components/structure/text/text.stories.tsx +5 -10
  128. package/lib/components/template/authPage/authPage.stories.tsx +6 -5
  129. package/lib/components/template/landingPage/landingPage.stories.tsx +8 -6
  130. package/lib/components/template/productListing/productListing.stories.tsx +7 -13
  131. package/lib/components/template/productOverview/productOverview.stories.tsx +5 -11
  132. package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +6 -12
  133. package/lib/components/template/userHomePage/userHomePage.stories.tsx +7 -6
  134. package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +5 -11
  135. package/package.json +1 -1
@@ -4,10 +4,144 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Data Graph for Dashboard
7
+ A dashboard chart grid that fetches and renders analytics data from a remote API. Supports card, bar, line, pie, and radar chart types in a responsive grid layout. Each chart handles its own data fetching, date range filtering, and attribute filtering.
8
8
 
9
9
  ##### Import
10
10
 
11
11
  ```js
12
12
  import { DataGraph } from "blixify-ui-web/components/data/dataGraph";
13
13
  ```
14
+
15
+ ##### Usage
16
+
17
+ Basic dashboard with card and bar charts:
18
+
19
+ ```jsx
20
+ <DataGraph
21
+ charts={[
22
+ {
23
+ gridSize: 1,
24
+ type: "card",
25
+ title: "Total Products",
26
+ spaceId: "products",
27
+ query: [],
28
+ queryBaseType: "count",
29
+ },
30
+ {
31
+ gridSize: 1,
32
+ type: "card",
33
+ title: "Total Revenue",
34
+ spaceId: "orders",
35
+ query: [],
36
+ queryBaseType: "sum",
37
+ queryAttributeId: ["price"],
38
+ queryBaseDateId: "createdAt",
39
+ },
40
+ {
41
+ gridSize: 2,
42
+ type: "bar",
43
+ title: "Sales by Product",
44
+ spaceId: "orders",
45
+ query: [
46
+ { type: "=", queryId: "code", value: "P001" },
47
+ { type: "=", queryId: "code", value: "P002" },
48
+ ],
49
+ queryBaseType: "sum",
50
+ queryAttributeId: ["price"],
51
+ },
52
+ ]}
53
+ workspace={{
54
+ apiEndpoint: "http://localhost:3000/api",
55
+ apiEndpointType: "mongoDB",
56
+ }}
57
+ />
58
+ ```
59
+
60
+ Line chart with date range:
61
+
62
+ ```jsx
63
+ {
64
+ gridSize: 2,
65
+ type: "line",
66
+ title: "Orders Over Time",
67
+ spaceId: "orders",
68
+ query: [],
69
+ queryBaseType: "count",
70
+ queryBaseDateId: "createdAt",
71
+ }
72
+ ```
73
+
74
+ Radar chart comparing multiple attributes across query groups:
75
+
76
+ ```jsx
77
+ {
78
+ gridSize: 2,
79
+ type: "radar",
80
+ title: "Performance",
81
+ spaceId: "reports",
82
+ query: [
83
+ { type: "=", queryId: "status", value: "Completed" },
84
+ { type: "=", queryId: "status", value: "Pending" },
85
+ ],
86
+ queryBaseType: "sum",
87
+ queryAttributeId: ["revenue", "units", "returns"],
88
+ queryBaseDateId: "createdAt",
89
+ }
90
+ ```
91
+
92
+ Custom layout via renderSettings:
93
+
94
+ ```jsx
95
+ <DataGraph
96
+ charts={charts}
97
+ workspace={workspace}
98
+ renderSettings={(chartsElement, data) => (
99
+ <div className="my-custom-wrapper">{chartsElement}</div>
100
+ )}
101
+ />
102
+ ```
103
+
104
+ ##### Required props
105
+
106
+ | Name | Type | Description |
107
+ | ----------- | ---------------------- | -------------------------------------------------------- |
108
+ | `charts` | `Charts[]` | List of chart definitions — see Charts below |
109
+ | `workspace` | `WorkspaceDevSettings` | API connection settings — see WorkspaceDevSettings below |
110
+
111
+ ##### Optional props
112
+
113
+ | Name | Type | Default | Description |
114
+ | ---------------- | ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
115
+ | `gridSize` | `2 \| 3` | — | Override the grid column layout. Default is a responsive `1 → 2 → 4` column grid. `2` forces 2 cols, `3` forces 3 cols. |
116
+ | `renderSettings` | `(charts: ReactElement, data: any) => any` | — | Custom render function. Receives the rendered charts element and the raw analytics data object. Use to wrap charts in a custom layout. |
117
+
118
+ ##### Charts
119
+
120
+ | Name | Type | Description |
121
+ | ------------------ | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
122
+ | `type` | `"card" \| "bar" \| "line" \| "pie" \| "radar"` | Chart type to render |
123
+ | `title` | `string` | Chart title — also used as the key for internal state |
124
+ | `spaceId` | `string` | The collection/space ID to query data from |
125
+ | `gridSize` | `number` | Number of grid columns this chart spans |
126
+ | `query` | `Query[]` | Data series definitions. Each query entry produces one data point or series segment. Pass `[]` for a single aggregate. |
127
+ | `queryBaseType` | `"count" \| "sum" \| "avg" \| "value"` | Aggregate function. Defaults to `"count"`. |
128
+ | `queryAttributeId` | `string[]` | Required when `queryBaseType` is `"sum"`, `"avg"`, or `"value"`. The field(s) to aggregate. For `radar`, each entry becomes a radar axis. |
129
+ | `queryBaseDateId` | `string` | Field used for date range filtering. When set, a date range picker is shown on the chart. |
130
+ | `queryReferenceId` | `string` | Field used for reference-based filtering when a reference filter is active. |
131
+ | `baseQuery` | `Query[]` | Static filter queries always applied alongside any dynamic filters. |
132
+ | `description` | `string` | Subtitle shown on `card` type charts |
133
+ | `cardIcon` | `string` | Heroicon name (solid) for the card icon, e.g. `"UserIcon"`. Defaults to `FolderIcon`. |
134
+ | `cardIconBgColor` | `string` | Tailwind bg class for the card icon background |
135
+ | `colors` | `string[]` | Custom color array for chart segments/bars/lines |
136
+ | `orientation` | `"col" \| "row"` | Bar chart orientation. Defaults to `"row"`. |
137
+ | `stackedVertical` | `boolean` | Enables stacked bars on bar charts |
138
+
139
+ ##### WorkspaceDevSettings
140
+
141
+ | Name | Type | Description |
142
+ | ------------------ | -------------------------------------------------------------------------- | ------------------------------- |
143
+ | `apiEndpoint` | `string` | Base URL for the data API |
144
+ | `apiEndpointType` | `"mongoDB" \| "firebase" \| "mongoServer" \| "fbServer" \| "mondayServer"` | Server/DB type driving the API |
145
+ | `apiEndpointToken` | `string` | Auth token for the API endpoint |
146
+ | `apiUserToken` | `string` | Per-user auth token |
147
+ | `assetEndpoint` | `string` | Base URL for asset/file storage |
@@ -1,84 +1,97 @@
1
- import { storiesOf } from "@storybook/react";
2
1
  import React from "react";
3
- import { Container } from "../../structure/container";
4
- import README from "./README.md";
2
+ import { StorySection } from "../../storyUtils";
5
3
  import { DataGraph } from "./index";
6
4
 
7
- const stories = storiesOf("Data", module);
5
+ const meta = { title: "Data/Data Graph" };
6
+ export default meta;
8
7
 
9
- stories.addParameters({
10
- readme: {
11
- content: README,
12
- },
13
- });
14
8
 
15
- stories.add("Data Graph", () => {
9
+ const workspace = {
10
+ apiEndpoint: "http://localhost:3000/api",
11
+ apiEndpointType: "mongoDB" as const,
12
+ };
13
+
14
+ export const DataGraphStory = () => {
16
15
  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>
16
+ <>
17
+ <StorySection
18
+ title="Card Charts"
19
+ 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."
20
+ >
21
+ <div className="w-full">
22
+ <DataGraph
23
+ charts={[
24
+ {
25
+ gridSize: 1,
26
+ type: "card",
27
+ title: "Total Products",
28
+ description: "All products in catalogue",
29
+ spaceId: "esh-products",
30
+ query: [],
31
+ queryBaseType: "count",
32
+ },
33
+ {
34
+ gridSize: 1,
35
+ type: "card",
36
+ title: "Total Revenue",
37
+ description: "Sum of all order prices",
38
+ spaceId: "esh-products",
39
+ query: [],
40
+ queryBaseType: "sum",
41
+ queryAttributeId: ["price"],
42
+ queryBaseDateId: "createdAt",
43
+ },
44
+ ]}
45
+ workspace={workspace}
46
+ gridSize={2}
47
+ />
48
+ </div>
49
+ </StorySection>
50
+
51
+ <StorySection
52
+ title="Mixed Dashboard"
53
+ description="Combine multiple chart types in one DataGraph. Each chart's gridSize controls how many columns it spans within the grid."
54
+ >
55
+ <div className="w-full">
56
+ <DataGraph
57
+ charts={[
58
+ {
59
+ gridSize: 1,
60
+ type: "card",
61
+ title: "All Products",
62
+ description: "Total product count",
63
+ spaceId: "esh-products",
64
+ query: [],
65
+ queryBaseType: "count",
66
+ },
67
+ {
68
+ gridSize: 1,
69
+ type: "card",
70
+ title: "Total Price",
71
+ description: "Sum of all prices",
72
+ spaceId: "esh-products",
73
+ query: [],
74
+ queryBaseType: "sum",
75
+ queryAttributeId: ["price"],
76
+ },
77
+ {
78
+ gridSize: 2,
79
+ type: "bar",
80
+ title: "Price per Code",
81
+ spaceId: "esh-products",
82
+ query: [
83
+ { type: "=", queryId: "code", value: "P001" },
84
+ { type: "=", queryId: "code", value: "N001" },
85
+ { type: "=", queryId: "code", value: "A001" },
86
+ ],
87
+ queryBaseType: "sum",
88
+ queryAttributeId: ["price"],
89
+ },
90
+ ]}
91
+ workspace={workspace}
92
+ />
93
+ </div>
94
+ </StorySection>
95
+ </>
83
96
  );
84
- });
97
+ }
@@ -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 |