11import { storiesOf } from "@storybook/polymer" ;
22import * as storybookBridge from "@storybook/addon-knobs/polymer" ;
33import * as tools from "../../../.storybook/utils.js" ;
4+
45import PfeModal from "../pfe-modal" ;
6+ import PfeCta from "../../pfe-cta/pfe-cta" ;
57
68const stories = storiesOf ( "Modal" , module ) ;
79
10+ const defaultHeader = tools . autoHeading ( ) ;
11+ const defaultContent = tools . autoContent ( ) ;
812
913// Define the template to be used
1014const 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