@cimpress/react-components
Version:
React components to support the MCP styleguide
116 lines • 4.43 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importStar(require("react"));
const react_components_1 = require("@cimpress/react-components");
const modal_jsx_1 = __importDefault(require("!raw-loader!./modal.jsx"));
const modal_jsx_2 = __importDefault(require("./modal.jsx"));
const TabbedComponentDoc_1 = __importDefault(require("../../shared/TabbedComponentDoc"));
function ModalDocs() {
const [perfTest, setPerfTest] = (0, react_1.useState)(false);
const propInfos = [
{
name: 'show',
type: 'boolean (required)',
default: '',
description: 'Controls whether or not the modal is displayed',
},
{
name: 'title',
type: 'node',
default: '',
description: 'Title for the modal. If no title is provided, the space will be left blank.',
},
{
name: 'closeButton',
type: 'boolean',
default: 'false',
description: 'Controls whether an "x" appears in the header to close the modal.',
},
{
name: 'footer',
type: 'node',
default: '',
description: 'Modal footer. Any buttons with actions should go here. If a footer is not provided, the modal-footer element will not render.',
},
{
name: 'onRequestHide',
type: 'function',
default: '',
description: 'Function called when the modal wants to close itself.',
},
{
name: 'closeOnOutsideClick',
type: 'boolean',
default: 'true',
description: 'Calls onRequestHide when clicked outside of the main Modal div.',
},
{
name: 'size',
type: 'string',
default: '',
description: 'Render the modal with a specific size, one of "sm" or "lg"',
},
{
name: 'status',
type: 'string',
default: '',
description: `Render the modal with a bootstrap contextual style,
one of one of "success" "warning" "danger" or "info"`,
},
{
name: 'className',
type: 'string',
default: '',
description: 'Class name to append to the body of the modal',
},
{
name: 'style',
type: 'object',
default: '',
description: 'Inline styles for the body of the modal',
},
{
name: 'wrapperStyle',
type: 'object',
default: '',
description: 'Inline styles for the modal wrapper node',
},
{
name: 'children',
type: 'node',
default: '',
description: 'JSX to render as the body of the modal',
},
];
return (react_1.default.createElement(TabbedComponentDoc_1.default, { name: "Modal", propInfos: propInfos },
react_1.default.createElement(modal_jsx_2.default, null),
react_1.default.createElement(react_components_1.CodeExample, { code: modal_jsx_1.default })));
}
exports.default = ModalDocs;
//# sourceMappingURL=index.js.map