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 { Select } from "../src/components/Select/Select";
|
2024-08-20 13:57:58 +00:00
|
|
|
|
|
|
|
const meta = {
|
|
|
|
title: "Forms/Select",
|
|
|
|
component: Select,
|
|
|
|
parameters: {
|
|
|
|
layout: "centered",
|
|
|
|
},
|
|
|
|
tags: ["autodocs"],
|
|
|
|
argTypes: {},
|
2024-08-22 18:04:24 +00:00
|
|
|
args: {
|
|
|
|
onFocus: fn(),
|
|
|
|
onBlur: fn(),
|
|
|
|
onMouseEnter: fn(),
|
|
|
|
onMouseLeave: fn(),
|
|
|
|
onChange: fn(),
|
|
|
|
},
|
2024-08-20 13:57:58 +00:00
|
|
|
} satisfies Meta<typeof Select>;
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
args: {
|
|
|
|
id: "select",
|
|
|
|
label: "Select",
|
|
|
|
options: [
|
|
|
|
["value 1", "Text 1"],
|
|
|
|
["value 2", "Text 2"],
|
|
|
|
],
|
2024-10-30 18:25:37 +00:00
|
|
|
value: "value 1"
|
2024-08-20 13:57:58 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|