@cimpress/react-components
Version:
React components to support the MCP styleguide
66 lines • 2.82 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const react_components_1 = require("@cimpress/react-components");
const documentation_jsx_1 = __importDefault(require("!raw-loader!./documentation.jsx"));
const documentation_jsx_2 = __importDefault(require("./documentation.jsx"));
const TabbedComponentDoc_1 = __importDefault(require("../../shared/TabbedComponentDoc"));
const DocumentationDocs = () => {
const codePropInfos = [
{
name: 'code',
type: 'string (required)',
default: '',
description: 'The code to display, as a string.',
},
{
name: 'initialOpen',
type: 'boolean',
default: 'true',
description: 'Whether the code example should start open or collapsed.',
},
];
const propInfos = [
{
name: 'name',
type: 'string (required)',
default: '',
description: 'The name of the component being documented.',
},
{
name: 'demoName',
type: 'string',
default: 'Demo',
description: 'Header for the code demo, if desired.',
},
{
name: 'propInfos',
type: 'array of {name: string, type: string, default: string, description: string}',
default: '',
description: react_1.default.createElement("span", null, "Array of objects representing prop info to document the props."),
},
{
name: 'remarks',
type: 'element',
default: '',
description: 'Additional remarks or notes about the component',
},
{
name: 'children',
type: 'node',
default: '',
description: 'Children for the component doc -- usually a demo of the component and the code example',
},
];
return (react_1.default.createElement("div", null,
react_1.default.createElement(TabbedComponentDoc_1.default, { name: "Documentation" }),
react_1.default.createElement(TabbedComponentDoc_1.default, { name: "ComponentDoc", propInfos: propInfos, includeTabs: false }),
react_1.default.createElement(TabbedComponentDoc_1.default, { name: "CodeExample", propInfos: codePropInfos, includeTabs: false },
react_1.default.createElement(documentation_jsx_2.default, null),
react_1.default.createElement(react_components_1.CodeExample, { code: documentation_jsx_1.default }))));
};
exports.default = DocumentationDocs;
//# sourceMappingURL=index.js.map