@thecb/components 11.2.8-beta.0 → 11.2.8-beta.1

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
@@ -21732,6 +21732,7 @@ function adjustHue(degree, color) {
21732
21732
 
21733
21733
  // prettier-ignore
21734
21734
  var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue);
21735
+ var curriedAdjustHue$1 = curriedAdjustHue;
21735
21736
 
21736
21737
  function guard(lowerBoundary, upperBoundary, value) {
21737
21738
  return Math.max(lowerBoundary, Math.min(upperBoundary, value));
@@ -21770,6 +21771,7 @@ function darken(amount, color) {
21770
21771
 
21771
21772
  // prettier-ignore
21772
21773
  var curriedDarken = curry /* ::<number | string, string, string> */(darken);
21774
+ var curriedDarken$1 = curriedDarken;
21773
21775
 
21774
21776
  /**
21775
21777
  * Decreases the intensity of a color. Its range is between 0 to 1. The first
@@ -51527,47 +51529,218 @@ var ContactCard = function ContactCard(_ref) {
51527
51529
  })))));
51528
51530
  };
51529
51531
 
51532
+ // Colors
51530
51533
  var heroPrimaryColor = ROYAL_BLUE_VIVID;
51531
- var heroSecondaryColor = MATISSE_BLUE;
51532
51534
  var heroTextColor = WHITE;
51533
- var fallbackValues$11 = {
51534
- heroPrimaryColor: heroPrimaryColor,
51535
- heroSecondaryColor: heroSecondaryColor,
51536
- heroTextColor: heroTextColor
51535
+
51536
+ // Font Sizes
51537
+ var headingFontSize = {
51538
+ v1: {
51539
+ mobile: "3.00rem",
51540
+ desktop: "3.50rem"
51541
+ },
51542
+ v2: {
51543
+ mobile: "2.50rem",
51544
+ desktop: "3.50rem"
51545
+ }
51546
+ };
51547
+ var subheadingFontSize = {
51548
+ v1: {
51549
+ mobile: "2.00rem",
51550
+ desktop: "2.50rem"
51551
+ }
51552
+ };
51553
+ var descriptionFontSize = {
51554
+ v1: {
51555
+ mobile: FONT_SIZE.MD,
51556
+ desktop: FONT_SIZE.XL
51557
+ },
51558
+ v2: {
51559
+ mobile: FONT_SIZE.LG,
51560
+ desktop: FONT_SIZE.XL
51561
+ }
51537
51562
  };
51538
51563
 
51539
- var _excluded$P = ["variant", "isMobile"];
51564
+ // Line Heights
51565
+ var headingLineHeight = {
51566
+ v1: {
51567
+ mobile: 1.25,
51568
+ desktop: 1.15
51569
+ },
51570
+ v2: {
51571
+ mobile: 1.25,
51572
+ desktop: 1.15
51573
+ }
51574
+ };
51575
+ var subheadingLineHeight = {
51576
+ v1: {
51577
+ mobile: 1.5,
51578
+ desktop: 1.15
51579
+ }
51580
+ };
51581
+ var descriptionLineHeight = {
51582
+ v1: {
51583
+ mobile: 1.5,
51584
+ desktop: 1.5
51585
+ },
51586
+ v2: {
51587
+ mobile: 1.5,
51588
+ desktop: 1.5
51589
+ }
51590
+ };
51591
+
51592
+ // Alignment
51593
+ var textAlign$2 = {
51594
+ v1: {
51595
+ mobile: "left",
51596
+ desktop: "left"
51597
+ },
51598
+ v2: {
51599
+ mobile: "left",
51600
+ desktop: "center"
51601
+ }
51602
+ };
51603
+ var justifyContent = {
51604
+ v1: {
51605
+ mobile: "flex-start",
51606
+ desktop: "flex-start"
51607
+ },
51608
+ v2: {
51609
+ mobile: "flex-start",
51610
+ desktop: "center"
51611
+ }
51612
+ };
51613
+ var fallbackValues$11 = {
51614
+ // Colors
51615
+ heroPrimaryColor: heroPrimaryColor,
51616
+ heroTextColor: heroTextColor,
51617
+ // Font sizes
51618
+ headingFontSize: headingFontSize,
51619
+ descriptionFontSize: descriptionFontSize,
51620
+ subheadingFontSize: subheadingFontSize,
51621
+ // Line heights
51622
+ headingLineHeight: headingLineHeight,
51623
+ subheadingLineHeight: subheadingLineHeight,
51624
+ descriptionLineHeight: descriptionLineHeight,
51625
+ // Alignment
51626
+ textAlign: textAlign$2,
51627
+ justifyContent: justifyContent
51628
+ };
51629
+
51630
+ var _excluded$P = ["variant", "imageUrl", "isMobile", "theme", "extraStyles"],
51631
+ _excluded2$2 = ["theme", "isMobile"],
51632
+ _excluded3 = ["theme", "isMobile"],
51633
+ _excluded4 = ["theme", "isMobile"];
51540
51634
  var getHeroGradientStyles = function getHeroGradientStyles(_ref) {
51541
51635
  var variant = _ref.variant,
51542
51636
  isMobile = _ref.isMobile,
51543
- heroPrimaryColor = _ref.heroPrimaryColor,
51544
- heroSecondaryColor = _ref.heroSecondaryColor;
51637
+ heroPrimaryColor = _ref.heroPrimaryColor;
51545
51638
  var v1Gradient = "linear-gradient(\n 90deg,\n ".concat(heroPrimaryColor, " 33%,\n transparent 100%\n )");
51546
51639
  var v1GradientMobile = "linear-gradient(\n ".concat(rgba$1(heroPrimaryColor, 0.8), ",\n ").concat(rgba$1(heroPrimaryColor, 0.8), "\n )");
51640
+ var heroSecondaryColor = curriedDarken$1(0.18, curriedAdjustHue$1(-29, heroPrimaryColor));
51547
51641
  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];
51642
+ return variant === "v1" ? isMobile ? v1GradientMobile : v1Gradient : v2Gradient;
51552
51643
  };
51553
- var HeroDescription = styled(function (_ref2) {
51644
+ var getDeviceStyles = function getDeviceStyles(isMobile, theme) {
51645
+ return isMobile ? theme.mobile : theme.desktop;
51646
+ };
51647
+ var HeroContainer = styled(function (_ref2) {
51554
51648
  var variant = _ref2.variant,
51649
+ imageUrl = _ref2.imageUrl,
51555
51650
  isMobile = _ref2.isMobile,
51651
+ theme = _ref2.theme,
51652
+ extraStyles = _ref2.extraStyles,
51556
51653
  props = _objectWithoutProperties(_ref2, _excluded$P);
51557
- return /*#__PURE__*/React.createElement(Paragraph$1, props);
51654
+ return /*#__PURE__*/React.createElement(Box, props);
51558
51655
  }).withConfig({
51559
- displayName: "HeroImagestyled__HeroDescription",
51656
+ displayName: "HeroImagestyled__HeroContainer",
51560
51657
  componentId: "sc-oqear-0"
51561
- })(["line-height:150%;font-size:", ";text-align:", ";font-size:", ";"], function (_ref3) {
51562
- var isMobile = _ref3.isMobile;
51563
- return !isMobile ? "1.25rem" : "inherit";
51658
+ })(["display:flex;background:", ";", ""], function (_ref3) {
51659
+ var variant = _ref3.variant,
51660
+ imageUrl = _ref3.imageUrl,
51661
+ isMobile = _ref3.isMobile,
51662
+ theme = _ref3.theme;
51663
+ return "".concat(getHeroGradientStyles({
51664
+ variant: variant,
51665
+ isMobile: isMobile,
51666
+ heroPrimaryColor: theme.heroPrimaryColor
51667
+ }), ",\n url(").concat(imageUrl, ") center / cover no-repeat, ").concat(theme.heroPrimaryColor);
51564
51668
  }, 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";
51669
+ var extraStyles = _ref4.extraStyles;
51670
+ return extraStyles;
51671
+ });
51672
+ var HeroHeading = styled(function (_ref5) {
51673
+ var theme = _ref5.theme,
51674
+ isMobile = _ref5.isMobile,
51675
+ props = _objectWithoutProperties(_ref5, _excluded2$2);
51676
+ return /*#__PURE__*/React.createElement(Title$1, props);
51677
+ }).withConfig({
51678
+ displayName: "HeroImagestyled__HeroHeading",
51679
+ componentId: "sc-oqear-1"
51680
+ })(["font-size:", ";color:", ";font-weight:", ";text-align:", ";line-height:", ";"], function (_ref6) {
51681
+ var theme = _ref6.theme,
51682
+ isMobile = _ref6.isMobile;
51683
+ return getDeviceStyles(isMobile, theme.headingFontSize);
51684
+ }, function (_ref7) {
51685
+ var color = _ref7.color;
51686
+ return color;
51687
+ }, function (_ref8) {
51688
+ var weight = _ref8.weight;
51689
+ return weight;
51690
+ }, function (_ref9) {
51691
+ var textAlign = _ref9.textAlign;
51692
+ return textAlign;
51693
+ }, function (_ref10) {
51694
+ var theme = _ref10.theme,
51695
+ isMobile = _ref10.isMobile;
51696
+ return getDeviceStyles(isMobile, theme.headingLineHeight);
51697
+ });
51698
+ var HeroSubheading = styled(function (_ref11) {
51699
+ var theme = _ref11.theme,
51700
+ isMobile = _ref11.isMobile,
51701
+ props = _objectWithoutProperties(_ref11, _excluded3);
51702
+ return /*#__PURE__*/React.createElement(Title$1, props);
51703
+ }).withConfig({
51704
+ displayName: "HeroImagestyled__HeroSubheading",
51705
+ componentId: "sc-oqear-2"
51706
+ })(["font-size:", ";color:", ";font-weight:", ";text-align:", ";line-height:", ";"], function (_ref12) {
51707
+ var theme = _ref12.theme,
51708
+ isMobile = _ref12.isMobile;
51709
+ return getDeviceStyles(isMobile, theme.subheadingFontSize);
51710
+ }, function (_ref13) {
51711
+ var color = _ref13.color;
51712
+ return color;
51713
+ }, function (_ref14) {
51714
+ var weight = _ref14.weight;
51715
+ return weight;
51716
+ }, function (_ref15) {
51717
+ var textAlign = _ref15.textAlign;
51718
+ return textAlign;
51719
+ }, function (_ref16) {
51720
+ var theme = _ref16.theme,
51721
+ isMobile = _ref16.isMobile;
51722
+ return getDeviceStyles(isMobile, theme.subheadingLineHeight);
51723
+ });
51724
+ var HeroDescription = styled(function (_ref17) {
51725
+ var theme = _ref17.theme,
51726
+ isMobile = _ref17.isMobile,
51727
+ props = _objectWithoutProperties(_ref17, _excluded4);
51728
+ return /*#__PURE__*/React.createElement(Paragraph$1, props);
51729
+ }).withConfig({
51730
+ displayName: "HeroImagestyled__HeroDescription",
51731
+ componentId: "sc-oqear-3"
51732
+ })(["line-height:", ";font-size:", ";text-align:", ";"], function (_ref18) {
51733
+ var theme = _ref18.theme,
51734
+ isMobile = _ref18.isMobile;
51735
+ return getDeviceStyles(isMobile, theme.descriptionLineHeight);
51736
+ }, function (_ref19) {
51737
+ var theme = _ref19.theme,
51738
+ isMobile = _ref19.isMobile;
51739
+ return getDeviceStyles(isMobile, theme.descriptionFontSize);
51740
+ }, function (_ref20) {
51741
+ var theme = _ref20.theme,
51742
+ isMobile = _ref20.isMobile;
51743
+ return getDeviceStyles(isMobile, theme.textAlign);
51571
51744
  });
