Skip to content

Commit 561bf61

Browse files
authored
Merge branch 'master' into theiliad-README-codesandbox
2 parents 3aeb957 + 5851870 commit 561bf61

File tree

176 files changed

+7455
-6132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+7455
-6132
lines changed

.storybook/addons.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
import '@storybook/addon-actions/register';
2-
import '@storybook/addon-links/register';
3-
import '@storybook/addon-notes/register';
4-
import '@storybook/addon-knobs/register'
1+
import "core-js/es6/symbol";
2+
import "core-js/es6/object";
3+
import "core-js/es6/function";
4+
import "core-js/es6/parse-int";
5+
import "core-js/es6/parse-float";
6+
import "core-js/es6/number";
7+
import "core-js/es6/math";
8+
import "core-js/es6/string";
9+
import "core-js/es6/date";
10+
import "core-js/es6/array";
11+
import "core-js/es6/regexp";
12+
import "core-js/es6/map";
13+
import "core-js/es6/set";
14+
import "core-js/es6/reflect";
15+
16+
import "core-js/es7/reflect";
17+
import "zone.js/dist/zone";
18+
19+
import "@storybook/addon-actions/register";
20+
import "@storybook/addon-links/register";
21+
import "@storybook/addon-notes/register";
22+
import "@storybook/addon-knobs/register";

.storybook/bootstrap.module.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
import { NgModule } from "@angular/core";
2-
import { TranslateModule, TranslateService } from "@ngx-translate/core";
3-
const en = require("./../src/i18n/en.json");
42

53
@NgModule({
6-
imports: [
7-
TranslateModule.forRoot()
8-
]
94
})
105
export class BootstrapModule {
11-
constructor(private translateService: TranslateService) {
12-
this.translateService.setDefaultLang("en");
13-
this.translateService.use("en");
14-
this.translateService.setTranslation("en", en);
15-
}
166
}

.storybook/config.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
import "core-js/es6/symbol";
2+
import "core-js/es6/object";
3+
import "core-js/es6/function";
4+
import "core-js/es6/parse-int";
5+
import "core-js/es6/parse-float";
6+
import "core-js/es6/number";
7+
import "core-js/es6/math";
8+
import "core-js/es6/string";
9+
import "core-js/es6/date";
10+
import "core-js/es6/array";
11+
import "core-js/es6/regexp";
12+
import "core-js/es6/map";
13+
import "core-js/es6/set";
14+
import "core-js/es6/reflect";
15+
16+
import "core-js/es7/reflect";
17+
import "zone.js/dist/zone";
18+
119
import { configure } from "@storybook/angular";
220

