Skip to content

Commit 85e18a7

Browse files
authored
Merge pull request #542 from youda97/notes
feat(documentation): Add documentation to stories
2 parents 93f696e + dba3d27 commit 85e18a7

File tree

84 files changed

+1649
-785
lines changed

Some content is hidden

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

84 files changed

+1649
-785
lines changed

.storybook/addons.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ import "zone.js/dist/zone";
1919
import '@storybook/addon-storysource/register';
2020
import "@storybook/addon-actions/register";
2121
import "@storybook/addon-links/register";
22+
import '@storybook/addon-notes/register';
2223
import "@storybook/addon-knobs/register";
2324
import '@storybook/addon-options/register';

.storybook/preview.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $feature-flags: (
44

55
@import '~carbon-components/scss/globals/scss/styles';
66

7-
.sb-show-main:not(.welcome) {
7+
.sb-show-main:not(.full-page) {
88
padding: 3em;
99
display: flex;
1010
flex-direction: column;

package-lock.json

Lines changed: 929 additions & 667 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"@storybook/addon-links": "5.0.6",
9292
"@storybook/addon-options": "5.0.6",
9393
"@storybook/addon-storysource": "5.0.6",
94+
"@storybook/addon-notes": "5.0.6",
9495
"@storybook/addons": "5.0.6",
9596
"@storybook/angular": "5.0.6",
9697
"@types/jasmine": "3.3.12",

src/accordion/accordion.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import {
77
} from "@angular/core";
88
import { AccordionItem } from "./accordion-item.component";
99

10+
/**
11+
* [See demo](../../?path=/story/accordion--basic)
12+
*
13+
* <example-url>../../iframe.html?id=accordion--basic</example-url>
14+
*
15+
* @export
16+
* @class Accordion
17+
* @implements {AfterContentInit}
18+
*/
1019
@Component({
1120
selector: "ibm-accordion",
1221
template: `

src/accordion/accordion.stories.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import { storiesOf, moduleMetadata } from "@storybook/angular";
22
import { action } from "@storybook/addon-actions";
33
import { withKnobs, boolean, object } from "@storybook/addon-knobs/angular";
44

5-
import { AccordionModule } from "../";
5+
import { AccordionModule, DocumentationModule } from "../";
66

77
storiesOf("Accordion", module)
88
.addDecorator(
99
moduleMetadata({
1010
imports: [
11-
AccordionModule
11+
AccordionModule,
12+
DocumentationModule
1213
]
1314
})
1415
)
@@ -63,4 +64,9 @@ storiesOf("Accordion", module)
6364
</ibm-accordion>
6465
</div>
6566
`
67+
}))
68+
.add("Documentation", () => ({
69+
template: `
70+
<ibm-documentation src="documentation/components/Accordion.html"></ibm-documentation>
71+
`
6672
}));

src/breadcrumb/breadcrumb.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ import { BreadcrumbItemComponent } from "./breadcrumb-item.component";
1111

1212
const MINIMUM_OVERFLOW_THRESHOLD = 4;
1313

14+
/**
15+
* [See demo](../../?path=/story/breadcrumb--basic)
16+
*
17+
* <example-url>../../iframe.html?id=breadcrumb--basic</example-url>
18+
*
19+
* @export
20+
* @class Breadcrumb
21+
* @implements {AfterContentInit}
22+
*/
1423
@Component({
1524
selector: "ibm-breadcrumb",
1625
template: `

src/breadcrumb/breadcrumb.stories.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { storiesOf, moduleMetadata } from "@storybook/angular";
22
import { withKnobs, boolean, number } from "@storybook/addon-knobs/angular";
33

4-
import { BreadcrumbModule, DialogModule } from "../";
4+
import { BreadcrumbModule, DialogModule, DocumentationModule } from "../";
55
import { BreadcrumbItem } from "../breadcrumb/breadcrumb-item.interface";
66

77
let breadcrumbItems;
@@ -19,7 +19,8 @@ storiesOf("Breadcrumb", module)
1919
moduleMetadata({
2020
imports: [
2121
BreadcrumbModule,
22-
DialogModule
22+
DialogModule,
23+
DocumentationModule
2324
]
2425
})
2526
)
@@ -69,4 +70,9 @@ storiesOf("Breadcrumb", module)
6970
props: {
7071
noTrailingSlash: boolean("noTrailingSlash", true)
7172
}
73+
}))
74+
.add("Documentation", () => ({
75+
template: `
76+
<ibm-documentation src="documentation/components/Breadcrumb.html"></ibm-documentation>
77+
`
7278
}));

src/button/button.directive.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
/**
99
* A convinence directive for applying styling to a button.
1010
*
11+
* [See demo](../../?path=/story/button--basic)
12+
*
1113
* Example:
1214
*
1315
* ```html
@@ -16,6 +18,8 @@ import {
1618
* ```
1719
*
1820
* See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/button/code) for more detail.
21+
*
22+
* <example-url>../../iframe.html?id=button--basic</example-url>
1923
*/
2024
@Directive({
2125
selector: "[ibmButton]"

src/button/button.stories.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { storiesOf, moduleMetadata } from "@storybook/angular";
22
import { action } from "@storybook/addon-actions";
33
import { withKnobs, select } from "@storybook/addon-knobs/angular";
44

5-
import { ButtonModule } from "../";
5+
import { ButtonModule, DocumentationModule } from "../";
66

77
storiesOf("Button", module)
88
.addDecorator(
99
moduleMetadata({
10-
imports: [ButtonModule]
10+
imports: [ButtonModule, DocumentationModule]
1111
})
1212
)
1313
.addDecorator(withKnobs)
@@ -35,4 +35,9 @@ storiesOf("Button", module)
3535
&nbsp;
3636
<button ibmButton skeleton="true" size="sm"></button>
3737
`
38+
}))
39+
.add("Documentation", () => ({
40+
template: `
41+
<ibm-documentation src="documentation/directives/Button.html"></ibm-documentation>
42+
`
3843
}));

0 commit comments

Comments
 (0)