@rhinestone/deposit-modal 0.1.55 → 0.1.57

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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-AJUR6FAP.mjs";
3
+ } from "./chunk-VOGD6Y4U.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-JQTV5JTB.mjs";
8
+ import "./chunk-7TTEHQBD.mjs";
9
9
  import "./chunk-CIXHTOO3.mjs";
10
10
 
11
11
  // src/DepositModalReown.tsx
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkQJVXCBUIcjs = require('./chunk-QJVXCBUI.cjs');
3
+ var _chunkZ2TKNB6Ccjs = require('./chunk-Z2TKNB6C.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-EAEDK474.cjs');
8
+ require('./chunk-TQ6IIGRS.cjs');
9
9
  require('./chunk-R6U6BHCV.cjs');
10
10
 
11
11
  // src/DepositModalReown.tsx
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
32
32
  reown.disconnect();
33
33
  }, [reown.disconnect]);
34
34
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
- _chunkQJVXCBUIcjs.DepositModalInner,
35
+ _chunkZ2TKNB6Ccjs.DepositModalInner,
36
36
  {
37
37
  ...props,
38
38
  reownWallet: reownWithSolana,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WithdrawModalInner
3
- } from "./chunk-QOEACKBH.mjs";
3
+ } from "./chunk-3ESBSOB7.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-JQTV5JTB.mjs";
8
+ import "./chunk-7TTEHQBD.mjs";
9
9
  import "./chunk-CIXHTOO3.mjs";
10
10
 
11
11
  // src/WithdrawModalReown.tsx
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXMNGYDDBcjs = require('./chunk-XMNGYDDB.cjs');
3
+ var _chunk3FEFGN7Hcjs = require('./chunk-3FEFGN7H.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-EAEDK474.cjs');
8
+ require('./chunk-TQ6IIGRS.cjs');
9
9
  require('./chunk-R6U6BHCV.cjs');
10
10
 
11
11
  // src/WithdrawModalReown.tsx
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
20
20
  reown.disconnect();
21
21
  }, [reown.disconnect]);
22
22
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23
- _chunkXMNGYDDBcjs.WithdrawModalInner,
23
+ _chunk3FEFGN7Hcjs.WithdrawModalInner,
24
24
  {
25
25
  ...props,
26
26
  reownWallet: reown,
@@ -20,7 +20,7 @@ import {
20
20
  loadSessionOwnerFromStorage,
21
21
  saveSessionOwnerToStorage,
22
22
  toEvmCaip2
23
- } from "./chunk-JQTV5JTB.mjs";
23
+ } from "./chunk-7TTEHQBD.mjs";
24
24
  import {
25
25
  DEFAULT_BACKEND_URL,
26
26
  DEFAULT_SIGNER_ADDRESS,
@@ -1453,7 +1453,7 @@ function WithdrawFlow({
1453
1453
  // src/WithdrawModal.tsx
1454
1454
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1455
1455
  var ReownWithdrawInner = lazy(
1456
- () => import("./WithdrawModalReown-K57JK52O.mjs").then((m) => ({
1456
+ () => import("./WithdrawModalReown-PFGUPZFN.mjs").then((m) => ({
1457
1457
  default: m.WithdrawModalReown
1458
1458
  }))
1459
1459
  );
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
 
23
- var _chunkEAEDK474cjs = require('./chunk-EAEDK474.cjs');
23
+ var _chunkTQ6IIGRScjs = require('./chunk-TQ6IIGRS.cjs');
24
24
 
25
25
 
26
26
 
@@ -141,7 +141,7 @@ function WithdrawFormStep({
141
141
  setIsSwitching(true);
142
142
  switchChain(asset.chainId).catch((err) => {
143
143
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
144
- setError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw));
144
+ setError(_chunkTQ6IIGRScjs.formatUserError.call(void 0, raw));
145
145
  }).finally(() => {
146
146
  setIsSwitching(false);
147
147
  });
@@ -161,7 +161,7 @@ function WithdrawFormStep({
161
161
  return;
162
162
  }
163
163
  try {
164
- const bal = _chunkEAEDK474cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
164
+ const bal = _chunkTQ6IIGRScjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
165
165
  address: asset.token,
166
166
  abi: _viem.erc20Abi,
167
167
  functionName: "balanceOf",
@@ -264,7 +264,7 @@ function WithdrawFormStep({
264
264
  await onSubmit(recipient, amount);
265
265
  } catch (err) {
266
266
  const raw = err instanceof Error ? err.message : "Withdrawal failed";
267
- setError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw));
267
+ setError(_chunkTQ6IIGRScjs.formatUserError.call(void 0, raw));
268
268
  } finally {
269
269
  setIsSubmitting(false);
270
270
  }
@@ -272,11 +272,11 @@ function WithdrawFormStep({
272
272
  if (isBalanceLoading) {
273
273
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
274
274
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
275
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.Spinner, { className: "rs-spinner--lg" }),
275
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.Spinner, { className: "rs-spinner--lg" }),
276
276
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
277
277
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
278
278
  ] }),
279
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
279
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.PoweredBy, {})
280
280
  ] });
281
281
  }
