beta-parity-react
Version:
Beta Parity React Components
113 lines • 3.43 kB
TypeScript
import React from 'react';
import './index.css';
import './variables.css';
import { BaseProps } from '../Base';
export declare const sizeInputMap: Record<'sm' | 'md', string>;
/**
* Props for the Input component.
*
* Extends properties from the `input` element.
*/
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
/**
* More props for the wrapper input
*
* @memberof InputProps
*/
wrapperProps?: InputWrapperProps & React.HTMLAttributes<HTMLDivElement>;
/**
* More props for the clear button
*
* @memberof InputProps
*/
clearBtnProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
/**
* Define the visible of clear button
*
* @default false
*
* @memberof InputProps
*/
isClearable?: boolean;
/**
* Define of floating label of input
*
* If the value is component, the floating label will be generate by that component
*
* @memberof InputProps
*/
floatingLabel?: React.ReactNode;
/**
* Callback function when clear value of input
*
* @memberof InputProps
*/
onClear?: () => void;
/**
* More action button, generate in the right of clear button (if any)
*
*
* @memberof InputProps
*/
ActionBtn?: JSX.Element | React.ReactNode;
/**
* Define of error state
*
* @default false
* @memberof InputProps
*/
isError?: boolean;
/**
* Define of error message
*
* @memberof InputProps
*/
errorMessage?: string;
/**
* Define of left icon
*
* @memberof InputProps
*/
leftIcon?: React.ReactNode;
/**
* Define of theme
*
* @default 'default'
* @memberof InputProps
*/
theme?: 'default' | 'alternative';
/**
* Define of size
*
* @default 'sm'
* @memberof InputProps
*/
inputSize?: keyof typeof sizeInputMap;
}
/**
* **Parity Input**
*
* @see {@link https://beta-parity-react.vercel.app/input Parity Input}
*/
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
export interface InputWrapperProps extends React.HTMLAttributes<HTMLDivElement>, BaseProps {
leftElement?: JSX.Element | React.ReactNode;
rightElement?: JSX.Element | React.ReactNode;
}
export declare const InputWrapper: React.ForwardRefExoticComponent<InputWrapperProps & React.RefAttributes<HTMLDivElement>>;
export interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
}
export declare const ErrorMessage: React.ForwardRefExoticComponent<ErrorMessageProps & React.RefAttributes<HTMLDivElement>>;
export interface ValueInputWrapperProps extends React.HTMLAttributes<HTMLDivElement> {
theme?: 'default' | 'alternative';
}
export declare const ValueInputWrapper: React.ForwardRefExoticComponent<ValueInputWrapperProps & React.RefAttributes<HTMLDivElement>>;
export interface UnitSelectorProps extends React.HTMLAttributes<HTMLSelectElement> {
unit?: string | string[];
onUnitChange?: (e: any) => void;
unitValue?: string;
disabled?: boolean;
theme?: 'default' | 'alternative';
}
export declare const UnitSelector: ({ unit, theme, onUnitChange, unitValue, disabled, ...props }: UnitSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
//# sourceMappingURL=index.d.ts.map