1.1.4 • Published 4 years ago

olimpo v1.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

olimpo

React Component Framework

NPM JavaScript Style Guide

Olimpo image

Install

npm install --save olimpo

Usage

Button

PropertyDescriptionValues
textText that will be displayedstring
colorButton colorStandart HTML color name: 'red', 'green', 'blue', 'yellow'... RGB code. Ex.: rgb(255,0,0) Hexadecimal color code. Ex.: #FF0000
textColorChange the color of the text displayedStandart HTML color name: 'red', 'green', 'blue', 'yellow'... RGB code. Ex.: rgb(255,0,0) Hexadecimal color code. Ex.: #ff0000
sizeComponent sizeDefault sizes: small, medium, large Number value for size in pixels. Ex.: 100px
shapeComponent and borders shaperound, square, circle
disabledDisable button flag'true' or 'false'
frameworkFramework that component will be used when instanciated'antd' or 'materialui'
onClickCallback method for click eventfunction
onMouseOverCallback method for mouse over the component eventfunction
import React, { Component } from 'react'
import { Button } from 'olimpo'

class Example extends Component {

  onClick = () => {
    console.log("On click event");
  }

  onMouseOver = () => {
    console.log("On mouse over event");
  }

  render() {
    return <Button
        text='My text' 
        size='large'
        color='red'
        textColor='yellow'
        shape='round'
        disabled={false}
        onClick={this.onClick()}
        onMouseOver={this.onMouseOver()}
        
     />
  }
}

Obs.: When use materialui or antd framework component, all properties available on Material-UI and Ant Design documentation can be use.

Input

PropertyDescriptionValues
labelText that will be placed as label above the input fieldstring
placeholderText that will be placed inside the input fieldstring
backgroundColorInput field background colorStandart HTML color name: 'red', 'green', 'blue', 'yellow'... RGB code. Ex.: rgb(255,0,0) Hexadecimal color code. Ex.: #FF0000
sizeComponent sizeDefault sizes: small, medium, large Number value for size in pixels. Ex.: 100px
shapeComponent borders shaperound, square, circle
disabledDisable input field flag'true' or 'false'
errorError on field flag'true' or 'false'
frameworkFramework that component will be used when instanciated'antd' or 'materialui'
onClickCallback method for click eventfunction
onMouseOverCallback method for mouse over the component eventfunction
onChangeCallback method for change component eventfunction
import React, { Component } from 'react'
import { Input } from 'olimpo'

class Example extends Component {

  onClick = () => {
    console.log("On click event");
  }

  onMouseOver = () => {
    console.log("On mouse over event");
  }

  onChange = () => {
    console.log("On change event");
  }

  render() {
    return <Input
        label='This is an example'
        placeholder='Input Example' 
        backgroundColor='#cccc'
        size='large'
        shape='round'
        disabled={false}
        error={false}
        onClick={this.onClick()}
        onMouseOver={this.onMouseOver()}
        onChange={this.onChange()}
     />
  }
}

Obs.: When use materialui or antd framework component, all properties available on Material-UI and Ant Design documentation can be use.

Checkbox

PropertyDescriptionValues
labelText that will be placed as labelstring
backgroundColorCheckbox background colorStandart HTML color name: 'red', 'green', 'blue', 'yellow'... RGB code. Ex.: rgb(255,0,0) Hexadecimal color code. Ex.: #FF0000
sizeComponent sizeDefault sizes: small, medium, large Number value for size in pixels. Ex.: 100px
shapeCheckbox borders shaperound, square, circle
disabledDisable checkbox field flag'true' or 'false'
frameworkFramework that component will be used when instanciated'antd' or 'materialui'
onClickCallback method for click eventfunction
onChangeCallback method for change component eventfunction
labelStyleObject to style exclusively the labelobject
checkboxStyleObject to style exclusively the checkboxobject
import React, { Component } from 'react'
import { Checkbox } from 'olimpo'

