@mavenlink/design-system

0.104.2 • Public • Published

Mavenlink Design System · License Build Status PRs Welcome

A set of React components created by, and for, Mavenlink. See all the available components at our Github Page.

For a living style guide of design patterns, visit our site on Notion.

Installation

  • Install with NPM or Yarn

    npm install --save @mavenlink/design-system
    
    # or
    
    yarn add @mavenlink/design-system
  • Setup React JSX processing. One way of doing that is with babel-loader for Webpack.

  • Setup CSS modules. One way of doing that is with style-loader for Webpack and css-loader for Webpack.

  • Setup SVG processing. One way of doing that is with svg-sprite-loader for Webpack.

    // Webpack configuration
    const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
    
    module.exports = {
      module: {
        rules: [{
          test: /\.jsx?$/,
          use: [{
            loader: 'babel-loader',
          }],
        }, {
          test: /\.css$/,
          use: [{
            loader: 'style-loader'
          }, {
            loader: 'css-loader',
            options: {
              modules: true
            },
          }],
        }, {
          test: /\.svg$/,
          use: [{
            loader: 'svg-sprite-loader',
          }],
        }],
      },
      plugins: [
        new SpriteLoaderPlugin(),
      ],
    };
  • Use in your project

    import Input from '@mavenlink/design-system/src/components/input/input.jsx';
    
    function App() {
      return <Input id="hello!" />;
    }

Style linter

We periodically update and upgrade styles. We have also created linters to help with those changes! To use, do the following:

  • Install stylelint into your project

  • In your stylelint configuration file (.stylelintrc.json, .stylelintrc, stylelint.config.js) include the following:

    const path = require('path');
    
    module.exports = {
      plugins: [
        path.resolve('@mavenlink/design-system/src/linters/colors.js'),
      ],
      rules: {
        'mds/colors': true,
      },
    };
  • Run stylelint to see failures

Documentation

Readme

Keywords

Package Sidebar

Install

npm i @mavenlink/design-system

Weekly Downloads

3

Version

0.104.2

License

MIT

Unpacked Size

862 kB

Total Files

415

Last publish

Collaborators

  • mavenlink-ops
  • guanw88
  • juanca
  • ryandhaase
  • ben-mavenlink