@thecb/components 11.2.6 → 11.2.8-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -51536,17 +51536,39 @@ var fallbackValues$11 = {
51536
51536
  heroTextColor: heroTextColor
51537
51537
  };
51538
51538
 
51539
- var getHeroImageVariantStyles = function getHeroImageVariantStyles(_ref) {
51539
+ var _excluded$P = ["variant", "isMobile"];
51540
+ var getHeroGradientStyles = function getHeroGradientStyles(_ref) {
51540
51541
  var variant = _ref.variant,
51541
- imageUrl = _ref.imageUrl,
51542
51542
  isMobile = _ref.isMobile,
51543
- heroPrimaryColor = _ref.heroPrimaryColor;
51544
- return "\n background: ".concat(!isMobile ? "linear-gradient(\n 90deg,\n ".concat(heroPrimaryColor, " 33%,\n transparent 100%\n )") : "linear-gradient(\n ".concat(rgba$1(heroPrimaryColor, 0.8), ",\n ").concat(rgba$1(heroPrimaryColor, 0.8), "\n )"), ",\n url(").concat(imageUrl, ") center / cover no-repeat, ").concat(heroPrimaryColor, ";\n ");
51545
- };
51546
- var HeroImageContainer = styled(Box).withConfig({
51547
- displayName: "HeroImagestyled__HeroImageContainer",
51543
+ heroPrimaryColor = _ref.heroPrimaryColor,
51544
+ heroSecondaryColor = _ref.heroSecondaryColor;
51545
+ var v1Gradient = "linear-gradient(\n 90deg,\n ".concat(heroPrimaryColor, " 33%,\n transparent 100%\n )");
51546
+ var v1GradientMobile = "linear-gradient(\n ".concat(rgba$1(heroPrimaryColor, 0.8), ",\n ").concat(rgba$1(heroPrimaryColor, 0.8), "\n )");
51547
+ var v2Gradient = "linear-gradient(\n 90deg,\n ".concat(rgba$1(heroPrimaryColor, 0.8), " 0%,\n ").concat(rgba$1(heroSecondaryColor, 0.8), " 100%\n )");
51548
+ return {
51549
+ v1: isMobile ? v1GradientMobile : v1Gradient,
51550
+ v2: v2Gradient
51551
+ }[variant];
51552
+ };
51553
+ var HeroDescription = styled(function (_ref2) {
51554
+ var variant = _ref2.variant,
51555
+ isMobile = _ref2.isMobile,
51556
+ props = _objectWithoutProperties(_ref2, _excluded$P);
51557
+ return /*#__PURE__*/React.createElement(Paragraph$1, props);
51558
+ }).withConfig({
51559
+ displayName: "HeroImagestyled__HeroDescription",
51548
51560
  componentId: "sc-oqear-0"
51549
- })(["display:flex;"]);
51561
+ })(["line-height:150%;font-size:", ";text-align:", ";font-size:", ";"], function (_ref3) {
51562
+ var isMobile = _ref3.isMobile;
51563
+ return !isMobile ? "1.25rem" : "inherit";
51564
+ }, function (_ref4) {
51565
+ var variant = _ref4.variant;
51566
+ return variant === "v2" ? "center" : "inherit";
51567
+ }, function (_ref5) {
51568
+ var variant = _ref5.variant,
51569
+ isMobile = _ref5.isMobile;
51570
+ return variant === "v2" ? isMobile ? "1.125rem" : "1.25rem" : "inherit";
51571
+ });
51550
51572
 