321
// load global styles
@@ -7,8 +25,12 @@ require("../src/index.stories");
725
// automatically import all files ending in *.stories.ts
826
const req = require.context("../src", true, /.stories.ts$/);
927
function loadStories() {
10-
req.keys().forEach(filename => {
11-
if (!filename.includes("index")) { req(filename) }
28+
req.keys()
29+
.sort((path1, path2) => path1.split("/").slice(-1)[0] > path2.split("/").slice(-1)[0] ? 1 : -1)
30+
.forEach(filename => {
31+
if (!filename.includes("index")) {
32+
req(filename);
33+
}
1234
});
1335
}
1436

.storybook/manager-head.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<meta property="og:title" content="Carbon Components Angular">
2+
<meta property="og:description" content="An Angular implementation of the Carbon Design System for IBM.">
3+
<meta property="og:image" content="https://angular.carbondesignsystem.com/carbon.jpg">
4+
<meta property="og:url" content="https://angular.carbondesignsystem.com">
5+
6+
<meta name="twitter:title" content="Carbon Components Angular">
7+
<meta name="twitter:description" content="An Angular implementation of the Carbon Design System for IBM.">
8+
<meta name="twitter:image" content="https://angular.carbondesignsystem.com/carbon.jpg">
9+
<meta name="twitter:card" content="summary_large_image">

.storybook/preview.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@import "~carbon-components/scss/globals/scss/styles.scss";
1+
@import "~carbon-components/css/carbon-components.min.css";
22

33
body {
4-
margin: 20px;
4+
padding: 20px;
55
// for tooltips/popovers ... can be on any chld element before the popover
66
// but body is most conveient
77
position: relative;

.storybook/public/carbon.jpg

164 KB
Loading

.storybook/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"emitDecoratorMetadata": true,
66
"experimentalDecorators": true,
77
"lib": [
8-
"es2015",
8+
"es2016",
99
"dom"
1010
],
1111
"sourceMap": true,

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ deploy:
3232
skip_cleanup: true
3333
true:
3434
branch: master
35+
notifications:
36+
email: false

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Assuming we're starting with a new @angular/cli project:
2020
```shell
2121
$ npx @angular/cli new my-project --style=scss
2222
$ cd my-project
23-
$ npm i --save-dev carbon-components-angular carbon-components @ngx-translate/core
23+
$ npm i --save-dev carbon-components-angular carbon-components
2424
```
2525

2626
Then we need to include carbon-components in `src/styles.scss`:
@@ -29,12 +29,13 @@ Then we need to include carbon-components in `src/styles.scss`:
2929
@import "~carbon-components/scss/globals/scss/styles.scss";
3030
```
3131

32-
And set up our translations in `src/app/app.module.ts`:
32+
> *Note:* For offline usage we'll need to set `$font-path: '~carbon-components/src/globals/fonts';` at the very top of our `src/styles.scss`. This will copy the fonts to our `dist` folder upon successful build. If you like the fonts to be a part of your `assets` folder and not pollute the `dist` folder then copy the fonts from `node_modules/carbon-components/src/globals/fonts` into our app's `src/assets/fonts` folder and add `$font-path: '/assets/fonts/';` at the very top of our `src/styles.scss`.
33+
34+
Then set up our translations in `src/app/app.module.ts`:
3335

3436
```ts
3537
import { BrowserModule } from '@angular/platform-browser';
3638
import { NgModule } from '@angular/core';
37-
import { TranslateModule } from '@ngx-translate/core';
3839

3940
import { AppComponent } from './app.component';
4041

@@ -44,7 +45,6 @@ import { AppComponent } from './app.component';
4445
],
4546
imports: [
4647
BrowserModule,
47-
TranslateModule.forRoot()
4848
],
4949
providers: [],
5050
bootstrap: [AppComponent]
@@ -80,7 +80,7 @@ _Finally_ we can run `npm start` and start building out our application!
8080
- attach a screenshot (or a gif!) for design reference if needed
8181
- reference the related issue
8282
- "closes #123" or "fixes #123" will close issue #123 once the PR is merged
83-
- "issue #123" just refences the issue. Only use this if you definitly need the issue to remain open.
83+
- "issue #123" just references the issue. Only use this if you definitely need the issue to remain open.
8484
- @mention any specific other developers that need to be aware of the changes
8585
- add the "needs review" label along with any other relevant labels
8686
- [link to code review checklist goes here](#)
@@ -97,11 +97,11 @@ _Finally_ we can run `npm start` and start building out our application!
9797
- screenshots if needed
9898
- relevant code snippets
9999
- links to application source code or running demo ([Codesandbox is awesome for this!](https://codesandbox.io/s/angular)) (including connection/authentication information)
100-
- add relevant labels (bug, accsibility, design, discussion, feature, etc)
100+
- add relevant labels (bug, accessibility, design, discussion, feature, etc)
101101
- if you have a fix to contribute, assign yourself, otherwise leave unassigned
102102

103103
#### npm commands
104-
To keep our build dependancies 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.
104+
To 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.
105105
- `npm run storybook` to run storybook (port 6006)
106106
- `npm run build` to generate the dist
107107
- `docs:build` to build documentation
@@ -113,7 +113,9 @@ To keep our build dependancies local we use npm scripts to run our webpack, gulp
113113
- [Style guide (WIP)](https://github.com/IBM/carbon-components-angular/wiki/Style-guide)
114114
- [General component API guidelines (WIP)](https://github.com/IBM/carbon-components-angular/wiki/Component-API-guidelines)
115115
- [Angular style guide](https://angular.io/styleguide)
116-
- [I18N tooling](https://angular.io/docs/ts/latest/cookbook/i18n.html)
116+
- I18N tooling
117+
- [I18N guide](https://angular.io/guide/i18n)
118+
- [ngx-translate](https://github.com/ngx-translate/core)
117119
- (Angular 2+ doesn't have anything like ngAria, instead here's [The A11Y Project](http://a11yproject.com/), [WAI-ARIA specs](https://www.w3.org/TR/wai-aria/), and [WAI-ARIA Authoring Practices](https://www.w3.org/TR/2016/WD-wai-aria-practices-1.1-20160317/))
118120
- [TypeScript docs](https://www.typescriptlang.org/docs/tutorial.html)
119121

0 commit comments

Comments
 (0)