blixify-ui-web-mcp 0.1.3 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/action/button/README.md +12 -11
- package/lib/components/action/button/button.stories.tsx +4 -10
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +4 -10
- package/lib/components/action/iconButton/iconButton.stories.tsx +4 -10
- package/lib/components/action/radioList/radioList.stories.tsx +4 -10
- package/lib/components/action/slider/slider.stories.tsx +4 -10
- package/lib/components/action/textButton/textButton.stories.tsx +4 -10
- package/lib/components/action/toggle/toggle.stories.tsx +4 -10
- package/lib/components/advanced/collapse/collapse.stories.tsx +4 -10
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +4 -10
- package/lib/components/advanced/popUp/README.md +21 -7
- package/lib/components/advanced/popUp/popUp.stories.tsx +4 -10
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +30 -10
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +4 -10
- package/lib/components/auth/signIn/signIn.stories.tsx +4 -10
- package/lib/components/auth/signUp/signUp.stories.tsx +4 -10
- package/lib/components/chart/areaChart/areaChart.stories.tsx +7 -13
- package/lib/components/chart/barChart/barChart.stories.tsx +7 -13
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +8 -14
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +8 -14
- package/lib/components/chart/card/card.stories.tsx +4 -10
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +4 -10
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +4 -10
- package/lib/components/chart/lineChart/lineChart.stories.tsx +4 -10
- package/lib/components/chart/pieChart/pieChart.stories.tsx +4 -10
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +8 -14
- package/lib/components/chart/radarChart/radarChart.stories.tsx +4 -10
- package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +4 -10
- package/lib/components/chart/statsCard/statsCard.stories.tsx +4 -10
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +8 -14
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +13 -19
- package/lib/components/chat/chatBase/README.md +103 -22
- package/lib/components/chat/chatBase/chatBase.stories.tsx +652 -52
- package/lib/components/chat/chatDashboard/README.md +17 -15
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +356 -44
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +4 -10
- package/lib/components/data/dataReference/dataReference.stories.tsx +4 -10
- package/lib/components/data/dataTemplate/README.md +88 -61
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +4 -10
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +4 -10
- package/lib/components/data/dataWrapper/README.md +46 -45
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +258 -489
- package/lib/components/data/queryForm/queryForm.stories.tsx +4 -10
- package/lib/components/data/readQuery/readQuery.stories.tsx +4 -9
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +4 -10
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +4 -8
- package/lib/components/design/actionSection/actionSection.stories.tsx +6 -10
- package/lib/components/design/banner/banner.stories.tsx +4 -10
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +4 -10
- package/lib/components/design/blogSection/blogSection.stories.tsx +4 -10
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +4 -10
- package/lib/components/design/designList/designList.stories.tsx +4 -10
- package/lib/components/design/faq/faq.stories.tsx +4 -10
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +4 -10
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +4 -10
- package/lib/components/design/footerSection/footerSection.stories.tsx +4 -10
- package/lib/components/design/googleReview/googleReview.stories.tsx +4 -10
- package/lib/components/design/heroSection/heroSection.stories.tsx +4 -10
- package/lib/components/design/iconList/iconList.stories.tsx +4 -10
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +4 -10
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +4 -10
- package/lib/components/design/leftContent/leftContent.stories.tsx +4 -10
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +4 -10
- package/lib/components/design/onboarding/onboarding.stories.tsx +4 -10
- package/lib/components/design/pricing/pricing.stories.tsx +4 -10
- package/lib/components/design/rightContent/rightContent.stories.tsx +4 -10
- package/lib/components/design/sectionList/sectionList.stories.tsx +4 -10
- package/lib/components/design/teams/teams.stories.tsx +4 -10
- package/lib/components/display/alert/alert.stories.tsx +4 -10
- package/lib/components/display/calendar/README.md +49 -0
- package/lib/components/display/calendar/calendar.stories.tsx +71 -28
- package/lib/components/display/clipboard/clipboard.stories.tsx +4 -10
- package/lib/components/display/detailList/detailList.stories.tsx +5 -10
- package/lib/components/display/drawer/drawer.stories.tsx +5 -10
- package/lib/components/display/emptyState/emptyState.stories.tsx +4 -10
- package/lib/components/display/feeds/feeds.stories.tsx +4 -10
- package/lib/components/display/flexTable/README.md +11 -7
- package/lib/components/display/flexTable/flexTable.stories.tsx +114 -11
- package/lib/components/display/grid/README.md +28 -27
- package/lib/components/display/grid/grid.stories.tsx +4 -10
- package/lib/components/display/kanban/kanban.stories.tsx +14 -20
- package/lib/components/display/list/README.md +30 -29
- package/lib/components/display/list/list.stories.tsx +4 -10
- package/lib/components/display/loading/loading.stories.tsx +5 -10
- package/lib/components/display/mapView/mapView.stories.tsx +4 -10
- package/lib/components/display/modal/modal.stories.tsx +4 -11
- package/lib/components/display/notification/notification.stories.tsx +4 -10
- package/lib/components/display/progress/progress.stories.tsx +5 -10
- package/lib/components/display/stepper/stepper.stories.tsx +5 -10
- package/lib/components/display/table/README.md +38 -37
- package/lib/components/display/table/table.stories.tsx +8 -14
- package/lib/components/display/tag/tag.stories.tsx +4 -10
- package/lib/components/input/address/address.stories.tsx +4 -10
- package/lib/components/input/canvas/canvas.stories.tsx +4 -10
- package/lib/components/input/checkbox/checkbox.stories.tsx +4 -10
- package/lib/components/input/datePicker/datePicker.stories.tsx +4 -10
- package/lib/components/input/form/form.stories.tsx +4 -10
- package/lib/components/input/markdown/markdown.stories.tsx +5 -10
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +4 -10
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +4 -10
- package/lib/components/input/rating/rating.stories.tsx +4 -10
- package/lib/components/input/select/README.md +30 -29
- package/lib/components/input/select/select.stories.tsx +4 -10
- package/lib/components/input/signature/signature.stories.tsx +4 -10
- package/lib/components/input/textArea/textArea.stories.tsx +4 -10
- package/lib/components/input/textInput/textinput.stories.tsx +4 -10
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +135 -11
- package/lib/components/navigation/bars/bars.stories.tsx +4 -10
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +5 -10
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +4 -10
- package/lib/components/navigation/header/header.stories.tsx +24 -12
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +4 -10
- package/lib/components/navigation/tabs/tabs.stories.tsx +4 -10
- package/lib/components/structure/column/column.stories.tsx +5 -10
- package/lib/components/structure/container/container.stories.tsx +5 -10
- package/lib/components/structure/link/link.stories.tsx +4 -10
- package/lib/components/structure/text/text.stories.tsx +5 -10
- package/lib/components/template/authPage/authPage.stories.tsx +6 -5
- package/lib/components/template/landingPage/landingPage.stories.tsx +8 -6
- package/lib/components/template/productListing/productListing.stories.tsx +7 -13
- package/lib/components/template/productOverview/productOverview.stories.tsx +5 -11
- package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +6 -12
- package/lib/components/template/userHomePage/userHomePage.stories.tsx +7 -6
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +5 -11
- package/package.json +1 -1
|
@@ -62,14 +62,15 @@ Disabled:
|
|
|
62
62
|
|
|
63
63
|
##### Optional props
|
|
64
64
|
|
|
65
|
-
| Name
|
|
66
|
-
|
|
|
67
|
-
| `icon`
|
|
68
|
-
| `size`
|
|
69
|
-
| `disable`
|
|
70
|
-
| `className`
|
|
71
|
-
| `popUpMenuItems`
|
|
72
|
-
| `popUpDirection`
|
|
73
|
-
| `popUpAnchor`
|
|
74
|
-
| `popUpClassName`
|
|
75
|
-
| `
|
|
65
|
+
| Name | Type | Default | Description |
|
|
66
|
+
| ----------------- | ----------------------------------------------------- | ---------- | ----------------------------------------------- |
|
|
67
|
+
| `icon` | `React Element` | — | Icon element to display before the button text |
|
|
68
|
+
| `size` | `string` | — | `"small"`, `"extraSmall"`, or default (large) |
|
|
69
|
+
| `disable` | `boolean` | `false` | When true, disables the button |
|
|
70
|
+
| `className` | `string` | `""` | Tailwind (or other) CSS classes for the button |
|
|
71
|
+
| `popUpMenuItems` | `{ text: string; onClick: (text: string) => void }[]` | — | Items for a pop-up menu; when set, shows pop-up |
|
|
72
|
+
| `popUpDirection` | `"top" \| "bottom"` | `"bottom"` | Where the pop-up menu opens relative to button |
|
|
73
|
+
| `popUpAnchor` | `"left" \| "right"` | `"left"` | Horizontal alignment of the pop-up |
|
|
74
|
+
| `popUpClassName` | `string` | — | CSS classes for the pop-up container |
|
|
75
|
+
| `customEventText` | `string` | — | Custom text for the Rybbit tracking event name |
|
|
76
|
+
| `onClick` | `(e: any) => void` | — | Called when the button is clicked |
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { Button } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
5
3
|
import { StorySection } from "../../storyUtils";
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
const meta = { title: "Action/Button" };
|
|
6
|
+
export default meta;
|
|
8
7
|
|
|
9
|
-
stories.addParameters({
|
|
10
|
-
readme: {
|
|
11
|
-
content: README,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
export const ButtonStory = () => (
|
|
16
10
|
<div className="font-sans max-w-2xl p-6">
|
|
17
11
|
<StorySection
|
|
18
12
|
title="Button Types"
|
|
@@ -135,4 +129,4 @@ stories.add("Button", () => (
|
|
|
135
129
|
<Button text="Danger" size="small" type="danger" disable={true} />
|
|
136
130
|
</StorySection>
|
|
137
131
|
</div>
|
|
138
|
-
)
|
|
132
|
+
)
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { ButtonGroup } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
5
3
|
import { StorySection } from "../../storyUtils";
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
const meta = { title: "Action/Button Group" };
|
|
6
|
+
export default meta;
|
|
8
7
|
|
|
9
|
-
stories.addParameters({
|
|
10
|
-
readme: {
|
|
11
|
-
content: README,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
8
|
|
|
15
9
|
const defaultSelection = [
|
|
16
10
|
{ id: "item1", name: "Item 1" },
|
|
@@ -18,7 +12,7 @@ const defaultSelection = [
|
|
|
18
12
|
{ id: "item3", name: "Item 3" },
|
|
19
13
|
];
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
export const ButtonGroupStory = () => {
|
|
22
16
|
const [selectedId, setSelectedId] = useState("item1");
|
|
23
17
|
|
|
24
18
|
return (
|
|
@@ -101,4 +95,4 @@ stories.add("Button Group", () => {
|
|
|
101
95
|
</StorySection>
|
|
102
96
|
</div>
|
|
103
97
|
);
|
|
104
|
-
}
|
|
98
|
+
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { Bars3Icon } from "@heroicons/react/24/solid";
|
|
2
|
-
import { storiesOf } from "@storybook/react";
|
|
3
2
|
import React from "react";
|
|
4
3
|
import { IconButton } from ".";
|
|
5
|
-
import README from "./README.md";
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
const meta = { title: "Action/Icon Button" };
|
|
6
|
+
export default meta;
|
|
8
7
|
|
|
9
|
-
stories.addParameters({
|
|
10
|
-
readme: {
|
|
11
|
-
content: README,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
export const IconButtonStory = () => {
|
|
16
10
|
return (
|
|
17
11
|
<IconButton
|
|
18
12
|
icon={<Bars3Icon className="h-5 w-5 text-gray-400" />}
|
|
19
13
|
onClick={() => {}}
|
|
20
14
|
/>
|
|
21
15
|
);
|
|
22
|
-
}
|
|
16
|
+
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { RadioList, RadioListItem } from ".";
|
|
4
3
|
import { TextButton } from "../textButton";
|
|
5
|
-
import README from "./README.md";
|
|
6
4
|
import { StorySection } from "../../storyUtils";
|
|
7
5
|
|
|
8
|
-
const
|
|
6
|
+
const meta = { title: "Action/Radio List" };
|
|
7
|
+
export default meta;
|
|
9
8
|
|
|
10
|
-
stories.addParameters({
|
|
11
|
-
readme: {
|
|
12
|
-
content: README,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
9
|
|
|
16
10
|
const baseList: RadioListItem[] = [
|
|
17
11
|
{
|
|
@@ -52,7 +46,7 @@ const baseList: RadioListItem[] = [
|
|
|
52
46
|
},
|
|
53
47
|
];
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
export const RadioListStory = () => {
|
|
56
50
|
const [singleValue, setSingleValue] = useState("");
|
|
57
51
|
const [multiValue, setMultiValue] = useState<string[]>([]);
|
|
58
52
|
|
|
@@ -178,4 +172,4 @@ stories.add("Radio List", () => {
|
|
|
178
172
|
</StorySection>
|
|
179
173
|
</div>
|
|
180
174
|
);
|
|
181
|
-
}
|
|
175
|
+
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { Slider } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
5
3
|
import { StorySection } from "../../storyUtils";
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
const meta = { title: "Action/Slider" };
|
|
6
|
+
export default meta;
|
|
8
7
|
|
|
9
|
-
stories.addParameters({
|
|
10
|
-
readme: {
|
|
11
|
-
content: README,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
export const SliderStory = () => {
|
|
16
10
|
const [single, setSingle] = useState("50");
|
|
17
11
|
const [steppedValue, setSteppedValue] = useState("50");
|
|
18
12
|
const [rangeMin, setRangeMin] = useState("20");
|
|
@@ -130,4 +124,4 @@ stories.add("Slider", () => {
|
|
|
130
124
|
</StorySection>
|
|
131
125
|
</div>
|
|
132
126
|
);
|
|
133
|
-
}
|
|
127
|
+
}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { TextButton } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
5
3
|
|
|
6
|
-
const
|
|
4
|
+
const meta = { title: "Action/Text Button" };
|
|
5
|
+
export default meta;
|
|
7
6
|
|
|
8
|
-
stories.addParameters({
|
|
9
|
-
readme: {
|
|
10
|
-
content: README,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
7
|
|
|
14
|
-
|
|
8
|
+
export const TextButtonStory = () => {
|
|
15
9
|
return <TextButton text="Click Me" onClick={() => {}} />;
|
|
16
|
-
}
|
|
10
|
+
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { Toggle } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
5
3
|
|
|
6
|
-
const
|
|
4
|
+
const meta = { title: "Action/Toggle" };
|
|
5
|
+
export default meta;
|
|
7
6
|
|
|
8
|
-
stories.addParameters({
|
|
9
|
-
readme: {
|
|
10
|
-
content: README,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
7
|
|
|
14
|
-
|
|
8
|
+
export const ToggleStory = () => {
|
|
15
9
|
return (
|
|
16
10
|
<Toggle
|
|
17
11
|
direction="right"
|
|
@@ -20,4 +14,4 @@ stories.add("Toggle", () => {
|
|
|
20
14
|
onClick={() => {}}
|
|
21
15
|
/>
|
|
22
16
|
);
|
|
23
|
-
}
|
|
17
|
+
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { ArrowsPointingOutIcon, MapIcon } from "@heroicons/react/24/solid";
|
|
2
|
-
import { storiesOf } from "@storybook/react";
|
|
3
2
|
import React, { useState } from "react";
|
|
4
3
|
import { Collapse } from ".";
|
|
5
4
|
import { Stepper } from "../../display/stepper";
|
|
6
|
-
import README from "./README.md";
|
|
7
5
|
import { StorySection } from "../../storyUtils";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Advanced/Collapse" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
11
|
const loremContent = (
|
|
18
12
|
<div className="w-full p-3 text-sm text-gray-700">
|
|
@@ -38,7 +32,7 @@ const stepperComp = (
|
|
|
38
32
|
</div>
|
|
39
33
|
);
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
export const CollapseStory = () => {
|
|
42
36
|
const [collapse, setCollapse] = useState(true);
|
|
43
37
|
const toggle = () => setCollapse((prev) => !prev);
|
|
44
38
|
|
|
@@ -162,4 +156,4 @@ stories.add("Collapse", () => {
|
|
|
162
156
|
</StorySection>
|
|
163
157
|
</div>
|
|
164
158
|
);
|
|
165
|
-
}
|
|
159
|
+
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { BoltIcon } from "@heroicons/react/24/outline";
|
|
2
2
|
import { QuestionMarkCircleIcon } from "@heroicons/react/24/solid";
|
|
3
|
-
import { storiesOf } from "@storybook/react";
|
|
4
3
|
import React from "react";
|
|
5
4
|
import { InfoWindow } from ".";
|
|
6
|
-
import README from "./README.md";
|
|
7
5
|
import { StorySection } from "../../storyUtils";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Advanced/Info Window" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
11
|
const infoContent = (
|
|
18
12
|
<div className="w-60 bg-gray-200 p-3 rounded-lg text-sm text-gray-700">
|
|
@@ -22,7 +16,7 @@ const infoContent = (
|
|
|
22
16
|
|
|
23
17
|
const iconClassName = "h-6 w-6 text-gray-400";
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
export const InfoWindowStory = () => (
|
|
26
20
|
<div className="font-sans max-w-2xl p-6">
|
|
27
21
|
<StorySection
|
|
28
22
|
title="Position: Right"
|
|
@@ -109,4 +103,4 @@ stories.add("Info Window", () => (
|
|
|
109
103
|
/>
|
|
110
104
|
</StorySection>
|
|
111
105
|
</div>
|
|
112
|
-
)
|
|
106
|
+
)
|
|
@@ -29,6 +29,8 @@ import { Transition } from "@headlessui/react";
|
|
|
29
29
|
Close the popup from inside `renderComp` using a ref:
|
|
30
30
|
|
|
31
31
|
```jsx
|
|
32
|
+
import { Transition } from "@headlessui/react";
|
|
33
|
+
|
|
32
34
|
const ref = useRef(null);
|
|
33
35
|
|
|
34
36
|
<PopUp
|
|
@@ -68,6 +70,17 @@ Top direction with left anchor:
|
|
|
68
70
|
/>
|
|
69
71
|
```
|
|
70
72
|
|
|
73
|
+
Exclude portal elements from outside-click detection:
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
<PopUp
|
|
77
|
+
ctaComp={<ChevronDownIcon className="h-5 w-5" />}
|
|
78
|
+
renderComp={<DatePicker />}
|
|
79
|
+
excludePortalIds={["datepicker-portal"]}
|
|
80
|
+
lib={{ Transition }}
|
|
81
|
+
/>
|
|
82
|
+
```
|
|
83
|
+
|
|
71
84
|
##### Required props
|
|
72
85
|
|
|
73
86
|
| Name | Type | Description |
|
|
@@ -78,13 +91,14 @@ Top direction with left anchor:
|
|
|
78
91
|
|
|
79
92
|
##### Optional props
|
|
80
93
|
|
|
81
|
-
| Name
|
|
82
|
-
|
|
|
83
|
-
| `trigger`
|
|
84
|
-
| `direction`
|
|
85
|
-
| `anchor`
|
|
86
|
-
| `className`
|
|
87
|
-
| `onClose`
|
|
94
|
+
| Name | Type | Default | Description |
|
|
95
|
+
| ------------------ | -------------------- | ---------- | ------------------------------------------------------------------------------------------- |
|
|
96
|
+
| `trigger` | `"click" \| "hover"` | `"click"` | How the panel is opened. `"hover"` opens on mouse enter, closes on leave |
|
|
97
|
+
| `direction` | `"top" \| "bottom"` | `"bottom"` | Whether the panel opens above or below the trigger |
|
|
98
|
+
| `anchor` | `"left" \| "right"` | `"right"` | Horizontal alignment of the panel relative to the trigger |
|
|
99
|
+
| `className` | `string` | `""` | Tailwind classes applied to the outer wrapper `div` |
|
|
100
|
+
| `onClose` | `() => void` | — | Called when the panel closes (click outside, hover leave, or via ref) |
|
|
101
|
+
| `excludePortalIds` | `string[]` | `[]` | DOM element IDs that render outside the wrapper — clicks inside these won't close the panel |
|
|
88
102
|
|
|
89
103
|
##### Ref API
|
|
90
104
|
|
|
@@ -5,25 +5,19 @@ import {
|
|
|
5
5
|
ShoppingCartIcon,
|
|
6
6
|
UserGroupIcon,
|
|
7
7
|
} from "@heroicons/react/24/solid";
|
|
8
|
-
import { storiesOf } from "@storybook/react";
|
|
9
8
|
import React, { useRef } from "react";
|
|
10
9
|
import { PopUp } from ".";
|
|
11
10
|
import { TextButton } from "../../action/textButton";
|
|
12
11
|
import { Card } from "../../chart/card";
|
|
13
|
-
import README from "./README.md";
|
|
14
12
|
import { StorySection } from "../../storyUtils";
|
|
15
13
|
|
|
16
|
-
const
|
|
14
|
+
const meta = { title: "Advanced/PopUp" };
|
|
15
|
+
export default meta;
|
|
17
16
|
|
|
18
|
-
stories.addParameters({
|
|
19
|
-
readme: {
|
|
20
|
-
content: README,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
17
|
|
|
24
18
|
const lib = { Transition };
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
export const PopUpStory = () => {
|
|
27
21
|
const ref = useRef<any>(null);
|
|
28
22
|
|
|
29
23
|
const richContent = (
|
|
@@ -186,4 +180,4 @@ stories.add("PopUp", () => {
|
|
|
186
180
|
</StorySection>
|
|
187
181
|
</div>
|
|
188
182
|
);
|
|
189
|
-
}
|
|
183
|
+
}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { AvailableProvider, BareSignIn } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
5
3
|
import { StorySection } from "../../storyUtils";
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
const meta = { title: "Auth/Bare Sign In" };
|
|
6
|
+
export default meta;
|
|
8
7
|
|
|
9
|
-
stories.addParameters({
|
|
10
|
-
readme: {
|
|
11
|
-
content: README,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
8
|
|
|
15
9
|
const cardCls =
|
|
16
10
|
"w-full max-w-md bg-white rounded-lg shadow-sm border border-gray-100";
|
|
17
11
|
|
|
18
|
-
|
|
12
|
+
export const BareSignInStory = () => {
|
|
19
13
|
const [provider, setProvider] = useState<typeof AvailableProvider>("email");
|
|
20
14
|
|
|
21
15
|
return (
|
|
@@ -113,6 +107,32 @@ stories.add("Bare Sign In", () => {
|
|
|
113
107
|
</div>
|
|
114
108
|
</StorySection>
|
|
115
109
|
|
|
110
|
+
<StorySection
|
|
111
|
+
title="OTP Provider — WhatsApp Fallback"
|
|
112
|
+
description={
|
|
113
|
+
<>
|
|
114
|
+
Pass <code>otpRetryWhatsapp={true}</code> alongside{" "}
|
|
115
|
+
<code>onChangeResendOTP</code> to show a "Resend via WhatsApp" link
|
|
116
|
+
on the right side of "Resend OTP". The callback receives{" "}
|
|
117
|
+
<code>"sms"</code> or <code>"whatsapp"</code> depending on which was
|
|
118
|
+
clicked.
|
|
119
|
+
</>
|
|
120
|
+
}
|
|
121
|
+
>
|
|
122
|
+
<div className={cardCls}>
|
|
123
|
+
<BareSignIn
|
|
124
|
+
version="0.0.1"
|
|
125
|
+
type="phoneOTP"
|
|
126
|
+
provider={["phoneOTP"]}
|
|
127
|
+
onChangeProvider={setProvider}
|
|
128
|
+
column="flex"
|
|
129
|
+
className="py-6 px-4"
|
|
130
|
+
onChangeResendOTP={(channel) => console.log("resend via", channel)}
|
|
131
|
+
otpRetryWhatsapp={true}
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
</StorySection>
|
|
135
|
+
|
|
116
136
|
<StorySection
|
|
117
137
|
title="Switchable Provider (controlled)"
|
|
118
138
|
description={
|
|
@@ -138,4 +158,4 @@ stories.add("Bare Sign In", () => {
|
|
|
138
158
|
</StorySection>
|
|
139
159
|
</div>
|
|
140
160
|
);
|
|
141
|
-
}
|
|
161
|
+
}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useRef, useState } from "react";
|
|
3
2
|
import { BareSignUp } from ".";
|
|
4
3
|
import { Option, Select } from "../../input/select";
|
|
5
4
|
import { TextInput } from "../../input/textInput";
|
|
6
5
|
import { AvailableProvider } from "../bareSignIn";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
import { StorySection } from "../../storyUtils";
|
|
9
7
|
|
|
10
|
-
const
|
|
8
|
+
const meta = { title: "Auth/Bare Sign Up" };
|
|
9
|
+
export default meta;
|
|
11
10
|
|
|
12
|
-
stories.addParameters({
|
|
13
|
-
readme: {
|
|
14
|
-
content: README,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
11
|
|
|
18
12
|
const genderOptions: Option[] = [
|
|
19
13
|
{ key: "M", label: "Male" },
|
|
20
14
|
{ key: "F", label: "Female" },
|
|
21
15
|
];
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
export const BareSignUpStory = () => {
|
|
24
18
|
const custFormRef: any = useRef(null);
|
|
25
19
|
const signUpFormRef: any = useRef(null);
|
|
26
20
|
const input1: any = useRef(null);
|
|
@@ -156,4 +150,4 @@ stories.add("Bare Sign Up", () => {
|
|
|
156
150
|
</StorySection>
|
|
157
151
|
</div>
|
|
158
152
|
);
|
|
159
|
-
}
|
|
153
|
+
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { SignInTemplate } from ".";
|
|
4
3
|
import { AvailableProvider } from "../bareSignIn";
|
|
5
|
-
import README from "./README.md";
|
|
6
4
|
import { StorySection } from "../../storyUtils";
|
|
7
5
|
|
|
8
|
-
const
|
|
6
|
+
const meta = { title: "Auth/Sign In" };
|
|
7
|
+
export default meta;
|
|
9
8
|
|
|
10
|
-
stories.addParameters({
|
|
11
|
-
readme: {
|
|
12
|
-
content: README,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
9
|
|
|
16
10
|
const contactInfo = (
|
|
17
11
|
<>
|
|
@@ -57,7 +51,7 @@ const contactInfo = (
|
|
|
57
51
|
</>
|
|
58
52
|
);
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
export const SignIn = () => {
|
|
61
55
|
const [provider, setProvider] = useState<typeof AvailableProvider>("email");
|
|
62
56
|
|
|
63
57
|
return (
|
|
@@ -117,4 +111,4 @@ stories.add("Sign In", () => {
|
|
|
117
111
|
</StorySection>
|
|
118
112
|
</div>
|
|
119
113
|
);
|
|
120
|
-
}
|
|
114
|
+
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useRef, useState } from "react";
|
|
3
2
|
import { SignUpTemplate } from ".";
|
|
4
3
|
import { Stepper } from "../../display/stepper";
|
|
5
4
|
import { Option, Select } from "../../input/select";
|
|
6
5
|
import { TextInput } from "../../input/textInput";
|
|
7
6
|
import { AvailableProvider } from "../bareSignIn";
|
|
8
|
-
import README from "./README.md";
|
|
9
7
|
import { StorySection } from "../../storyUtils";
|
|
10
8
|
|
|
11
|
-
const
|
|
9
|
+
const meta = { title: "Auth/Sign Up" };
|
|
10
|
+
export default meta;
|
|
12
11
|
|
|
13
|
-
stories.addParameters({
|
|
14
|
-
readme: {
|
|
15
|
-
content: README,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
12
|
|
|
19
13
|
const genderOptions: Option[] = [
|
|
20
14
|
{ key: "M", label: "Male" },
|
|
@@ -33,7 +27,7 @@ const signUpSteps = [
|
|
|
33
27
|
},
|
|
34
28
|
];
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
export const SignUp = () => {
|
|
37
31
|
const custFormRef: any = useRef(null);
|
|
38
32
|
const signUpFormRef: any = useRef(null);
|
|
39
33
|
const input1: any = useRef(null);
|
|
@@ -190,4 +184,4 @@ stories.add("Sign Up", () => {
|
|
|
190
184
|
</StorySection>
|
|
191
185
|
</div>
|
|
192
186
|
);
|
|
193
|
-
}
|
|
187
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { PencilIcon } from "@heroicons/react/24/outline";
|
|
2
|
-
import
|
|
3
|
-
import moment from "moment";
|
|
2
|
+
import dayjs from "../../dayjs";
|
|
4
3
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
4
|
import { AreaChart } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
import { StorySection } from "../../storyUtils";
|
|
9
7
|
|
|
10
|
-
const
|
|
8
|
+
const meta = { title: "Chart/Area Chart" };
|
|
9
|
+
export default meta;
|
|
11
10
|
|
|
12
|
-
stories.addParameters({
|
|
13
|
-
readme: {
|
|
14
|
-
content: README,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
11
|
|
|
18
12
|
const stackedAreaSeries = [
|
|
19
13
|
{
|
|
@@ -51,7 +45,7 @@ const rawData = [
|
|
|
51
45
|
{ label: "Banana", value: 55, daysAgo: 28 },
|
|
52
46
|
];
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
export const AreaChartStory = () => {
|
|
55
49
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
56
50
|
|
|
57
51
|
const chartDummyData = useMemo(() => {
|
|
@@ -86,11 +80,11 @@ stories.add("Area Chart", () => {
|
|
|
86
80
|
}, [handleSetData]);
|
|
87
81
|
|
|
88
82
|
const sevenDaysAgo = new Date();
|
|
89
|
-
sevenDaysAgo.setDate(
|
|
83
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
90
84
|
|
|
91
85
|
const defaultDateRange: RangeInterface = {
|
|
92
86
|
startDate: sevenDaysAgo,
|
|
93
|
-
endDate:
|
|
87
|
+
endDate: dayjs().toDate(),
|
|
94
88
|
isDuration: true,
|
|
95
89
|
};
|
|
96
90
|
|
|
@@ -196,4 +190,4 @@ stories.add("Area Chart", () => {
|
|
|
196
190
|
</StorySection>
|
|
197
191
|
</div>
|
|
198
192
|
);
|
|
199
|
-
}
|
|
193
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { PencilIcon } from "@heroicons/react/24/outline";
|
|
2
|
-
import
|
|
3
|
-
import moment from "moment";
|
|
2
|
+
import dayjs from "../../dayjs";
|
|
4
3
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
4
|
import { BarChart } from ".";
|
|
6
5
|
import { RangeInterface } from "../DateRange";
|
|
7
|
-
import README from "./README.md";
|
|
8
6
|
import { StorySection } from "../../storyUtils";
|
|
9
7
|
|
|
10
|
-
const
|
|
8
|
+
const meta = { title: "Chart/Bar Chart" };
|
|
9
|
+
export default meta;
|
|
11
10
|
|
|
12
|
-
stories.addParameters({
|
|
13
|
-
readme: {
|
|
14
|
-
content: README,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
11
|
|
|
18
12
|
const stackedSeries = [
|
|
19
13
|
{ name: "Company A", data: [400, 430, 448] },
|
|
@@ -29,7 +23,7 @@ const rawData = [
|
|
|
29
23
|
{ label: "Banana", value: 55, daysAgo: 28 },
|
|
30
24
|
];
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
export const BarChartStory = () => {
|
|
33
27
|
const [seriesData, setSeriesData] = useState<any[]>([]);
|
|
34
28
|
|
|
35
29
|
const chartDummyData = useMemo(() => {
|
|
@@ -64,11 +58,11 @@ stories.add("Bar Chart", () => {
|
|
|
64
58
|
}, [handleSetData]);
|
|
65
59
|
|
|
66
60
|
const sevenDaysAgo = new Date();
|
|
67
|
-
sevenDaysAgo.setDate(
|
|
61
|
+
sevenDaysAgo.setDate(dayjs().toDate().getDate() - 7);
|
|
68
62
|
|
|
69
63
|
const defaultDateRange: RangeInterface = {
|
|
70
64
|
startDate: sevenDaysAgo,
|
|
71
|
-
endDate:
|
|
65
|
+
endDate: dayjs().toDate(),
|
|
72
66
|
isDuration: true,
|
|
73
67
|
};
|
|
74
68
|
|
|
@@ -315,4 +309,4 @@ stories.add("Bar Chart", () => {
|
|
|
315
309
|
</StorySection>
|
|
316
310
|
</div>
|
|
317
311
|
);
|
|
318
|
-
}
|
|
312
|
+
}
|