282
282
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
@@ -375,7 +375,7 @@ function WithdrawFormStep({
375
375
  ] })
376
376
  ] }),
377
377
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
378
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkEAEDK474cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
378
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkTQ6IIGRScjs.currencyFormatter.format(amountUsd) : "$0.00" }),
379
379
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
380
380
  "Balance: ",
381
381
  formattedBalance,
@@ -569,7 +569,7 @@ function WithdrawFormStep({
569
569
  ] })
570
570
  ] }),
571
571
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
572
- _chunkEAEDK474cjs.Button,
572
+ _chunkTQ6IIGRScjs.Button,
573
573
  {
574
574
  onClick: handleWithdraw,
575
575
  fullWidth: true,
@@ -578,7 +578,7 @@ function WithdrawFormStep({
578
578
  children: isBusy ? "Preparing..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
579
579
  }
580
580
  ) }),
581
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
581
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.PoweredBy, {})
582
582
  ] });
583
583
  }
584
584
  WithdrawFormStep.displayName = "WithdrawFormStep";
@@ -910,13 +910,13 @@ function WithdrawFlow({
910
910
  const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
911
911
  const logFlow = _react.useCallback.call(void 0,
912
912
  (message, data) => {
913
- _chunkEAEDK474cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
913
+ _chunkTQ6IIGRScjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
914
914
  },
915
915
  [debug]
916
916
  );
917
917
  const logFlowError = _react.useCallback.call(void 0,
918
918
  (message, error, data) => {
919
- _chunkEAEDK474cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
919
+ _chunkTQ6IIGRScjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
920
920
  },
921
921
  [debug]
922
922
  );
@@ -975,14 +975,14 @@ function WithdrawFlow({
975
975
  return {
976
976
  ownerAddress: dappAddress,
977
977
  walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
978
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain))),
978
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTQ6IIGRScjs.getPublicClient.call(void 0, sourceChain))),
979
979
  switchChain: dappSwitchChain
980
980
  };
981
981
  }
982
982
  return {
983
983
  ownerAddress: dappWalletClient.account.address,
984
984
  walletClient: dappWalletClient,
985
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain))),
985
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTQ6IIGRScjs.getPublicClient.call(void 0, sourceChain))),
986
986
  switchChain: dappSwitchChain
987
987
  };
988
988
  }
@@ -993,7 +993,7 @@ function WithdrawFlow({
993
993
  return {
994
994
  ownerAddress: dappWalletClient.account.address,
995
995
  walletClient: dappWalletClient,
996
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain))),
996
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTQ6IIGRScjs.getPublicClient.call(void 0, sourceChain))),
997
997
  switchChain: dappSwitchChain
