@thecb/components 7.13.2-beta.0 → 7.13.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 +180 -76
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +180 -76
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +27 -7
- package/src/components/atoms/spinner/Spinner.js +26 -4
- package/src/components/molecules/payment-details/PaymentDetails.js +88 -10
- package/src/util/generateShadows.js +1 -1
- package/src/components/atoms/icons/GenericErrorIcon.js +0 -131
package/dist/index.cjs.js
CHANGED
|
@@ -18471,7 +18471,63 @@ var fallbackValues$4 = {
|
|
|
18471
18471
|
link: link
|
|
18472
18472
|
};
|
|
18473
18473
|
|
|
18474
|
+
/*
|
|
18475
|
+
|
|
18476
|
+
A utility function that can generate box-shadow values for components
|
|
18477
|
+
Takes a string representing an rgb color value and returns an object
|
|
18478
|
+
with values for standard, inset, and overlay shadows.
|
|
18479
|
+
|
|
18480
|
+
The objects for standard and inset shadows contain versions approiate
|
|
18481
|
+
for base, hover, and active interaction states.
|
|
18482
|
+
|
|
18483
|
+
*/
|
|
18484
|
+
|
|
18485
|
+
/*
|
|
18486
|
+
Function to convert string representing rgb color to rgba value with provided opacity
|
|
18487
|
+
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
18488
|
+
|
|
18489
|
+
*/
|
|
18490
|
+
var rgbToRgba = function rgbToRgba() {
|
|
18491
|
+
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
18492
|
+
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
18493
|
+
|
|
18494
|
+
if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
|
|
18495
|
+
return "";
|
|
18496
|
+
}
|
|
18497
|
+
|
|
18498
|
+
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
18499
|
+
};
|
|
18500
|
+
|
|
18501
|
+
var generateShadows = function generateShadows() {
|
|
18502
|
+
var baseColorRGB = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(41, 42, 51)";
|
|
18503
|
+
var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
18504
|
+
var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
18505
|
+
var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
|
|
18506
|
+
var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
|
|
18507
|
+
var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
|
|
18508
|
+
var standard = {
|
|
18509
|
+
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
18510
|
+
hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
|
|
18511
|
+
active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
|
|
18512
|
+
};
|
|
18513
|
+
var inset = {
|
|
18514
|
+
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
18515
|
+
hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
|
|
18516
|
+
active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
|
|
18517
|
+
};
|
|
18518
|
+
var overlay = {
|
|
18519
|
+
base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
|
|
18520
|
+
};
|
|
18521
|
+
return {
|
|
18522
|
+
standard: standard,
|
|
18523
|
+
inset: inset,
|
|
18524
|
+
overlay: overlay
|
|
18525
|
+
};
|
|
18526
|
+
};
|
|
18527
|
+
|
|
18474
18528
|
var Alert = function Alert(_ref) {
|
|
18529
|
+
var _generateShadows, _generateShadows$inse;
|
|
18530
|
+
|
|
18475
18531
|
var heading = _ref.heading,
|
|
18476
18532
|
text = _ref.text,
|
|
18477
18533
|
textOverride = _ref.textOverride,
|
|
@@ -18485,13 +18541,26 @@ var Alert = function Alert(_ref) {
|
|
|
18485
18541
|
showQuitLink = _ref$showQuitLink === void 0 ? true : _ref$showQuitLink,
|
|
18486
18542
|
themeValues = _ref.themeValues,
|
|
18487
18543
|
extraStyles = _ref.extraStyles,
|
|
18488
|
-
maxContentWidth = _ref.maxContentWidth
|
|
18544
|
+
maxContentWidth = _ref.maxContentWidth,
|
|
18545
|
+
_ref$noBorder = _ref.noBorder,
|
|
18546
|
+
noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
|
|
18547
|
+
_ref$enableBoxShadow = _ref.enableBoxShadow,
|
|
18548
|
+
enableBoxShadow = _ref$enableBoxShadow === void 0 ? false : _ref$enableBoxShadow,
|
|
18549
|
+
_ref$enableSmallText = _ref.enableSmallText,
|
|
18550
|
+
enableSmallText = _ref$enableSmallText === void 0 ? false : _ref$enableSmallText,
|
|
18551
|
+
_ref$innerContentPadd = _ref.innerContentPadding,
|
|
18552
|
+
innerContentPadding = _ref$innerContentPadd === void 0 ? "1rem" : _ref$innerContentPadd,
|
|
18553
|
+
_ref$iconPadding = _ref.iconPadding,
|
|
18554
|
+
iconPadding = _ref$iconPadding === void 0 ? "0 0 0 1rem" : _ref$iconPadding,
|
|
18555
|
+
_ref$contentFullHeigh = _ref.contentFullHeight,
|
|
18556
|
+
contentFullHeight = _ref$contentFullHeigh === void 0 ? false : _ref$contentFullHeigh;
|
|
18489
18557
|
var Icon = AlertIcons[variant];
|
|
18558
|
+
var contentPadding = maxContentWidth ? "".concat(padding, " 1rem") : innerContentPadding;
|
|
18490
18559
|
var content = /*#__PURE__*/React__default.createElement(Sidebar, {
|
|
18491
18560
|
width: "24px",
|
|
18492
18561
|
childGap: "0rem"
|
|
18493
18562
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
18494
|
-
padding:
|
|
18563
|
+
padding: iconPadding,
|
|
18495
18564
|
minHeight: "100%"
|
|
18496
18565
|
}, /*#__PURE__*/React__default.createElement(Cover, {
|
|
18497
18566
|
minHeight: "100%",
|
|
@@ -18505,17 +18574,18 @@ var Alert = function Alert(_ref) {
|
|
|
18505
18574
|
}, /*#__PURE__*/React__default.createElement(Sidebar, {
|
|
18506
18575
|
sidebarOnRight: true,
|
|
18507
18576
|
width: "24px",
|
|
18508
|
-
childGap: "0rem"
|
|
18577
|
+
childGap: "0rem",
|
|
18578
|
+
fullHeight: contentFullHeight
|
|
18509
18579
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
18510
|
-
padding:
|
|
18580
|
+
padding: contentPadding
|
|
18511
18581
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
18512
18582
|
justify: "flex-start",
|
|
18513
18583
|
align: "center"
|
|
18514
18584
|
}, textOverride ? textOverride : /*#__PURE__*/React__default.createElement(Stack, {
|
|
18515
18585
|
fullHeight: true,
|
|
18516
|
-
childGap: "0
|
|
18586
|
+
childGap: "0"
|
|
18517
18587
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
18518
|
-
variant: "p",
|
|
18588
|
+
variant: enableSmallText ? "pS" : "p",
|
|
18519
18589
|
color: themeValues.text,
|
|
18520
18590
|
weight: "600"
|
|
18521
18591
|
}, heading), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
@@ -18537,7 +18607,8 @@ var Alert = function Alert(_ref) {
|
|
|
18537
18607
|
background: themeValues.background,
|
|
18538
18608
|
borderRadius: "4px",
|
|
18539
18609
|
borderColor: themeValues.border,
|
|
18540
|
-
borderSize: "1px",
|
|
18610
|
+
borderSize: noBorder ? "0px" : "1px",
|
|
18611
|
+
boxShadow: enableBoxShadow ? (_generateShadows = generateShadows()) === null || _generateShadows === void 0 ? void 0 : (_generateShadows$inse = _generateShadows.inset) === null || _generateShadows$inse === void 0 ? void 0 : _generateShadows$inse.base : "",
|
|
18541
18612
|
extraStyles: extraStyles
|
|
18542
18613
|
}, maxContentWidth ? /*#__PURE__*/React__default.createElement(Center, {
|
|
18543
18614
|
maxWidth: maxContentWidth
|
|
@@ -26282,7 +26353,7 @@ var fallbackValues$q = {
|
|
|
26282
26353
|
var SpinnerSvgAnimation = styled__default.svg.withConfig({
|
|
26283
26354
|
displayName: "Spinner__SpinnerSvgAnimation",
|
|
26284
26355
|
componentId: "sc-vhupl9-0"
|
|
26285
|
-
})(["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) {
|
|
26356
|
+
})(["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) {
|
|
26286
26357
|
var size = _ref.size;
|
|
26287
26358
|
return size;
|
|
26288
26359
|
}, function (_ref2) {
|
|
@@ -26291,19 +26362,36 @@ var SpinnerSvgAnimation = styled__default.svg.withConfig({
|
|
|
26291
26362
|
}, function (_ref3) {
|
|
26292
26363
|
var color = _ref3.color;
|
|
26293
26364
|
return color;
|
|
26365
|
+
}, function (_ref4) {
|
|
26366
|
+
var centerSpinner = _ref4.centerSpinner;
|
|
26367
|
+
return centerSpinner ? styled.css(["margin:0;"]) : "";
|
|
26294
26368
|
});
|
|
26295
26369
|
var SpinnerContainer$2 = styled__default.div.withConfig({
|
|
26296
26370
|
displayName: "Spinner__SpinnerContainer",
|
|
26297
26371
|
componentId: "sc-vhupl9-1"
|
|
26298
|
-
})(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;line-height:1;"])
|
|
26372
|
+
})(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;line-height:1;", ""], function (_ref5) {
|
|
26373
|
+
var centerSpinner = _ref5.centerSpinner,
|
|
26374
|
+
size = _ref5.size;
|
|
26375
|
+
return centerSpinner ? styled.css(["width:", "px;height:", "px;"], size, size) : "";
|
|
26376
|
+
});
|
|
26377
|
+
/*
|
|
26378
|
+
`centerSpinner` prop alters existing styling of spinner to allow it to properly center itself within
|
|
26379
|
+
containers. Default is false to preserve legacy behavior for past uses.
|
|
26380
|
+
*/
|
|
26299
26381
|
|
|
26300
|
-
var Spinner$1 = function Spinner(
|
|
26301
|
-
var
|
|
26302
|
-
size =
|
|
26303
|
-
|
|
26304
|
-
|
|
26382
|
+
var Spinner$1 = function Spinner(_ref6) {
|
|
26383
|
+
var _ref6$size = _ref6.size,
|
|
26384
|
+
size = _ref6$size === void 0 ? "24" : _ref6$size,
|
|
26385
|
+
_ref6$centerSpinner = _ref6.centerSpinner,
|
|
26386
|
+
centerSpinner = _ref6$centerSpinner === void 0 ? false : _ref6$centerSpinner,
|
|
26387
|
+
themeValues = _ref6.themeValues;
|
|
26388
|
+
return /*#__PURE__*/React__default.createElement(SpinnerContainer$2, {
|
|
26389
|
+
centerSpinner: centerSpinner,
|
|
26390
|
+
size: size
|
|
26391
|
+
}, /*#__PURE__*/React__default.createElement(SpinnerSvgAnimation, {
|
|
26305
26392
|
size: size,
|
|
26306
|
-
color: themeValues.color
|
|
26393
|
+
color: themeValues.color,
|
|
26394
|
+
centerSpinner: centerSpinner
|
|
26307
26395
|
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
26308
26396
|
className: "path",
|
|
26309
26397
|
cx: "50",
|
|
@@ -47661,7 +47749,7 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47661
47749
|
},
|
|
47662
47750
|
text: "Void",
|
|
47663
47751
|
padding: "0",
|
|
47664
|
-
extraStyles: "\n min-width: 65px
|
|
47752
|
+
extraStyles: "\n min-width: 65px;\n margin: 0px;\n min-height: 0px;\n ",
|
|
47665
47753
|
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;")
|
|
47666
47754
|
})), /*#__PURE__*/React__default.createElement(Box, {
|
|
47667
47755
|
padding: "0",
|
|
@@ -47689,12 +47777,69 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47689
47777
|
}));
|
|
47690
47778
|
};
|
|
47691
47779
|
|
|
47780
|
+
var LoadingDetails = function LoadingDetails() {
|
|
47781
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
47782
|
+
padding: "0",
|
|
47783
|
+
background: GRECIAN_GREY,
|
|
47784
|
+
borderRadius: "4px",
|
|
47785
|
+
minHeight: "196px"
|
|
47786
|
+
}, /*#__PURE__*/React__default.createElement(Cover, {
|
|
47787
|
+
minHeight: "196px",
|
|
47788
|
+
singleChild: true,
|
|
47789
|
+
fillCenter: true
|
|
47790
|
+
}, /*#__PURE__*/React__default.createElement(Center, {
|
|
47791
|
+
intrinsic: true
|
|
47792
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
47793
|
+
padding: "0",
|
|
47794
|
+
extraStyles: "flex-grow: 1; display: flex; justify-content: center; align-items: center;"
|
|
47795
|
+
}, /*#__PURE__*/React__default.createElement(Spinner$2, {
|
|
47796
|
+
size: "100",
|
|
47797
|
+
centerSpinner: true
|
|
47798
|
+
})))));
|
|
47799
|
+
};
|
|
47800
|
+
|
|
47801
|
+
var ErrorDetails = function ErrorDetails() {
|
|
47802
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
47803
|
+
padding: "0"
|
|
47804
|
+
}, /*#__PURE__*/React__default.createElement(Alert$1, {
|
|
47805
|
+
variant: "error",
|
|
47806
|
+
heading: "Error Loading Payment",
|
|
47807
|
+
text: "Please go back and try again.",
|
|
47808
|
+
showQuitLink: false,
|
|
47809
|
+
noBorder: true,
|
|
47810
|
+
enableBoxShadow: true,
|
|
47811
|
+
enableSmallText: true,
|
|
47812
|
+
innerContentPadding: "0 0 0 0.75rem",
|
|
47813
|
+
iconPadding: "0 0 0 0",
|
|
47814
|
+
height: "67px",
|
|
47815
|
+
minHeight: "67px",
|
|
47816
|
+
padding: "0.75rem"
|
|
47817
|
+
}));
|
|
47818
|
+
};
|
|
47819
|
+
|
|
47820
|
+
var getLoadingOrErrorContent = function getLoadingOrErrorContent() {
|
|
47821
|
+
var isLoading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
47822
|
+
var isError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
47823
|
+
|
|
47824
|
+
if (isLoading) {
|
|
47825
|
+
return /*#__PURE__*/React__default.createElement(LoadingDetails, null);
|
|
47826
|
+
} else if (isError) {
|
|
47827
|
+
return /*#__PURE__*/React__default.createElement(ErrorDetails, null);
|
|
47828
|
+
}
|
|
47829
|
+
|
|
47830
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null);
|
|
47831
|
+
};
|
|
47832
|
+
|
|
47692
47833
|
var Collapsible = function Collapsible(_ref2) {
|
|
47693
47834
|
var content = _ref2.content,
|
|
47694
47835
|
title = _ref2.title,
|
|
47695
47836
|
supportsTouch = _ref2.supportsTouch,
|
|
47696
47837
|
isOpen = _ref2.isOpen,
|
|
47697
|
-
setIsOpen = _ref2.setIsOpen
|
|
47838
|
+
setIsOpen = _ref2.setIsOpen,
|
|
47839
|
+
_ref2$isLoading = _ref2.isLoading,
|
|
47840
|
+
isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
|
|
47841
|
+
_ref2$isError = _ref2.isError,
|
|
47842
|
+
isError = _ref2$isError === void 0 ? false : _ref2$isError;
|
|
47698
47843
|
return /*#__PURE__*/React__default.createElement(CollapsibleSection$1, {
|
|
47699
47844
|
isMobile: true,
|
|
47700
47845
|
supportsTouch: supportsTouch,
|
|
@@ -47717,13 +47862,17 @@ var Collapsible = function Collapsible(_ref2) {
|
|
|
47717
47862
|
},
|
|
47718
47863
|
positionTransition: true,
|
|
47719
47864
|
initial: "closed"
|
|
47720
|
-
}, content));
|
|
47865
|
+
}, isLoading || isError ? getLoadingOrErrorContent(isLoading, isError) : content));
|
|
47721
47866
|
};
|
|
47722
47867
|
|
|
47723
47868
|
var NonCollapsible = function NonCollapsible(_ref3) {
|
|
47724
47869
|
var title = _ref3.title,
|
|
47725
|
-
content = _ref3.content
|
|
47726
|
-
|
|
47870
|
+
content = _ref3.content,
|
|
47871
|
+
_ref3$isLoading = _ref3.isLoading,
|
|
47872
|
+
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
47873
|
+
_ref3$isError = _ref3.isError,
|
|
47874
|
+
isError = _ref3$isError === void 0 ? false : _ref3$isError;
|
|
47875
|
+
return /*#__PURE__*/React__default.createElement(Stack, null, title, isLoading || isError ? getLoadingOrErrorContent(isLoading, isError) : content);
|
|
47727
47876
|
};
|
|
47728
47877
|
|
|
47729
47878
|
var PaymentDetails = function PaymentDetails(_ref4) {
|
|
@@ -47753,7 +47902,11 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47753
47902
|
_ref4$voidableAmountP = _ref4.voidableAmountPaid,
|
|
47754
47903
|
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP,
|
|
47755
47904
|
_ref4$remainingBalanc = _ref4.remainingBalance,
|
|
47756
|
-
remainingBalance = _ref4$remainingBalanc === void 0 ? false : _ref4$remainingBalanc
|
|
47905
|
+
remainingBalance = _ref4$remainingBalanc === void 0 ? false : _ref4$remainingBalanc,
|
|
47906
|
+
_ref4$isLoading = _ref4.isLoading,
|
|
47907
|
+
isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
|
|
47908
|
+
_ref4$isError = _ref4.isError,
|
|
47909
|
+
isError = _ref4$isError === void 0 ? false : _ref4$isError;
|
|
47757
47910
|
|
|
47758
47911
|
var _useState = React.useState(initiallyOpen),
|
|
47759
47912
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -47856,10 +48009,14 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47856
48009
|
isOpen: isOpen,
|
|
47857
48010
|
setIsOpen: setIsOpen,
|
|
47858
48011
|
isMobile: isMobile,
|
|
47859
|
-
supportsTouch: supportsTouch
|
|
48012
|
+
supportsTouch: supportsTouch,
|
|
48013
|
+
isLoading: isLoading,
|
|
48014
|
+
isError: isError
|
|
47860
48015
|
}) : /*#__PURE__*/React__default.createElement(NonCollapsible, {
|
|
47861
48016
|
title: title,
|
|
47862
|
-
content: content
|
|
48017
|
+
content: content,
|
|
48018
|
+
isLoading: isLoading,
|
|
48019
|
+
isError: isError
|
|
47863
48020
|
});
|
|
47864
48021
|
};
|
|
47865
48022
|
|
|
@@ -48070,59 +48227,6 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
|
48070
48227
|
})))));
|
|
48071
48228
|
};
|
|
48072
48229
|
|
|
48073
|
-
/*
|
|
48074
|
-
|
|
48075
|
-
A utility function that can generate box-shadow values for components
|
|
48076
|
-
Takes a string representing an rgb color value and returns an object
|
|
48077
|
-
with values for standard, inset, and overlay shadows.
|
|
48078
|
-
|
|
48079
|
-
The objects for standard and inset shadows contain versions approiate
|
|
48080
|
-
for base, hover, and active interaction states.
|
|
48081
|
-
|
|
48082
|
-
*/
|
|
48083
|
-
|
|
48084
|
-
/*
|
|
48085
|
-
Function to convert string representing rgb color to rgba value with provided opacity
|
|
48086
|
-
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
48087
|
-
|
|
48088
|
-
*/
|
|
48089
|
-
var rgbToRgba = function rgbToRgba() {
|
|
48090
|
-
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
48091
|
-
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
48092
|
-
|
|
48093
|
-
if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
|
|
48094
|
-
return "";
|
|
48095
|
-
}
|
|
48096
|
-
|
|
48097
|
-
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
48098
|
-
};
|
|
48099
|
-
|
|
48100
|
-
var generateShadows = function generateShadows(baseColorRGB) {
|
|
48101
|
-
var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
48102
|
-
var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
48103
|
-
var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
|
|
48104
|
-
var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
|
|
48105
|
-
var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
|
|
48106
|
-
var standard = {
|
|
48107
|
-
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
48108
|
-
hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
|
|
48109
|
-
active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
|
|
48110
|
-
};
|
|
48111
|
-
var inset = {
|
|
48112
|
-
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
48113
|
-
hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
|
|
48114
|
-
active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
|
|
48115
|
-
};
|
|
48116
|
-
var overlay = {
|
|
48117
|
-
base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
|
|
48118
|
-
};
|
|
48119
|
-
return {
|
|
48120
|
-
standard: standard,
|
|
48121
|
-
inset: inset,
|
|
48122
|
-
overlay: overlay
|
|
48123
|
-
};
|
|
48124
|
-
};
|
|
48125
|
-
|
|
48126
48230
|
/*
|
|
48127
48231
|
Hook that takes an ID selector for an element on the screen
|
|
48128
48232
|
And optionally values for top position, left position, smooth behavior
|