/* eslint-disable @typescript-eslint/no-explicit-any */ import { useRef, useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; import { Check, Download, Upload } from '@phosphor-icons/react'; import { Button, Flex } from '..'; const meta: Meta = { component: Button, title: 'HTML-Like Component/Button', tags: ['autodocs'], parameters: { layout: 'centered', }, argTypes: { width: { control: { type: 'text', }, }, size: { control: { type: 'radio', }, options: ['small', 'regular', 'medium', 'large'], }, variant: { control: { type: 'select', }, options: ['primary', 'secondary', 'tertiary', 'danger', 'warning', 'warning'], }, shape: { control: { type: 'radio', }, options: ['square', 'round'], }, align: { control: { type: 'inline-radio', }, options: ['start', 'center', 'end'], }, disabled: { control: { type: 'boolean', }, }, isLoading: { control: { type: 'boolean', }, }, prefix: { control: { type: { name: 'React.ReactNode', required: false, }, }, }, suffix: { control: { type: { name: 'React.ReactNode', required: false, }, }, }, }, args: { width: 'fit-content', size: 'regular', variant: 'primary', iconOnly: false, shape: 'square', align: 'center', disabled: false, isLoading: false, }, }; export default meta; type Story = StoryObj; export const Primary: Story = { args: { children: 'hello, World!', onClick: () => null, }, }; export const PrefixSuffix: Story = { args: { prefix: , suffix: , children: 'hello, World!', onClick: () => null, }, }; export const AsA: Story = { args: { children: 'hello, World!', as: 'a', href: '/', target: '_blank', }, }; const LoadingTemplateComponent = (arg: any) => { const [loading, setLoading] = useState(false); const timer = useRef(); const onClick = () => { setLoading(true); clearInterval(timer.current); timer.current = setTimeout(() => { setLoading(false); }, 2000); }; return (