UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

102 lines (96 loc) 2.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ConfirmDialogExampleWithAllOptions = exports.ConfirmDialogExample = void 0; var _react = _interopRequireDefault(require("react")); var _index = require("./index"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const Template = args => /*#__PURE__*/_react.default.createElement(_index.ConfirmDialog, args); const ConfirmDialogExample = Template.bind({}); exports.ConfirmDialogExample = ConfirmDialogExample; ConfirmDialogExample.args = { title: "Confirm Title", message: "Confirm Content", onConfirm: () => { alert("Confirm 🤗"); }, onCancel: () => { alert("Cancel 😔"); } }; const ConfirmDialogExampleWithAllOptions = Template.bind({}); exports.ConfirmDialogExampleWithAllOptions = ConfirmDialogExampleWithAllOptions; ConfirmDialogExampleWithAllOptions.args = { title: "Confirm Title", message: "Confirm Content", position: "middle", size: "small", hide: false, cancelButtonText: "Cancel", confirmButtonText: "Confirm", confirmButtonColor: "primary", onConfirm: () => { alert("Confirm 🤗"); }, onCancel: () => { alert("Cancel 😔"); }, customActions: [{ label: "Custom Action", color: "secondary", onClick: () => { alert("Custom Action 🙃"); } }] }; var _default = { title: "Components/Confirm Dialog/Confirm Dialog", component: ConfirmDialogExample, argTypes: { title: { control: { type: "text" } }, message: { control: { type: "text" } }, position: { control: { type: "select", options: ["top", "middle", "bottom"] } }, size: { control: { type: "select", options: ["small", "large"] } }, hide: { control: { type: "boolean" } }, cancelButtonText: { control: { type: "text" } }, confirmButtonText: { control: { type: "text" } }, confirmButtonColor: { control: { type: "select", options: ["primary", "secondary", "destructive"] } } } }; exports.default = _default;