Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Hero/Hero.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.Hero = void 0;
4 const tslib_1 = require("tslib");
5 const jsx_runtime_1 = require("react/jsx-runtime");
6 const hero_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Hero/hero"));
7 const react_styles_1 = require("@patternfly/react-styles");
8 const c_hero_BackgroundImage_light_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_BackgroundImage_light'));
9 const c_hero_BackgroundImage_dark_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_BackgroundImage_dark'));
10 const c_hero_gradient_stop_1_light_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_gradient_stop_1_light'));
11 const c_hero_gradient_stop_2_light_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_gradient_stop_2_light'));
12 const c_hero_gradient_stop_3_light_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_gradient_stop_3_light'));
13 const c_hero_gradient_stop_1_dark_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_gradient_stop_1_dark'));
14 const c_hero_gradient_stop_2_dark_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_gradient_stop_2_dark'));
15 const c_hero_gradient_stop_3_dark_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero_gradient_stop_3_dark'));
16 const c_hero__body_Width_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero__body_Width'));
17 const c_hero__body_MaxWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_hero__body_MaxWidth'));
18 const Hero = (_a) => {
19 var { className, children, backgroundSrcLight, backgroundSrcDark, gradientLight, gradientDark, isGlass = false, bodyWidth, bodyMaxWidth } = _a, props = tslib_1.__rest(_a, ["className", "children", "backgroundSrcLight", "backgroundSrcDark", "gradientLight", "gradientDark", "isGlass", "bodyWidth", "bodyMaxWidth"]);
20 const customStyles = {};
21 if (backgroundSrcLight) {
22 customStyles[c_hero_BackgroundImage_light_1.default.name] = `url(${backgroundSrcLight})`;
23 }
24 if (backgroundSrcDark) {
25 customStyles[c_hero_BackgroundImage_dark_1.default.name] = `url(${backgroundSrcDark})`;
26 }
27 if (gradientLight === null || gradientLight === void 0 ? void 0 : gradientLight.stop1) {
28 customStyles[c_hero_gradient_stop_1_light_1.default.name] = gradientLight.stop1;
29 }
30 if (gradientLight === null || gradientLight === void 0 ? void 0 : gradientLight.stop2) {
31 customStyles[c_hero_gradient_stop_2_light_1.default.name] = gradientLight.stop2;
32 }
33 if (gradientLight === null || gradientLight === void 0 ? void 0 : gradientLight.stop3) {
34 customStyles[c_hero_gradient_stop_3_light_1.default.name] = gradientLight.stop3;
35 }
36 if (gradientDark === null || gradientDark === void 0 ? void 0 : gradientDark.stop1) {
37 customStyles[c_hero_gradient_stop_1_dark_1.default.name] = gradientDark.stop1;
38 }
39 if (gradientDark === null || gradientDark === void 0 ? void 0 : gradientDark.stop2) {
40 customStyles[c_hero_gradient_stop_2_dark_1.default.name] = gradientDark.stop2;
41 }
42 if (gradientDark === null || gradientDark === void 0 ? void 0 : gradientDark.stop3) {
43 customStyles[c_hero_gradient_stop_3_dark_1.default.name] = gradientDark.stop3;
44 }
45 if (bodyWidth) {
46 customStyles[c_hero__body_Width_1.default.name] = bodyWidth;
47 }
48 if (bodyMaxWidth) {
49 customStyles[c_hero__body_MaxWidth_1.default.name] = bodyMaxWidth;
50 }
51 return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, react_styles_1.css)(hero_1.default.hero, isGlass && hero_1.default.modifiers.glass, className), style: Object.assign(Object.assign({}, props.style), customStyles) }, props, { children: (0, jsx_runtime_1.jsx)("div", { className: (0, react_styles_1.css)(hero_1.default.heroBody), children: children }) })));
52 };
53 exports.Hero = Hero;
54 exports.Hero.displayName = 'Hero';
55 //# sourceMappingURL=Hero.js.map