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,78 @@
1
+ # Bare Sign In
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ A headless sign-in form that supports multiple authentication providers. Renders the appropriate input fields based on the active `type`, and shows alternative provider buttons for the remaining entries in `provider`.
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { BareSignIn, AvailableProvider } from "blixify-ui-web/auth/bareSignIn";
13
+ ```
14
+
15
+ ##### Usage
16
+
17
+ Basic email sign-in:
18
+
19
+ ```jsx
20
+ const [provider, setProvider] = useState("email");
21
+
22
+ <BareSignIn
23
+ type={provider}
24
+ provider={["email", "phone", "google"]}
25
+ onChangeProvider={setProvider}
26
+ column="flex"
27
+ version="1.0.0"
28
+ />;
29
+ ```
30
+
31
+ Phone sign-in with country picker:
32
+
33
+ ```jsx
34
+ <BareSignIn
35
+ type="phone"
36
+ provider={["phone", "email"]}
37
+ mobilePicker={true}
38
+ mobileCountryEditable={true}
39
+ onChangeProvider={setProvider}
40
+ column="flex"
41
+ />
42
+ ```
43
+
44
+ OTP sign-in with resend:
45
+
46
+ ```jsx
47
+ <BareSignIn
48
+ type="phoneOTP"
49
+ provider={["phoneOTP"]}
50
+ onChangeProvider={setProvider}
51
+ column="flex"
52
+ onChangeResendOTP={() => {
53
+ /* trigger resend */
54
+ }}
55
+ />
56
+ ```
57
+
58
+ ##### Required props
59
+
60
+ | Name | Type | Description |
61
+ | ------------------ | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
62
+ | `type` | `"email" \| "phone" \| "phoneOTP" \| "username" \| "google"` | Currently active sign-in method — determines which form fields are rendered |
63
+ | `provider` | `Array<"email" \| "phone" \| "phoneOTP" \| "username" \| "google">` | Full list of supported providers. Non-active ones render as alternative sign-in buttons |
64
+ | `onChangeProvider` | `(provider: typeof AvailableProvider) => void` | Called when the user clicks an alternative provider button |
65
+
66
+ ##### Optional props
67
+
68
+ | Name | Type | Default | Description |
69
+ | ----------------------- | ---------------------- | -------- | -------------------------------------------------------------------------- |
70
+ | `version` | `string` | — | Version string displayed at the bottom of the form |
71
+ | `column` | `"grid" \| "flex"` | `"grid"` | Layout of the form fields. `"flex"` stacks them vertically |
72
+ | `mobilePicker` | `boolean` | `false` | Shows a country code picker on the phone input |
73
+ | `mobileCountryEditable` | `boolean` | `false` | Allows the user to edit the country code in the mobile picker |
74
+ | `imgLogo` | `string` | — | Custom logo URL used for the Google sign-in button icon |
75
+ | `className` | `string` | — | Tailwind classes applied to the outer wrapper |
76
+ | `bottomComponent` | `ReactElement` | — | Extra element rendered below the version string |
77
+ | `onComplete` | `(value: any) => void` | — | Called with the form state when the sign-in form is submitted successfully |
78
+ | `onChangeResendOTP` | `(value: any) => void` | — | When provided, shows a "Resend OTP" link on the `phoneOTP` form |
@@ -0,0 +1,141 @@
1
+ import { storiesOf } from "@storybook/react";
2
+ import React, { useState } from "react";
3
+ import { AvailableProvider, BareSignIn } from ".";
4
+ import README from "./README.md";
5
+ import { StorySection } from "../../storyUtils";
6
+
7
+ const stories = storiesOf("Auth", module);
8
+
9
+ stories.addParameters({
10
+ readme: {
11
+ content: README,
12
+ },
13
+ });
14
+
15
+ const cardCls =
16
+ "w-full max-w-md bg-white rounded-lg shadow-sm border border-gray-100";
17
+
18
+ stories.add("Bare Sign In", () => {
19
+ const [provider, setProvider] = useState<typeof AvailableProvider>("email");
20
+
21
+ return (
22
+ <div className="font-sans max-w-2xl p-6">
23
+ <StorySection
24
+ title="Email Provider"
25
+ description={
26
+ <>
27
+ Sign in form for <code>type="email"</code>. Renders email + password
28
+ fields with a "Forgot Your Password?" toggle. The{" "}
29
+ <code>provider</code> array controls which alternative sign-in
30
+ buttons appear below the form.
31
+ </>
32
+ }
33
+ >
34
+ <div className={cardCls}>
35
+ <BareSignIn
36
+ version="0.0.1"
37
+ type="email"
38
+ provider={["email", "phone", "google", "username"]}
39
+ onChangeProvider={setProvider}
40
+ column="flex"
41
+ className="py-6 px-4"
42
+ />
43
+ </div>
44
+ </StorySection>
45
+
46
+ <StorySection
47
+ title="Phone Provider"
48
+ description={
49
+ <>
50
+ Sign in form for <code>type="phone"</code>. Renders a mobile number
51
+ input with a reCAPTCHA container. Set{" "}
52
+ <code>mobilePicker=&#123;true&#125;</code> to show a country code
53
+ picker, and <code>mobileCountryEditable</code> to allow editing it.
54
+ </>
55
+ }
56
+ >
57
+ <div className={cardCls}>
58
+ <BareSignIn
59
+ version="0.0.1"
60
+ type="phone"
61
+ mobilePicker={true}
62
+ mobileCountryEditable={true}
63
+ provider={["phone", "email"]}
64
+ onChangeProvider={setProvider}
65
+ column="flex"
66
+ className="py-6 px-4"
67
+ />
68
+ </div>
69
+ </StorySection>
70
+
71
+ <StorySection
72
+ title="Username Provider"
73
+ description={
74
+ <>
75
+ Sign in form for <code>type="username"</code>. Renders a username +
76
+ password input. Username is validated against alphanumeric
77
+ characters and dots.
78
+ </>
79
+ }
80
+ >
81
+ <div className={cardCls}>
82
+ <BareSignIn
83
+ version="0.0.1"
84
+ type="username"
85
+ provider={["username", "email"]}
86
+ onChangeProvider={setProvider}
87
+ column="flex"
88
+ className="py-6 px-4"
89
+ />
90
+ </div>
91
+ </StorySection>
92
+
93
+ <StorySection
94
+ title="OTP Provider"
95
+ description={
96
+ <>
97
+ Sign in form for <code>type="phoneOTP"</code>. Renders a 6-digit OTP
98
+ input. Pass <code>onChangeResendOTP</code> to show a "Resend OTP"
99
+ link.
100
+ </>
101
+ }
102
+ >
103
+ <div className={cardCls}>
104
+ <BareSignIn
105
+ version="0.0.1"
106
+ type="phoneOTP"
107
+ provider={["phoneOTP"]}
108
+ onChangeProvider={setProvider}
109
+ column="flex"
110
+ className="py-6 px-4"
111
+ onChangeResendOTP={() => {}}
112
+ />
113
+ </div>
114
+ </StorySection>
115
+
116
+ <StorySection
117
+ title="Switchable Provider (controlled)"
118
+ description={
119
+ <>
120
+ Use <code>onChangeProvider</code> with local state to let users
121
+ switch between sign-in methods. The active <code>type</code> drives
122
+ which form is rendered.
123
+ </>
124
+ }
125
+ >
126
+ <div className={cardCls}>
127
+ <BareSignIn
128
+ version="0.0.1"
129
+ type={provider}
130
+ mobilePicker={true}
131
+ mobileCountryEditable={true}
132
+ provider={["phone", "email", "google", "username"]}
133
+ onChangeProvider={setProvider}
134
+ column="flex"
135
+ className="py-6 px-4"
136
+ />
137
+ </div>
138
+ </StorySection>
139
+ </div>
140
+ );
141
+ });
@@ -0,0 +1,130 @@
1
+ # Bare Sign Up
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ A headless multi-step sign-up form. Shows a provider selection screen when no `type` is active, then steps through `formList.steps` one at a time. Includes a back button between steps.
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { BareSignUp } from "blixify-ui-web/auth/bareSignUp";
13
+ import { AvailableProvider } from "blixify-ui-web/auth/bareSignIn";
14
+ ```
15
+
16
+ ##### Usage
17
+
18
+ ```jsx
19
+ const custFormRef = useRef(null);
20
+ const input1 = useRef(null);
21
+ const input2 = useRef(null);
22
+
23
+ const [type, setType] = useState("");
24
+ const [stepIndex, setStepIndex] = useState(0);
25
+
26
+ const handleChangeProvider = (provider) => {
27
+ setType(provider);
28
+ setStepIndex(0);
29
+ };
30
+
31
+ <BareSignUp
32
+ type={type}
33
+ stepIndex={stepIndex}
34
+ handleUpdateStepIndex={setStepIndex}
35
+ onChangeProvider={handleChangeProvider}
36
+ provider={["email", "phone", "google"]}
37
+ defaultProvider="email"
38
+ formList={{
39
+ steps: [
40
+ {
41
+ components: [
42
+ <TextInput
43
+ ref={input1}
44
+ id="name"
45
+ value=""
46
+ type="name"
47
+ label="Name"
48
+ placeholder="John Doe"
49
+ />,
50
+ <TextInput
51
+ ref={input2}
52
+ id="phone"
53
+ value=""
54
+ type="mobile"
55
+ label="Mobile"
56
+ placeholder="+60123456789"
57
+ />,
58
+ ],
59
+ formRef: custFormRef,
60
+ refs: [input1, input2],
61
+ onHandleComponents: () => setStepIndex(1),
62
+ },
63
+ {
64
+ components: [
65
+ <TextInput
66
+ ref={input1}
67
+ id="email"
68
+ value=""
69
+ type="email"
70
+ label="Email"
71
+ placeholder="Enter your email"
72
+ />,
73
+ <TextInput
74
+ ref={input2}
75
+ id="password"
76
+ value=""
77
+ type="password"
78
+ label="Password"
79
+ placeholder="Enter your password"
80
+ />,
81
+ ],
82
+ formRef: custFormRef,
83
+ refs: [input1, input2],
84
+ onHandleComponents: () => {
85
+ /* submit */
86
+ },
87
+ },
88
+ ],
89
+ }}
90
+ version="1.0.0"
91
+ />;
92
+ ```
93
+
94
+ ##### Required props
95
+
96
+ | Name | Type | Description |
97
+ | ----------------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
98
+ | `type` | `"email" \| "phone" \| "google" \| ""` | Active provider. Empty string shows the provider selection screen |
99
+ | `provider` | `Array<"email" \| "phone" \| "google">` | All available sign-up providers shown on the selection screen |
100
+ | `stepIndex` | `number` | Index of the currently active step in `formList.steps` |
101
+ | `formList` | `FormList` | Defines the multi-step form — see FormList below |
102
+ | `handleUpdateStepIndex` | `(index: number) => void` | Called to advance or go back between steps |
103
+ | `onChangeProvider` | `(provider: typeof AvailableProvider \| "") => void` | Called when a provider is selected or the user goes back to selection |
104
+
105
+ ##### Optional props
106
+
107
+ | Name | Type | Default | Description |
108
+ | -------------------- | -------------------------- | ------- | -------------------------------------------------------------------------------- |
109
+ | `defaultProvider` | `typeof AvailableProvider` | — | Provider shown as the primary button on the selection screen |
110
+ | `preventBack` | `boolean` | `false` | Hides the back button between steps and from the form back to provider selection |
111
+ | `maxCol` | `number` | — | Overrides the default two-column grid. Pass `1` for a single-column layout |
112
+ | `version` | `string` | — | Version string displayed at the bottom |
113
+ | `imgLogo` | `string` | — | Custom logo URL for the Google sign-up button icon |
114
+ | `className` | `string` | — | Tailwind classes applied to the inner wrapper |
115
+ | `onCompleteEachStep` | `() => void` | — | Called when a step's form is submitted successfully |
116
+
117
+ ##### FormList
118
+
119
+ | Name | Type | Description |
120
+ | ------- | --------- | ----------------------------------------- |
121
+ | `steps` | `Steps[]` | Ordered list of steps in the sign-up flow |
122
+
123
+ ##### Steps
124
+
125
+ | Name | Type | Description |
126
+ | -------------------- | --------------- | ------------------------------------------------------------------- |
127
+ | `components` | `JSX.Element[]` | Form field components to render for this step |
128
+ | `refs` | `any[]` | Refs to input components — used for validation before advancing |
129
+ | `formRef` | `Ref<Form>` | Ref to the `Form` wrapper — used to trigger submit programmatically |
130
+ | `onHandleComponents` | `() => void` | Called when the user clicks "Next" or "Submit" on this step |
@@ -0,0 +1,159 @@
1
+ import { storiesOf } from "@storybook/react";
2
+ import React, { useRef, useState } from "react";
3
+ import { BareSignUp } from ".";
4
+ import { Option, Select } from "../../input/select";
5
+ import { TextInput } from "../../input/textInput";
6
+ import { AvailableProvider } from "../bareSignIn";
7
+ import README from "./README.md";
8
+ import { StorySection } from "../../storyUtils";
9
+
10
+ const stories = storiesOf("Auth", module);
11
+
12
+ stories.addParameters({
13
+ readme: {
14
+ content: README,
15
+ },
16
+ });
17
+
18
+ const genderOptions: Option[] = [
19
+ { key: "M", label: "Male" },
20
+ { key: "F", label: "Female" },
21
+ ];
22
+
23
+ stories.add("Bare Sign Up", () => {
24
+ const custFormRef: any = useRef(null);
25
+ const signUpFormRef: any = useRef(null);
26
+ const input1: any = useRef(null);
27
+ const input2: any = useRef(null);
28
+
29
+ const [signUpType, setSignUpType] =
30
+ useState<typeof AvailableProvider | "">("");
31
+ const [stepIndex, setStepIndex] = useState(0);
32
+
33
+ const handleChangeProvider = (provider: typeof AvailableProvider | "") => {
34
+ setSignUpType(provider);
35
+ setStepIndex(0);
36
+ };
37
+
38
+ /*
39
+ formList.steps defines each step of the multi-step sign-up flow.
40
+ Each step has:
41
+ - components: the form fields to render
42
+ - refs: input refs used for validation
43
+ - formRef: ref to the Form wrapper for triggering submit
44
+ - onHandleComponents: called when the user clicks "Next" or "Submit"
45
+ */
46
+ const formList = {
47
+ steps: [
48
+ {
49
+ components: [
50
+ <TextInput
51
+ ref={input1}
52
+ id="name"
53
+ value=""
54
+ type="name"
55
+ label="Name"
56
+ placeholder="John Doe"
57
+ />,
58
+ <TextInput
59
+ ref={input2}
60
+ id="phoneNumber"
61
+ value=""
62
+ type="mobile"
63
+ label="Mobile"
64
+ placeholder="+60123456789"
65
+ />,
66
+ <Select
67
+ value="M"
68
+ label="Gender"
69
+ options={genderOptions}
70
+ onChange={() => {}}
71
+ />,
72
+ <div className="text-sm">
73
+ By signing up, you agree to our terms & condition, privacy & policy
74
+ </div>,
75
+ ],
76
+ formRef: custFormRef,
77
+ refs: [input1, input2],
78
+ onHandleComponents: () => setStepIndex(1),
79
+ },
80
+ {
81
+ components: [
82
+ <TextInput
83
+ ref={input1}
84
+ id="email"
85
+ value=""
86
+ type="email"
87
+ label="Email"
88
+ placeholder="Enter your email"
89
+ />,
90
+ <TextInput
91
+ ref={input2}
92
+ id="password"
93
+ value=""
94
+ type="password"
95
+ label="Password"
96
+ placeholder="Enter your password"
97
+ />,
98
+ ],
99
+ formRef: signUpFormRef,
100
+ refs: [input1, input2],
101
+ onHandleComponents: () => {},
102
+ },
103
+ ],
104
+ };
105
+
106
+ return (
107
+ <div className="font-sans max-w-2xl p-6">
108
+ <StorySection
109
+ title="Multi-step Sign Up"
110
+ description={
111
+ <>
112
+ Provider selection screen shown when <code>type</code> is empty.
113
+ Once a provider is selected, the form steps in <code>formList</code>{" "}
114
+ are rendered one at a time, controlled by <code>stepIndex</code> and{" "}
115
+ <code>handleUpdateStepIndex</code>. A back button appears between
116
+ steps unless <code>preventBack</code> is set.
117
+ </>
118
+ }
119
+ >
120
+ <div className="p-4 w-full max-w-md bg-white rounded-lg shadow-sm border border-gray-100">
121
+ <BareSignUp
122
+ type={signUpType}
123
+ stepIndex={stepIndex}
124
+ handleUpdateStepIndex={setStepIndex}
125
+ onChangeProvider={handleChangeProvider}
126
+ provider={["email", "phone", "google"]}
127
+ defaultProvider="email"
128
+ formList={formList}
129
+ version="0.0.1"
130
+ />
131
+ </div>
132
+ </StorySection>
133
+
134
+ <StorySection
135
+ title="Single Column Layout"
136
+ description={
137
+ <>
138
+ Use <code>maxCol=&#123;1&#125;</code> to force a single-column form
139
+ layout, overriding the default two-column grid on larger screens.
140
+ </>
141
+ }
142
+ >
143
+ <div className="p-4 w-full max-w-sm bg-white rounded-lg shadow-sm border border-gray-100">
144
+ <BareSignUp
145
+ type={signUpType}
146
+ stepIndex={stepIndex}
147
+ handleUpdateStepIndex={setStepIndex}
148
+ onChangeProvider={handleChangeProvider}
149
+ provider={["email", "phone", "google"]}
150
+ defaultProvider="email"
151
+ formList={formList}
152
+ maxCol={1}
153
+ version="0.0.1"
154
+ />
155
+ </div>
156
+ </StorySection>
157
+ </div>
158
+ );
159
+ });
@@ -0,0 +1,53 @@
1
+ # Sign In Template
2
+
3
+ <!-- STORY -->
4
+
5
+ <hr>
6
+
7
+ A two-column sign-in page layout. The left panel renders custom `leftComponents` (branding, contact info, etc.) and the right two columns render a `BareSignIn` form. All `BareSignIn` props are forwarded.
8
+
9
+ ##### Import
10
+
11
+ ```js
12
+ import { SignInTemplate } from "blixify-ui-web/auth/signIn";
13
+ import { AvailableProvider } from "blixify-ui-web/auth/bareSignIn";
14
+ ```
15
+
16
+ ##### Usage
17
+
18
+ ```jsx
19
+ const [provider, setProvider] = useState("email");
20
+
21
+ <SignInTemplate
22
+ type={provider}
23
+ provider={["email", "phone", "google"]}
24
+ onChangeProvider={setProvider}
25
+ leftComponents={
26
+ <div>
27
+ <h3 className="text-lg font-medium text-gray-700">Contact information</h3>
28
+ <p className="mt-4 text-sm text-gray-600">info@example.com</p>
29
+ </div>
30
+ }
31
+ leftClassName="bg-gray-50"
32
+ version="1.0.0"
33
+ />;
34
+ ```
35
+
36
+ ##### Required props
37
+
38
+ | Name | Type | Description |
39
+ | ------------------ | ------------------------------------------------------------------- | ---------------------------------------------------------------------- |
40
+ | `type` | `"email" \| "phone" \| "phoneOTP" \| "username" \| "google"` | Active sign-in provider — determines which form fields are rendered |
41
+ | `provider` | `Array<"email" \| "phone" \| "phoneOTP" \| "username" \| "google">` | All available providers. Non-active ones render as alternative buttons |
42
+ | `leftComponents` | `ReactElement \| ReactElement[]` | Content rendered in the left panel (branding, contact info, etc.) |
43
+ | `onChangeProvider` | `(provider: typeof AvailableProvider) => void` | Called when the user switches to a different provider |
44
+
45
+ ##### Optional props
46
+
47
+ | Name | Type | Default | Description |
48
+ | ------------------- | ---------------------- | ------- | --------------------------------------------------------------------- |
49
+ | `leftClassName` | `string` | — | Tailwind classes applied to the left panel (e.g. background color) |
50
+ | `version` | `string` | — | Version string shown at the bottom of the form |
51
+ | `bottomComponents` | `ReactElement` | — | Extra element rendered below the version string |
52
+ | `onComplete` | `(value: any) => void` | — | Called with form state when sign-in is submitted successfully |
53
+ | `onChangeResendOTP` | `(value: any) => void` | — | Shows a "Resend OTP" link when provided (used with `type="phoneOTP"`) |
@@ -0,0 +1,120 @@
1
+ import { storiesOf } from "@storybook/react";
2
+ import React, { useState } from "react";
3
+ import { SignInTemplate } from ".";
4
+ import { AvailableProvider } from "../bareSignIn";
5
+ import README from "./README.md";
6
+ import { StorySection } from "../../storyUtils";
7
+
8
+ const stories = storiesOf("Auth", module);
9
+
10
+ stories.addParameters({
11
+ readme: {
12
+ content: README,
13
+ },
14
+ });
15
+
16
+ const contactInfo = (
17
+ <>
18
+ <h3 className="text-lg font-medium text-gray-700">Contact information</h3>
19
+ <dl className="mt-8 space-y-6">
20
+ <dd className="flex text-base text-gray-600">
21
+ <svg
22
+ className="flex-shrink-0 w-6 h-6 text-gray-500"
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ fill="none"
25
+ viewBox="0 0 24 24"
26
+ stroke="currentColor"
27
+ aria-hidden="true"
28
+ >
29
+ <path
30
+ strokeLinecap="round"
31
+ strokeLinejoin="round"
32
+ strokeWidth="2"
33
+ d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
34
+ />
35
+ </svg>
36
+ <span className="ml-3">+(60) 12-3456789</span>
37
+ </dd>
38
+ <dd className="flex text-base text-gray-600">
39
+ <svg
40
+ className="flex-shrink-0 w-6 h-6 text-gray-500"
41
+ xmlns="http://www.w3.org/2000/svg"
42
+ fill="none"
43
+ viewBox="0 0 24 24"
44
+ stroke="currentColor"
45
+ aria-hidden="true"
46
+ >
47
+ <path
48
+ strokeLinecap="round"
49
+ strokeLinejoin="round"
50
+ strokeWidth="2"
51
+ d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
52
+ />
53
+ </svg>
54
+ <span className="ml-3">info@example.com</span>
55
+ </dd>
56
+ </dl>
57
+ </>
58
+ );
59
+
60
+ stories.add("Sign In", () => {
61
+ const [provider, setProvider] = useState<typeof AvailableProvider>("email");
62
+
63
+ return (
64
+ <div className="font-sans max-w-4xl p-6">
65
+ <StorySection
66
+ title="Default Layout"
67
+ description={
68
+ <>
69
+ Two-column layout: <code>leftComponents</code> fills the left panel,{" "}
70
+ <code>BareSignIn</code> fills the right two columns. Use{" "}
71
+ <code>leftClassName</code> to style the left panel background. The
72
+ active <code>type</code> and <code>provider</code> array work the
73
+ same as in <code>BareSignIn</code>.
74
+ </>
75
+ }
76
+ >
77
+ <div className="w-full bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden">
78
+ <SignInTemplate
79
+ version="0.0.1"
80
+ leftComponents={contactInfo}
81
+ leftClassName="bg-gray-50"
82
+ type={provider}
83
+ provider={["phone", "email", "google"]}
84
+ onChangeProvider={setProvider}
85
+ />
86
+ </div>
87
+ </StorySection>
88
+
89
+ <StorySection
90
+ title="Colored Left Panel"
91
+ description={
92
+ <>
93
+ Pass any Tailwind background class via <code>leftClassName</code> to
94
+ brand the left panel. Combine with custom{" "}
95
+ <code>leftComponents</code>
96
+ content for a fully styled auth page.
97
+ </>
98
+ }
99
+ >
100
+ <div className="w-full bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden">
101
+ <SignInTemplate
102
+ version="0.0.1"
103
+ leftComponents={
104
+ <div className="text-white">
105
+ <h3 className="text-lg font-medium">Welcome back</h3>
106
+ <p className="mt-4 text-sm opacity-80">
107
+ Sign in to continue to your account.
108
+ </p>
109
+ </div>
110
+ }
111
+ leftClassName="bg-primary-700"
112
+ type={provider}
113
+ provider={["email", "google"]}
114
+ onChangeProvider={setProvider}
115
+ />
116
+ </div>
117
+ </StorySection>
118
+ </div>
119
+ );
120
+ });