998
998
  };
999
999
  }
@@ -1023,7 +1023,7 @@ function WithdrawFlow({
1023
1023
  const symbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
1024
1024
  const decimals = _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
1025
1025
  return {
1026
- id: _chunkEAEDK474cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1026
+ id: _chunkTQ6IIGRScjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1027
1027
  chainId: sourceChain,
1028
1028
  token: sourceToken,
1029
1029
  symbol,
@@ -1073,15 +1073,15 @@ function WithdrawFlow({
1073
1073
  [logFlowError, onError]
1074
1074
  );
1075
1075
  const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
1076
- const localOwner = _chunkEAEDK474cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1076
+ const localOwner = _chunkTQ6IIGRScjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1077
1077
  if (localOwner) {
1078
1078
  return {
1079
- account: _chunkEAEDK474cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1079
+ account: _chunkTQ6IIGRScjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1080
1080
  address: localOwner.address
1081
1081
  };
1082
1082
  }
1083
- const created = _chunkEAEDK474cjs.createSessionOwnerKey.call(void 0, );
1084
- _chunkEAEDK474cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1083
+ const created = _chunkTQ6IIGRScjs.createSessionOwnerKey.call(void 0, );
1084
+ _chunkTQ6IIGRScjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1085
1085
  return {
1086
1086
  account: created.account,
1087
1087
  address: created.address
@@ -1111,7 +1111,7 @@ function WithdrawFlow({
1111
1111
  const setup = await service.setupAccount({
1112
1112
  ownerAddress: ownerAddress2,
1113
1113
  sessionOwnerAddress: sessionOwner.address,
1114
- targetChain: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, targetChain),
1114
+ targetChain: _chunkTQ6IIGRScjs.toEvmCaip2.call(void 0, targetChain),
1115
1115
  targetToken,
1116
1116
  signerAddress,
1117
1117
  sessionChainIds,
@@ -1138,7 +1138,7 @@ function WithdrawFlow({
1138
1138
  primaryType: typedData.primaryType,
1139
1139
  message: typedData.message
1140
1140
  });
1141
- const sessionDetails = _chunkEAEDK474cjs.buildSessionDetails.call(void 0,
1141
+ const sessionDetails = _chunkTQ6IIGRScjs.buildSessionDetails.call(void 0,
1142
1142
  setup.sessionDetailsUnsigned,
1143
1143
  signature
1144
1144
  );
@@ -1152,7 +1152,7 @@ function WithdrawFlow({
1152
1152
  eoaAddress: ownerAddress2,
1153
1153
  sessionOwner: sessionOwner.address,
1154
1154
  target: {
1155
- chain: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, targetChain),
1155
+ chain: _chunkTQ6IIGRScjs.toEvmCaip2.call(void 0, targetChain),
1156
1156
  token: targetToken,
1157
1157
  recipient
1158
1158
  }
@@ -1161,7 +1161,7 @@ function WithdrawFlow({
1161
1161
  }
1162
1162
  handleConnected(ownerAddress2, smartAccount);
1163
1163
  const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
1164
- const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _26 => _26.publicClient]), () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain)));
1164
+ const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _26 => _26.publicClient]), () => ( _chunkTQ6IIGRScjs.getPublicClient.call(void 0, sourceChain)));
1165
1165
  let result;
1166
1166
  if (onSignTransaction) {
1167
1167
  const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
@@ -1184,7 +1184,7 @@ function WithdrawFlow({
1184
1184
  const { signature } = await onSignTransaction(request);
1185
1185
  const relayResult = await service.relayWithdraw({
1186
1186
  smartAccount,
1187
- chainId: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, sourceChain),
1187
+ chainId: _chunkTQ6IIGRScjs.toEvmCaip2.call(void 0, sourceChain),
1188
1188
  safeAddress,
1189
1189
  safeTransaction: request.typedData.message,
1190
1190
  signature
@@ -1242,7 +1242,7 @@ function WithdrawFlow({
1242
1242
  targetChain,
1243
1243
  targetToken
1244
1244
  });
1245
- handleError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1245
+ handleError(_chunkTQ6IIGRScjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1246
1246
  throw err;
1247
1247
  } finally {
1248
1248
  setIsSubmitting(false);
@@ -1377,7 +1377,7 @@ function WithdrawFlow({
1377
1377
  }, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _41 => _41.icon])]);
1378
1378
  if (showConnectStep) {
1379
1379
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1380
- _chunkEAEDK474cjs.ConnectStep,
1380
+ _chunkTQ6IIGRScjs.ConnectStep,
1381
1381
  {
1382
1382
  walletOptions,
1383
1383
  selectedWalletId: selectedWalletIdEffective,
@@ -1400,7 +1400,7 @@ function WithdrawFlow({
1400
1400
  const resolvedOwnerAddress = signerContext.ownerAddress;
1401
1401
  const resolvedConnectedAddress = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _42 => _42.walletClient, 'optionalAccess', _43 => _43.account, 'optionalAccess', _44 => _44.address]), () => ( _optionalChain([reownWallet, 'optionalAccess', _45 => _45.address]))), () => ( _optionalChain([dappWalletClient, 'optionalAccess', _46 => _46.account, 'optionalAccess', _47 => _47.address]))), () => ( resolvedOwnerAddress));
1402
1402
  const resolvedDefaultRecipient = _nullishCoalesce(defaultRecipient, () => ( resolvedConnectedAddress));
1403
- const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain)));
1403
+ const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkTQ6IIGRScjs.getPublicClient.call(void 0, sourceChain)));
1404
1404
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
1405
1405
  step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1406
