UNPKG

@carbon/ibm-security

Version:

Carbon for Cloud & Cognitive IBM Security UI components

38 lines (36 loc) 1.41 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["children", "className"]; /** * @file Time indicator. * @copyright IBM Security 2019 - 2021 */ import { Time16 } from '@carbon/icons-react'; import classnames from 'classnames'; import { node, string } from 'prop-types'; import React from 'react'; import { getComponentNamespace } from '../../globals/namespace'; var namespace = getComponentNamespace('time-indicator'); /** * Time indicators display an estimated amount of time it takes to complete a flow. If there is unavailable space to accommodate the text, `minute` should be abbreviated to `min`. */ var TimeIndicator = function TimeIndicator(_ref) { var children = _ref.children, className = _ref.className, other = _objectWithoutProperties(_ref, _excluded); return /*#__PURE__*/React.createElement("span", _extends({ className: classnames(namespace, className) }, other), /*#__PURE__*/React.createElement(Time16, { className: "".concat(namespace, "__icon") }), children); }; TimeIndicator.defaultProps = { className: null }; TimeIndicator.propTypes = { /** Provide the contents of the `TimeIndicator` */ children: node.isRequired, /** Provide an optional class to be applied to the containing node */ className: string }; export default TimeIndicator;