@cimpress/react-components
Version:
React components to support the MCP styleguide
78 lines • 3.31 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 slider_jsx_1 = __importDefault(require("!raw-loader!./slider.jsx"));
const slider_jsx_2 = __importDefault(require("./slider.jsx"));
const TabbedComponentDoc_1 = __importDefault(require("../../shared/TabbedComponentDoc"));
const SliderDocs = () => {
const propInfos = [
{
name: 'label',
type: 'string (required)',
default: '',
description: 'The label displayed above the slider',
},
{
name: 'onSelect',
type: 'function (required)',
default: '',
description: 'Once a value is selected, this callback function will receive the selected number as an argument',
},
{
name: 'value',
type: 'number (required)',
default: '',
description: 'The current value of the slider',
},
{
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'Setting this to true disables the slider, and greys it out',
},
{
name: 'min',
type: 'number',
default: '0',
description: 'The minimum value that the slider can select (on the left)',
},
{
name: 'max',
type: 'number',
default: '100',
description: 'The maximum value that the slider can select (on the right)',
},
{
name: 'increment',
type: 'number',
default: '1',
description: 'Any real number denoting the increment that the slider will select',
},
{
name: 'selectOnDrag',
type: 'boolean',
default: 'false',
description: 'Setting this to true calls onSelect while dragging the slider, instead of only when it is dropped',
},
];
const remarks = (react_1.default.createElement("div", null,
react_1.default.createElement("p", null, "Sliders will expand horizontally to fill whatever container is provided."),
react_1.default.createElement("p", null,
"For examples of where sliders are used, see the",
' ',
react_1.default.createElement("a", { href: "https://caps.cimpress.io", target: "_blank", rel: "noopener noreferrer" }, "Caps Demo website"),
' ',
"or the",
' ',
react_1.default.createElement("a", { href: "https://apis.documents.cimpress.io", target: "_blank", rel: "noopener noreferrer" }, "Documents APIs webpage"),
".")));
return (react_1.default.createElement(TabbedComponentDoc_1.default, { name: "Slider", propInfos: propInfos, remarks: remarks },
react_1.default.createElement(slider_jsx_2.default, null),
react_1.default.createElement(react_components_1.CodeExample, { code: slider_jsx_1.default })));
};
exports.default = SliderDocs;
//# sourceMappingURL=index.js.map