keycloak-scim/src/stories/MultiLineInput.stories.tsx
Erik Jan de Wit 7161af82b8
initial version of the multi line input (#107)
* initial version of the multi select input

* changed direction and fixed tab index
2020-09-24 09:27:23 +02:00

40 lines
893 B
TypeScript

import React from "react";
import { Meta, Story } from "@storybook/react";
import { action } from "@storybook/addon-actions";
import { useForm } from "react-hook-form";
import { Button } from "@patternfly/react-core";
import {
MultiLineInput,
MultiLineInputProps,
} from "../components/multi-line-input/MultiLineInput";
export default {
title: "MultiLineInput component",
component: MultiLineInput,
} as Meta;
const Template: Story<MultiLineInputProps> = (args) => {
const form = useForm({
defaultValues: {
items: [{ value: "" }],
},
});
return (
<form
onSubmit={form.handleSubmit((data) => {
action("submit")(data);
})}
>
<MultiLineInput {...args} form={form} />
<br />
<br />
<Button type="submit">Submit</Button>
</form>
);
};
export const View = Template.bind({});
View.args = {
name: "items",
};