feat: refactor Button and Input components to use Headless UI

This commit is contained in:
Ardeman
2025-03-01 16:14:03 +08:00
parent 9ef33d72d3
commit 1e876ae04f
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
import { Button as HeadlessButton } from '@headlessui/react'
import { cva, type VariantProps } from 'class-variance-authority'
import type { ReactNode, ElementType, ComponentPropsWithoutRef } from 'react'
import { twMerge } from 'tailwind-merge'
@@ -52,7 +53,7 @@ export const Button = <C extends ElementType = 'button'>({
className,
...properties
}: ButtonProperties<C>) => {
const Component = as || 'button'
const Component = as || HeadlessButton
const classes = twMerge(buttonVariants({ variant, size, className }))
return (