@stories-js/core
Version:
Stories web components to build stories
28 lines (24 loc) • 896 B
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
import { r as registerInstance, h } from './index-49238f69.js';
import { s as state } from './index-f706f0f6.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) {
registerInstance(this, hostRef);
}
render() {
const stories = state.stories;
if (stories && Object.keys(stories).length) {
return (h("nav", null, h("h1", null, "Navigation"), Object.keys(stories).map(key => {
const story = stories[key];
return h("li", null, h("a", { href: `/#path=${key}` }, story.storyName));
})));
}
return h("div", null, "No stories");
}
};
Sidebar.style = sidebarCss;
export { Sidebar as stories_sidebar };
//# sourceMappingURL=stories-sidebar.entry.js.map