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,7 +4,7 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Breadcrumb for selected item navigation
7
+ A breadcrumb trail for hierarchical navigation. Renders a home icon followed by a chevron-separated list of pages. Non-current pages are links; the current page is plain text.
8
8
 
9
9
  ##### Import
10
10
 
@@ -14,35 +14,55 @@ import { Breadcrumb } from "blixify-ui-web/components/navigation/breadcrumb";
14
14
 
15
15
  ##### Usage
16
16
 
17
+ Link-based navigation:
18
+
17
19
  ```jsx
18
20
  const pages = [
19
- { name: "Projects", href: "#", current: false },
20
- { name: "Project Nero", href: "#", current: true },
21
+ { name: "Projects", href: "/projects", current: false },
22
+ { name: "Project Nero", href: "/projects/nero", current: true },
21
23
  ];
22
24
 
23
- stories.add("Breadcrumb", () => {
24
- return <Breadcrumb pages={pages} />;
25
- });
25
+ <Breadcrumb pages={pages} />;
26
+ ```
27
+
28
+ Programmatic navigation with onClick:
29
+
30
+ ```jsx
31
+ <Breadcrumb
32
+ pages={pages}
33
+ onClick={(name) => {
34
+ // name is the page.name of the clicked item
35
+ router.push(name);
36
+ }}
37
+ />
38
+ ```
39
+
40
+ Dark mode:
41
+
42
+ ```jsx
43
+ <Breadcrumb pages={pages} darkMode={true} />
26
44
  ```
27
45
 
28
46
  ##### Required props
29
47
 
30
- | Name | Type | Description |
31
- | ------- | ----------------- | --------------- |
32
- | `pages` | `Page Class List` | Page Class List |
48
+ | Name | Type | Description |
49
+ | ------- | -------- | ---------------------------------- |
50
+ | `pages` | `Page[]` | Ordered list of pages in the trail |
33
51
 
34
52
  ##### Optional props
35
53
 
36
- | Name | Type | Default | Description |
37
- | ----------- | ---------------- | ---------- | ----------- |
38
- | `className` | `tailwind class` | "" | |
39
- | `onClick` | `function` | `() => {}` | |
54
+ | Name | Type | Default | Description |
55
+ | ----------- | ---------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------- |
56
+ | `onClick` | `(name: string) => void` | — | When provided, non-current pages render as clickable divs instead of links. Called with the page's `name`. |
57
+ | `darkMode` | `boolean` | `false` | Switches the home icon and current-page text to white for use on dark backgrounds. |
58
+ | `className` | `string` | — | Tailwind classes applied to the outer `<nav>` element. |
59
+ | `linkType` | `"react" \| "gatsby" \| "next" \| "external" \| "default"` | — | Router adapter for link rendering. Pass alongside `custom` when using React Router, Gatsby, or Next.js. |
60
+ | `custom` | `any` | — | The custom link component to use when `linkType` is `"react"`, `"gatsby"`, or `"next"`. |
40
61
 
41
- ##### Page Class props
62
+ ##### Page
42
63
 
43
- | Name | Type | Default | Description |
44
- | ----------- | ------------------ | ---------------------------------------------- | ----------------------- |
45
- | `name` | `string` | "" | |
46
- | `href` | `string` | "" | |
47
- | `current` | `boolean` | false | Whether page is current |
48
- | `linkProps` | `Link Props Class` | Refer to Link Component for more documentation | |
64
+ | Name | Type | Description |
65
+ | --------- | --------- | ------------------------------------------------------------------------- |
66
+ | `name` | `string` | Display label for the breadcrumb item |
67
+ | `href` | `string` | URL for the link. Used when `onClick` is not provided. |
68
+ | `current` | `boolean` | Marks this item as the current page — rendered as plain text, not a link. |
@@ -1,27 +1,47 @@
1
- import { storiesOf } from "@storybook/react";
2
- import React from "react";
1
+ import React, { useState } from "react";
3
2
  import { Breadcrumb } from ".";
