@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS
40 lines (36 loc) • 1.26 kB
TypeScript
import { AllHTMLAttributes, ReactNode, ElementType, MouseEvent, CSSProperties } from 'react';
import { Breakpoint } from './src/types.js';
import { Themes } from './src/constants.js';
declare enum Variants {
Display = "display",
Primary = "primary",
Secondary = "secondary",
Text = "text"
}
declare const DEFAULT_VARIANT = Variants.Primary;
interface ButtonProps extends Omit<AllHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, 'label' | 'onClick' | 'wrap'> {
children?: ReactNode;
disabled?: boolean;
element?: ElementType;
fullStyle?: boolean;
fullWidth?: boolean;
href?: string;
icon?: ReactNode;
iconHidden?: boolean | Breakpoint;
iconOnly?: boolean | 'auto' | Breakpoint;
iconPosition?: 'left' | 'right';
inlineStyle?: boolean;
label?: ReactNode;
target?: HTMLAnchorElement['target'];
theme?: Themes;
truncate?: boolean;
type?: 'button' | 'reset' | 'submit';
underlined?: boolean;
variant?: `${Variants}`;
wrap?: boolean;
onClick?: (event: MouseEvent<HTMLElement>) => void;
wrapperClassName?: string;
wrapperStyles?: CSSProperties;
disableClickTracking?: boolean;
}
export { type ButtonProps as B, DEFAULT_VARIANT as D, Variants as V };