43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import React from "react";
|
|
import { storiesOf } from "@storybook/react";
|
|
import {
|
|
withKnobs,
|
|
boolean,
|
|
text,
|
|
color,
|
|
number,
|
|
} from "@storybook/addon-knobs/react";
|
|
import Section from "../../../../.storybook/decorators/section";
|
|
|
|
import Loaders from "..";
|
|
import { LoaderStyle } from "../../../constants";
|
|
import withReadme from "storybook-readme/with-readme";
|
|
import Readme from "./README.md";
|
|
|
|
storiesOf("Components|Loaders", module)
|
|
.addDecorator(withKnobs)
|
|
.addDecorator(withReadme(Readme))
|
|
.add("main button loader", () => (
|
|
<Section>
|
|
<h1>Main Button Loader</h1>
|
|
<Loaders.MainButton
|
|
title={text("title", LoaderStyle.title)}
|
|
width={text("width", "100%")}
|
|
height={text("height", "32px")}
|
|
borderRadius={text("border radius", "3")}
|
|
backgroundColor={color("backgroundColor", LoaderStyle.backgroundColor)}
|
|
foregroundColor={color("foregroundColor", LoaderStyle.foregroundColor)}
|
|
backgroundOpacity={number(
|
|
"backgroundOpacity",
|
|
LoaderStyle.backgroundOpacity
|
|
)}
|
|
foregroundOpacity={number(
|
|
"foregroundOpacity",
|
|
LoaderStyle.foregroundOpacity
|
|
)}
|
|
speed={number("speed", LoaderStyle.speed)}
|
|
animate={boolean("animate", LoaderStyle.animate)}
|
|
/>
|
|
</Section>
|
|
));
|