2023-05-12 16:03:16 +02:00
|
|
|
import { Meta, StoryFn } from "@storybook/react";
|
2023-04-14 16:38:08 +02:00
|
|
|
import React from "react";
|
2023-05-04 15:04:47 +02:00
|
|
|
import { Field } from ":/components/Forms/Field/index";
|
2023-04-14 16:38:08 +02:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
title: "Components/Forms/Field",
|
|
|
|
|
component: Field,
|
2023-05-12 16:03:16 +02:00
|
|
|
} as Meta<typeof Field>;
|
2023-04-14 16:38:08 +02:00
|
|
|
|
2023-05-12 16:03:16 +02:00
|
|
|
const Template: StoryFn<typeof Field> = (args) => (
|
2023-04-14 16:38:08 +02:00
|
|
|
<Field {...args}>
|
|
|
|
|
<strong>Any children</strong>
|
|
|
|
|
</Field>
|
|
|
|
|
);
|
|
|
|
|
|
2023-05-12 16:03:16 +02:00
|
|
|
export const Default = {
|
|
|
|
|
render: Template,
|
|
|
|
|
|
|
|
|
|
args: {
|
|
|
|
|
text: "This is an optional text",
|
|
|
|
|
rightText: "Right text",
|
|
|
|
|
},
|
2023-04-14 16:38:08 +02:00
|
|
|
};
|
|
|
|
|
|
2023-05-12 16:03:16 +02:00
|
|
|
export const Success = {
|
|
|
|
|
render: Template,
|
|
|
|
|
|
|
|
|
|
args: {
|
|
|
|
|
state: "success",
|
|
|
|
|
text: "This is an optional success message",
|
|
|
|
|
rightText: "Right text",
|
|
|
|
|
},
|
2023-04-14 16:38:08 +02:00
|
|
|
};
|
|
|
|
|
|
2023-05-12 16:03:16 +02:00
|
|
|
export const Error = {
|
|
|
|
|
render: Template,
|
|
|
|
|
|
|
|
|
|
args: {
|
|
|
|
|
state: "error",
|
|
|
|
|
text: "This is an optional error message",
|
|
|
|
|
rightText: "Right text",
|
|
|
|
|
},
|
2023-04-14 16:38:08 +02:00
|
|
|
};
|