0.1.85 • Published 3 years ago

enno-component v0.1.85

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

w# Get started

npm Start

To get started with E-nno Components, import {XXXX} from 'enno-component';

Components

Button

Available props :

nametypesDetail
textStringWill be the text in the button
classNameStringbutton-grey or button-blue or button-ghost or button-disabled
sizeStringM or L or S
onClickFunctionPass the onClick function you want on the button
iconJSX iconAdd an icon to the button, ex:<Icons type="ChevronLeft" size="large-icon" />

Icon

Available props :

nametypesDetail
typeStringWill be the text in the button
sizeStringsmall-icon or medium-icon or large-icon

Available of type: 1. ChevronLeft 2. ChevronRight 3. ChevronDown 4. ChevronUp 5. Plus 6. Minus 7. User 8. AtSign 9. Lock 10. X 11. ArrowUpCircle 12. Search 13. Lock 14. AlertCircle 15. CheckCircle 16. ArrowLeft 17. ArrowRight 18. Thermometer

Input

Available props :

nametypesDetail
elementStringInput or Select or TextArea
idString
typeStringHtml input types
labelStringLabel on top of the input
validatorsFunctionFunction to validate the inputs. If not needed, pass an empty array
errorTextStringHelper text below the input
onInputFunctionFunction that handles the input
disabledBooleanLet to enable of disable the input. If true, add "disabled" className.
classNameStringCan set a specific className to overpass the default.
dataArrayLet you pass an array for select html inputs
dataObjectArray of objectsLet you pass an array for select html inputs. Structure : {name:"", id:""}
minNumberWork together with number type
maxNumberWork together with number type
logoIcon componentLet you pass a logo on the right of the input
initialValueString
initialValidBoolean
labelLeftBooleanAlign the labbel on the left of the input
styleInputObjectPass a style object to overwrite defaut styles
styleInputContObjectPass a style object to overwrite defaut styles
styleLabelObjectPass a style object to overwrite defaut styles

NB : validators && onInput works together with the form-hook && validators

Toggle

Available props :

nametypesDetail
nameStringInput name
sizeStringsmall or big
onChangeFunctionGive a function to your toggle
labelRightStringLabel on the right of the toggle
labelLeftStringLabel on the left of the toggle
disabledBooleanDisable the toggle
customSliderWidthStringcustom slider width
customSliderHeightStringcustom slider height
customWidthStringcustom width
customHeightStringcustom height
customTranslateStringcustom translate

Radio

Available props :

nametypesDetail
onChangeFunctionGive a function to your radio
valueString
labelStringLabel on the right of your radio

Checkbox

Available props :

nametypesDetail
onChangeFunctionGive a function to your checkbox
nameStringGive a function to your checkbox
checkedBooleanDefault checked
labelStringLabel on the right of your checkbox

FilePicker

Available props :

nametypesDetail
onInputFunctionHandle downloaded file

NB: work together with form-hook

Login

Available props :

nametypesDetail
successLoginFunctionPass a function on sucessfull login
retrievePasswordFunctionPass a function to retrieve password
handleSubmitFunctionPass a function to submit handler

Avatar

Available props :

nametypesDetail
sizeStringsmall-avatar or medium-avatar or large-avatar
imageBooleanIf true, pass the source. If false, passe the initials
sourceStringlink to an image
descriptionStringLet you pass a description to the picture
initialeStringDisplay initials instead of picture ("S.B.")

Tag

Available props :

nametypesDetail
textStringPass string to be displayed in the tag
typeStringIf true, pass the source. If false, passe the initials

Card

Available props :

nametypesDetail
titleString
childrenJSX comp.Pass your JSX component
styleCardObjectPass a style object to overwrite defaut styles

Navbar

Available props :

nametypesDetail
logoLinkStringSet up the path desired on click for the logo
logoJSX compPass your JSX component
childrenJSX comp.Pass your JSX component
styleCardObjectPass a style object to overwrite defaut styles

NB: As the children, you should pass a div with className="navbar-links-block" Containing 2 elements : an icon and a span

SmallCard

Available props :

nametypesDetail
iconIconImported from icon Component
titleStringLet you se a title to the card
subTitleStringLet you se a sub-title to the card
temperatureNumberLabel on the right of the toggle
menuBooleanAdd or not an icon to the right of the card
onClickFunctionIf Menu is set to true, possibility to add function to the icon
simpleCardBooleanif True, create a simple card with only Title and sub-title

Validators

Available validators :

  1. VALIDATOR_REQUIRE -> input is required
  2. VALIDATOR_FILE -> check if file is existing
  3. VALIDATOR_MINLENGTH -> check min length of the input
  4. VALIDATOR_MAXLENGTH -> check max length of the input
  5. VALIDATOR_MIN -> check min value of the input
  6. VALIDATOR_MAX -> check max value of the input
  7. VALIDATOR_EMAIL -> check if e-mail is valid
  8. VALIDATOR_BOOLEAN -> check if returned value is either true or false

useForm

useForm is a custom hook to help you handle form.

Import the formState and inputHandler to handle your form state and validity by deconstructing :

const [formState, inputHandler] = useForm(
  {
    name: {
      value: '',
      isValid: false
    }
  },
  false // is the default validity of the form
);

Loader

Available props :

nametypesDetail
isLoadingBooleanSet the loading state of the loader

Created with ❤️ by Simon Busch for E-nno Switzerland S.A.

0.1.85

3 years ago

0.1.83

3 years ago

0.1.84

3 years ago

0.1.81

3 years ago

0.1.80

3 years ago

0.1.79

3 years ago

0.1.77

3 years ago

0.1.78

3 years ago

0.1.76

3 years ago

0.1.75

3 years ago

0.1.74

3 years ago

0.1.73

3 years ago

0.1.71

3 years ago

0.1.72

3 years ago

0.1.70

4 years ago

0.1.69

4 years ago

0.1.64

4 years ago

0.1.65

4 years ago

0.1.66

4 years ago

0.1.67

4 years ago

0.1.68

4 years ago

0.1.63

4 years ago

0.1.62

4 years ago

0.1.61

4 years ago

0.1.60

4 years ago

0.1.59

4 years ago

0.1.58

4 years ago

0.1.57

4 years ago

0.1.56

4 years ago

0.1.55

4 years ago

0.1.54

4 years ago

0.1.53

4 years ago

0.1.52

4 years ago

0.1.51

4 years ago

0.1.50

4 years ago

0.1.49

4 years ago

0.1.48

4 years ago

0.1.47

4 years ago

0.1.46

4 years ago

0.1.45

4 years ago

0.1.44

4 years ago

0.1.43

4 years ago

0.1.42

4 years ago

0.1.41

4 years ago

0.1.40

4 years ago

0.1.39

4 years ago

0.1.38

4 years ago

0.1.37

4 years ago

0.1.36

4 years ago

0.1.35

4 years ago

0.1.34

4 years ago

0.1.33

4 years ago

0.1.32

4 years ago

0.1.31

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.1.312

4 years ago