@thecb/components 10.6.0-beta.0 → 10.6.0-beta.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
@@ -4919,7 +4919,9 @@ var FONT_SIZE = {
4919
4919
  // 14px
4920
4920
  MD: "1.000rem",
4921
4921
  // 16px
4922
- LG: "1.125rem" // 18px
4922
+ LG: "1.125rem",
4923
+ // 18px
4924
+ XL: "1.250rem" //20px
4923
4925
  };
4924
4926
  var FONT_WEIGHT_REGULAR = "400";
4925
4927
  var FONT_WEIGHT_SEMIBOLD = "600";
@@ -39262,11 +39264,15 @@ var LoadingLine = function LoadingLine(_ref) {
39262
39264
  var backgroundColor$6 = {
39263
39265
  primary: WHITE
39264
39266
  };
39267
+ var color$b = {
39268
+ primary: ROYAL_BLUE
39269
+ };
39265
39270
  var boxShadow$1 = {
39266
39271
  primary: "box-shadow: 0px 1px 2px 0px rgba(".concat(CHARADE_GREY, ", 0.1);\n box-shadow: 0px 2px 6px 0px rgba(").concat(CHARADE_GREY, ", 0.2);\n box-shadow: 0px -1px 0px 0px rgba(").concat(CHARADE_GREY, ", 0.1) inset;")
39267
39272
  };
39268
39273
  var fallbackValues$C = {
39269
39274
  backgroundColor: backgroundColor$6,
39275
+ color: color$b,
39270
39276
  boxShadow: boxShadow$1
39271
39277
  };
39272
39278
 
@@ -39400,17 +39406,17 @@ var Module = function Module(_ref) {
39400
39406
  var Module$1 = /*#__PURE__*/React.memo(themeComponent(Module, "Module", fallbackValues$D, "default"));
39401
39407
 
39402
39408
  var WalletName = function WalletName(_ref) {
39403
- var _ref$mainText = _ref.mainText,
39404
- mainText = _ref$mainText === void 0 ? "" : _ref$mainText,
39405
- _ref$action = _ref.action,
39406
- action = _ref$action === void 0 ? noop : _ref$action,
39407
- _ref$text = _ref.text,
39408
- text = _ref$text === void 0 ? "Not you?" : _ref$text,
39409
- _ref$actionText = _ref.actionText,
39410
- actionText = _ref$actionText === void 0 ? "Check out as a guest" : _ref$actionText,
39411
- themeValues = _ref.themeValues;
39412
- var themeContext = React.useContext(styled.ThemeContext);
39413
- var isMobile = themeContext.isMobile;
39409
+ var mainText = _ref.mainText,
39410
+ action = _ref.action,
39411
+ text = _ref.text,
39412
+ actionText = _ref.actionText,
39413
+ themeValues = _ref.themeValues,
39414
+ _ref$disableAction = _ref.disableAction,
39415
+ disableAction = _ref$disableAction === void 0 ? false : _ref$disableAction,
39416
+ _ref$buttonExtraStyle = _ref.buttonExtraStyles,
39417
+ buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle;
39418
+ var _useContext = React.useContext(styled.ThemeContext),
39419
+ isMobile = _useContext.isMobile;
39414
39420
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Module$1, {
39415
39421
  spacingBottom: isMobile ? "0" : "1.5rem"
39416
39422
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -39418,28 +39424,30 @@ var WalletName = function WalletName(_ref) {
39418
39424
  boxShadow: themeValues.boxShadow,
39419
39425
  spacingBottom: "0",
39420
39426
  margin: "0 0 0 0",
39421
- extraStyles: isMobile ? "display: flex; flex-direction: column; flex-wrap: wrap; span {text - align: right;}" : "display: flex; justify-content: space-between; align-items: center;"
39427
+ extraStyles: isMobile ? "display: flex; flex-direction: column; flex-wrap: wrap; span {text-align: right;}" : "display: flex; justify-content: space-between; align-items: center;"
39422
39428
  }, /*#__PURE__*/React__default.createElement(Box, {
39423
39429
  padding: "0 0 0"
39424
39430
  }, /*#__PURE__*/React__default.createElement(Text$1, null, mainText)), !isMobile && /*#__PURE__*/React__default.createElement(Box, {
39425
39431
  padding: "0"
39426
- }, /*#__PURE__*/React__default.createElement(Text$1, {
39432
+ }, text && /*#__PURE__*/React__default.createElement(Text$1, {
39427
39433
  variant: "pXS"
39428
- }, text), "\xA0", /*#__PURE__*/React__default.createElement(ButtonWithAction, {
39434
+ }, text), text && actionText && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\xA0"), action && actionText && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
39435
+ disabled: disableAction,
39429
39436
  text: actionText,
39430
39437
  action: action,
39431
39438
  variant: "smallGhost",
39432
- extraStyles: " margin-left: 0; span {font-size: 0.75rem;} "
39439
+ extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.75rem;}\n ".concat(buttonExtraStyles, "\n ")
39433
39440
  })))), isMobile && /*#__PURE__*/React__default.createElement(Box, {
39434
39441
  padding: "0 0 24px",
39435
39442
  extraStyles: "display: flex; align-items: center; justify-content: flex-end;"
39436
- }, /*#__PURE__*/React__default.createElement(Text$1, {
39443
+ }, text && /*#__PURE__*/React__default.createElement(Text$1, {
39437
39444
  extraStyles: "font-size: 12px"
39438
- }, text), /*#__PURE__*/React__default.createElement(ButtonWithAction, {
39445
+ }, text), action && actionText && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
39439
39446
  text: actionText,
39440
39447
  action: action,
39441
39448
  variant: "smallGhost",
39442
- extraStyles: "span {font-size: 12px;}"
39449
+ disabled: disableAction,
39450
+ extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.75rem;}\n ".concat(buttonExtraStyles, "\n ")
39443
39451
  })));
