@cimpress/react-components
Version:
React components to support the MCP styleguide
100 lines • 4.13 kB
JavaScript
;
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 checkbox_jsx_1 = __importDefault(require("!raw-loader!./checkbox.jsx"));
const checkbox_jsx_2 = __importDefault(require("./checkbox.jsx"));
const TabbedComponentDoc_1 = __importDefault(require("../../shared/TabbedComponentDoc"));
const CheckboxDocs = () => {
const propInfos = [
{
name: 'label',
type: 'string or node',
default: '',
description: 'Label for the checkbox.',
},
{
name: 'id',
type: 'string',
default: '',
description: 'ID prop for the input field',
},
{
name: 'whiteBackground',
type: 'boolean',
default: 'false',
description: 'If set to true, the checkbox icon is rendered with white background, otherwise - transparent.',
},
{
name: 'checked',
type: 'boolean',
default: '',
description: 'Determines whether or not the checkbox is checked',
},
{
name: 'indeterminate',
type: 'boolean',
default: '',
description: (react_1.default.createElement("div", null,
"Determines whether or not the checkbox is in an indeterminate state. If ",
react_1.default.createElement("code", null, "checked"),
" is true, it will override ",
react_1.default.createElement("code", null, "indeterminate"),
".")),
},
{
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'Marks the checkbox as disabled',
},
{
name: 'className',
type: 'string',
default: '',
description: 'Additional classNames to be appended to the parent element of the input field',
},
{
name: 'onChange',
type: 'function',
default: '',
description: (react_1.default.createElement("div", null,
react_1.default.createElement("p", null, "Callback function that is fired when the checked value changes. "),
react_1.default.createElement("p", null,
"Signature: ",
react_1.default.createElement("code", null,
"function(event: object, payload: any) ",
'=>',
" void"),
' '),
react_1.default.createElement("p", null,
react_1.default.createElement("code", null, "event:"),
" Change event targeting the checkbox.",
react_1.default.createElement("code", null, "payload:"),
" The payload prop value."))),
},
{
name: 'payload',
type: 'any',
default: '',
description: (react_1.default.createElement("p", null,
"Anything you want passed in to the ",
react_1.default.createElement("code", null, "onChange"),
" handler as the second argument.")),
},
{
name: 'inline',
type: 'boolean',
default: 'false',
description: react_1.default.createElement("p", null, "If set to true, checkbox will display in a row instead of being stacked"),
},
];
return (react_1.default.createElement(TabbedComponentDoc_1.default, { name: "Checkbox", propInfos: propInfos },
react_1.default.createElement(checkbox_jsx_2.default, null),
react_1.default.createElement(react_components_1.CodeExample, { code: checkbox_jsx_1.default })));
};
exports.default = CheckboxDocs;
//# sourceMappingURL=index.js.map