@devopness/ui-react
Version:
Devopness Design System React Components - Painless essential DevOps to everyone
59 lines (58 loc) • 2.35 kB
TypeScript
import { ButtonHTMLAttributes } from 'react';
import { getColor } from '../../../colors';
import { Icon } from '../../../icons';
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
/** Customize background color */
backgroundColor?: string;
/** Customize border color */
borderColor?: string;
/** Predefined style variations for the button */
buttonType?: 'borderless' | 'outlinedSecondary' | 'outlinedAuxiliary' | 'Default';
/** `Warning`: This property overrides the style defined by the `buttonType` property!
*
* Customize elements color
*/
color?: string;
/** Icon name */
icon?: Icon;
/**
* By default the icon color is primary, use this prop to customize "iconColor"
*/
iconColor?: ReturnType<typeof getColor>;
/**
* By default the icon component is 16px high, use this prop to customize "iconSize"
*/
iconSize?: number;
/** Enable button loading animation */
loading?: boolean;
/**
* The button component has a 15px margin on its sides, to remove activate the "noMargin" property
*/
noMargin?: boolean;
/**
* The button component has a 10px margin on its sides, to remove activate the "noIconMargin" property
*/
noIconMargin?: boolean;
/**
* The button component has a 15px padding on its sides, to remove activate the "noPadding" property
*/
noPadding?: boolean;
/**
* It should be true if the button is wrapped in a tooltip
*/
noPointerEvents?: boolean;
/**
* With the property "revertOrientation" it is possible to change the positioning of
* the elements inside the button as "icon" or "loading"
*/
revertOrientation?: boolean;
/**
* By default the button component is 34px high, the "typeSize" property contains
* the "medium" variation that changes to 27px
*/
typeSize?: 'default' | 'medium' | 'auto';
};
/** Primary UI component for user interaction */
declare const Button: ({ backgroundColor, borderColor, buttonType, children, color, disabled, icon, iconColor, iconSize, loading: isLoading, noIconMargin, noMargin, noPadding, noPointerEvents, revertOrientation, tabIndex, type, typeSize, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
export type { ButtonProps };
export { Button };