51572
51745
 
51573
51746
  var HeroImage = function HeroImage(_ref) {
@@ -51591,57 +51764,60 @@ var HeroImage = function HeroImage(_ref) {
51591
51764
  _ref$secondaryHeading = _ref.secondaryHeadingVariant,
51592
51765
  secondaryHeadingVariant = _ref$secondaryHeading === void 0 ? "h2" : _ref$secondaryHeading,
51593
51766
  extraStyles = _ref.extraStyles;
51594
- var _useContext = useContext(ThemeContext),
51595
- isMobile = _useContext.isMobile;
51596
- var gradientStyles = getHeroGradientStyles({
51767
+ var themeContext = useContext(ThemeContext);
51768
+ var isMobile = themeContext.isMobile;
51769
+ return /*#__PURE__*/React.createElement(HeroContainer, {
51597
51770
  variant: variant,
51598
- isMobile: isMobile,
51599
- heroPrimaryColor: themeValues.heroPrimaryColor,
51600
- heroSecondaryColor: themeValues.heroSecondaryColor
51601
- });
51602
- return /*#__PURE__*/React.createElement(Box, {
51603
51771
  minWidth: minWidth,
51604
51772
  minHeight: minHeight,
51605
51773
  padding: isMobile ? "2rem" : "3rem 2rem",
51606
- extraStyles: "\n display: flex;\n background: ".concat(gradientStyles, ",\n url(").concat(imageUrl, ") center / cover no-repeat, ").concat(themeValues.heroPrimaryColor, ";\n ").concat(extraStyles, "\n ")
51774
+ extraStyles: extraStyles,
51775
+ imageUrl: imageUrl,
51776
+ isMobile: isMobile,
51777
+ theme: themeValues
51607
51778
  }, /*#__PURE__*/React.createElement(Center, {
51608
51779
  maxWidth: contentMaxWidth,
51609
51780
  width: "100%",
51610
51781
  intrinsic: true,
51611
- extraStyles: "\n flex-flow: unset;\n justify-content: ".concat(variant === "v2" ? "center" : "flex-start", ";\n flex-wrap: nowrap;\n ")
51782
+ extraStyles: "\n flex-flow: unset;\n justify-content: ".concat(getDeviceStyles(isMobile, themeValues.justifyContent), ";\n flex-wrap: nowrap;\n ")
51612
51783
  }, /*#__PURE__*/React.createElement(Stack, {
51613
51784
  childGap: contentSpacing,
51614
51785
  extraStyles: "max-width: ".concat(isMobile || variant === "v2" ? "100%" : "50%", ";")
51615
51786
  }, variant === "v1" ? /*#__PURE__*/React.createElement(Stack, {
51616
51787
  childGap: "0"
51617
- }, heading && /*#__PURE__*/React.createElement(Title$1, {
51788
+ }, heading && /*#__PURE__*/React.createElement(HeroHeading, {
51618
51789
  variant: "hero",
51619
51790
  as: headingVariant,
51620
51791
  weight: FONT_WEIGHT_BOLD,
51621
51792
  color: themeValues.heroTextColor,
51622
- extraStyles: "line-height: ".concat(isMobile ? "125%" : "115%", ";")
51623
- }, heading), subheading && /*#__PURE__*/React.createElement(Title$1, {
51793
+ textAlign: getDeviceStyles(isMobile, themeValues.textAlign),
51794
+ isMobile: isMobile,
51795
+ theme: themeValues
51796
+ }, heading), subheading && /*#__PURE__*/React.createElement(HeroSubheading, {
51624
51797
  variant: "large",
51625
51798
  as: secondaryHeadingVariant,
51626
51799
  weight: FONT_WEIGHT_SEMIBOLD,
51627
- fontSize: isMobile ? "2rem" : "2.5rem",
51800
+ textAlign: getDeviceStyles(isMobile, themeValues.textAlign),
51628
51801
  color: themeValues.heroTextColor,
51629
- extraStyles: "line-height: ".concat(isMobile ? "150%" : "115%", ";")
51630
- }, subheading)) : /*#__PURE__*/React.createElement(React.Fragment, null, heading && /*#__PURE__*/React.createElement(Title$1, {
51802
+ isMobile: isMobile,
51803
+ theme: themeValues
51804
+ }, subheading)) : /*#__PURE__*/React.createElement(React.Fragment, null, heading && /*#__PURE__*/React.createElement(HeroHeading, {
51631
51805
  variant: "hero",
51632
51806
  as: headingVariant,
51633
51807
  weight: FONT_WEIGHT_BOLD,
51634
51808
  color: themeValues.heroTextColor,
51635
- extraStyles: "text-align: center; line-height: ".concat(isMobile ? "125%" : "115%", ";")
51809
+ textAlign: getDeviceStyles(isMobile, themeValues.textAlign),
51810
+ isMobile: isMobile,
51811
+ theme: themeValues
51636
51812
  }, heading)), description && /*#__PURE__*/React.createElement(Box, {
51637
51813
  padding: "0"
51638
51814
  }, /*#__PURE__*/React.createElement(HeroDescription, {
51639
51815
  color: themeValues.heroTextColor,
51640
51816
  isMobile: isMobile,
51641
- variant: variant
51817
+ theme: themeValues
51642
51818
  }, description)))));
51643
51819
  };
51644
- var HeroImage$1 = withWindowSize(themeComponent(HeroImage, "HeroImage", fallbackValues$11));
51820
+ var HeroImage$1 = withWindowSize(themeComponent(HeroImage, "HeroImage", fallbackValues$11, "v1"));
51645
51821
 
51646
51822
  var pageBackground = "#FBFCFD";
51647
51823
  var fallbackValues$12 = {