Israel Lavi | b2a3ace | 2018-08-07 10:54:17 +0300 | [diff] [blame] | 1 | import { storiesOf } from '@storybook/angular'; |
| 2 | import '!style-loader!css-loader!sass-loader!./styles.scss'; |
| 3 | |
| 4 | storiesOf('Welcome', module).add('to Storybook', () => ({ |
| 5 | template: ` |
| 6 | <div class="storybook-welcome"> |
| 7 | <h1>ONAP-UI-ANGULAR Style-Guide and Components</h1> |
| 8 | <p> |
| 9 | This project aims to create a unified UI styled components for multiple development teams who work on the same web-based applications. |
| 10 | This repository contains the definition of all the basic widgets and reusable controllers. |
| 11 | </p> |
| 12 | Note: the project is build of 3 different projects: |
| 13 | <ul> |
| 14 | <li><a href="https://github.com/onap-sdc/onap-ui-common">onap-ui-common</a> contains HTML and SCSS files for all components.</li> |
| 15 | <li><a href="https://github.com/onap-sdc/onap-ui-angular">onap-ui-angular</a> contains Angular components according to the HTML defined in onap-ui-common.</li> |
| 16 | <li><a href="https://github.com/onap-sdc/onap-ui-react">onap-ui-react</a> contains React components according to the HTML defined in onap-ui-common.</li> |
| 17 | </ul> |
| 18 | |
| 19 | <h2>Usage</h2> |
| 20 | <h3>Link the library's CSS file</h3> |
| 21 | <p> |
| 22 | There are several options to link to onap-ui-angular CSS file: |
| 23 | </p> |
| 24 | |
| 25 | <h4>SCSS</h4> |
| 26 | <code> |
| 27 | @import "path_to_node_modules/onap-ui/css/style.css"; |
| 28 | </code> |
| 29 | <br><br> |
| 30 | |
| 31 | <h4>HTML</h4> |
| 32 | <code> |
| 33 | <![CDATA[ |
| 34 | <link rel="stylesheet" href="path_to_node_modules/onap-ui/css/style.css"> |
| 35 | ]]> |
| 36 | </code> |
| 37 | <br><br> |
| 38 | |
| 39 | <h4>As Module (Using loading tool, i.e. <a href="https://webpack.github.io/">Webpack</a>)</h4> |
| 40 | <code>import "onap-ui/css/style.css";</code> |
| 41 | <br><br> |
| 42 | |
| 43 | <h4>Angular CLI projects</h4> |
| 44 | <p>You can add this line to style.css file:</p> |
| 45 | <code>@import "../node_modules/onap-ui/css/style.css";</code> |
| 46 | <br><br> |
| 47 | |
| 48 | <h3>Using the library in latest Angular (6)</h3> |
| 49 | <h4>Add the library to your module</h4> |
| 50 | <code> |
| 51 | <![CDATA[ |
| 52 | import { SdcUiComponentsModule, SdcUiComponents } from 'onap-ui-angular'; |
| 53 | @NgModule({ |
| 54 | declarations: [ |
| 55 | AppComponent |
| 56 | ], |
| 57 | imports: [ |
| 58 | BrowserModule, |
| 59 | FormsModule, |
| 60 | HttpModule, |
| 61 | SdcUiComponentsModule |
| 62 | ], |
| 63 | providers: [ |
| 64 | SdcUiComponents.ModalService |
| 65 | ], |
| 66 | bootstrap: [AppComponent] |
| 67 | }) |
| 68 | export class AppModule { } |
| 69 | ]]> |
| 70 | </code> |
| 71 | <br><br> |
| 72 | |
| 73 | <h2>Running storybook</h2> |
| 74 | The components in this library are displayed via <a href="https://github.com/storybooks/storybook">storybook</a>. |
| 75 | Head to <a href="http://onap-sdc.github.io/onap-ui-angular">http://onap-sdc.github.io/onap-ui-angular</a> to see the components that are in <b>master</b>. |
| 76 | While developing, just run <b>npm run storybook</b> in your terminal to launch a local storybook server where you can see your changes. For deploying storybook to your own fork repository, refer to the guides section below. |
| 77 | |
| 78 | <h3>Useful guides</h3> |
| 79 | <ul> |
| 80 | <li><a href="https://github.com/onap-sdc/onap-ui-angular/wiki/Adding-a-new-component">Adding a new component</a></li> |
| 81 | <li><a href="https://github.com/onap-sdc/onap-ui-angular/wiki/Deploying-storybook-to-a-fork's-github-pages">Deploying storybook to a fork's github pages</a></li> |
| 82 | <li><a href="https://github.com/onap-sdc/onap-ui-angular/wiki/Understanding-project-build">Understanding project build</a></li> |
| 83 | </ul> |
| 84 | |
| 85 | <h3>Having some trouble? Have an issue?</h3> |
| 86 | For bugs and issues, please use the <a href="https://github.com/onap-sdc/onap-ui-angular/issues">issues</a> page |
| 87 | |
| 88 | <h3>How to Contribute</h3> |
| 89 | <ul> |
| 90 | <li> |
| 91 | Contribution can be made only by following these guide lines |
| 92 | </li> |
| 93 | <li> |
| 94 | This project combines both <b>React</b> & <b>Angular</b> framework libraries. |
| 95 | Hence, every change in the basic HTML files structure, must be followed by changes on react and angular |
| 96 | projects (<a href="https://github.com/onap-sdc/onap-ui-angular">onap-ui-angular</a>, <a href="https://github.com/onap-sdc/onap-ui-react">onap-ui-react</a>). |
| 97 | </li> |
| 98 | <li> |
| 99 | There will be no any 3rd party UI framework imported (i.e. <b>Bootstrap</b>, <b>Material</b>, <b>Foundation</b>... etc.). |
| 100 | </li> |
| 101 | <li> |
| 102 | Contribution are done only by the <a href="https://github.com/onap-sdc/onap-ui-angular/wiki/Contribution-guide">contribution guide</a>. |
| 103 | Contributions submitted not in this format and guidelines will not be considered. |
| 104 | </li> |
| 105 | </ul> |
| 106 | </div> |
| 107 | `, |
| 108 | props: { |
| 109 | }, |
| 110 | moduleMetadata: { |
| 111 | }, |
| 112 | })); |