class Example extends Component {

  onClick = () => {
    console.log("On click event");
  }

  onChange = () => {
    console.log("On change event");
  }

  render() {
    return 
      <Checkbox 
        label='This is an example' 
        backgroundColor='#cccc'
        size='medium'
        shape='round'
        disabled={false}
        onClick={this.onClick()}
        />
  }
}

Obs.: When use materialui or antd framework component, all properties available on Material-UI and Ant Design documentation can be use.

Avatar

PropertyDescriptionValues
typeAvatar type that will be usedIt can be 'image' or 'text'
srcLink for the image that will be displayed when type is 'image'string
altValue for when image can't be loadedstring
valueText that will displayed when type is 'text'string
fontColorColor for the text font when type is 'text'Standart HTML color name: 'red', 'green', 'blue', 'yellow'... RGB code. Ex.: rgb(255,0,0) Hexadecimal color code. Ex.: #FF0000
backgroundColorAvatar background color when type is 'text'Standart HTML color name: 'red', 'green', 'blue', 'yellow'... RGB code. Ex.: rgb(255,0,0) Hexadecimal color code. Ex.: #FF0000
sizeAvatar sizeDefault sizes: small, medium, large Number value for size in pixels. Ex.: 100
shapeCheckbox borders shaperound, square, circle
frameworkFramework that component will be used when instanciated'antd' or 'materialui'
onMouseOverCallback method for mouse over the component eventfunction
import React, { Component } from 'react'
import { Avatar } from 'olimpo'

class Example extends Component {

  onMouseOver = () => {
    console.log("On mouse over event");
  }

  render() {
    return 
      <Avatar 
        type='text'
        value='Olimpo'
        fontColor='white'
        backgroundColor='#0891a1'
        shape='circle' 
        size='large'
        onMouseOver={this.onMouseOver()} 
      />
  }
}

Obs.: When use materialui or antd framework component, all properties available on Material-UI and Ant Design documentation can be use.

Contributing Guide

Olimpo welcome all contributions. Please read contributing guide first. You can submit any ideas as pull requests or as GitHub issues. If you'd like to improve code, follow the develop patterns that already exist in other components and have a good time! :smile: For every new component, it must exist on others frameworks! Olimpo is the house of all gods, can you imagine if only Zeus live there? :stuck_out_tongue_winking_eye:

Development

To start develpment in olimpo there is a few things that you need to do in order to get it running on your machine. First setup you environment:

cd olimpo/
npm install

To create a new component you can run npm run create that will initialize a component class for you instead of you have to write everything from scratch.

Then you are able to start it. For development, you can start a rollup and also a example if you want to check visualy your change or new component. Jut import the module from local files, you need to import olimpo on your project then run the following commands:

npm start ./olimpo
npm start ./olimpo/example

All new component MUST be exported at index.js file.

Tests and Lint

As part of the good pratices pack, tests MUST be written for every change. Change or new components that don't have tests won't be accepted. So please, make sure tests are passing and testing every thing the right way before a pull request is open.

Also, make sure that lint are running and no errors are ocurring, this helps to implement a pattern for olimpo and it should be followed by everyone. :smile:

Documentation

For better usability and understanding, documentation is very necessary, so for every contribution that changes a component interface/property or add a new component to olimpo, it MUST have the right documentation. Add documentation location of the other frameworks as well! Check the example below:

PropertyDescriptionValues
propertyProperty descriptionPossible values
import React, { Component } from 'react'
import MyComponent from 'olimpo'
 
class Example extends Component {
  render() {
    return <MyComponent property='myPropery'/>
  }
}

Pull requests

If you are contributign with olimpo, make sure that everything is tested and ready for be in master before you open the pull request. In pull request description, please, specify what is the change or new component that are being merged. Give every possible detail about it, this way the development team that mantains the framework can merge this as soon as possible!

License

MIT © pereiraguilherme

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago