codex-marketplace-ui-compon.../stories/Input.stories.ts

58 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-08-20 13:57:58 +00:00
import type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";
import { Input } from "../src/components/Input/Input";
2024-08-20 13:57:58 +00:00
import { InputIcon } from "./InputIcon";
const meta = {
title: "Forms/Input",
component: Input,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
argTypes: {},
args: { onChange: fn() },
} satisfies Meta<typeof Input>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
id: "input",
label: "Input",
},
};
export const Helper: Story = {
args: {
id: "helper",
label: "Input",
helper: "Helper text to give some indication.",
},
};
export const Icon: Story = {
args: {
id: "icon",
label: "Icon",
Icon: InputIcon,
},
};
export const Disabled: Story = {
args: {
id: "disabled",
label: "Disabled",
disabled: true,
},
};
export const CustomStyle: Story = {
args: {
id: "custom",
label: "Label",
style: { "--codex-input-border": "1px solid red" },
},
};