* change root dit and change way to import modules * update deps to latest versions * use latest tools for building bundles * rewrite webpack config * use nomodule technique for loading modern bundle * inject polyfills by babel usebuiltins * update eslint rules * rename all style files to CSS * use postcss preset env for building styles * proper typescript typing * put all html files to templates folder * etc
22 lines
605 B
TypeScript
22 lines
605 B
TypeScript
import { h, JSX } from 'preact';
|
|
import { forwardRef } from 'preact/compat';
|
|
import b, { Mods, Mix } from 'bem-react-helper';
|
|
|
|
import type { Theme } from 'common/types';
|
|
|
|
export type InputProps = {
|
|
kind?: 'primary' | 'secondary';
|
|
theme?: Theme;
|
|
mods?: Mods;
|
|
mix?: Mix;
|
|
type?: string;
|
|
} & Omit<JSX.HTMLAttributes, 'className'>;
|
|
|
|
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
({ children, theme, mods, mix, type = 'text', ...props }, ref) => (
|
|
<input className={b('input', { mix }, { theme, ...mods })} type={type} {...props} ref={ref}>
|
|
{children}
|
|
</input>
|
|
)
|
|
);
|