import { Meta } from "@storybook/addon-docs/blocks";

<Meta title="Intro" />

<img src="/trinity-logo.png" alt="Trinity Design System" style={{ display: 'block', paddingBottom: '40px'}} />

## Geting started

The Trinity Design System is a reusable component library that enables Hermes developers to build complex and powerful UI's faster.

## Install

TDS components are written in Vue JS, and its stories are written in [Component Story Format](https://medium.com/storybookjs/component-story-format-66f4c32366df). It requires Storybook version 5.2-beta and up.

TDS is compatible with both Vue CLI and Nuxt

Add TDS to your project.

`npm install tds-test-library`

`npm install nuxt-tds-test-library`

## **Use**

and use them like so

```
      <H-Button appearance="primary" onClick={() => 0}>Do something</H-Button>
```
Additional documentation is available on individual components.

### Browser and device support

TDS is built to be compatible with IE11, MS Edge, Chrome, Mozilla Firefox, Safari and Opera.

Both Android and iOs are supported.

### **Run and develop TDS locally**

Clone the [TDS Project](https://git.hermescloud.co.uk/Hisg721/llana) then start Storybook.

`yarn && yarn run storybook`


### Contributing to the library

CSS naming conventions must be adhered to and follow the BEMIT naming convention, see below for further details.

When adding new components to the library they must be registered in the lib/src/components/index.js file for them to be exposed for use once the package is bundled.


### Updating the npm packages

- Update the version number in `lib/package.json, cli/package.json, nuxt/package.json`.
- Ensure you're in the packages/lib folder
- Run `npm run release` - This will build Trinity and generate a new dist.
- Once this has finished, install the latest version of the library in both plugins:
  - Run `cd ../ && cd cli/ && npm i @hermes-ux/trinity-core && npm run release`.
  - Run `cd ../ && cd nuxt/ && npm i @hermes-ux/trinity-core && npm run release`.
- Now that you have bumped the versions of all of the libraries you can now install the latest versions in any app that is consuming the library.

### CSS Architecture

In order to be highly performant and scalable a number of Methodologies have been used in terms of both architecture and naming conventions. Any additions to the Style Guide must adhere to these and are as follows:

#### Inverted Triangle CSS (ITCSS)

ITCSS stands for Inverted Triangle CSS and it helps organize CSS files in such way that to better deal with CSS specifics like global namespace, cascade and selectors specificity.

One of the key principles of ITCSS is that it separates your CSS codebase to several sections (called layers), which take form of the inverted triangle:

<img src="/itcss-layers.svg" alt="Diagram of inverted triangle CSS" style={{ display: 'block', paddingTop: '40px', paddingBottom: '40px'}} />

### Naming conventions

Classes are named using the BEMIT naming convention, an extension of BEM. The key difference being is that the letter o- is prepended to object classes, c- to components and u- to utilities. This is to reflect the ITCSS architecture.

[BEMIT Cheatsheet](https://gist.github.com/stephenway/a6145d9b4430e8c55a77)

### **Resources**

[GitLab repository](https://git.hermescloud.co.uk/Hisg721/llana)
