11import { Story , Canvas , Meta } from ' @storybook/addon-docs/blocks' ;
22import { useEffect } from ' @storybook/client-api' ;
3+ import { makeTwigInclude } from ' ../../make-twig-include' ;
34import menu from ' ./demo/menu.json' ;
45import template from ' ./sky-nav.twig' ;
56import { initSkyNav } from ' ./sky-nav.ts' ;
7+ const basicStoryArgs = {
8+ include_main_demo : true ,
9+ menu ,
10+ } ;
611
712<!--
813Inline stories disabled so media queries will behave as expected within
@@ -34,6 +39,14 @@ The Sky Nav is intended for use with our [our dark theme](/docs/design-themes--d
3439 layout: ' fullscreen' ,
3540 paddings: { disable: true },
3641 themes: { disable: true },
42+ docs: {
43+ source: {
44+ code: makeTwigInclude (' @cloudfour/components/sky-nav/sky-nav.twig' , {
45+ class: ' t-dark' ,
46+ ... basicStoryArgs ,
47+ }),
48+ },
49+ },
3750 }}
3851 >
3952 { () => {
@@ -43,7 +56,10 @@ The Sky Nav is intended for use with our [our dark theme](/docs/design-themes--d
4356 );
4457 return destroy ;
4558 }, []);
46- return template ({ class: ' t-dark' , include_main_demo: true , menu });
59+ return template ({
60+ class: ' t-dark' ,
61+ ... basicStoryArgs ,
62+ });
4763 }}
4864 </Story >
4965</Canvas >
@@ -58,6 +74,14 @@ But it works without a theme, too, just in case:
5874 layout: ' fullscreen' ,
5975 paddings: { disable: true },
6076 themes: { disable: true },
77+ docs: {
78+ source: {
79+ code: makeTwigInclude (
80+ ' @cloudfour/components/sky-nav/sky-nav.twig' ,
81+ basicStoryArgs
82+ ),
83+ },
84+ },
6185 }}
6286 >
6387 { () => {
@@ -67,7 +91,7 @@ But it works without a theme, too, just in case:
6791 );
6892 return destroy ;
6993 }, []);
70- return template ({ include_main_demo: true , menu } );
94+ return template (basicStoryArgs );
7195 }}
7296 </Story >
7397</Canvas >
0 commit comments