@thecb/components 7.12.2-beta.5 → 7.12.2-beta.7
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 +68 -57
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +68 -57
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +6 -2
- package/src/components/molecules/payment-details/PaymentDetails.js +10 -2
- package/src/util/generateShadows.js +1 -1
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,7 +17840,11 @@ 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;
|
|
17788
17848
|
var Icon = AlertIcons[variant];
|
|
17789
17849
|
var content = /*#__PURE__*/React__default.createElement(Sidebar, {
|
|
17790
17850
|
width: "24px",
|
|
@@ -17836,7 +17896,8 @@ var Alert = function Alert(_ref) {
|
|
|
17836
17896
|
background: themeValues.background,
|
|
17837
17897
|
borderRadius: "4px",
|
|
17838
17898
|
borderColor: themeValues.border,
|
|
17839
|
-
borderSize: "1px",
|
|
17899
|
+
borderSize: noBorder ? "0px" : "1px",
|
|
17900
|
+
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
17901
|
extraStyles: extraStyles
|
|
17841
17902
|
}, maxContentWidth ? /*#__PURE__*/React__default.createElement(Center, {
|
|
17842
17903
|
maxWidth: maxContentWidth
|
|
@@ -47004,7 +47065,7 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47004
47065
|
var LoadingDetails = function LoadingDetails() {
|
|
47005
47066
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
47006
47067
|
padding: "0",
|
|
47007
|
-
background:
|
|
47068
|
+
background: GRECIAN_GREY,
|
|
47008
47069
|
borderRadius: "4px",
|
|
47009
47070
|
minHeight: "196px"
|
|
47010
47071
|
}, /*#__PURE__*/React__default.createElement(Cover, {
|
|
@@ -47029,7 +47090,10 @@ var ErrorDetails = function ErrorDetails() {
|
|
|
47029
47090
|
variant: "error",
|
|
47030
47091
|
heading: "Error Loading Payment",
|
|
47031
47092
|
text: "Please go back and try again.",
|
|
47032
|
-
showQuitLink: false
|
|
47093
|
+
showQuitLink: false,
|
|
47094
|
+
noBorder: true,
|
|
47095
|
+
enableBoxShadow: true,
|
|
47096
|
+
extraStyles: "min-height: 67px; height: 67px;"
|
|
47033
47097
|
}));
|
|
47034
47098
|
};
|
|
47035
47099
|
|
|
@@ -47443,59 +47507,6 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
|
47443
47507
|
})))));
|
|
47444
47508
|
};
|
|
47445
47509
|
|
|
47446
|
-
/*
|
|
47447
|
-
|
|
47448
|
-
A utility function that can generate box-shadow values for components
|
|
47449
|
-
Takes a string representing an rgb color value and returns an object
|
|
47450
|
-
with values for standard, inset, and overlay shadows.
|
|
47451
|
-
|
|
47452
|
-
The objects for standard and inset shadows contain versions approiate
|
|
47453
|
-
for base, hover, and active interaction states.
|
|
47454
|
-
|
|
47455
|
-
*/
|
|
47456
|
-
|
|
47457
|
-
/*
|
|
47458
|
-
Function to convert string representing rgb color to rgba value with provided opacity
|
|
47459
|
-
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
47460
|
-
|
|
47461
|
-
*/
|
|
47462
|
-
var rgbToRgba = function rgbToRgba() {
|
|
47463
|
-
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
47464
|
-
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
47465
|
-
|
|
47466
|
-
if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
|
|
47467
|
-
return "";
|
|
47468
|
-
}
|
|
47469
|
-
|
|
47470
|
-
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
47471
|
-
};
|
|
47472
|
-
|
|
47473
|
-
var generateShadows = function generateShadows(baseColorRGB) {
|
|
47474
|
-
var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
47475
|
-
var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
47476
|
-
var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
|
|
47477
|
-
var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
|
|
47478
|
-
var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
|
|
47479
|
-
var standard = {
|
|
47480
|
-
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
47481
|
-
hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
|
|
47482
|
-
active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
|
|
47483
|
-
};
|
|
47484
|
-
var inset = {
|
|
47485
|
-
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
47486
|
-
hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
|
|
47487
|
-
active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
|
|
47488
|
-
};
|
|
47489
|
-
var overlay = {
|
|
47490
|
-
base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
|
|
47491
|
-
};
|
|
47492
|
-
return {
|
|
47493
|
-
standard: standard,
|
|
47494
|
-
inset: inset,
|
|
47495
|
-
overlay: overlay
|
|
47496
|
-
};
|
|
47497
|
-
};
|
|
47498
|
-
|
|
47499
47510
|
/*
|
|
47500
47511
|
Hook that takes an ID selector for an element on the screen
|
|
47501
47512
|
And optionally values for top position, left position, smooth behavior
|