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
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A component for triggering a user action. e.g: a submit button in a form
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { Button } from "blixify-ui-web/action/button";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
All button types:
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
<Button text="Normal" size="small" type="normal" />
|
|
21
|
+
<Button text="Dark" size="small" type="dark" />
|
|
22
|
+
<Button text="Light" size="small" type="light" />
|
|
23
|
+
<Button text="Icon" size="small" type="icon" />
|
|
24
|
+
<Button text="Danger" size="small" type="danger" />
|
|
25
|
+
<Button text="Dark Mode" size="small" type="darkMode" />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
With an icon:
|
|
29
|
+
|
|
30
|
+
```jsx
|
|
31
|
+
<Button text="Add Item" size="small" type="normal" icon={<MyIcon />} />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
As a dropdown:
|
|
35
|
+
|
|
36
|
+
```jsx
|
|
37
|
+
<Button
|
|
38
|
+
text="Options"
|
|
39
|
+
size="small"
|
|
40
|
+
type="normal"
|
|
41
|
+
popUpMenuItems={[
|
|
42
|
+
{ text: "Edit", onClick: (text) => {} },
|
|
43
|
+
{ text: "Delete", onClick: (text) => {} },
|
|
44
|
+
]}
|
|
45
|
+
popUpDirection="bottom"
|
|
46
|
+
popUpAnchor="left"
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Disabled:
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
<Button text="Submit" size="small" type="normal" disable={true} />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
##### Required props
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description |
|
|
59
|
+
| ------ | -------- | --------------------- |
|
|
60
|
+
| `text` | `string` | Content of the button |
|
|
61
|
+
| `type` | `string` | Type of the button |
|
|
62
|
+
|
|
63
|
+
##### Optional props
|
|
64
|
+
|
|
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
|
+
| `onClick` | `(e: any) => void` | — | Called when the button is clicked |
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Button } from ".";
|
|
4
|
+
import README from "./README.md";
|
|
5
|
+
import { StorySection } from "../../storyUtils";
|
|
6
|
+
|
|
7
|
+
const stories = storiesOf("Action", module);
|
|
8
|
+
|
|
9
|
+
stories.addParameters({
|
|
10
|
+
readme: {
|
|
11
|
+
content: README,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
stories.add("Button", () => (
|
|
16
|
+
<div className="font-sans max-w-2xl p-6">
|
|
17
|
+
<StorySection
|
|
18
|
+
title="Button Types"
|
|
19
|
+
description={
|
|
20
|
+
<>
|
|
21
|
+
All available <code>type</code> values. Use <code>normal</code> for
|
|
22
|
+
primary actions, <code>dark</code> for emphasis, <code>light</code> on
|
|
23
|
+
colored backgrounds, <code>icon</code> for outlined icon-adjacent
|
|
24
|
+
buttons, and <code>danger</code> for destructive actions.
|
|
25
|
+
</>
|
|
26
|
+
}
|
|
27
|
+
>
|
|
28
|
+
<Button text="Normal" size="small" type="normal" />
|
|
29
|
+
<Button text="Dark" size="small" type="dark" />
|
|
30
|
+
<Button text="Light" size="small" type="light" />
|
|
31
|
+
<Button text="Icon" size="small" type="icon" />
|
|
32
|
+
<Button text="Danger" size="small" type="danger" />
|
|
33
|
+
</StorySection>
|
|
34
|
+
|
|
35
|
+
<StorySection
|
|
36
|
+
title="Dark Mode"
|
|
37
|
+
description={
|
|
38
|
+
<>
|
|
39
|
+
Use <code>type="darkMode"</code> when the button sits on a dark-themed
|
|
40
|
+
surface.
|
|
41
|
+
</>
|
|
42
|
+
}
|
|
43
|
+
dark
|
|
44
|
+
>
|
|
45
|
+
<Button text="Dark Mode" size="small" type="darkMode" />
|
|
46
|
+
</StorySection>
|
|
47
|
+
|
|
48
|
+
<StorySection
|
|
49
|
+
title="Sizes"
|
|
50
|
+
description={
|
|
51
|
+
<>
|
|
52
|
+
Three sizes via the <code>size</code> prop: default (no prop),{" "}
|
|
53
|
+
<code>small</code>, and <code>extraSmall</code>.
|
|
54
|
+
</>
|
|
55
|
+
}
|
|
56
|
+
>
|
|
57
|
+
<div className="flex flex-wrap gap-3 items-end">
|
|
58
|
+
<Button text="Default" type="normal" />
|
|
59
|
+
<Button text="Small" size="small" type="normal" />
|
|
60
|
+
<Button text="Extra Small" size="extraSmall" type="normal" />
|
|
61
|
+
</div>
|
|
62
|
+
</StorySection>
|
|
63
|
+
|
|
64
|
+
<StorySection
|
|
65
|
+
title="With Icon"
|
|
66
|
+
description={
|
|
67
|
+
<>
|
|
68
|
+
Pass any <code>ReactElement</code> to the <code>icon</code> prop to
|
|
69
|
+
render it before the button label. Works with any icon library.
|
|
70
|
+
</>
|
|
71
|
+
}
|
|
72
|
+
>
|
|
73
|
+
<Button
|
|
74
|
+
text="Add Item"
|
|
75
|
+
size="small"
|
|
76
|
+
type="normal"
|
|
77
|
+
icon={<span className="mr-1.5">+</span>}
|
|
78
|
+
/>
|
|
79
|
+
<Button
|
|
80
|
+
text="Settings"
|
|
81
|
+
size="small"
|
|
82
|
+
type="icon"
|
|
83
|
+
icon={<span className="mr-1.5">⚙</span>}
|
|
84
|
+
/>
|
|
85
|
+
</StorySection>
|
|
86
|
+
|
|
87
|
+
<StorySection
|
|
88
|
+
title="Dropdown (popUpMenuItems)"
|
|
89
|
+
description={
|
|
90
|
+
<>
|
|
91
|
+
When <code>popUpMenuItems</code> is provided, the button becomes a
|
|
92
|
+
dropdown trigger. Use <code>popUpDirection</code> (<code>"top"</code>{" "}
|
|
93
|
+
| <code>"bottom"</code>) and <code>popUpAnchor</code> (
|
|
94
|
+
<code>"left"</code> | <code>"right"</code>) to control placement.
|
|
95
|
+
</>
|
|
96
|
+
}
|
|
97
|
+
>
|
|
98
|
+
<Button
|
|
99
|
+
text="Opens Below Left"
|
|
100
|
+
size="small"
|
|
101
|
+
type="normal"
|
|
102
|
+
popUpMenuItems={[
|
|
103
|
+
{ text: "Edit", onClick: () => {} },
|
|
104
|
+
{ text: "Duplicate", onClick: () => {} },
|
|
105
|
+
{ text: "Delete", onClick: () => {} },
|
|
106
|
+
]}
|
|
107
|
+
popUpDirection="bottom"
|
|
108
|
+
popUpAnchor="left"
|
|
109
|
+
/>
|
|
110
|
+
<Button
|
|
111
|
+
text="Opens Below Right"
|
|
112
|
+
size="small"
|
|
113
|
+
type="light"
|
|
114
|
+
popUpMenuItems={[
|
|
115
|
+
{ text: "Export CSV", onClick: () => {} },
|
|
116
|
+
{ text: "Export PDF", onClick: () => {} },
|
|
117
|
+
]}
|
|
118
|
+
popUpDirection="bottom"
|
|
119
|
+
popUpAnchor="right"
|
|
120
|
+
/>
|
|
121
|
+
</StorySection>
|
|
122
|
+
|
|
123
|
+
<StorySection
|
|
124
|
+
title="Disabled State"
|
|
125
|
+
description={
|
|
126
|
+
<>
|
|
127
|
+
Set <code>disable={"{true}"}</code> to block interaction. Renders at
|
|
128
|
+
reduced opacity with <code>cursor-not-allowed</code>. Applies to all
|
|
129
|
+
types.
|
|
130
|
+
</>
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
<Button text="Normal" size="small" type="normal" disable={true} />
|
|
134
|
+
<Button text="Light" size="small" type="light" disable={true} />
|
|
135
|
+
<Button text="Danger" size="small" type="danger" disable={true} />
|
|
136
|
+
</StorySection>
|
|
137
|
+
</div>
|
|
138
|
+
));
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Button Group
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A segmented control for selecting between mutually exclusive choices.
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { ButtonGroup } from "blixify-ui-web/action/buttonGroup";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
Default:
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
<ButtonGroup
|
|
21
|
+
selection={[
|
|
22
|
+
{ id: "item1", name: "Item 1" },
|
|
23
|
+
{ id: "item2", name: "Item 2" },
|
|
24
|
+
{ id: "item3", name: "Item 3" },
|
|
25
|
+
]}
|
|
26
|
+
selectedId={selectedId}
|
|
27
|
+
onClick={(id) => setSelectedId(id)}
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Small size:
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<ButtonGroup
|
|
35
|
+
selection={selection}
|
|
36
|
+
selectedId={selectedId}
|
|
37
|
+
onClick={(id) => setSelectedId(id)}
|
|
38
|
+
size="small"
|
|
39
|
+
/>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Tag variant:
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
<ButtonGroup
|
|
46
|
+
selection={selection}
|
|
47
|
+
selectedId={selectedId}
|
|
48
|
+
onClick={(id) => setSelectedId(id)}
|
|
49
|
+
variant="tag"
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Dark mode:
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
<ButtonGroup
|
|
57
|
+
selection={selection}
|
|
58
|
+
selectedId={selectedId}
|
|
59
|
+
onClick={(id) => setSelectedId(id)}
|
|
60
|
+
darkMode={true}
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
##### Required props
|
|
65
|
+
|
|
66
|
+
| Name | Type | Description |
|
|
67
|
+
| ------------ | -------------------------------- | --------------------------------------- |
|
|
68
|
+
| `selection` | `{ id: string; name: string }[]` | List of items to render as buttons |
|
|
69
|
+
| `selectedId` | `string` | The `id` of the currently selected item |
|
|
70
|
+
|
|
71
|
+
##### Optional props
|
|
72
|
+
|
|
73
|
+
| Name | Type | Default | Description |
|
|
74
|
+
| -------------------- | ---------------------- | ----------- | ------------------------------------------------------------------ |
|
|
75
|
+
| `onClick` | `(id: string) => void` | `undefined` | Called with the `id` of the clicked item |
|
|
76
|
+
| `containerClassName` | `string` | `""` | Tailwind classes applied to the outer container |
|
|
77
|
+
| `size` | `"small"` | `undefined` | Reduces font size and padding for a compact layout |
|
|
78
|
+
| `variant` | `"tag"` | `undefined` | Renders pill/tag style buttons without borders, separated by a gap |
|
|
79
|
+
| `darkMode` | `boolean` | `false` | Switches to dark background and text colors for dark surfaces |
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { ButtonGroup } from ".";
|
|
4
|
+
import README from "./README.md";
|
|
5
|
+
import { StorySection } from "../../storyUtils";
|
|
6
|
+
|
|
7
|
+
const stories = storiesOf("Action", module);
|
|
8
|
+
|
|
9
|
+
stories.addParameters({
|
|
10
|
+
readme: {
|
|
11
|
+
content: README,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const defaultSelection = [
|
|
16
|
+
{ id: "item1", name: "Item 1" },
|
|
17
|
+
{ id: "item2", name: "Item 2" },
|
|
18
|
+
{ id: "item3", name: "Item 3" },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
stories.add("Button Group", () => {
|
|
22
|
+
const [selectedId, setSelectedId] = useState("item1");
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="font-sans max-w-2xl p-6">
|
|
26
|
+
<StorySection
|
|
27
|
+
title="Default"
|
|
28
|
+
description="Standard segmented button group. Each item is a bordered button; the selected item is highlighted with the primary color ring."
|
|
29
|
+
>
|
|
30
|
+
<ButtonGroup
|
|
31
|
+
selection={defaultSelection}
|
|
32
|
+
containerClassName="w-full"
|
|
33
|
+
onClick={setSelectedId}
|
|
34
|
+
selectedId={selectedId}
|
|
35
|
+
/>
|
|
36
|
+
</StorySection>
|
|
37
|
+
|
|
38
|
+
<StorySection
|
|
39
|
+
title="Small"
|
|
40
|
+
description={
|
|
41
|
+
<>
|
|
42
|
+
Use <code>size="small"</code> for a more compact layout with reduced
|
|
43
|
+
padding and font size.
|
|
44
|
+
</>
|
|
45
|
+
}
|
|
46
|
+
>
|
|
47
|
+
<ButtonGroup
|
|
48
|
+
selection={defaultSelection}
|
|
49
|
+
containerClassName="w-full"
|
|
50
|
+
onClick={setSelectedId}
|
|
51
|
+
selectedId={selectedId}
|
|
52
|
+
size="small"
|
|
53
|
+
/>
|
|
54
|
+
</StorySection>
|
|
55
|
+
|
|
56
|
+
<StorySection
|
|
57
|
+
title="Variant: Tag"
|
|
58
|
+
description={
|
|
59
|
+
<>
|
|
60
|
+
Use <code>variant="tag"</code> for a pill/tag style group without
|
|
61
|
+
borders. Items sit inline with a gap. Also supports{" "}
|
|
62
|
+
<code>size="small"</code>.
|
|
63
|
+
</>
|
|
64
|
+
}
|
|
65
|
+
>
|
|
66
|
+
<ButtonGroup
|
|
67
|
+
selection={defaultSelection}
|
|
68
|
+
containerClassName="w-full"
|
|
69
|
+
onClick={setSelectedId}
|
|
70
|
+
selectedId={selectedId}
|
|
71
|
+
variant="tag"
|
|
72
|
+
/>
|
|
73
|
+
<ButtonGroup
|
|
74
|
+
selection={defaultSelection}
|
|
75
|
+
containerClassName="w-full"
|
|
76
|
+
onClick={setSelectedId}
|
|
77
|
+
selectedId={selectedId}
|
|
78
|
+
variant="tag"
|
|
79
|
+
size="small"
|
|
80
|
+
/>
|
|
81
|
+
</StorySection>
|
|
82
|
+
|
|
83
|
+
<StorySection
|
|
84
|
+
title="Dark Mode"
|
|
85
|
+
description={
|
|
86
|
+
<>
|
|
87
|
+
Set <code>darkMode={true}</code> for use on dark
|
|
88
|
+
backgrounds. Switches the button background and text to dark-theme
|
|
89
|
+
colors.
|
|
90
|
+
</>
|
|
91
|
+
}
|
|
92
|
+
dark
|
|
93
|
+
>
|
|
94
|
+
<ButtonGroup
|
|
95
|
+
selection={defaultSelection}
|
|
96
|
+
containerClassName="w-full"
|
|
97
|
+
onClick={setSelectedId}
|
|
98
|
+
selectedId={selectedId}
|
|
99
|
+
darkMode={true}
|
|
100
|
+
/>
|
|
101
|
+
</StorySection>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Icon Button
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A component for triggering a user action with Icon. e.g: a submit button in a form
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { IconButton } from "blixify-ui-web/action/iconButton";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
<IconButton
|
|
19
|
+
icon={<Bars3Icon className="h-5 w-5 text-gray-400" />}
|
|
20
|
+
onClick={() => {}}
|
|
21
|
+
className="rounded-md"
|
|
22
|
+
/>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
##### Required props
|
|
26
|
+
|
|
27
|
+
| Name | Type | Description |
|
|
28
|
+
| ------ | --------------- | ----------- |
|
|
29
|
+
| `icon` | `React Element` | Hero Icons |
|
|
30
|
+
|
|
31
|
+
##### Optional props
|
|
32
|
+
|
|
33
|
+
| Name | Type | Default | Description |
|
|
34
|
+
| ------------ | ---------------- | --------------------- | ----------- |
|
|
35
|
+
| `disabled` | `boolean` | `false` | |
|
|
36
|
+
| `background` | `tailwind class` | "" | |
|
|
37
|
+
| `className` | `tailwind class` | "" | |
|
|
38
|
+
| `bgColor` | `string` | Icon background color |
|
|
39
|
+
| `onClick` | `function` | `() => {}` | |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Bars3Icon } from "@heroicons/react/24/solid";
|
|
2
|
+
import { storiesOf } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { IconButton } from ".";
|
|
5
|
+
import README from "./README.md";
|
|
6
|
+
|
|
7
|
+
const stories = storiesOf("Action", module);
|
|
8
|
+
|
|
9
|
+
stories.addParameters({
|
|
10
|
+
readme: {
|
|
11
|
+
content: README,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
stories.add("Icon Button", () => {
|
|
16
|
+
return (
|
|
17
|
+
<IconButton
|
|
18
|
+
icon={<Bars3Icon className="h-5 w-5 text-gray-400" />}
|
|
19
|
+
onClick={() => {}}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Radio List
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A radio (or checkbox) list for selecting one or multiple options from a predefined set. Supports custom user-added values, horizontal layout, and per-item disabled states.
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { RadioList, RadioListItem } from "blixify-ui-web/action/radioList";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
Single select (vertical):
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
const [value, setValue] = useState("");
|
|
21
|
+
|
|
22
|
+
<RadioList
|
|
23
|
+
id="diet"
|
|
24
|
+
list={list}
|
|
25
|
+
value={value}
|
|
26
|
+
optional
|
|
27
|
+
onSelect={(val) => setValue(val)}
|
|
28
|
+
/>;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Single select (horizontal):
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<RadioList
|
|
35
|
+
id="diet"
|
|
36
|
+
list={list}
|
|
37
|
+
value={value}
|
|
38
|
+
optional
|
|
39
|
+
horizontal
|
|
40
|
+
onSelect={(val) => setValue(val)}
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Multi select — pass a `string[]` to `value` to enable checkbox mode:
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
const [value, setValue] = useState<string[]>([]);
|
|
48
|
+
|
|
49
|
+
<RadioList
|
|
50
|
+
id="diet"
|
|
51
|
+
list={list}
|
|
52
|
+
value={value}
|
|
53
|
+
optional
|
|
54
|
+
onSelect={(val) => setValue(val)}
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Allow user to add custom values:
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
<RadioList
|
|
62
|
+
id="diet"
|
|
63
|
+
list={list}
|
|
64
|
+
value={value}
|
|
65
|
+
newValue
|
|
66
|
+
placeholder="Enter a custom option..."
|
|
67
|
+
onSelect={(val) => setValue(val)}
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
##### Required props
|
|
72
|
+
|
|
73
|
+
| Name | Type | Description |
|
|
74
|
+
| ---------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
75
|
+
| `list` | `RadioListItem[]` | Items to render as options |
|
|
76
|
+
| `value` | `string \| string[]` | Currently selected value. Pass `string` for single select, `string[]` for multi-select |
|
|
77
|
+
| `onSelect` | `(value: string \| string[], id?: string) => void` | Called when an item is selected or deselected |
|
|
78
|
+
|
|
79
|
+
##### Optional props
|
|
80
|
+
|
|
81
|
+
| Name | Type | Default | Description |
|
|
82
|
+
| ------------- | --------- | ----------------------- | ----------------------------------------------------------------------------- |
|
|
83
|
+
| `id` | `string` | `undefined` | Prefix for input element IDs, useful when multiple lists are on the same page |
|
|
84
|
+
| `name` | `string` | `undefined` | Name attribute for grouping radio inputs |
|
|
85
|
+
| `optional` | `boolean` | `false` | Allows deselecting the current selection by clicking it again |
|
|
86
|
+
| `horizontal` | `boolean` | `false` | Lays items out in a wrapping row instead of a vertical stack |
|
|
87
|
+
| `newValue` | `boolean` | `false` | Shows an "+ Add new value" button for typing in custom options |
|
|
88
|
+
| `placeholder` | `string` | `"Type a new value..."` | Placeholder text for the new value input field |
|
|
89
|
+
|
|
90
|
+
##### RadioListItem
|
|
91
|
+
|
|
92
|
+
| Name | Type | Description |
|
|
93
|
+
| ------------ | -------------- | ------------------------------------------------------------ |
|
|
94
|
+
| `id` | `string` | Unique identifier for the item |
|
|
95
|
+
| `label` | `string` | Display label shown next to the radio/checkbox input |
|
|
96
|
+
| `content` | `string` | Optional description text rendered below the label |
|
|
97
|
+
| `addContent` | `ReactElement` | Optional React element rendered below the label or content |
|
|
98
|
+
| `disabled` | `boolean` | When `true`, the item is non-interactive and visually dimmed |
|