@vantageos/mosaic 0.3.1 → 0.5.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.
- package/CHANGELOG.md +88 -2
- package/LICENSE +110 -0
- package/README.md +193 -21
- package/dist/PipelineBoard-FucyGArR.d.cts +759 -0
- package/dist/PipelineBoard-FucyGArR.d.ts +759 -0
- package/dist/PipelineBoard.markdown-DIcvrS-2.d.cts +16 -0
- package/dist/PipelineBoard.markdown-DIcvrS-2.d.ts +16 -0
- package/dist/{StatusBadge.schema-1tOjB4Ir.d.cts → StatusBadge.schema-BEjSH2_4.d.cts} +2 -2
- package/dist/{StatusBadge.schema-1tOjB4Ir.d.ts → StatusBadge.schema-BEjSH2_4.d.ts} +2 -2
- package/dist/{Tabs.schema-BzcEyeq8.d.cts → Tabs.schema-Dqr6vwV3.d.cts} +2 -2
- package/dist/{Tabs.schema-BzcEyeq8.d.ts → Tabs.schema-Dqr6vwV3.d.ts} +2 -2
- package/dist/Timeline-Coo_3tA_.d.cts +114 -0
- package/dist/Timeline-Coo_3tA_.d.ts +114 -0
- package/dist/Timeline.markdown-C6UPDv1H.d.cts +4 -0
- package/dist/Timeline.markdown-C6UPDv1H.d.ts +4 -0
- package/dist/TransactionPreview-BzWDn8kE.d.cts +391 -0
- package/dist/TransactionPreview-BzWDn8kE.d.ts +391 -0
- package/dist/TransactionPreview.markdown-Dpb0VYgN.d.cts +7 -0
- package/dist/TransactionPreview.markdown-Dpb0VYgN.d.ts +7 -0
- package/dist/artifacts.cjs +190 -2
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.js +190 -2
- package/dist/artifacts.js.map +1 -1
- package/dist/confirmation.cjs +728 -2
- package/dist/confirmation.cjs.map +1 -1
- package/dist/confirmation.d.cts +2 -1
- package/dist/confirmation.d.ts +2 -1
- package/dist/confirmation.js +726 -4
- package/dist/confirmation.js.map +1 -1
- package/dist/display.cjs +1555 -203
- package/dist/display.cjs.map +1 -1
- package/dist/display.d.cts +6 -229
- package/dist/display.d.ts +6 -229
- package/dist/display.js +1539 -206
- package/dist/display.js.map +1 -1
- package/dist/forms.cjs +139 -46
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.d.cts +2 -2
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +139 -46
- package/dist/forms.js.map +1 -1
- package/dist/host.cjs +822 -0
- package/dist/host.cjs.map +1 -0
- package/dist/host.d.cts +287 -0
- package/dist/host.d.ts +287 -0
- package/dist/host.js +794 -0
- package/dist/host.js.map +1 -0
- package/dist/{index-CwXVgtGb.d.cts → index-BadRcCbm.d.cts} +28 -11
- package/dist/{index-CwXVgtGb.d.ts → index-BadRcCbm.d.ts} +28 -11
- package/dist/index.cjs +2202 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -8
- package/dist/index.d.ts +42 -8
- package/dist/index.js +2167 -251
- package/dist/index.js.map +1 -1
- package/dist/input.d.cts +2 -2
- package/dist/input.d.ts +2 -2
- package/dist/media.cjs +190 -2
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/media.js +190 -2
- package/dist/media.js.map +1 -1
- package/dist/preact/artifacts.js +190 -2
- package/dist/preact/artifacts.js.map +1 -1
- package/dist/preact/confirmation.d.ts +321 -1
- package/dist/preact/confirmation.js +629 -4
- package/dist/preact/confirmation.js.map +1 -1
- package/dist/preact/display.d.ts +570 -31
- package/dist/preact/display.js +1248 -126
- package/dist/preact/display.js.map +1 -1
- package/dist/preact/forms.d.ts +32 -15
- package/dist/preact/forms.js +139 -46
- package/dist/preact/forms.js.map +1 -1
- package/dist/preact/host.d.ts +307 -0
- package/dist/preact/host.js +875 -0
- package/dist/preact/host.js.map +1 -0
- package/dist/preact/media.d.ts +37 -1
- package/dist/preact/media.js +423 -0
- package/dist/preact/media.js.map +1 -1
- package/dist/preact/progress.d.ts +92 -1
- package/dist/preact/progress.js +469 -3
- package/dist/preact/progress.js.map +1 -1
- package/dist/progress.cjs +525 -2
- package/dist/progress.cjs.map +1 -1
- package/dist/progress.d.cts +2 -1
- package/dist/progress.d.ts +2 -1
- package/dist/progress.js +522 -3
- package/dist/progress.js.map +1 -1
- package/dist/react/artifacts.cjs +190 -2
- package/dist/react/artifacts.cjs.map +1 -1
- package/dist/react/artifacts.js +190 -2
- package/dist/react/artifacts.js.map +1 -1
- package/dist/react/confirmation.cjs +630 -2
- package/dist/react/confirmation.cjs.map +1 -1
- package/dist/react/confirmation.d.cts +3 -3
- package/dist/react/confirmation.d.ts +3 -3
- package/dist/react/confirmation.js +629 -4
- package/dist/react/confirmation.js.map +1 -1
- package/dist/react/display.cjs +1137 -123
- package/dist/react/display.cjs.map +1 -1
- package/dist/react/display.d.cts +42 -14
- package/dist/react/display.d.ts +42 -14
- package/dist/react/display.js +1122 -126
- package/dist/react/display.js.map +1 -1
- package/dist/react/forms.cjs +139 -46
- package/dist/react/forms.cjs.map +1 -1
- package/dist/react/forms.d.cts +1 -1
- package/dist/react/forms.d.ts +1 -1
- package/dist/react/forms.js +139 -46
- package/dist/react/forms.js.map +1 -1
- package/dist/react/host.cjs +910 -0
- package/dist/react/host.cjs.map +1 -0
- package/dist/react/host.d.cts +24 -0
- package/dist/react/host.d.ts +24 -0
- package/dist/react/host.js +875 -0
- package/dist/react/host.js.map +1 -0
- package/dist/react/input.d.cts +1 -1
- package/dist/react/input.d.ts +1 -1
- package/dist/react/media.cjs +426 -0
- package/dist/react/media.cjs.map +1 -1
- package/dist/react/media.d.cts +19 -1
- package/dist/react/media.d.ts +19 -1
- package/dist/react/media.js +423 -0
- package/dist/react/media.js.map +1 -1
- package/dist/react/progress.cjs +471 -2
- package/dist/react/progress.cjs.map +1 -1
- package/dist/react/progress.d.cts +1 -1
- package/dist/react/progress.d.ts +1 -1
- package/dist/react/progress.js +469 -3
- package/dist/react/progress.js.map +1 -1
- package/dist/server/resource.cjs +151 -0
- package/dist/server/resource.cjs.map +1 -0
- package/dist/server/resource.d.cts +90 -0
- package/dist/server/resource.d.ts +90 -0
- package/dist/server/resource.js +147 -0
- package/dist/server/resource.js.map +1 -0
- package/dist/server.cjs +1100 -25
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +84 -5
- package/dist/server.d.ts +84 -5
- package/dist/server.js +1087 -27
- package/dist/server.js.map +1 -1
- package/dist/tokens.cjs +73 -22
- package/dist/tokens.cjs.map +1 -1
- package/dist/tokens.d.cts +23 -3
- package/dist/tokens.d.ts +23 -3
- package/dist/tokens.js +73 -22
- package/dist/tokens.js.map +1 -1
- package/package.json +250 -231
- package/registry.yaml +51 -2
- package/dist/Alert.schema-LPJE5gFP.d.cts +0 -71
- package/dist/Alert.schema-LPJE5gFP.d.ts +0 -71
- package/dist/ProgressBar.schema-CdVYx0Wq.d.cts +0 -22
- package/dist/ProgressBar.schema-CdVYx0Wq.d.ts +0 -22
- package/dist/{ConfirmDialog-B3CQQGmJ.d.cts → ConfirmDialog-BCtOcmHe.d.cts} +1 -1
- package/dist/{ConfirmDialog-B3CQQGmJ.d.ts → ConfirmDialog-BCtOcmHe.d.ts} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { jsx, jsxs } from 'preact/jsx-runtime';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
|
|
3
3
|
import { useRef, useId, useEffect, useState } from 'preact/compat';
|
|
4
4
|
|
|
5
5
|
// src/components/confirmation/Alert.logic.ts
|
|
@@ -66,6 +66,8 @@ var EN = {
|
|
|
66
66
|
"TokenDisplayOnceModal.copied": "Copied",
|
|
67
67
|
"StatusBadge.aria.status": "Status",
|
|
68
68
|
"StatusBadge.error.invalidProps": "StatusBadge: invalid props",
|
|
69
|
+
"Badge.aria.label": "Badge",
|
|
70
|
+
"Badge.error.invalidProps": "Badge: invalid props",
|
|
69
71
|
"EmptyState.error.invalidProps": "EmptyState: invalid props",
|
|
70
72
|
"Toast.aria.close": "Close notification",
|
|
71
73
|
"Toast.error.invalidProps": "Toast: invalid props",
|
|
@@ -135,7 +137,99 @@ var EN = {
|
|
|
135
137
|
"Select.search.placeholder": "Search\u2026",
|
|
136
138
|
"Select.empty": "No options available",
|
|
137
139
|
"Select.error.required": "Select an option",
|
|
138
|
-
"Select.error.invalidProps": "Select: invalid props"
|
|
140
|
+
"Select.error.invalidProps": "Select: invalid props",
|
|
141
|
+
"ModelContext.selection.one": "1 row selected",
|
|
142
|
+
"ModelContext.selection.many": "{n} rows selected",
|
|
143
|
+
"ModelContext.selection.none": "No rows selected",
|
|
144
|
+
"TableView.sort.by": "Sort by",
|
|
145
|
+
"TableView.select.row": "Select row",
|
|
146
|
+
"TableView.select.all": "Select all rows",
|
|
147
|
+
"TableView.loading": "Loading table",
|
|
148
|
+
"StatCard.title": "Statistic",
|
|
149
|
+
"StatCard.trend.up": "Up",
|
|
150
|
+
"StatCard.trend.down": "Down",
|
|
151
|
+
"StatCard.trend.flat": "Flat",
|
|
152
|
+
"StatCard.empty.message": "No statistic to display",
|
|
153
|
+
"StatCard.loading": "Loading statistic",
|
|
154
|
+
"StatCard.error.invalidProps": "StatCard: invalid props",
|
|
155
|
+
"BalanceCard.title": "Balance",
|
|
156
|
+
"BalanceCard.network": "Network",
|
|
157
|
+
"BalanceCard.testnet": "Testnet",
|
|
158
|
+
"BalanceCard.address": "Address",
|
|
159
|
+
"BalanceCard.contract": "Token contract",
|
|
160
|
+
"BalanceCard.value": "Value",
|
|
161
|
+
"BalanceCard.copy": "Copy address",
|
|
162
|
+
"BalanceCard.copied": "Address copied",
|
|
163
|
+
"BalanceCard.empty.message": "No balance to display",
|
|
164
|
+
"BalanceCard.loading": "Loading balance",
|
|
165
|
+
"BalanceCard.error.invalidProps": "BalanceCard: invalid props",
|
|
166
|
+
"Timeline.title": "Timeline",
|
|
167
|
+
"Timeline.status.done": "Done",
|
|
168
|
+
"Timeline.status.current": "In progress",
|
|
169
|
+
"Timeline.status.pending": "Pending",
|
|
170
|
+
"Timeline.status.blocked": "Blocked",
|
|
171
|
+
"Timeline.completed": "{n} completed",
|
|
172
|
+
"Timeline.more": "{n} more",
|
|
173
|
+
"Timeline.empty.message": "No steps to display",
|
|
174
|
+
"Timeline.loading": "Loading timeline",
|
|
175
|
+
"Timeline.error.invalidProps": "Timeline: invalid props",
|
|
176
|
+
"MessageFeed.title": "Messages",
|
|
177
|
+
"MessageFeed.unread": "Unread",
|
|
178
|
+
"MessageFeed.attachment": "Attachment",
|
|
179
|
+
"MessageFeed.showing": "Showing the latest {n} of {total}",
|
|
180
|
+
"MessageFeed.empty.message": "No messages",
|
|
181
|
+
"MessageFeed.loading": "Loading messages",
|
|
182
|
+
"MessageFeed.error.invalidProps": "MessageFeed: invalid props",
|
|
183
|
+
"PipelineBoard.title": "Pipeline",
|
|
184
|
+
"PipelineBoard.deals.one": "1 deal",
|
|
185
|
+
"PipelineBoard.deals.many": "{n} deals",
|
|
186
|
+
"PipelineBoard.total": "Total",
|
|
187
|
+
"PipelineBoard.stage.empty": "No deals",
|
|
188
|
+
"PipelineBoard.filter.label": "Show stages",
|
|
189
|
+
"PipelineBoard.summary.open": "Open full board",
|
|
190
|
+
"PipelineBoard.more": "{n} more stages",
|
|
191
|
+
"PipelineBoard.empty.message": "No pipeline to display",
|
|
192
|
+
"PipelineBoard.loading": "Loading pipeline",
|
|
193
|
+
"PipelineBoard.error.invalidProps": "PipelineBoard: invalid props",
|
|
194
|
+
"PipelineBoard.col.stage": "Stage",
|
|
195
|
+
"PipelineBoard.col.deals": "Deals",
|
|
196
|
+
"TransactionPreview.title": "Transaction preview",
|
|
197
|
+
"TransactionPreview.notice": "NOT SIGNED - preparation only",
|
|
198
|
+
"TransactionPreview.kind.transfer": "Transfer",
|
|
199
|
+
"TransactionPreview.kind.swap": "Swap",
|
|
200
|
+
"TransactionPreview.testnet": "Testnet",
|
|
201
|
+
"TransactionPreview.field.network": "Network",
|
|
202
|
+
"TransactionPreview.field.from": "From",
|
|
203
|
+
"TransactionPreview.field.to": "To",
|
|
204
|
+
"TransactionPreview.field.amount": "Amount",
|
|
205
|
+
"TransactionPreview.field.fee": "Network fee",
|
|
206
|
+
"TransactionPreview.field.sell": "Sell",
|
|
207
|
+
"TransactionPreview.field.buy": "Buy",
|
|
208
|
+
"TransactionPreview.field.minReceived": "Minimum received",
|
|
209
|
+
"TransactionPreview.field.route": "Route",
|
|
210
|
+
"TransactionPreview.field.priceImpact": "Price impact",
|
|
211
|
+
"TransactionPreview.field.expires": "Quote expires",
|
|
212
|
+
"TransactionPreview.priceImpact.high": "High price impact",
|
|
213
|
+
"TransactionPreview.simulation.success": "Simulation succeeded",
|
|
214
|
+
"TransactionPreview.simulation.failed": "Simulation failed",
|
|
215
|
+
"TransactionPreview.simulation.unavailable": "Simulation unavailable",
|
|
216
|
+
"TransactionPreview.warnings": "Warnings",
|
|
217
|
+
"TransactionPreview.handoff": "Open in wallet",
|
|
218
|
+
"TransactionPreview.empty.message": "No transaction to preview",
|
|
219
|
+
"TransactionPreview.loading": "Loading preview",
|
|
220
|
+
"TransactionPreview.error.invalidProps": "TransactionPreview: invalid props",
|
|
221
|
+
"ProgressBar.title": "Progress",
|
|
222
|
+
"ConfirmDialog.title": "Confirmation",
|
|
223
|
+
"ConfirmDialog.options": "Answers",
|
|
224
|
+
"TableView.title": "Data table",
|
|
225
|
+
"TableView.markdown.more": "{n} more rows",
|
|
226
|
+
"MarkdownRenderer.title": "Markdown content",
|
|
227
|
+
"TokenDisplayOnceModal.title": "Token (shown once)",
|
|
228
|
+
"StatusBadge.title": "Status",
|
|
229
|
+
"TokenDisplayOnceModal.notice.once": "The value is shown once, in the app view only.",
|
|
230
|
+
"TokenDisplayOnceModal.field.scope": "Scope",
|
|
231
|
+
"TokenDisplayOnceModal.field.expires": "Expires",
|
|
232
|
+
"TokenDisplayOnceModal.field.fingerprint": "Fingerprint"
|
|
139
233
|
};
|
|
140
234
|
var FR = {
|
|
141
235
|
// ─── Non-forms components ──────────────────────────────────────────────────
|
|
@@ -158,6 +252,8 @@ var FR = {
|
|
|
158
252
|
"TokenDisplayOnceModal.copied": "Copi\xE9",
|
|
159
253
|
"StatusBadge.aria.status": "Statut",
|
|
160
254
|
"StatusBadge.error.invalidProps": "StatusBadge : propri\xE9t\xE9s invalides",
|
|
255
|
+
"Badge.aria.label": "Badge",
|
|
256
|
+
"Badge.error.invalidProps": "Badge : propri\xE9t\xE9s invalides",
|
|
161
257
|
"EmptyState.error.invalidProps": "EmptyState : propri\xE9t\xE9s invalides",
|
|
162
258
|
"Toast.aria.close": "Fermer la notification",
|
|
163
259
|
"Toast.error.invalidProps": "Toast : propri\xE9t\xE9s invalides",
|
|
@@ -227,7 +323,99 @@ var FR = {
|
|
|
227
323
|
"Select.search.placeholder": "Rechercher\u2026",
|
|
228
324
|
"Select.empty": "Aucune option disponible",
|
|
229
325
|
"Select.error.required": "S\xE9lectionnez une option",
|
|
230
|
-
"Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides"
|
|
326
|
+
"Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides",
|
|
327
|
+
"ModelContext.selection.one": "1 ligne s\xE9lectionn\xE9e",
|
|
328
|
+
"ModelContext.selection.many": "{n} lignes s\xE9lectionn\xE9es",
|
|
329
|
+
"ModelContext.selection.none": "Aucune ligne s\xE9lectionn\xE9e",
|
|
330
|
+
"TableView.sort.by": "Trier par",
|
|
331
|
+
"TableView.select.row": "S\xE9lectionner la ligne",
|
|
332
|
+
"TableView.select.all": "Tout s\xE9lectionner",
|
|
333
|
+
"TableView.loading": "Chargement du tableau",
|
|
334
|
+
"StatCard.title": "Statistique",
|
|
335
|
+
"StatCard.trend.up": "En hausse",
|
|
336
|
+
"StatCard.trend.down": "En baisse",
|
|
337
|
+
"StatCard.trend.flat": "Stable",
|
|
338
|
+
"StatCard.empty.message": "Aucune statistique \xE0 afficher",
|
|
339
|
+
"StatCard.loading": "Chargement de la statistique",
|
|
340
|
+
"StatCard.error.invalidProps": "StatCard : propri\xE9t\xE9s invalides",
|
|
341
|
+
"BalanceCard.title": "Solde",
|
|
342
|
+
"BalanceCard.network": "R\xE9seau",
|
|
343
|
+
"BalanceCard.testnet": "R\xE9seau de test",
|
|
344
|
+
"BalanceCard.address": "Adresse",
|
|
345
|
+
"BalanceCard.contract": "Contrat du jeton",
|
|
346
|
+
"BalanceCard.value": "Valeur",
|
|
347
|
+
"BalanceCard.copy": "Copier l'adresse",
|
|
348
|
+
"BalanceCard.copied": "Adresse copi\xE9e",
|
|
349
|
+
"BalanceCard.empty.message": "Aucun solde \xE0 afficher",
|
|
350
|
+
"BalanceCard.loading": "Chargement du solde",
|
|
351
|
+
"BalanceCard.error.invalidProps": "BalanceCard : propri\xE9t\xE9s invalides",
|
|
352
|
+
"Timeline.title": "Chronologie",
|
|
353
|
+
"Timeline.status.done": "Termin\xE9",
|
|
354
|
+
"Timeline.status.current": "En cours",
|
|
355
|
+
"Timeline.status.pending": "\xC0 venir",
|
|
356
|
+
"Timeline.status.blocked": "Bloqu\xE9",
|
|
357
|
+
"Timeline.completed": "{n} termin\xE9(s)",
|
|
358
|
+
"Timeline.more": "{n} de plus",
|
|
359
|
+
"Timeline.empty.message": "Aucune \xE9tape \xE0 afficher",
|
|
360
|
+
"Timeline.loading": "Chargement de la chronologie",
|
|
361
|
+
"Timeline.error.invalidProps": "Timeline : propri\xE9t\xE9s invalides",
|
|
362
|
+
"MessageFeed.title": "Messages",
|
|
363
|
+
"MessageFeed.unread": "Non lu",
|
|
364
|
+
"MessageFeed.attachment": "Pi\xE8ce jointe",
|
|
365
|
+
"MessageFeed.showing": "Affichage des {n} derniers sur {total}",
|
|
366
|
+
"MessageFeed.empty.message": "Aucun message",
|
|
367
|
+
"MessageFeed.loading": "Chargement des messages",
|
|
368
|
+
"MessageFeed.error.invalidProps": "MessageFeed : propri\xE9t\xE9s invalides",
|
|
369
|
+
"PipelineBoard.title": "Pipeline",
|
|
370
|
+
"PipelineBoard.deals.one": "1 affaire",
|
|
371
|
+
"PipelineBoard.deals.many": "{n} affaires",
|
|
372
|
+
"PipelineBoard.total": "Total",
|
|
373
|
+
"PipelineBoard.stage.empty": "Aucune affaire",
|
|
374
|
+
"PipelineBoard.filter.label": "Afficher les \xE9tapes",
|
|
375
|
+
"PipelineBoard.summary.open": "Ouvrir le tableau complet",
|
|
376
|
+
"PipelineBoard.more": "{n} \xE9tapes de plus",
|
|
377
|
+
"PipelineBoard.empty.message": "Aucun pipeline \xE0 afficher",
|
|
378
|
+
"PipelineBoard.loading": "Chargement du pipeline",
|
|
379
|
+
"PipelineBoard.error.invalidProps": "PipelineBoard : propri\xE9t\xE9s invalides",
|
|
380
|
+
"PipelineBoard.col.stage": "\xC9tape",
|
|
381
|
+
"PipelineBoard.col.deals": "Affaires",
|
|
382
|
+
"TransactionPreview.title": "Aper\xE7u de transaction",
|
|
383
|
+
"TransactionPreview.notice": "NON SIGN\xC9 - pr\xE9paration uniquement",
|
|
384
|
+
"TransactionPreview.kind.transfer": "Transfert",
|
|
385
|
+
"TransactionPreview.kind.swap": "\xC9change",
|
|
386
|
+
"TransactionPreview.testnet": "R\xE9seau de test",
|
|
387
|
+
"TransactionPreview.field.network": "R\xE9seau",
|
|
388
|
+
"TransactionPreview.field.from": "De",
|
|
389
|
+
"TransactionPreview.field.to": "\xC0",
|
|
390
|
+
"TransactionPreview.field.amount": "Montant",
|
|
391
|
+
"TransactionPreview.field.fee": "Frais de r\xE9seau",
|
|
392
|
+
"TransactionPreview.field.sell": "Vendre",
|
|
393
|
+
"TransactionPreview.field.buy": "Acheter",
|
|
394
|
+
"TransactionPreview.field.minReceived": "Minimum re\xE7u",
|
|
395
|
+
"TransactionPreview.field.route": "Itin\xE9raire",
|
|
396
|
+
"TransactionPreview.field.priceImpact": "Impact sur le prix",
|
|
397
|
+
"TransactionPreview.field.expires": "Expiration du devis",
|
|
398
|
+
"TransactionPreview.priceImpact.high": "Impact sur le prix \xE9lev\xE9",
|
|
399
|
+
"TransactionPreview.simulation.success": "Simulation r\xE9ussie",
|
|
400
|
+
"TransactionPreview.simulation.failed": "Simulation \xE9chou\xE9e",
|
|
401
|
+
"TransactionPreview.simulation.unavailable": "Simulation indisponible",
|
|
402
|
+
"TransactionPreview.warnings": "Avertissements",
|
|
403
|
+
"TransactionPreview.handoff": "Ouvrir dans le portefeuille",
|
|
404
|
+
"TransactionPreview.empty.message": "Aucune transaction \xE0 pr\xE9visualiser",
|
|
405
|
+
"TransactionPreview.loading": "Chargement de l'aper\xE7u",
|
|
406
|
+
"TransactionPreview.error.invalidProps": "TransactionPreview : propri\xE9t\xE9s invalides",
|
|
407
|
+
"ProgressBar.title": "Progression",
|
|
408
|
+
"ConfirmDialog.title": "Confirmation",
|
|
409
|
+
"ConfirmDialog.options": "R\xE9ponses",
|
|
410
|
+
"TableView.title": "Tableau de donn\xE9es",
|
|
411
|
+
"TableView.markdown.more": "{n} lignes de plus",
|
|
412
|
+
"MarkdownRenderer.title": "Contenu Markdown",
|
|
413
|
+
"TokenDisplayOnceModal.title": "Jeton (affich\xE9 une fois)",
|
|
414
|
+
"StatusBadge.title": "Statut",
|
|
415
|
+
"TokenDisplayOnceModal.notice.once": "La valeur n'est affich\xE9e qu'une fois, dans la vue de l'application uniquement.",
|
|
416
|
+
"TokenDisplayOnceModal.field.scope": "Port\xE9e",
|
|
417
|
+
"TokenDisplayOnceModal.field.expires": "Expire le",
|
|
418
|
+
"TokenDisplayOnceModal.field.fingerprint": "Empreinte"
|
|
231
419
|
};
|
|
232
420
|
var TABLE = {
|
|
233
421
|
en: EN,
|
|
@@ -390,6 +578,11 @@ var TokenDisplayOnceModalPropsSchema = z.object({
|
|
|
390
578
|
warningMessage: z.string().min(1),
|
|
391
579
|
copyLabel: z.string().min(1),
|
|
392
580
|
closeLabel: z.string().min(1),
|
|
581
|
+
/** Non-secret metadata, shown in the view AND carried by the A-1 fallback. */
|
|
582
|
+
scope: z.string().optional(),
|
|
583
|
+
expiresAt: z.string().optional(),
|
|
584
|
+
/** Supplied by the issuer; NEVER derived from the secret. */
|
|
585
|
+
fingerprint: z.string().optional(),
|
|
393
586
|
locale: z.enum(["en", "fr"]).default("en")
|
|
394
587
|
});
|
|
395
588
|
function validateTokenDisplayOnceModalProps(raw) {
|
|
@@ -401,6 +594,9 @@ function TokenDisplayOnceModalInner({
|
|
|
401
594
|
warningMessage,
|
|
402
595
|
copyLabel,
|
|
403
596
|
closeLabel,
|
|
597
|
+
scope,
|
|
598
|
+
expiresAt,
|
|
599
|
+
fingerprint,
|
|
404
600
|
locale,
|
|
405
601
|
onClose
|
|
406
602
|
}) {
|
|
@@ -463,6 +659,29 @@ function TokenDisplayOnceModalInner({
|
|
|
463
659
|
children: warningMessage
|
|
464
660
|
}
|
|
465
661
|
),
|
|
662
|
+
scope || expiresAt || fingerprint ? /* @__PURE__ */ jsxs("dl", { className: "m-0 text-sm text-gray-700", children: [
|
|
663
|
+
scope ? /* @__PURE__ */ jsxs("div", { children: [
|
|
664
|
+
/* @__PURE__ */ jsxs("dt", { className: "inline", children: [
|
|
665
|
+
t("TokenDisplayOnceModal.field.scope", locale),
|
|
666
|
+
": "
|
|
667
|
+
] }),
|
|
668
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 inline", children: scope })
|
|
669
|
+
] }) : null,
|
|
670
|
+
expiresAt ? /* @__PURE__ */ jsxs("div", { children: [
|
|
671
|
+
/* @__PURE__ */ jsxs("dt", { className: "inline", children: [
|
|
672
|
+
t("TokenDisplayOnceModal.field.expires", locale),
|
|
673
|
+
": "
|
|
674
|
+
] }),
|
|
675
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 inline", children: expiresAt })
|
|
676
|
+
] }) : null,
|
|
677
|
+
fingerprint ? /* @__PURE__ */ jsxs("div", { children: [
|
|
678
|
+
/* @__PURE__ */ jsxs("dt", { className: "inline", children: [
|
|
679
|
+
t("TokenDisplayOnceModal.field.fingerprint", locale),
|
|
680
|
+
": "
|
|
681
|
+
] }),
|
|
682
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 inline font-mono", children: fingerprint })
|
|
683
|
+
] }) : null
|
|
684
|
+
] }) : null,
|
|
466
685
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 bg-gray-50 border border-gray-200 rounded-md px-3 py-2", children: /* @__PURE__ */ jsx("code", { className: "flex-1 text-sm font-mono text-gray-800 break-all select-all", children: secureToken }) }),
|
|
467
686
|
/* @__PURE__ */ jsx("output", { "aria-live": "polite", "aria-atomic": "true", className: "min-h-[1.25rem] block", children: copied && /* @__PURE__ */ jsx("span", { className: "text-sm text-green-700 font-medium", children: t("TokenDisplayOnceModal.copied", locale) }) }),
|
|
468
687
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-3 mt-2", children: [
|
|
@@ -500,7 +719,413 @@ function TokenDisplayOnceModal(raw) {
|
|
|
500
719
|
return null;
|
|
501
720
|
}
|
|
502
721
|
}
|
|
722
|
+
var BadgePropsSchema = z.object({
|
|
723
|
+
label: z.string(),
|
|
724
|
+
variant: z.enum(["default", "primary", "success", "warning", "danger", "info", "neutral"]).default("default"),
|
|
725
|
+
dot: z.boolean().optional(),
|
|
726
|
+
count: z.number().int().nonnegative().optional(),
|
|
727
|
+
locale: z.enum(["en", "fr"]).default("en")
|
|
728
|
+
});
|
|
729
|
+
function validateBadgeProps(raw) {
|
|
730
|
+
return BadgePropsSchema.parse(raw);
|
|
731
|
+
}
|
|
732
|
+
var variantClasses = {
|
|
733
|
+
default: "bg-slate-100 text-slate-700 ring-1 ring-slate-200",
|
|
734
|
+
primary: "bg-indigo-100 text-indigo-800 ring-1 ring-indigo-300",
|
|
735
|
+
success: "bg-green-100 text-green-800 ring-1 ring-green-300",
|
|
736
|
+
warning: "bg-amber-100 text-amber-800 ring-1 ring-amber-300",
|
|
737
|
+
danger: "bg-red-100 text-red-800 ring-1 ring-red-300",
|
|
738
|
+
info: "bg-blue-100 text-blue-800 ring-1 ring-blue-300",
|
|
739
|
+
neutral: "bg-slate-100 text-slate-800 ring-1 ring-slate-300"
|
|
740
|
+
};
|
|
741
|
+
var dotClasses = {
|
|
742
|
+
default: "bg-slate-400",
|
|
743
|
+
primary: "bg-indigo-500",
|
|
744
|
+
success: "bg-green-500",
|
|
745
|
+
warning: "bg-amber-500",
|
|
746
|
+
danger: "bg-red-500",
|
|
747
|
+
info: "bg-blue-500",
|
|
748
|
+
neutral: "bg-slate-400"
|
|
749
|
+
};
|
|
750
|
+
function BadgeInner({ label, variant, dot, count, locale }) {
|
|
751
|
+
const ariaLabel = t("Badge.aria.label", locale);
|
|
752
|
+
const displayCount = count !== void 0 ? ` (${count})` : "";
|
|
753
|
+
return /* @__PURE__ */ jsxs(
|
|
754
|
+
"span",
|
|
755
|
+
{
|
|
756
|
+
"aria-label": `${ariaLabel}: ${label}${displayCount}`,
|
|
757
|
+
lang: locale,
|
|
758
|
+
className: `inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium ${variantClasses[variant]}`,
|
|
759
|
+
children: [
|
|
760
|
+
dot && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: `h-1.5 w-1.5 rounded-full ${dotClasses[variant]}` }),
|
|
761
|
+
label,
|
|
762
|
+
count !== void 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "font-semibold tabular-nums", children: count })
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
);
|
|
766
|
+
}
|
|
767
|
+
function Badge(raw) {
|
|
768
|
+
try {
|
|
769
|
+
const props = validateBadgeProps(raw);
|
|
770
|
+
return /* @__PURE__ */ jsx(BadgeInner, { ...props });
|
|
771
|
+
} catch {
|
|
772
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
773
|
+
return /* @__PURE__ */ jsx("span", { role: "alert", children: t("Badge.error.invalidProps", locale) });
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// src/components/display/EmptyState.logic.ts
|
|
778
|
+
var ACTION_VARIANT_CLASSES = {
|
|
779
|
+
primary: "inline-flex items-center justify-center rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900 disabled:pointer-events-none disabled:opacity-50",
|
|
780
|
+
secondary: "inline-flex items-center justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-400 disabled:pointer-events-none disabled:opacity-50"
|
|
781
|
+
};
|
|
782
|
+
var EmptyStatePropsSchema = z.object({
|
|
783
|
+
title: z.string().min(1),
|
|
784
|
+
description: z.string().optional(),
|
|
785
|
+
action: z.object({
|
|
786
|
+
label: z.string().min(1),
|
|
787
|
+
variant: z.enum(["primary", "secondary"]).default("primary")
|
|
788
|
+
}).optional(),
|
|
789
|
+
locale: z.enum(["en", "fr"]).default("en")
|
|
790
|
+
});
|
|
791
|
+
function validateEmptyStateProps(raw) {
|
|
792
|
+
return EmptyStatePropsSchema.parse(raw);
|
|
793
|
+
}
|
|
794
|
+
function EmptyStateInner({
|
|
795
|
+
icon,
|
|
796
|
+
title,
|
|
797
|
+
description,
|
|
798
|
+
action,
|
|
799
|
+
locale: _locale
|
|
800
|
+
}) {
|
|
801
|
+
const variant = action?.variant ?? "primary";
|
|
802
|
+
return /* @__PURE__ */ jsxs(
|
|
803
|
+
"section",
|
|
804
|
+
{
|
|
805
|
+
"aria-label": title,
|
|
806
|
+
className: "flex flex-col items-center justify-center gap-4 px-6 py-12 text-center",
|
|
807
|
+
children: [
|
|
808
|
+
icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-slate-400", children: icon }),
|
|
809
|
+
/* @__PURE__ */ jsx("h2", { className: "text-base font-semibold text-slate-900", children: title }),
|
|
810
|
+
description && /* @__PURE__ */ jsx("p", { className: "max-w-sm text-sm leading-relaxed text-slate-500", children: description }),
|
|
811
|
+
action && /* @__PURE__ */ jsx("button", { type: "button", onClick: action.onClick, className: ACTION_VARIANT_CLASSES[variant], children: action.label })
|
|
812
|
+
]
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
function EmptyState(raw) {
|
|
817
|
+
try {
|
|
818
|
+
const parsed = validateEmptyStateProps(raw);
|
|
819
|
+
return /* @__PURE__ */ jsx(
|
|
820
|
+
EmptyStateInner,
|
|
821
|
+
{
|
|
822
|
+
...parsed,
|
|
823
|
+
icon: raw.icon,
|
|
824
|
+
action: parsed.action && raw.action?.onClick ? { ...parsed.action, onClick: raw.action.onClick } : void 0
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
} catch (err) {
|
|
828
|
+
console.error("[EmptyState] Invalid props \u2014 component will not render.", err);
|
|
829
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
830
|
+
return /* @__PURE__ */ jsx("span", { role: "alert", children: t("EmptyState.error.invalidProps", locale) });
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// src/components/display/Skeleton.logic.ts
|
|
835
|
+
function getAnimationClass(animation) {
|
|
836
|
+
switch (animation) {
|
|
837
|
+
case "pulse":
|
|
838
|
+
return "animate-pulse";
|
|
839
|
+
case "wave":
|
|
840
|
+
return "skeleton-wave";
|
|
841
|
+
case "none":
|
|
842
|
+
return "";
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
function getVariantClass(variant) {
|
|
846
|
+
switch (variant) {
|
|
847
|
+
case "rect":
|
|
848
|
+
return "rounded-md";
|
|
849
|
+
case "circle":
|
|
850
|
+
return "rounded-full";
|
|
851
|
+
case "text":
|
|
852
|
+
return "rounded";
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
var SKELETON_BG_CLASS = "bg-gray-200 dark:bg-gray-700";
|
|
856
|
+
function textLineKey(index) {
|
|
857
|
+
return `skeleton-line-${index}`;
|
|
858
|
+
}
|
|
859
|
+
function lastLineWidth(index, total, baseWidth) {
|
|
860
|
+
if (total > 1 && index === total - 1) {
|
|
861
|
+
return "75%";
|
|
862
|
+
}
|
|
863
|
+
return baseWidth;
|
|
864
|
+
}
|
|
865
|
+
var SkeletonPropsSchema = z.object({
|
|
866
|
+
variant: z.enum(["rect", "circle", "text"]).default("rect"),
|
|
867
|
+
width: z.union([z.string().min(1), z.number().positive()]).optional(),
|
|
868
|
+
height: z.union([z.string().min(1), z.number().positive()]).optional(),
|
|
869
|
+
count: z.number().int().min(1).max(20).default(1),
|
|
870
|
+
animation: z.enum(["pulse", "wave", "none"]).default("pulse"),
|
|
871
|
+
locale: z.enum(["en", "fr"]).default("en")
|
|
872
|
+
});
|
|
873
|
+
function validateSkeletonProps(raw) {
|
|
874
|
+
return SkeletonPropsSchema.parse(raw);
|
|
875
|
+
}
|
|
876
|
+
function resolveSkeletonDimensions(variant, width, height) {
|
|
877
|
+
const toCss = (v, fallback) => {
|
|
878
|
+
if (v === void 0) return fallback;
|
|
879
|
+
if (typeof v === "number") return `${v}px`;
|
|
880
|
+
return v;
|
|
881
|
+
};
|
|
882
|
+
if (variant === "circle") {
|
|
883
|
+
const size = width !== void 0 ? toCss(width, "40px") : height !== void 0 ? toCss(height, "40px") : "40px";
|
|
884
|
+
return { widthCss: size, heightCss: size };
|
|
885
|
+
}
|
|
886
|
+
if (variant === "text") {
|
|
887
|
+
return {
|
|
888
|
+
widthCss: toCss(width, "100%"),
|
|
889
|
+
heightCss: toCss(height, "16px")
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
return {
|
|
893
|
+
widthCss: toCss(width, "100%"),
|
|
894
|
+
heightCss: toCss(height, "100px")
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
function SkeletonInner({ variant, width, height, count, animation, locale }) {
|
|
898
|
+
const { widthCss, heightCss } = resolveSkeletonDimensions(variant, width, height);
|
|
899
|
+
const animClass = getAnimationClass(animation);
|
|
900
|
+
const variantClass = getVariantClass(variant);
|
|
901
|
+
const ariaLabel = t("Skeleton.aria.label", locale);
|
|
902
|
+
const baseClass = `${SKELETON_BG_CLASS} ${variantClass} ${animClass}`.trim();
|
|
903
|
+
if (variant === "text") {
|
|
904
|
+
return (
|
|
905
|
+
// biome-ignore lint/a11y/useSemanticElements: role="status" is the correct ARIA pattern for loading indicators; <output> conveys form output semantics which is incorrect here
|
|
906
|
+
/* @__PURE__ */ jsx("div", { role: "status", "aria-label": ariaLabel, "aria-busy": "true", className: "flex flex-col gap-2", children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(
|
|
907
|
+
"span",
|
|
908
|
+
{
|
|
909
|
+
className: `block ${baseClass}`,
|
|
910
|
+
style: {
|
|
911
|
+
width: lastLineWidth(i, count, widthCss),
|
|
912
|
+
height: heightCss
|
|
913
|
+
},
|
|
914
|
+
"aria-hidden": "true"
|
|
915
|
+
},
|
|
916
|
+
textLineKey(i)
|
|
917
|
+
)) })
|
|
918
|
+
);
|
|
919
|
+
}
|
|
920
|
+
return /* @__PURE__ */ jsx(
|
|
921
|
+
"div",
|
|
922
|
+
{
|
|
923
|
+
role: "status",
|
|
924
|
+
"aria-label": ariaLabel,
|
|
925
|
+
"aria-busy": "true",
|
|
926
|
+
className: `block ${baseClass}`,
|
|
927
|
+
style: { width: widthCss, height: heightCss }
|
|
928
|
+
}
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
function Skeleton(raw) {
|
|
932
|
+
try {
|
|
933
|
+
const props = validateSkeletonProps(raw);
|
|
934
|
+
return /* @__PURE__ */ jsx(SkeletonInner, { ...props });
|
|
935
|
+
} catch {
|
|
936
|
+
const locale = raw.locale === "fr" ? "fr" : "en";
|
|
937
|
+
return /* @__PURE__ */ jsx("span", { role: "alert", className: "text-red-600 text-sm", children: t("Skeleton.error.invalidProps", locale) });
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// src/components/display/TableView.logic.ts
|
|
942
|
+
var DECIMAL = /^(-)?(\d+)(?:\.(\d+))?$/;
|
|
943
|
+
function parseDecimal(s) {
|
|
944
|
+
const m = DECIMAL.exec(s.trim());
|
|
945
|
+
if (!m) return void 0;
|
|
946
|
+
const int = (m[2] ?? "0").replace(/^0+(?=\d)/, "");
|
|
947
|
+
const frac = (m[3] ?? "").replace(/0+$/, "");
|
|
948
|
+
const zero = int === "0" && frac === "";
|
|
949
|
+
return { neg: m[1] === "-" && !zero, int, frac };
|
|
950
|
+
}
|
|
951
|
+
function compareDecimalStrings(a, b) {
|
|
952
|
+
const x = parseDecimal(a);
|
|
953
|
+
const y = parseDecimal(b);
|
|
954
|
+
if (!x || !y) return 0;
|
|
955
|
+
if (x.neg !== y.neg) return x.neg ? -1 : 1;
|
|
956
|
+
const sign = x.neg ? -1 : 1;
|
|
957
|
+
if (x.int.length !== y.int.length) return sign * (x.int.length < y.int.length ? -1 : 1);
|
|
958
|
+
if (x.int !== y.int) return sign * (x.int < y.int ? -1 : 1);
|
|
959
|
+
const len = Math.max(x.frac.length, y.frac.length);
|
|
960
|
+
const fx = x.frac.padEnd(len, "0");
|
|
961
|
+
const fy = y.frac.padEnd(len, "0");
|
|
962
|
+
if (fx === fy) return 0;
|
|
963
|
+
return sign * (fx < fy ? -1 : 1);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// src/components/shared/datetime.ts
|
|
967
|
+
function formatTimestamp(iso, locale, timeZone) {
|
|
968
|
+
const d = new Date(iso);
|
|
969
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
970
|
+
try {
|
|
971
|
+
return new Intl.DateTimeFormat(locale, {
|
|
972
|
+
dateStyle: "medium",
|
|
973
|
+
timeStyle: "short",
|
|
974
|
+
...timeZone ? { timeZone } : {}
|
|
975
|
+
}).format(d);
|
|
976
|
+
} catch {
|
|
977
|
+
return iso;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// src/components/shared/url.ts
|
|
982
|
+
function normalizeHttpUrl(value) {
|
|
983
|
+
if (typeof value !== "string") return void 0;
|
|
984
|
+
try {
|
|
985
|
+
const u = new URL(value);
|
|
986
|
+
return u.protocol === "https:" || u.protocol === "http:" ? u.href : void 0;
|
|
987
|
+
} catch {
|
|
988
|
+
return void 0;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
var AmountSchema = z.object({
|
|
992
|
+
/** Decimal STRING (never a float). */
|
|
993
|
+
value: z.string().min(1),
|
|
994
|
+
symbol: z.string().min(1)
|
|
995
|
+
});
|
|
996
|
+
var QuoteSchema = z.object({
|
|
997
|
+
sell: AmountSchema,
|
|
998
|
+
buy: AmountSchema,
|
|
999
|
+
minReceived: AmountSchema.optional(),
|
|
1000
|
+
route: z.array(z.string().min(1)).optional(),
|
|
1001
|
+
/** Percent as a decimal string, e.g. "0.42". */
|
|
1002
|
+
priceImpact: z.string().optional()
|
|
1003
|
+
});
|
|
1004
|
+
var TransactionPreviewPropsSchema = z.object({
|
|
1005
|
+
kind: z.enum(["transfer", "swap"]).default("transfer"),
|
|
1006
|
+
network: z.string().optional(),
|
|
1007
|
+
testnet: z.boolean().default(false),
|
|
1008
|
+
from: z.string().optional(),
|
|
1009
|
+
to: z.string().optional(),
|
|
1010
|
+
amount: AmountSchema.optional(),
|
|
1011
|
+
fee: AmountSchema.optional(),
|
|
1012
|
+
quote: QuoteSchema.optional(),
|
|
1013
|
+
simulation: z.object({
|
|
1014
|
+
status: z.enum(["success", "failed", "unavailable"]),
|
|
1015
|
+
message: z.string().optional()
|
|
1016
|
+
}).optional(),
|
|
1017
|
+
warnings: z.array(z.string()).default([]),
|
|
1018
|
+
/** ISO 8601 expiry of the quote. */
|
|
1019
|
+
expiresAt: z.string().optional(),
|
|
1020
|
+
/** Wallet link-out. Only http(s) urls are ever rendered. */
|
|
1021
|
+
handoff: z.object({ url: z.string().min(1) }).optional(),
|
|
1022
|
+
timeZone: z.string().optional(),
|
|
1023
|
+
loading: z.boolean().default(false),
|
|
1024
|
+
locale: z.enum(["en", "fr"]).default("en")
|
|
1025
|
+
});
|
|
1026
|
+
function validateTransactionPreviewProps(raw) {
|
|
1027
|
+
return TransactionPreviewPropsSchema.parse(raw);
|
|
1028
|
+
}
|
|
1029
|
+
function hasPreviewContent(p) {
|
|
1030
|
+
return Boolean(p.from || p.to || p.amount || p.quote || p.fee);
|
|
1031
|
+
}
|
|
1032
|
+
var amountText = (a) => `${a.value} ${a.symbol}`;
|
|
1033
|
+
function Row({ label, children }) {
|
|
1034
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 py-1 sm:flex-row sm:gap-3", children: [
|
|
1035
|
+
/* @__PURE__ */ jsx("dt", { className: "w-36 shrink-0 text-sm text-slate-500", children: label }),
|
|
1036
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 min-w-0 break-all text-sm text-slate-900", children })
|
|
1037
|
+
] });
|
|
1038
|
+
}
|
|
1039
|
+
function TransactionPreview(raw = {}) {
|
|
1040
|
+
const parsed = TransactionPreviewPropsSchema.safeParse(raw);
|
|
1041
|
+
const locale = raw?.locale === "fr" ? "fr" : "en";
|
|
1042
|
+
if (!parsed.success) {
|
|
1043
|
+
return /* @__PURE__ */ jsx("div", { role: "alert", children: t("TransactionPreview.error.invalidProps", locale) });
|
|
1044
|
+
}
|
|
1045
|
+
const p = parsed.data;
|
|
1046
|
+
if (p.loading) {
|
|
1047
|
+
return /* @__PURE__ */ jsx("div", { "aria-busy": "true", "aria-label": t("TransactionPreview.loading", p.locale), children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", count: 6, locale: p.locale }) });
|
|
1048
|
+
}
|
|
1049
|
+
if (!hasPreviewContent(p)) {
|
|
1050
|
+
return /* @__PURE__ */ jsx(EmptyState, { title: t("TransactionPreview.empty.message", p.locale), locale: p.locale });
|
|
1051
|
+
}
|
|
1052
|
+
const highImpact = p.quote?.priceImpact !== void 0 && compareDecimalStrings(p.quote.priceImpact, "1") >= 0;
|
|
1053
|
+
const handoff = normalizeHttpUrl(p.handoff?.url);
|
|
1054
|
+
return /* @__PURE__ */ jsxs(
|
|
1055
|
+
"section",
|
|
1056
|
+
{
|
|
1057
|
+
"aria-label": t("TransactionPreview.title", p.locale),
|
|
1058
|
+
lang: p.locale,
|
|
1059
|
+
className: "flex flex-col gap-3 rounded-lg border border-slate-200 bg-white p-4",
|
|
1060
|
+
children: [
|
|
1061
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1062
|
+
/* @__PURE__ */ jsx("strong", { className: "text-slate-900", children: t(`TransactionPreview.kind.${p.kind}`, p.locale) }),
|
|
1063
|
+
p.testnet ? /* @__PURE__ */ jsx(
|
|
1064
|
+
Badge,
|
|
1065
|
+
{
|
|
1066
|
+
label: t("TransactionPreview.testnet", p.locale),
|
|
1067
|
+
variant: "warning",
|
|
1068
|
+
locale: p.locale
|
|
1069
|
+
}
|
|
1070
|
+
) : null
|
|
1071
|
+
] }),
|
|
1072
|
+
/* @__PURE__ */ jsx(
|
|
1073
|
+
"p",
|
|
1074
|
+
{
|
|
1075
|
+
role: "note",
|
|
1076
|
+
className: "m-0 rounded bg-amber-50 px-3 py-2 text-sm font-semibold text-amber-900",
|
|
1077
|
+
children: t("TransactionPreview.notice", p.locale)
|
|
1078
|
+
}
|
|
1079
|
+
),
|
|
1080
|
+
/* @__PURE__ */ jsxs("dl", { className: "m-0", children: [
|
|
1081
|
+
p.network ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.network", p.locale), children: p.network }) : null,
|
|
1082
|
+
p.from ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.from", p.locale), children: /* @__PURE__ */ jsx("span", { className: "font-mono", children: p.from }) }) : null,
|
|
1083
|
+
p.to ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.to", p.locale), children: /* @__PURE__ */ jsx("span", { className: "font-mono", children: p.to }) }) : null,
|
|
1084
|
+
p.amount ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.amount", p.locale), children: amountText(p.amount) }) : null,
|
|
1085
|
+
p.quote ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1086
|
+
/* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.sell", p.locale), children: amountText(p.quote.sell) }),
|
|
1087
|
+
/* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.buy", p.locale), children: amountText(p.quote.buy) }),
|
|
1088
|
+
p.quote.minReceived ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.minReceived", p.locale), children: amountText(p.quote.minReceived) }) : null,
|
|
1089
|
+
p.quote.route ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.route", p.locale), children: p.quote.route.join(" > ") }) : null,
|
|
1090
|
+
p.quote.priceImpact !== void 0 ? /* @__PURE__ */ jsxs(Row, { label: t("TransactionPreview.field.priceImpact", p.locale), children: [
|
|
1091
|
+
/* @__PURE__ */ jsx("span", { children: `${p.quote.priceImpact}%` }),
|
|
1092
|
+
highImpact ? /* @__PURE__ */ jsx("strong", { className: "ml-2 text-red-700", children: t("TransactionPreview.priceImpact.high", p.locale) }) : null
|
|
1093
|
+
] }) : null
|
|
1094
|
+
] }) : null,
|
|
1095
|
+
p.fee ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.fee", p.locale), children: amountText(p.fee) }) : null,
|
|
1096
|
+
p.expiresAt ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.expires", p.locale), children: formatTimestamp(p.expiresAt, p.locale, p.timeZone) }) : null
|
|
1097
|
+
] }),
|
|
1098
|
+
p.simulation ? /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
|
|
1099
|
+
/* @__PURE__ */ jsx("strong", { className: p.simulation.status === "failed" ? "text-red-700" : "text-slate-800", children: t(`TransactionPreview.simulation.${p.simulation.status}`, p.locale) }),
|
|
1100
|
+
p.simulation.message ? /* @__PURE__ */ jsx("span", { className: "block text-slate-600", children: p.simulation.message }) : null
|
|
1101
|
+
] }) : null,
|
|
1102
|
+
p.warnings.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
|
|
1103
|
+
/* @__PURE__ */ jsx("strong", { className: "text-amber-800", children: t("TransactionPreview.warnings", p.locale) }),
|
|
1104
|
+
/* @__PURE__ */ jsx("ul", { className: "m-0 pl-5", children: p.warnings.map((w) => /* @__PURE__ */ jsx("li", { children: w }, w)) })
|
|
1105
|
+
] }) : null,
|
|
1106
|
+
handoff ? raw.onHandoff ? /* @__PURE__ */ jsx(
|
|
1107
|
+
"button",
|
|
1108
|
+
{
|
|
1109
|
+
type: "button",
|
|
1110
|
+
onClick: () => raw.onHandoff?.(handoff),
|
|
1111
|
+
className: "self-start rounded border border-slate-300 px-3 py-1 text-sm hover:bg-slate-50",
|
|
1112
|
+
children: t("TransactionPreview.handoff", p.locale)
|
|
1113
|
+
}
|
|
1114
|
+
) : /* @__PURE__ */ jsx(
|
|
1115
|
+
"a",
|
|
1116
|
+
{
|
|
1117
|
+
href: handoff,
|
|
1118
|
+
rel: "noopener noreferrer",
|
|
1119
|
+
target: "_blank",
|
|
1120
|
+
className: "self-start text-sm text-blue-700 underline",
|
|
1121
|
+
children: t("TransactionPreview.handoff", p.locale)
|
|
1122
|
+
}
|
|
1123
|
+
) : null
|
|
1124
|
+
]
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
503
1128
|
|
|
504
|
-
export { Alert, AlertPropsSchema, ConfirmDialog, ConfirmDialogPropsSchema, ConfirmDialog as ConfirmModal, TokenDisplayOnceModal, TokenDisplayOnceModalPropsSchema, validateAlertProps, validateConfirmDialogProps, validateTokenDisplayOnceModalProps };
|
|
1129
|
+
export { Alert, AlertPropsSchema, ConfirmDialog, ConfirmDialogPropsSchema, ConfirmDialog as ConfirmModal, TokenDisplayOnceModal, TokenDisplayOnceModalPropsSchema, TransactionPreview, TransactionPreviewPropsSchema, validateAlertProps, validateConfirmDialogProps, validateTokenDisplayOnceModalProps, validateTransactionPreviewProps };
|
|
505
1130
|
//# sourceMappingURL=confirmation.js.map
|
|
506
1131
|
//# sourceMappingURL=confirmation.js.map
|