Skip to content

feat(widget): add redesigned amount input cards for jumper modes#776

Draft
effie-ms wants to merge 4 commits into
feat/header-tabs-storefrom
feat/amount-input-cards
Draft

feat(widget): add redesigned amount input cards for jumper modes#776
effie-ms wants to merge 4 commits into
feat/header-tabs-storefrom
feat/amount-input-cards

Conversation

@effie-ms

@effie-ms effie-ms commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Which Linear task is linked to this PR?

EMB-452

Why was it implemented this way?

This adds a redesigned amount input as Send/Receive cards, rendered exclusively in the jumper widget variant (across its simple and advanced view tiers). All other variants (compact, wide, drawer) continue using the existing SelectChainAndToken + AmountInput unchanged, so the redesign is fully scoped to the jumper variant and carries no regression risk for existing integrators.

  • Send card (SendAmountCard): large editable input with adaptive font sizing, token pill selector, percentage chips (25/50/75/Max), fiat/token toggle, and wallet balance display. Percentage chips are shown only when a wallet is connected.
  • Receive card (ReceiveAmountCard): read-only amount from the best route with fiat/token toggle and token pill selector. The amount is formatted with the same numberExt precision as the route cards, and the footer shows the route's price impact (computed via getPriceImpact, identical to RouteDetails) with an info tooltip. Both footer values and the amount fall back to skeletons while routes are fetching.
  • Token pill (TokenPillButton): the selected state is a neutral chip-style pill matching the percentage pills; the empty state is derived from the app's primary Button, so its background/hover/disabled treatment stays in sync with the theme.
  • Swap button (SwapButton): vertical swap arrow between the cards (hidden when the active tab is in refuel mode), replicating ReverseTokensButton logic rather than duplicating it.
  • Per-tab variant: JumperTab gains an optional variant (JumperTabVariant = wide | compact) so each jumper tab can declare its layout; useWideVariant now resolves the wide layout from the active jumper tab's variant when in the jumper variant.
  • The cards are composed via AmountInputCardPair and rendered conditionally from MainPage for the jumper variant, keeping the existing layout path untouched for other variants.

New components

  • AmountInputCard/SendAmountCard, ReceiveAmountCard, AmountInputCardPair, PercentageChips, BalanceDisplay, FiatValueToggle, shared styles
  • SwapButton/ — swap arrow with overlapping card design
  • TokenPillButton/ — compact pill-shaped token selector (chip-style when selected, primary-button call to action when empty)

Builds on the Jumper variant / HeaderTabsStore work in #775 (EMB-451); this branch is based on feat/header-tabs-store.

Visual showcase (Screenshots or Videos)

TODO: add screenshots/GIFs of Send & Receive cards in the jumper variant — simple and advanced tiers (light + dark mode).

Test plan

  • Visual check in playground with the jumper variant, simple tier — switch all tabs (Swap & Bridge, Private, Gas)
  • Visual check in playground with the jumper variant, advanced tier — switch all tabs (Swap, Bridge, Limit)
  • Token selection via pill button navigates to picker and displays selected token
  • Selected token pill matches the percentage-pill style; empty "Select" pill matches the primary button
  • Swap button reverses from/to tokens; hidden on Gas tab
  • Percentage chips set correct amounts with gas deduction on native tokens
  • Percentage chips are hidden when no wallet is connected
  • Receive card price impact matches the route card value, with a working info tooltip
  • Receive amount and footer values show skeletons while routes are fetching
  • Fiat/token toggle works on both Send and Receive cards
  • Large numbers auto-scale font size without changing card height
  • Per-tab variant drives the wide/compact layout per jumper tab
  • Other variants (compact, wide, drawer) render unchanged
  • Dark mode renders correctly

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Widget API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

@effie-ms effie-ms marked this pull request as draft June 11, 2026 11:39
@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 74478ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@effie-ms effie-ms self-assigned this Jun 15, 2026
@effie-ms effie-ms force-pushed the feat/amount-input-cards branch from 53fa01e to 9f97fb1 Compare June 17, 2026 11:22
<AmountInput formType="from" sx={marginSx} />
) : null}
{isJumper ? (
<AmountInputCardPair sx={marginSx} />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD: do we use new inputs cards only for Jumper tiers or everywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant