@rhinestone/deposit-modal 0.8.1 → 0.9.0

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.
Files changed (65) hide show
  1. package/README.md +193 -29
  2. package/dist/{chunk-2JPB3PLB.mjs → DepositModalReown-6KUAO5ZC.mjs} +56 -4
  3. package/dist/{chunk-Q3W53BKR.cjs → DepositModalReown-XC5RIU7Z.cjs} +62 -10
  4. package/dist/{caip-C_ZYFIGa.d.cts → caip-523Zrc3r.d.cts} +1 -3
  5. package/dist/{caip-C_ZYFIGa.d.ts → caip-523Zrc3r.d.ts} +1 -3
  6. package/dist/{chunk-D3Y7ZBED.cjs → chunk-22RV33LK.cjs} +2170 -1460
  7. package/dist/chunk-4WB2FHGC.mjs +865 -0
  8. package/dist/chunk-A223BLVC.mjs +801 -0
  9. package/dist/{chunk-HQWZCOMS.cjs → chunk-DIX7M3SP.cjs} +232 -601
  10. package/dist/{chunk-T43VUEJH.mjs → chunk-E4G5BOZP.mjs} +167 -536
  11. package/dist/chunk-H577RJN5.cjs +801 -0
  12. package/dist/{chunk-DABKCJVL.mjs → chunk-ILT2PITN.mjs} +60 -3
  13. package/dist/{chunk-7KHEIMWD.mjs → chunk-KKHLNFSA.mjs} +2436 -1726
  14. package/dist/chunk-LGVJWVSS.mjs +81 -0
  15. package/dist/chunk-NEXUCY4B.cjs +11 -0
  16. package/dist/chunk-NMIMRASD.cjs +1785 -0
  17. package/dist/chunk-OSI2CFGL.mjs +11 -0
  18. package/dist/chunk-PAGMU4RQ.cjs +865 -0
  19. package/dist/chunk-T7LGQFP3.cjs +81 -0
  20. package/dist/chunk-VN4BLZYC.cjs +2273 -0
  21. package/dist/chunk-VOGZAZB2.mjs +2273 -0
  22. package/dist/chunk-WYXBY2MQ.mjs +1785 -0
  23. package/dist/{chunk-4NN7UTWQ.cjs → chunk-YEBXUUH3.cjs} +63 -6
  24. package/dist/claim.cjs +10 -0
  25. package/dist/claim.d.cts +8 -0
  26. package/dist/claim.d.ts +8 -0
  27. package/dist/claim.mjs +10 -0
  28. package/dist/constants.cjs +3 -3
  29. package/dist/constants.d.cts +4 -2
  30. package/dist/constants.d.ts +4 -2
  31. package/dist/constants.mjs +5 -5
  32. package/dist/deposit.cjs +8 -6
  33. package/dist/deposit.d.cts +2 -2
  34. package/dist/deposit.d.ts +2 -2
  35. package/dist/deposit.mjs +7 -5
  36. package/dist/index.cjs +22 -12
  37. package/dist/index.d.cts +15 -2
  38. package/dist/index.d.ts +15 -2
  39. package/dist/index.mjs +21 -11
  40. package/dist/polymarket.cjs +5 -6
  41. package/dist/polymarket.mjs +2 -3
  42. package/dist/server.cjs +96 -0
  43. package/dist/server.d.cts +65 -0
  44. package/dist/server.d.ts +65 -0
  45. package/dist/server.mjs +96 -0
  46. package/dist/styles.css +263 -12
  47. package/dist/types-C0SGf-21.d.cts +606 -0
  48. package/dist/types-C0SGf-21.d.ts +606 -0
  49. package/dist/withdraw.cjs +6 -5
  50. package/dist/withdraw.d.cts +3 -6
  51. package/dist/withdraw.d.ts +3 -6
  52. package/dist/withdraw.mjs +5 -4
  53. package/package.json +53 -6
  54. package/dist/DepositModalReown-4BSHOQ5Y.mjs +0 -63
  55. package/dist/DepositModalReown-UND3DEJH.cjs +0 -63
  56. package/dist/WithdrawModalReown-FVXSSGY5.mjs +0 -46
  57. package/dist/WithdrawModalReown-TVZWJKQI.cjs +0 -46
  58. package/dist/chunk-7OKA6GNA.cjs +0 -4537
  59. package/dist/chunk-NASHLEVQ.mjs +0 -4537
  60. package/dist/chunk-O5OKA27M.mjs +0 -800
  61. package/dist/chunk-U7SVYWVD.cjs +0 -800
  62. package/dist/chunk-WK5AFRSP.mjs +0 -295
  63. package/dist/chunk-XRWQMIBY.cjs +0 -295
  64. package/dist/types--LQWg_4W.d.cts +0 -468
  65. package/dist/types--LQWg_4W.d.ts +0 -468
