import { ComponentMeta, ComponentStory } from "@storybook/react"; import React, { useState } from "react"; import { faker } from "@faker-js/faker"; import { Select } from ":/components/Forms/Select"; import { Button } from ":/components/Button"; import { CunninghamProvider } from ":/components/Provider"; export default { title: "Components/Forms/Select/Mono", component: Select, } as ComponentMeta; const Template: ComponentStory = (args) => (
setValue(e.target.value as string)} />
); }; export const Overflow = Template.bind({}); Overflow.args = { label: "Select a city", options: [ { value: "1", label: "Very long long long long long long long city name", }, ], defaultValue: "1", }; export const SearchableEmpty = Template.bind({}); SearchableEmpty.args = { label: "Select a city", options: OPTIONS, searchable: true, }; export const SearchableUncontrolled = Template.bind({}); SearchableUncontrolled.args = { label: "Select a city", options: OPTIONS, defaultValue: OPTIONS[4].value, searchable: true, }; export const SearchableDisabled = Template.bind({}); SearchableDisabled.args = { label: "Select a city", options: OPTIONS, defaultValue: OPTIONS[4].value, searchable: true, disabled: true, }; export const SearchableControlled = () => { const [value, setValue] = useState(OPTIONS[8].value); return (
Value: {value}
); };