blixify-ui-web-mcp 0.1.1

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 (245) hide show
  1. package/README.md +5 -0
  2. package/lib/components/action/button/README.md +75 -0
  3. package/lib/components/action/button/button.stories.tsx +138 -0
  4. package/lib/components/action/buttonGroup/README.md +79 -0
  5. package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +104 -0
  6. package/lib/components/action/iconButton/README.md +39 -0
  7. package/lib/components/action/iconButton/iconButton.stories.tsx +22 -0
  8. package/lib/components/action/radioList/README.md +98 -0
  9. package/lib/components/action/radioList/radioList.stories.tsx +181 -0
  10. package/lib/components/action/slider/README.md +86 -0
  11. package/lib/components/action/slider/slider.stories.tsx +133 -0
  12. package/lib/components/action/textButton/README.md +34 -0
  13. package/lib/components/action/textButton/textButton.stories.tsx +16 -0
  14. package/lib/components/action/toggle/README.md +39 -0
  15. package/lib/components/action/toggle/toggle.stories.tsx +23 -0
  16. package/lib/components/advanced/collapse/README.md +106 -0
  17. package/lib/components/advanced/collapse/collapse.stories.tsx +165 -0
  18. package/lib/components/advanced/infoWindow/README.md +69 -0
  19. package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +112 -0
  20. package/lib/components/advanced/popUp/README.md +95 -0
  21. package/lib/components/advanced/popUp/popUp.stories.tsx +189 -0
  22. package/lib/components/auth/bareSignIn/README.md +78 -0
  23. package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +141 -0
  24. package/lib/components/auth/bareSignUp/README.md +130 -0
  25. package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +159 -0
  26. package/lib/components/auth/signIn/README.md +53 -0
  27. package/lib/components/auth/signIn/signIn.stories.tsx +120 -0
  28. package/lib/components/auth/signUp/README.md +136 -0
  29. package/lib/components/auth/signUp/signUp.stories.tsx +193 -0
  30. package/lib/components/chart/README.md +13 -0
  31. package/lib/components/chart/areaChart/README.md +133 -0
  32. package/lib/components/chart/areaChart/areaChart.stories.tsx +199 -0
  33. package/lib/components/chart/barChart/README.md +193 -0
  34. package/lib/components/chart/barChart/barChart.stories.tsx +318 -0
  35. package/lib/components/chart/boxPlotChart/README.md +124 -0
  36. package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +104 -0
  37. package/lib/components/chart/bubbleChart/README.md +166 -0
  38. package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +144 -0
  39. package/lib/components/chart/card/README.md +107 -0
  40. package/lib/components/chart/card/card.stories.tsx +89 -0
  41. package/lib/components/chart/ganttChart/README.md +142 -0
  42. package/lib/components/chart/ganttChart/ganttChart.stories.tsx +138 -0
  43. package/lib/components/chart/heatmapChart/README.md +125 -0
  44. package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +106 -0
  45. package/lib/components/chart/lineChart/README.md +140 -0
  46. package/lib/components/chart/lineChart/lineChart.stories.tsx +152 -0
  47. package/lib/components/chart/pieChart/README.md +117 -0
  48. package/lib/components/chart/pieChart/pieChart.stories.tsx +180 -0
  49. package/lib/components/chart/polarAreaChart/README.md +126 -0
  50. package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +106 -0
  51. package/lib/components/chart/radarChart/README.md +57 -0
  52. package/lib/components/chart/radarChart/radarChart.stories.tsx +36 -0
  53. package/lib/components/chart/radialBar/README.md +152 -0
  54. package/lib/components/chart/radialBar/radialChart.stories.tsx +136 -0
  55. package/lib/components/chart/rangeBarChart/README.md +323 -0
  56. package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +208 -0
  57. package/lib/components/chart/statsCard/README.md +97 -0
  58. package/lib/components/chart/statsCard/statsCard.stories.tsx +183 -0
  59. package/lib/components/chart/treemapChart/README.md +142 -0
  60. package/lib/components/chart/treemapChart/treemapChart.stories.tsx +122 -0
  61. package/lib/components/chat/chatAnchor/README.md +113 -0
  62. package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +156 -0
  63. package/lib/components/chat/chatBase/README.md +223 -0
  64. package/lib/components/chat/chatBase/chatBase.stories.tsx +306 -0
  65. package/lib/components/chat/chatDashboard/README.md +161 -0
  66. package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +154 -0
  67. package/lib/components/data/dataGraph/README.md +13 -0
  68. package/lib/components/data/dataGraph/dataGraph.stories.tsx +84 -0
  69. package/lib/components/data/dataReference/README.md +62 -0
  70. package/lib/components/data/dataReference/dataReference.stories.tsx +53 -0
  71. package/lib/components/data/dataTemplate/README.md +903 -0
  72. package/lib/components/data/dataTemplate/dataModule.stories.tsx +196 -0
  73. package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +337 -0
  74. package/lib/components/data/dataWrapper/README.md +1077 -0
  75. package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +831 -0
  76. package/lib/components/data/queryForm/README.md +56 -0
  77. package/lib/components/data/queryForm/queryForm.stories.tsx +85 -0
  78. package/lib/components/data/readQuery/README.md +282 -0
  79. package/lib/components/data/readQuery/readQuery.stories.tsx +256 -0
  80. package/lib/components/data/readQueryHoc/README.md +89 -0
  81. package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +33 -0
  82. package/lib/components/data/writeQuery/README.md +178 -0
  83. package/lib/components/data/writeQuery/writeQuery.stories.tsx +209 -0
  84. package/lib/components/design/actionSection/README.md +47 -0
  85. package/lib/components/design/actionSection/actionSection.stories.tsx +74 -0
  86. package/lib/components/design/banner/README.md +43 -0
  87. package/lib/components/design/banner/banner.stories.tsx +34 -0
  88. package/lib/components/design/bannerAction/README.md +44 -0
  89. package/lib/components/design/bannerAction/bannerAction.stories.tsx +25 -0
  90. package/lib/components/design/blogSection/README.md +111 -0
  91. package/lib/components/design/blogSection/blogSection.stories.tsx +72 -0
  92. package/lib/components/design/carouselSection/README.md +82 -0
  93. package/lib/components/design/carouselSection/carouselSection.stories.tsx +52 -0
  94. package/lib/components/design/designList/README.md +60 -0
  95. package/lib/components/design/designList/designList.stories.tsx +44 -0
  96. package/lib/components/design/faq/README.md +121 -0
  97. package/lib/components/design/faq/faq.stories.tsx +103 -0
  98. package/lib/components/design/fileGrid/README.md +87 -0
  99. package/lib/components/design/fileGrid/fileGrid.stories.tsx +110 -0
  100. package/lib/components/design/fileViewer/README.md +40 -0
  101. package/lib/components/design/fileViewer/fileViewer.stories.tsx +28 -0
  102. package/lib/components/design/footerSection/README.md +62 -0
  103. package/lib/components/design/footerSection/footerSection.stories.tsx +84 -0
  104. package/lib/components/design/googleReview/README.md +45 -0
  105. package/lib/components/design/googleReview/googleReview.stories.tsx +33 -0
  106. package/lib/components/design/heroSection/README.md +48 -0
  107. package/lib/components/design/heroSection/heroSection.stories.tsx +85 -0
  108. package/lib/components/design/iconList/README.md +60 -0
  109. package/lib/components/design/iconList/iconList.stories.tsx +41 -0
  110. package/lib/components/design/imageGallery/README.md +56 -0
  111. package/lib/components/design/imageGallery/imageGallery.stories.tsx +45 -0
  112. package/lib/components/design/imageZoom/README.md +47 -0
  113. package/lib/components/design/imageZoom/imageZoom.stories.tsx +30 -0
  114. package/lib/components/design/leftContent/README.md +47 -0
  115. package/lib/components/design/leftContent/leftContent.stories.tsx +32 -0
  116. package/lib/components/design/logoCloud/README.md +42 -0
  117. package/lib/components/design/logoCloud/logoCloud.stories.tsx +44 -0
  118. package/lib/components/design/onboarding/README.md +100 -0
  119. package/lib/components/design/onboarding/onboarding.stories.tsx +113 -0
  120. package/lib/components/design/pricing/README.md +112 -0
  121. package/lib/components/design/pricing/pricing.stories.tsx +86 -0
  122. package/lib/components/design/rightContent/README.md +47 -0
  123. package/lib/components/design/rightContent/rightContent.stories.tsx +32 -0
  124. package/lib/components/design/sectionList/README.md +51 -0
  125. package/lib/components/design/sectionList/sectionList.stories.tsx +35 -0
  126. package/lib/components/design/teams/README.md +62 -0
  127. package/lib/components/design/teams/teams.stories.tsx +61 -0
  128. package/lib/components/display/alert/README.md +82 -0
  129. package/lib/components/display/alert/alert.stories.tsx +71 -0
  130. package/lib/components/display/calendar/README.md +113 -0
  131. package/lib/components/display/calendar/calendar.stories.tsx +159 -0
  132. package/lib/components/display/clipboard/README.md +36 -0
  133. package/lib/components/display/clipboard/clipboard.stories.tsx +32 -0
  134. package/lib/components/display/detailList/README.md +61 -0
  135. package/lib/components/display/detailList/detailList.stories.tsx +131 -0
  136. package/lib/components/display/drawer/README.md +74 -0
  137. package/lib/components/display/drawer/drawer.stories.tsx +66 -0
  138. package/lib/components/display/emptyState/README.md +38 -0
  139. package/lib/components/display/emptyState/emptyState.stories.tsx +22 -0
  140. package/lib/components/display/feeds/README.md +80 -0
  141. package/lib/components/display/feeds/feeds.stories.tsx +75 -0
  142. package/lib/components/display/flexTable/README.md +160 -0
  143. package/lib/components/display/flexTable/flexTable.stories.tsx +313 -0
  144. package/lib/components/display/grid/README.md +121 -0
  145. package/lib/components/display/grid/grid.stories.tsx +234 -0
  146. package/lib/components/display/kanban/README.md +78 -0
  147. package/lib/components/display/kanban/kanban.stories.tsx +133 -0
  148. package/lib/components/display/list/README.md +109 -0
  149. package/lib/components/display/list/list.stories.tsx +188 -0
  150. package/lib/components/display/loading/README.md +25 -0
  151. package/lib/components/display/loading/loading.stories.tsx +15 -0
  152. package/lib/components/display/mapView/README.md +99 -0
  153. package/lib/components/display/mapView/mapView.stories.tsx +225 -0
  154. package/lib/components/display/modal/README.md +43 -0
  155. package/lib/components/display/modal/modal.stories.tsx +81 -0
  156. package/lib/components/display/notification/README.md +43 -0
  157. package/lib/components/display/notification/notification.stories.tsx +30 -0
  158. package/lib/components/display/progress/README.md +25 -0
  159. package/lib/components/display/progress/progress.stories.tsx +15 -0
  160. package/lib/components/display/stepper/README.md +96 -0
  161. package/lib/components/display/stepper/stepper.stories.tsx +175 -0
  162. package/lib/components/display/table/README.md +176 -0
  163. package/lib/components/display/table/table.stories.tsx +330 -0
  164. package/lib/components/display/tag/README.md +74 -0
  165. package/lib/components/display/tag/tag.stories.tsx +79 -0
  166. package/lib/components/input/address/README.md +132 -0
  167. package/lib/components/input/address/address.stories.tsx +147 -0
  168. package/lib/components/input/canvas/README.md +131 -0
  169. package/lib/components/input/canvas/canvas.stories.tsx +165 -0
  170. package/lib/components/input/checkbox/README.md +61 -0
  171. package/lib/components/input/checkbox/checkbox.stories.tsx +30 -0
  172. package/lib/components/input/datePicker/README.md +124 -0
  173. package/lib/components/input/datePicker/datePicker.stories.tsx +197 -0
  174. package/lib/components/input/form/README.md +55 -0
  175. package/lib/components/input/form/form.stories.tsx +143 -0
  176. package/lib/components/input/markdown/README.md +146 -0
  177. package/lib/components/input/markdown/markdown.stories.tsx +40 -0
  178. package/lib/components/input/monthYearPicker/README.md +69 -0
  179. package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +47 -0
  180. package/lib/components/input/netPromoterScore/README.md +52 -0
  181. package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +30 -0
  182. package/lib/components/input/rating/README.md +51 -0
  183. package/lib/components/input/rating/rating.stories.tsx +30 -0
  184. package/lib/components/input/select/README.md +108 -0
  185. package/lib/components/input/select/select.stories.tsx +286 -0
  186. package/lib/components/input/signature/README.md +106 -0
  187. package/lib/components/input/signature/signature.stories.tsx +188 -0
  188. package/lib/components/input/textArea/README.md +55 -0
  189. package/lib/components/input/textArea/textArea.stories.tsx +30 -0
  190. package/lib/components/input/textInput/README.md +81 -0
  191. package/lib/components/input/textInput/textinput.stories.tsx +231 -0
  192. package/lib/components/input/uploadInput/README.md +134 -0
  193. package/lib/components/input/uploadInput/uploadInput.stories.tsx +193 -0
  194. package/lib/components/navigation/bars/README.md +40 -0
  195. package/lib/components/navigation/bars/bars.stories.tsx +85 -0
  196. package/lib/components/navigation/bottomTab/README.md +53 -0
  197. package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +32 -0
  198. package/lib/components/navigation/breadcrumb/README.md +48 -0
  199. package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +27 -0
  200. package/lib/components/navigation/header/README.md +149 -0
  201. package/lib/components/navigation/header/header.stories.tsx +107 -0
  202. package/lib/components/navigation/leftNav/README.md +91 -0
  203. package/lib/components/navigation/leftNav/leftNav.stories.tsx +106 -0
  204. package/lib/components/navigation/tabs/README.md +75 -0
  205. package/lib/components/navigation/tabs/tabs.stories.tsx +60 -0
  206. package/lib/components/structure/column/README.md +40 -0
  207. package/lib/components/structure/column/column.stories.tsx +26 -0
  208. package/lib/components/structure/container/README.md +34 -0
  209. package/lib/components/structure/container/container.stories.tsx +19 -0
  210. package/lib/components/structure/link/README.md +55 -0
  211. package/lib/components/structure/link/link.stories.tsx +30 -0
  212. package/lib/components/structure/text/README.md +42 -0
  213. package/lib/components/structure/text/text.stories.tsx +39 -0
  214. package/lib/components/template/authPage/authPage.stories.tsx +68 -0
  215. package/lib/components/template/landingPage/landingPage.stories.tsx +288 -0
  216. package/lib/components/template/productListing/productListing.stories.tsx +297 -0
  217. package/lib/components/template/productOverview/productOverview.stories.tsx +194 -0
  218. package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +252 -0
  219. package/lib/components/template/userHomePage/userHomePage.stories.tsx +605 -0
  220. package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +481 -0
  221. package/lib/mcp/server.d.ts +2 -0
  222. package/lib/mcp/server.d.ts.map +1 -0
  223. package/lib/mcp/server.js +33 -0
  224. package/lib/mcp/server.js.map +1 -0
  225. package/lib/mcp/tools/getBackendComponent.d.ts +13 -0
  226. package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -0
  227. package/lib/mcp/tools/getBackendComponent.js +119 -0
  228. package/lib/mcp/tools/getBackendComponent.js.map +1 -0
  229. package/lib/mcp/tools/getComponent.d.ts +17 -0
  230. package/lib/mcp/tools/getComponent.d.ts.map +1 -0
  231. package/lib/mcp/tools/getComponent.js +118 -0
  232. package/lib/mcp/tools/getComponent.js.map +1 -0
  233. package/lib/mcp/tools/listComponents.d.ts +13 -0
  234. package/lib/mcp/tools/listComponents.d.ts.map +1 -0
  235. package/lib/mcp/tools/listComponents.js +113 -0
  236. package/lib/mcp/tools/listComponents.js.map +1 -0
  237. package/lib/mcp/tools/listTemplates.d.ts +13 -0
  238. package/lib/mcp/tools/listTemplates.d.ts.map +1 -0
  239. package/lib/mcp/tools/listTemplates.js +68 -0
  240. package/lib/mcp/tools/listTemplates.js.map +1 -0
  241. package/lib/mcp/tools/suggestTemplate.d.ts +17 -0
  242. package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -0
  243. package/lib/mcp/tools/suggestTemplate.js +212 -0
  244. package/lib/mcp/tools/suggestTemplate.js.map +1 -0
  245. package/package.json +23 -0
