@thecb/components 4.5.1 → 4.5.2

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
@@ -21903,6 +21903,125 @@ var HamburgerButton = function HamburgerButton(_ref4) {
21903
21903
  })));
21904
21904
  };
21905
21905
 
21906
+ function _templateObject$t() {
21907
+ var data = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: 1.5;\n color: ", ";\n font-weight: ", ";\n margin: ", ";\n text-align: ", ";\n font-family: ", ";\n\n ", ";\n"]);
21908
+
21909
+ _templateObject$t = function _templateObject() {
21910
+ return data;
21911
+ };
21912
+
21913
+ return data;
21914
+ }
21915
+ var TitleText = styled__default.h1(_templateObject$t(), function (_ref) {
21916
+ var fontSize = _ref.fontSize;
21917
+ return fontSize;
21918
+ }, function (_ref2) {
21919
+ var color = _ref2.color;
21920
+ return color;
21921
+ }, function (_ref3) {
21922
+ var weight = _ref3.weight;
21923
+ return weight;
21924
+ }, function (_ref4) {
21925
+ var margin = _ref4.margin;
21926
+ return margin;
21927
+ }, function (_ref5) {
21928
+ var textAlign = _ref5.textAlign;
21929
+ return textAlign;
21930
+ }, function (_ref6) {
21931
+ var fontFamily = _ref6.fontFamily;
21932
+ return fontFamily;
21933
+ }, function (_ref7) {
21934
+ var extraStyles = _ref7.extraStyles;
21935
+ return extraStyles;
21936
+ });
21937
+
21938
+ var fontSize$9 = {
21939
+ large: "1.5rem",
21940
+ small: "1.25rem"
21941
+ };
21942
+ var fontFamily$5 = {
21943
+ large: "Public Sans",
21944
+ small: "Public Sans"
21945
+ };
21946
+ var mobileFontSize$1 = {
21947
+ large: "1.5rem",
21948
+ small: "1.2142rem"
21949
+ };
21950
+ var fallbackValues$l = {
21951
+ fontFamily: fontFamily$5,
21952
+ fontSize: fontSize$9
21953
+ };
21954
+ var mobileFallbackValues$1 = {
21955
+ fontFamily: fontFamily$5,
21956
+ fontSize: mobileFontSize$1
21957
+ };
21958
+ var MOBILE_BREAKPOINT$1 = 768;
21959
+
21960
+ /*
21961
+ New responsive text component for Title elements
21962
+ Size is decoupled from tag
21963
+ Comes with two variants - "large" and "small"
21964
+ Large variant results in text that is 1.5rem (24px desktop, 21px mobile)
21965
+ Small variant results in text that is 1.25rem/1.2142rem (20px desktop, 17px mobile)
21966
+
21967
+ If you need a smaller text size, use the <Detail /> atom, which has smaller variants
21968
+
21969
+ Use the "as" prop to specify element type, can use any of: h1/h2/h3/h4/h5/h6/p
21970
+ If you need an inline text element (span), use the <Text /> atom
21971
+ The "as" value should be dictated by the structure of your page, not what font-size you want
21972
+
21973
+ Title / Detail both use slightly different desktop/mobile scales
21974
+ (Mobile scale is different to allow for design-friendly px values)
21975
+ Both atoms detect the presence of a mobile device on their own
21976
+ and apply the corresponding scale
21977
+
21978
+ Mobile breakpoint value is specified in Title.theme.js
21979
+
21980
+ If you want to disable mobile text scales (use the same rem scale for desktop/mobile), then use a theme in FCS to set both the "large" and "small" variants to use the same rem sizes. FCS themes override fallbacks defined in the .theme file
21981
+ */
21982
+
21983
+ var isBelowBreakpoint$1 = window.innerWidth < MOBILE_BREAKPOINT$1;
21984
+ var isTouchDevice$2 = "ontouchstart" in window || navigator.maxTouchPoints > 1;
21985
+ var mobileDeviceDetected$1 = isBelowBreakpoint$1 && isTouchDevice$2;
21986
+ var fallbacks$1 = mobileDeviceDetected$1 ? mobileFallbackValues$1 : fallbackValues$l;
21987
+
21988
+ var Title = function Title(_ref) {
21989
+ var themeValues = _ref.themeValues,
21990
+ _ref$weight = _ref.weight,
21991
+ weight = _ref$weight === void 0 ? FONT_WEIGHT_REGULAR : _ref$weight,
21992
+ _ref$color = _ref.color,
21993
+ color = _ref$color === void 0 ? FIREFLY_GREY : _ref$color,
21994
+ _ref$margin = _ref.margin,
21995
+ margin = _ref$margin === void 0 ? 0 : _ref$margin,
21996
+ textAlign = _ref.textAlign,
21997
+ _ref$extraStyles = _ref.extraStyles,
21998
+ extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
21999
+ className = _ref.className,
22000
+ _ref$variant = _ref.variant,
22001
+ variant = _ref$variant === void 0 ? "large" : _ref$variant,
22002
+ _ref$as = _ref.as,
22003
+ as = _ref$as === void 0 ? "h1" : _ref$as,
22004
+ dataQa = _ref.dataQa,
22005
+ children = _ref.children,
22006
+ rest = _objectWithoutProperties(_ref, ["themeValues", "weight", "color", "margin", "textAlign", "extraStyles", "className", "variant", "as", "dataQa", "children"]);
22007
+
22008
+ return /*#__PURE__*/React__default.createElement(TitleText, _extends({
22009
+ variant: variant,
22010
+ as: as,
22011
+ weight: weight,
22012
+ color: color,
22013
+ margin: margin,
22014
+ textAlign: textAlign,
22015
+ extraStyles: extraStyles,
22016
+ className: className,
22017
+ fontFamily: themeValues.fontFamily,
22018
+ fontSize: themeValues.fontSize,
22019
+ "data-qa": dataQa
22020
+ }, rest), safeChildren(children, /*#__PURE__*/React__default.createElement("span", null)));
22021
+ };
22022
+
22023
+ var Title$1 = themeComponent(Title, "Title", fallbacks$1, "large");
22024
+
21906
22025
  var Jumbo = function Jumbo(_ref) {
21907
22026
  var showButton = _ref.showButton,
21908
22027
  heading = _ref.heading,
@@ -21944,11 +22063,11 @@ var Jumbo = function Jumbo(_ref) {
21944
22063
  justify: isMobile && !showCartStatus ? "center" : showButton || showCartStatus ? "space-between" : "left",
21945
22064
  align: "center",
21946
22065
  nowrap: showCartStatus
21947
- }, /*#__PURE__*/React__default.createElement(Heading$1, {
21948
- variant: isMobile ? "h5" : "h3",
22066
+ }, /*#__PURE__*/React__default.createElement(Title$1, {
22067
+ variant: isMobile ? "small" : "large",
22068
+ as: "h1",
21949
22069
  color: "#ffffff",
21950
22070
  className: "themeJumboHeading",
21951
- themeJumboHeading: true,
21952
22071
  extraStyles: showCartStatus && isMobile && "max-width: 60%;"
21953
22072
  }, heading), subHeading && /*#__PURE__*/React__default.createElement(Heading$1, {
21954
22073
  variant: isMobile ? "h6" : "h2",
@@ -21975,7 +22094,7 @@ var fontWeight$4 = {
21975
22094
  pL: "600",
21976
22095
  h6: "700"
21977
22096
  };
21978
- var fallbackValues$l = {
22097
+ var fallbackValues$m = {
21979
22098
  fontWeight: fontWeight$4
21980
22099
  };
21981
22100
 
@@ -22003,7 +22122,7 @@ var LabeledAmount = function LabeledAmount(_ref) {
22003
22122
  }, amount));
22004
22123
  };
22005
22124
 
22006
- var LabeledAmount$1 = themeComponent(LabeledAmount, "LabeledAmount", fallbackValues$l, "default");
22125
+ var LabeledAmount$1 = themeComponent(LabeledAmount, "LabeledAmount", fallbackValues$m, "default");
22007
22126
 
22008
22127
  var weightTitle = {
22009
22128
  "default": "600",
@@ -22013,7 +22132,7 @@ var paragraphVariant = {
22013
22132
  "default": "pL",
22014
22133
  small: "pS"
22015
22134
  };
22016
- var fallbackValues$m = {
22135
+ var fallbackValues$n = {
22017
22136
  weightTitle: weightTitle,
22018
22137
  paragraphVariant: paragraphVariant
22019
22138
  };
@@ -22042,10 +22161,10 @@ var LineItem = function LineItem(_ref) {
22042
22161
  }, amount));
22043
22162
  };
22044
22163
 
22045
- var LineItem$1 = themeComponent(LineItem, "LineItem", fallbackValues$m, "default");
22164
+ var LineItem$1 = themeComponent(LineItem, "LineItem", fallbackValues$n, "default");
22046
22165
 
22047
22166
  var color$8 = "#15749D";
22048
- var fallbackValues$n = {
22167
+ var fallbackValues$o = {
22049
22168
  color: color$8
22050
22169
  };
22051
22170
 
@@ -22059,16 +22178,16 @@ function _templateObject2$g() {
22059
22178
  return data;
22060
22179
  }
22061
22180
 
22062
- function _templateObject$t() {
22181
+ function _templateObject$u() {
22063
22182
  var data = _taggedTemplateLiteral(["\n animation: rotate 2s linear infinite;\n margin: -25px 0 0 -25px;\n width: ", "px;\n height: ", "px;\n & .path {\n stroke: ", ";\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n }\n @keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n }\n @keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n }\n"]);
22064
22183
 
22065
- _templateObject$t = function _templateObject() {
22184
+ _templateObject$u = function _templateObject() {
22066
22185
  return data;
22067
22186
  };
22068
22187
 
22069
22188
  return data;
22070
22189
  }
22071
- var SpinnerSvgAnimation = styled__default.svg(_templateObject$t(), function (_ref) {
22190
+ var SpinnerSvgAnimation = styled__default.svg(_templateObject$u(), function (_ref) {
22072
22191
  var size = _ref.size;
22073
22192
  return size;
22074
22193
  }, function (_ref2) {
@@ -22097,7 +22216,7 @@ var Spinner$1 = function Spinner(_ref4) {
22097
22216
  })));
22098
22217
  };
22099
22218
 
22100
- var Spinner$2 = themeComponent(Spinner$1, "Spinner", fallbackValues$n);
22219
+ var Spinner$2 = themeComponent(Spinner$1, "Spinner", fallbackValues$o);
22101
22220
 
22102
22221
  var Loading = function Loading() {
22103
22222
  return /*#__PURE__*/React__default.createElement(Box, {
@@ -22345,10 +22464,10 @@ function _templateObject2$h() {
22345
22464
  return data;
22346
22465
  }
22347
22466
 
22348
- function _templateObject$u() {
22467
+ function _templateObject$v() {
22349
22468
  var data = _taggedTemplateLiteral(["", " is too short"]);
22350
22469
 
22351
- _templateObject$u = function _templateObject() {
22470
+ _templateObject$v = function _templateObject() {
22352
22471
  return data;
22353
22472
  };
22354
22473
 
@@ -22394,7 +22513,7 @@ with interpolation.
22394
22513
  */
22395
22514
 
22396
22515
 
22397
- var DEFAULT_ERROR_MESSAGES = (_DEFAULT_ERROR_MESSAG = {}, _defineProperty(_DEFAULT_ERROR_MESSAG, MIN_LENGTH_ERROR, genErrorMessage(_templateObject$u(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MAX_LENGTH_ERROR, genErrorMessage(_templateObject2$h(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EXACT_LENGTH_ERROR, genErrorMessage(_templateObject3$9(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MULTIPLE_LENGTHS_ERROR, genErrorMessage(_templateObject4$4(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EMAIL_ERROR, genErrorMessage(_templateObject5$3(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_NUMBER_ERROR, genErrorMessage(_templateObject6$3(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_UPPERCASE_LETTER_ERROR, genErrorMessage(_templateObject7$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_LOWERCASE_LETTER_ERROR, genErrorMessage(_templateObject8$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_SPECIAL_CHARACTER_ERROR, genErrorMessage(_templateObject9$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_NUMBERS_ERROR, genErrorMessage(_templateObject10$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_LETTERS_ERROR, genErrorMessage(_templateObject11$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, REQUIRED_FIELD_ERROR, genErrorMessage(_templateObject12(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_GREATER_THAN_ERROR, genErrorMessage(_templateObject13(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_LESS_THAN_ERROR, genErrorMessage(_templateObject14(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MATCHES_FIELD_ERROR, genErrorMessage(_templateObject15(), "fieldLabel", "matchField")), _defineProperty(_DEFAULT_ERROR_MESSAG, VALID_SELECT_OPTION_ERROR, genErrorMessage(_templateObject16(), "fieldLabel")), _DEFAULT_ERROR_MESSAG); // Constants to represent an input's state
22516
+ var DEFAULT_ERROR_MESSAGES = (_DEFAULT_ERROR_MESSAG = {}, _defineProperty(_DEFAULT_ERROR_MESSAG, MIN_LENGTH_ERROR, genErrorMessage(_templateObject$v(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MAX_LENGTH_ERROR, genErrorMessage(_templateObject2$h(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EXACT_LENGTH_ERROR, genErrorMessage(_templateObject3$9(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MULTIPLE_LENGTHS_ERROR, genErrorMessage(_templateObject4$4(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EMAIL_ERROR, genErrorMessage(_templateObject5$3(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_NUMBER_ERROR, genErrorMessage(_templateObject6$3(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_UPPERCASE_LETTER_ERROR, genErrorMessage(_templateObject7$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_LOWERCASE_LETTER_ERROR, genErrorMessage(_templateObject8$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_SPECIAL_CHARACTER_ERROR, genErrorMessage(_templateObject9$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_NUMBERS_ERROR, genErrorMessage(_templateObject10$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_LETTERS_ERROR, genErrorMessage(_templateObject11$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, REQUIRED_FIELD_ERROR, genErrorMessage(_templateObject12(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_GREATER_THAN_ERROR, genErrorMessage(_templateObject13(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_LESS_THAN_ERROR, genErrorMessage(_templateObject14(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MATCHES_FIELD_ERROR, genErrorMessage(_templateObject15(), "fieldLabel", "matchField")), _defineProperty(_DEFAULT_ERROR_MESSAG, VALID_SELECT_OPTION_ERROR, genErrorMessage(_templateObject16(), "fieldLabel")), _DEFAULT_ERROR_MESSAG); // Constants to represent an input's state
22398
22517
  // Neutral - has not been validated
22399
22518
  // Invalid - has been validated and has an error
22400
22519
  // Valid - has been validated and has no error
@@ -22519,7 +22638,7 @@ var height$1 = {
22519
22638
  "default": "3rem",
22520
22639
  large: "192px"
22521
22640
  };
22522
- var fallbackValues$o = {
22641
+ var fallbackValues$p = {
22523
22642
  color: color$9,
22524
22643
  height: height$1
22525
22644
  };
@@ -22612,12 +22731,12 @@ var Placeholder = function Placeholder(_ref2) {
22612
22731
  }, text)))))))))));
22613
22732
  };
22614
22733
 
22615
- var Placeholder$1 = themeComponent(Placeholder, "Placeholder", fallbackValues$o, "default");
22734
+ var Placeholder$1 = themeComponent(Placeholder, "Placeholder", fallbackValues$p, "default");
22616
22735
 
22617
22736
  var backgroundColor$4 = {
22618
22737
  "default": "".concat(WHITE)
22619
22738
  };
22620
- var fallbackValues$p = {
22739
+ var fallbackValues$q = {
22621
22740
  backgroundColor: backgroundColor$4
22622
22741
  };
22623
22742
 
@@ -22645,25 +22764,25 @@ var ProcessingFee = function ProcessingFee(_ref) {
22645
22764
  }));
22646
22765
  };
22647
22766
 
22648
- var ProcessingFee$1 = themeComponent(ProcessingFee, "ProcessingFee", fallbackValues$p, "default");
22767
+ var ProcessingFee$1 = themeComponent(ProcessingFee, "ProcessingFee", fallbackValues$q, "default");
22649
22768
 
22650
22769
  var activeColor$4 = "".concat(MATISSE_BLUE);
22651
22770
  var inactiveColor = "".concat(GREY_CHATEAU);
22652
- var fallbackValues$q = {
22771
+ var fallbackValues$r = {
22653
22772
  activeColor: activeColor$4,
22654
22773
  inactiveColor: inactiveColor
22655
22774
  };
22656
22775
 
22657
- function _templateObject$v() {
22776
+ function _templateObject$w() {
22658
22777
  var data = _taggedTemplateLiteral(["\n opacity: 0;\n position: absolute;\n cursor: ", ";\n"]);
22659
22778
 
22660
- _templateObject$v = function _templateObject() {
22779
+ _templateObject$w = function _templateObject() {
22661
22780
  return data;
22662
22781
  };
22663
22782
 
22664
22783
  return data;
22665
22784
  }
22666
- var HiddenRadioButton = styled__default.input(_templateObject$v(), function (_ref) {
22785
+ var HiddenRadioButton = styled__default.input(_templateObject$w(), function (_ref) {
22667
22786
  var disabled = _ref.disabled;
22668
22787
  return disabled ? "auto" : "pointer";
22669
22788
  });
@@ -22745,12 +22864,12 @@ var RadioButton$1 = function RadioButton(_ref2) {
22745
22864
  })));
22746
22865
  };
22747
22866
 
22748
- var RadioButton$2 = themeComponent(RadioButton$1, "RadioButton", fallbackValues$q);
22867
+ var RadioButton$2 = themeComponent(RadioButton$1, "RadioButton", fallbackValues$r);
22749
22868
 
22750
22869
  var border$2 = {
22751
22870
  "default": "1px solid #caced8"
22752
22871
  };
22753
- var fallbackValues$r = {
22872
+ var fallbackValues$s = {
22754
22873
  border: border$2
22755
22874
  };
22756
22875
 
@@ -22825,7 +22944,7 @@ var SearchableSelect = function SearchableSelect(_ref) {
22825
22944
  })))));
22826
22945
  };
22827
22946
 
22828
- var SearchableSelect$1 = themeComponent(SearchableSelect, "SearchableSelect", fallbackValues$r, "default");
22947
+ var SearchableSelect$1 = themeComponent(SearchableSelect, "SearchableSelect", fallbackValues$s, "default");
22829
22948
 
22830
22949
  var borderColor$2 = {
22831
22950
  "default": "".concat(GREY_CHATEAU)
@@ -22833,7 +22952,7 @@ var borderColor$2 = {
22833
22952
  var borderSize = {
22834
22953
  "default": "1px"
22835
22954
  };
22836
- var fallbackValues$s = {
22955
+ var fallbackValues$t = {
22837
22956
  borderColor: borderColor$2,
22838
22957
  borderSize: borderSize
22839
22958
  };
@@ -22850,7 +22969,7 @@ var SolidDivider = function SolidDivider(_ref) {
22850
22969
  });
22851
22970
  };
22852
22971
 
22853
- var SolidDivider$1 = themeComponent(SolidDivider, "SolidDivider", fallbackValues$s, "default");
22972
+ var SolidDivider$1 = themeComponent(SolidDivider, "SolidDivider", fallbackValues$t, "default");
22854
22973
 
22855
22974
  var placeHolderOptionUS = {
22856
22975
  text: "Please select state",
@@ -33425,125 +33544,6 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
33425
33544
  });
33426
33545
  };
33427
33546
 
33428
- function _templateObject$w() {
33429
- var data = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: 1.5;\n color: ", ";\n font-weight: ", ";\n margin: ", ";\n text-align: ", ";\n font-family: ", ";\n\n ", ";\n"]);
33430
-
33431
- _templateObject$w = function _templateObject() {
33432
- return data;
33433
- };
33434
-
33435
- return data;
33436
- }
33437
- var TitleText = styled__default.h1(_templateObject$w(), function (_ref) {
33438
- var fontSize = _ref.fontSize;
33439
- return fontSize;
33440
- }, function (_ref2) {
33441
- var color = _ref2.color;
33442
- return color;
33443
- }, function (_ref3) {
33444
- var weight = _ref3.weight;
33445
- return weight;
33446
- }, function (_ref4) {
33447
- var margin = _ref4.margin;
33448
- return margin;
33449
- }, function (_ref5) {
33450
- var textAlign = _ref5.textAlign;
33451
- return textAlign;
33452
- }, function (_ref6) {
33453
- var fontFamily = _ref6.fontFamily;
33454
- return fontFamily;
33455
- }, function (_ref7) {
33456
- var extraStyles = _ref7.extraStyles;
33457
- return extraStyles;
33458
- });
33459
-
33460
- var fontSize$9 = {
33461
- large: "1.5rem",
33462
- small: "1.25rem"
33463
- };
33464
- var fontFamily$5 = {
33465
- large: "Public Sans",
33466
- small: "Public Sans"
33467
- };
33468
- var mobileFontSize$1 = {
33469
- large: "1.5rem",
33470
- small: "1.2142rem"
33471
- };
33472
- var fallbackValues$t = {
33473
- fontFamily: fontFamily$5,
33474
- fontSize: fontSize$9
33475
- };
33476
- var mobileFallbackValues$1 = {
33477
- fontFamily: fontFamily$5,
33478
- fontSize: mobileFontSize$1
33479
- };
33480
- var MOBILE_BREAKPOINT$1 = 768;
33481
-
33482
- /*
33483
- New responsive text component for Title elements
33484
- Size is decoupled from tag
33485
- Comes with two variants - "large" and "small"
33486
- Large variant results in text that is 1.5rem (24px desktop, 21px mobile)
33487
- Small variant results in text that is 1.25rem/1.2142rem (20px desktop, 17px mobile)
33488
-
33489
- If you need a smaller text size, use the <Detail /> atom, which has smaller variants
33490
-
33491
- Use the "as" prop to specify element type, can use any of: h1/h2/h3/h4/h5/h6/p
33492
- If you need an inline text element (span), use the <Text /> atom
33493
- The "as" value should be dictated by the structure of your page, not what font-size you want
33494
-
33495
- Title / Detail both use slightly different desktop/mobile scales
33496
- (Mobile scale is different to allow for design-friendly px values)
33497
- Both atoms detect the presence of a mobile device on their own
33498
- and apply the corresponding scale
33499
-
33500
- Mobile breakpoint value is specified in Title.theme.js
33501
-
33502
- If you want to disable mobile text scales (use the same rem scale for desktop/mobile), then use a theme in FCS to set both the "large" and "small" variants to use the same rem sizes. FCS themes override fallbacks defined in the .theme file
33503
- */
33504
-
33505
- var isBelowBreakpoint$1 = window.innerWidth < MOBILE_BREAKPOINT$1;
33506
- var isTouchDevice$2 = "ontouchstart" in window || navigator.maxTouchPoints > 1;
33507
- var mobileDeviceDetected$1 = isBelowBreakpoint$1 && isTouchDevice$2;
33508
- var fallbacks$1 = mobileDeviceDetected$1 ? mobileFallbackValues$1 : fallbackValues$t;
33509
-
33510
- var Title = function Title(_ref) {
33511
- var themeValues = _ref.themeValues,
33512
- _ref$weight = _ref.weight,
33513
- weight = _ref$weight === void 0 ? FONT_WEIGHT_REGULAR : _ref$weight,
33514
- _ref$color = _ref.color,
33515
- color = _ref$color === void 0 ? FIREFLY_GREY : _ref$color,
33516
- _ref$margin = _ref.margin,
33517
- margin = _ref$margin === void 0 ? 0 : _ref$margin,
33518
- textAlign = _ref.textAlign,
33519
- _ref$extraStyles = _ref.extraStyles,
33520
- extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
33521
- className = _ref.className,
33522
- _ref$variant = _ref.variant,
33523
- variant = _ref$variant === void 0 ? "large" : _ref$variant,
33524
- _ref$as = _ref.as,
33525
- as = _ref$as === void 0 ? "h1" : _ref$as,
33526
- dataQa = _ref.dataQa,
33527
- children = _ref.children,
33528
- rest = _objectWithoutProperties(_ref, ["themeValues", "weight", "color", "margin", "textAlign", "extraStyles", "className", "variant", "as", "dataQa", "children"]);
33529
-
33530
- return /*#__PURE__*/React__default.createElement(TitleText, _extends({
33531
- variant: variant,
33532
- as: as,
33533
- weight: weight,
33534
- color: color,
33535
- margin: margin,
33536
- textAlign: textAlign,
33537
- extraStyles: extraStyles,
33538
- className: className,
33539
- fontFamily: themeValues.fontFamily,
33540
- fontSize: themeValues.fontSize,
33541
- "data-qa": dataQa
33542
- }, rest), safeChildren(children, /*#__PURE__*/React__default.createElement("span", null)));
33543
- };
33544
-
33545
- var Title$1 = themeComponent(Title, "Title", fallbacks$1, "large");
33546
-
33547
33547
  var onBackground = "".concat(MATISSE_BLUE);
33548
33548
  var disabledBackground = "".concat(IRON_GREY);
33549
33549
  var white = "".concat(WHITE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -4,6 +4,7 @@ import { ThemeContext } from "styled-components";
4
4
  import ButtonWithLink from "../button-with-link";
5
5
  import { Box, Cluster, Center, Cover, Switcher } from "../layouts";
6
6
  import Heading from "../heading";
7
+ import Title from "../title";
7
8
  import withWindowSize from "../../withWindowSize";
8
9
 
9
10
  const Jumbo = ({
@@ -49,16 +50,15 @@ const Jumbo = ({
49
50
  align="center"
50
51
  nowrap={showCartStatus}
51
52
  >
52
- <Heading
53
- variant={isMobile ? "h5" : "h3"}
53
+ <Title
54
+ variant={isMobile ? "small" : "large"}
55
+ as="h1"
54
56
  color="#ffffff"
55
57
  className="themeJumboHeading"
56
- themeJumboHeading
57
58
  extraStyles={showCartStatus && isMobile && `max-width: 60%;`}
58
59
  >
59
60
  {heading}
60
- </Heading>
61
-
61
+ </Title>
62
62
  {subHeading && (
63
63
  <Heading
64
64
  variant={isMobile ? "h6" : "h2"}