1406
  WithdrawFormStep,
@@ -1427,7 +1427,7 @@ function WithdrawFlow({
1427
1427
  }
1428
1428
  ),
1429
1429
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1430
- _chunkEAEDK474cjs.ProcessingStep,
1430
+ _chunkTQ6IIGRScjs.ProcessingStep,
1431
1431
  {
1432
1432
  smartAccount: step.smartAccount,
1433
1433
  txHash: step.txHash,
@@ -1453,7 +1453,7 @@ function WithdrawFlow({
1453
1453
  // src/WithdrawModal.tsx
1454
1454
 
1455
1455
  var ReownWithdrawInner = _react.lazy.call(void 0,
1456
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-CN2NJUYL.cjs"))).then((m) => ({
1456
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-TUBSUJQ6.cjs"))).then((m) => ({
1457
1457
  default: m.WithdrawModalReown
1458
1458
  }))
1459
1459
  );
@@ -1511,12 +1511,12 @@ function WithdrawModalInner({
1511
1511
  const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
1512
1512
  const sourceChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp);
1513
1513
  const service = _react.useMemo.call(void 0,
1514
- () => _chunkEAEDK474cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1514
+ () => _chunkTQ6IIGRScjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1515
1515
  [backendUrl, debug]
1516
1516
  );
1517
1517
  _react.useEffect.call(void 0, () => {
1518
1518
  if (isOpen && modalRef.current) {
1519
- _chunkEAEDK474cjs.applyTheme.call(void 0, modalRef.current, theme);
1519
+ _chunkTQ6IIGRScjs.applyTheme.call(void 0, modalRef.current, theme);
1520
1520
  }
1521
1521
  }, [isOpen, theme]);
1522
1522
  const hasCalledReady = _react.useRef.call(void 0, false);
@@ -1552,7 +1552,7 @@ function WithdrawModalInner({
1552
1552
  const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _56 => _56.title]), () => ( "Withdraw"));
1553
1553
  const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
1554
1554
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1555
- _chunkEAEDK474cjs.Modal,
1555
+ _chunkTQ6IIGRScjs.Modal,
1556
1556
  {
1557
1557
  isOpen,
1558
1558
  onClose,
@@ -1611,7 +1611,7 @@ function WithdrawModalInner({
1611
1611
  ] }),