package/dist/styles.css CHANGED
@@ -327,7 +327,12 @@
327
327
  the previous step's height instead of jumping. Min-height is on
328
328
  modal-content rather than modal-body so the transitioned property
329
329
  lives on an element that survives step swaps. */
330
- min-height 280ms cubic-bezier(0.22, 1, 0.36, 1);
330
+ min-height 280ms cubic-bezier(0.22, 1, 0.36, 1),
331
+ /* The Swapped iframe phase raises the shell corner to the widget's 28px
332
+ (see the sizing rules at the bottom of this file); animate it on the same
333
+ curve as max-width/min-height so the corner doesn't pop while the modal
334
+ is still resizing into the iframe. */
335
+ border-radius 240ms cubic-bezier(0.22, 1, 0.36, 1);
331
336
  }
332
337
 
333
338
  .rs-modal-content[data-theme="dark"] {
@@ -557,6 +562,19 @@
557
562
  gap: 6px;
558
563
  }
559
564
 
565
+ /* Chrome/Safari paint their own autofill background with !important UA
566
+ styles. Clip that paint to the glyphs so every themed input keeps its real
567
+ surface — including the transparent withdrawal inputs — without replacing
568
+ the focus/error box-shadows. The standard pseudo-class and WebKit alias are
569
+ both kept for current and older browser engines. */
570
+ .rs-modal
571
+ :is(.rs-input, .rs-withdraw-input):is(:autofill, :-webkit-autofill) {
572
+ -webkit-background-clip: text;
573
+ background-clip: text;
574
+ -webkit-text-fill-color: var(--rs-foreground);
575
+ caret-color: var(--rs-foreground);
576
+ }
577
+
560
578
  .rs-input-label {
561
579
  font-size: 13px;
562
580
  color: var(--rs-muted);
@@ -2555,7 +2573,8 @@
2555
2573
  the image is loading (`data-loading`), show a muted pulsing placeholder so the
2556
2574
  first paint isn't a blank/broken-image flash; it inherits the caller's size
2557
2575
  and border-radius, so there's no layout shift when the icon paints in. */
2558
- .rs-token-icon[data-loading] {
2576
+ .rs-token-icon[data-loading],
2577
+ .rs-cdn-icon[data-loading] {
2559
2578
  background-color: var(--rs-muted);
2560
2579
  animation: rs-token-icon-pulse 1.2s ease-in-out infinite;
2561
2580
  }
@@ -2571,7 +2590,8 @@
2571
2590
  }
2572
2591
 
2573
2592
  @media (prefers-reduced-motion: reduce) {
2574
- .rs-token-icon[data-loading] {
2593
+ .rs-token-icon[data-loading],
2594
+ .rs-cdn-icon[data-loading] {
2575
2595
  animation: none;
2576
2596
  }
2577
2597
  }
@@ -4867,6 +4887,53 @@
4867
4887
  object-fit: cover;
4868
4888
  }
4869
4889
 
4890
+ /* Provider-hosted fiat method icons (regional methods: GCash, Maya, PIX, …).
4891
+ When a dark-background variant is supplied, the theme toggles which img
4892
+ shows; otherwise the single (light) icon shows in both themes. */
4893
+ .rs-fiat-remote-icon {
4894
+ display: inline-flex;
4895
+ align-items: center;
4896
+ justify-content: center;
4897
+ width: 24px;
4898
+ height: 24px;
4899
+ }
4900
+
4901
+ .rs-fiat-remote-icon img {
4902
+ width: 24px;
4903
+ height: 24px;
4904
+ object-fit: contain;
4905
+ }
4906
+
4907
+ .rs-fiat-remote-icon-dark {
4908
+ display: none;
4909
+ }
4910
+
4911
+ .rs-modal[data-theme="dark"] .rs-fiat-remote-icon--has-dark .rs-fiat-remote-icon-light {
4912
+ display: none;
4913
+ }
4914
+
4915
+ .rs-modal[data-theme="dark"] .rs-fiat-remote-icon--has-dark .rs-fiat-remote-icon-dark {
4916
+ display: inline-block;
4917
+ }
4918
+
4919
+ /* Sits in the row's meta slot, so no inline-with-the-label wrapper is needed —
4920
+ `.rs-list-row-title` already handles its own truncation. */
4921
+ .rs-fiat-method-badge {
4922
+ flex-shrink: 0;
4923
+ padding: 2px 6px;
4924
+ border-radius: 999px;
4925
+ background: #a4f4cf;
4926
+ color: #004f3b;
4927
+ font-size: 11px;
4928
+ font-weight: 600;
4929
+ line-height: 1.2;
4930
+ }
4931
+
4932
+ .rs-modal[data-theme="dark"] .rs-fiat-method-badge {
4933
+ background: #006045;
4934
+ color: #d0fae5;
4935
+ }
4936
+
4870
4937
  .rs-list-row-body {
4871
4938
  flex: 1;
4872
4939
  min-width: 0;
@@ -4949,6 +5016,18 @@
4949
5016
  border-radius: 4px;
4950
5017
  }
4951
5018
 
5019
+ /* Chain with no bundled icon: short-label chip inside the badge circle. */
5020
+ .rs-chain-badge-fallback {
5021
+ display: inline-flex;
5022
+ width: 100%;
5023
+ height: 100%;
5024
+ align-items: center;
5025
+ justify-content: center;
5026
+ font-size: 9px;
5027
+ font-weight: 600;
5028
+ line-height: 1;
5029
+ }
5030
+
4952
5031
  /* Card-network chips: exported Figma tiles are all 38×24. */
4953
5032
  .rs-list-row-meta-icons--cards > .rs-card-network {
4954
5033
  position: relative;
@@ -4970,7 +5049,10 @@
4970
5049
  }
4971
5050
 
4972
5051
  .rs-list-row-meta-icons--cards > .rs-card-network + .rs-card-network {
4973
- margin-left: -7px;
5052
+ /* Cards paint in source order, so Mastercard (last) sits on top and Amex
5053
+ (first) beneath. Amex's mark is right-aligned, so this overlap is kept
5054
+ gentle — a larger one would tuck Amex's "EX" under Visa. */
5055
+ margin-left: -3px;
4974
5056
  }
4975
5057
 
4976
5058
  .rs-list-row-meta-icons--cards .rs-card-network svg {
@@ -5065,8 +5147,8 @@
5065
5147
  }
5066
5148
 
5067
5149
  /* The iframe phase owns the whole modal width. Normal screens keep the
5068
- 16px body inset, but Swapped now provides its own in-iframe back chrome so
5069
- the embedded sheet should not look like a padded card inside our modal. */
5150
+ 16px body inset, but the embedded sheet should not look like a padded card
5151
+ inside our modal. */
5070
5152
  .rs-modal-body[data-flow-mode="fiat-onramp"]:has(.rs-fiat-onramp),
5071
5153
  .rs-modal-body[data-flow-mode="exchange-connect"]:has(.rs-fiat-onramp) {
5072
5154
  padding-inline: 0;
@@ -5088,7 +5170,9 @@
5088
5170
  width: 100%;
5089
5171
  min-height: 586px;
5090
5172
  margin: 0;
5091
- border-radius: 0;
5173
+ /* Matches the iframe's 28px below so the loading / error overlays that sit
5174
+ on top of it share the same corner arc. */
5175
+ border-radius: 28px;
5092
5176
  overflow: hidden;
5093
5177
  }
5094
5178
 
@@ -5096,13 +5180,45 @@
5096
5180
  min-height: 585px;
5097
5181
  }