4
- import README from "./README.md";
5
- const stories = storiesOf("Navigation", module);
3
+ import { StorySection } from "../../storyUtils";
4
+
5
+ const meta = { title: "Navigation/Breadcrumb" };
6
+ export default meta;
6
7
 
7
- stories.addParameters({
8
- readme: {
9
- content: README,
10
- },
11
- });
12
8
 
13
9
  const pages = [
14
10
  { name: "Projects", href: "#", current: false },
15
11
  { name: "Project Nero", href: "#", current: true },
16
12
  ];
17
13
 
18
- stories.add("Breadcrumb", () => {
14
+ export const BreadcrumbStory = () => {
15
+ const [selected, setSelected] = useState("");
16
+
19
17
  return (
20
18
  <>
21
- <Breadcrumb pages={pages} />
22
- <div className="bg-gray-900 py-2">
19
+ <StorySection
20
+ title="Default"
21
+ description="Each non-current page renders as a link using its href. The current page is rendered as plain text."
22
+ >
23
+ <Breadcrumb pages={pages} />
24
+ </StorySection>
25
+
26
+ <StorySection
27
+ title="With onClick"
28
+ description="Pass onClick to handle navigation programmatically. The page name is passed as the argument. Useful for SPAs where you manage routing yourself."
29
+ >
30
+ <div className="flex flex-col items-center gap-2">
31
+ <Breadcrumb pages={pages} onClick={(name) => setSelected(name)} />
32
+ {selected && (
33
+ <p className="text-sm text-gray-500">Clicked: {selected}</p>
34
+ )}
35
+ </div>
36
+ </StorySection>
37
+
38
+ <StorySection
39
+ title="Dark Mode"
40
+ description="Pass darkMode=true for use on dark backgrounds."
41
+ dark
42
+ >
23
43
  <Breadcrumb pages={pages} darkMode={true} />
24
- </div>
44
+ </StorySection>
25
45
  </>
26
46
  );
27
- });
47
+ }
@@ -4,7 +4,7 @@
4
4
 
5
5
  <hr>
6
6
 
7
- Header for Application UI for Normal User
7
+ A responsive application header with a logo, navigation links, an optional user avatar dropdown, and mobile hamburger menu. Navigation items can have a Popover dropdown (`multiNav`) for grouped sub-links. Supports dark mode, transparent background, and an extra slot for custom elements.
8
8
 
9
9
  ##### Import
10
10
 
@@ -15,135 +15,94 @@ import { Header } from "blixify-ui-web/components/navigation/header";
15
15
  ##### Usage
16
16
 
