1.0.0 • Published 5 years ago

@softledger/components v1.0.0

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

Examples

Storybook

Installation

Most of these components rely on Reactstrap

To add to your project:

yarn add reactstrap 
yarn add @softledger/components

Then just import the component:

import { LoadingButton } from '@softledger/components';

Components:

BoolDropDownMenuItem

From src/BoolDropDownMenuItem.jsx

Drop Down Menu Item which is toggled as either on/off on click Component is stateless, so toggle is handled up

proptypedefaultrequireddescription
onToggleFunction:white_check_mark:Function to toggles the value
textString:white_check_mark:Menu Item Text
toggleBoolean:x:If false, will not toggle wrapped dropdown
valueBoolean:x:Current value

ButtonBar

From src/ButtonBar.jsx

Displays a Row a buttons, propertly spaced

proptypedefaultrequireddescription
buttonsArray:white_check_mark:Array of buttons to show, in order
styleObject:x:Additional styles on the containing component

CardValue

From src/CardValue.jsx

Displays a Card with a header and body

proptypedefaultrequireddescription
BodyUnion<String \| Object>:x:Text or JSX to display in the body
HeaderUnion<String \| Object>:x:Text or JSX to display in the heaader
bigBooleanfalse:x:Set true will pad header and body with extra space
styleObject:x:Extra styles to apply to container

ChipButton

From src/ChipButton.jsx

Displays a Pill shaped Button with text and an Icon

proptypedefaultrequireddescription
iconClassString:x:FontAwesome Icon class name (make sure font awesome library is loaded)
onClickFunction:x:Function to call when clicked
styleObject:x:Additional styles to add to container
textUnion<String \| Object>:white_check_mark:Can be text or jsx

ConfirmButton

From src/ConfirmButton.jsx

Button which, when clicked, displays a confirm modal

proptypedefaultrequireddescription
buttonClassString'btn-primary':x:Classes to apply to button "space separated" example: 'btn-success'
buttonTextString'Submit':x:Text to display on the button
confirmBodyUnion<String \| Object>'Please Confirm':x:Text or JSX to show in modal body
confirmTitleUnion<String \| Object>'Are you sure?':x:Text or JSX to show in modal header
disabledBooleanfalse:x:Whether the button is disabled
onConfirmFunction:white_check_mark:Callback when modal is confirmed
styleObject:x:Additional styles to apply to the button

DateFormat

From src/DateFormat.jsx

Formats a date value consistently

proptypedefaultrequireddescription
dateUnion<Object \| String>:white_check_mark:Can be a string, Date() or moment()
formatString'MM/DD/YYYY':x:Moment format specifier

DropDownMenu

From src/DropDownMenu.jsx

Thin wrapper on reactstrap DropdownMenu Toggle tag defaults to a font aweseom bars Controls toggle state

proptypedefaultrequireddescription
classString:x:className to apply to DropDown container
openRightBooleanfalse:x:Should open on the right
toggleTagObject<FontAwesomeIcon icon='bars' />:x:Custom Tag

LoadingButton

From src/LoadingButton.jsx

Multi-purpose button shows loading icon if onSubmit is promise based controls loading state

proptypedefaultrequireddescription
buttonClassString'btn-primary':x:Optional classNames to apply to the button
buttonTextString:x:Text to display on the button required if iconClass is not set
disabledBooleanfalse:x:Set to true to disable the button
iconClassString:x:Font Awesome icon name to be used *if set buttonText is ignored
notPromiseBooleanfalse:x:Specifies that the onClick function does not return a Promise
onClickFunction:white_check_mark:Callback for when the button is clicked *if it does not return a promise, set prop 'notPromise'={true}
toolTipString:x:Text to display as a tooltip when the button is hovered
toolTipPlacementEnum('left','right','top','bottom','topLeft','topRight','bottomLeft','bottomRight')'top':x:Location the tooltip should appear

SLLoadingIcon

From src/SLLoadingIcon.jsx

Loading Icon which displays the SoftLedger Log spinning

proptypedefaultrequireddescription

SLLogo

From src/SLLogo.jsx

SVG generated SoftLedger Logo

proptypedefaultrequireddescription

TabView

From src/TabView.jsx

Thin wrapper on reactstrap's Tabs

proptypedefaultrequireddescription
tabsArray[]<Shape>:white_check_mark:Array of tabs to display
tabs[].BodyObject:white_check_mark:JSX to display as the tab content
tabs[].HeaderString:white_check_mark:Tab Navigation Header Text
tabs[].onClickFunction:x:Optional callback when the tab is clicked useful for loading content

ZeroPad

From src/ZeroPad.jsx

Pads texts with zeroes ('0')

  • Can be text or integer
  • If value.length > pad, no zeroes are added
  • if value is null then '--' is displayed
proptypedefaultrequireddescription
padNumber:white_check_mark:
valueUnion<String \| Number>:x:
1.0.0

5 years ago

0.5.0

5 years ago

0.4.13

6 years ago

0.4.14

6 years ago

0.4.12

6 years ago

0.4.11

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.0

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago