import React from "react"; import DragAndDrop from "./"; import Text from "../text"; export default { title: "Components/DragAndDrop", component: DragAndDrop, argTypes: { dragging: { description: "Show that the item is being dragged now." }, isDropZone: { description: "Sets the component as a dropzone" }, onDrop: { action: "onDrop", description: "Occurs when the dragged element is dropped on the drop target", }, targetFile: { action: "File: ", table: { disable: true } }, className: { description: "Accepts class" }, onMouseDown: { description: "Occurs when the mouse button is pressed", action: "onMouseDown", }, children: { table: { disable: true } }, }, parameters: { docs: { description: { component: `Drag And Drop component can be used as Dropzone See documentation: https://github.com/react-dropzone/react-dropzone `, }, source: { code: ` import DragAndDrop from "@appserver/components/drag-and-drop"; Drop items here `, }, }, }, }; const Template = (args) => { const onDrop = (items) => { args.onDrop(items); for (let file of items) { if (file) { args.targetFile(file.name); } } }; const dropDownStyles = { margin: 16, width: 200, height: 200 }; const textStyles = { textAlign: "center", lineHeight: "9.5em" }; return ( Drop items here ); }; export const Default = Template.bind({});