5098
5182
 
5183
+ /* Swapped paints its widget as a card with a 28px corner radius and its drop
5184
+ shadow sits just outside that arc, so the embedding iframe has to clip at the
5185
+ same 28px — otherwise the shadow's corners bleed out past the card and read as
5186
+ grey smudges in our modal corners. Confirmed with Swapped: their iframe-
5187
+ initialization docs still show a stale `border-radius: 0.75rem`, 28px is the
5188
+ value that matches the current widget. */
5099
5189
  .rs-fiat-onramp-iframe {
5100
5190
  display: block;
5101
5191
  width: 100%;
5102
5192
  height: 586px;
5103
5193
  min-height: 586px;
5104
5194
  border: 0;
5195
+ border-radius: 28px;
5105
5196
  background: var(--rs-background);
5197
+ /* Swapped's widget paints its own page background behind a rounded card, and
5198
+ that card is rounder than our modal. Where their radius exceeds ours the
5199
+ modal's corner clip doesn't reach their page background, so a grey wedge
5200
+ shows in each corner (visible on their payment-method screen). Clipping the
5201
+ iframe at a radius at least as round as their card puts the modal's own
5202
+ background there instead.
5203
+ ponytail: one blunt radius rather than tracking Swapped's per-screen shape
5204
+ — if they round their card past this, raise it. */
5205
+ border-radius: 28px;
5206
+ /* Swapped's embedded widget has no theme URL param and follows
5207
+ `prefers-color-scheme`. Setting `color-scheme` on the iframe element
5208
+ propagates into its (cross-origin) document's `prefers-color-scheme`, so
5209
+ we pin it to the modal's theme — a light modal renders a light widget and
5210
+ a dark modal a dark one — instead of following the visitor's OS setting.
5211
+ This base rule forces light; because it wins over the `color-scheme: dark`
5212
+ inherited from `.rs-modal[data-theme="dark"]`, the dark override below is
5213
+ required to re-assert dark. NOTE: this only takes effect because
5214
+ SwappedIframeStep assigns the iframe `src` one commit after mount — the
5215
+ widget reads prefers-color-scheme at its first navigation, which must
5216
+ happen after this rule is resolved on the element. */
5217
+ color-scheme: light;
5218
+ }
5219
+
5220
+ .rs-modal[data-theme="dark"] .rs-fiat-onramp-iframe {
5221
+ color-scheme: dark;
5106
5222
  }
