@cimpress/react-components
Version:
React components to support the MCP styleguide
69 lines • 2.67 kB
JavaScript
import React from 'react';
import { CodeExample } from '@cimpress/react-components';
import DatePickerCode from '!raw-loader!./datePicker.jsx';
import DatePickerDemo from './datePicker.jsx';
import ComponentDoc from '../../shared/TabbedComponentDoc';
const DatePickerDocs = () => {
const propInfos = [
{
name: 'readonly',
type: 'boolean',
default: 'false',
description: (React.createElement("div", null, "Indicates whether a selected date time is readonly and can only be set by selecting a date on the calendar.")),
},
{
name: 'label',
type: 'string',
default: '',
description: (React.createElement("div", null,
"Floating label for an input field. Use either this or ",
React.createElement("code", null, "placeholder"),
" but not both")),
},
{
name: 'helpText',
type: 'node',
default: '',
description: 'Additional help text to display under the input field.',
},
{
name: 'placeholder',
type: 'string',
default: '',
description: 'The placeholder that will displayed inside the input box.',
},
{
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'Indicates whether the input box should be disabled.',
},
{
name: 'required',
type: 'boolean',
default: 'false',
description: 'Indicates whether a selected date time is required.',
},
{
name: 'isClearable',
type: 'boolean',
default: 'false',
description: 'Indicates whether a selected date can be cleared.',
},
{
name: 'onClickInput',
type: 'function',
default: '',
description: 'Callback trigger for when the user clicks the input box.',
},
];
return (React.createElement("div", null,
React.createElement("div", null,
"This component depends on react-datetime which has a peer dependency on moment. To import and use this component moment must be installed.",
React.createElement("pre", null, "npm install moment")),
React.createElement(ComponentDoc, { name: "Date Picker", propInfos: propInfos },
React.createElement(DatePickerDemo, null),
React.createElement(CodeExample, { code: DatePickerCode }))));
};
export default DatePickerDocs;
//# sourceMappingURL=index.js.map