1612
1612
  balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
1613
1613
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
1614
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkEAEDK474cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
1614
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkTQ6IIGRScjs.currencyFormatter.format(totalBalanceUsd) : null))) })
1615
1615
  ] })
1616
1616
  ] }),
1617
1617
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -810,45 +810,57 @@ function formatUserError(raw) {
810
810
  }
811
811
 
812
812
  // src/core/theme.ts
813
- var RADIUS_VALUES = {
814
- none: "0",
815
- sm: "8px",
816
- md: "10px",
817
- lg: "14px",
818
- full: "9999px"
813
+ var RADIUS_SCALE = {
814
+ none: { sm: "0", md: "0", lg: "0" },
815
+ sm: { sm: "4px", md: "6px", lg: "8px" },
816
+ md: { sm: "8px", md: "10px", lg: "14px" },
817
+ lg: { sm: "10px", md: "14px", lg: "18px" },
818
+ full: { sm: "9999px", md: "9999px", lg: "9999px" }
819
819
  };
820
+ function setVar(targets, prop, value) {
821
+ for (const el of targets) {
822
+ el.style.setProperty(prop, value);
823
+ }
824
+ }
820
825
  function applyTheme(element, theme) {
821
826
  if (!element) return;
827
+ const parent = element.parentElement;
828
+ const targets = parent?.classList.contains("rs-modal-content") ? [element, parent] : [element];
822
829
  if (theme?.mode) {
823
830
  element.setAttribute("data-theme", theme.mode);
824
831
  } else {
825
832
  element.removeAttribute("data-theme");
826
833
  }
827
834
  if (theme?.fontColor) {
828
- element.style.setProperty("--rs-foreground", theme.fontColor);
835
+ setVar(targets, "--rs-foreground", theme.fontColor);
829
836
  }
830
837
  if (theme?.iconColor) {
831
- element.style.setProperty("--rs-icon", theme.iconColor);
838
+ setVar(targets, "--rs-icon", theme.iconColor);
832
839
  }
833
840
  if (theme?.ctaColor) {
834
- element.style.setProperty("--rs-primary", theme.ctaColor);
835
- element.style.setProperty("--rs-border-accent", theme.ctaColor);
836
- element.style.setProperty(
841
+ setVar(targets, "--rs-primary", theme.ctaColor);
842
+ setVar(targets, "--rs-border-accent", theme.ctaColor);
843
+ setVar(
844
+ targets,
837
845
  "--rs-primary-hover",
838
846
  theme.ctaHoverColor ?? theme.ctaColor
839
847
  );
840
848
  } else if (theme?.ctaHoverColor) {
841
- element.style.setProperty("--rs-primary-hover", theme.ctaHoverColor);
849
+ setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
842
850
  }
843
851
  if (theme?.borderColor) {
844
- element.style.setProperty("--rs-border", theme.borderColor);
845
- element.style.setProperty("--rs-border-surface", theme.borderColor);
852
+ setVar(targets, "--rs-border", theme.borderColor);
853
+ setVar(targets, "--rs-border-surface", theme.borderColor);
846
854
  }
847
855
  if (theme?.backgroundColor) {
848
- element.style.setProperty("--rs-background", theme.backgroundColor);
856
+ setVar(targets, "--rs-background", theme.backgroundColor);
849
857
  }
850
858
  if (theme?.radius) {
851
- element.style.setProperty("--rs-radius", RADIUS_VALUES[theme.radius]);
859
+ const scale = RADIUS_SCALE[theme.radius];
860
+ setVar(targets, "--rs-radius-sm", scale.sm);
861
+ setVar(targets, "--rs-radius-md", scale.md);
862
+ setVar(targets, "--rs-radius-lg", scale.lg);
863
+ setVar(targets, "--rs-radius", scale.md);
852
864
  }
853
865
  }
854
866