51551
51573
  var HeroImage = function HeroImage(_ref) {
51552
51574
  var _ref$variant = _ref.variant,
@@ -51571,26 +51593,26 @@ var HeroImage = function HeroImage(_ref) {
51571
51593
  extraStyles = _ref.extraStyles;
51572
51594
  var _useContext = useContext(ThemeContext),
51573
51595
  isMobile = _useContext.isMobile;
51574
- var heroImageVariantStyles = getHeroImageVariantStyles({
51596
+ var gradientStyles = getHeroGradientStyles({
51575
51597
  variant: variant,
51576
- imageUrl: imageUrl,
51577
51598
  isMobile: isMobile,
51578
- heroPrimaryColor: themeValues.heroPrimaryColor
51599
+ heroPrimaryColor: themeValues.heroPrimaryColor,
51600
+ heroSecondaryColor: themeValues.heroSecondaryColor
51579
51601
  });
51580
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HeroImageContainer, {
51602
+ return /*#__PURE__*/React.createElement(Box, {
51581
51603
  minWidth: minWidth,
51582
51604
  minHeight: minHeight,
51583
51605
  padding: isMobile ? "2rem" : "3rem 2rem",
51584
- extraStyles: "".concat(heroImageVariantStyles, " ").concat(extraStyles)
51606
+ extraStyles: "\n display: flex;\n background: ".concat(gradientStyles, ",\n url(").concat(imageUrl, ") center / cover no-repeat, ").concat(themeValues.heroPrimaryColor, ";\n ").concat(extraStyles, "\n ")
51585
51607
  }, /*#__PURE__*/React.createElement(Center, {
51586
51608
  maxWidth: contentMaxWidth,
51587
51609
  width: "100%",
51588
51610
  intrinsic: true,
51589
- extraStyles: "\n flex-flow: unset;\n justify-content: flex-start;\n flex-wrap: nowrap;\n "
51611
+ extraStyles: "\n flex-flow: unset;\n justify-content: ".concat(variant === "v2" ? "center" : "flex-start", ";\n flex-wrap: nowrap;\n ")
51590
51612
  }, /*#__PURE__*/React.createElement(Stack, {
51591
51613
  childGap: contentSpacing,
51592
- extraStyles: "max-width: ".concat(isMobile ? "100%" : "50%", ";")
51593
- }, /*#__PURE__*/React.createElement(Stack, {
51614
+ extraStyles: "max-width: ".concat(isMobile || variant === "v2" ? "100%" : "50%", ";")
51615
+ }, variant === "v1" ? /*#__PURE__*/React.createElement(Stack, {
51594
51616
  childGap: "0"
51595
51617
  }, heading && /*#__PURE__*/React.createElement(Title$1, {
51596
51618
  variant: "hero",
@@ -51605,12 +51627,19 @@ var HeroImage = function HeroImage(_ref) {
51605
51627
  fontSize: isMobile ? "2rem" : "2.5rem",
51606
51628
  color: themeValues.heroTextColor,
51607
51629
  extraStyles: "line-height: ".concat(isMobile ? "150%" : "115%", ";")
51608
- }, subheading)), description && /*#__PURE__*/React.createElement(Box, {
51630
+ }, subheading)) : /*#__PURE__*/React.createElement(React.Fragment, null, heading && /*#__PURE__*/React.createElement(Title$1, {
51631
+ variant: "hero",
51632
+ as: headingVariant,
51633
+ weight: FONT_WEIGHT_BOLD,
51634
+ color: themeValues.heroTextColor,
51635
+ extraStyles: "text-align: center; line-height: ".concat(isMobile ? "125%" : "115%", ";")
51636
+ }, heading)), description && /*#__PURE__*/React.createElement(Box, {
51609
51637
  padding: "0"
51610
- }, /*#__PURE__*/React.createElement(Paragraph$1, {
51638
+ }, /*#__PURE__*/React.createElement(HeroDescription, {
51611
51639
  color: themeValues.heroTextColor,
51612
- extraStyles: "line-height: 150%; ".concat(!isMobile ? "font-size: 1.25rem;" : "")
51613
- }, description))))));
51640
+ isMobile: isMobile,
51641
+ variant: variant
51642
+ }, description)))));
51614
51643
  };
51615
51644
  var HeroImage$1 = withWindowSize(themeComponent(HeroImage, "HeroImage", fallbackValues$11));
51616
51645