create raw component
This commit is contained in:
parent
1a42b0321d
commit
3d6d6ce634
21
src/components/TextInput.tsx
Normal file
21
src/components/TextInput.tsx
Normal 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})} />
|
||||
);
|
||||
|
||||
}
|
17
src/stories/TextInput.stories.tsx
Normal file
17
src/stories/TextInput.stories.tsx
Normal 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'
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user