0.16.0 • Published 5 years ago

travix-ui-kit v0.16.0

Weekly downloads
212
License
MIT
Repository
github
Last release
5 years ago

Travix UI-kit

npm Build Status coverage Greenkeeper badge

Travix UI Components' repository.

UI-Kit

Take a look at: https://travix-ui-kit.netlify.com/

How to install and setup

  • npm i react travix-ui-kit -S install as a dependency

Usage

CLI

The UI Kit comes with a CLI tool to help you build your UI bundles (JS and CSS).

To see the options available:

$ node_modules/.bin/travix-ui-kit -h

  Usage: travix-ui-kit [options]

  Options:

    -h, --help                       output usage information
    -V, --version                    output the version number
    -c, --css-dir <directory>        Destination directory of the ui-kit.css
    -e, --environment <environment>  Environment in which to run the build
    -j, --js-dir <directory>         Destination directory of the ui-kit.js
    -t, --theme-file <path>          Path to a theme file to override default UI Kit styles
    -w, --watch                      Enables file-watcher functionality

For example, if we want to generate our UI Bundles, with the default styling, on ./js/ and ./css/ folders, we do:

$ node_modules/.bin/travix-ui-kit -j ./js/ -c ./css/

If we want to pass our own YAML file for styling, we also can do it:

$ node_modules/.bin/travix-ui-kit -j ./js/ -c ./css/ -t ./myDefaultStyle.yml

And for development purposes, we tend to want to watch for changes on the files. That's possible too:

$ node_modules/.bin/travix-ui-kit -j ./js/ -c ./css/ -t ./myDefaultStyle.yml -w

For simplicity purposes we suggest to add a task/script to your package.json, which simplifies the usage of the CLI. E.g.:

{
  "scripts": {
    "build:ui": "travix-ui-kit -j ./js/ -c ./css/ -t ./myDefaultStyle.yml",
    "build:ui-watch": "travix-ui-kit -j ./js/ -c ./css/ -t ./myDefaultStyle.yml -w",
  }
}

The components

JS
const Button = require('travix-ui-kit').Button;
// or
import { Button } from 'travix-ui-kit';

function renderSomething({onAdd}) {
  return (
    <Button size="s" onClick={onAdd}>Add value</Button>
  );
}
CSS

use file node_modules/travix-ui-kit/dist/ui-bundle.css

  • you can create an alias in your webpack plugin
  • or inject it in your page current styles bundle
  • or copy to public folder and add as separate style file with <link>

Warning: Directly using file components/index.scss not recommended. We're not promising that we will use SCSS in future or will keep file's structure


Living style guide

Before installation

  • Soon we will add a public web service. For now you need to install it on your local machine
  • We are using default styling theme. If you need to adjust it, you can do it by passing proper theme YAML file as env var: THEME_PATH=/some/path/to/theme.yaml npm run build

How install

Prereqs

Installing

  • git clone this repo
  • npm ci to install dependencies
  • npm run build to build theme, styles and javascript

How to run living style guide

  • npm run styleguide:build to build web service with living style guide
  • npm run styleguide:server to run web service with living style guide
  • open localhost:6060

Development

Start developing

  • npm run build:watch to build the themes, styles and javascript on each file change
  • npm run build:watch -- -t "./path/to/my/theme.yml" to build using a custom theme (also can use the other options as well).
  • npm run styleguide:server to run web service with livingstyle guide and review changes
  • npm run styleguide:dev to run both styguide:build and styleguide:server

Testing

  • npm test to run unit test
  • npm run update-snapshots to update current unit test snapshots
  • npm run lint to check ES-lint errors

Requirements

  • Developer must follow the sturcture of the project
    • every component must contain own directory with its own .js, .scss and .md files
  • 100% unit test coverage of components and helpers
  • 0 ES lint errors
0.16.0

5 years ago

0.15.14

5 years ago

0.15.13

5 years ago

0.15.12

5 years ago

0.15.11

5 years ago

0.15.10

5 years ago

0.15.9

5 years ago

0.15.8

5 years ago

0.15.7

5 years ago

0.15.6

5 years ago

0.15.5

5 years ago

0.15.3

6 years ago

0.15.2

6 years ago

0.15.1

6 years ago

0.15.0

6 years ago

0.14.1-2

6 years ago

0.14.1-1

6 years ago

0.14.0

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.9.0-0

6 years ago

0.8.0

6 years ago

0.7.10

6 years ago

0.7.9

6 years ago

0.7.8

6 years ago

0.7.7

6 years ago

0.7.6

6 years ago

0.7.5

6 years ago

0.7.4

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.38

6 years ago

0.6.37

6 years ago

0.6.36

7 years ago

0.6.35

7 years ago

0.6.34

7 years ago

0.6.33

7 years ago

0.6.32

7 years ago

0.6.31

7 years ago

0.6.30

7 years ago

0.6.29

7 years ago

0.6.28

7 years ago

0.6.27

7 years ago

0.6.26

7 years ago

0.6.25

7 years ago

0.6.24

7 years ago

0.6.23

7 years ago

0.6.22

7 years ago

0.6.21

7 years ago

0.6.20

7 years ago

0.6.19

7 years ago

0.6.18

7 years ago

0.6.17

7 years ago

0.6.16

7 years ago

0.6.15

7 years ago

0.6.14

7 years ago

0.6.13

7 years ago

0.6.12

7 years ago

0.6.11

7 years ago

0.6.10

7 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago