@porsche-design-system/components-react
Version:
Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.
31 lines (27 loc) • 1.62 kB
JavaScript
;
var jsxRuntime = require('react/jsx-runtime');
var splitChildren = require('../../splitChildren.cjs');
var react = require('react');
var minifyCss = require('../../minifyCss.cjs');
var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.cjs');
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
/**
* @slot {"name": "", "description": "Default slot to render the headline." }
*
* @deprecated since v3.0.0, will be removed with next major release. Please use "p-heading" instead.
*/
class DSRHeadline extends react.Component {
host;
render() {
splitChildren.splitChildren(this.props.children);
const alignDeprecationMap = {
left: 'start',
right: 'end',
};
const TagType = utilsEntry.getHeadlineTagType(null, this.props.variant, this.props.tag);
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getHeadlineCss(this.props.variant, (alignDeprecationMap[this.props.align] || this.props.align), this.props.color, this.props.ellipsis, this.props.theme)));
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(TagType, { className: "root", children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
}
}
exports.DSRHeadline = DSRHeadline;