2020-11-06 12:20:06 +00:00
|
|
|
import React from "react";
|
|
|
|
import { storiesOf } from "@storybook/react";
|
|
|
|
import {
|
|
|
|
withKnobs,
|
|
|
|
text,
|
|
|
|
number,
|
|
|
|
boolean,
|
|
|
|
color,
|
|
|
|
} from "@storybook/addon-knobs/react";
|
|
|
|
import Section from "../../../../.storybook/decorators/section";
|
2020-11-09 11:45:57 +00:00
|
|
|
import withReadme from "storybook-readme/with-readme";
|
|
|
|
import Readme from "./README.md";
|
2020-11-06 12:20:06 +00:00
|
|
|
|
|
|
|
import Loaders from "..";
|
2021-02-25 21:19:45 +00:00
|
|
|
import { LoaderStyle } from "../../../constants";
|
2020-11-06 12:20:06 +00:00
|
|
|
|
|
|
|
storiesOf("Components|Loaders", module)
|
|
|
|
.addDecorator(withKnobs)
|
2020-11-09 11:45:57 +00:00
|
|
|
.addDecorator(withReadme(Readme))
|
2020-11-06 12:20:06 +00:00
|
|
|
.add("rectangle loader", () => (
|
|
|
|
<Section>
|
|
|
|
<h1>Rectangle Loader</h1>
|
|
|
|
<Loaders.Rectangle
|
2020-11-09 13:02:08 +00:00
|
|
|
title={text("title", LoaderStyle.title)}
|
2020-11-06 12:20:06 +00:00
|
|
|
x={text("x", "0")}
|
|
|
|
y={text("y", "0")}
|
|
|
|
width={text("width", LoaderStyle.width)}
|
|
|
|
height={text("height", LoaderStyle.height)}
|
|
|
|
borderRadius={number("borderRadius", LoaderStyle.borderRadius)}
|
|
|
|
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>
|
|
|
|
));
|