5107
5223
 
5108
5224
  .rs-fiat-onramp[data-variant="connect"] .rs-fiat-onramp-iframe {
@@ -5110,6 +5226,15 @@
5110
5226
  min-height: 585px;
5111
5227
  }
5112
5228
 
5229
+ /* Connect sits below our header (only fiat is immersive), so only its bottom
5230
+ corners meet the modal's rounded edge. Rounding the top too would leave the
5231
+ shell background showing through as light notches under the header. Applies to
5232
+ the wrap as well so the loading / error overlays share the same arc. */
5233
+ .rs-fiat-onramp[data-variant="connect"] .rs-fiat-onramp-iframe-wrap,
5234
+ .rs-fiat-onramp[data-variant="connect"] .rs-fiat-onramp-iframe {
5235
+ border-radius: 0 0 28px 28px;
5236
+ }
5237
+
5113
5238
  /* Finalising deposit — compact centered spinner screen (Swapped Connect). */
5114
5239
  .rs-finalising-body {
5115
5240
  display: flex;
@@ -5306,6 +5431,16 @@
5306
5431
  line-height: 1.35;
5307
5432
  }
5308
5433
 
5434
+ /* Pre-deposit "Exchange Fee" disclosure shown below the picker footer. */
5435
+ .rs-exchange-select-fee-note {
5436
+ font-size: 12px;
5437
+ font-weight: 500;
5438
+ line-height: 1.35;
5439
+ color: var(--rs-muted);
5440
+ text-align: center;
5441
+ margin: 0;
5442
+ }
5443
+
5309
5444
  /* =============================================================================
5310
5445
  Modal sizing for the Swapped iframe step
5311
5446
  =============================================================================
@@ -5349,16 +5484,32 @@
5349
5484
  min-height: 698px;
5350
5485
  }
5351
5486
 
5352
- /* Iframe phase: with no header/footer chrome the modal is sized to the
5353
- embedded iframe exactly (586 fiat / 585 connect) so it fills the modal with
5354
- no whitespace below. The taller setup values above pre-reserve the space
5355
- before SwappedIframeStep mounts. */
5487
+ /* Iframe phase: fiat is immersive (no header/footer chrome), so the modal is
5488
+ sized to the embedded iframe exactly — 586 — and fills top-to-bottom with no
5489
+ whitespace. The taller setup values above pre-reserve the space before
5490
+ SwappedIframeStep mounts. */
5356
5491
  .rs-modal-content:has(.rs-modal-body[data-flow-mode="fiat-onramp"] .rs-fiat-onramp) {
5357
5492
  min-height: 586px;
5358
5493
  }
