Skip to content

Commit 019565c

Browse files
author
Said Shah
committed
Updated version for Reach UI
1 parent a5fb714 commit 019565c

File tree

3 files changed

+119
-116
lines changed

3 files changed

+119
-116
lines changed

package-lock.json

Lines changed: 58 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://github.com/AndcultureCode/AndcultureCode.JavaScript.React.Components/issues"
2222
},
2323
"dependencies": {
24-
"@reach/menu-button": "0.10.2",
24+
"@reach/menu-button": "0.11.2",
2525
"@tippyjs/react": "4.0.2",
2626
"@types/react": "16.9.11",
2727
"@types/react-beautiful-dnd": "13.0.0",
Lines changed: 60 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,72 @@
1-
// import { optionsKnob } from "@storybook/addon-knobs";
2-
import { DropdownButton } from "./dropdown-button";
1+
import { optionsKnob } from "@storybook/addon-knobs";
2+
import { DropdownButton, DropdownItem } from "./dropdown-button";
33
import React from "react";
4-
// import { ButtonSizes } from "../../atoms/constants/button-sizes";
5-
// import { ButtonStyles } from "../../atoms/constants/button-styles";
6-
// import { Icon } from "../../atoms/icons/icon";
7-
// import { Icons } from "../../atoms/constants/icons";
4+
import { ButtonSizes } from "../../atoms/constants/button-sizes";
5+
import { ButtonStyles } from "../../atoms/constants/button-styles";
6+
import { Icon } from "../../atoms/icons/icon";
7+
import { Icons } from "../../atoms/constants/icons";
88

99
export default {
1010
component: DropdownButton,
1111
title: "Molecules | Dropdown Button",
1212
};
1313

1414
export const dropdownButtonKnobs = () => {
15-
// const items: Array<DropdownItem> = [
16-
// {
17-
// component: "Item #1",
18-
// onSelect: () => window.alert("Clicked dropdown item #1!"),
19-
// },
20-
// {
21-
// component: "Item #2",
22-
// onSelect: () => window.alert("Clicked dropdown item #2!"),
23-
// },
24-
// {
25-
// component: "Item #3",
26-
// onSelect: () => window.alert("Clicked dropdown item #3!"),
27-
// },
28-
// {
29-
// component: "Item #4",
30-
// onSelect: () => window.alert("Clicked dropdown item #4!"),
31-
// },
32-
// {
33-
// component: "Item #5",
34-
// onSelect: () => window.alert("Clicked dropdown item #5!"),
35-
// },
36-
// ];
15+
const items: Array<DropdownItem> = [
16+
{
17+
component: "Item #1",
18+
onSelect: () => window.alert("Clicked dropdown item #1!"),
19+
},
20+
{
21+
component: "Item #2",
22+
onSelect: () => window.alert("Clicked dropdown item #2!"),
23+
},
24+
{
25+
component: "Item #3",
26+
onSelect: () => window.alert("Clicked dropdown item #3!"),
27+
},
28+
{
29+
component: "Item #4",
30+
onSelect: () => window.alert("Clicked dropdown item #4!"),
31+
},
32+
{
33+
component: "Item #5",
34+
onSelect: () => window.alert("Clicked dropdown item #5!"),
35+
},
36+
];
3737

3838
return (
39-
<strong>
40-
TODO:
41-
https://github.com/AndcultureCode/AndcultureCode.JavaScript.React.Components/issues/22
42-
</strong>
43-
// <DropdownButton
44-
// buttonContents={
45-
// <React.Fragment>
46-
// Dropdown
47-
// <Icon type={Icons.ChevronDown} />
48-
// </React.Fragment>
49-
// }
50-
// menuItems={items}
51-
// size={optionsKnob(
52-
// "Button Size",
53-
// {
54-
// small: ButtonSizes.Small,
55-
// medium: ButtonSizes.Medium,
56-
// large: ButtonSizes.Large,
57-
// },
58-
// ButtonSizes.Small,
59-
// { display: "radio" }
60-
// )}
61-
// style={optionsKnob(
62-
// "Button Style",
63-
// {
64-
// anchor: ButtonStyles.Anchor,
65-
// destructive: ButtonStyles.Destructive,
66-
// primary: ButtonStyles.Primary,
67-
// secondary: ButtonStyles.Secondary,
68-
// tertiary: ButtonStyles.Tertiary,
69-
// tertiaryAlt: ButtonStyles.TertiaryAlt,
70-
// },
71-
// ButtonStyles.Primary,
72-
// { display: "radio" }
73-
// )}
74-
// />
39+
<DropdownButton
40+
buttonContents={
41+
<React.Fragment>
42+
Dropdown
43+
<Icon type={Icons.ChevronDown} />
44+
</React.Fragment>
45+
}
46+
menuItems={items}
47+
size={optionsKnob(
48+
"Button Size",
49+
{
50+
small: ButtonSizes.Small,
51+
medium: ButtonSizes.Medium,
52+
large: ButtonSizes.Large,
53+
},
54+
ButtonSizes.Small,
55+
{ display: "radio" }
56+
)}
57+
style={optionsKnob(
58+
"Button Style",
59+
{
60+
anchor: ButtonStyles.Anchor,
61+
destructive: ButtonStyles.Destructive,
62+
primary: ButtonStyles.Primary,
63+
secondary: ButtonStyles.Secondary,
64+
tertiary: ButtonStyles.Tertiary,
65+
tertiaryAlt: ButtonStyles.TertiaryAlt,
66+
},
67+
ButtonStyles.Primary,
68+
{ display: "radio" }
69+
)}
70+
/>
7571
);
7672
};

0 commit comments

Comments
 (0)