UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

65 lines 3.25 kB
/** @component list-separator */ var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import React from 'react'; import PropTypes from 'prop-types'; import { prefix } from '../utils/index'; import { Text } from '../../components'; /** * @deprecated - Components in the legacy folder (/src/legacy) are deprecated. Please use a component from the components folder (/src/components) instead. Legacy components may not follow accessibility standards. **/ var ListSeparator = function (props) { var children = props.children, className = props.className, lineColor = props.lineColor, margin = props.margin, textColor = props.textColor, text = props.text, textPadding = props.textPadding, otherProps = __rest(props, ["children", "className", "lineColor", "margin", "textColor", "text", "textPadding"]); var lsClass = "".concat(prefix, "-list-separator"); return (React.createElement("div", __assign({ className: "".concat(lsClass) + "".concat((className && " ".concat(className)) || ''), style: __assign(__assign({}, (lineColor && { color: lineColor })), (margin && { margin: margin })) }, otherProps), React.createElement("span", { className: "".concat(lsClass, "__container") }, children || (text && (React.createElement(Text, { className: "".concat(lsClass, "__text"), style: __assign(__assign({}, (textColor && { color: textColor })), (textPadding && { padding: textPadding })), type: "subheader-secondary", tagName: "span" }, children ? children : text)))))); }; ListSeparator.propTypes = { /** @prop Children nodes to render inside ListSeparator | null */ children: PropTypes.node, /** @prop Optional css class name | null */ className: PropTypes.string, /** @prop Color of the ListSeparator line | null */ lineColor: PropTypes.string, /** @prop Margin of the ListSeparator | null */ margin: PropTypes.string, /** @prop Text of the ListSeparator | null */ text: PropTypes.string, /** @prop TextColor of the ListSeparator | null */ textColor: PropTypes.string, /** @prop Padding around text of the ListSeparator | null */ textPadding: PropTypes.string, }; ListSeparator.defaultProps = { children: null, className: null, lineColor: null, margin: null, text: null, textColor: null, textPadding: null, }; ListSeparator.displayName = 'ListSeparator'; export default ListSeparator; //# sourceMappingURL=index.js.map