import React from 'react'; import { EnvelopeIcon } from '@heroicons/react/24/solid'; import type { ComponentMeta } from '@storybook/react'; import type { ButtonAddOnPosition, ButtonDisplay, ButtonSize, ButtonType, ButtonVariant, } from '@tih/ui'; import { Button } from '@tih/ui'; 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 { argTypes: { addonPosition: { control: { type: 'select' }, options: buttonAddOnPositions, }, disabled: { control: 'boolean', }, display: { control: { type: 'select' }, options: buttonDisplays, }, isLoading: { control: 'boolean', }, label: { control: 'text', }, size: { control: { type: 'select' }, options: buttonSizes, }, type: { control: { type: 'select' }, options: buttonTypes, }, variant: { control: { type: 'select' }, options: buttonVariants, }, }, component: Button, title: 'Button', } 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) => (
); }