UNPKG

@szum-tech/design-system

Version:

Szum-Tech design system with tailwindcss support

65 lines (60 loc) 2.01 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import * as React from 'react'; import { VariantProps } from 'class-variance-authority'; import * as class_variance_authority_types from 'class-variance-authority/types'; type Props = { /** * Defines button full width */ fullWidth?: boolean; /** * Defines button color */ color?: ButtonColorType; /** * Defines button variant */ variant?: ButtonVariantType; /** * Defines button size */ size?: ButtonSizeType; /** * Defines button content */ children?: React.ReactNode; /** * Disabled button */ disabled?: boolean; /** * Defines left icon */ startIcon?: React.ReactElement; /** * Defines right icon */ endIcon?: React.ReactElement; /** * Defines is button is in loading state */ loading?: boolean; /** * Defines is position of loading icon */ loadingPosition?: "start" | "end"; asChild?: boolean; }; type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & Props; declare function Button({ asChild, variant, color, disabled, fullWidth, loadingPosition, ref, ...props }: ButtonProps): react_jsx_runtime.JSX.Element; declare const buttonCva: (props?: ({ fullWidth?: boolean | null | undefined; color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined; size?: "sm" | "md" | "lg" | null | undefined; variant?: "text" | "outlined" | "contained" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; type ButtonCvaProps = VariantProps<typeof buttonCva>; type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>; type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>; type ButtonColorType = NonNullable<ButtonCvaProps["color"]>; export { Button, type ButtonColorType, type ButtonProps, type ButtonSizeType, type ButtonVariantType };