UNPKG

@carbon/react

Version:

React components for the Carbon Design System

66 lines (58 loc) 2.1 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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes); var React__default = /*#__PURE__*/_interopDefaultLegacy(React); var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx); function OrderedList({ className, nested = false, native = false, isExpressive = false, ...other }) { const prefix = usePrefix.usePrefix(); const classNames = cx__default["default"]({ [`${prefix}--list--ordered`]: !native, [`${prefix}--list--ordered--native`]: native, [`${prefix}--list--nested`]: nested, [`${prefix}--list--expressive`]: isExpressive }, className); return /*#__PURE__*/React__default["default"].createElement("ol", _rollupPluginBabelHelpers["extends"]({ className: classNames }, other)); } OrderedList.propTypes = { /** * Provide list items to be rendered in the ordered list */ children: PropTypes__default["default"].node, /** * Provide an optional className to be applied to the containing <ol> node */ className: PropTypes__default["default"].string, /** * Specify whether this ordered list expressive or not */ isExpressive: PropTypes__default["default"].bool, /** * Specify whether this ordered list should use native list styles instead of custom counter */ native: PropTypes__default["default"].bool, /** * Specify whether this ordered list is nested inside of another nested list */ nested: PropTypes__default["default"].bool }; exports["default"] = OrderedList;