1.1.59 • Published 2 years ago

react-component-library-sutradhar v1.1.59

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React UI components library

This library contains UI components to be used in forms with various inputs.

Documentation links

Installation and usage.

To install and use the components in the library run below commands:

npm i react-component-library-sutradhar

Note: In case of missing dependecy error, run below command:

npm i @mui/material react react-dom react-table styled-components react-icons @emotion/styled

Usage/Examples

TextField

TextField accepts regular string input.

import { Textfield } from 'react-components-library-sutradhar'
/* Props Example: 
  border: "standard" | "outlined" | "filled";
  width: '100px' '50%';
  fontSize: '14px';
  fontColor: '#000000'
  errorState: {
    isError: true | false,
    errorMessage: 'Enter error message here'
  }
  handleReturnValue: callbackfunction
*/
function App() {
  return <TextField
          label={label}
          placeholder='Enter date'
          border={border}
          width='200px'
          fontSize={fontSize}
          fontColor={fontColor}
          handleReturnValue={handleValue}
          error={errorState}
        />
}

TextInput with Search Modal

TextInputWithSearch accepts string input. On presssing enter the provided value to the input can be submitted. If the provided values matches the provided data options the matched value will be set.

import { TextInputWithSearch } from 'react-components-library-sutradhar'
/* Props Example: 
  border: "standard" | "outlined" | "filled";
  width: '100px' '50%';
  fontSize: '14px';
  fontColor: '#000000'
  listData: [
    {
      id: 1,
      firstName: Jon,
      lastName: Doe
    },
    {
      id: 1,
      firstName: Jon,
      lastName: Doe
    },
    ....
  ]
  // searchBy will be the same value you will enter in textfield as input
  searchBy: firstName
  handleReturnValue: callbackfunction
*/

function App() {
  return <TextInputWithSearch
          fontFamily='Arial'
          label='Test Label'
          fontSize='14px'
          fontColor='#000000'
          listData={testData}
          placeholder='Enter text'
          searchBy='firstName'
          width='200px'
          handleReturnValue={handleSelectedValues}
        />
}

NumberInput

NumberInput accepts integers as input. \ 4 types of integer inputs:\     1. integer: accepts numbers. \     2. decimal: accepts float values and with 2 digits after the decimal. \     3. amount: accepts integers and masks the value with commas. Eg. 10,200 \     4. decimalMasking: Masks decimal values with commas.

import { NumberInput } from 'react-components-library-sutradhar'

/* Props Example: 
  border: "standard" | "outlined" | "filled";
  width: '100px' '50%';
  fontSize: '14px';
  fontColor: '#000000'
  type: 'integer' | 'decimal' | 'decimalMasking' | 'amount'
  handleReturnValue: callbackfunction,
  // To provide range input i.e. To & From values 
  isRangeInput: true | false
*/

function App() {
  return <NumberInput
          type= 'decimalMasking'
          label='Test label'
          border='outlined'
          fontSize='14px'
          font='Arial'
          width='200px'
          placeholder='Enter text'
          handleReturnValue={handleReturnedValue}
          isRangeInput={false}
        />
}

DateInput

Accepts integer values as dates. If the input format is correct then input value is accpeted as enter is pressed. \ Supportted formats: ddmmyy, ddmmyyyy \ Eg. 010211 (ddmmyy) = 01/02/2011 \ 01042022 (ddmmyyyyy) = 01/04/2022

import { DateInput } from 'react-components-library-sutradhar'

/* Props Example: 
  border: "standard" | "outlined" | "filled";
  width: '100px' '50%';
  fontSize: '14px';
  fontColor: '#000000'
  type: 'integer' | 'decimal' | 'decimalMasking' | 'amount'
  handleReturnValue: callbackfunction,
  // To provide range input i.e. To & From values 
  isRangeInput: true | false
*/

function App() {
  return <DateInput
          type= 'decimalMasking'
          label='Test label'
          border='outlined'
          fontSize='14px'
          font='Arial'
          width='200px'
          placeholder='Enter text'
          handleReturnValue={handleReturnedValue}
          isRangeInput={false}
        />
}
1.1.41

2 years ago

1.1.45

2 years ago

1.1.44

2 years ago

1.1.43

2 years ago

1.1.42

2 years ago

1.1.49

2 years ago

1.1.48

2 years ago

1.1.47

2 years ago

1.1.46

2 years ago

1.1.52

2 years ago

1.1.51

2 years ago

1.1.50

2 years ago

1.1.56

2 years ago

1.1.54

2 years ago

1.1.53

2 years ago

1.1.59

2 years ago

1.1.58

2 years ago

1.1.57

2 years ago

1.1.29

3 years ago

1.1.28

3 years ago

1.1.30

3 years ago

1.1.34

3 years ago

1.1.33

3 years ago

1.1.32

3 years ago

1.1.31

3 years ago

1.1.38

3 years ago

1.1.37

3 years ago

1.1.36

3 years ago

1.1.35

3 years ago

1.1.39

3 years ago

1.1.40

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.23

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.20

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago