@stakefish/ui
Version:
<div align="center"> <a href="https://www.npmjs.com/package/@stakefish/ui"><img src="https://gateway.pinata.cloud/ipfs/QmbZL1ceA8Yiz2pKALTg919jYx141DPUGegC9L4XpyayW5" width="300" /></a> </div>
109 lines (108 loc) • 3.17 kB
TypeScript
/// <reference types="react" />
import { Theme } from "@mui/material/styles";
import { InputProps as MuiInputProps } from "@mui/material/Input";
import { EndAdornmentProps } from "./EndAdornment";
export interface InputProps extends Omit<MuiInputProps, "color" | "size"> {
/**
* The color of the component. The prop defaults to the value (`'primary'`)
*/
color?: "primary" | "secondary";
/**
* The size of the component. The prop defaults to the value (`'md'`)
*/
size?: "xs" | "sm" | "md" | "lg";
/**
* If `true`, `Input` element wouldn't render error icon in default.
* The props defaults to the value `false`.
*/
overrideErrorAdornment?: boolean;
/**
* If not undefined, an action button is rendered as part of end adornment.
*/
actionButtonProps?: EndAdornmentProps["actionButtonProps"];
}
interface StyledInputProps extends Omit<InputProps, "color" | "size"> {
size?: InputProps["size"];
$append?: boolean;
}
interface ExtendedStyledInputProps extends StyledInputProps {
theme: Theme;
}
export declare const getFontSize: ({ size, theme }: ExtendedStyledInputProps) => {
main: 17;
mobile: 14;
} | {
main: 19;
mobile: 19;
} | {
main: 28;
mobile: 21;
} | undefined;
export declare const getLineHeight: ({ size, theme }: ExtendedStyledInputProps) => {
main: "24px";
mobile: "20px";
} | {
main: "28px";
mobile: "28px";
} | {
main: "36px";
mobile: "32px";
} | undefined;
export declare const getPadding: ({ size, theme, $append: append }: ExtendedStyledInputProps) => {
main: string;
mobile: string;
} | undefined;
export declare const getRadius: ({ size, theme }: ExtendedStyledInputProps) => {
main: any;
mobile: any;
} | undefined;
export declare const formCommonStyles: (theme: Theme) => {
[x: string]: string | {
backgroundColor: string;
height?: undefined;
boxShadow?: undefined;
"&.Mui-focused"?: undefined;
"&.Mui-error"?: undefined;
} | {
height: string;
backgroundColor?: undefined;
boxShadow?: undefined;
"&.Mui-focused"?: undefined;
"&.Mui-error"?: undefined;
} | {
boxShadow: string;
backgroundColor?: undefined;
height?: undefined;
"&.Mui-focused"?: undefined;
"&.Mui-error"?: undefined;
} | {
"&.Mui-focused": {
boxShadow: string;
};
"&.Mui-error": {
boxShadow: string;
};
backgroundColor?: undefined;
height?: undefined;
boxShadow?: undefined;
};
caretColor: string;
backgroundColor: string;
"&.MuiInputBase-colorSecondary": {
backgroundColor: string;
};
"& input": {
height: string;
};
"&.Mui-focused": {
boxShadow: string;
};
"&.Mui-error": {
boxShadow: string;
};
"&.Mui-disabled": {
backgroundColor: string;
};
};
declare const Input: React.FC<InputProps>;
export default Input;