1.1.26 • Published 8 months ago

@mirach-gtls/gtls-react-component-library v1.1.26

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

React Component Library:


Installation:

npm install @mirach-gtls/gtls-react-component-library

Components:

This library currently has six components:

  • WhiteBox
  • NavBar
  • AppHeader
  • Button
  • MenuButton
  • TableComp

All styles should be implemented using tailwindcss

WhiteBox:

It accepts 2 props:

  • title : String
  • component : JSX element

Code example:

<WhiteBox title="My requests" component={} />

P.S: The whitebox already has some styles imbedded and will take the full width and height of parent component if it's inveloped in one or take the size of the title and component that will be passed as props

WhiteBox

MenuButton:

It accepts 5 props:

  • id : String /// id of the menu button that will be used to navigate between pages
  • activeButtonId: string /// active button id that if it matches will be given a different style
  • onClick: function
  • title: string /// label of the menu button
  • icon: JSX element

Code example:

Svg element in a component <MenuButton id="dashboard" activeButtonId={activeButtonId} onClick={handleClick} title="Dashboard" icon={}/> or Svg element directly: P.S: Svg should not have a class or className and the fill and stroke should be set to "inherit" for the hover or when active effects to be displayed correctly

MenuButton

Button:

It accepts 6 props:

  • name: string
  • icon: JSX element optional
  • className : for CSS styling
  • disabled: boolean optional
  • onClick function
  • hoverBg: string optional if you choose to include it in className

Code example:

Button

AppHeader:

It accepts 2 props:

  • NotificationBell: JSX element optional
  • changeState: function /// prop passed from parent

Code example:

<AppHeader NotificationBell={} changeState={changeState}/>

AppHeader

NavBar:

It accepts 6 props:

  • pp: JSX element of the picture of the employee
  • name: string /// name of the employee
  • logo: ReactNode; JSX element
  • logout function
  • buttons: Button[]; /// array of buttons (different component than the button that is previously mentioned) that will be rendered
  • logoutIcon: JSX element /// icon that can be a string or a jsx element

Code example:

P.S: buttons should be in the following format:

NavBar

TableComp:

It accepts 3 props:

  • headers: HeaderData[];
  • body: JSON Data;
  • fieldStyles : JSON

Code example:

P.S: headers should abid the following structure:

P.SS: fieldStyles should abid the following structure:

You can specify the style that you want in each header A method is implemented that will transform the json data into the following to render the table data correctly

Each object represents a element and the cells represent the inside of it

TableComp

1.1.26

8 months ago

1.1.25

8 months ago

1.1.24

8 months ago

1.1.23

8 months ago

1.1.22

8 months ago

1.1.21

8 months ago

1.1.20

8 months ago

1.1.19

8 months ago

1.1.18

8 months ago

1.1.17

8 months ago

1.1.16

8 months ago

1.1.15

8 months ago

1.1.14

8 months ago

1.1.13

8 months ago

1.1.11

8 months ago

1.1.10

8 months ago

1.1.9

8 months ago

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.20

8 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.4

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago