ur-ui-kit-tm
Version:
unlimited robotics ui kit
44 lines (43 loc) • 1.72 kB
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from "react";
import { Modal } from "..";
import { Button } from "../components/button/button.component";
export default {
title: "Example/Modal",
component: Modal,
argTypes: {
title: {
description: "A string that is placed in header",
default: "",
control: "text",
},
isOpen: {
description: "Is modal open or not (boolean)",
default: false,
control: "boolean",
},
onRequestClose: {
action: "closed",
description: "A function that is called when user clicks out of an open modal",
},
},
};
var Template = function (args) {
var _a = useState(false), isOpen = _a[0], setIsOpen = _a[1];
return (_jsxs(_Fragment, { children: [_jsx(Modal, __assign({}, args, { isOpen: isOpen, onRequestClose: function (a) { return setIsOpen(false); } }, { children: "Basic example of basic body of basic modal." }), void 0), _jsx(Button, { color: "light_blue", label: "Open Modal", onClick: function () { return setIsOpen(true); } }, void 0)] }, void 0));
};
export var Basic = Template.bind({});
Basic.args = {
title: "Modal Basic",
};