@gear-js/vara-ui
Version:
React UI components used across Vara applications
32 lines (31 loc) • 1.01 kB
TypeScript
import { ComponentPropsWithRef, FunctionComponent, ReactNode, SVGProps } from 'react';
type BaseProps = ComponentPropsWithRef<'button'> & {
text?: string;
icon?: FunctionComponent<SVGProps<SVGSVGElement> & {
title?: string | undefined;
}>;
color?: 'primary' | 'plain' | 'contrast' | 'grey' | 'border' | 'transparent' | 'danger';
size?: 'x-small' | 'small' | 'medium' | 'default' | 'x-large';
isLoading?: boolean;
block?: boolean;
noWrap?: boolean;
};
type TextProps = BaseProps & {
text: string;
children?: never;
};
type IconProps = BaseProps & {
icon: FunctionComponent<SVGProps<SVGSVGElement> & {
title?: string | undefined;
}>;
children?: never;
};
type ChildrenProps = BaseProps & {
children: ReactNode;
text?: never;
icon?: never;
};
type Props = TextProps | IconProps | ChildrenProps;
declare const Button: (props: Props) => import("react/jsx-runtime").JSX.Element;
export { Button };
export type { Props as ButtonProps };