create raw component

This commit is contained in:
Maximus 2022-08-05 12:30:13 +03:00
parent 1a42b0321d
commit 3d6d6ce634
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import classNames from "classnames";
import { omit } from "lodash";
import React from "react";
type Props = {
placeholder?: string | undefined,
color?: string |undefined,
className?: string | undefined,
} & Omit<React.InputHTMLAttributes<HTMLInputElement> ,"">;
export const TextInput = ({
placeholder = undefined,
color = "white",
className,
...props
} :Props) => {
return(
<input type="text" placeholder={placeholder} color={color} className={classNames({className})} />
);
}

View File

@ -0,0 +1,17 @@
import React from "react";
import { ComponentStory, ComponentMeta } from '@storybook/react';
import {TextInput} from "../components/TextInput";
export default {
title: 'Text Input',
component: TextInput,
} as ComponentMeta<typeof TextInput>;
const Template: ComponentStory<typeof TextInput> = (args) => <TextInput {...args} />
export const TextInputStory = Template.bind({});
TextInputStory.args ={
placeholder: "uaaaaaa",
color: 'blue'
}