@swype-org/react-sdk 0.2.26 → 0.2.29

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.js CHANGED
@@ -4907,30 +4907,6 @@ var waitHintStyle = (color) => ({
4907
4907
  color,
4908
4908
  margin: 0
4909
4909
  });
4910
-
4911
- // src/feeFormat.ts
4912
- function isPreciseMoneyNonPositive(fee) {
4913
- const raw = fee.value.trim();
4914
- if (!/^-?\d+(\.\d*)?$/.test(raw)) return false;
4915
- const n = Number(raw);
4916
- return Number.isFinite(n) && n <= 0;
4917
- }
4918
- function formatNonPositiveFeeDisplay(fee) {
4919
- return "< $0.01";
4920
- }
4921
- function formatPreciseMoneyForDisplay(fee) {
4922
- const raw = fee.value.trim();
4923
- if (fee.currency === "USD") {
4924
- if (!/^\d+(\.\d*)?$/.test(raw)) {
4925
- return `$${raw}`;
4926
- }
4927
- const [whole, frac = ""] = raw.split(".");
4928
- const dec = `${frac}00`.slice(0, 2);
4929
- const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
4930
- return `$${intFmt}.${dec}`;
4931
- }
4932
- return `${raw} ${fee.currency}`;
4933
- }
4934
4910
  function formatUsdTwoDecimals(value) {
4935
4911
  const n = Number(value);
4936
4912
  return (Number.isFinite(n) ? n : 0).toLocaleString("en-US", {
@@ -5102,10 +5078,9 @@ function DepositScreen({
5102
5078
  return /* @__PURE__ */ jsx(WarningBanner, { title: "Fee estimate unavailable", children: quoteError });
5103
5079
  }
5104
5080
  if (quoteFee) {
5105
- const feeText = isPreciseMoneyNonPositive(quoteFee) ? formatNonPositiveFeeDisplay() : formatPreciseMoneyForDisplay(quoteFee);
5106
5081
  return /* @__PURE__ */ jsxs("div", { style: feeRowContainerStyle, "aria-live": "polite", children: [
5107
5082
  /* @__PURE__ */ jsx("span", { style: feeRowLabelStyle(tokens.textMuted), children: "Fee estimate: " }),
5108
- /* @__PURE__ */ jsx("span", { style: feeRowAmountStyle(tokens.textSecondary), children: feeText })
5083
+ /* @__PURE__ */ jsx("span", { style: feeRowAmountStyle(tokens.textSecondary), children: "Free" })
5109
5084
  ] });
5110
5085
  }
5111
5086
  return null;
@@ -6671,6 +6646,30 @@ var selectCircleSelectedStyle = (color) => ({
6671
6646
  justifyContent: "center",
6672
6647
  flexShrink: 0
6673
6648
  });
6649
+
6650
+ // src/feeFormat.ts
6651
+ function isPreciseMoneyNonPositive(fee) {
6652
+ const raw = fee.value.trim();
6653
+ if (!/^-?\d+(\.\d*)?$/.test(raw)) return false;
6654
+ const n = Number(raw);
6655
+ return Number.isFinite(n) && n <= 0;
6656
+ }
6657
+ function formatNonPositiveFeeDisplay(fee) {
6658
+ return "Free";
6659
+ }
6660
+ function formatPreciseMoneyForDisplay(fee) {
6661
+ const raw = fee.value.trim();
6662
+ if (fee.currency === "USD") {
6663
+ if (!/^\d+(\.\d*)?$/.test(raw)) {
6664
+ return `$${raw}`;
6665
+ }
6666
+ const [whole, frac = ""] = raw.split(".");
6667
+ const dec = `${frac}00`.slice(0, 2);
6668
+ const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
6669
+ return `$${intFmt}.${dec}`;
6670
+ }
6671
+ return `${raw} ${fee.currency}`;
6672
+ }
6674
6673
  function entryKey(entry) {
6675
6674
  return `${entry.sourceChainId}-${entry.tokenAddress.toLowerCase()}`;
6676
6675
  }