UNPKG

lucid-ui

Version:

A UI component library from Xandr.

96 lines 3.02 kB
import React from 'react'; import PropTypes from 'prop-types'; import { StandardProps, Overwrite } from '../../util/component-types'; export interface IButtonPropsRaw extends StandardProps { /** * Disables the Button by greying it out * * @default false **/ isDisabled: boolean; /** * Activates the Button by giving it a "pressed down" look * * @default false **/ isActive: boolean; /** * Set this to `true` if you want the Button to only contain an icon. * * @default false * */ hasOnlyIcon: boolean; /** Style variations of the Button */ kind?: 'primary' | 'link' | 'danger' | 'invisible'; /** Size variations of the Button */ size?: 'short' | 'small' | 'large'; /** Called when the user clicks the \`Button\`. */ onClick: ({ event, props, }: { event: React.MouseEvent<HTMLButtonElement>; props: IButtonProps; }) => void; /** * Form element type variations of Button. Passed through to DOM Button. * * @default "button" * */ type: 'submit' | 'reset' | 'button'; } export declare type IButtonProps = Overwrite<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, IButtonPropsRaw>; /** Button */ export declare const Button: { (props: IButtonProps): React.ReactElement; defaultProps: { isDisabled: boolean; isActive: boolean; onClick: (...args: any[]) => void; type: "button"; hasOnlyIcon: boolean; }; displayName: string; peek: { description: string; categories: string[]; }; propName: string; propTypes: { /** Disables the Button by greying it out */ isDisabled: PropTypes.Requireable<boolean>; /** Activates the Button by giving it a "pressed down" look */ isActive: PropTypes.Requireable<boolean>; /** Class names that are appended to the defaults */ className: PropTypes.Requireable<string>; /** Set this to \`true\` if you want the Button to only contain an icon. */ hasOnlyIcon: PropTypes.Requireable<boolean>; /** Any valid React children */ children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; /** Style variations of the Button */ kind: PropTypes.Requireable<string>; /** Size variations of the Button */ size: PropTypes.Requireable<string>; /** Called when the user clicks the \`Button\`. */ onClick: PropTypes.Requireable<(...args: any[]) => any>; /** Form element type variations of Button. Passed through to DOM Button. */ type: PropTypes.Requireable<string>; }; }; export default Button; //# sourceMappingURL=Button.d.ts.map