GithubHelp home page GithubHelp logo

eldroos / react-components Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seb-oss/react-components

0.0 0.0 0.0 9.82 MB

Home Page: https://sebgroup.github.io/react-components/

License: Apache License 2.0

JavaScript 2.40% TypeScript 74.29% HTML 0.26% CSS 23.05%

react-components's Introduction

SEB React Components

Build Status Commitizen friendly semantic-release Coverage Status

This is a set of react components some of which are based on SEB's bootstrap. The plan for this project is to increase and improve components for future usage.

  •   The package name: `@sebgroup/react-components`
    
  •   The package documentation: [Documentation](https://sebgroup.github.io/react-components)
    
  •   The package sourcecode: [Github Source Code](https://github.com/sebgroup/react-components)
    

Minimum requirements

This version of components has been developed with:

  • React 16.10.1
  • Typescript 3.6.3
  • SEB Bootstrap 4.0.0

Installation

You should be able to install the NPM package.

npm install @sebgroup/react-components --save

This project is based on SEB Bootstrap which includes fonts, colors and variables, to make sure everything works fine, please install these dependencies on your project:

npm install @sebgroup/bootstrap --save

Then make sure you add the Main SEB bootstrap package in your main style.SCSS or index.ts as follows @import '~@sebgroup/bootstrap/scss/bootstrap';.

For Visual Studio Code users, please install official TSLint plugin which has been published by Microsoft on your IDE, to enable ts-linting as by default you need to pass TSLint to be able to compile your code for production.

Development

This project uses proper ts-linting and our lints are based on tslint:latest and tslint-react, with our changes in lint rules for a more consistent (less annoying) coding. We are using 4 different builds for this project. The src folder is where the actual components exist with all their necessary dependencies. and develop folder is where we develop and test those components. Unit tests are based on jest and enzyme.

  1. Development: npm start
  2. Check for Lint-ing rules, Compile components and Create Docs folder: npm run build
  3. Build and create the Documentation pages only: npm run docs
  4. To run the unit tests, run: npm test
  5. To run a unit test for a specific component you have to pass the name of the component in comp variable, run: npm test Button. It can also be chained with multiple specific components, e.g. npm test Button RadioGroup

Usage

For performance benefits we are not combining all the components into single Index rather they are chunked into their subpackage. Therefore, to use a component, you need to import the Component submodule from the dist folder, in whichever Class you want to use it. Here is a sample of how to import a Button component in a page.

import { Button } from "@sebgroup/react-components/dist/Button";

class Comp extends React.Component<any, any> {
    constructor(props) {
        super(props);

        this.onClick = this.onClick.bind(this);
    }

    onClick(e) {
        console.log("Im Clicked");
    }

    render() {
        return (
            <div>
                <Button label="a button" onClick={this.onClick} />
            </div>
        );
    }
}
export default Comp;

react-components's People

Contributors

dansallau avatar dependabot[bot] avatar hjalmers avatar kherp avatar mario-subo avatar mohsenzaim avatar omarvodiak avatar yousifalraheem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.