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,71 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Alert } from ".";
|
|
4
|
+
import {
|
|
5
|
+
BoltIcon,
|
|
6
|
+
CheckCircleIcon,
|
|
7
|
+
CurrencyDollarIcon,
|
|
8
|
+
} from "@heroicons/react/20/solid";
|
|
9
|
+
import README from "./README.md";
|
|
10
|
+
|
|
11
|
+
const stories = storiesOf("Display", module);
|
|
12
|
+
|
|
13
|
+
stories.addParameters({
|
|
14
|
+
readme: {
|
|
15
|
+
content: README,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
stories.add("Alert", () => {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Alert
|
|
23
|
+
title="Order completed"
|
|
24
|
+
desc="Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam."
|
|
25
|
+
icon={<BoltIcon className="size-5 text-purple-500" />}
|
|
26
|
+
actionBtns={[
|
|
27
|
+
{ text: "View status", onClick: () => {} },
|
|
28
|
+
{ text: "Dismiss", onClick: () => {} },
|
|
29
|
+
]}
|
|
30
|
+
color="purple"
|
|
31
|
+
/>
|
|
32
|
+
<div className="mt-4 p-6 bg-black">
|
|
33
|
+
<Alert
|
|
34
|
+
title="Order completed"
|
|
35
|
+
desc="Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam."
|
|
36
|
+
icon={<CheckCircleIcon className="size-5 text-green-500" />}
|
|
37
|
+
actionBtns={[
|
|
38
|
+
{ text: "View status", onClick: () => {} },
|
|
39
|
+
{ text: "Dismiss", onClick: () => {} },
|
|
40
|
+
]}
|
|
41
|
+
color="dark"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<Alert
|
|
45
|
+
title="Order completed"
|
|
46
|
+
desc="Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam."
|
|
47
|
+
icon={<CurrencyDollarIcon className="size-5 text-green-500" />}
|
|
48
|
+
actionBtns={[
|
|
49
|
+
{ text: "View status", onClick: () => {} },
|
|
50
|
+
{ text: "Dismiss", onClick: () => {} },
|
|
51
|
+
]}
|
|
52
|
+
color="green"
|
|
53
|
+
className="mt-4"
|
|
54
|
+
addContent={
|
|
55
|
+
<div>
|
|
56
|
+
<p>Additional Content</p>
|
|
57
|
+
<ul className="list-disc list-inside">
|
|
58
|
+
<li>Item 1</li>
|
|
59
|
+
<li>Item 2</li>
|
|
60
|
+
</ul>
|
|
61
|
+
<img
|
|
62
|
+
src="https://plus.unsplash.com/premium_photo-1722593856418-05d6d47eec59?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=1170"
|
|
63
|
+
alt=""
|
|
64
|
+
className="h-32 w-48 rounded-lg overflow-hidden"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Calendar
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A full-featured calendar built on FullCalendar. Supports month, week, day, and list views with responsive layout, public holidays via Google Calendar API, custom event rendering, and a configurable toolbar.
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { Calendar } from "blixify-ui-web/display/calendar";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
Basic month view with date picker:
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
const [currentDate, setCurrentDate] = useState(new Date());
|
|
21
|
+
|
|
22
|
+
<InputDatePicker
|
|
23
|
+
value={currentDate}
|
|
24
|
+
onChange={(_id, value) => { if (value) setCurrentDate(value); }}
|
|
25
|
+
/>
|
|
26
|
+
<Calendar
|
|
27
|
+
calendarView="dayGridMonth"
|
|
28
|
+
currentDate={currentDate}
|
|
29
|
+
dayMaxEvents={5}
|
|
30
|
+
handleMonthChange={setCurrentDate}
|
|
31
|
+
renderEventAvailabilities={() => [
|
|
32
|
+
{ id: "1", title: "Team Sync", start: new Date() },
|
|
33
|
+
{ id: "2", title: "Sprint Review", start: new Date(), end: moment().add(2, "days").toDate() },
|
|
34
|
+
]}
|
|
35
|
+
lib={{ moment }}
|
|
36
|
+
height="700px"
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Custom header title (week view):
|
|
41
|
+
|
|
42
|
+
```jsx
|
|
43
|
+
<Calendar
|
|
44
|
+
calendarView="timeGridWeek"
|
|
45
|
+
currentDate={currentDate}
|
|
46
|
+
renderEventAvailabilities={getEvents}
|
|
47
|
+
lib={{ moment }}
|
|
48
|
+
customHeaderFn={(dateInfo) => {
|
|
49
|
+
const start = moment(dateInfo.start.marker).format("DD/MM/YYYY");
|
|
50
|
+
const end = moment(dateInfo.end.marker).format("DD/MM/YYYY");
|
|
51
|
+
return `${start} - ${end}`;
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
##### Required props
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description |
|
|
59
|
+
| --------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------ |
|
|
60
|
+
| `calendarView` | `"dayGridMonth" \| "timeGridWeek" \| "timeGridDay" \| "listMonth"` | Initial calendar view |
|
|
61
|
+
| `renderEventAvailabilities` | `() => EventAvailability[]` | Returns the list of events to render |
|
|
62
|
+
| `lib` | `{ moment: typeof moment }` | Pass the moment library — required for date navigation |
|
|
63
|
+
|
|
64
|
+
##### Optional props
|
|
65
|
+
|
|
66
|
+
| Name | Type | Default | Description |
|
|
67
|
+
| ------------------------ | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `currentDate` | `Date` | `moment().toDate()` | Controls the displayed date. Update this via `handleMonthChange` to navigate |
|
|
69
|
+
| `height` | `string` | `550` | Calendar height, e.g. `"700px"` or `"100%"`. On mobile, overridden to `"85vh"` |
|
|
70
|
+
| `dayMaxEvents` | `boolean \| number` | `3` | Max events shown per day cell. `true` = auto-hide overflow, `false` = show all |
|
|
71
|
+
| `dayCellMinHeight` | `number` | — | Minimum height in px for each day cell |
|
|
72
|
+
| `firstDay` | `number` | `1` | First day of the week. `0` = Sunday, `1` = Monday |
|
|
73
|
+
| `headerToolbar` | `ToolbarOptions` | `{ left: "backward,current,forward", center: "title", right: "monthView,weekView,dayView,listView" }` | Override the header toolbar buttons |
|
|
74
|
+
| `footerToolbar` | `ToolbarOptions` | — | Override the footer toolbar buttons |
|
|
75
|
+
| `customButtons` | `{ [key: string]: any }` | — | Override the built-in custom button definitions |
|
|
76
|
+
| `customView` | `CalendarCustomView` | — | Set a multi-week span for week view. `view: "week"`, `duration: 1–4` |
|
|
77
|
+
| `enableCustomViewSelect` | `boolean` | — | Adds a "Custom" toolbar button that opens a modal for users to set their own week duration |
|
|
78
|
+
| `customHeaderFn` | `(dateInfo: any) => string` | — | Override the toolbar title string. Receives `{ start: { marker: Date }, end: { marker: Date } }` |
|
|
79
|
+
| `customPlugin` | `FullCalendar plugin` | — | Replace the default plugins with a custom FullCalendar plugin. See [FullCalendar docs](https://fullcalendar.io/docs/react#custom-views-with-components) |
|
|
80
|
+
| `publicHolidays` | `{ enable: boolean, key: string, country?: string }` | — | Fetch public holidays from Google Calendar API. `key` = Google Cloud Calendar API key. `country` = region code (e.g. `"malaysia"`). See [country codes](https://gist.github.com/dhoeric/76bd1c15168ee0ee61ad3bf1730dcb65) |
|
|
81
|
+
| `onClickEvent` | `(id?: string) => void` | — | Called with the event id when a calendar event is clicked |
|
|
82
|
+
| `handleMonthChange` | `(date: Date) => void` | — | Called with the new date when the user navigates |
|
|
83
|
+
| `handleViewChange` | `(view: string) => void` | — | Called with the current view type when the view changes |
|
|
84
|
+
| `handleCalendarResize` | `(ref: React.RefObject<any>, isMobileWidth: boolean) => void` | — | Override the default responsive resize behaviour. Receives the calendar ref and a mobile breakpoint flag |
|
|
85
|
+
|
|
86
|
+
##### EventAvailability
|
|
87
|
+
|
|
88
|
+
| Name | Type | Required | Description |
|
|
89
|
+
| ------------ | -------- | -------- | ---------------------------------------------------------------------- |
|
|
90
|
+
| `id` | `string` | no | Unique event id (returned by `onClickEvent`) |
|
|
91
|
+
| `title` | `string` | yes | Event label shown in the calendar |
|
|
92
|
+
| `start` | `Date` | no | Event start date/time. Falls back to `date` if omitted |
|
|
93
|
+
| `end` | `Date` | no | Event end date/time. If `end` is before `start`, it is ignored |
|
|
94
|
+
| `bgColor` | `string` | no | Tailwind bg class for the event pill, e.g. `"bg-primary-500"` |
|
|
95
|
+
| `hoverColor` | `string` | no | Tailwind hover class for the event pill, e.g. `"hover:bg-primary-700"` |
|
|
96
|
+
| `textColor` | `string` | no | Tailwind text class for the event pill, e.g. `"text-white"` |
|
|
97
|
+
|
|
98
|
+
##### ToolbarOptions
|
|
99
|
+
|
|
100
|
+
| Name | Type | Description |
|
|
101
|
+
| -------------- | -------- | ---------------------------------------------- |
|
|
102
|
+
| `left`/`start` | `string` | Comma-separated button keys for the left side |
|
|
103
|
+
| `center` | `string` | Comma-separated button keys for the center |
|
|
104
|
+
| `right`/`end` | `string` | Comma-separated button keys for the right side |
|
|
105
|
+
|
|
106
|
+
Built-in custom button keys: `backward`, `forward`, `current`, `monthView`, `weekView`, `dayView`, `listView`, `customView` (when `enableCustomViewSelect` is true).
|
|
107
|
+
|
|
108
|
+
##### CalendarCustomView
|
|
109
|
+
|
|
110
|
+
| Name | Type | Description |
|
|
111
|
+
| ---------- | -------- | -------------------------------- |
|
|
112
|
+
| `view` | `"week"` | Only `"week"` is supported |
|
|
113
|
+
| `duration` | `number` | Number of weeks to display (1–4) |
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { Calendar } from ".";
|
|
5
|
+
import { StorySection } from "../../storyUtils";
|
|
6
|
+
import { InputDatePicker } from "../../input/datePicker";
|
|
7
|
+
import README from "./README.md";
|
|
8
|
+
|
|
9
|
+
const stories = storiesOf("Display", module);
|
|
10
|
+
|
|
11
|
+
stories.addParameters({
|
|
12
|
+
readme: {
|
|
13
|
+
content: README,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const sampleEvents = () => [
|
|
18
|
+
{
|
|
19
|
+
id: "1",
|
|
20
|
+
title: "Blixify Gantt Chart Updates",
|
|
21
|
+
start: moment("2024/05/06 09:30", "YYYY/MM/DD HH:mm").toDate(),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "2",
|
|
25
|
+
title: "Verdant Summarize Updates",
|
|
26
|
+
start: moment("2024/05/08 13:10", "YYYY/MM/DD HH:mm").toDate(),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "3",
|
|
30
|
+
title: "Tech Daily Sync",
|
|
31
|
+
start: moment("2024/05/08 09:30", "YYYY/MM/DD HH:mm").toDate(),
|
|
32
|
+
end: moment("2024/05/08 10:30", "YYYY/MM/DD HH:mm").toDate(),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "4",
|
|
36
|
+
title: "Blixify UI Update Sync",
|
|
37
|
+
start: moment().toDate(),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "5",
|
|
41
|
+
title: "Blood Donation Campaign",
|
|
42
|
+
start: moment().toDate(),
|
|
43
|
+
end: moment().add(2, "days").toDate(),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "6",
|
|
47
|
+
title: "Sprint Review",
|
|
48
|
+
start: moment().toDate(),
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
stories.add("Calendar", () => {
|
|
53
|
+
const [currentDate, setCurrentDate] = useState<Date>(new Date());
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<StorySection
|
|
58
|
+
title="Default (Month View)"
|
|
59
|
+
description="Default calendar in dayGridMonth view. Pass currentDate to control the displayed month. Use an InputDatePicker to let users jump to a specific date."
|
|
60
|
+
>
|
|
61
|
+
<div className="w-full">
|
|
62
|
+
<InputDatePicker
|
|
63
|
+
value={currentDate}
|
|
64
|
+
onChange={(_id, value) => {
|
|
65
|
+
if (value) setCurrentDate(value);
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
<div className="mt-4">
|
|
69
|
+
<Calendar
|
|
70
|
+
calendarView="dayGridMonth"
|
|
71
|
+
currentDate={currentDate}
|
|
72
|
+
dayMaxEvents={5}
|
|
73
|
+
handleMonthChange={setCurrentDate}
|
|
74
|
+
renderEventAvailabilities={sampleEvents}
|
|
75
|
+
lib={{ moment }}
|
|
76
|
+
height="700px"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</StorySection>
|
|
81
|
+
|
|
82
|
+
<StorySection
|
|
83
|
+
title="Public Holidays"
|
|
84
|
+
description="Pass publicHolidays with a Google Calendar API key to fetch and overlay public holidays. Set country to a region code (e.g. 'malaysia'). Leave key empty to disable fetching."
|
|
85
|
+
>
|
|
86
|
+
<div className="w-full">
|
|
87
|
+
<Calendar
|
|
88
|
+
calendarView="dayGridMonth"
|
|
89
|
+
currentDate={new Date()}
|
|
90
|
+
dayMaxEvents={5}
|
|
91
|
+
handleMonthChange={() => {}}
|
|
92
|
+
renderEventAvailabilities={sampleEvents}
|
|
93
|
+
lib={{ moment }}
|
|
94
|
+
height="700px"
|
|
95
|
+
publicHolidays={{ enable: true, key: "", country: "malaysia" }}
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
</StorySection>
|
|
99
|
+
|
|
100
|
+
<StorySection
|
|
101
|
+
title="Custom View (2-Week)"
|
|
102
|
+
description="Pass customView with view='week' and a duration (1–4) to set a multi-week span. enableCustomViewSelect adds a 'Custom' button to the toolbar so users can change the duration themselves."
|
|
103
|
+
>
|
|
104
|
+
<div className="w-full">
|
|
105
|
+
<Calendar
|
|
106
|
+
calendarView="timeGridWeek"
|
|
107
|
+
currentDate={new Date()}
|
|
108
|
+
dayMaxEvents={3}
|
|
109
|
+
handleMonthChange={() => {}}
|
|
110
|
+
renderEventAvailabilities={sampleEvents}
|
|
111
|
+
lib={{ moment }}
|
|
112
|
+
height="700px"
|
|
113
|
+
customView={{ view: "week", duration: 2 }}
|
|
114
|
+
enableCustomViewSelect
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</StorySection>
|
|
118
|
+
|
|
119
|
+
<StorySection
|
|
120
|
+
title="Custom Event Content"
|
|
121
|
+
description="Use renderCustomEventContent to replace the default event pill with your own JSX. The callback receives the FullCalendar eventInfo object."
|
|
122
|
+
>
|
|
123
|
+
<div className="w-full">
|
|
124
|
+
<Calendar
|
|
125
|
+
calendarView="dayGridMonth"
|
|
126
|
+
currentDate={new Date()}
|
|
127
|
+
dayMaxEvents={5}
|
|
128
|
+
handleMonthChange={() => {}}
|
|
129
|
+
renderEventAvailabilities={sampleEvents}
|
|
130
|
+
lib={{ moment }}
|
|
131
|
+
height="700px"
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
</StorySection>
|
|
135
|
+
|
|
136
|
+
<StorySection
|
|
137
|
+
title="Custom Header Title"
|
|
138
|
+
description="Pass customHeaderFn to format the toolbar title string. Receives a dateInfo object with start and end markers."
|
|
139
|
+
>
|
|
140
|
+
<div className="w-full">
|
|
141
|
+
<Calendar
|
|
142
|
+
calendarView="timeGridWeek"
|
|
143
|
+
currentDate={new Date()}
|
|
144
|
+
dayMaxEvents={3}
|
|
145
|
+
handleMonthChange={() => {}}
|
|
146
|
+
renderEventAvailabilities={sampleEvents}
|
|
147
|
+
lib={{ moment }}
|
|
148
|
+
height="700px"
|
|
149
|
+
customHeaderFn={(dateInfo) => {
|
|
150
|
+
const start = moment(dateInfo.start.marker).format("DD/MM/YYYY");
|
|
151
|
+
const end = moment(dateInfo.end.marker).format("DD/MM/YYYY");
|
|
152
|
+
return `${start} - ${end}`;
|
|
153
|
+
}}
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
</StorySection>
|
|
157
|
+
</>
|
|
158
|
+
);
|
|
159
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Clipboard
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A clipboard component that displays text in a read-only input field with a copy button. When clicked, the copy button copies the text to the clipboard and shows a "Copied" confirmation.
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { Clipboard } from "blixify-ui-web/lib";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
const [copyCount, setCopyCount] = useState(0);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Clipboard
|
|
22
|
+
text="https://blixify.co"
|
|
23
|
+
onCopy={(text) => {
|
|
24
|
+
setCopyCount((prev) => prev + 1);
|
|
25
|
+
console.log("Copied:", text);
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
##### Required props
|
|
32
|
+
|
|
33
|
+
| Name | Type | Description |
|
|
34
|
+
| -------- | ------------------------ | ---------------------------------------------------- |
|
|
35
|
+
| `text` | `string` | The text to display and copy to clipboard |
|
|
36
|
+
| `onCopy` | `(text: string) => void` | Callback function called when copy button is clicked |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { Clipboard } from ".";
|
|
4
|
+
import README from "./README.md";
|
|
5
|
+
|
|
6
|
+
const stories = storiesOf("Design", module);
|
|
7
|
+
|
|
8
|
+
stories.addParameters({
|
|
9
|
+
readme: {
|
|
10
|
+
content: README,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
stories.add("Clipboard", () => {
|
|
15
|
+
const [copyCount, setCopyCount] = useState(0);
|
|
16
|
+
const [copiedText, setCopiedText] = useState("");
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<Clipboard
|
|
20
|
+
text="https://blixify.co"
|
|
21
|
+
onCopy={(text) => {
|
|
22
|
+
setCopyCount((prev) => copyCount + 1);
|
|
23
|
+
setCopiedText(text);
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
<div className="mt-5 text-sm">
|
|
27
|
+
<p>Copied: {copyCount} times</p>
|
|
28
|
+
<p>Copied text: {copiedText}</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Detail List
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
Detail List to display content
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { DetailList } from "blixify-ui-web/components/display/detailList";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
<DetailList
|
|
19
|
+
title="User Details"
|
|
20
|
+
list={[
|
|
21
|
+
{ title: "User Name", text: "Tom Holland" },
|
|
22
|
+
{ title: "Age", text: "26 ages" },
|
|
23
|
+
]}
|
|
24
|
+
/>
|
|
25
|
+
<DetailList
|
|
26
|
+
className="mt-5"
|
|
27
|
+
title="Applicant Information"
|
|
28
|
+
description="Personal details and application."
|
|
29
|
+
list={[
|
|
30
|
+
{ title: "Full name", text: "Margot Foster" },
|
|
31
|
+
{ title: "Application for", text: "Backend Developer" },
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
##### Required props
|
|
37
|
+
|
|
38
|
+
| Name | Type | Description |
|
|
39
|
+
| ------- | ------------------- | ----------- |
|
|
40
|
+
| `title` | `string` | |
|
|
41
|
+
| `list` | `Detail List Class` | Class |
|
|
42
|
+
|
|
43
|
+
##### Optional props
|
|
44
|
+
|
|
45
|
+
| Name | Type | Description |
|
|
46
|
+
| --------------------- | ------------------------------------------------ | -------------------------------------------------------- |
|
|
47
|
+
| `addTitleElement` | `ReactElement` | Additional react elemnt to be displayed next to title |
|
|
48
|
+
| `description` | `string` | |
|
|
49
|
+
| `className` | `tailwind class` | |
|
|
50
|
+
| `model` | `Model Data Structure` | Only used in Data Template |
|
|
51
|
+
| `hideModal` | `boolean` | Only used in Data Template |
|
|
52
|
+
| `referenceModel` | `Model Data Structure` | Only used in Data Template |
|
|
53
|
+
| `splitView` | `boolean` | Able to split into two |
|
|
54
|
+
| `handleReferenceLink` | `(dataId: string, collectionId: string) => void` | Only used in Data Template, when reference being clicked |
|
|
55
|
+
|
|
56
|
+
##### Detail List class
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description |
|
|
59
|
+
| ------- | -------- | ----------- |
|
|
60
|
+
| `title` | `string` | |
|
|
61
|
+
| `text` | `any` | |
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { DetailList } from ".";
|
|
4
|
+
import README from "./README.md";
|
|
5
|
+
import { Tag } from "../tag";
|
|
6
|
+
const stories = storiesOf("Display", module);
|
|
7
|
+
|
|
8
|
+
stories.addParameters({
|
|
9
|
+
readme: {
|
|
10
|
+
content: README,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
stories.add("Detail List", () => {
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<DetailList
|
|
18
|
+
title="User Details"
|
|
19
|
+
addTitleElement={
|
|
20
|
+
<Tag
|
|
21
|
+
tagText="Verified"
|
|
22
|
+
size="small"
|
|
23
|
+
variant="flatOutline"
|
|
24
|
+
rounded="md"
|
|
25
|
+
/>
|
|
26
|
+
}
|
|
27
|
+
list={[
|
|
28
|
+
{ title: "User Name", text: "Tom Holland" },
|
|
29
|
+
{ title: "Age", text: "26 ages" },
|
|
30
|
+
]}
|
|
31
|
+
splitView={true}
|
|
32
|
+
/>
|
|
33
|
+
<DetailList
|
|
34
|
+
className="mt-5"
|
|
35
|
+
title="Applicant Information"
|
|
36
|
+
description="Personal details and application."
|
|
37
|
+
list={[
|
|
38
|
+
{ title: "Full name", text: "Margot Foster" },
|
|
39
|
+
{ title: "Application for", text: "Backend Developer" },
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
<DetailList
|
|
43
|
+
className="mt-5"
|
|
44
|
+
title="Data Template"
|
|
45
|
+
description="Data Template Example"
|
|
46
|
+
darkMode={true}
|
|
47
|
+
list={[
|
|
48
|
+
{ title: "Full name", text: "Margot Foster" },
|
|
49
|
+
{
|
|
50
|
+
title: "Image",
|
|
51
|
+
text: (
|
|
52
|
+
<img
|
|
53
|
+
src="https://arusoil.com/static/oil_collection_drum-ddf6f26e6fbb1bc058bffb0faa722f51.webp"
|
|
54
|
+
alt=""
|
|
55
|
+
/>
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: "Address",
|
|
60
|
+
text: { lat: 5, lng: 6, address: "Penang" },
|
|
61
|
+
},
|
|
62
|
+
]}
|
|
63
|
+
model={[
|
|
64
|
+
{ id: "full_name", name: "Full name", type: "string" },
|
|
65
|
+
{ id: "image", name: "Image", type: "image" },
|
|
66
|
+
{
|
|
67
|
+
id: "address",
|
|
68
|
+
name: "Address",
|
|
69
|
+
type: "reference",
|
|
70
|
+
referenceLabel: "address",
|
|
71
|
+
},
|
|
72
|
+
]}
|
|
73
|
+
referenceModel={{
|
|
74
|
+
address: [
|
|
75
|
+
{ id: "lat", name: "Lat", type: "number" },
|
|
76
|
+
{ id: "lng", name: "Lng", type: "number" },
|
|
77
|
+
{ id: "address", name: "Address", type: "string" },
|
|
78
|
+
],
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
<DetailList
|
|
82
|
+
className="mt-5"
|
|
83
|
+
title="Data Template"
|
|
84
|
+
description={"Data Template Example"}
|
|
85
|
+
darkMode={true}
|
|
86
|
+
list={[
|
|
87
|
+
{ title: "Full name", text: "Margot Foster" },
|
|
88
|
+
{
|
|
89
|
+
title: "Image",
|
|
90
|
+
text: (
|
|
91
|
+
<img
|
|
92
|
+
src="https://arusoil.com/static/oil_collection_drum-ddf6f26e6fbb1bc058bffb0faa722f51.webp"
|
|
93
|
+
alt=""
|
|
94
|
+
/>
|
|
95
|
+
),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: "Address",
|
|
99
|
+
text: { lat: 5, lng: 6, address: "Penang" },
|
|
100
|
+
},
|
|
101
|
+
]}
|
|
102
|
+
model={[
|
|
103
|
+
{ id: "full_name", name: "Full name", type: "string" },
|
|
104
|
+
{ id: "image", name: "Image", type: "image" },
|
|
105
|
+
{
|
|
106
|
+
id: "address",
|
|
107
|
+
name: "Address",
|
|
108
|
+
type: "object",
|
|
109
|
+
objectData: [
|
|
110
|
+
{
|
|
111
|
+
id: "lat",
|
|
112
|
+
name: "Lat",
|
|
113
|
+
type: "number",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "lng",
|
|
117
|
+
name: "Lng",
|
|
118
|
+
type: "number",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "address",
|
|
122
|
+
name: "Address",
|
|
123
|
+
type: "string",
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
]}
|
|
128
|
+
/>
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
});
|