UNPKG

@stories-js/core

Version:

Stories web components to build stories

32 lines (26 loc) 999 B
/*! * (C) StoriesJS https://storiesjs.org - GPL-2.0 License */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-c25eada5.js'); const index$1 = require('./index-ad63dbd0.js'); const sidebarCss = ":host{display:block;background-color:lightblue}nav{-ms-flex-negative:0;flex-shrink:0;height:100vh;width:200px}"; const Sidebar = class { constructor(hostRef) { index.registerInstance(this, hostRef); } render() { const stories = index$1.state.stories; if (stories && Object.keys(stories).length) { return (index.h("nav", null, index.h("h1", null, "Navigation"), Object.keys(stories).map(key => { const story = stories[key]; return index.h("li", null, index.h("a", { href: `/#path=${key}` }, story.storyName)); }))); } return index.h("div", null, "No stories"); } }; Sidebar.style = sidebarCss; exports.stories_sidebar = Sidebar; //# sourceMappingURL=stories-sidebar.cjs.entry.js.map