@depay/widgets 7.13.1 → 7.14.1

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/esm/index.js CHANGED
@@ -1323,7 +1323,7 @@ var CardStyle = (function (style) {
1323
1323
  });
1324
1324
 
1325
1325
  var DialogStyle = (function (style) {
1326
- return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .contained .ReactDialog {\n position: absolute;\n height: 100%;\n min-height: 100%;\n width: 100%;\n min-width: 100%;\n }\n\n .contained .ReactDialogBackground {\n position: absolute;\n }\n\n .contained .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n top: 0;\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 13px;\n background: rgb(248,248,248);\n }\n\n @media (max-width: 450px) {\n\n .Dialog {\n border-radius: 0;\n width: 100%;\n }\n }\n\n @media (orientation: portrait) and (max-width: 800px) {\n\n .ReactDialogAnimation {\n width: 100%;\n }\n\n .ReactDialog {\n height: 100%;\n min-height: 100%;\n }\n\n .ReactDialogStack {\n align-items: flex-end;\n }\n\n .Dialog {\n align-content: stretch;\n border-radius: 13px;\n border-top-radius: 13px;\n display: flex;\n flex-direction: column;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogAnimation {\n margin-bottom: -100px !important;\n top: inherit !important;\n position: relative;\n transition: opacity 0.4s ease, margin-bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n margin-bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n align-items: flex-end;\n }\n }\n\n .DialogBody {\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\n }\n\n .DialogHeader {\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n min-height: 54px;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 48px;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\n height: 48px;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n line-height: 24px;\n min-height: 32px;\n position: relative;\n text-align: center;\n }\n\n ";
1326
+ return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .contained .ReactDialog {\n position: absolute;\n height: 100%;\n min-height: 100%;\n width: 100%;\n min-width: 100%;\n }\n\n .contained .ReactDialogBackground {\n position: absolute;\n }\n\n .contained .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n top: 0;\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.2);\n border-radius: 13px;\n background: rgb(248,248,248);\n }\n\n @media (max-width: 450px) {\n\n .Dialog {\n border-radius: 0;\n width: 100%;\n }\n }\n\n @media (orientation: portrait) and (max-width: 800px) {\n\n .ReactDialogAnimation {\n width: 100%;\n }\n\n .ReactDialog {\n height: 100%;\n min-height: 100%;\n }\n\n .ReactDialogStack {\n align-items: flex-end;\n }\n\n .Dialog {\n align-content: stretch;\n border-radius: 13px;\n border-top-radius: 13px;\n display: flex;\n flex-direction: column;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogAnimation {\n margin-bottom: -100px !important;\n top: inherit !important;\n position: relative;\n transition: opacity 0.4s ease, margin-bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n margin-bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n align-items: flex-end;\n }\n }\n\n .DialogBody {\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\n }\n\n .DialogHeader {\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n min-height: 54px;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 48px;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\n height: 48px;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n line-height: 24px;\n min-height: 32px;\n position: relative;\n text-align: center;\n }\n\n ";
1327
1327
  });
1328
1328
 
1329
1329
  var FontStyle = (function (style) {
@@ -1367,7 +1367,7 @@ var PaddingStyle = (function () {
1367
1367
  });
1368
1368
 
1369
1369
  var PoweredByStyle = (function (style) {
1370
- return "\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 3px;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .contained .PoweredByWrapper {\n position: absolute;\n }\n\n .PoweredByLink {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;\n color: white;\n opacity: 0.4;\n display: inline-block;\n font-size: 14px;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 8px;\n text-decoration: none;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
1370
+ return "\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 3px;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .contained .PoweredByWrapper {\n position: absolute;\n }\n\n .PoweredByLink {\n color: white;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;\n font-size: 14px;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 8px;\n opacity: 0.5;\n text-decoration: none;\n text-shadow: black 0 0 2px;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
1371
1371
  });
1372
1372
 
1373
1373
  var RangeSliderStyle = (function (style) {
@@ -1411,15 +1411,17 @@ var TooltipStyle = (function (style) {
1411
1411
  });
1412
1412
 
1413
1413
  var styleRenderer = (function (style) {
1414
- style = Object.assign({
1415
- colors: {
1414
+ var _style, _style2;
1415
+
1416
+ style = {
1417
+ colors: Object.assign({
1416
1418
  primary: '#ea357a',
1417
1419
  buttonText: '#ffffff',
1418
1420
  icons: '#000000',
1419
1421
  text: '#212529'
1420
- },
1421
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
1422
- }, style);
1422
+ }, ((_style = style) === null || _style === void 0 ? void 0 : _style.colors) || {}),
1423
+ fontFamily: ((_style2 = style) === null || _style2 === void 0 ? void 0 : _style2.fontFamily) || '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
1424
+ };
1423
1425
  return [ResetStyle(), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), PoweredByStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), FontStyle(style), IconStyle(style), OpacityStyle(), PaddingStyle(), HeightStyle(), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle(), BlockchainLogoStyle(), SearchStyle(style), TokenImageStyle(), AlertStyle(), TableStyle(), LinkStyle(style), TooltipStyle(style)].join('');
1424
1426
  });
1425
1427
 
@@ -19064,13 +19066,13 @@ var ChangableAmountProvider = (function (props) {
19064
19066
  }).then(function (readableMaxAmount) {
19065
19067
  var slippage = 1.01;
19066
19068
  var maxAmount = parseFloat(new Decimal(readableMaxAmount).div(slippage).mul(conversionRate).toString());
19067
- setMaxAmount(maxAmount > 10 ? Math.round(maxAmount) : round(maxAmount));
19069
+ setMaxAmount(maxAmount > 10 ? Math.round(maxAmount - 1) : round(maxAmount - 1));
19068
19070
  })["catch"](setError);
19069
19071
  })["catch"](setError);
