mirror of
https://github.com/detleph/components.git
synced 2026-09-04 08:36:03 +02:00
Add default exports and format radiobutton files
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
import RadioButton from "./button/RadioButton";
|
||||||
|
import RadioButtonGroup from "./group/RadioButtonGroup";
|
||||||
|
|
||||||
|
export default { RadioButton, RadioButtonGroup };
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
|
|
||||||
import RadioButtonGroup from "../components/radio/group/RadioButtonGroup";
|
import RadioButtonGroup from "../components/radio/group/RadioButtonGroup";
|
||||||
@@ -8,13 +7,15 @@ import RadioButton from "../components/radio/button/RadioButton";
|
|||||||
export default {
|
export default {
|
||||||
title: "Radio button group",
|
title: "Radio button group",
|
||||||
component: RadioButtonGroup,
|
component: RadioButtonGroup,
|
||||||
argTypes: { onSelection: { action: "select" }, value: {type: "string"} },
|
argTypes: { onSelection: { action: "select" }, value: { type: "string" } },
|
||||||
} as ComponentMeta<typeof RadioButtonGroup>;
|
} as ComponentMeta<typeof RadioButtonGroup>;
|
||||||
|
|
||||||
const Template: ComponentStory<typeof RadioButtonGroup> = (args) => <RadioButtonGroup {...args}>
|
const Template: ComponentStory<typeof RadioButtonGroup> = (args) => (
|
||||||
|
<RadioButtonGroup {...args}>
|
||||||
<RadioButton value="one" label="First option" />
|
<RadioButton value="one" label="First option" />
|
||||||
<RadioButton value="two" label="Second option" />
|
<RadioButton value="two" label="Second option" />
|
||||||
</RadioButtonGroup>;
|
</RadioButtonGroup>
|
||||||
|
);
|
||||||
|
|
||||||
export const DefaultInput = Template.bind({});
|
export const DefaultInput = Template.bind({});
|
||||||
|
|
||||||
@@ -22,4 +23,4 @@ DefaultInput.args = {
|
|||||||
value: undefined,
|
value: undefined,
|
||||||
defaultValue: "two",
|
defaultValue: "two",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
}
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user