@carbon/ibm-products
Version:
Carbon for IBM Products
42 lines (38 loc) • 1.48 kB
JavaScript
/**
* Copyright IBM Corp. 2020, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import React__default from 'react';
import PropTypes from '../../_virtual/index.js';
import cx from 'classnames';
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
import { pkg } from '../../settings.js';
import { StructuredListRow } from '@carbon/react';
// The block part of our conventional BEM class names (blockClass__E--M).
const blockClass = `${pkg.prefix}--description-list__row`;
const componentName = 'DescriptionListRow';
let DescriptionListRow = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
let {
children /* TODO: remove if not needed. */,
className,
...rest
} = _ref;
return /*#__PURE__*/React__default.createElement(StructuredListRow, _extends({
className: cx(blockClass, className)
// role="row"
,
ref: ref
}, getDevtoolsProps(componentName), rest), children);
});
DescriptionListRow.propTypes = {
/** Provide the contents of the node */
children: PropTypes.node,
/** Provide an optional class to be applied to the containing node */
className: PropTypes.string
};
DescriptionListRow = pkg.checkComponentEnabled(DescriptionListRow, componentName);
DescriptionListRow.displayName = componentName;
export { DescriptionListRow };