@cimpress/react-components
Version:
React components to support the MCP styleguide
52 lines • 2.01 kB
JavaScript
import React from 'react';
import { CodeExample } from '@cimpress/react-components';
import CopyButtonCode from '!raw-loader!./copyButton.jsx';
import CopyButtonDemo from './copyButton.jsx';
import CopyTextCode from '!raw-loader!./copyText.jsx';
import CopyTextDemo from './copyText.jsx';
import ComponentDoc from '../../shared/TabbedComponentDoc';
const CopyDocs = () => {
const propInfos = [
{
name: 'variant',
type: "string ('button' | 'text' | 'inline')",
default: 'text',
description: 'The variant of copy component user wants to use. Button, text or inline.',
},
{
name: 'value',
type: 'string',
description: React.createElement("span", null, "The text to copy to clipboard"),
},
{
name: 'children',
type: 'string|Node',
default: 'Copy',
description: React.createElement("span", null, "The content of the button."),
},
{
name: 'hoverText',
type: 'string',
description: 'Text to display in tooltip when user covers over component.',
},
{
name: 'successMessage',
type: 'string',
default: 'Copied successfully',
description: React.createElement("span", null, "The message to show in a Snackbar when copying is finished."),
},
{
name: 'duration',
type: 'number',
default: '1500',
description: 'How long (in milliseconds) to show the success message',
},
];
return (React.createElement(ComponentDoc, { name: "Copy", propInfos: propInfos },
React.createElement(CopyTextDemo, null),
React.createElement(CodeExample, { code: CopyTextCode }),
React.createElement(CopyButtonDemo, null),
React.createElement(CodeExample, { code: CopyButtonCode })));
};
export default CopyDocs;
//# sourceMappingURL=index.js.map