0.1.85 • Published 2 years ago

enno-component v0.1.85

Weekly downloads
-
License
-
Repository
-
Last release
2 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

2 years ago

0.1.83

2 years ago

0.1.84

2 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

3 years ago

0.1.69

3 years ago

0.1.64

3 years ago

0.1.65

3 years ago

0.1.66

3 years ago

0.1.67

3 years ago

0.1.68

3 years ago

0.1.63

3 years ago

0.1.62

3 years ago

0.1.61

3 years ago

0.1.60

3 years ago

0.1.59

3 years ago

0.1.58

3 years ago

0.1.57

3 years ago

0.1.56

3 years ago

0.1.55

3 years ago

0.1.54

3 years ago

0.1.53

3 years ago

0.1.52

3 years ago

0.1.51

3 years ago

0.1.50

3 years ago

0.1.49

3 years ago

0.1.48

3 years ago

0.1.47

3 years ago

0.1.46

3 years ago

0.1.45

3 years ago

0.1.44

3 years ago

0.1.43

3 years ago

0.1.42

3 years ago

0.1.41

3 years ago

0.1.40

3 years ago

0.1.39

3 years ago

0.1.38

3 years ago

0.1.37

3 years ago

0.1.36

3 years ago

0.1.35

3 years ago

0.1.34

3 years ago

0.1.33

3 years ago

0.1.32

3 years ago

0.1.31

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.1.312

3 years ago