5359
5494
 
5495
+ /* Connect keeps our header, so its exact height is the sum of the chrome above
5496
+ the widget: 16px top inset + 24px header row + 16px gap + 585px iframe + 2px
5497
+ borders (border-box). Matching it here means the setup → iframe hand-off
5498
+ settles on one height instead of overshooting and snapping back. */
5360
5499
  .rs-modal-content:has(.rs-modal-body[data-flow-mode="exchange-connect"] .rs-fiat-onramp) {
5361
- min-height: 585px;
5500
+ min-height: 643px;
5501
+ }
5502
+
5503
+ /* In the iframe phase the Swapped widget owns the modal's bottom edge (fiat owns
5504
+ all four corners; Connect owns the bottom two, under our header), so the shell
5505
+ corner takes the widget's 28px instead of our default 16px. Left at 16px, our
5506
+ border would trace a tighter arc than the widget inside it and those corners
5507
+ would show a sliver of modal background between the two curves — plus the
5508
+ widget's own drop shadow. Kept uniform so the shell stays one shape, and
5509
+ scoped to this phase only — every other screen keeps 16px. */
5510
+ .rs-modal-content:has(.rs-modal-body[data-flow-mode="fiat-onramp"] .rs-fiat-onramp),
5511
+ .rs-modal-content:has(.rs-modal-body[data-flow-mode="exchange-connect"] .rs-fiat-onramp) {
5512
+ border-radius: 28px;
5362
5513
  }
5363
5514
 
