2020-11-05 13:56:29 +00:00
|
|
|
import { OutputData } from "@editorjs/editorjs";
|
|
|
|
import RichTextEditor from "@saleor/components/RichTextEditor";
|
|
|
|
import CardDecorator from "@saleor/storybook/CardDecorator";
|
|
|
|
import Decorator from "@saleor/storybook/Decorator";
|
|
|
|
import { storiesOf } from "@storybook/react";
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
import * as fixtures from "./fixtures.json";
|
|
|
|
import { RichTextEditorProps } from "./RichTextEditor";
|
2022-03-16 10:09:12 +00:00
|
|
|
import RichTextEditorContent from "./RichTextEditorContent";
|
2020-11-05 13:56:29 +00:00
|
|
|
|
|
|
|
export const data: OutputData = fixtures.richTextEditor;
|
|
|
|
|
|
|
|
const props: RichTextEditorProps = {
|
|
|
|
data,
|
|
|
|
disabled: false,
|
|
|
|
error: false,
|
|
|
|
helperText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
|
|
label: "Content",
|
|
|
|
name: "content",
|
|
|
|
onChange: () => undefined
|
|
|
|
};
|
|
|
|
|
|
|
|
storiesOf("Generics / Rich text editor", module)
|
|
|
|
.addDecorator(CardDecorator)
|
|
|
|
.addDecorator(Decorator)
|
|
|
|
.add("default", () => <RichTextEditor {...props} />)
|
|
|
|
.add("disabled", () => <RichTextEditor {...props} disabled={true} />)
|
2022-03-16 10:09:12 +00:00
|
|
|
.add("error", () => <RichTextEditor {...props} error={true} />)
|
|
|
|
.add("static", () => <RichTextEditorContent {...props} />);
|