UNPKG

grommet

Version:

focus on the essential experience

34 lines (29 loc) 2.35 kB
"use strict"; exports.__esModule = true; exports.doc = void 0; var _reactDesc = require("react-desc"); var _utils = require("../../utils"); var doc = function doc(Drop) { var DocumentedDrop = (0, _reactDesc.describe)(Drop).availableAt((0, _utils.getAvailableAtBadge)('Drop')).description('A container that is overlaid next to a target.').usage("import { Drop } from 'grommet';\n<Drop target={reference}>...</Drop>").intrinsicElement('div'); DocumentedDrop.propTypes = { align: _reactDesc.PropTypes.shape({ top: _reactDesc.PropTypes.oneOf(['top', 'bottom']), bottom: _reactDesc.PropTypes.oneOf(['top', 'bottom']), right: _reactDesc.PropTypes.oneOf(['left', 'right']), left: _reactDesc.PropTypes.oneOf(['left', 'right']) }).description("How to align the drop with respect to the target element. Not specifying\n a vertical or horizontal alignment will cause it to be aligned in the\n center.").defaultValue({ top: 'top', left: 'left' }), onClickOutside: _reactDesc.PropTypes.func.description('Function that will be invoked when the user clicks outside the drop.'), onEsc: _reactDesc.PropTypes.func.description('Function that will be called when the user presses the escape key inside the drop.'), responsive: _reactDesc.PropTypes.bool.description('Whether to dynamically re-place when resized.').defaultValue(true), restrictFocus: _reactDesc.PropTypes.bool.description('Whether the drop should control focus.').defaultValue(false), stretch: _reactDesc.PropTypes.bool.description("Whether the drop element should be stretched to at least match the\n width of the target element. The default is true because\n that is what most uses of Drop want, like Select and Menu.").defaultValue(true), target: _reactDesc.PropTypes.object.description('Target where the drop will be aligned to. This should be a React reference.').isRequired, elevation: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.oneOf(['none', 'xsmall', 'small', 'medium', 'large', 'xlarge']), _reactDesc.PropTypes.string]).description("Elevated height of the target, indicated via a drop shadow."), plain: _reactDesc.PropTypes.bool.description("Whether the drop element should have no background nor shadow").defaultValue(false) }; return DocumentedDrop; }; exports.doc = doc;