mirror of
https://github.com/tale/headplane.git
synced 2026-09-04 11:15:42 +00:00
feat: redesign buttons and share them in dialogs
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import type { Dispatch, SetStateAction } from 'react';
|
||||
import React, { useRef } from 'react';
|
||||
import { Button as AriaButton } from 'react-aria-components';
|
||||
import { useButton } from 'react-aria';
|
||||
import { useButton, type AriaButtonOptions } from 'react-aria';
|
||||
import { cn } from '~/utils/cn';
|
||||
|
||||
interface Props extends React.HTMLProps<HTMLButtonElement> {
|
||||
variant?: 'heavy'
|
||||
isDisabled?: boolean
|
||||
export interface IconButtonProps extends AriaButtonOptions<'button'> {
|
||||
variant?: 'heavy' | 'light'
|
||||
className?: string
|
||||
children: React.ReactNode
|
||||
label: string
|
||||
}
|
||||
|
||||
export default function IconButton({ variant = 'light', ...props }: Props) {
|
||||
export default function IconButton({ variant = 'light', ...props }: IconButtonProps) {
|
||||
const ref = useRef<HTMLButtonElement | null>(null);
|
||||
const { buttonProps } = useButton(props, ref);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user