@carbon/ibm-cloud-cognitive-cdai
Version:
Carbon for Cloud & Cognitive CD&AI UI components
37 lines (36 loc) • 1.78 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
//
// Copyright IBM Corp. 2020, 2020
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
import React from 'react';
import PropTypes from 'prop-types';
import { settings } from 'carbon-components';
import { idAttribute } from '../../../component_helpers/IDHelper';
import { idePrefix } from '../../../globals/js/settings';
var prefix = settings.prefix;
var IdePageContent = function IdePageContent(_ref) {
var bleedClassName = _ref.bleedClassName,
children = _ref.children,
className = _ref.className;
var pageContentWrapper = /*#__PURE__*/React.createElement("div", _extends({}, idAttribute("IdePageContent-container"), {
className: "".concat(className, " ").concat(idePrefix, "-page-content-use-width ").concat(prefix, "--grid ").concat(idePrefix, "--content-alignment")
}), children);
return bleedClassName ? /*#__PURE__*/React.createElement("div", _extends({}, idAttribute("IdePageContent-bleed-container"), {
className: "".concat(idePrefix, "-page-content-use-width ").concat(bleedClassName)
}), pageContentWrapper) : pageContentWrapper;
};
IdePageContent.defaultProps = {
className: ''
};
IdePageContent.propTypes = {
/** bleedClassName. If your content required a bleed effect, provide a class name here (with your desired background colour) to apply this effect */
bleedClassName: PropTypes.string,
/** children. Standard prop, required to render content inside this component/take advantage of the provided grid and alignment classes */
children: PropTypes.node,
/** className. Append your own css class to the grid if required */
className: PropTypes.string
};
export default IdePageContent;