1.0.16 • Published 2 years ago

react-typescript-ui-component-library v1.0.16

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Installation

$ npm install -save-dev react-typescript-ui-component-library

Set Up instructions

You can create new react project using the typescript or you can use your existing react-typescript project

$ npx install create-react-app --template typescript<br>

Environment file

Create .env file in your root directory to resolve the sourcemap dependency issue and paste the below code GENERATE_SOURCEMAP=false

Usage

import { Button, Input, Dropdown, Modal } from 'react-typescript-ui-component-library';

function App() {
    return (
        <div className="App">
         <Modal isOpen={true}></Modal>
         <Button label="Test" onClick={(e) => console.log(e.target)} style={{size: 'large'}}></Button>
         <Input type="email" placeholder="text" isValid={true} onChange={()=> {}}></Input>
         <Dropdown options={["sdf", "sdfsdf", "Sfsdf"]} selectedOption='sdfsdf'></Dropdown>
        </div>
    )
}

export default App;

Button component optional properties

label: string disabled: boolean style: object { size?: "small" | "medium" | "large"; primary?: boolean; primaryColor?: string; secondaryColor?: string; hoverPrimaryColor?: string; hoverSecondaryColor?: string; } onClick: MouseEventHandler

Input component optional properties

id: string type: "text" | "number" | "email" value: string isValid: boolean disabled: boolean placeholder: string onChange: ChangeEventHandler

Dropdown component optional properties

options: string[] selectedOption: string onSelect: ReactEventHandler

Modal component optional properties

children: string isOpen: boolean onClose: MouseEventHandler

To run the package

  1. Clone the repository
  2. Install the dependencies with
$ npm install 
  1. Build the components with
$ npm run build 
  1. Run the tests with
$ npm run test

Storybook UI

All the components are build in stories using Storybook. Every component includes a file *.stories.tsx with the possible inputs

$ npm run storybook

This command will execute all the stories present inside all the components and will loaded on the localhost:6006 port

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago