UNPKG

@carbon/react

Version:

React components for the Carbon Design System

53 lines (47 loc) 1.42 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'); function UnorderedList({ className, nested = false, isExpressive = false, ...other }) { const prefix = usePrefix.usePrefix(); const classNames = cx(`${prefix}--list--unordered`, className, { [`${prefix}--list--nested`]: nested, [`${prefix}--list--expressive`]: isExpressive }); return /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({ className: classNames }, other)); } UnorderedList.propTypes = { /** * Specify a collection of ListItem's to be rendered in the UnorderedList */ children: PropTypes.node, /** * Specify an optional className to be applied to the underlying `<ul>` node */ className: PropTypes.string, /** * Specify whether this ordered list expressive or not */ isExpressive: PropTypes.bool, /** * Specify whether the list is nested, or not */ nested: PropTypes.bool }; exports.default = UnorderedList;