UNPKG

2.89 kBMarkdownView Raw
1<p align="center">
2 <h1 align="center">Suka Components Angular</h1>
3 <p align="center">
4 An Angular implementation of the Suka Design System
5 </p>
6</p>
7
8### Getting started
9
10Assuming we're starting with a new @angular/cli project:
11
12```shell
13$ npx @angular/cli new my-project --style=scss
14$ cd my-project
15$ npm i --save @kushki/ng-suka
16```
17
18Then we need to include suka components in `src/styles.scss`:
19
20```scss
21@import '~@kushki/ng-suka/scss/main';
22```
23
24That's it! Now we can run `npm start` and start building out our application!
25
26[![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](https://kushki.github.io/ng-suka/)
27
28[![Edit Carbon Components Angular](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/suka-angular-playground-jrjns)
29
30### Contributing
31
32#### Quickstart
33- fork Kushki/ng-suka and clone it locally
34- run `npm install` to grab all the dependencies, then `npm run storybook` to start storybook
35- **if you are adding a component**:
36 - add a folder with your component code, styles, tests and story under `projects/suka/src`
37 - export your module from `public-api.ts`
38- **if you are contributing a fix**:
39 - add your fix, update the documentation as needed
40 - consider adding or modifying a test case to cover the fix
41- follow the [Angular style guide](https://angular.io/styleguide)
42- be sure to run `npm test` and `npm run lint` to make sure the tests and linter pass
43- submit a PR
44
45#### npm commands
46To keep our build dependencies local we use npm scripts to run our webpack, gulp, and general build tasks. You should never install webpack or gulp globally as that will likely conflict with our version. You should never need to modify the build process to add a component or story.
47- `npm run storybook` to run storybook (port 6006)
48- `npm run build` to generate the dist
49- `npm run lint` to run tslint
50- `npm test` to run tests
51
52### Philosophy
53- Components should be the smallest unit of computation
54 - Think in terms of pages and applications composed from a multitude of components rather than pages or applications as a single unit of computation
55- Components should delegate to the consumer whenever possible
56 - The individual applications should be the single source of truth, and be able to create any UI from our building blocks
57- Components should do one thing, and do it well
58 - This does not mean they should be over specialized, but rather focus on providing a single, core experience
59- Components should NOT maintain more state than absolutely necessary
60 - Likewise, stateless components should be favored whenever possible
61- Components should NOT *necessarily* implement the style guide point-for-point, the guide simply provides guidance on overarching functionality, components should enable that and product specific designs **without** baking in extra functionality
\No newline at end of file