UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

21 lines 1.05 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderStoriesForChromatic = renderStoriesForChromatic; const react_1 = __importDefault(require("react")); function renderStoriesForChromatic(stories) { return { render: (...args) => (react_1.default.createElement(react_1.default.Fragment, null, Object.entries(stories).map(([storyName, Story]) => { var _a; return (react_1.default.createElement("div", { key: storyName }, react_1.default.createElement("h2", { className: "storyheading" }, storyName), typeof Story === "function" ? react_1.default.createElement(Story, null) : (_a = Story.render) === null || _a === void 0 ? void 0 : _a.call(Story, ...args))); }))), parameters: { chromatic: { disable: false }, }, }; } //# sourceMappingURL=renderStoriesForChromatic.js.map