@pollar/react 0.11.1 → 0.11.3-rc.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/README.md CHANGED
@@ -3,14 +3,20 @@
3
3
  React bindings for [Pollar](https://pollar.xyz) — drop-in authentication UI, transaction modals, and hooks for
4
4
  Stellar and Solana applications.
5
5
 
6
- > **0.11.1** requires `@pollar/core@^0.11.1`. Headline feature: a **network
7
- > picker** (`<ChainSelect>`) across the wallet-balance, enabled-assets, send and
8
- > receive modals - each scopes its rows to the selected chain instead of tagging
9
- > every row, and the filter is local (the backend returns every chain in one
10
- > payload, so switching networks costs no request). Balances now format against
11
- > each token's own `decimals`, and a `null` balance renders as a dash rather than
12
- > as `0`, because `null` means the chain could not be read. The login modal shows
13
- > loading / error state when the app config fails to load. See the
6
+ > **0.11.2** requires `@pollar/core@^0.11.2`. The **Transaction History modal
7
+ > goes multichain**: the same network picker and address chip as the Balance /
8
+ > Send modals, a server-side chain filter (pagination is server-side, so
9
+ > switching networks refetches and resets to page 1), per-chain explorer links
10
+ > (stellar.expert for Stellar, explorer.solana.com for Solana), and the unified
11
+ > `{ amount, unit }` fee, so a Solana row reads "5000 lamports". The picker
12
+ > hides itself on a single-chain app. Non-breaking.
13
+ >
14
+ > Earlier: **0.11.1** added the network picker (`<ChainSelect>`) across the
15
+ > wallet-balance, enabled-assets, send and receive modals - each scopes its rows
16
+ > to the selected chain instead of tagging every row, with a local filter (the
17
+ > backend returns every chain in one payload). Balances format against each
18
+ > token's own `decimals`, and a `null` balance renders as a dash rather than as
19
+ > `0`, because `null` means the chain could not be read. See the
14
20
  > [CHANGELOG](../../CHANGELOG.md) and [UPGRADE.md](../../UPGRADE.md) for the full
15
21
  > version history before upgrading.
16
22
 
@@ -97,11 +103,11 @@ Context provider that initialises the Pollar client and makes it available to ch
97
103
  </PollarProvider>
98
104
  ```
99
105
 
100
- | Prop | Type | Required | Description |
101
- | ----------- | ------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102
- | `client` | `PollarClient \| PollarClientConfig` | Yes | Either a pre-built `PollarClient` (testing, reuse outside React) or a `PollarClientConfig` the provider will construct one from. **Locked at first render** — swapping after mount is ignored |
103
- | `appConfig` | `PollarConfig` | No | Local override of `/applications/config`. **Presence is the opt-out switch**: pass it (even `{}`) and the remote fetch is skipped. Omit it to keep the existing remote-fetch-on-mount behaviour |
104
- | `adapters` | `PollarAdapters` | No | Named set of `PollarAdapter` objects (e.g. Trustless Work). See below |
106
+ | Prop | Type | Required | Description |
107
+ | ----------- | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
108
+ | `client` | `PollarClient \| PollarClientConfig` | Yes | Either a pre-built `PollarClient` (testing, reuse outside React) or a `PollarClientConfig` the provider will construct one from. **Locked at first render** — swapping after mount is ignored |
109
+ | `appConfig` | `PollarConfig` | No | Local override of `/applications/config`. **Presence is the opt-out switch**: pass it (even `{}`) and the remote fetch is skipped. Omit it to keep the existing remote-fetch-on-mount behaviour. Unlike `client`, it can be added or swapped after mount — the context re-applies it (compared by value, so an inline object literal is fine) |
110
+ | `adapters` | `PollarAdapters` | No | Named set of `PollarAdapter` objects (e.g. Trustless Work). See below |
105
111
 
106
112
  ---
107
113
 
@@ -296,7 +302,7 @@ already wired inside `<PollarProvider>` — and most are exported in case you wa
296
302
  | `<SwapModal>` | On-chain asset-to-asset swap: pick from/to assets and amount, quote across venues, execute (auto-trustline on the buy asset when needed); paste a custom buy token (code + issuer) |
297
303
  | `<EarnModal>` | Deposit/withdraw across DeFindex vaults and Blend pools: provider + opportunity selection with live APY, wallet balance, over-spend guards, and auto-trustline on deposit |
298
304
  | `<ReceiveModal>` | Wallet address as QR code with copy-to-clipboard (no external QR dependency required) |
299
- | `<TxHistoryModal>` | Paginated transaction history with auto-fetch on open and stellar.expert explorer links |
305
+ | `<TxHistoryModal>` | Paginated multichain transaction history with auto-fetch on open. A `<ChainSelect>` in the header filters server-side (switching networks refetches and resets to page 1); rows link to their own chain's explorer (stellar.expert for Stellar, explorer.solana.com for Solana) and show the unified `{ amount, unit }` fee |
300
306
  | `<WalletBalanceModal>` | Multichain wallet balances (Stellar, Polygon, Solana). A `<ChainSelect>` in the header picks the network and the rows are filtered to it; shows that chain's address plus a refresh button. An unreadable chain's balance renders as a dash, never as `0`. On Solana testnet each row offers a faucet hint — a devnet SOL faucet on the native row, Circle's USDC faucet on the USDC row |
301
307
  | `<EnabledAssetsModal>` | The application's dashboard-enabled assets for the network picked in the header, with per-asset trustline state; establish/remove trustlines (Stellar only - other chains are informational) |
302
308
  | `<DistributionRulesModal>` | Manage the wallet's distribution rules |
package/dist/index.css CHANGED
@@ -15,7 +15,7 @@
15
15
  .pollar-overlay {
16
16
  position: fixed;
17
17
  inset: 0;
18
- z-index: 50;
18
+ z-index: var(--pollar-overlay-z-index, 50);
19
19
  display: flex;
20
20
  align-items: center;
21
21
  justify-content: center;
@@ -27,7 +27,7 @@
27
27
  .pollar-modal-card {
28
28
  position: relative;
29
29
  width: 100%;
30
- border-radius: 1rem;
30
+ border-radius: var(--pollar-modal-border-radius, 1rem);
31
31
  border: 1px solid var(--pollar-border);
32
32
  padding: var(--pollar-modal-padding, 1.75rem);
33
33
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
@@ -130,7 +130,7 @@
130
130
  border: none;
131
131
  border-radius: var(--pollar-buttons-border-radius, 0.5rem);
132
132
  background-color: var(--pollar-accent);
133
- color: #fff;
133
+ color: var(--pollar-btn-primary-fg, #fff);
134
134
  font-size: 0.9375rem;
135
135
  font-weight: 700;
136
136
  cursor: pointer;
@@ -152,8 +152,8 @@
152
152
  padding: 0 1rem;
153
153
  border: 1px solid var(--pollar-border);
154
154
  border-radius: var(--pollar-buttons-border-radius, 0.5rem);
155
- background-color: transparent;
156
- color: var(--pollar-muted);
155
+ background-color: var(--pollar-btn-secondary-bg, transparent);
156
+ color: var(--pollar-btn-secondary-fg, var(--pollar-muted));
157
157
  font-size: 0.9375rem;
158
158
  font-weight: 600;
159
159
  cursor: pointer;
@@ -180,8 +180,8 @@
180
180
  border-width: 2px;
181
181
  }
182
182
  .pollar-btn-primary .pollar-spinner {
183
- border-color: rgba(255, 255, 255, 0.35);
184
- border-top-color: #fff;
183
+ border-color: color-mix(in srgb, var(--pollar-btn-primary-fg, #fff) 35%, transparent);
184
+ border-top-color: var(--pollar-btn-primary-fg, #fff);
185
185
  }
186
186
  .pollar-spinner-current {
187
187
  border-color: color-mix(in srgb, currentColor 25%, transparent);
@@ -760,7 +760,7 @@
760
760
  padding: 0.875rem 1rem;
761
761
  border-radius: var(--pollar-card-border-radius, 10px);
762
762
  border: 1px solid var(--pollar-border);
763
- background-color: var(--pollar-input-bg);
763
+ background-color: var(--pollar-btn-secondary-bg, var(--pollar-input-bg));
764
764
  cursor: pointer;
765
765
  transition: all 0.15s;
766
766
  box-sizing: border-box;
@@ -776,7 +776,7 @@
776
776
  .pollar-kyc-provider-name {
777
777
  font-size: 0.9375rem;
778
778
  font-weight: 600;
779
- color: var(--pollar-text);
779
+ color: var(--pollar-btn-secondary-fg, var(--pollar-text));
780
780
  }
781
781
  .pollar-kyc-provider-flow {
782
782
  font-size: 0.75rem;
@@ -1092,7 +1092,7 @@
1092
1092
  gap: 0.75rem;
1093
1093
  border-radius: var(--pollar-buttons-border-radius, 0.5rem);
1094
1094
  border: 1px solid var(--pollar-border);
1095
- background-color: var(--pollar-input-bg);
1095
+ background-color: var(--pollar-btn-secondary-bg, var(--pollar-input-bg));
1096
1096
  padding: 0 1rem;
1097
1097
  cursor: pointer;
1098
1098
  transition: all 0.15s;
@@ -1112,7 +1112,7 @@
1112
1112
  .pollar-social-btn-text {
1113
1113
  font-size: 1rem;
1114
1114
  font-weight: 600;
1115
- color: var(--pollar-text);
1115
+ color: var(--pollar-btn-secondary-fg, var(--pollar-text));
1116
1116
  }
1117
1117
  .pollar-wallet-section {
1118
1118
  display: flex;
@@ -1135,8 +1135,8 @@
1135
1135
  padding: 0 1rem;
1136
1136
  border-radius: var(--pollar-buttons-border-radius, 0.5rem);
1137
1137
  border: 1px solid var(--pollar-border);
1138
- background-color: var(--pollar-input-bg);
1139
- color: var(--pollar-text);
1138
+ background-color: var(--pollar-btn-secondary-bg, var(--pollar-input-bg));
1139
+ color: var(--pollar-btn-secondary-fg, var(--pollar-text));
1140
1140
  font-size: 1rem;
1141
1141
  font-weight: 500;
1142
1142
  cursor: pointer;
@@ -1185,8 +1185,8 @@
1185
1185
  gap: 0.75rem;
1186
1186
  border-radius: var(--pollar-buttons-border-radius, 0.5rem);
1187
1187
  border: 1px solid var(--pollar-border);
1188
- background-color: var(--pollar-input-bg);
1189
- color: var(--pollar-text);
1188
+ background-color: var(--pollar-btn-secondary-bg, var(--pollar-input-bg));
1189
+ color: var(--pollar-btn-secondary-fg, var(--pollar-text));
1190
1190
  padding: 0 1rem;
1191
1191
  font-size: 1rem;
1192
1192
  font-weight: 500;
@@ -1214,8 +1214,8 @@
1214
1214
  gap: 0.75rem;
1215
1215
  border-radius: var(--pollar-buttons-border-radius, 0.5rem);
1216
1216
  border: 1px solid var(--pollar-border);
1217
- background-color: var(--pollar-input-bg);
1218
- color: var(--pollar-text);
1217
+ background-color: var(--pollar-btn-secondary-bg, var(--pollar-input-bg));
1218
+ color: var(--pollar-btn-secondary-fg, var(--pollar-text));
1219
1219
  padding: 0 1rem;
1220
1220
  font-size: 1rem;
1221
1221
  font-weight: 500;
@@ -1297,6 +1297,33 @@
1297
1297
  font-size: var(--pollar-modal-subtitle-size, 0.9rem);
1298
1298
  color: var(--pollar-muted);
1299
1299
  }
1300
+ .pollar-ramp-steps {
1301
+ display: flex;
1302
+ flex-direction: column;
1303
+ gap: 0.5rem;
1304
+ margin-bottom: 1.25rem;
1305
+ }
1306
+ .pollar-ramp-steps-label {
1307
+ font-size: 0.6875rem;
1308
+ font-weight: 600;
1309
+ letter-spacing: 0.05em;
1310
+ text-transform: uppercase;
1311
+ color: var(--pollar-muted);
1312
+ }
1313
+ .pollar-ramp-steps-track {
1314
+ display: flex;
1315
+ gap: 0.375rem;
1316
+ }
1317
+ .pollar-ramp-steps-segment {
1318
+ flex: 1;
1319
+ height: 4px;
1320
+ border-radius: 999px;
1321
+ background: var(--pollar-border);
1322
+ transition: background-color 0.2s;
1323
+ }
1324
+ .pollar-ramp-steps-segment[data-done] {
1325
+ background: var(--pollar-accent);
1326
+ }
1300
1327
  .pollar-ramp-field {
1301
1328
  margin-bottom: 1rem;
1302
1329
  }
@@ -1331,6 +1358,17 @@
1331
1358
  font-size: 0.75rem;
1332
1359
  color: var(--pollar-error-text, #dc2626);
1333
1360
  }
1361
+ .pollar-ramp-field-hint {
1362
+ display: block;
1363
+ margin-top: 0.375rem;
1364
+ font-size: 0.75rem;
1365
+ color: var(--pollar-muted);
1366
+ }
1367
+ .pollar-ramp-field-optional {
1368
+ font-weight: 400;
1369
+ text-transform: none;
1370
+ color: var(--pollar-muted);
1371
+ }
1334
1372
  .pollar-ramp-input-row {
1335
1373
  display: flex;
1336
1374
  gap: 0.625rem;
@@ -1398,11 +1436,19 @@
1398
1436
  transition: all 0.15s;
1399
1437
  box-sizing: border-box;
1400
1438
  }
1439
+ .pollar-ramp-route-card[data-busy] {
1440
+ cursor: wait;
1441
+ border-color: var(--pollar-accent);
1442
+ }
1443
+ .pollar-ramp-route-card[data-disabled] {
1444
+ opacity: 0.5;
1445
+ cursor: not-allowed;
1446
+ }
1401
1447
  .pollar-ramp-route-card[data-recommended=true] {
1402
1448
  border-color: var(--pollar-accent);
1403
1449
  background-color: color-mix(in srgb, var(--pollar-accent) 5%, var(--pollar-input-bg));
1404
1450
  }
1405
- .pollar-ramp-route-card:hover {
1451
+ .pollar-ramp-route-card:not([data-disabled]):hover {
1406
1452
  border-color: var(--pollar-accent);
1407
1453
  }
1408
1454
  .pollar-ramp-route-left {
@@ -1475,6 +1521,18 @@
1475
1521
  letter-spacing: 0.03em;
1476
1522
  font-family: monospace;
1477
1523
  }
1524
+ .pollar-ramp-qr {
1525
+ display: flex;
1526
+ justify-content: center;
1527
+ width: 100%;
1528
+ color: var(--pollar-text);
1529
+ }
1530
+ .pollar-ramp-qr svg {
1531
+ width: 100%;
1532
+ max-width: 220px;
1533
+ height: auto;
1534
+ display: block;
1535
+ }
1478
1536
  .pollar-ramp-copy-btn {
1479
1537
  padding: 0.25rem 0.625rem;
1480
1538
  border-radius: var(--pollar-buttons-border-radius, 6px);