Travix-International / travix-ui-kit

[DEPRECATED] Travix UI Components' repository.
https://travix-international.github.io/travix-ui-kit/
MIT License
8 stars 10 forks source link

DEPRECATED

(Please refer to https://github.com/Travix-International/ui/

Travix UI-kit

npm Build Status coverage Greenkeeper badge NSP Status

Travix UI Components' repository.

UI-Kit

Take a look at: https://travix-international.github.io/travix-ui-kit/

How to install and setup

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

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

How install

Prereqs

Installing

How to run living style guide

Development

Start developing

Testing

Requirements