Debian Codegraph @

node/@patternfly/react-core/dist/esm/components/Content/Content.js

raw
1 import { __rest } from "tslib";
2 import { jsx as _jsx } from "react/jsx-runtime";
3 import { css } from '@patternfly/react-styles';
4 import styles from '@patternfly/react-styles/css/components/Content/content.mjs';
5 import { useOUIAProps } from '../../helpers';
6 export var ContentVariants;
7 (function (ContentVariants) {
8 ContentVariants["h1"] = "h1";
9 ContentVariants["h2"] = "h2";
10 ContentVariants["h3"] = "h3";
11 ContentVariants["h4"] = "h4";
12 ContentVariants["h5"] = "h5";
13 ContentVariants["h6"] = "h6";
14 ContentVariants["p"] = "p";
15 ContentVariants["a"] = "a";
16 ContentVariants["small"] = "small";
17 ContentVariants["blockquote"] = "blockquote";
18 ContentVariants["pre"] = "pre";
19 ContentVariants["hr"] = "hr";
20 ContentVariants["ul"] = "ul";
21 ContentVariants["ol"] = "ol";
22 ContentVariants["dl"] = "dl";
23 ContentVariants["li"] = "li";
24 ContentVariants["dt"] = "dt";
25 ContentVariants["dd"] = "dd";
26 })(ContentVariants || (ContentVariants = {}));
27 const componentStyles = {
28 div: styles.content,
29 h1: styles.contentH1,
30 h2: styles.contentH2,
31 h3: styles.contentH3,
32 h4: styles.contentH4,
33 h5: styles.contentH5,
34 h6: styles.contentH6,
35 p: styles.contentP,
36 a: styles.contentA,
37 small: styles.contentSmall,
38 blockquote: styles.contentBlockquote,
39 pre: styles.contentPre,
40 hr: styles.contentHr,
41 ul: styles.contentUl,
42 ol: styles.contentOl,
43 dl: styles.contentDl,
44 li: styles.contentLi,
45 dt: styles.contentDt,
46 dd: styles.contentDd
47 };
48 export const Content = (_a) => {
49 var { children, className = '', component, isPlainList = false, isVisitedLink = false, ouiaId, ouiaSafe = true, isEditorial = false } = _a, props = __rest(_a, ["children", "className", "component", "isPlainList", "isVisitedLink", "ouiaId", "ouiaSafe", "isEditorial"]);
50 const wrappingComponent = component !== null && component !== void 0 ? component : 'div';
51 const Component = wrappingComponent;
52 const ouiaProps = useOUIAProps(Content.displayName, ouiaId, ouiaSafe);
53 const isList = ['ul', 'ol', 'dl'].includes(wrappingComponent);
54 return (_jsx(Component, Object.assign({}, ouiaProps, props, { "data-pf-content": true, className: css(componentStyles[wrappingComponent], isList && isPlainList && styles.modifiers.plain, isVisitedLink && styles.modifiers.visited, isEditorial && styles.modifiers.editorial, className), children: children })));
55 };
56 Content.displayName = 'Content';
57 //# sourceMappingURL=Content.js.map