Skip to content

Commit 90d138b

Browse files
author
castastrophe
committed
A few minor adjustments to the storybook instance to improve the preview experience
1 parent d752bdc commit 90d138b

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

elements/pfe-modal/demo/pfe-modal.story.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { storiesOf } from "@storybook/polymer";
22
import * as storybookBridge from "@storybook/addon-knobs/polymer";
33
import * as tools from "../../../.storybook/utils.js";
4+
45
import PfeModal from "../pfe-modal";
6+
import PfeCta from "../../pfe-cta/pfe-cta";
57

68
const stories = storiesOf("Modal", module );
79

10+
const defaultHeader = tools.autoHeading();
11+
const defaultContent = tools.autoContent();
812

913
// Define the template to be used
1014
const template = (data = {}) => {
@@ -23,22 +27,34 @@ stories.add(PfeModal.tag, () => {
2327

2428
const slots = PfeModal.slots;
2529

30+
slots.trigger.default = "Launch modal";
31+
slots.header.default = defaultHeader;
32+
slots.body.default = defaultContent;
33+
2634
// Trigger the auto generation of the knobs for slots
2735
config.has = tools.autoContentKnobs(slots, storybookBridge);
2836

2937
// prettier-ignore
3038
config.slots = [{
31-
slot: "pfe-card--trigger",
32-
tag: "a",
33-
content: "launch"
39+
slot: "pfe-modal--trigger",
40+
tag: "button",
41+
content: config.has.trigger
3442
}, {
3543
slot: "pfe-modal--header",
3644
content: tools.customTag({
3745
tag: "h3",
3846
content: config.has.header
3947
})
4048
}, {
41-
content: config.has.body
49+
content: config.has.body + tools.component(PfeCta.tag, {}, [{
50+
content: tools.customTag({
51+
tag: "a",
52+
attributes: {
53+
href: "#"
54+
},
55+
content: "Learn more"
56+
})
57+
}])
4258
}];
4359

4460
const render = template(config);

0 commit comments

Comments
 (0)