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
@@ -1,17 +1,11 @@
1
1
  import { FolderPlusIcon, HomeIcon } from "@heroicons/react/24/outline";
2
- import { storiesOf } from "@storybook/react";
3
2
  import React, { useState } from "react";
4
3
  import { Option, Select } from ".";
5
4
  import { StorySection } from "../../storyUtils";
6
- import README from "./README.md";
7
5
 
8
- const stories = storiesOf("Input", module);
6
+ const meta = { title: "Input/Select" };
7
+ export default meta;
9
8
 
10
- stories.addParameters({
11
- readme: {
12
- content: README,
13
- },
14
- });
15
9
 
16
10
  const genderOptions: Option[] = [
17
11
  {
@@ -56,7 +50,7 @@ const genderOptions: Option[] = [
56
50
  },
57
51
  ];
58
52
 
59
- stories.add("Select", () => {
53
+ export const SelectStory = () => {
60
54
  const [value, setValue] = useState("");
61
55
  const [multiValue, setMultiValue] = useState<string[]>(["M"]);
62
56
  const [dbValue, setDBValue] = useState("");
@@ -283,4 +277,4 @@ stories.add("Select", () => {
283
277
  </StorySection>
284
278
  </>
285
279
  );
286
- });
280
+ }
@@ -1,24 +1,18 @@
1
- import { storiesOf } from "@storybook/react";
2
1
  import React, { useRef, useState } from "react";
3
2
  import { Signature } from ".";
4
3
  import { Button } from "../../action/button";
5
4
  import { Modal } from "../../display/modal";
6
5
  import { Form } from "../form";
7
6
  import { StorySection } from "../../storyUtils";
8
- import README from "./README.md";
9
7
 
10
- const stories = storiesOf("Input", module);
8
+ const meta = { title: "Input/Signature" };
9
+ export default meta;
11
10
 
12
- stories.addParameters({
13
- readme: {
14
- content: README,
15
- },
16
- });
17
11
 
18
12
  const sampleDataURL =
19
13
  "https://upload.wikimedia.org/wikipedia/commons/2/2d/Sample_SVG_file%2C_signature.svg";
20
14
 
21
- stories.add("Signature", () => {
15
+ export const SignatureStory = () => {
22
16
  const signatureRef = useRef<any>(null);
23
17
  const modalSignatureRef = useRef<any>(null);
24
18
  const modalFormRef = useRef<any>(null);
@@ -185,4 +179,4 @@ stories.add("Signature", () => {
185
179
  </StorySection>
186
180
  </>
187
181
  );
188
- });
182
+ }
@@ -1,17 +1,11 @@
1
- import { storiesOf } from "@storybook/react";
2
1
  import React, { useState } from "react";
3
2
  import { TextArea } from ".";
4
- import README from "./README.md";
5
3
 
6
- const stories = storiesOf("Input", module);
4
+ const meta = { title: "Input/TextArea" };
5
+ export default meta;
7
6
 
8
- stories.addParameters({
9
- readme: {
10
- content: README,
11
- },
12
- });
13
7
 
14
- stories.add("TextArea", () => {
8
+ export const TextAreaStory = () => {
15
9
  const [value, setValue] = useState("");
16
10
 
17
11
  return (
@@ -27,4 +21,4 @@ stories.add("TextArea", () => {
27
21
  }}
28
22
  />
29
23
  );
30
- });
24
+ }
@@ -1,19 +1,13 @@
1
- import { storiesOf } from "@storybook/react";
2
1
  import React, { useRef, useState } from "react";
3
2
  import { TextInput } from ".";
4
3
  import { Button } from "../../action/button";
5
4
  import { StorySection } from "../../storyUtils";
6
- import README from "./README.md";
7
5
 
8
- const stories = storiesOf("Input", module);
6
+ const meta = { title: "Input/TextInput" };
7
+ export default meta;
9
8
 
10
- stories.addParameters({
11
- readme: {
12
- content: README,
13
- },
14
- });
15
9
 
16
- stories.add("TextInput", () => {
10
+ export const TextInputStory = () => {
17
11
  const refEmail = useRef<any>(null);
18
12
  const refPassword = useRef<any>(null);
19
13
  const refNumber = useRef<any>(null);
@@ -228,4 +222,4 @@ stories.add("TextInput", () => {
228
222
  </StorySection>
229
223
  </>
230
224
  );
231
- });
225
+ }
@@ -1,17 +1,10 @@
1
- import { storiesOf } from "@storybook/react";
2
1
  import axios from "axios";
3
2
  import React, { useRef, useState } from "react";
4
3
  import { UploadInput } from ".";
5
4
  import { StorySection } from "../../storyUtils";
6
- import README from "./README.md";
7
5
 
8
- const stories = storiesOf("Input", module);
9
-
10
- stories.addParameters({
11
- readme: {
12
- content: README,
13
- },
14
- });
6
+ const meta = { title: "Input/UploadInput" };
7
+ export default meta;
15
8
 
16
9
  const emptyFiles = { data: [], upload: [], remove: [] };
17
10
 
@@ -32,7 +25,7 @@ const preloadedImages = {
32
25
  remove: [],
33
26
  };
34
27
 
35
- stories.add("UploadInput", () => {
28
+ export const UploadInputStory = () => {
36
29
  const refSingle = useRef<any>(null);
37
30
 
38
31
  const [singleFile, setSingleFile] = useState<any>(undefined);
@@ -40,6 +33,46 @@ stories.add("UploadInput", () => {
40
33
  const [multiImages, setMultiImages] = useState<any>({ ...preloadedImages });
41
34
  const [multiPdfs, setMultiPdfs] = useState<any>({ ...emptyFiles });
42
35
  const [noDupFiles, setNoDupFiles] = useState<any>({ ...emptyFiles });
36
+ const [compactFiles, setCompactFiles] = useState<any>({ ...preloadedImages });
37
+ const [tagFiles, setTagFiles] = useState<any>({
38
+ data: [
39
+ {
40
+ fileName:
41
+ "https://images.pexels.com/photos/2338407/pexels-photo-2338407.jpeg?auto=compress&cs=tinysrgb&w=400",
42
+ token: "TAG-A",
43
+ tags: ["Before"],
44
+ description: "Front entrance before repair",
45
+ },
46
+ {
47
+ fileName:
48
+ "https://images.pexels.com/photos/60616/fried-chicken-chicken-fried-crunchy-60616.jpeg?auto=compress&cs=tinysrgb&w=400",
49
+ token: "TAG-B",
50
+ tags: ["After"],
51
+ },
52
+ ],
53
+ upload: [],
54
+ remove: [],
55
+ });
56
+
57
+ const [tagToggleFiles, setTagToggleFiles] = useState<any>({
58
+ data: [
59
+ {
60
+ fileName:
61
+ "https://images.pexels.com/photos/2338407/pexels-photo-2338407.jpeg?auto=compress&cs=tinysrgb&w=400",
62
+ token: "TOGGLE-A",
63
+ tags: ["Before"],
64
+ description: "Front entrance before repair",
65
+ },
66
+ {
67
+ fileName:
68
+ "https://images.pexels.com/photos/60616/fried-chicken-chicken-fried-crunchy-60616.jpeg?auto=compress&cs=tinysrgb&w=400",
69
+ token: "TOGGLE-B",
70
+ tags: ["After"],
71
+ },
72
+ ],
73
+ upload: [],
74
+ remove: [],
75
+ });
43
76
 
44
77
  const handleMultiChange =
45
78
  (setter: React.Dispatch<React.SetStateAction<any>>) =>
@@ -62,6 +95,9 @@ stories.add("UploadInput", () => {
62
95
  upload: prev.upload.filter((f: any) => f.token !== value.token),
63
96
  };
64
97
  }
98
+ if (action === "tagEdit") {
99
+ return { ...prev, data: value.data, upload: value.upload };
100
+ }
65
101
  return prev;
66
102
  });
67
103
  };
@@ -188,6 +224,94 @@ stories.add("UploadInput", () => {
188
224
  />
189
225
  </div>
190
226
  </StorySection>
227
+
228
+ <StorySection
229
+ title="Per-File Tag & Description Editing (Toggle Mode)"
230
+ description="imageTagToggleMode=true shows an eye/eye-slash icon on each thumbnail. Click to instantly hide or show that image's preview."
231
+ >
232
+ <div className="w-full max-w-sm">
233
+ <UploadInput
234
+ lib={{ axios }}
235
+ label="Tagged Photos (Toggle)"
236
+ files={tagToggleFiles}
237
+ type="multi"
238
+ accept=".png,.jpg,.jpeg,.heic,.heif"
239
+ imageTagToggleMode={true}
240
+ onChange={handleMultiChange(setTagToggleFiles)}
241
+ />
242
+ </div>
243
+ </StorySection>
244
+
245
+ <StorySection
246
+ title="Per-File Tag & Description Editing"
247
+ description="imageTagEdit=true shows a pencil icon on each thumbnail. Click it to open a modal with tag selection and description input. imageTagOptions defines predefined tags, imageTagNewOption=true allows custom tags."
248
+ >
249
+ <div className="w-full max-w-sm">
250
+ <UploadInput
251
+ lib={{ axios }}
252
+ label="Tagged Photos"
253
+ files={tagFiles}
254
+ type="multi"
255
+ accept=".png,.jpg,.jpeg,.heic,.heif"
256
+ imageTagEdit={true}
257
+ imageTagOptions={["Before", "After", "Damage", "Repair", "Invoice"]}
258
+ imageTagNewOption={true}
259
+ onChange={handleMultiChange(setTagFiles)}
260
+ />
261
+ </div>
262
+ </StorySection>
263
+ <StorySection
264
+ title="Compact Mode"
265
+ description="compact=true removes the dashed border box, dropzone overlay, label, and file description. Thumbnails shrink to 56×56px. Designed for tight spaces like FlexTable cells. Supports all the same remove / tag-edit / eye-toggle features as the standard mode."
266
+ >
267
+ <div className="w-72 border border-gray-200 rounded p-3">
268
+ <p className="text-xs text-gray-500 mb-2">
269
+ Inside a table cell (w-72 simulated)
270
+ </p>
271
+ <UploadInput
272
+ lib={{ axios }}
273
+ label=""
274
+ files={compactFiles}
275
+ type="multi"
276
+ accept=".png,.jpg,.jpeg,.heic,.heif"
277
+ compact={true}
278
+ onChange={handleMultiChange(setCompactFiles)}
279
+ />
280
+ </div>
281
+ </StorySection>
282
+
283
+ <StorySection
284
+ title="Compact Mode (Disabled)"
285
+ description="disabled=true in compact mode hides the upload trigger and shows — when empty."
286
+ >
287
+ <div className="w-72 border border-gray-200 rounded p-3">
288
+ <UploadInput
289
+ lib={{ axios }}
290
+ label=""
291
+ files={preloadedImages}
292
+ type="multi"
293
+ compact={true}
294
+ disabled={true}
295
+ onChange={() => {}}
296
+ />
297
+ </div>
298
+ </StorySection>
299
+
300
+ <StorySection
301
+ title="Compact Mode (Empty)"
302
+ description="compact=true with no files shows an Upload link."
303
+ >
304
+ <div className="w-72 border border-gray-200 rounded p-3">
305
+ <UploadInput
306
+ lib={{ axios }}
307
+ label=""
308
+ files={emptyFiles}
309
+ type="multi"
310
+ compact={true}
311
+ onChange={() => {}}
312
+ />
313
+ </div>
314
+ </StorySection>
191
315
  </>
192
316
  );
193
- });
317
+ };
@@ -4,7 +4,7 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Multiple bars selection for navigation
7
+ A flexible navigation bar component that supports vertical and horizontal layouts, grouped collapsible items, drag-to-reorder, custom colors, and dark mode.
8
8
 
9
9
  ##### Import
10
10
 
@@ -14,27 +14,100 @@ import { Bars } from "blixify-ui-web/components/navigation/bars";
14
14
 
15
15
  ##### Usage
16
16
 
17
+ Basic vertical nav:
18
+
19
+ ```jsx
20
+ <Bars
21
+ bars={navigation}
22
+ selectedId="reports"
23
+ primaryColor={true}
24
+ onClick={(id) => setSelectedId(id)}
25
+ />
26
+ ```
27
+
28
+ Horizontal nav bar:
29
+
30
+ ```jsx
31
+ <Bars
32
+ bars={navigation}
33
+ selectedId={selectedId}
34
+ primaryColor={true}
35
+ horizontal={true}
36
+ onClick={(id) => setSelectedId(id)}
37
+ />
38
+ ```
39
+
40
+ Grouped items (collapsible via Disclosure):
41
+
42
+ ```jsx
43
+ const navigation = [
44
+ { id: "dashboard", name: "Dashboard", href: "#", icon: HomeIcon },
45
+ {
46
+ id: "projects",
47
+ name: "Projects",
48
+ href: "#",
49
+ icon: FolderIcon,
50
+ groupId: "Activity",
51
+ },
52
+ {
53
+ id: "calendar",
54
+ name: "Calendar",
55
+ href: "#",
56
+ icon: CalendarIcon,
57
+ groupId: "Activity",
58
+ },
59
+ ];
60
+
61
+ <Bars
62
+ bars={navigation}
63
+ selectedId={selectedId}
64
+ onClick={(id) => setSelectedId(id)}
65
+ />;
66
+ ```
67
+
68
+ Draggable with reorder callbacks:
69
+
17
70
  ```jsx
18
- <Bars bars={navigation} selectedId={"reports"} />
71
+ <Bars
72
+ bars={navigation}
73
+ selectedId={selectedId}
74
+ draggable={true}
75
+ onClick={(id) => setSelectedId(id)}
76
+ handleChangeBars={(value) => setNavigation(value)}
77
+ handleDropEnd={() => {}}
78
+ />
19
79
  ```
20
80
 
21
81
  ##### Required props
22
82
 
23
- | Name | Type | Description |
24
- | ------------ | ------------ | --------------- |
25
- | `bars` | `Bars Class` | Bar Class List |
26
- | `selectedId` | `string` | Selected Tab ID |
83
+ | Name | Type | Description |
84
+ | ------------ | -------- | ------------------------------------------------ |
85
+ | `bars` | `Bar[]` | Ordered list of navigation items — see Bar below |
86
+ | `selectedId` | `string` | The `id` of the currently active item |
27
87
 
28
88
  ##### Optional props
29
89
 
30
- | Name | Type | Default | Description |
31
- | ------------------ | ------------------ | ---------------------------------------------- | -------------------------------------------- |
32
- | `primaryColor` | `boolean` | `false` | |
33
- | `draggable` | `boolean` | `false` | Make component items draggable |
34
- | `collapse` | `boolean` | `false` | Required when leftNav transition is not null |
35
- | `customColor` | `string` | `""` | Rainbow color for bar |
36
- | `linkProps` | `Link Props Class` | Refer to Link Component for more documentation | |
37
- | `onClick` | `function` | `() => {}` | |
38
- | `handleChangeBars` | `function` | `(value) => {setBars(value)}` | Required when draggable is true |
39
- | `handleDropEnd` | `function` | `() => {}` | Required when draggable is true |
40
- | `horizontal` | `boolean` | `false` | When `true`, display horizontal bar |
90
+ | Name | Type | Default | Description |
91
+ | ------------------ | ---------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------- |
92
+ | `onClick` | `(id: string) => void` | — | When provided, items render as clickable divs instead of links. Called with the item's `id`. |
93
+ | `primaryColor` | `boolean` | `false` | Highlights the selected item and hover state with the primary brand color. |
94
+ | `customColor` | `"red" \| "orange" \| "yellow" \| "green" \| "blue" \| "indigo" \| "violet"` | — | Overrides the highlight color for selected and hovered items. Takes precedence over `primaryColor`. |
95
+ | `horizontal` | `boolean` | `false` | Lays items out in a row instead of a column. Useful for top navigation bars. |
96
+ | `darkMode` | `boolean` | `false` | Switches item text to white for use on dark backgrounds. |
97
+ | `draggable` | `boolean` | `false` | Makes items reorderable via drag-and-drop. Requires `handleChangeBars` and `handleDropEnd`. |
98
+ | `handleChangeBars` | `(value: Bar[]) => void` | — | Called with the updated bars array after each drag move. Required when `draggable` is `true`. |
99
+ | `handleDropEnd` | `() => void` | — | Called when a drag interaction ends. Required when `draggable` is `true`. |
100
+ | `collapse` | `boolean` | `false` | Hides item labels and shows only icons. Used when the parent `LeftNav` is in collapsed state. |
101
+ | `linkType` | `"react" \| "gatsby" \| "next" \| "external" \| "default"` | — | Router adapter for link rendering when `onClick` is not provided. |
102
+ | `custom` | `any` | — | The custom link component to use when `linkType` is `"react"`, `"gatsby"`, or `"next"`. |
103
+
104
+ ##### Bar
105
+
106
+ | Name | Type | Description |
107
+ | ---------------- | -------------- | ----------------------------------------------------------------------------------------------------------- |
108
+ | `id` | `string` | Unique identifier for the item |
109
+ | `name` | `string` | Display label |
110
+ | `href` | `string` | URL used when `onClick` is not provided |
111
+ | `icon` | `any` | Heroicon or any SVG component rendered to the left of the label |
112
+ | `groupId` | `string` | Optional — items sharing the same `groupId` are nested under a collapsible Disclosure group with that label |
113
+ | `additionalIcon` | `ReactElement` | Optional — extra icon/element rendered to the right of the item label |
@@ -6,80 +6,148 @@ import {
6
6
  InboxIcon,
7
7
  UsersIcon,
8
8
  } from "@heroicons/react/24/outline";
9
- import { storiesOf } from "@storybook/react";
10
9
  import React, { useState } from "react";
11
10
  import { Bars } from ".";
12
- import README from "./README.md";
11
+ import { StorySection } from "../../storyUtils";
13
12
 
14
- const stories = storiesOf("Navigation", module);
13
+ const meta = { title: "Navigation/Bars" };
14
+ export default meta;
15
15
 
16
- stories.addParameters({
17
- readme: {
18
- content: README,
16
+
17
+ const baseNavigation = [
18
+ { id: "dashboard", name: "Dashboard", href: "#", icon: HomeIcon },
19
+ { id: "team", name: "Team", href: "#", icon: UsersIcon },
20
+ { id: "documents", name: "Documents", href: "#", icon: InboxIcon },
21
+ { id: "reports", name: "Reports", href: "#", icon: ChartBarIcon },
22
+ ];
23
+
24
+ const groupedNavigation = [
25
+ { id: "dashboard", name: "Dashboard", href: "#", icon: HomeIcon },
26
+ { id: "team", name: "Team", href: "#", icon: UsersIcon },
27
+ {
28
+ id: "projects",
29
+ name: "Projects",
30
+ href: "#",
31
+ icon: FolderIcon,
32
+ groupId: "Activity",
33
+ },
34
+ {
35
+ id: "calendar",
36
+ name: "Calendar",
37
+ href: "#",
38
+ icon: CalendarIcon,
39
+ groupId: "Activity",
19
40
  },
20
- });
41
+ { id: "documents", name: "Documents", href: "#", icon: InboxIcon },
42
+ { id: "reports", name: "Reports", href: "#", icon: ChartBarIcon },
43
+ ];
21
44
 
22
- stories.add("Bars", () => {
45
+ export const BarsStory = () => {
23
46
  const [selectedId, setSelectedId] = useState("reports");
24
- const [navigation, setNavigation] = useState([
25
- {
26
- id: "dashboard",
27
- name: "Dashboard",
28
- href: "#",
29
- icon: HomeIcon,
30
- },
31
- { id: "team", name: "Team", href: "#", icon: UsersIcon, current: false },
32
- {
33
- id: "projects",
34
- name: "Projects",
35
- href: "#",
36
- icon: FolderIcon,
37
- groupId: "Activity",
38
- },
39
- {
40
- id: "calendar",
41
- name: "Calendar",
42
- href: "#",
43
- icon: CalendarIcon,
44
- groupId: "Activity",
45
- },
46
- {
47
- id: "documents",
48
- name: "Documents",
49
- href: "#",
50
- icon: InboxIcon,
51
- },
52
- {
53
- id: "reports",
54
- name: "Reports",
55
- href: "#",
56
- icon: ChartBarIcon,
57
- },
58
- ]);
47
+ const [draggableBars, setDraggableBars] = useState(baseNavigation);
59
48
 
60
49
  return (
61
50
  <>
62
- <Bars
63
- bars={navigation}
64
- selectedId={"reports"}
65
- primaryColor={true}
66
- horizontal={false}
67
- />
68
- <div className="bg-gray-900">
51
+ <StorySection
52
+ title="Default (Vertical)"
53
+ description="Basic vertical nav bar. Each item renders as a link using its href. primaryColor highlights the selected item with the primary brand color."
54
+ >
55
+ <div className="w-64">
56
+ <Bars
57
+ bars={baseNavigation}
58
+ selectedId="reports"
59
+ primaryColor={true}
60
+ />
61
+ </div>
62
+ </StorySection>
63
+
64
+ <StorySection
65
+ title="With onClick"
66
+ description="Pass onClick to handle selection programmatically instead of using href links. selectedId controls which item is highlighted."
67
+ >
68
+ <div className="w-64">
69
+ <Bars
70
+ bars={baseNavigation}
71
+ selectedId={selectedId}
72
+ primaryColor={true}
73
+ onClick={(id) => setSelectedId(id)}
74
+ />
75
+ </div>
76
+ </StorySection>
77
+
78
+ <StorySection
79
+ title="Grouped Items"
80
+ description="Items sharing the same groupId are nested under a collapsible Disclosure group labelled with that groupId string."
81
+ >
82
+ <div className="w-64">
83
+ <Bars
84
+ bars={groupedNavigation}
85
+ selectedId={selectedId}
86
+ primaryColor={true}
87
+ onClick={(id) => setSelectedId(id)}
88
+ />
89
+ </div>
90
+ </StorySection>
91
+
92
+ <StorySection
93
+ title="Draggable"
94
+ description="Set draggable=true and provide handleChangeBars to persist the new order. handleDropEnd fires when the drag interaction ends."
95
+ >
96
+ <div className="w-64">
97
+ <Bars
98
+ bars={draggableBars}
99
+ selectedId={selectedId}
100
+ primaryColor={true}
101
+ draggable={true}
102
+ onClick={(id) => setSelectedId(id)}
103
+ handleChangeBars={setDraggableBars}
104
+ handleDropEnd={() => {}}
105
+ />
106
+ </div>
107
+ </StorySection>
108
+
109
+ <StorySection
110
+ title="Horizontal"
111
+ description="horizontal=true lays items out in a row. Useful for top navigation bars."
112
+ >
69
113
  <Bars
70
- draggable={true}
71
- bars={navigation}
114
+ bars={baseNavigation}
72
115
  selectedId={selectedId}
73
116
  primaryColor={true}
74
- darkMode={true}
75
- onClick={(id) => {
76
- setSelectedId(id);
77
- }}
78
- handleChangeBars={setNavigation}
79
- handleDropEnd={() => {}}
80
117
  horizontal={true}
118
+ onClick={(id) => setSelectedId(id)}
81
119
  />
82
- </div>
120
+ </StorySection>
121
+
122
+ <StorySection
123
+ title="Custom Color"
124
+ description="customColor overrides the selected/hover highlight with a named color: red, orange, yellow, green, blue, indigo, or violet."
125
+ >
126
+ <div className="w-64">
127
+ <Bars
128
+ bars={baseNavigation}
129
+ selectedId={selectedId}
130
+ customColor="indigo"
131
+ onClick={(id) => setSelectedId(id)}
132
+ />
133
+ </div>
134
+ </StorySection>
135
+
136
+ <StorySection
137
+ title="Dark Mode"
138
+ description="Pass darkMode=true for use on dark backgrounds."
139
+ dark
140
+ >
141
+ <div className="w-64">
142
+ <Bars
143
+ bars={baseNavigation}
144
+ selectedId={selectedId}
145
+ primaryColor={true}
146
+ darkMode={true}
147
+ onClick={(id) => setSelectedId(id)}
148
+ />
149
+ </div>
150
+ </StorySection>
83
151
  </>
84
152
  );
85
- });
153
+ }
@@ -4,17 +4,12 @@ import {
4
4
  SunIcon,
5
5
  UserGroupIcon,
6
6
  } from "@heroicons/react/24/solid";
7
- import { storiesOf } from "@storybook/react";
8
7
  import React from "react";
9
8
  import { BottomTab } from ".";
10
- import README from "./README.md";
11
- const stories = storiesOf("Navigation", module);
12
9
 
13
- stories.addParameters({
14
- readme: {
15
- content: README,
16
- },
17
- });
10
+ const meta = { title: "Navigation/BottomTab" };
11
+ export default meta;
12
+
18
13
 
19
14
  const tabs = [
20
15
  { icon: HomeIcon, title: "Home", href: "/home" },
@@ -27,6 +22,6 @@ const tabs = [
27
22
  { icon: UserGroupIcon, title: "Referral", href: "/referral" },
28
23
  ];
29
24
 
30
- stories.add("BottomTab", () => {
25
+ export const BottomTabStory = () => {
31
26
  return <BottomTab tabData={tabs} selectedTab="Home" />;
32
- });
27
+ }