import { ComponentMeta } from '@storybook/react'; import { Button, ButtonAddOnPosition, ButtonDisplay, ButtonSize, ButtonType, ButtonVariant, } from '@tih/ui'; import React from 'react'; import { EnvelopeIcon } from '@heroicons/react/24/solid'; const buttonTypes: ReadonlyArray = ['button', 'reset', 'submit']; const buttonSizes: ReadonlyArray = ['sm', 'md', 'lg']; const buttonAddOnPositions: ReadonlyArray = [ 'start', 'end', ]; const buttonDisplays: ReadonlyArray = ['block', 'inline']; const buttonVariants: ReadonlyArray = [ 'primary', 'secondary', 'tertiary', 'special', 'success', ]; export default { title: 'Button', component: Button, argTypes: { addonPosition: { options: buttonAddOnPositions, control: { type: 'select' }, }, display: { options: buttonDisplays, control: { type: 'select' }, }, isDisabled: { control: 'boolean', }, isLoading: { control: 'boolean', }, label: { control: 'string', }, size: { options: buttonSizes, control: { type: 'select' }, }, type: { options: buttonTypes, control: { type: 'select' }, }, variant: { options: buttonVariants, control: { type: 'select' }, }, }, } as ComponentMeta; export const Basic = { args: { label: 'Click Me', size: 'md', variant: 'primary', }, }; export function Variant() { return (
{buttonVariants.map((variant) => (
); } export function Size() { return (
{buttonSizes.map((size) => (
); } export function Display() { return (
{buttonSizes.map((size) => (
); } export function Disabled() { return (
{buttonVariants.map((variant) => (
); } export function Loading() { return (
{buttonVariants.map((variant) => (
{buttonVariants.map((variant) => (
); } export function Icons() { return (
{buttonSizes.map((size) => (
{buttonSizes.map((size) => (
{buttonSizes.map((size) => (
); } export function HiddenLabel() { return (
{buttonSizes.map((size) => (
); }