17
17
  ```jsx
18
- const multiNavigation = [
19
- {
20
- name: "Section 1",
21
- href: "/dashboard/section1",
22
- description:
23
- "This is a dropdown section that allows you navigate to section 1",
24
- icon: PhoneIcon,
25
- },
26
- {
27
- name: "Section 2",
28
- href: "/dashboard/section2",
29
- description:
30
- "This is a dropdown section that allows you navigate to section 2",
31
- icon: ComputerDesktopIcon,
32
- },
33
- {
34
- name: "Section 3",
35
- href: "/dashboard/section3",
36
- description:
37
- "This is a dropdown section that allows you navigate to section 3",
38
- icon: BookOpenIcon,
39
- },
40
- {
41
- name: "Section 4",
42
- href: "/dashboard/section4",
43
- description:
44
- "This is a dropdown section that allows you navigate to section 4",
45
- icon: MapIcon,
46
- },
47
- ];
18
+ import { Disclosure, Menu, Popover, Transition } from "@headlessui/react";
19
+ import { PhoneIcon } from "@heroicons/react/20/solid";
48
20
 
49
21
  const navigation = [
50
22
  { name: "Dashboard", href: "/dashboard" },
51
23
  {
52
24
  name: "Activities",
53
- href: "/dashboard/logistic",
54
- multiNav: multiNavigation,
25
+ href: "/dashboard/activities",
26
+ multiNav: [
27
+ {
28
+ name: "Section 1",
29
+ href: "/dashboard/section1",
30
+ description: "Go to section 1",
31
+ icon: PhoneIcon,
32
+ },
33
+ ],
55
34
  },
56
- { name: "Records", href: "/dashboard/transaction" },
57
- { name: "Donees", href: "/dashboard/orgs" },
58
35
  { name: "FAQ", href: "https://google.com", openInNewTab: true },
59
36
  ];
60
37
 
61
- const [modal, setModal] = useState(false);
62
-
63
- const handleSwapAccount = () => {
64
- setModal(!modal);
65
- window.alert("Swap account clicked");
66
- };
67
-
68
38
  const userNavigation = [
69
39
  { name: "My Profile", href: "/dashboard/profile" },
70
40
  {
71
41
  name: "Swap Account",
72
- customAction: handleSwapAccount,
42
+ customAction: () => alert("swap"),
73
43
  notification: true,
74
44
  },
75
45
  { name: "Sign out", action: "logout", href: "#" },
76
46
  ];
77
47
 
78
- return (
79
- <div className="bg-gray-100">
80
- <Header
81
- defaultNav="/"
82
- page="Activities"
83
- transparent={true}
84
- logo={Logo}
85
- navigation={navigation}
86
- userNavigation={userNavigation}
87
- user={{
88
- name: "Louis Ong",
89
- email: "louis@blixify.co",
90
- image: Favicon,
91
- }}
92
- lib={{
93
- Disclosure,
94
- Menu,
95
- Transition,
96
- Popover,
97
- }}
98
- />
99
- </div>
100
- );
48
+ <Header
49
+ defaultNav="/"
50
+ page="Dashboard"
51
+ logo={Logo}
52
+ navigation={navigation}
53
+ userNavigation={userNavigation}
54
+ user={{ name: "Jane Doe", email: "jane@example.com", image: Avatar }}
55
+ lib={{ Disclosure, Menu, Transition, Popover }}
56
+ />;
101
57
  ```
102
58
 
103
59
  ##### Required props
104
60
 
105
- | Name | Type | Description |
106
- | ---------------- | ---------------- | --------------------------------------------- |
107
- | `defaultNav` | `string` | Default path once logo is selected |
108
- | `page` | `string` | Current selected path according to navigation |
109
- | `logo` | `string` | Logo |
110
- | `navigation` | `Navigation` | Class |
111
- | `userNavigation` | `UserNavigation` | Class |
112
- | `lib` | `class` | Class |
61
+ | Name | Type | Description |
62
+ | ------------ | ------------------------------------------- | ------------------------------------------------------------------------- |
63
+ | `defaultNav` | `string` | URL the logo links to |
64
+ | `page` | `string` | Name of the currently active navigation item — used to highlight the link |
65
+ | `logo` | `string` | Image src for the logo |
66
+ | `navigation` | `Navigation[]` | Ordered list of nav links — see Navigation below |
67
+ | `lib` | `{ Disclosure, Menu, Transition, Popover }` | Headless UI components passed in to avoid bundling conflicts |
113
68
 
114
69
  ##### Optional props
115
70
 
