apphouse
Version:
Component library for React that uses observable state management and theme-able components.
48 lines (47 loc) • 1.45 kB
TypeScript
import { HTMLInputTypeAttribute } from 'react';
import { InputToggleTypeButtonStyles } from './input.styles.interface';
import React from 'react';
import { BoxSizeStyles, ButtonStyleVariant } from '../../styles/defaults/themes.interface';
/**
* Interface for the ButtonToggleInputType component
* A private component used by the Input component
*/
export interface InputToggleTypeButtonProps {
/**
* A function that is called when the button is clicked
* @param type
* @returns
*/
onToggle: (type: HTMLInputTypeAttribute) => void;
/**
* The type of the input
*/
type: HTMLInputTypeAttribute;
/**
* Styles to be applied to the button
* @default 'clear'
* @optional
*/
styleOverwrites?: InputToggleTypeButtonStyles;
/**
* If provided, the button will be rendered with this
* icon instead of the default one
* @optional
*/
icon?: React.ReactNode;
/**
* The variant of the input
* @default 'm'
*/
variant?: keyof ButtonStyleVariant;
/**
* The size of the input
*/
size?: keyof BoxSizeStyles;
}
/**
* A private button component used by the Input component
* @param InputToggleTypeButtonProps
* @returns a react component that renders a button with a wrapper
*/
export declare const InputToggleTypeButton: React.ForwardRefExoticComponent<InputToggleTypeButtonProps & React.RefAttributes<HTMLButtonElement>>;