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.
- package/README.md +5 -0
- package/lib/components/action/button/README.md +75 -0
- package/lib/components/action/button/button.stories.tsx +138 -0
- package/lib/components/action/buttonGroup/README.md +79 -0
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +104 -0
- package/lib/components/action/iconButton/README.md +39 -0
- package/lib/components/action/iconButton/iconButton.stories.tsx +22 -0
- package/lib/components/action/radioList/README.md +98 -0
- package/lib/components/action/radioList/radioList.stories.tsx +181 -0
- package/lib/components/action/slider/README.md +86 -0
- package/lib/components/action/slider/slider.stories.tsx +133 -0
- package/lib/components/action/textButton/README.md +34 -0
- package/lib/components/action/textButton/textButton.stories.tsx +16 -0
- package/lib/components/action/toggle/README.md +39 -0
- package/lib/components/action/toggle/toggle.stories.tsx +23 -0
- package/lib/components/advanced/collapse/README.md +106 -0
- package/lib/components/advanced/collapse/collapse.stories.tsx +165 -0
- package/lib/components/advanced/infoWindow/README.md +69 -0
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +112 -0
- package/lib/components/advanced/popUp/README.md +95 -0
- package/lib/components/advanced/popUp/popUp.stories.tsx +189 -0
- package/lib/components/auth/bareSignIn/README.md +78 -0
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +141 -0
- package/lib/components/auth/bareSignUp/README.md +130 -0
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +159 -0
- package/lib/components/auth/signIn/README.md +53 -0
- package/lib/components/auth/signIn/signIn.stories.tsx +120 -0
- package/lib/components/auth/signUp/README.md +136 -0
- package/lib/components/auth/signUp/signUp.stories.tsx +193 -0
- package/lib/components/chart/README.md +13 -0
- package/lib/components/chart/areaChart/README.md +133 -0
- package/lib/components/chart/areaChart/areaChart.stories.tsx +199 -0
- package/lib/components/chart/barChart/README.md +193 -0
- package/lib/components/chart/barChart/barChart.stories.tsx +318 -0
- package/lib/components/chart/boxPlotChart/README.md +124 -0
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +104 -0
- package/lib/components/chart/bubbleChart/README.md +166 -0
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +144 -0
- package/lib/components/chart/card/README.md +107 -0
- package/lib/components/chart/card/card.stories.tsx +89 -0
- package/lib/components/chart/ganttChart/README.md +142 -0
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +138 -0
- package/lib/components/chart/heatmapChart/README.md +125 -0
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +106 -0
- package/lib/components/chart/lineChart/README.md +140 -0
- package/lib/components/chart/lineChart/lineChart.stories.tsx +152 -0
- package/lib/components/chart/pieChart/README.md +117 -0
- package/lib/components/chart/pieChart/pieChart.stories.tsx +180 -0
- package/lib/components/chart/polarAreaChart/README.md +126 -0
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +106 -0
- package/lib/components/chart/radarChart/README.md +57 -0
- package/lib/components/chart/radarChart/radarChart.stories.tsx +36 -0
- package/lib/components/chart/radialBar/README.md +152 -0
- package/lib/components/chart/radialBar/radialChart.stories.tsx +136 -0
- package/lib/components/chart/rangeBarChart/README.md +323 -0
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +208 -0
- package/lib/components/chart/statsCard/README.md +97 -0
- package/lib/components/chart/statsCard/statsCard.stories.tsx +183 -0
- package/lib/components/chart/treemapChart/README.md +142 -0
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +122 -0
- package/lib/components/chat/chatAnchor/README.md +113 -0
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +156 -0
- package/lib/components/chat/chatBase/README.md +223 -0
- package/lib/components/chat/chatBase/chatBase.stories.tsx +306 -0
- package/lib/components/chat/chatDashboard/README.md +161 -0
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +154 -0
- package/lib/components/data/dataGraph/README.md +13 -0
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +84 -0
- package/lib/components/data/dataReference/README.md +62 -0
- package/lib/components/data/dataReference/dataReference.stories.tsx +53 -0
- package/lib/components/data/dataTemplate/README.md +903 -0
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +196 -0
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +337 -0
- package/lib/components/data/dataWrapper/README.md +1077 -0
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +831 -0
- package/lib/components/data/queryForm/README.md +56 -0
- package/lib/components/data/queryForm/queryForm.stories.tsx +85 -0
- package/lib/components/data/readQuery/README.md +282 -0
- package/lib/components/data/readQuery/readQuery.stories.tsx +256 -0
- package/lib/components/data/readQueryHoc/README.md +89 -0
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +33 -0
- package/lib/components/data/writeQuery/README.md +178 -0
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +209 -0
- package/lib/components/design/actionSection/README.md +47 -0
- package/lib/components/design/actionSection/actionSection.stories.tsx +74 -0
- package/lib/components/design/banner/README.md +43 -0
- package/lib/components/design/banner/banner.stories.tsx +34 -0
- package/lib/components/design/bannerAction/README.md +44 -0
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +25 -0
- package/lib/components/design/blogSection/README.md +111 -0
- package/lib/components/design/blogSection/blogSection.stories.tsx +72 -0
- package/lib/components/design/carouselSection/README.md +82 -0
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +52 -0
- package/lib/components/design/designList/README.md +60 -0
- package/lib/components/design/designList/designList.stories.tsx +44 -0
- package/lib/components/design/faq/README.md +121 -0
- package/lib/components/design/faq/faq.stories.tsx +103 -0
- package/lib/components/design/fileGrid/README.md +87 -0
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +110 -0
- package/lib/components/design/fileViewer/README.md +40 -0
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +28 -0
- package/lib/components/design/footerSection/README.md +62 -0
- package/lib/components/design/footerSection/footerSection.stories.tsx +84 -0
- package/lib/components/design/googleReview/README.md +45 -0
- package/lib/components/design/googleReview/googleReview.stories.tsx +33 -0
- package/lib/components/design/heroSection/README.md +48 -0
- package/lib/components/design/heroSection/heroSection.stories.tsx +85 -0
- package/lib/components/design/iconList/README.md +60 -0
- package/lib/components/design/iconList/iconList.stories.tsx +41 -0
- package/lib/components/design/imageGallery/README.md +56 -0
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +45 -0
- package/lib/components/design/imageZoom/README.md +47 -0
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +30 -0
- package/lib/components/design/leftContent/README.md +47 -0
- package/lib/components/design/leftContent/leftContent.stories.tsx +32 -0
- package/lib/components/design/logoCloud/README.md +42 -0
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +44 -0
- package/lib/components/design/onboarding/README.md +100 -0
- package/lib/components/design/onboarding/onboarding.stories.tsx +113 -0
- package/lib/components/design/pricing/README.md +112 -0
- package/lib/components/design/pricing/pricing.stories.tsx +86 -0
- package/lib/components/design/rightContent/README.md +47 -0
- package/lib/components/design/rightContent/rightContent.stories.tsx +32 -0
- package/lib/components/design/sectionList/README.md +51 -0
- package/lib/components/design/sectionList/sectionList.stories.tsx +35 -0
- package/lib/components/design/teams/README.md +62 -0
- package/lib/components/design/teams/teams.stories.tsx +61 -0
- package/lib/components/display/alert/README.md +82 -0
- package/lib/components/display/alert/alert.stories.tsx +71 -0
- package/lib/components/display/calendar/README.md +113 -0
- package/lib/components/display/calendar/calendar.stories.tsx +159 -0
- package/lib/components/display/clipboard/README.md +36 -0
- package/lib/components/display/clipboard/clipboard.stories.tsx +32 -0
- package/lib/components/display/detailList/README.md +61 -0
- package/lib/components/display/detailList/detailList.stories.tsx +131 -0
- package/lib/components/display/drawer/README.md +74 -0
- package/lib/components/display/drawer/drawer.stories.tsx +66 -0
- package/lib/components/display/emptyState/README.md +38 -0
- package/lib/components/display/emptyState/emptyState.stories.tsx +22 -0
- package/lib/components/display/feeds/README.md +80 -0
- package/lib/components/display/feeds/feeds.stories.tsx +75 -0
- package/lib/components/display/flexTable/README.md +160 -0
- package/lib/components/display/flexTable/flexTable.stories.tsx +313 -0
- package/lib/components/display/grid/README.md +121 -0
- package/lib/components/display/grid/grid.stories.tsx +234 -0
- package/lib/components/display/kanban/README.md +78 -0
- package/lib/components/display/kanban/kanban.stories.tsx +133 -0
- package/lib/components/display/list/README.md +109 -0
- package/lib/components/display/list/list.stories.tsx +188 -0
- package/lib/components/display/loading/README.md +25 -0
- package/lib/components/display/loading/loading.stories.tsx +15 -0
- package/lib/components/display/mapView/README.md +99 -0
- package/lib/components/display/mapView/mapView.stories.tsx +225 -0
- package/lib/components/display/modal/README.md +43 -0
- package/lib/components/display/modal/modal.stories.tsx +81 -0
- package/lib/components/display/notification/README.md +43 -0
- package/lib/components/display/notification/notification.stories.tsx +30 -0
- package/lib/components/display/progress/README.md +25 -0
- package/lib/components/display/progress/progress.stories.tsx +15 -0
- package/lib/components/display/stepper/README.md +96 -0
- package/lib/components/display/stepper/stepper.stories.tsx +175 -0
- package/lib/components/display/table/README.md +176 -0
- package/lib/components/display/table/table.stories.tsx +330 -0
- package/lib/components/display/tag/README.md +74 -0
- package/lib/components/display/tag/tag.stories.tsx +79 -0
- package/lib/components/input/address/README.md +132 -0
- package/lib/components/input/address/address.stories.tsx +147 -0
- package/lib/components/input/canvas/README.md +131 -0
- package/lib/components/input/canvas/canvas.stories.tsx +165 -0
- package/lib/components/input/checkbox/README.md +61 -0
- package/lib/components/input/checkbox/checkbox.stories.tsx +30 -0
- package/lib/components/input/datePicker/README.md +124 -0
- package/lib/components/input/datePicker/datePicker.stories.tsx +197 -0
- package/lib/components/input/form/README.md +55 -0
- package/lib/components/input/form/form.stories.tsx +143 -0
- package/lib/components/input/markdown/README.md +146 -0
- package/lib/components/input/markdown/markdown.stories.tsx +40 -0
- package/lib/components/input/monthYearPicker/README.md +69 -0
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +47 -0
- package/lib/components/input/netPromoterScore/README.md +52 -0
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +30 -0
- package/lib/components/input/rating/README.md +51 -0
- package/lib/components/input/rating/rating.stories.tsx +30 -0
- package/lib/components/input/select/README.md +108 -0
- package/lib/components/input/select/select.stories.tsx +286 -0
- package/lib/components/input/signature/README.md +106 -0
- package/lib/components/input/signature/signature.stories.tsx +188 -0
- package/lib/components/input/textArea/README.md +55 -0
- package/lib/components/input/textArea/textArea.stories.tsx +30 -0
- package/lib/components/input/textInput/README.md +81 -0
- package/lib/components/input/textInput/textinput.stories.tsx +231 -0
- package/lib/components/input/uploadInput/README.md +134 -0
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +193 -0
- package/lib/components/navigation/bars/README.md +40 -0
- package/lib/components/navigation/bars/bars.stories.tsx +85 -0
- package/lib/components/navigation/bottomTab/README.md +53 -0
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +32 -0
- package/lib/components/navigation/breadcrumb/README.md +48 -0
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +27 -0
- package/lib/components/navigation/header/README.md +149 -0
- package/lib/components/navigation/header/header.stories.tsx +107 -0
- package/lib/components/navigation/leftNav/README.md +91 -0
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +106 -0
- package/lib/components/navigation/tabs/README.md +75 -0
- package/lib/components/navigation/tabs/tabs.stories.tsx +60 -0
- package/lib/components/structure/column/README.md +40 -0
- package/lib/components/structure/column/column.stories.tsx +26 -0
- package/lib/components/structure/container/README.md +34 -0
- package/lib/components/structure/container/container.stories.tsx +19 -0
- package/lib/components/structure/link/README.md +55 -0
- package/lib/components/structure/link/link.stories.tsx +30 -0
- package/lib/components/structure/text/README.md +42 -0
- package/lib/components/structure/text/text.stories.tsx +39 -0
- package/lib/components/template/authPage/authPage.stories.tsx +68 -0
- package/lib/components/template/landingPage/landingPage.stories.tsx +288 -0
- package/lib/components/template/productListing/productListing.stories.tsx +297 -0
- package/lib/components/template/productOverview/productOverview.stories.tsx +194 -0
- package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +252 -0
- package/lib/components/template/userHomePage/userHomePage.stories.tsx +605 -0
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +481 -0
- package/lib/mcp/server.d.ts +2 -0
- package/lib/mcp/server.d.ts.map +1 -0
- package/lib/mcp/server.js +33 -0
- package/lib/mcp/server.js.map +1 -0
- package/lib/mcp/tools/getBackendComponent.d.ts +13 -0
- package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -0
- package/lib/mcp/tools/getBackendComponent.js +119 -0
- package/lib/mcp/tools/getBackendComponent.js.map +1 -0
- package/lib/mcp/tools/getComponent.d.ts +17 -0
- package/lib/mcp/tools/getComponent.d.ts.map +1 -0
- package/lib/mcp/tools/getComponent.js +118 -0
- package/lib/mcp/tools/getComponent.js.map +1 -0
- package/lib/mcp/tools/listComponents.d.ts +13 -0
- package/lib/mcp/tools/listComponents.d.ts.map +1 -0
- package/lib/mcp/tools/listComponents.js +113 -0
- package/lib/mcp/tools/listComponents.js.map +1 -0
- package/lib/mcp/tools/listTemplates.d.ts +13 -0
- package/lib/mcp/tools/listTemplates.d.ts.map +1 -0
- package/lib/mcp/tools/listTemplates.js +68 -0
- package/lib/mcp/tools/listTemplates.js.map +1 -0
- package/lib/mcp/tools/suggestTemplate.d.ts +17 -0
- package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -0
- package/lib/mcp/tools/suggestTemplate.js +212 -0
- package/lib/mcp/tools/suggestTemplate.js.map +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Sign Up Template
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A two-column sign-up page layout. The left panel renders custom `leftComponents` (branding, stepper, etc.) and the right two columns render a `BareSignUp` multi-step form. All `BareSignUp` props are forwarded.
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { SignUpTemplate } from "blixify-ui-web/auth/signUp";
|
|
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
|
+
<SignUpTemplate
|
|
32
|
+
type={type}
|
|
33
|
+
stepIndex={stepIndex}
|
|
34
|
+
handleUpdateStepIndex={setStepIndex}
|
|
35
|
+
onChangeProvider={handleChangeProvider}
|
|
36
|
+
provider={["email", "phone", "google"]}
|
|
37
|
+
defaultProvider="email"
|
|
38
|
+
leftComponents={
|
|
39
|
+
<>
|
|
40
|
+
<h3 className="text-lg font-medium text-gray-700">Create Your Account</h3>
|
|
41
|
+
<Stepper steps={steps} stepIndex={stepIndex} onChange={setStepIndex} />
|
|
42
|
+
</>
|
|
43
|
+
}
|
|
44
|
+
leftClassName="bg-gray-50"
|
|
45
|
+
formList={{
|
|
46
|
+
steps: [
|
|
47
|
+
{
|
|
48
|
+
components: [
|
|
49
|
+
<TextInput
|
|
50
|
+
ref={input1}
|
|
51
|
+
id="name"
|
|
52
|
+
value=""
|
|
53
|
+
type="name"
|
|
54
|
+
label="Name"
|
|
55
|
+
placeholder="John Doe"
|
|
56
|
+
/>,
|
|
57
|
+
<TextInput
|
|
58
|
+
ref={input2}
|
|
59
|
+
id="phone"
|
|
60
|
+
value=""
|
|
61
|
+
type="mobile"
|
|
62
|
+
label="Mobile"
|
|
63
|
+
placeholder="+60123456789"
|
|
64
|
+
/>,
|
|
65
|
+
],
|
|
66
|
+
formRef: custFormRef,
|
|
67
|
+
refs: [input1, input2],
|
|
68
|
+
onHandleComponents: () => setStepIndex(1),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
components: [
|
|
72
|
+
<TextInput
|
|
73
|
+
ref={input1}
|
|
74
|
+
id="email"
|
|
75
|
+
value=""
|
|
76
|
+
type="email"
|
|
77
|
+
label="Email"
|
|
78
|
+
placeholder="Enter your email"
|
|
79
|
+
/>,
|
|
80
|
+
<TextInput
|
|
81
|
+
ref={input2}
|
|
82
|
+
id="password"
|
|
83
|
+
value=""
|
|
84
|
+
type="password"
|
|
85
|
+
label="Password"
|
|
86
|
+
placeholder="Enter your password"
|
|
87
|
+
/>,
|
|
88
|
+
],
|
|
89
|
+
formRef: custFormRef,
|
|
90
|
+
refs: [input1, input2],
|
|
91
|
+
onHandleComponents: () => {
|
|
92
|
+
/* submit */
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
}}
|
|
97
|
+
version="1.0.0"
|
|
98
|
+
/>;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
##### Required props
|
|
102
|
+
|
|
103
|
+
| Name | Type | Description |
|
|
104
|
+
| ----------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
105
|
+
| `type` | `"email" \| "phone" \| "google" \| ""` | Active provider. Empty string shows the provider selection screen |
|
|
106
|
+
| `provider` | `Array<"email" \| "phone" \| "google">` | All available sign-up providers |
|
|
107
|
+
| `stepIndex` | `number` | Index of the currently active step in `formList.steps` |
|
|
108
|
+
| `formList` | `FormList` | Multi-step form definition — see FormList below |
|
|
109
|
+
| `leftComponents` | `ReactElement` | Content rendered in the left panel. Re-render it when `stepIndex` changes to keep a stepper in sync |
|
|
110
|
+
| `handleUpdateStepIndex` | `(index: number) => void` | Called to advance or go back between steps |
|
|
111
|
+
| `onChangeProvider` | `(provider: typeof AvailableProvider \| "") => void` | Called when a provider is selected or the user returns to provider selection |
|
|
112
|
+
|
|
113
|
+
##### Optional props
|
|
114
|
+
|
|
115
|
+
| Name | Type | Default | Description |
|
|
116
|
+
| -------------------- | -------------------------- | ------- | ------------------------------------------------------------------ |
|
|
117
|
+
| `defaultProvider` | `typeof AvailableProvider` | — | Provider shown as the primary button on the selection screen |
|
|
118
|
+
| `leftClassName` | `string` | — | Tailwind classes applied to the left panel (e.g. background color) |
|
|
119
|
+
| `preventBack` | `boolean` | `false` | Hides the back button between steps |
|
|
120
|
+
| `version` | `string` | — | Version string shown at the bottom of the form |
|
|
121
|
+
| `onCompleteEachStep` | `() => void` | — | Called when a step's form is submitted successfully |
|
|
122
|
+
|
|
123
|
+
##### FormList
|
|
124
|
+
|
|
125
|
+
| Name | Type | Description |
|
|
126
|
+
| ------- | --------- | ----------------------------------------- |
|
|
127
|
+
| `steps` | `Steps[]` | Ordered list of steps in the sign-up flow |
|
|
128
|
+
|
|
129
|
+
##### Steps
|
|
130
|
+
|
|
131
|
+
| Name | Type | Description |
|
|
132
|
+
| -------------------- | --------------- | ------------------------------------------------------------------- |
|
|
133
|
+
| `components` | `JSX.Element[]` | Form field components to render for this step |
|
|
134
|
+
| `refs` | `any[]` | Refs to input components — used for validation before advancing |
|
|
135
|
+
| `formRef` | `Ref<Form>` | Ref to the `Form` wrapper — used to trigger submit programmatically |
|
|
136
|
+
| `onHandleComponents` | `() => void` | Called when the user clicks "Next" or "Submit" on this step |
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React, { useRef, useState } from "react";
|
|
3
|
+
import { SignUpTemplate } from ".";
|
|
4
|
+
import { Stepper } from "../../display/stepper";
|
|
5
|
+
import { Option, Select } from "../../input/select";
|
|
6
|
+
import { TextInput } from "../../input/textInput";
|
|
7
|
+
import { AvailableProvider } from "../bareSignIn";
|
|
8
|
+
import README from "./README.md";
|
|
9
|
+
import { StorySection } from "../../storyUtils";
|
|
10
|
+
|
|
11
|
+
const stories = storiesOf("Auth", module);
|
|
12
|
+
|
|
13
|
+
stories.addParameters({
|
|
14
|
+
readme: {
|
|
15
|
+
content: README,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const genderOptions: Option[] = [
|
|
20
|
+
{ key: "M", label: "Male" },
|
|
21
|
+
{ key: "F", label: "Female" },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const signUpSteps = [
|
|
25
|
+
{
|
|
26
|
+
title: "Profile Information",
|
|
27
|
+
description: "Help us to understand you better",
|
|
28
|
+
},
|
|
29
|
+
{ title: "Create Account", description: "Place your security credentials" },
|
|
30
|
+
{
|
|
31
|
+
title: "Verification",
|
|
32
|
+
description: "Verify your email to ensure that you are contactable",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
stories.add("Sign Up", () => {
|
|
37
|
+
const custFormRef: any = useRef(null);
|
|
38
|
+
const signUpFormRef: any = useRef(null);
|
|
39
|
+
const input1: any = useRef(null);
|
|
40
|
+
const input2: any = useRef(null);
|
|
41
|
+
|
|
42
|
+
const [signUpType, setSignUpType] =
|
|
43
|
+
useState<typeof AvailableProvider | "">("");
|
|
44
|
+
const [stepIndex, setStepIndex] = useState(0);
|
|
45
|
+
|
|
46
|
+
const handleChangeProvider = (provider: typeof AvailableProvider | "") => {
|
|
47
|
+
setSignUpType(provider);
|
|
48
|
+
setStepIndex(0);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
leftComponents re-renders on each stepIndex change so the Stepper
|
|
53
|
+
reflects the current step. Pass it as a prop (not a render function)
|
|
54
|
+
so SignUpTemplate receives the updated element.
|
|
55
|
+
*/
|
|
56
|
+
const leftComponents = (
|
|
57
|
+
<>
|
|
58
|
+
<h3 className="text-lg font-medium text-gray-700">Create Your Account</h3>
|
|
59
|
+
<Stepper
|
|
60
|
+
steps={signUpSteps}
|
|
61
|
+
disabled={true}
|
|
62
|
+
className="mt-5"
|
|
63
|
+
stepIndex={stepIndex}
|
|
64
|
+
onChange={setStepIndex}
|
|
65
|
+
/>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const formList = {
|
|
70
|
+
steps: [
|
|
71
|
+
{
|
|
72
|
+
components: [
|
|
73
|
+
<TextInput
|
|
74
|
+
ref={input1}
|
|
75
|
+
id="name"
|
|
76
|
+
value=""
|
|
77
|
+
type="name"
|
|
78
|
+
label="Name"
|
|
79
|
+
placeholder="John Doe"
|
|
80
|
+
/>,
|
|
81
|
+
<TextInput
|
|
82
|
+
ref={input2}
|
|
83
|
+
id="phoneNumber"
|
|
84
|
+
value=""
|
|
85
|
+
type="mobile"
|
|
86
|
+
label="Mobile"
|
|
87
|
+
placeholder="+60123456789"
|
|
88
|
+
/>,
|
|
89
|
+
<Select
|
|
90
|
+
value="M"
|
|
91
|
+
label="Gender"
|
|
92
|
+
options={genderOptions}
|
|
93
|
+
onChange={() => {}}
|
|
94
|
+
/>,
|
|
95
|
+
<div className="text-sm sm:col-span-2">
|
|
96
|
+
By signing up, you agree to our terms & condition, privacy & policy
|
|
97
|
+
</div>,
|
|
98
|
+
],
|
|
99
|
+
formRef: custFormRef,
|
|
100
|
+
refs: [input1, input2],
|
|
101
|
+
onHandleComponents: () => setStepIndex(1),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
components: [
|
|
105
|
+
<TextInput
|
|
106
|
+
ref={input1}
|
|
107
|
+
id="email"
|
|
108
|
+
value=""
|
|
109
|
+
type="email"
|
|
110
|
+
label="Email"
|
|
111
|
+
placeholder="Enter your email"
|
|
112
|
+
/>,
|
|
113
|
+
<TextInput
|
|
114
|
+
ref={input2}
|
|
115
|
+
id="password"
|
|
116
|
+
value=""
|
|
117
|
+
type="password"
|
|
118
|
+
label="Password"
|
|
119
|
+
placeholder="Enter your password"
|
|
120
|
+
/>,
|
|
121
|
+
],
|
|
122
|
+
formRef: signUpFormRef,
|
|
123
|
+
refs: [input1, input2],
|
|
124
|
+
onHandleComponents: () => {},
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<div className="font-sans max-w-4xl p-6">
|
|
131
|
+
<StorySection
|
|
132
|
+
title="Default Layout"
|
|
133
|
+
description={
|
|
134
|
+
<>
|
|
135
|
+
Two-column layout: <code>leftComponents</code> fills the left panel,{" "}
|
|
136
|
+
<code>BareSignUp</code> fills the right two columns. The left panel
|
|
137
|
+
is ideal for branding or a progress stepper that reflects{" "}
|
|
138
|
+
<code>stepIndex</code>. Use <code>leftClassName</code> to style the
|
|
139
|
+
panel background.
|
|
140
|
+
</>
|
|
141
|
+
}
|
|
142
|
+
>
|
|
143
|
+
<div className="w-full bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden">
|
|
144
|
+
<SignUpTemplate
|
|
145
|
+
type={signUpType}
|
|
146
|
+
stepIndex={stepIndex}
|
|
147
|
+
leftComponents={leftComponents}
|
|
148
|
+
leftClassName="bg-gray-50"
|
|
149
|
+
handleUpdateStepIndex={setStepIndex}
|
|
150
|
+
onChangeProvider={handleChangeProvider}
|
|
151
|
+
provider={["email", "phone", "google"]}
|
|
152
|
+
defaultProvider="email"
|
|
153
|
+
formList={formList}
|
|
154
|
+
version="0.0.1"
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
</StorySection>
|
|
158
|
+
|
|
159
|
+
<StorySection
|
|
160
|
+
title="Colored Left Panel"
|
|
161
|
+
description={
|
|
162
|
+
<>
|
|
163
|
+
Pass a branded background via <code>leftClassName</code>. The left
|
|
164
|
+
panel content can be anything — here it shows a simple welcome
|
|
165
|
+
message.
|
|
166
|
+
</>
|
|
167
|
+
}
|
|
168
|
+
>
|
|
169
|
+
<div className="w-full rounded-lg shadow-sm border border-gray-100 overflow-hidden">
|
|
170
|
+
<SignUpTemplate
|
|
171
|
+
type={signUpType}
|
|
172
|
+
stepIndex={stepIndex}
|
|
173
|
+
leftComponents={
|
|
174
|
+
<div className="text-white">
|
|
175
|
+
<h3 className="text-lg font-medium">Join us today</h3>
|
|
176
|
+
<p className="mt-4 text-sm opacity-80">
|
|
177
|
+
Create your account to get started.
|
|
178
|
+
</p>
|
|
179
|
+
</div>
|
|
180
|
+
}
|
|
181
|
+
leftClassName="bg-primary-700"
|
|
182
|
+
handleUpdateStepIndex={setStepIndex}
|
|
183
|
+
onChangeProvider={handleChangeProvider}
|
|
184
|
+
provider={["email", "google"]}
|
|
185
|
+
defaultProvider="email"
|
|
186
|
+
formList={formList}
|
|
187
|
+
version="0.0.1"
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
</StorySection>
|
|
191
|
+
</div>
|
|
192
|
+
);
|
|
193
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
##### Chart Utils props
|
|
2
|
+
|
|
3
|
+
| Name | Type | Default | Description |
|
|
4
|
+
| ------------------ | ----------------- | ------- | ------------------------ |
|
|
5
|
+
| `containerStyle` | `string` | "" | |
|
|
6
|
+
| `chartOnly` | `boolean ` | `false` | |
|
|
7
|
+
| `chartSize` | `number` | "" | |
|
|
8
|
+
| `tool` | `React Element` | "" | |
|
|
9
|
+
| `customDate` | `Range Interface` | | |
|
|
10
|
+
| `dateRangeVisible` | `boolean` | `false` | |
|
|
11
|
+
| `onChangeDate` | `function` | | Handle Change Chart Data |
|
|
12
|
+
| `colours` | `string[]` | `false` | Colours of Chart |
|
|
13
|
+
| `hideGradient` | `true` | `false` | Enable Gradient |
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Area Chart
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
An area chart for displaying trends over time. Supports single series, stacked multi-series, dark mode, gradient fill, and an optional date range picker.
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { AreaChart } from "blixify-ui-web/chart/areaChart";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
Single series:
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
const [seriesData, setSeriesData] = useState([]);
|
|
21
|
+
|
|
22
|
+
<AreaChart
|
|
23
|
+
title="Sales"
|
|
24
|
+
seriesName="Value"
|
|
25
|
+
seriesData={seriesData}
|
|
26
|
+
dateRangeVisible={true}
|
|
27
|
+
customDate={{ startDate, endDate, isDuration: true }}
|
|
28
|
+
onChangeDate={(range) => setSeriesData(filterData(range))}
|
|
29
|
+
/>;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Stacked multi-series:
|
|
33
|
+
|
|
34
|
+
```jsx
|
|
35
|
+
<AreaChart
|
|
36
|
+
title="Sales by Region"
|
|
37
|
+
categories={["Jan", "Feb", "Mar", "Apr"]}
|
|
38
|
+
stackedAreaSeries={[
|
|
39
|
+
{ name: "North", data: [430, 460, 478, 500] },
|
|
40
|
+
{ name: "South", data: [400, 430, 448, 470] },
|
|
41
|
+
]}
|
|
42
|
+
dateRangeVisible={true}
|
|
43
|
+
customDate={{ startDate, endDate, isDuration: true }}
|
|
44
|
+
onChangeDate={handleSetData}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Dark mode with gradient:
|
|
49
|
+
|
|
50
|
+
```jsx
|
|
51
|
+
<AreaChart
|
|
52
|
+
title="Sales"
|
|
53
|
+
categories={categories}
|
|
54
|
+
stackedAreaSeries={stackedAreaSeries}
|
|
55
|
+
darkMode={true}
|
|
56
|
+
darkModeBg="bg-gradient-to-r from-slate-700 to-gray-900"
|
|
57
|
+
enableGradient={true}
|
|
58
|
+
borderColor=""
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Chart only (no header or date range):
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
<AreaChart
|
|
66
|
+
title="Sales"
|
|
67
|
+
seriesData={seriesData}
|
|
68
|
+
chartOnly={true}
|
|
69
|
+
chartSize={200}
|
|
70
|
+
containerStyle="w-full"
|
|
71
|
+
/>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
##### Required props
|
|
75
|
+
|
|
76
|
+
| Name | Type | Description |
|
|
77
|
+
| ------- | -------- | -------------------------------------------------------------------------------- |
|
|
78
|
+
| `title` | `string` | Title shown in the chart header (also used as link text when `newTabUrl` is set) |
|
|
79
|
+
|
|
80
|
+
##### Chart props
|
|
81
|
+
|
|
82
|
+
| Name | Type | Default | Description |
|
|
83
|
+
| ------------------- | ------------------------------------------- | ----------- | ------------------------------------------------------------------------ |
|
|
84
|
+
| `seriesData` | `SeriesData[]` | `[]` | Data points for a single series — array of `{ x: string, y: number }` |
|
|
85
|
+
| `seriesName` | `string` | `""` | Label shown in the tooltip for single-series mode |
|
|
86
|
+
| `stackedAreaSeries` | `SeriesItem[]` | `[]` | Data for stacked multi-series mode — array of `{ name, data: number[] }` |
|
|
87
|
+
| `categories` | `string[]` | `[]` | X-axis category labels, required when using `stackedAreaSeries` |
|
|
88
|
+
| `showDataLabel` | `boolean` | `false` | Show value labels on each data point |
|
|
89
|
+
| `showToolbar` | `boolean` | `false` | Show the ApexCharts toolbar (download, zoom, etc.) |
|
|
90
|
+
| `enableGradient` | `boolean` | `false` | Fill the area with a gradient instead of a solid colour |
|
|
91
|
+
| `borderColor` | `string` | `"#e7e7e7"` | Grid line colour. Pass `""` to remove grid lines |
|
|
92
|
+
| `onClick` | `(category: string, value: string) => void` | — | Called when a data point is clicked |
|
|
93
|
+
| `newTabUrl` | `string` | `""` | Makes the chart title a link. Opens in a new tab |
|
|
94
|
+
|
|
95
|
+
##### ChartUtils props (shared across all chart components)
|
|
96
|
+
|
|
97
|
+
| Name | Type | Default | Description |
|
|
98
|
+
| ------------------ | --------------------------------------- | --------------- | ---------------------------------------------------------------------------------------- |
|
|
99
|
+
| `tool` | `ReactElement` | — | Icon or element rendered in the top-right of the chart header |
|
|
100
|
+
| `dateRangeVisible` | `boolean` | `false` | Shows a date range picker below the chart |
|
|
101
|
+
| `customDate` | `RangeInterface` | — | Initial date range for the picker |
|
|
102
|
+
| `onChangeDate` | `(customDate?: RangeInterface) => void` | — | Called when the user applies a new date range |
|
|
103
|
+
| `colors` | `string[]` | — | Custom hex colour array for the series. Falls back to `localChartColors` in localStorage |
|
|
104
|
+
| `darkMode` | `boolean` | `false` | Switches the chart to a dark theme |
|
|
105
|
+
| `darkModeBg` | `string` | `"bg-gray-900"` | Tailwind classes for the dark mode background |
|
|
106
|
+
| `chartOnly` | `boolean` | `false` | Renders only the chart canvas — no title, tool, or date range bar |
|
|
107
|
+
| `chartSize` | `number` | `280` | Chart height in pixels |
|
|
108
|
+
| `containerStyle` | `string` | — | Tailwind classes applied to the outer container |
|
|
109
|
+
| `minInterval` | `number` | `60` | Time picker interval in minutes (used in the date range modal) |
|
|
110
|
+
|
|
111
|
+
##### SeriesData
|
|
112
|
+
|
|
113
|
+
| Name | Type | Description |
|
|
114
|
+
| ---- | -------- | -------------------- |
|
|
115
|
+
| `x` | `string` | Category / label |
|
|
116
|
+
| `y` | `number` | Value for this point |
|
|
117
|
+
|
|
118
|
+
##### SeriesItem (stacked)
|
|
119
|
+
|
|
120
|
+
| Name | Type | Description |
|
|
121
|
+
| ------ | ---------- | ------------------------------- |
|
|
122
|
+
| `name` | `string` | Series name shown in the legend |
|
|
123
|
+
| `data` | `number[]` | Values aligned to `categories` |
|
|
124
|
+
|
|
125
|
+
##### RangeInterface
|
|
126
|
+
|
|
127
|
+
| Name | Type | Description |
|
|
128
|
+
| ------------ | --------- | -------------------------------------------------------- |
|
|
129
|
+
| `startDate` | `Date` | Start of the range |
|
|
130
|
+
| `endDate` | `Date` | End of the range |
|
|
131
|
+
| `isDuration` | `boolean` | `true` = date range, `false` = "beginning until endDate" |
|
|
132
|
+
| `startTime` | `string` | Optional time string `"HH:mm:ss"` for same-day ranges |
|
|
133
|
+
| `endTime` | `string` | Optional time string `"HH:mm:ss"` for same-day ranges |
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { PencilIcon } from "@heroicons/react/24/outline";
|
|
2
|
+
import { storiesOf } from "@storybook/react";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { AreaChart } from ".";
|
|
6
|
+
import { RangeInterface } from "../DateRange";
|
|
7
|
+
import README from "./README.md";
|
|
8
|
+
import { StorySection } from "../../storyUtils";
|
|
9
|
+
|
|
10
|
+
const stories = storiesOf("Chart", module);
|
|
11
|
+
|
|
12
|
+
stories.addParameters({
|
|
13
|
+
readme: {
|
|
14
|
+
content: README,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const stackedAreaSeries = [
|
|
19
|
+
{
|
|
20
|
+
name: "South",
|
|
21
|
+
data: [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "North",
|
|
25
|
+
data: [430, 460, 478, 500, 570, 610, 720, 1130, 1230, 1410],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "Central",
|
|
29
|
+
data: [448, 470, 490, 520, 590, 630, 740, 1150, 1250, 1430],
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const categories = [
|
|
34
|
+
"Jan",
|
|
35
|
+
"Feb",
|
|
36
|
+
"Mar",
|
|
37
|
+
"Apr",
|
|
38
|
+
"May",
|
|
39
|
+
"Jun",
|
|
40
|
+
"Jul",
|
|
41
|
+
"Aug",
|
|
42
|
+
"Sep",
|
|
43
|
+
"Oct",
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const rawData = [
|
|
47
|
+
{ label: "Apple", value: 10, daysAgo: 7 },
|
|
48
|
+
{ label: "Mango", value: 20, daysAgo: 7 },
|
|
49
|
+
{ label: "Orange", value: 5, daysAgo: 1 },
|
|
50
|
+
{ label: "Watermelon", value: 15, daysAgo: 1 },
|
|
51
|
+
{ label: "Banana", value: 55, daysAgo: 28 },
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
stories.add("Area Chart", () => {
|
|
55
|
+
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
56
|
+
|
|
57
|
+
const chartDummyData = useMemo(() => {
|
|
58
|
+
const today = new Date();
|
|
59
|
+
return rawData.map((d) => {
|
|
60
|
+
const date = new Date();
|
|
61
|
+
date.setDate(today.getDate() - d.daysAgo);
|
|
62
|
+
return { label: d.label, value: d.value, createdAt: date };
|
|
63
|
+
});
|
|
64
|
+
}, []);
|
|
65
|
+
|
|
66
|
+
const handleSetData = useCallback(
|
|
67
|
+
(customDate?: RangeInterface) => {
|
|
68
|
+
const points = chartDummyData
|
|
69
|
+
.filter((d) => {
|
|
70
|
+
if (!customDate) return true;
|
|
71
|
+
if (customDate.isDuration)
|
|
72
|
+
return (
|
|
73
|
+
d.createdAt >= customDate.startDate &&
|
|
74
|
+
d.createdAt <= customDate.endDate
|
|
75
|
+
);
|
|
76
|
+
return customDate.endDate ? d.createdAt <= customDate.endDate : true;
|
|
77
|
+
})
|
|
78
|
+
.map((d) => ({ x: d.label, y: d.value }));
|
|
79
|
+
setSeriesData(points);
|
|
80
|
+
},
|
|
81
|
+
[chartDummyData]
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
handleSetData();
|
|
86
|
+
}, [handleSetData]);
|
|
87
|
+
|
|
88
|
+
const sevenDaysAgo = new Date();
|
|
89
|
+
sevenDaysAgo.setDate(moment().toDate().getDate() - 7);
|
|
90
|
+
|
|
91
|
+
const defaultDateRange: RangeInterface = {
|
|
92
|
+
startDate: sevenDaysAgo,
|
|
93
|
+
endDate: moment().toDate(),
|
|
94
|
+
isDuration: true,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<div className="font-sans max-w-3xl p-6">
|
|
99
|
+
<StorySection
|
|
100
|
+
title="Single Series"
|
|
101
|
+
description={
|
|
102
|
+
<>
|
|
103
|
+
Basic area chart using <code>seriesData</code> (array of{" "}
|
|
104
|
+
<code>{ x: string, y: number }</code>). Pass{" "}
|
|
105
|
+
<code>seriesName</code> to label the tooltip. Use <code>tool</code>{" "}
|
|
106
|
+
to render an action icon in the header, and <code>newTabUrl</code>{" "}
|
|
107
|
+
to make the title a link.
|
|
108
|
+
</>
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
<AreaChart
|
|
112
|
+
title="Sales"
|
|
113
|
+
seriesName="Value"
|
|
114
|
+
seriesData={seriesData}
|
|
115
|
+
tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
|
|
116
|
+
dateRangeVisible={true}
|
|
117
|
+
customDate={defaultDateRange}
|
|
118
|
+
onChangeDate={handleSetData}
|
|
119
|
+
showDataLabel={false}
|
|
120
|
+
newTabUrl="https://www.google.com/"
|
|
121
|
+
/>
|
|
122
|
+
</StorySection>
|
|
123
|
+
|
|
124
|
+
<StorySection
|
|
125
|
+
title="Stacked Area Chart"
|
|
126
|
+
description={
|
|
127
|
+
<>
|
|
128
|
+
Use <code>stackedAreaSeries</code> (array of{" "}
|
|
129
|
+
<code>{ name: string, data: number[] }</code>) together
|
|
130
|
+
with <code>categories</code> for the x-axis labels. Multiple series
|
|
131
|
+
are stacked automatically.
|
|
132
|
+
</>
|
|
133
|
+
}
|
|
134
|
+
>
|
|
135
|
+
<AreaChart
|
|
136
|
+
title="Sales by Region"
|
|
137
|
+
categories={categories}
|
|
138
|
+
stackedAreaSeries={stackedAreaSeries}
|
|
139
|
+
tool={<PencilIcon className="h-4 w-4 text-primary-600" />}
|
|
140
|
+
dateRangeVisible={true}
|
|
141
|
+
customDate={defaultDateRange}
|
|
142
|
+
onChangeDate={handleSetData}
|
|
143
|
+
showDataLabel={false}
|
|
144
|
+
/>
|
|
145
|
+
</StorySection>
|
|
146
|
+
|
|
147
|
+
<StorySection
|
|
148
|
+
title="Dark Mode with Gradient"
|
|
149
|
+
description={
|
|
150
|
+
<>
|
|
151
|
+
Set <code>darkMode={true}</code> to switch to a dark
|
|
152
|
+
theme. Use <code>darkModeBg</code> to customise the background
|
|
153
|
+
(accepts Tailwind classes).
|
|
154
|
+
<code>enableGradient={true}</code> fills the area with a
|
|
155
|
+
gradient instead of a solid colour. Pass <code>borderColor=""</code>{" "}
|
|
156
|
+
to remove the grid border lines.
|
|
157
|
+
</>
|
|
158
|
+
}
|
|
159
|
+
dark
|
|
160
|
+
>
|
|
161
|
+
<AreaChart
|
|
162
|
+
title="Sales by Region"
|
|
163
|
+
categories={categories}
|
|
164
|
+
stackedAreaSeries={stackedAreaSeries}
|
|
165
|
+
tool={<PencilIcon className="h-4 w-4 text-white" />}
|
|
166
|
+
dateRangeVisible={true}
|
|
167
|
+
customDate={defaultDateRange}
|
|
168
|
+
onChangeDate={handleSetData}
|
|
169
|
+
showDataLabel={false}
|
|
170
|
+
darkMode={true}
|
|
171
|
+
darkModeBg="bg-gradient-to-r from-slate-700 to-gray-900"
|
|
172
|
+
borderColor=""
|
|
173
|
+
enableGradient={true}
|
|
174
|
+
/>
|
|
175
|
+
</StorySection>
|
|
176
|
+
|
|
177
|
+
<StorySection
|
|
178
|
+
title="Chart Only (no container)"
|
|
179
|
+
description={
|
|
180
|
+
<>
|
|
181
|
+
Set <code>chartOnly={true}</code> to render just the
|
|
182
|
+
ApexCharts canvas without the title, tool, or date range bar. Use{" "}
|
|
183
|
+
<code>containerStyle</code> to apply Tailwind classes to the wrapper
|
|
184
|
+
and <code>chartSize</code> to set the height in pixels.
|
|
185
|
+
</>
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
<AreaChart
|
|
189
|
+
title="Sales"
|
|
190
|
+
seriesName="Value"
|
|
191
|
+
seriesData={seriesData}
|
|
192
|
+
chartOnly={true}
|
|
193
|
+
chartSize={200}
|
|
194
|
+
containerStyle="w-full"
|
|
195
|
+
/>
|
|
196
|
+
</StorySection>
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
});
|