2024-08-20 13:57:58 +00:00
|
|
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
|
|
import { fn } from "@storybook/test";
|
2024-08-21 15:14:40 +00:00
|
|
|
import { InputGroup } from "../src/components/InputGroup/InputGroup";
|
2024-08-20 13:57:58 +00:00
|
|
|
|
|
|
|
const meta = {
|
2024-08-20 13:57:58 +00:00
|
|
|
title: "Forms/InputGroup",
|
2024-08-20 13:57:58 +00:00
|
|
|
component: InputGroup,
|
|
|
|
parameters: {
|
|
|
|
layout: "centered",
|
|
|
|
},
|
|
|
|
tags: ["autodocs"],
|
|
|
|
argTypes: {},
|
2024-08-22 18:04:24 +00:00
|
|
|
args: {
|
|
|
|
onGroupChange: fn(),
|
|
|
|
onChange: fn(),
|
|
|
|
onFocus: fn(),
|
|
|
|
onBlur: fn(),
|
|
|
|
onMouseEnter: fn(),
|
|
|
|
onMouseLeave: fn(),
|
|
|
|
},
|
2024-08-20 13:57:58 +00:00
|
|
|
} satisfies Meta<typeof InputGroup>;
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
export const Simple: Story = {
|
|
|
|
args: {
|
|
|
|
id: "input",
|
|
|
|
label: "Input",
|
|
|
|
group: "Seconds",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Select: Story = {
|
|
|
|
args: {
|
|
|
|
id: "input",
|
|
|
|
label: "Input",
|
|
|
|
group: [
|
|
|
|
["seconds", "Seconds"],
|
|
|
|
["minutes", "Minutes"],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
};
|