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