19070
19072
  } else if (maxRoute.fromToken.address == CONSTANTS[maxRoute.blockchain].USD) {
19071
19073
  var _maxAmount = parseFloat(new Decimal(readableMaxAmount).mul(conversionRate).toString());
19072
19074
 
19073
- setMaxAmount(_maxAmount > 10 ? Math.round(_maxAmount) : _maxAmount);
19075
+ setMaxAmount(_maxAmount > 10 ? Math.round(_maxAmount - 1) : _maxAmount - 1);
19074
19076
  } else {
19075
19077
  route({
19076
19078
  blockchain: maxRoute.blockchain,
@@ -19247,7 +19249,8 @@ var PaymentProvider = (function (props) {
19247
19249
  setUpdatable = _useContext6.setUpdatable;
19248
19250
 
19249
19251
  var _useContext7 = useContext(NavigateContext),
19250
- navigate = _useContext7.navigate;
19252
+ navigate = _useContext7.navigate,
19253
+ set = _useContext7.set;
19251
19254
 
19252
19255
  var _useContext8 = useContext(WalletContext),
19253
19256
  wallet = _useContext8.wallet;
@@ -19299,7 +19302,7 @@ var PaymentProvider = (function (props) {
19299
19302
  }
19300
19303
 
19301
19304
  setClosable(true);
19302
- navigate('PaymentError');
19305
+ set(['PaymentError']);
19303
19306
  };
19304
19307
 
19305
19308
  var pay = /*#__PURE__*/function () {
@@ -20361,7 +20364,9 @@ var ChangeAmountDialog = (function (props) {
20361
20364
  className: "PaddingLeftM PaddingRightM"
20362
20365
  }, /*#__PURE__*/React.createElement("div", {
20363
20366
  className: "PaddingTopS TextCenter PaddingBottomL"
20364
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
20367
+ }, /*#__PURE__*/React.createElement("div", {
20368
+ className: "PaddingBottomM"
20369
+ }, /*#__PURE__*/React.createElement("input", {
20365
20370
  max: parseFloat(maxAmount),
20366
20371
  min: min,
20367
20372
  step: step,
@@ -20381,12 +20386,12 @@ var ChangeAmountDialog = (function (props) {
20381
20386
  }
20382
20387
  }, /*#__PURE__*/React.createElement("div", {
20383
20388
  className: "FontSizeS"
20384
- }, format(toValidStep(maxAmount)), /*#__PURE__*/React.createElement("button", {
20389
+ }, format(toValidStep(maxAmount)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
20385
20390
  className: "TextButton",
20386
20391
  onClick: function onClick() {
20387
20392
  changeAmount(toValidValue(maxAmount));
20388
20393
  }
20389
- }, "(Max)")))))),
20394
+ }, "(Max)"))))))),
20390
20395
  footer: /*#__PURE__*/React.createElement("div", {
20391
20396
  className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
20392
20397
  }, /*#__PURE__*/React.createElement("button", {
@@ -20536,12 +20541,15 @@ var ChangePaymentDialog = (function (props) {
20536
20541
  });
20537
20542
 
20538
20543
  var DonationOverviewSkeleton = (function (props) {
20544
+ var _useContext = useContext(ConfigurationContext),
20545
+ title = _useContext.title;
20546
+
20539
20547
  return /*#__PURE__*/React.createElement(Dialog$1, {
20540
20548
  header: /*#__PURE__*/React.createElement("div", {
20541
20549
  className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
20542
20550
  }, /*#__PURE__*/React.createElement("h1", {
20543
20551
  className: "LineHeightL FontSizeL"
20544
- }, "Donation")),
20552
+ }, title || 'Donation')),
20545
20553
  body: /*#__PURE__*/React.createElement("div", {
20546
20554
  className: "PaddingLeftM PaddingRightM PaddingBottomXS"
20547
20555
  }, /*#__PURE__*/React.createElement("div", {
@@ -20895,7 +20903,8 @@ var Footer = (function () {
20895
20903
 
20896
20904
  var DonationOverviewDialog = (function (props) {
20897
20905
  var _useContext = useContext(ConfigurationContext),
20898
- currencyCode = _useContext.currencyCode;
20906
+ currencyCode = _useContext.currencyCode,
20907
+ title = _useContext.title;
20899
20908
 
20900
20909
  var _useContext2 = useContext(ChangableAmountContext),
20901
20910
  amount = _useContext2.amount;
@@ -20917,7 +20926,7 @@ var DonationOverviewDialog = (function (props) {
20917
20926
  className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
20918
20927
  }, /*#__PURE__*/React.createElement("h1", {
20919
20928
  className: "LineHeightL FontSizeL"
20920
- }, "Donation")),
20929
+ }, title || 'Donation')),
20921
20930
  body: /*#__PURE__*/React.createElement("div", {
20922
20931
  className: "PaddingLeftM PaddingRightM PaddingBottomXS"
20923
20932
  }, /*#__PURE__*/React.createElement("div", {
@@ -20996,9 +21005,6 @@ var PaymentErrorDialog = (function () {
20996
21005
  var _useContext2 = useContext(PaymentContext),
20997
21006
  transaction = _useContext2.transaction;
20998
21007
 
20999
- var _useContext3 = useContext(ConfigurationContext),
21000
- recover = _useContext3.recover;
21001
-
21002
21008
  return /*#__PURE__*/React.createElement(Dialog$1, {
21003
21009
  stacked: false,
21004
21010
  header: /*#__PURE__*/React.createElement("div", {
@@ -21015,7 +21021,7 @@ var PaymentErrorDialog = (function () {
21015
21021
  className: "LineHeightL Text FontSizeL PaddingTopS FontWeightBold"
21016
21022
  }, "Payment Failed"), /*#__PURE__*/React.createElement("div", {
21017
21023
  className: "Text PaddingTopS PaddingBottomS PaddingLeftS PaddingRightS"
21018
- }, recover == undefined && /*#__PURE__*/React.createElement("strong", {
21024
+ }, /*#__PURE__*/React.createElement("strong", {
21019
21025
  className: "FontSizeM"
21020
21026
  }, "Unfortunately executing your payment failed. You can go back and try again."), transaction && /*#__PURE__*/React.createElement("div", {
21021
21027
  className: "PaddingTopS"
@@ -21028,7 +21034,7 @@ var PaymentErrorDialog = (function () {
21028
21034
  }, "View on explorer")))),
21029
21035
  footer: /*#__PURE__*/React.createElement("div", {
21030
21036
  className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
21031
- }, recover == undefined && /*#__PURE__*/React.createElement("button", {
21037
+ }, /*#__PURE__*/React.createElement("button", {
21032
21038
  className: "ButtonPrimary",
21033
21039
  onClick: function onClick() {
21034
21040
  return close();
@@ -21085,10 +21091,10 @@ var DonationStack = (function (props) {
21085
21091
  close = _useContext.close;
21086
21092
 
21087
21093
  var _useContext2 = useContext(NavigateContext),
21088
- setNavigate = _useContext2.setNavigate;
21094
+ setNavigator = _useContext2.setNavigator;
21089
21095
 
21090
21096
  return /*#__PURE__*/React.createElement(ReactDialogStack, {
21091
- setNavigate: setNavigate,
21097
+ setNavigator: setNavigator,
21092
21098
  open: open,
21093
21099
  close: close,
21094
21100
  start: "DonationOverview",
@@ -21107,20 +21113,27 @@ var DonationStack = (function (props) {
21107
21113
  var NavigateProvider = (function (props) {
21108
21114
  var navigator;
21109
21115
 
21110
- var setNavigate = function setNavigate(_navigator) {
21116
+ var setNavigator = function setNavigator(_navigator) {
21111
21117
  navigator = _navigator;
21112
21118
  };
21113
21119
 
21114
21120
  var navigate = function navigate(dialog) {
21115
21121
  if (navigator) {
21116
- navigator(dialog);
21122
+ navigator.navigate(dialog);
21123
+ }
21124
+ };
21125
+
21126
+ var set = function set(dialogs) {
21127
+ if (navigator) {
21128
+ navigator.set(dialogs);
21117
21129
  }
21118
21130
  };
21119
21131
 
21120
21132
  return /*#__PURE__*/React.createElement(NavigateContext.Provider, {
21121
21133
  value: {
21122
21134
  navigate: navigate,
21123
- setNavigate: setNavigate
21135
+ set: set,
21136
+ setNavigator: setNavigator
21124
21137
  }
21125
21138
  }, props.children);
21126
21139
  });
@@ -21178,7 +21191,7 @@ var PaymentTrackingProvider = (function (props) {
21178
21191
  setClosable = _useContext3.setClosable;
21179
21192
 
21180
21193
  var _useContext4 = useContext(NavigateContext),
21181
- navigate = _useContext4.navigate;
21194
+ set = _useContext4.set;
21182
21195
 
21183
21196
  var openSocket = function openSocket(transaction) {
21184
21197
  var socket = new WebSocket('wss://integrate.depay.fi/cable');
@@ -21207,7 +21220,7 @@ var PaymentTrackingProvider = (function (props) {
21207
21220
 
21208
21221
  if (item.message.status == 'failed') {
21209
21222
  setClosable(true);
21210
- navigate('PaymentError');
21223
+ set(['PaymentError']);
21211
21224
  }
21212
21225
 
21213
21226
  if (validated) {
@@ -21678,12 +21691,12 @@ var preflight$2 = /*#__PURE__*/function () {
21678
21691
 
21679
21692
  var Donation = /*#__PURE__*/function () {
21680
21693
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
21681
- var amount, accept, event, sent, confirmed, validated, failed, error, critical, style, blacklist, providers, currency, connected, closed, track, fee, closable, integration, link, container, document, unmount;
21694
+ var amount, accept, event, sent, confirmed, validated, failed, error, critical, style, blacklist, providers, currency, connected, closed, track, fee, closable, integration, link, container, title, document, unmount;
21682
21695
  return regenerator.wrap(function _callee2$(_context2) {
21683
21696
  while (1) {
21684
21697
  switch (_context2.prev = _context2.next) {
21685
21698
  case 0:
21686
- amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, validated = _ref3.validated, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, fee = _ref3.fee, closable = _ref3.closable, integration = _ref3.integration, link = _ref3.link, container = _ref3.container, document = _ref3.document;
21699
+ amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, validated = _ref3.validated, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, fee = _ref3.fee, closable = _ref3.closable, integration = _ref3.integration, link = _ref3.link, container = _ref3.container, title = _ref3.title, document = _ref3.document;
21687
21700
  requireReactVersion();
21688
21701
  _context2.prev = 2;
21689
21702
  _context2.next = 5;
@@ -21719,7 +21732,8 @@ var Donation = /*#__PURE__*/function () {
21719
21732
  blacklist: blacklist,
21720
21733
  providers: providers,
21721
21734
  integration: integration,
21722
- link: link
21735
+ link: link,
21736
+ title: title
21723
21737
  }
21724
21738
  }, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
21725
21739
  unmount: unmount,
@@ -22125,10 +22139,10 @@ var PaymentStack = (function (props) {
22125
22139
  close = _useContext.close;
22126
22140
 
22127
22141
  var _useContext2 = useContext(NavigateContext),
22128
- setNavigate = _useContext2.setNavigate;
22142
+ setNavigator = _useContext2.setNavigator;
22129
22143
 
22130
22144
  return /*#__PURE__*/React.createElement(ReactDialogStack, {
22131
- setNavigate: setNavigate,
22145
+ setNavigator: setNavigator,
22132
22146
  open: open,
22133
22147
  close: close,
22134
22148
  start: "PaymentOverview",
@@ -22578,10 +22592,10 @@ var SaleStack = (function (props) {
22578
22592
  close = _useContext.close;
22579
22593
 
22580
22594
  var _useContext2 = useContext(NavigateContext),
22581
- setNavigate = _useContext2.setNavigate;
22595
+ setNavigator = _useContext2.setNavigator;
22582
22596
 
22583
22597
  return /*#__PURE__*/React.createElement(ReactDialogStack, {
22584
- setNavigate: setNavigate,
22598
+ setNavigator: setNavigator,
22585
22599
  open: open,
22586
22600
  close: close,
22587
22601
  start: "SaleOverview",