UNPKG

@carbon/react

Version:

React components for the Carbon Design System

44 lines (38 loc) 1.15 kB
/** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js'); var PropTypes = require('prop-types'); var React = require('react'); var cx = require('classnames'); var usePrefix = require('../../internal/usePrefix.js'); var Text = require('../Text/Text.js'); require('../Text/TextDirection.js'); function ListItem({ className, children, ...other }) { const prefix = usePrefix.usePrefix(); const classNames = cx(`${prefix}--list__item`, className); return /*#__PURE__*/React.createElement(Text.Text, _rollupPluginBabelHelpers.extends({ as: "li", className: classNames }, other), children); } ListItem.propTypes = { /** * Specify the content for the ListItem */ children: PropTypes.node, /** * Specify an optional className to apply to the underlying `<li>` node */ className: PropTypes.string }; exports.default = ListItem;