UNPKG

@cimpress/react-components

Version:
95 lines 3.58 kB
import React from 'react'; import { CodeExample } from '@cimpress/react-components'; import CheckboxCode from '!raw-loader!./checkbox.jsx'; import CheckboxDemo from './checkbox.jsx'; import ComponentDoc from '../../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.createElement("div", null, "Determines whether or not the checkbox is in an indeterminate state. If ", React.createElement("code", null, "checked"), " is true, it will override ", React.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.createElement("div", null, React.createElement("p", null, "Callback function that is fired when the checked value changes. "), React.createElement("p", null, "Signature: ", React.createElement("code", null, "function(event: object, payload: any) ", '=>', " void"), ' '), React.createElement("p", null, React.createElement("code", null, "event:"), " Change event targeting the checkbox.", React.createElement("code", null, "payload:"), " The payload prop value."))), }, { name: 'payload', type: 'any', default: '', description: (React.createElement("p", null, "Anything you want passed in to the ", React.createElement("code", null, "onChange"), " handler as the second argument.")), }, { name: 'inline', type: 'boolean', default: 'false', description: React.createElement("p", null, "If set to true, checkbox will display in a row instead of being stacked"), }, ]; return (React.createElement(ComponentDoc, { name: "Checkbox", propInfos: propInfos }, React.createElement(CheckboxDemo, null), React.createElement(CodeExample, { code: CheckboxCode }))); }; export default CheckboxDocs; //# sourceMappingURL=index.js.map