@@ -0,0 +1,149 @@
1
+ # Header
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ Header for Application UI for Normal User
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { Header } from "blixify-ui-web/components/navigation/header";
13
+ ```
14
+
15
+ ##### Usage
16
+
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
+ ];
48
+
49
+ const navigation = [
50
+ { name: "Dashboard", href: "/dashboard" },
51
+ {
52
+ name: "Activities",
53
+ href: "/dashboard/logistic",
54
+ multiNav: multiNavigation,
55
+ },
56
+ { name: "Records", href: "/dashboard/transaction" },
57
+ { name: "Donees", href: "/dashboard/orgs" },
58
+ { name: "FAQ", href: "https://google.com", openInNewTab: true },
59
+ ];
60
+
61
+ const [modal, setModal] = useState(false);
62
+
63
+ const handleSwapAccount = () => {
64
+ setModal(!modal);
65
+ window.alert("Swap account clicked");
66
+ };
67
+
68
+ const userNavigation = [
69
+ { name: "My Profile", href: "/dashboard/profile" },
70
+ {
71
+ name: "Swap Account",
72
+ customAction: handleSwapAccount,
73
+ notification: true,
74
+ },
75
+ { name: "Sign out", action: "logout", href: "#" },
76
+ ];
77
+
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
+ );
101
+ ```
102
+
103
+ ##### Required props
104
+
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 |
113
+
114
+ ##### Optional props
115
+
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` | |
@@ -0,0 +1,107 @@
1
+ import { Disclosure, Menu, Popover, Transition } from "@headlessui/react";
2
+ import {
3
+ BookOpenIcon,
4
+ ComputerDesktopIcon,
5
+ MapIcon,
6
+ PhoneIcon,
7
+ } from "@heroicons/react/20/solid";
8
+ import { storiesOf } from "@storybook/react";
9
+ import React, { useState } from "react";
10
+ import { Header } from ".";
11
+ import Favicon from "../../../assets/favicon.png";
12
+ import Logo from "../../../assets/logo.png";
13
+ import README from "./README.md";
14
+
15
+ const stories = storiesOf("Navigation", module);
16
+
17
+ stories.addParameters({
18
+ readme: {
19
+ content: README,
20
+ },
21
+ });
22
+
23
+ const multiNavigation = [
24
+ {
25
+ name: "Section 1",
26
+ href: "/dashboard/section1",
27
+ description:
28
+ "This is a dropdown section that allows you navigate to section 1",
29
+ icon: PhoneIcon,
30
+ },
31
+ {
32
+ name: "Section 2",
33
+ href: "/dashboard/section2",
34
+ description:
35
+ "This is a dropdown section that allows you navigate to section 2",
36
+ icon: ComputerDesktopIcon,
37
+ },
38
+ {
39
+ name: "Section 3",
40
+ href: "/dashboard/section3",
41
+ description:
42
+ "This is a dropdown section that allows you navigate to section 3",
43
+ icon: BookOpenIcon,
44
+ },
45
+ {
46
+ name: "Section 4",
47
+ href: "/dashboard/section4",
48
+ description:
49
+ "This is a dropdown section that allows you navigate to section 4",
50
+ icon: MapIcon,
51
+ },
52
+ ];
53
+
54
+ const navigation = [
55
+ { name: "Dashboard", href: "/dashboard" },
56
+ {
57
+ name: "Activities",
58
+ href: "/dashboard/logistic",
59
+ multiNav: multiNavigation,
60
+ },
61
+ { name: "Records", href: "/dashboard/transaction" },
62
+ { name: "Donees", href: "/dashboard/orgs" },
63
+ { name: "FAQ", href: "https://google.com", openInNewTab: true },
64
+ ];
65
+
66
+ stories.add("Header", () => {
67
+ const [modal, setModal] = useState(false);
68
+
69
+ const handleSwapAccount = () => {
70
+ setModal(!modal);
71
+ window.alert("Swap account clicked");
72
+ };
73
+
74
+ const userNavigation = [
75
+ { name: "My Profile", href: "/dashboard/profile" },
76
+ {
77
+ name: "Swap Account",
78
+ customAction: handleSwapAccount,
79
+ notification: true,
80
+ },
81
+ { name: "Sign out", action: "logout", href: "#" },
82
+ ];
83
+
84
+ 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>
106
+ );
107
+ });
@@ -0,0 +1,91 @@
1
+ # Left Nav
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ Left Nav for Dashboard Template
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ const [mobile, setMobile] = useState(false);
13
+ const navigation = [
14
+ {
15
+ id: "inspection",
16
+ name: "Inspection",
17
+ href: "/dashboard",
18
+ icon: HomeIcon,
19
+ },
20
+ {
21
+ id: "defects",
22
+ name: "Defects",
23
+ href: "/dashboard/defects",
24
+ icon: FolderIcon,
25
+ },
26
+ ];
27
+
28
+ return (
29
+ <LeftNav
30
+ selectedId="inspection"
31
+ draggable={true}
32
+ navigation={navigation}
33
+ leftNavMobileMenu={mobile}
34
+ handleChangeNavigation={(value) => {
35
+ setNavigation(value);
36
+ }}
37
+ handleToggleLeftNavMobileMenu={() => {
38
+ setMobile(!mobile);
39
+ }}
40
+ renderDashboardLogo={() => (
41
+ <div className="flex items-center flex-shrink-0 px-6 cursor-pointer">
42
+ <img className="h-10 w-auto" src={Logo} alt="Favicon" />
43
+ </div>
44
+ )}
45
+ renderDashboardContent={() => {}}
46
+ renderDashboardHeaderContent={() => {}}
47
+ />
48
+ );
49
+ ```
50
+
51
+ ##### Required props
52
+
53
+ | Name | Type | Description |
54
+ | ------------------------------- | ----------------- | ------------------------------ |
55
+ | `selectedId` | `string` | Selected ID of navigation |
56
+ | `navigation` | `Navigation List` | Navigation list to render bars |
57
+ | `leftNavMobileMenu` | `boolean` | Mobile menu activation |
58
+ | `bgColor` | `string` | Content background color |
59
+ | `handleToggleLeftNavMobileMenu` | `function` | Toggle mobile menu activation |
60
+ | `renderDashboardLogo` | `function` | Render Logo |
61
+ | `renderDashboardContent` | `function` | Render Content |
62
+ | `renderDashboardHeaderContent` | `function` | Render Header Content |
63
+
64
+ ##### Optional props
65
+
66
+ | Name | Type | Default | Description |
67
+ | ------------------------------ | ------------------ | ------------------------------------------------ | --------------------------------------------------------------- |
68
+ | `draggable` | `boolean` | `false` | `Make component items draggable` |
69
+ | `handleChangeNavigation` | `function` | `(value) => {setNavigation(value)}` | `Required when draggable is true` |
70
+ | `handleDropEnd` | `function` | `(value) => {}` | `Required when draggable is true` |
71
+ | `renderDashboardFooterContent` | `function` | `null` | `Render Left Nav Footer` |
72
+ | `linkProps` | `Link Props Class` | `Refer to Link Component for more documentation` | |
73
+ | `transition` | `Transition Class` | `null` | |
74
+ | `handleToggleCollapse` | `function` | `() => {}` | `Required when transition exist` |
75
+ | `handleBarsOnClick` | `function` | `(id:string) => {}` | `Used for single page rendering setState instead of navigation` |
76
+
77
+ ##### Navigation Class
78
+
79
+ | Name | Type | Default | Description |
80
+ | ------ | --------------- | ------- | ------------------ |
81
+ | `id` | `string` | "" | ID of Menu |
82
+ | `name` | `string` | "" | Name of Menu |
83
+ | `href` | `string` | "" | Page Href |
84
+ | `icon` | `React Element` | `` | Hero Icons Element |
85
+
86
+ ##### Transition Class
87
+
88
+ | Name | Type | Default | Description |
89
+ | --------------- | --------- | ------- | ----------------------------------------- |
90
+ | `headerVisible` | `boolean` | "true" | Render Header if it is true |
91
+ | `collapse` | `boolean` | "false" | Left nav will be collapse when it is true |
@@ -0,0 +1,106 @@
1
+ import { FolderIcon, HomeIcon } from "@heroicons/react/24/outline";
2
+ import { storiesOf } from "@storybook/react";
3
+ import React, { useEffect, useState } from "react";
4
+ import { LeftNav } from ".";
5
+ import Logo from "../../../assets/logo.png";
6
+ import README from "./README.md";
7
+
8
+ const stories = storiesOf("Navigation", module);
9
+
10
+ stories.addParameters({
11
+ readme: {
12
+ content: README,
13
+ },
14
+ });
15
+
16
+ stories.add("LeftNav", () => {
17
+ useEffect(() => {
18
+ window.addEventListener("resize", checkViewportWidth);
19
+
20
+ return () => {
21
+ window.removeEventListener("resize", checkViewportWidth);
22
+ };
23
+ });
24
+
25
+ const [mobile, setMobile] = useState(false);
26
+ const [navigation, setNavigation] = useState([
27
+ {
28
+ id: "inspection",
29
+ name: "Inspection",
30
+ href: "/dashboard",
31
+ icon: HomeIcon,
32
+ },
33
+ {
34
+ id: "teams",
35
+ name: "Teams",
36
+ href: "/team",
37
+ icon: HomeIcon,
38
+ groupId: "team",
39
+ },
40
+ {
41
+ id: "engineering",
42
+ name: "Engineering",
43
+ href: "/teams/engineering",
44
+ icon: HomeIcon,
45
+ groupId: "team",
46
+ },
47
+ {
48
+ id: "human_resources",
49
+ name: "Human Resources",
50
+ href: "/teams/hr",
51
+ icon: HomeIcon,
52
+ groupId: "team",
53
+ },
54
+ {
55
+ id: "defects",
56
+ name: "Defects",
57
+ href: "/dashboard/defects",
58
+ icon: FolderIcon,
59
+ },
60
+ ]);
61
+
62
+ const [collapse, setCollapse] = useState(false);
63
+
64
+ const checkViewportWidth = () => {
65
+ const laptop = 1024;
66
+ if (window.innerWidth <= laptop) {
67
+ setCollapse(false);
68
+ }
69
+ };
70
+
71
+ return (
72
+ <LeftNav
73
+ selectedId="inspection"
74
+ navigation={navigation}
75
+ leftNavMobileMenu={mobile}
76
+ draggable={true}
77
+ transition={{
78
+ headerVisible: undefined,
79
+ collapse,
80
+ }}
81
+ handleToggleCollapse={() => {
82
+ setCollapse(!collapse);
83
+ }}
84
+ handleChangeNavigation={(value) => {
85
+ setNavigation(value);
86
+ }}
87
+ handleToggleLeftNavMobileMenu={() => {
88
+ setMobile(!mobile);
89
+ }}
90
+ renderDashboardLogo={() => (
91
+ <div className="flex items-center flex-shrink-0 px-6 cursor-pointer flex-col">
92
+ <img
93
+ className={`h-10 ${
94
+ collapse ? "w-1/4 object-contain lg:hidden" : "w-auto"
95
+ } `}
96
+ w-auto
97
+ src={Logo}
98
+ alt="Favicon"
99
+ />
100
+ </div>
101
+ )}
102
+ renderDashboardContent={() => {}}
103
+ renderDashboardHeaderContent={() => {}}
104
+ />
105
+ );
106
+ });
@@ -0,0 +1,75 @@
1
+ # Tabs
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ Multiple tabs selection for navigation
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { Tabs } from "blixify-ui-web/components/navigation/tabs";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ ```jsx
18
+ const [selectedId, setSelectedId] = useState("account");
19
+ const [tabs, setTabs] = useState([
20
+ { id: "account", name: "My Account", href: "#" },
21
+ { id: "company", name: "Company", href: "#" },
22
+ { id: "members", name: "Team Members", href: "#" },
23
+ { id: "billing", name: "Billing", href: "#" },
24
+ ]);
25
+
26
+ //Default
27
+ <Tabs
28
+ tabs={tabs}
29
+ selectedId={selectedId}
30
+ onClick={(id) => {
31
+ setSelectedId(id);
32
+ }}
33
+ handleChangeTabs={(value) => setTabs(value)}
34
+ handleDropEnd={() => {}}
35
+ draggable={true}
36
+ />
37
+
38
+ //Overflow Wrap
39
+ <Tabs
40
+ tabs={tabs}
41
+ selectedId={selectedId}
42
+ onClick={(id) => {
43
+ setSelectedId(id);
44
+ }}
45
+ overflowWrap
46
+ />
47
+
48
+ // Dark Mode
49
+ <Tabs
50
+ tabs={tabs}
51
+ selectedId={selectedId}
52
+ onClick={(id) => {
53
+ setSelectedId(id);
54
+ }}
55
+ darkMode
56
+ />
57
+ ```
58
+
59
+ ##### Required props
60
+
61
+ | Name | Type | Description |
62
+ | ------------ | ------------ | --------------- |
63
+ | `tabs` | `Tabs Class` | Tab Class List |
64
+ | `selectedId` | `string` | Selected Tab ID |
65
+
66
+ ##### Optional Props
67
+
68
+ | Name | Type | Description |
69
+ | ------------------ | ---------------------- | ---------------------------------------------- |
70
+ | `draggable` | `boolean` | Make component items draggable |
71
+ | `overflowWrap` | `boolean` | Wrap tab options to new row when overflow |
72
+ | `linkProps` | `Link Props Class` | Refer to Link Component for more documentation |
73
+ | `onClick` | `(id: string) => void` | Callback function when tab option is clicked |
74
+ | `handleChangeTabs` | `(value) => void` | Required when draggable is true |
75
+ | `handleDropEnd` | `() => void` | Required when draggable is true |
@@ -0,0 +1,60 @@
1
+ import { storiesOf } from "@storybook/react";
2
+ import React, { useState } from "react";
3
+ import { Tabs } from ".";
4
+ import README from "./README.md";
5
+ const stories = storiesOf("Navigation", module);
6
+
7
+ stories.addParameters({
8
+ readme: {
9
+ content: README,
10
+ },
11
+ });
12
+
13
+ stories.add("Tabs", () => {
14
+ const [selectedId, setSelectedId] = useState("account");
15
+ const [tabs, setTabs] = useState([
16
+ { id: "account", name: "My Account", href: "#" },
17
+ { id: "company", name: "Company", href: "#" },
18
+ { id: "members", name: "Team Members", href: "#" },
19
+ { id: "billing", name: "Billing", href: "#" },
20
+ ]);
21
+
22
+ return (
23
+ <>
24
+ <h1 className="mb-2 text-lg font-bold">Default</h1>
25
+ <Tabs
26
+ tabs={tabs}
27
+ selectedId={selectedId}
28
+ onClick={(id) => {
29
+ setSelectedId(id);
30
+ }}
31
+ handleChangeTabs={(value) => setTabs(value)}
32
+ handleDropEnd={() => {}}
33
+ draggable={true}
34
+ />
35
+ <h1 className="mt-8 text-lg font-bold">Overflow Wrap</h1>
36
+ <p className="mb-2 text-sm text-gray-500">
37
+ Wrap tab options to new row when there's an overflow.
38
+ </p>
39
+ <Tabs
40
+ tabs={tabs}
41
+ selectedId={selectedId}
42
+ onClick={(id) => {
43
+ setSelectedId(id);
44
+ }}
45
+ overflowWrap
46
+ />
47
+ <h1 className="mt-8 mb-2 text-lg font-bold">Dark Mode</h1>
48
+ <div className="p-4 bg-black rounded-lg">
49
+ <Tabs
50
+ tabs={tabs}
51
+ selectedId={selectedId}
52
+ onClick={(id) => {
53
+ setSelectedId(id);
54
+ }}
55
+ darkMode={true}
56
+ />
57
+ </div>
58
+ </>
59
+ );
60
+ });
@@ -0,0 +1,40 @@
1
+ # Column
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ Column to define vertical or row container
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { Column } from "blixify-ui-web/components/structure/column";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ ```jsx
18
+ <Column orientation="row" mobileBp="sm" className="bg-gray-50">
19
+ <p>Row Item 1</p>
20
+ <p className="sm:ml-2">Row Item 2</p>
21
+ </Column>
22
+ <Column orientation="vertical" mobileBp="sm" className="bg-gray-50 mt-5">
23
+ <p>Row Item 1</p>
24
+ <p>Row Item 2</p>
25
+ </Column>
26
+ ```
27
+
28
+ ##### Required props
29
+
30
+ | Name | Type | Description |
31
+ | ------------- | ---------------- | --------------- |
32
+ | `children` | `React.Element` | React Element |
33
+ | `orientation` | `row / vertical` | Row or Vertical |
34
+
35
+ ##### Optional props
36
+
37
+ | Name | Type | Default | Description |
38
+ | ----------- | ---------------- | ------- | ----------- |
39
+ | `mobileBp` | `sm / md / lg` | Null |
40
+ | `className` | `tailwind class` | "" |
@@ -0,0 +1,26 @@
1
+ import { storiesOf } from "@storybook/react";
2
+ import React from "react";
3
+ import { Column } from ".";
4
+ import README from "./README.md";
5
+ const stories = storiesOf("Structure", module);
6
+
7
+ stories.addParameters({
8
+ readme: {
9
+ content: README,
10
+ },
11
+ });
12
+
13
+ stories.add("Column", () => {
14
+ return (
15
+ <>
16
+ <Column orientation="row" mobileBp="sm" className="bg-gray-50">
17
+ <p>Row Item 1</p>
18
+ <p className="sm:ml-2">Row Item 2</p>
19
+ </Column>
20
+ <Column orientation="vertical" mobileBp="sm" className="bg-gray-50 mt-5">
21
+ <p>Row Item 1</p>
22
+ <p>Row Item 2</p>
23
+ </Column>
24
+ </>
25
+ );
26
+ });
@@ -0,0 +1,34 @@
1
+ # Container
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ Root container to wrap objects with x-padding
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { Container } from "blixify-ui-web/components/structure/container";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ ```jsx
18
+ <Container>
19
+ <h1>Item 1</h1>
20
+ </Container>
21
+ ```
22
+
23
+ ##### Required props
24
+
25
+ | Name | Type | Description |
26
+ | ---------- | --------------- | ------------- |
27
+ | `children` | `React.Element` | React Element |
28
+
29
+ ##### Optional props
30
+
31
+ | Name | Type | Default | Description |
32
+ | ----------- | ---------------- | ------------ | ----------- |
33
+ | `bgColor` | `string` | `bg-gray-50` | |
34
+ | `className` | `tailwind class` | "" | |