UNPKG

@ljcl/storybook-addon-cssprops

Version:
23 lines (22 loc) 867 B
import * as React from "react"; import { addons, types } from "@storybook/manager-api"; import { AddonPanel } from "@storybook/components"; import { CssPropsPanel } from "./components/CssPropsPanel"; import { useTitle } from "./title"; import { ADDON_ID, PARAM_KEY } from "./constants"; addons.register(ADDON_ID, function (api) { addons.add(ADDON_ID, { title: useTitle, type: types.PANEL, paramKey: PARAM_KEY, render: function (_a) { var active = _a.active; var story = api.getCurrentStoryData(); if (!active || !story) { return React.createElement(React.Fragment, { key: "nothing" }, "-"); } return (React.createElement(AddonPanel, { active: !!active }, React.createElement(CssPropsPanel, { storyId: story.id }))); }, }); });