"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=exports.propTypes=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread")),_react=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_classnames=_interopRequireDefault(require("classnames")),_componentHelper=require("../../shared/component-helper"),renderProps={render_content:null},propTypes={content:_propTypes.default.string,modifier:_propTypes.default.string,tag:_propTypes.default.string,class:_propTypes.default.string,className:_propTypes.default.string,children:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.node,_propTypes.default.func]),render_content:_propTypes.default.func};exports.propTypes=propTypes;var defaultProps=(0,_objectSpread2.default)({content:null,modifier:null,tag:"h2",class:null,className:null,children:null},renderProps);exports.defaultProps=defaultProps;var _ref=_react.default.createElement("span",{className:"dnb-line-title__mask","aria-hidden":"true"}),_ref2=_react.default.createElement("span",{className:"dnb-line-title__line","aria-hidden":"true"}),LineTitle=function(e){function s(){return(0,_classCallCheck2.default)(this,s),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(s).apply(this,arguments))}return(0,_inherits2.default)(s,e),(0,_createClass2.default)(s,[{key:"render",value:function(){var e=this.props,t=e.tag,r=e.modifier,n=e.className,l=e.class,a=s.getContent(this.props),p={className:(0,_classnames.default)("dnb-line-title",n,l,r?"dnb-line-title--".concat(r):null)};(0,_componentHelper.validateDOMAttributes)(this.props,p);var i="".concat(t);return _react.default.createElement(i,p,_react.default.createElement("span",{className:"dnb-line-title__title dnb-typo-light"},_ref,_react.default.createElement("span",{className:"dnb-line-title__text"},a)),_ref2)}}],[{key:"enableWebComponent",value:function(){(0,_componentHelper.registerElement)(s.tagName,s,defaultProps)}},{key:"getContent",value:function(e){return"string"==typeof e.content?e.content:"function"==typeof e.render_content?e.render_content(e):(0,_componentHelper.processChildren)(e)}}]),s}(_react.PureComponent);exports.default=LineTitle,(0,_defineProperty2.default)(LineTitle,"tagName","dnb-line-title"),(0,_defineProperty2.default)(LineTitle,"defaultProps",defaultProps),LineTitle.propTypes="production"!==process.env.NODE_ENV?propTypes:{};
//# sourceMappingURL=LineTitle.js.map
