@carbon/ibm-security
Version:
Carbon for Cloud & Cognitive IBM Security UI components
39 lines (38 loc) • 1.8 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "dense", "mode", "short"];
/**
* @file Description list module.
* @copyright IBM Security 2020
*/
import classnames from 'classnames';
import { bool, node, oneOf } from 'prop-types';
import React from 'react';
import LayoutModule, { layoutModuleNamespace } from '../LayoutModule';
var namespace = 'description-list';
/**
* Description list modules provide a means to orderly layout terms and definitions.
*/
var DescriptionListModule = function DescriptionListModule(_ref) {
var children = _ref.children,
dense = _ref.dense,
mode = _ref.mode,
short = _ref.short,
other = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/React.createElement(LayoutModule, _extends({
namespace: namespace,
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(layoutModuleNamespace, "--").concat(namespace, "--dense"), dense), "".concat(layoutModuleNamespace, "--").concat(namespace, "--").concat(mode), mode), "".concat(layoutModuleNamespace, "--").concat(namespace, "--short"), short))
}, other), children);
};
DescriptionListModule.propTypes = {
/** Provide the `TypeLayout`, and optionally `TitleBar`, for the `DescriptionListModule` */
children: node.isRequired,
/** Specify whether a dense spacing should be used */
dense: bool,
/** Optionally specify if the module should be stacked or toggle between a stacked and default layout */
mode: oneOf(['stacked', 'toggle']),
/** Specify whether a short spacing should be used */
short: bool
};
export default DescriptionListModule;