krypton-ui
Version:
<h1 align="center"> <p align="center"><a href="https://krypton-ui.com"><img src="https://user-images.githubusercontent.com/7073241/224507377-395bffc0-9ff7-4d74-865b-f734394a7e7e.png" alt="Krypton" width="200"></a></p> </h1>
37 lines (36 loc) • 1.05 kB
TypeScript
import { ComponentPropsWithRef } from "react";
import { Color } from "../../types";
type ErrorType = {
error?: string;
};
type InputBaseType = {
fullWidth: boolean;
beginIcon: React.ReactNode;
endIcon: React.ReactNode;
};
type InputBaseStyleType = ErrorType & {
color?: Color;
readOnly?: boolean;
};
type InputErrorStyleType = ErrorType;
type InputOptionalType = InputBaseStyleType & {
helperText?: string;
beginIcon?: React.ReactNode;
endIcon?: React.ReactNode;
fullWidth?: boolean;
};
type InputDefaultType = InputOptionalType & {
name: string;
};
type InputFormType = InputOptionalType & {
value: string | number;
onChange: (value?: string) => void;
};
type FormInputType = InputDefaultType | InputFormType;
export type InnerStyledProps = InputBaseType & {
type: string;
};
export type InputFieldStyledProps = InputBaseType & InputBaseStyleType;
export type InputErrorStyledProps = InputErrorStyleType;
export type InputProps = ComponentPropsWithRef<"input"> & FormInputType;
export {};