@thecb/components 7.12.2-beta.1 → 7.12.2-beta.10

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
@@ -17770,7 +17770,63 @@ var fallbackValues$4 = {
17770
17770
  link: link
17771
17771
  };
17772
17772
 
17773
+ /*
17774
+
17775
+ A utility function that can generate box-shadow values for components
17776
+ Takes a string representing an rgb color value and returns an object
17777
+ with values for standard, inset, and overlay shadows.
17778
+
17779
+ The objects for standard and inset shadows contain versions approiate
17780
+ for base, hover, and active interaction states.
17781
+
17782
+ */
17783
+
17784
+ /*
17785
+ Function to convert string representing rgb color to rgba value with provided opacity
17786
+ ("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
17787
+
17788
+ */
17789
+ var rgbToRgba = function rgbToRgba() {
17790
+ var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
17791
+ var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
17792
+
17793
+ if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
17794
+ return "";
17795
+ }
17796
+
17797
+ return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
17798
+ };
17799
+
17800
+ var generateShadows = function generateShadows() {
17801
+ var baseColorRGB = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(41, 42, 51)";
17802
+ var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
17803
+ var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
17804
+ var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
17805
+ var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
17806
+ var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
17807
+ var standard = {
17808
+ base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
17809
+ hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
17810
+ active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
17811
+ };
17812
+ var inset = {
17813
+ base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
17814
+ hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
17815
+ active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
17816
+ };
17817
+ var overlay = {
17818
+ base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
17819
+ };
17820
+ return {
17821
+ standard: standard,
17822
+ inset: inset,
17823
+ overlay: overlay
17824
+ };
17825
+ };
17826
+
17773
17827
  var Alert = function Alert(_ref) {
17828
+ var _generateShadows, _generateShadows$inse;
17829
+
17774
17830
  var heading = _ref.heading,
17775
17831
  text = _ref.text,
17776
17832
  textOverride = _ref.textOverride,
@@ -17784,13 +17840,24 @@ var Alert = function Alert(_ref) {
17784
17840
  showQuitLink = _ref$showQuitLink === void 0 ? true : _ref$showQuitLink,
17785
17841
  themeValues = _ref.themeValues,
17786
17842
  extraStyles = _ref.extraStyles,
17787
- maxContentWidth = _ref.maxContentWidth;
17843
+ maxContentWidth = _ref.maxContentWidth,
17844
+ _ref$noBorder = _ref.noBorder,
17845
+ noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
17846
+ _ref$enableBoxShadow = _ref.enableBoxShadow,
17847
+ enableBoxShadow = _ref$enableBoxShadow === void 0 ? false : _ref$enableBoxShadow,
17848
+ _ref$enableSmallText = _ref.enableSmallText,
17849
+ enableSmallText = _ref$enableSmallText === void 0 ? false : _ref$enableSmallText,
17850
+ _ref$innerContentPadd = _ref.innerContentPadding,
17851
+ innerContentPadding = _ref$innerContentPadd === void 0 ? "1rem" : _ref$innerContentPadd,
17852
+ _ref$iconPadding = _ref.iconPadding,
17853
+ iconPadding = _ref$iconPadding === void 0 ? "0 0 0 1rem" : _ref$iconPadding;
17788
17854
  var Icon = AlertIcons[variant];
17855
+ var contentPadding = maxContentWidth ? "".concat(padding, " 1rem") : innerContentPadding;
17789
17856
  var content = /*#__PURE__*/React__default.createElement(Sidebar, {
17790
17857
  width: "24px",
17791
17858
  childGap: "0rem"
17792
17859
  }, /*#__PURE__*/React__default.createElement(Box, {
17793
- padding: "0 0 0 1rem",
17860
+ padding: iconPadding,
17794
17861
  minHeight: "100%"
17795
17862
  }, /*#__PURE__*/React__default.createElement(Cover, {
17796
17863
  minHeight: "100%",
@@ -17806,7 +17873,7 @@ var Alert = function Alert(_ref) {
17806
17873
  width: "24px",
17807
17874
  childGap: "0rem"
17808
17875
  }, /*#__PURE__*/React__default.createElement(Box, {
17809
- padding: maxContentWidth ? "".concat(padding, " 1rem") : "1rem"
17876
+ padding: contentPadding
17810
17877
  }, /*#__PURE__*/React__default.createElement(Cluster, {
17811
17878
  justify: "flex-start",
17812
17879
  align: "center"
@@ -17814,7 +17881,7 @@ var Alert = function Alert(_ref) {
17814
17881
  fullHeight: true,
17815
17882
  childGap: "0.25rem"
17816
17883
  }, /*#__PURE__*/React__default.createElement(Text$1, {
17817
- variant: "p",
17884
+ variant: enableSmallText ? "pS" : "p",
17818
17885
  color: themeValues.text,
17819
17886
  weight: "600"
17820
17887
  }, heading), /*#__PURE__*/React__default.createElement(Text$1, {
@@ -17836,7 +17903,8 @@ var Alert = function Alert(_ref) {
17836
17903
  background: themeValues.background,
17837
17904
  borderRadius: "4px",
17838
17905
  borderColor: themeValues.border,
17839
- borderSize: "1px",
17906
+ borderSize: noBorder ? "0px" : "1px",
17907
+ boxShadow: enableBoxShadow ? (_generateShadows = generateShadows()) === null || _generateShadows === void 0 ? void 0 : (_generateShadows$inse = _generateShadows.inset) === null || _generateShadows$inse === void 0 ? void 0 : _generateShadows$inse.base : "",
17840
17908
  extraStyles: extraStyles
17841
17909
  }, maxContentWidth ? /*#__PURE__*/React__default.createElement(Center, {
17842
17910
  maxWidth: maxContentWidth
@@ -25581,7 +25649,7 @@ var fallbackValues$q = {
25581
25649
  var SpinnerSvgAnimation = styled__default.svg.withConfig({
25582
25650
  displayName: "Spinner__SpinnerSvgAnimation",
25583
25651
  componentId: "sc-vhupl9-0"
25584
- })(["animation:rotate 2s linear infinite;margin:-25px 0 0 -25px;width:", "px;height:", "px;& .path{stroke:", ";stroke-linecap:round;animation:dash 1.5s ease-in-out infinite;}@keyframes rotate{100%{transform:rotate(360deg);}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;}}"], function (_ref) {
25652
+ })(["animation:rotate 2s linear infinite;margin:-25px 0 0 -25px;width:", "px;height:", "px;& .path{stroke:", ";stroke-linecap:round;animation:dash 1.5s ease-in-out infinite;}@keyframes rotate{100%{transform:rotate(360deg);}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;}}", ""], function (_ref) {
25585
25653
  var size = _ref.size;
25586
25654
  return size;
25587
25655
  }, function (_ref2) {
@@ -25590,19 +25658,36 @@ var SpinnerSvgAnimation = styled__default.svg.withConfig({
25590
25658
  }, function (_ref3) {
25591
25659
  var color = _ref3.color;
25592
25660
  return color;
25661
+ }, function (_ref4) {
25662
+ var centerSpinner = _ref4.centerSpinner;
25663
+ return centerSpinner ? styled.css(["margin:0;"]) : "";
25593
25664
  });
25594
25665
  var SpinnerContainer$2 = styled__default.div.withConfig({
25595
25666
  displayName: "Spinner__SpinnerContainer",
25596
25667
  componentId: "sc-vhupl9-1"
25597
- })(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;line-height:1;"]);
25668
+ })(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;line-height:1;", ""], function (_ref5) {
25669
+ var centerSpinner = _ref5.centerSpinner,
25670
+ size = _ref5.size;
25671
+ return centerSpinner ? styled.css(["width:", "px;height:", "px;"], size, size) : "";
25672
+ });
25673
+ /*
25674
+ `centerSpinner` prop alters existing styling of spinner to allow it to properly center itself within
25675
+ containers. Default is false to preserve legacy behavior for past uses.
25676
+ */
25598
25677
 
25599
- var Spinner$1 = function Spinner(_ref4) {
25600
- var _ref4$size = _ref4.size,
25601
- size = _ref4$size === void 0 ? "24" : _ref4$size,
25602
- themeValues = _ref4.themeValues;
25603
- return /*#__PURE__*/React__default.createElement(SpinnerContainer$2, null, /*#__PURE__*/React__default.createElement(SpinnerSvgAnimation, {
25678
+ var Spinner$1 = function Spinner(_ref6) {
25679
+ var _ref6$size = _ref6.size,
25680
+ size = _ref6$size === void 0 ? "24" : _ref6$size,
25681
+ _ref6$centerSpinner = _ref6.centerSpinner,
25682
+ centerSpinner = _ref6$centerSpinner === void 0 ? false : _ref6$centerSpinner,
25683
+ themeValues = _ref6.themeValues;
25684
+ return /*#__PURE__*/React__default.createElement(SpinnerContainer$2, {
25685
+ centerSpinner: centerSpinner,
25686
+ size: size
25687
+ }, /*#__PURE__*/React__default.createElement(SpinnerSvgAnimation, {
25604
25688
  size: size,
25605
- color: themeValues.color
25689
+ color: themeValues.color,
25690
+ centerSpinner: centerSpinner
25606
25691
  }, /*#__PURE__*/React__default.createElement("circle", {
25607
25692
  className: "path",
25608
25693
  cx: "50",
@@ -46956,7 +47041,7 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
46956
47041
  },
46957
47042
  text: "Void",
46958
47043
  padding: "0",
46959
- extraStyles: "\n min-width: 65px; \n margin: 0px;\n min-height: 0px;\n ",
47044
+ extraStyles: "\n min-width: 65px;\n margin: 0px;\n min-height: 0px;\n ",
46960
47045
  textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;")
46961
47046
  })), /*#__PURE__*/React__default.createElement(Box, {
46962
47047
  padding: "0",
@@ -46987,15 +47072,21 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
46987
47072
  var LoadingDetails = function LoadingDetails() {
46988
47073
  return /*#__PURE__*/React__default.createElement(Box, {
46989
47074
  padding: "0",
46990
- background: GHOST_GREY,
46991
- borderRadius: "4px"
47075
+ background: GRECIAN_GREY,
47076
+ borderRadius: "4px",
47077
+ minHeight: "196px"
46992
47078
  }, /*#__PURE__*/React__default.createElement(Cover, {
46993
- minHeight: "100%",
46994
- singleChild: true
47079
+ minHeight: "196px",
47080
+ singleChild: true,
47081
+ fillCenter: true
46995
47082
  }, /*#__PURE__*/React__default.createElement(Center, {
46996
47083
  intrinsic: true
46997
- }, /*#__PURE__*/React__default.createElement(Box, null, /*#__PURE__*/React__default.createElement(Spinner$2, {
46998
- size: "100"
47084
+ }, /*#__PURE__*/React__default.createElement(Box, {
47085
+ padding: "0",
47086
+ extraStyles: "flex-grow: 1; display: flex; justify-content: center; align-items: center;"
47087
+ }, /*#__PURE__*/React__default.createElement(Spinner$2, {
47088
+ size: "100",
47089
+ centerSpinner: true
46999
47090
  })))));
47000
47091
  };
47001
47092
 
@@ -47006,7 +47097,13 @@ var ErrorDetails = function ErrorDetails() {
47006
47097
  variant: "error",
47007
47098
  heading: "Error Loading Payment",
47008
47099
  text: "Please go back and try again.",
47009
- showQuitLink: false
47100
+ showQuitLink: false,
47101
+ noBorder: true,
47102
+ enableBoxShadow: true,
47103
+ enableSmallText: true,
47104
+ innerContentPadding: "0 1rem",
47105
+ extraStyles: "min-height: 67px; height: 67px;",
47106
+ iconPadding: "0 0 0 0.75rem"
47010
47107
  }));
47011
47108
  };
47012
47109
 
@@ -47420,59 +47517,6 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47420
47517
  })))));
47421
47518
  };
47422
47519
 
47423
- /*
47424
-
47425
- A utility function that can generate box-shadow values for components
47426
- Takes a string representing an rgb color value and returns an object
47427
- with values for standard, inset, and overlay shadows.
47428
-
47429
- The objects for standard and inset shadows contain versions approiate
47430
- for base, hover, and active interaction states.
47431
-
47432
- */
47433
-
47434
- /*
47435
- Function to convert string representing rgb color to rgba value with provided opacity
47436
- ("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
47437
-
47438
- */
47439
- var rgbToRgba = function rgbToRgba() {
47440
- var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
47441
- var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
47442
-
47443
- if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
47444
- return "";
47445
- }
47446
-
47447
- return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
47448
- };
47449
-
47450
- var generateShadows = function generateShadows(baseColorRGB) {
47451
- var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
47452
- var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
47453
- var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
47454
- var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
47455
- var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
47456
- var standard = {
47457
- base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
47458
- hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
47459
- active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
47460
- };
47461
- var inset = {
47462
- base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
47463
- hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
47464
- active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
47465
- };
47466
- var overlay = {
47467
- base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
47468
- };
47469
- return {
47470
- standard: standard,
47471
- inset: inset,
47472
- overlay: overlay
47473
- };
47474
- };
47475
-
47476
47520
  /*
47477
47521
  Hook that takes an ID selector for an element on the screen
47478
47522
  And optionally values for top position, left position, smooth behavior