| 1 |
import { __rest } from "tslib"; |
| 2 |
import { jsx as _jsx } from "react/jsx-runtime"; |
| 3 |
import styles from '@patternfly/react-styles/css/components/Hero/hero.mjs'; |
| 4 |
import { css } from '@patternfly/react-styles'; |
| 5 |
import heroBackgroundImageLight from '@patternfly/react-tokens/dist/esm/c_hero_BackgroundImage_light'; |
| 6 |
import heroBackgroundImageDark from '@patternfly/react-tokens/dist/esm/c_hero_BackgroundImage_dark'; |
| 7 |
import heroGradientStop1Light from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_1_light'; |
| 8 |
import heroGradientStop2Light from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_2_light'; |
| 9 |
import heroGradientStop3Light from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_3_light'; |
| 10 |
import heroGradientStop1Dark from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_1_dark'; |
| 11 |
import heroGradientStop2Dark from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_2_dark'; |
| 12 |
import heroGradientStop3Dark from '@patternfly/react-tokens/dist/esm/c_hero_gradient_stop_3_dark'; |
| 13 |
import heroBodyWidth from '@patternfly/react-tokens/dist/esm/c_hero__body_Width'; |
| 14 |
import heroBodyMaxWidth from '@patternfly/react-tokens/dist/esm/c_hero__body_MaxWidth'; |
| 15 |
export const Hero = (_a) => { |
| 16 |
var { className, children, backgroundSrcLight, backgroundSrcDark, gradientLight, gradientDark, isGlass = false, bodyWidth, bodyMaxWidth } = _a, props = __rest(_a, ["className", "children", "backgroundSrcLight", "backgroundSrcDark", "gradientLight", "gradientDark", "isGlass", "bodyWidth", "bodyMaxWidth"]); |
| 17 |
const customStyles = {}; |
| 18 |
if (backgroundSrcLight) { |
| 19 |
customStyles[heroBackgroundImageLight.name] = `url(${backgroundSrcLight})`; |
| 20 |
} |
| 21 |
if (backgroundSrcDark) { |
| 22 |
customStyles[heroBackgroundImageDark.name] = `url(${backgroundSrcDark})`; |
| 23 |
} |
| 24 |
if (gradientLight === null || gradientLight === void 0 ? void 0 : gradientLight.stop1) { |
| 25 |
customStyles[heroGradientStop1Light.name] = gradientLight.stop1; |
| 26 |
} |
| 27 |
if (gradientLight === null || gradientLight === void 0 ? void 0 : gradientLight.stop2) { |
| 28 |
customStyles[heroGradientStop2Light.name] = gradientLight.stop2; |
| 29 |
} |
| 30 |
if (gradientLight === null || gradientLight === void 0 ? void 0 : gradientLight.stop3) { |
| 31 |
customStyles[heroGradientStop3Light.name] = gradientLight.stop3; |
| 32 |
} |
| 33 |
if (gradientDark === null || gradientDark === void 0 ? void 0 : gradientDark.stop1) { |
| 34 |
customStyles[heroGradientStop1Dark.name] = gradientDark.stop1; |
| 35 |
} |
| 36 |
if (gradientDark === null || gradientDark === void 0 ? void 0 : gradientDark.stop2) { |
| 37 |
customStyles[heroGradientStop2Dark.name] = gradientDark.stop2; |
| 38 |
} |
| 39 |
if (gradientDark === null || gradientDark === void 0 ? void 0 : gradientDark.stop3) { |
| 40 |
customStyles[heroGradientStop3Dark.name] = gradientDark.stop3; |
| 41 |
} |
| 42 |
if (bodyWidth) { |
| 43 |
customStyles[heroBodyWidth.name] = bodyWidth; |
| 44 |
} |
| 45 |
if (bodyMaxWidth) { |
| 46 |
customStyles[heroBodyMaxWidth.name] = bodyMaxWidth; |
| 47 |
} |
| 48 |
return (_jsx("div", Object.assign({ className: css(styles.hero, isGlass && styles.modifiers.glass, className), style: Object.assign(Object.assign({}, props.style), customStyles) }, props, { children: _jsx("div", { className: css(styles.heroBody), children: children }) }))); |
| 49 |
}; |
| 50 |
Hero.displayName = 'Hero'; |
| 51 |
//# sourceMappingURL=Hero.js.map |