39444
39452
  };
39445
39453
  var WalletName$1 = themeComponent(WalletName, "WalletName", fallbackValues$C, "primary");
@@ -42877,7 +42885,7 @@ var backgroundColor$b = {
42877
42885
  var borderColor$5 = {
42878
42886
  primary: MOON_RAKER
42879
42887
  };
42880
- var color$b = {
42888
+ var color$c = {
42881
42889
  primary: ROYAL_BLUE_VIVID
42882
42890
  };
42883
42891
  var fallbackValues$K = {
@@ -42887,7 +42895,7 @@ var fallbackValues$K = {
42887
42895
  activeBackgroundColor: activeBackgroundColor$1,
42888
42896
  backgroundColor: backgroundColor$b,
42889
42897
  borderColor: borderColor$5,
42890
- color: color$b
42898
+ color: color$c
42891
42899
  };
42892
42900
 
42893
42901
  var Container = styled__default(Box).withConfig({
@@ -46682,6 +46690,8 @@ var CancelButton = function CancelButton(_ref) {
46682
46690
  cancelAction = _ref$cancelAction === void 0 ? noop : _ref$cancelAction,
46683
46691
  _ref$cancelButtonText = _ref.cancelButtonText,
46684
46692
  cancelButtonText = _ref$cancelButtonText === void 0 ? "" : _ref$cancelButtonText,
46693
+ _ref$cancelButtonVari = _ref.cancelButtonVariant,
46694
+ cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "secondary" : _ref$cancelButtonVari,
46685
46695
  _ref$hideModal = _ref.hideModal,
46686
46696
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46687
46697
  _ref$isMobile = _ref.isMobile,
@@ -46698,7 +46708,7 @@ var CancelButton = function CancelButton(_ref) {
46698
46708
  role: "button",
46699
46709
  text: cancelButtonText,
46700
46710
  textExtraStyles: "".concat(fontSize),
46701
- variant: "secondary"
46711
+ variant: cancelButtonVariant
46702
46712
  });
46703
46713
  };
46704
46714
 
@@ -46727,6 +46737,30 @@ var CloseButton = function CloseButton(_ref) {
46727
46737
  });
46728
46738
  };
46729
46739
 
46740
+ var CloseIconButton = function CloseIconButton(_ref) {
46741
+ var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
46742
+ _ref$hideModal = _ref.hideModal,
46743
+ hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46744
+ _ref$iconWidth = _ref.iconWidth,
46745
+ iconWidth = _ref$iconWidth === void 0 ? "24" : _ref$iconWidth,
46746
+ _ref$iconHeight = _ref.iconHeight,
46747
+ iconHeight = _ref$iconHeight === void 0 ? "24" : _ref$iconHeight,
46748
+ _ref$ariaLabel = _ref.ariaLabel,
46749
+ ariaLabel = _ref$ariaLabel === void 0 ? "Close Modal" : _ref$ariaLabel;
46750
+ return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46751
+ action: hideModal,
46752
+ "aria-label": ariaLabel,
46753
+ contentOverride: true,
46754
+ extraStyles: "\n min-height: auto;\n min-width: auto;\n height: 1.5rem;\n margin: 0 0 0 0.5rem;\n &:focus {\n outline-offset: -3px;\n }\n ",
46755
+ variant: "smallGhost"
46756
+ }, /*#__PURE__*/React__default.createElement(CloseIcon, {
46757
+ role: "img",
46758
+ "aria-hidden": "true",
46759
+ iconWidth: iconWidth,
46760
+ iconHeight: iconHeight
46761
+ }));
46762
+ };
46763
+
46730
46764
  var ContinueButton = function ContinueButton(_ref) {
46731
46765
  var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
46732
46766
  buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
@@ -46736,6 +46770,8 @@ var ContinueButton = function ContinueButton(_ref) {
46736
46770
  continueButtonText = _ref$continueButtonTe === void 0 ? "" : _ref$continueButtonTe,
46737
46771
  _ref$continueURL = _ref.continueURL,
46738
46772
  continueURL = _ref$continueURL === void 0 ? "" : _ref$continueURL,
46773
+ _ref$continueButtonVa = _ref.continueButtonVariant,
46774
+ continueButtonVariant = _ref$continueButtonVa === void 0 ? "primary" : _ref$continueButtonVa,
46739
46775
  _ref$isContinueAction = _ref.isContinueActionDisabled,
46740
46776
  isContinueActionDisabled = _ref$isContinueAction === void 0 ? false : _ref$isContinueAction,
46741
46777
  _ref$isLoading = _ref.isLoading,
@@ -46761,7 +46797,7 @@ var ContinueButton = function ContinueButton(_ref) {
46761
46797
  text: continueButtonText,
46762
46798
  textExtraStyles: "".concat(fontSize),
46763
46799
  url: continueURL,
46764
- variant: useDangerButton ? "danger" : "primary"
46800
+ variant: useDangerButton ? "danger" : continueButtonVariant
46765
46801
  });
46766
46802
  };