116
- | Name | Type | Default | Description |
117
- | ------------- | ------------------ | ---------------------------------------------- | ------------------------------------------------------- |
118
- | `user` | `class` | `null ` | |
119
- | `transparent` | `boolean` | `false` | Make background transparent |
120
- | `linkProps` | `Link Props Class` | Refer to Link Component for more documentation | |
121
- | `extra` | `React Element` | `null` | React Element placed on the left of userNavigation menu |
122
-
123
- ##### Navigation props
124
-
125
- | Name | Type | Description |
126
- | -------------- | ---------------------- | ---------------------------------------- |
127
- | `name` | `string` | Name of path |
128
- | `href` | `string` | Url |
129
- | `multiNav` | `Multi Nav List Class` | Optional for multiple navigation list |
130
- | `openInNewTab` | `boolean` | Optional. If true, opens link in new tab |
131
-
132
- ##### UserNavigation props
133
-
134
- | Name | Type | Description |
135
- | -------------- | ---------- | -------------- |
136
- | `name` | `string` | Name of path |
137
- | `href` | `string` | Url |
138
- | `notification` | `boolean` | True or false |
139
- | `action` | `function` | Trigger logout |
140
- | `customAction` | `function` | Optional |
141
-
142
- ##### Multi Navigation props
143
-
144
- | Name | Type | Description |
145
- | ------------- | --------------- | ------------ |
146
- | `name` | `string` | Name of path |
147
- | `href` | `string` | Url |
148
- | `icon` | `React Element` | |
149
- | `description` | `string` | |
71
+ | Name | Type | Default | Description |
72
+ | ---------------- | ---------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ |
73
+ | `userNavigation` | `UserNavigation[]` | — | Items shown in the user avatar dropdown — see UserNavigation below |
74
+ | `user` | `{ name: string; email: string; image: string }` | — | When provided, renders an avatar button that opens the user dropdown |
75
+ | `transparent` | `boolean` | `false` | Removes the background colour and shadow. Useful over hero images or coloured banners. |
76
+ | `darkMode` | `boolean` | `false` | Switches text and backgrounds to a dark theme |
77
+ | `extra` | `ReactElement` | — | Element rendered to the left of the user avatar. Use for search inputs, notification bells, etc. |
78
+ | `signOut` | `() => void` | — | Custom sign-out handler. Called when a `UserNavigation` item with `action: "logout"` is clicked. |
79
+ | `linkType` | `"react" \| "gatsby" \| "next" \| "external" \| "default"` | — | Router adapter for all link rendering |
80
+ | `custom` | `any` | — | Custom link component used when `linkType` is `"react"`, `"gatsby"`, or `"next"` |
81
+
82
+ ##### Navigation
83
+
84
+ | Name | Type | Description |
85
+ | -------------- | ------------------- | ------------------------------------------------------------------------------- |
86
+ | `name` | `string` | Display label and the value matched against `page` to highlight the active item |
87
+ | `href` | `string` | URL for the link |
88
+ | `multiNav` | `MultiNavigation[]` | Optional — when provided, renders a Popover dropdown instead of a direct link |
89
+ | `openInNewTab` | `boolean` | When `true`, opens the link in a new tab |
90
+
91
+ ##### MultiNavigation
92
+
93
+ | Name | Type | Description |
94
+ | ------------- | -------- | --------------------------------------------------- |
95
+ | `name` | `string` | Sub-item display label |
96
+ | `href` | `string` | URL for the sub-item link |
97
+ | `icon` | `any` | Heroicon or SVG component shown beside the sub-item |
98
+ | `description` | `string` | Short description shown below the sub-item name |
99
+
100
+ ##### UserNavigation
101
+
102
+ | Name | Type | Description |
103
+ | -------------- | ------------------ | ------------------------------------------------------------------------------------------- |
104
+ | `name` | `string` | Display label |
105
+ | `href` | `string` | URL — used when neither `action` nor `customAction` is set |
106
+ | `action` | `string` | Set to `"logout"` to trigger the `signOut` handler instead of navigating |
107
+ | `customAction` | `(e: any) => void` | Custom click handler. When set, renders the item as a `<span>` instead of a link. |
108
+ | `notification` | `boolean` | When `true`, shows an animated ping badge on the avatar button to indicate a pending action |
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { Disclosure, Menu, Popover, Transition } from "@headlessui/react";
2
3
  import {
3
4
  BookOpenIcon,
@@ -5,48 +6,41 @@ import {
5
6
  MapIcon,
6
7
  PhoneIcon,
7
8
  } from "@heroicons/react/20/solid";
8
- import { storiesOf } from "@storybook/react";
9
- import React, { useState } from "react";
9
+ import { useState } from "react";
10
10
  import { Header } from ".";
11
11
  import Favicon from "../../../assets/favicon.png";
12
12
  import Logo from "../../../assets/logo.png";
13
- import README from "./README.md";
13
+ import { StorySection } from "../../storyUtils";
14
14
 
15
- const stories = storiesOf("Navigation", module);
15
+ const meta = { title: "Navigation/Header" };
16
+ export default meta;
16
17
 
17
- stories.addParameters({
18
- readme: {
19
- content: README,
20
- },
21
- });
18
+
19
+ const lib = { Disclosure, Menu, Transition, Popover };
22
20
 
23
21
  const multiNavigation = [
24
22
  {
25
23
  name: "Section 1",
26
24
  href: "/dashboard/section1",
27
- description:
28
- "This is a dropdown section that allows you navigate to section 1",
25
+ description: "Navigate to section 1",
29
26
  icon: PhoneIcon,
30
27
  },
31
28
  {
32
29
  name: "Section 2",
33
30
  href: "/dashboard/section2",
34
- description:
35
- "This is a dropdown section that allows you navigate to section 2",
31
+ description: "Navigate to section 2",
36
32
  icon: ComputerDesktopIcon,
37
33
  },
38
34
  {
39
35
  name: "Section 3",
40
36
  href: "/dashboard/section3",
41
- description:
42
- "This is a dropdown section that allows you navigate to section 3",
37
+ description: "Navigate to section 3",
43
38
  icon: BookOpenIcon,
44
39
  },
45
40
  {
46
41
  name: "Section 4",
47
42
  href: "/dashboard/section4",
48
- description:
49
- "This is a dropdown section that allows you navigate to section 4",
43
+ description: "Navigate to section 4",
50
44
  icon: MapIcon,
51
45
  },
52
46
  ];
@@ -55,53 +49,175 @@ const navigation = [
55
49
  { name: "Dashboard", href: "/dashboard" },
56
50
  {
57
51
  name: "Activities",
58
- href: "/dashboard/logistic",
52
+ href: "/dashboard/activities",
59
53
  multiNav: multiNavigation,
60
54
  },
61
- { name: "Records", href: "/dashboard/transaction" },
62
- { name: "Donees", href: "/dashboard/orgs" },
55
+ { name: "Records", href: "/dashboard/records" },
63
56
  { name: "FAQ", href: "https://google.com", openInNewTab: true },
64
57
  ];
65
58
 
66
- stories.add("Header", () => {
67
- const [modal, setModal] = useState(false);
59
+ const user = {
60
+ name: "Louis Ong",
61
+ email: "louis@blixify.co",
62
+ image: Favicon,
63
+ };
68
64
 
69
- const handleSwapAccount = () => {
70
- setModal(!modal);
71
- window.alert("Swap account clicked");
72
- };
65
+ export const HeaderStory = () => {
66
+ const [page] = useState("Dashboard");
73
67
 
74
68
  const userNavigation = [
75
69
  { name: "My Profile", href: "/dashboard/profile" },
76
70
  {
77
71
  name: "Swap Account",
78
- customAction: handleSwapAccount,
72
+ customAction: () => window.alert("Swap account clicked"),
79
73
  notification: true,
80
74
  },
81
75
  { name: "Sign out", action: "logout", href: "#" },
82
76
  ];
83
77
 
84
78
  return (
85
- <div className="bg-gray-100">
86
- <Header
87
- defaultNav="/"
88
- page="Activities"
89
- transparent={true}
90
- logo={Logo}
91
- navigation={navigation}
92
- userNavigation={userNavigation}
93
- user={{
94
- name: "Louis Ong",
95
- email: "louis@blixify.co",
96
- image: Favicon,
97
- }}
98
- lib={{
99
- Disclosure,
100
- Menu,
101
- Transition,
102
- Popover,
103
- }}
104
- />
105
- </div>
79
+ <>
80
+ <StorySection
81
+ title="Default"
82
+ description="Standard header with logo, nav links, and a user avatar dropdown. page highlights the active nav item. Resize the window to see the mobile hamburger menu."
83
+ >
84
+ <div className="w-full bg-gray-100">
85
+ <Header
86
+ defaultNav="/"
87
+ page={page}
88
+ logo={Logo}
89
+ navigation={navigation}
90
+ userNavigation={userNavigation}
91
+ user={user}
92
+ lib={lib}
93
+ />
94
+ </div>
95
+ </StorySection>
96
+
97
+ <StorySection
98
+ title="Transparent Background"
99
+ description="transparent=true removes the background and shadow. Useful when the header sits over a hero image or coloured banner."
100
+ >
101
+ <div className="w-full bg-primary-50 rounded-lg">
102
+ <Header
103
+ defaultNav="/"
104
+ page={page}
105
+ logo={Logo}
106
+ navigation={navigation}
107
+ userNavigation={userNavigation}
108
+ user={user}
109
+ transparent={true}
110
+ lib={lib}
111
+ />
112
+ </div>
113
+ </StorySection>
114
+
115
+ <StorySection
116
+ title="Dropdown Navigation (multiNav)"
117
+ description="Add multiNav to a Navigation item to render a Popover dropdown with icon, name, and description for each sub-item. Click 'Activities' to see it."
118
+ >
119
+ <div className="w-full bg-gray-100">
120
+ <Header
121
+ defaultNav="/"
122
+ page="Activities"
123
+ logo={Logo}
124
+ navigation={navigation}
125
+ userNavigation={userNavigation}
126
+ user={user}
127
+ lib={lib}
128
+ />
129
+ </div>
130
+ </StorySection>
131
+
132
+ <StorySection
133
+ title="Notification Badge"
134
+ description="Set notification=true on a UserNavigation item to show an animated ping badge on the avatar button, indicating a pending action."
135
+ >
136
+ <div className="w-full bg-gray-100">
137
+ <Header
138
+ defaultNav="/"
139
+ page={page}
140
+ logo={Logo}
141
+ navigation={navigation}
142
+ userNavigation={userNavigation}
143
+ user={user}
144
+ lib={lib}
145
+ />
146
+ </div>
147
+ </StorySection>
148
+
149
+ <StorySection
150
+ title="Extra Element"
151
+ description="extra renders a ReactElement to the left of the user avatar. Useful for search inputs, notification bells, or action buttons."
152
+ >
153
+ <div className="w-full bg-gray-100">
154
+ <Header
155
+ defaultNav="/"
156
+ page={page}
157
+ logo={Logo}
158
+ navigation={navigation}
159
+ userNavigation={userNavigation}
160
+ user={user}
161
+ extra={
162
+ <button className="mr-3 text-sm text-primary-600 font-medium border border-primary-300 rounded-md px-3 py-1">
163
+ Upgrade
164
+ </button>
165
+ }
166
+ lib={lib}
167
+ />
168
+ </div>
169
+ </StorySection>
170
+
171
+ <StorySection
172
+ title="No User (Public Header)"
173
+ description="Omit user and userNavigation to render a header without the avatar dropdown. Suitable for public-facing pages."
174
+ >
175
+ <div className="w-full bg-gray-100">
176
+ <Header
177
+ defaultNav="/"
178
+ page={page}
179
+ logo={Logo}
180
+ navigation={navigation}
181
+ lib={lib}
182
+ />
183
+ </div>
184
+ </StorySection>
185
+
186
+ <StorySection
187
+ title="Dark Mode"
188
+ description="darkMode=true switches text and backgrounds to a dark theme."
189
+ dark
190
+ >
191
+ <div className="w-full bg-gray-900 rounded-lg">
192
+ <Header
193
+ defaultNav="/"
194
+ page={page}
195
+ logo={Logo}
196
+ navigation={navigation}
197
+ userNavigation={userNavigation}
198
+ user={user}
199
+ darkMode={true}
200
+ lib={lib}
201
+ />
202
+ </div>
203
+ </StorySection>
204
+
205
+ <StorySection
206
+ title="Empty Navigation (no hamburger, no divider)"
207
+ description="When navigation=[] the hamburger is hidden on mobile. The user avatar and dropdown show directly on all screen sizes, same as the desktop web view."
208
+ >
209
+ <div className="w-full bg-gray-100">
210
+ <Header
211
+ defaultNav="/"
212
+ page={page}
213
+ logo={Logo}
214
+ navigation={[]}
215
+ userNavigation={userNavigation}
216
+ user={user}
217
+ lib={lib}
218
+ />
219
+ </div>
220
+ </StorySection>
221
+ </>
106
222
  );
107
- });
223
+ }