Files
web/apps/scandic-web/components/TempDesignSystem/Button/button.ts
2025-05-22 14:00:37 +02:00

21 lines
674 B
TypeScript

import type { VariantProps } from "class-variance-authority"
import type { ButtonProps as ReactAriaButtonProps } from "react-aria-components"
import type { buttonVariants } from "./variants"
export interface ButtonPropsRAC
extends Omit<ReactAriaButtonProps, "isDisabled" | "onClick">,
VariantProps<typeof buttonVariants> {
asChild?: false | undefined | never
disabled?: ReactAriaButtonProps["isDisabled"]
onClick?: ReactAriaButtonProps["onPress"]
}
export interface ButtonPropsSlot
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild: true
}
export type ButtonProps = ButtonPropsSlot | ButtonPropsRAC