46767
46803
 
@@ -46787,6 +46823,8 @@ var Modal$2 = function Modal(_ref) {
46787
46823
  cancelAction = _ref$cancelAction === void 0 ? noop : _ref$cancelAction,
46788
46824
  _ref$cancelButtonText = _ref.cancelButtonText,
46789
46825
  cancelButtonText = _ref$cancelButtonText === void 0 ? "Cancel" : _ref$cancelButtonText,
46826
+ _ref$cancelButtonVari = _ref.cancelButtonVariant,
46827
+ cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "secondary" : _ref$cancelButtonVari,
46790
46828
  _ref$children = _ref.children,
46791
46829
  children = _ref$children === void 0 ? [] : _ref$children,
46792
46830
  _ref$closeButtonText = _ref.closeButtonText,
@@ -46795,6 +46833,8 @@ var Modal$2 = function Modal(_ref) {
46795
46833
  continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
46796
46834
  _ref$continueButtonTe = _ref.continueButtonText,
46797
46835
  continueButtonText = _ref$continueButtonTe === void 0 ? "Continue" : _ref$continueButtonTe,
46836
+ _ref$continueButtonVa = _ref.continueButtonVariant,
46837
+ continueButtonVariant = _ref$continueButtonVa === void 0 ? "primary" : _ref$continueButtonVa,
46798
46838
  _ref$continueURL = _ref.continueURL,
46799
46839
  continueURL = _ref$continueURL === void 0 ? "" : _ref$continueURL,
46800
46840
  _ref$customWidth = _ref.customWidth,
@@ -46831,6 +46871,8 @@ var Modal$2 = function Modal(_ref) {
46831
46871
  onlyCloseButton = _ref$onlyCloseButton === void 0 ? false : _ref$onlyCloseButton,
46832
46872
  _ref$onlyContinueButt = _ref.onlyContinueButton,
46833
46873
  onlyContinueButton = _ref$onlyContinueButt === void 0 ? false : _ref$onlyContinueButt,
46874
+ _ref$showCloseIconBut = _ref.showCloseIconButton,
46875
+ showCloseIconButton = _ref$showCloseIconBut === void 0 ? false : _ref$showCloseIconBut,
46834
46876
  _ref$underlayClickExi = _ref.underlayClickExits,
46835
46877
  underlayClickExits = _ref$underlayClickExi === void 0 ? true : _ref$underlayClickExi,
46836
46878
  _ref$useDangerButton = _ref.useDangerButton,
@@ -46879,7 +46921,7 @@ var Modal$2 = function Modal(_ref) {
46879
46921
  borderRadius: BORDER_RADIUS.MD,
46880
46922
  margin: SPACING.XS,
46881
46923
  overflow: "auto",
46882
- width: isMobile ? "" : customWidth || "615px"
46924
+ width: isMobile ? "" : customWidth || "576px"
46883
46925
  },
46884
46926
  underlayClickExits: underlayClickExits,
46885
46927
  "aria-modal": true,
@@ -46894,13 +46936,16 @@ var Modal$2 = function Modal(_ref) {
46894
46936
  borderWidthOverride: "0 0 ".concat(BORDER_THIN, " 0"),
46895
46937
  padding: "".concat(SPACING.XS, " ").concat(SPACING.MD)
46896
46938
  }, /*#__PURE__*/React__default.createElement(Cluster, {
46897
- justify: "flex-start",
46898
- align: "center"
46939
+ justify: showCloseIconButton ? "space-between" : "flex-start",
46940
+ align: showCloseIconButton && isMobile ? "flex-start" : "center",
46941
+ nowrap: true
46899
46942
  }, /*#__PURE__*/React__default.createElement(Title$1, {
46900
46943
  as: "h2",
46901
46944
  weight: FONT_WEIGHT_SEMIBOLD,
46902
46945
  fontSize: isMobile ? FONT_SIZE.MD : FONT_SIZE.LG
46903
- }, modalHeaderText))), /*#__PURE__*/React__default.createElement(Box, {
46946
+ }, modalHeaderText), showCloseIconButton && /*#__PURE__*/React__default.createElement(CloseIconButton, {
46947
+ hideModal: hideModal
46948
+ }))), /*#__PURE__*/React__default.createElement(Box, {
46904
46949
  background: modalBodyBg || ATHENS_GREY,
46905
46950
  padding: "0"
46906
46951
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -46918,6 +46963,7 @@ var Modal$2 = function Modal(_ref) {
46918
46963
  buttonExtraStyles: buttonExtraStyles,
46919
46964
  cancelAction: cancelAction,
46920
46965
  cancelButtonText: cancelButtonText,
46966
+ cancelButtonVariant: cancelButtonVariant,
46921
46967
  hideModal: hideModal,
46922
46968
  isMobile: isMobile,
46923
46969
  key: "cancel"
@@ -46926,6 +46972,7 @@ var Modal$2 = function Modal(_ref) {
46926
46972
  continueAction: continueAction,
46927
46973
  continueButtonText: continueButtonText,
46928
46974
  continueURL: continueURL,
46975
+ continueButtonVariant: continueButtonVariant,
46929
46976
  isContinueActionDisabled: isContinueActionDisabled,
46930
46977
  isLoading: isLoading,
46931
46978
  isMobile: isMobile,
@@ -47108,14 +47155,14 @@ var TitleModule = function TitleModule(_ref) {
47108
47155
  }, subtitle)));
47109
47156
  };
47110
47157
 
47111
- var color$c = "#15749D";
47158
+ var color$d = "#15749D";
47112
47159
  var hoverColor$5 = "#116285";
47113
47160
  var activeColor$8 = "#0E506D";
47114
47161
  var linkColor$4 = "#3176AA";
47115
47162
  var fontWeight$6 = FONT_WEIGHT_REGULAR;
47116
47163
  var modalLinkHoverFocus = "outline: none;\n cursor: pointer;\n text-decoration: underline;\n text-decoration-color: #317D4F;";
47117
47164
  var fallbackValues$M = {
47118
- color: color$c,
47165
+ color: color$d,
47119
47166
  hoverColor: hoverColor$5,
47120
47167
  activeColor: activeColor$8,
47121
47168
  linkColor: linkColor$4,