5364
5515
  /* =============================================================================
@@ -5565,3 +5716,103 @@
5565
5716
  border-color: #fafafa;
5566
5717
  color: #18181b;
5567
5718
  }
5719
+
5720
+ /* =============================================================================
5721
+ Mobile bottom sheet (<= 639px)
5722
+ =============================================================================
5723
+ Below the 640px breakpoint the modal docks to the bottom of the viewport and
5724
+ slides up as a full-width sheet — matching the 1auth dialog (bottom sheet on
5725
+ mobile, centered card on desktop). Everything here is scoped under
5726
+ `.rs-modal-overlay` so inline mode (`.rs-modal-content--inline`, which has no
5727
+ overlay ancestor) is untouched, and desktop (>= 640px) keeps the centered
5728
+ card verbatim. */
5729
+ @media (max-width: 639px) {
5730
+ .rs-modal-overlay {
5731
+ /* Dock the sheet to the bottom edge (desktop centers it). */
5732
+ align-items: flex-end;
5733
+ /* Fade the scrim in as the sheet rises. Animating background-color rather
5734
+ than opacity keeps the sheet itself fully opaque while it slides — the
5735
+ overlay is both scrim and flex parent, so an opacity fade would dim the
5736
+ sheet too. */
5737
+ animation: rs-backdrop-fade-in 0.2s ease-out;
5738
+ }
5739
+
5740
+ .rs-modal-overlay .rs-modal-content {
5741
+ width: 100%;
5742
+ max-width: none;
5743
+ margin: 0;
5744
+ /* Top corners only; the bottom sits flush against the viewport edge. */
5745
+ border-radius: 16px 16px 0 0;
5746
+ /* Cap below full height so a strip of scrim shows above the sheet (the
5747
+ bottom-sheet "peek"); taller content scrolls inside .rs-modal-body. */
5748
+ max-height: min(92dvh, calc(100dvh - 24px));
5749
+ /* Slide up from below the fold — iOS-sheet easing, matching 1auth's
5750
+ dialog-slide-up. When it ends the content rests at its --open transform
5751
+ (scale(1) == identity), so the settled position is unchanged. */
5752
+ animation: rs-sheet-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
5753
+ }
5754
+
5755
+ /* Swapped/fiat/exchange flows pre-reserve a tall desktop iframe height
5756
+ (min-height 585-699px), a 445px max-width, and a 28px shell radius. On a
5757
+ phone that would force the sheet taller than the screen and round its
5758
+ bottom corners away from the viewport edge, so restore the bottom-sheet
5759
+ dimensions and top-only radius. Specificity (0,4,0) matches the iframe
5760
+ phase :has() rules and, appended last, wins the tie. */
5761
+ .rs-modal-overlay .rs-modal-content:has(.rs-modal-body[data-flow-mode="fiat-onramp"]),
5762
+ .rs-modal-overlay .rs-modal-content:has(.rs-modal-body[data-flow-mode="exchange-connect"]) {
5763
+ max-width: none;
5764
+ min-height: 0;
5765
+ max-height: min(92dvh, calc(100dvh - 24px));
5766
+ border-radius: 16px 16px 0 0;
5767
+ }
5768
+
5769
+ /* The history panel is a long, scrollable list overlaid position:absolute, so
5770
+ it can't grow the sheet itself — left alone the sheet stays as short as the
5771
+ screen behind it and crams the list into a sliver at the bottom. When the
5772
+ panel is mounted, give the sheet a tall min-height so the list uses most of
5773
+ the phone screen. Placed after the fiat/exchange reset above so it wins when
5774
+ history is opened over one of those flows. */
5775
+ .rs-modal-overlay .rs-modal-content:has(.rs-history-panel) {
5776
+ min-height: min(85dvh, calc(100dvh - 24px));
5777
+ }
5778
+
5779
+ /* Clear the iOS home indicator. Excludes the immersive Swapped iframe, which
5780
+ is intentionally full-bleed to the sheet edges. */
5781
+ .rs-modal-overlay .rs-modal:not(.rs-modal--swapped-iframe) {
5782
+ padding-bottom: calc(16px + env(safe-area-inset-bottom));
5783
+ }
5784
+
5785
+ /* iOS Safari zooms the page in when a focused input's font is < 16px. Bump
5786
+ the small text inputs (the deposit amount input is 64px, so it is
5787
+ unaffected) to kill the zoom-on-focus jump. */
5788
+ .rs-modal-overlay .rs-modal .rs-input,
5789
+ .rs-modal-overlay .rs-modal .rs-withdraw-input {
5790
+ font-size: 16px;
5791
+ }
5792
+ }
5793
+
5794
+ @keyframes rs-sheet-slide-up {
5795
+ from {
5796
+ transform: translate3d(0, 100%, 0);
5797
+ }
5798
+ to {
5799
+ transform: translate3d(0, 0, 0);
5800
+ }
5801
+ }
5802
+
5803
+ @keyframes rs-backdrop-fade-in {
5804
+ from {
5805
+ background-color: rgba(0, 0, 0, 0);
5806
+ }
5807
+ to {
5808
+ background-color: rgba(0, 0, 0, 0.5);
5809
+ }
5810
+ }
5811
+
5812
+ /* Honour "Reduce motion": snap the sheet + scrim to their settled state. */
5813
+ @media (prefers-reduced-motion: reduce) {
5814
+ .rs-modal-overlay,
5815
+ .rs-modal-overlay .rs-modal-content {
5816
+ animation: none !important;
5817
+ }
5818
+ }