UNPKG

vcc-ui

Version:

VCC UI is a collection of React UI Components that can be used for developing front-end applications at Volvo Car Corporation.

41 lines 1.25 kB
import React from "react"; import { storiesOf } from "@storybook/react"; import { withKnobs, object } from "@storybook/addon-knobs"; import { withBackgrounds } from "@storybook/addon-backgrounds"; import { Logo, LOGO_TYPES } from "../../index"; import { render } from "../../../stories/render"; import { ThemeProvider } from "../../theme-provider"; var listOfBackgrounds = [{ name: "black", value: "#111111", default: true }, { name: "blue", value: "#3b5998" }]; storiesOf("Logo", module).addDecorator(withBackgrounds(listOfBackgrounds)).addDecorator(render).addDecorator(withKnobs).addWithJSX("square", function () { return React.createElement(Logo, { type: "square" }); }).addWithJSX("wordmark", function () { return React.createElement(Logo, { type: "wordmark" }); }).addWithJSX("with theme", function () { var label = "Custom theme"; var square = "vcc-ui/images/volvo-logo.png"; var defaultValue = { logoImages: { square: square }, logo: { backgroundColor: "#ffffff" } }; var defaultThemePropsConfig = object(label, defaultValue); return React.createElement(ThemeProvider, { theme: defaultThemePropsConfig }, React.createElement(Logo, { type: LOGO_TYPES.SQUARE })); });