@stridge/kit 0.1.0-alpha.51 → 0.1.0-alpha.53
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/dist/KitProvider.d.ts +11 -0
- package/dist/KitProvider.js +1 -1
- package/dist/_internal/activity/driver/index.d.ts +3 -0
- package/dist/_internal/activity/driver/index.js +1 -0
- package/dist/_internal/drivers/stridge/index.d.ts +2 -1
- package/dist/_internal/drivers/stridge/index.js +1 -1
- package/dist/_internal/drivers/stridge-mock/index.d.ts +2 -1
- package/dist/_internal/drivers/stridge-mock/index.js +1 -1
- package/dist/activity/compound/index.d.ts +19 -0
- package/dist/activity/compound/index.js +1 -0
- package/dist/activity/dialog/index.d.ts +3 -0
- package/dist/activity/dialog/index.js +1 -0
- package/dist/activity/widgets/index.d.ts +4 -0
- package/dist/activity/widgets/index.js +1 -0
- package/dist/deposit/compound/index.d.ts +9 -9
- package/dist/deposit/widgets/index.d.ts +3 -3
- package/dist/deposit/widgets/index.js +1 -1
- package/dist/drivers/stridge/createStridgeActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge/createStridgeActivityDriver.js +1 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
- package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +0 -2
- package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +1 -2
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
- package/dist/drivers/stridge-mock/fixtures.js +1 -1
- package/dist/flows/activity/compound/ActivityFlow.d.ts +46 -0
- package/dist/flows/activity/compound/ActivityFlow.js +1 -0
- package/dist/flows/activity/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/activity/compound/components/Boundary.js +1 -0
- package/dist/flows/activity/compound/components/Steps.d.ts +24 -0
- package/dist/flows/activity/compound/components/Steps.js +1 -0
- package/dist/flows/activity/dialog/ActivityDialog.d.ts +38 -0
- package/dist/flows/activity/dialog/ActivityDialog.js +1 -0
- package/dist/flows/activity/dialog/ActivityFlowBoundary.d.ts +1 -0
- package/dist/flows/activity/dialog/ActivityFlowBoundary.js +1 -0
- package/dist/flows/activity/driver/context.d.ts +38 -0
- package/dist/flows/activity/driver/context.js +1 -0
- package/dist/flows/activity/driver/types.d.ts +58 -0
- package/dist/flows/activity/orchestrator/controller.d.ts +11 -0
- package/dist/flows/activity/orchestrator/controller.js +1 -0
- package/dist/flows/activity/orchestrator/index.d.ts +4 -0
- package/dist/flows/activity/orchestrator/index.js +1 -0
- package/dist/flows/activity/orchestrator/reducer.d.ts +1 -0
- package/dist/flows/activity/orchestrator/reducer.js +1 -0
- package/dist/flows/activity/orchestrator/types.d.ts +71 -0
- package/dist/flows/activity/orchestrator/useActivity.d.ts +94 -0
- package/dist/flows/activity/orchestrator/useActivity.js +1 -0
- package/dist/flows/activity/widgets/ActivityDetail.d.ts +41 -0
- package/dist/flows/activity/widgets/ActivityDetail.js +1 -0
- package/dist/flows/activity/widgets/ActivityList.d.ts +38 -0
- package/dist/flows/activity/widgets/ActivityList.js +1 -0
- package/dist/flows/activity/widgets/useStandaloneActivitySource.js +1 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -1
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
- package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -1
- package/dist/flows/deposit/driver/types.d.ts +1 -38
- package/dist/flows/deposit/orchestrator/controller.js +1 -1
- package/dist/flows/deposit/orchestrator/reducer.js +1 -1
- package/dist/flows/deposit/orchestrator/types.d.ts +43 -29
- package/dist/flows/deposit/widgets/{activity-history/DepositHistoryDetail.d.ts → activity/DepositActivityDetail.d.ts} +11 -11
- package/dist/flows/deposit/widgets/activity/DepositActivityDetail.js +1 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityList.d.ts +38 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityList.js +1 -0
- package/dist/flows/deposit/widgets/activity/index.d.ts +2 -0
- package/dist/flows/deposit/widgets/activity/index.js +1 -0
- package/dist/flows/deposit/widgets/activity/useDepositActivitySource.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +7 -6
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +4 -3
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
- package/dist/flows/withdraw/driver/types.d.ts +0 -34
- package/dist/flows/withdraw/orchestrator/controller.js +1 -1
- package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
- package/dist/flows/withdraw/orchestrator/types.d.ts +44 -30
- package/dist/flows/withdraw/widgets/{activity-history/WithdrawHistoryDetail.d.ts → activity/WithdrawActivityDetail.d.ts} +11 -11
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.js +1 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts +36 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.js +1 -0
- package/dist/flows/withdraw/widgets/activity/index.d.ts +2 -0
- package/dist/flows/withdraw/widgets/activity/index.js +1 -0
- package/dist/flows/withdraw/widgets/activity/useWithdrawActivitySource.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +7 -6
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +4 -4
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
- package/dist/format/index.d.ts +2 -1
- package/dist/format/index.js +1 -1
- package/dist/i18n/locales/ar.js +1 -1
- package/dist/i18n/locales/es.js +1 -1
- package/dist/i18n/locales/source-keys.d.ts +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/scope/KitScope.d.ts +9 -0
- package/dist/scope/KitScope.js +1 -1
- package/dist/scope/context.d.ts +7 -0
- package/dist/shared/format/formatSmartRelative.d.ts +25 -0
- package/dist/shared/format/formatSmartRelative.js +1 -0
- package/dist/shared/format/formatUsd.js +1 -1
- package/dist/shared/icons/{HistoryIcon.d.ts → ActivityIcon.d.ts} +4 -4
- package/dist/shared/icons/{HistoryIcon.js → ActivityIcon.js} +1 -1
- package/dist/shared/orchestrator/activityOpenInput.d.ts +21 -0
- package/dist/shared/orchestrator/createActivityReducers.js +1 -0
- package/dist/shared/orchestrator/index.d.ts +2 -0
- package/dist/shared/orchestrator/index.js +1 -1
- package/dist/shared/orchestrator/resolveActivityEntry.d.ts +1 -0
- package/dist/shared/orchestrator/resolveActivityEntry.js +1 -0
- package/dist/shared/presentation/index.js +1 -0
- package/dist/shared/presentation/types.d.ts +30 -0
- package/dist/shared/presentation/types.js +1 -0
- package/dist/shared/presentation/useResolvedSurfaceKind.js +1 -0
- package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.d.ts +52 -0
- package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.js +1 -0
- package/dist/shared/ui/AdaptiveSurface/index.d.ts +2 -0
- package/dist/shared/ui/AdaptiveSurface/index.js +1 -0
- package/dist/shared/ui/Card/Card.d.ts +12 -9
- package/dist/shared/ui/Card/Card.js +1 -1
- package/dist/shared/ui/Card/Card.styles.js +1 -1
- package/dist/shared/ui/Dialog/Dialog.d.ts +10 -8
- package/dist/shared/ui/Dialog/Dialog.js +1 -1
- package/dist/shared/ui/Drawer/Drawer.d.ts +135 -0
- package/dist/shared/ui/Drawer/Drawer.js +1 -0
- package/dist/shared/ui/Drawer/Drawer.slots.d.ts +19 -0
- package/dist/shared/ui/Drawer/Drawer.slots.js +1 -0
- package/dist/shared/ui/Drawer/Drawer.styles.js +1 -0
- package/dist/shared/ui/Drawer/index.d.ts +2 -0
- package/dist/shared/ui/Drawer/index.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +1 -1
- package/dist/shared/ui/surfaceContext.d.ts +9 -0
- package/dist/shared/ui/surfaceContext.js +1 -0
- package/dist/shared/widgets/activity/ActivityTrigger.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/ActivityTrigger.styles.js +1 -1
- package/dist/shared/widgets/activity/adapters/settlementToWidgetProps.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.d.ts +95 -0
- package/dist/shared/widgets/activity/compound/Activity.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.slots.d.ts +22 -0
- package/dist/shared/widgets/activity/compound/Activity.slots.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.styles.js +1 -0
- package/dist/shared/widgets/{activity-history/compound/ActivityHistoryDetail.d.ts → activity/compound/ActivityDetail.d.ts} +24 -17
- package/dist/shared/widgets/activity/compound/ActivityDetail.js +1 -0
- package/dist/shared/widgets/activity/compound/Row.slots.d.ts +21 -0
- package/dist/shared/widgets/activity/compound/Row.slots.js +1 -0
- package/dist/shared/widgets/activity/compound/Row.styles.js +1 -0
- package/dist/shared/widgets/{activity-history/compound/components/HistoryHeader.d.ts → activity/compound/components/ActivityHeader.d.ts} +8 -8
- package/dist/shared/widgets/activity/compound/components/ActivityHeader.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/compound/components/Empty.d.ts +3 -3
- package/dist/shared/widgets/activity/compound/components/Empty.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/compound/components/ErrorView.d.ts +7 -7
- package/dist/shared/widgets/activity/compound/components/ErrorView.js +1 -0
- package/dist/shared/widgets/activity/compound/components/List.d.ts +23 -0
- package/dist/shared/widgets/activity/compound/components/List.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/compound/components/Row.d.ts +13 -16
- package/dist/shared/widgets/activity/compound/components/Row.js +1 -0
- package/dist/shared/widgets/activity/compound/components/StatusPip.js +1 -0
- package/dist/shared/widgets/activity/compound/context.d.ts +95 -0
- package/dist/shared/widgets/activity/compound/context.js +1 -0
- package/dist/shared/widgets/activity/compound/index.d.ts +8 -0
- package/dist/shared/widgets/activity/compound/index.js +1 -0
- package/dist/shared/widgets/activity/payloads.d.ts +108 -0
- package/dist/shared/widgets/activity/transformers/activityResponseToPayload.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +1 -1
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +2 -3
- package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +1 -1
- package/dist/shared/widgets/asset-picker/compound/types.d.ts +2 -2
- package/dist/stridge/StridgeProvider.d.ts +10 -6
- package/dist/stridge/StridgeProvider.js +1 -1
- package/dist/stridge/stubs.js +1 -1
- package/dist/styles/index.css +89 -0
- package/dist/types.d.ts +2 -1
- package/dist/ui/index.d.ts +5 -1
- package/dist/ui/index.js +1 -1
- package/dist/withdraw/compound/index.d.ts +6 -6
- package/dist/withdraw/widgets/index.d.ts +3 -3
- package/dist/withdraw/widgets/index.js +1 -1
- package/package.json +14 -6
- package/dist/activity-history/compound/index.d.ts +0 -9
- package/dist/activity-history/compound/index.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryDetail.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.d.ts +0 -38
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/index.d.ts +0 -2
- package/dist/flows/deposit/widgets/activity-history/index.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/useDepositActivityHistorySource.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryDetail.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.d.ts +0 -36
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/index.d.ts +0 -2
- package/dist/flows/withdraw/widgets/activity-history/index.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/useWithdrawActivityHistorySource.js +0 -1
- package/dist/shared/widgets/activity-history/ActivityTrigger.js +0 -1
- package/dist/shared/widgets/activity-history/adapters/settlementToWidgetProps.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.d.ts +0 -95
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.d.ts +0 -22
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.styles.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistoryDetail.js +0 -1
- package/dist/shared/widgets/activity-history/compound/Row.slots.d.ts +0 -21
- package/dist/shared/widgets/activity-history/compound/Row.slots.js +0 -1
- package/dist/shared/widgets/activity-history/compound/Row.styles.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/Empty.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/ErrorView.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/HistoryHeader.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/List.d.ts +0 -23
- package/dist/shared/widgets/activity-history/compound/components/List.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/Row.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/StatusPip.js +0 -1
- package/dist/shared/widgets/activity-history/compound/context.d.ts +0 -79
- package/dist/shared/widgets/activity-history/compound/context.js +0 -1
- package/dist/shared/widgets/activity-history/payloads.d.ts +0 -81
- package/dist/shared/widgets/activity-history/transformers/historyResponseToPayload.js +0 -1
- /package/dist/shared/widgets/{activity-history → activity}/index.js +0 -0
- /package/dist/shared/widgets/{activity-history → activity}/transformers/resolveDirection.js +0 -0
|
@@ -10,12 +10,13 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
10
10
|
*
|
|
11
11
|
* Two trailing affordances flank the close X:
|
|
12
12
|
*
|
|
13
|
-
* 1. **Activity
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `
|
|
13
|
+
* 1. **Activity trigger** — `<ActivityTrigger>` button. Gated on the host mounting the standalone
|
|
14
|
+
* {@link ActivityDriver} (Q4=(D) — activity is owned by the standalone driver, not the deposit
|
|
15
|
+
* driver). When omitted, the icon hides gracefully so per-flow-only integrations stay clean.
|
|
16
|
+
* FSM-state gating is handled upstream by the steps router — this header only mounts on the
|
|
17
|
+
* `deposit` (method-picker) state, so a separate state allow-list would be redundant. Tap
|
|
18
|
+
* fires `actions.openActivity()` which transitions the per-flow FSM into `activityList` with
|
|
19
|
+
* the source step snapshotted into `ctx.backTarget`.
|
|
19
20
|
* 2. `<Dialog.CloseButton>` — kit's canonical close affordance.
|
|
20
21
|
*/
|
|
21
22
|
declare function DepositHeader({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useOptionalActivityDriverInstance as e}from"../../../../../activity/driver/context.js";import{useLingui as t}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{useDepositActions as n}from"../../../../orchestrator/controller.js";import{Dialog as r}from"../../../../../../shared/ui/Dialog/Dialog.js";import"../../../../../../shared/ui/Dialog/index.js";import{Card as i}from"../../../../../../shared/ui/Card/Card.js";import{text as a}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{ActivityTrigger as o}from"../../../../../../shared/widgets/activity/ActivityTrigger.js";import"../../../../../../shared/widgets/activity/index.js";import{useDepositContext as s}from"../context.js";import{DEPOSIT_SLOTS as c}from"../Deposit.slots.js";import{styles as l}from"../Deposit.styles.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"@stylexjs/stylex";function p({title:p}={}){let m=s(`Deposit.Header`),{_:h}=t(),{openActivity:g}=n(),_=e()!==null,v=p??m.title??h({id:`kj3M8S`,message:`Deposit`});return d(i.Header,{"data-stridge-slot":c.header,...f.props(l.header),children:[u(a.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,children:v}),d(`div`,{...f.props(l.headerTrailing),children:[_?u(o,{onOpen:g}):null,u(r.CloseButton,{})]})]})}export{p as DepositHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{bucketFromSettlement as e,useBannerAckForSettlement as t}from"../../../../banners/useBannerAck.js";import"../../../../banners/index.js";import{
|
|
1
|
+
"use client";import{bucketFromSettlement as e,useBannerAckForSettlement as t}from"../../../../banners/useBannerAck.js";import"../../../../banners/index.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositSnapshot as r}from"../../driver/context.js";import{useDepositActions as i,useDepositState as a}from"../../orchestrator/controller.js";import{stepRendersSettlement as o}from"../../orchestrator/steps.js";import{DepositStatusBanner as s}from"./compound/DepositStatusBanner.js";import"./compound/index.js";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{AnimatePresence as p}from"motion/react";function m({children:s}={}){let l=r(),u=a().name,{resumeToProcessing:f,resumeToSuccess:m,resumeToError:g}=i(),{_:v}=n(),y=l.settlement,b=y.status===`ready`||y.status===`stale`?y.payload:void 0,{acked:x,ack:S}=t(b),C=(u===`success`||u===`error`)&&e(b)?.bucket===`terminal`;c(()=>{C&&!x&&S()},[C,x,S]);let w=b!==void 0&&!x&&!o(u);function T(e){return()=>{S(),e()}}return d(p,{children:w&&b?d(h,{payload:b,brandName:l.brand.status===`ready`||l.brand.status===`stale`?l.brand.payload.name:void 0,onDismiss:S,onResumeToProcessing:()=>f(`wallet`,_(b)),onResumeToSuccess:T(()=>m(`wallet`,_(b))),onResumeToError:T(()=>g(_(b))),labels:{completed:v({id:`3kg1gB`,message:`Deposit completed`}),didntComplete:v({id:`Rxjdjn`,message:`Deposit didn't complete`}),receivedProcessing:v({id:`junZX6`,message:`Deposit received and processing…`}),creditedToBrand:e=>v({id:`IRogzB`,message:`Your deposit has been credited to {brand}.`,values:{brand:e}}),creditedToAccount:v({id:`9JHY2T`,message:`Your deposit has been credited to your account.`}),fundsSafe:v({id:`Z1WbO6`,message:`Funds are safe on the source chain — contact support to recover.`}),willBeCreditedToBrand:e=>v({id:`TG4WOd`,message:`Your deposit will be credited to {brand}.`,values:{brand:e}}),willBeCreditedToAccount:v({id:`Offl0a`,message:`Your deposit will be credited to your account.`})},children:s},`banner`):null})}function h({payload:e,brandName:t,onDismiss:n,onResumeToProcessing:r,onResumeToSuccess:i,onResumeToError:a,labels:o,children:c}){let[p,m]=l(!1),h=()=>m(e=>!e),_=e.kind,v={symbol:e.creditedAsset.symbol,...e.creditedAsset.address?{address:e.creditedAsset.address}:{},...e.creditedAsset.isNative===void 0?{}:{isNative:e.creditedAsset.isNative},...e.creditedAsset.assetLogoUrl?{logoUrl:e.creditedAsset.assetLogoUrl}:{}},y=_===`succeeded`?o.completed:_===`failed`?o.didntComplete:o.receivedProcessing,b=_===`succeeded`?t?o.creditedToBrand(t):o.creditedToAccount:_===`failed`?o.fundsSafe:t?o.willBeCreditedToBrand(t):o.willBeCreditedToAccount,x=g(e),S=e.kind===`succeeded`&&e.completionTx?{hash:e.completionTx.hash.formatted,...e.completionTx.explorerUrl?{explorerUrl:e.completionTx.explorerUrl}:{}}:void 0,C=e.kind===`succeeded`||e.kind===`failed`?e.submittedAt.formatted:void 0,w=e.kind===`succeeded`?e.filledAt.formatted:void 0,T=_===`succeeded`?i:_===`failed`?a:r;return d(s,{kind:_,asset:v,headline:y,subline:b,expanded:p,onToggleExpanded:h,onDismiss:n,...x?{depositTx:x}:{},...S?{completionTx:S}:{},...C===void 0?{}:{submittedAt:C},...w===void 0?{}:{filledAt:w},onPrimaryAction:T,children:c??f(u,{children:[f(s.Body,{children:[d(s.Hero,{}),d(s.Close,{})]}),f(s.Details,{children:[d(s.DepositTxRow,{}),d(s.CompletionTxRow,{}),d(s.SubmittedAtRow,{}),d(s.FilledAtRow,{})]}),f(s.Footer,{children:[d(s.Toggle,{}),d(s.PrimaryAction,{})]})]})})}function g(e){if(e.kind===`succeeded`)return{hash:e.depositTx.hash.formatted,...e.depositTx.explorerUrl?{explorerUrl:e.depositTx.explorerUrl}:{}};if(e.kind===`failed`||e.txHash)return{hash:e.txHash.formatted,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}}function _(e){return e.kind===`succeeded`?{hash:e.depositTx.hash.value,...e.depositTx.explorerUrl?{explorerUrl:e.depositTx.explorerUrl}:{}}:e.kind===`failed`?{hash:e.txHash.value,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}:{hash:e.txHash?.value??``,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}}(function(e){e.Body=s.Body,e.Hero=s.Hero,e.Close=s.Close,e.Details=s.Details,e.DepositTxRow=s.DepositTxRow,e.CompletionTxRow=s.CompletionTxRow,e.SubmittedAtRow=s.SubmittedAtRow,e.FilledAtRow=s.FilledAtRow,e.Footer=s.Footer,e.Toggle=s.Toggle,e.PrimaryAction=s.PrimaryAction})(m||={});export{m as DepositStatusBanner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as t}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useDepositSnapshot as n}from"../../driver/context.js";import{useDepositActions as r,useDepositEffectiveState as i}from"../../orchestrator/controller.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ErrorState as o}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as s}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";function d({children:a,...d}){let f=n(),p=i(),{tryAgain:m}=r(),{_:h}=e(),g=t();if(p.name!==`error`)return null;let _=f.settlement,v=_.status===`ready`&&_.payload.kind===`failed`?_.payload:void 0,y=p.name===`error`?p.ctx.failure:void 0,b=h({id:`i-4Fbp`,message:`Deposit failed`}),x=v?g(v.failureKind):y?.reason;if(!v)return l(o,{...d,headline:b,...x?{reason:x}:{},onTryAgain:m,children:a??u(c,{children:[l(o.Header,{}),l(o.Body,{children:l(o.Hero,{})}),l(o.Actions,{})]})});let S=v,C={...S.sourceWallet.name===void 0?{}:{name:S.sourceWallet.name},address:S.sourceWallet.address.formatted,...S.sourceWallet.explorerUrl?{explorerUrl:S.sourceWallet.explorerUrl}:{}},w={...S.destination.name===void 0?{}:{name:S.destination.name},address:S.destination.address.formatted},T=s(S.creditedAsset)??{symbol:S.creditedAsset.symbol},E={hash:S.txHash.formatted,...S.txExplorerUrl?{explorerUrl:S.txExplorerUrl}:{}};return l(o,{...d,headline:b,...x?{reason:x}:{},sourceWallet:C,destination:w,receiveAmount:S.receiveAmount.formatted,receiveAsset:T,depositTx:E,submittedAt:S.submittedAt.formatted,failedAt:S.failedAt.formatted,onTryAgain:m,children:a??u(c,{children:[l(o.Header,{}),u(o.Body,{children:[l(o.Hero,{}),u(o.Details,{children:[l(o.FillStatusRow,{}),l(o.SourceRow,{}),l(o.DestinationRow,{}),l(o.YouReceiveRow,{}),u(o.MoreDetails,{children:[l(o.DepositTxRow,{}),l(o.SubmittedAtRow,{}),l(o.FailedAtRow,{})]})]}),l(o.HelpInfo,{})]}),l(o.Actions,{})]})})}function f({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return l(a,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:l(d,{...i})})}(function(e){e.Dialog=f,e.Header=o.Header,e.Body=o.Body,e.Hero=o.Hero,e.Details=o.Details,e.FillStatusRow=o.FillStatusRow,e.SourceRow=o.SourceRow,e.DestinationRow=o.DestinationRow,e.YouReceiveRow=o.YouReceiveRow,e.MoreDetails=o.MoreDetails,e.DepositTxRow=o.DepositTxRow,e.SubmittedAtRow=o.SubmittedAtRow,e.FailedAtRow=o.FailedAtRow,e.HelpInfo=o.HelpInfo,e.Actions=o.Actions})(d||={});export{d as ErrorState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositSnapshot as t}from"../../driver/context.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{shortenAddress as i}from"../../../../shared/format/shortenAddress.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ProcessingState as o}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=l(s,{children:[c(o.Header,{}),l(o.Body,{children:[c(o.Hero,{}),c(o.StatusPill,{}),l(o.Details,{children:[c(o.SourceRow,{}),c(o.SourceTxRow,{}),c(o.SubmittedAtRow,{}),c(o.DetectedAtRow,{})]})]})]});function d({children:a,...s}){let l=t(),d=r(),{back:f}=n(),{_:p}=e();if(d.name!==`processing`)return null;let m=l.settlement,h=(m.status===`ready`||m.status===`stale`)&&m.payload.kind===`pending`?m.payload:void 0,g=l.brand,_=g.status===`ready`||g.status===`stale`?g.payload.name:void 0,v=l.target,y=v.status===`ready`||v.status===`stale`?v.payload:void 0,b=l.wallet,x=b.status===`ready`||b.status===`stale`?b.payload:void 0,S=!h||h.receiveAmount.value===0,C=h?h.receiveAmount.formatted:``,w=h?.creditedAsset.symbol??y?.symbol??``,T=h?.creditedTo||_||w,E=d.ctx.tx,D=h?.txHash?.formatted??(E.hash?i(E.hash):``),O=h?.txExplorerUrl??E.explorerUrl,k=h?.sourceWallet.name??p({id:`sb9Y58`,message:`Wallet`}),A=h?.sourceWallet.address.formatted??x?.address.formatted??``,j=h?.sourceWallet.explorerUrl,M=A?{name:k,address:A,...j?{explorerUrl:j}:{}}:void 0,N=D?{hash:D,...O?{explorerUrl:O}:{}}:void 0;return c(o,{...s,amount:C,creditedAsset:{symbol:w},creditedTo:T,...S?{loading:!0}:{},onBack:f,...M?{sourceWallet:M}:{},...N?{sourceTx:N}:{},...h?.submittedAt?{submittedAt:h.submittedAt.formatted}:{},...h?.detectedAt?{detectedAt:h.detectedAt.formatted}:{},children:a??u})}function f({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return c(a,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:c(d,{...i})})}(function(e){e.Dialog=f,e.Header=o.Header,e.Body=o.Body,e.Hero=o.Hero,e.StatusPill=o.StatusPill,e.Details=o.Details,e.SourceRow=o.SourceRow,e.SourceTxRow=o.SourceTxRow,e.SubmittedAtRow=o.SubmittedAtRow,e.DetectedAtRow=o.DetectedAtRow})(d||={});export{d as ProcessingState};
|
|
@@ -7,10 +7,11 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
7
7
|
* the trailing flex child only when the widget is mounted inside
|
|
8
8
|
* `Dialog.Content`.
|
|
9
9
|
*
|
|
10
|
-
* Activity
|
|
10
|
+
* Activity trigger — when the host mounts the standalone {@link ActivityDriver}, an
|
|
11
11
|
* `<ActivityTrigger>` button renders next to the close X and opens the cross-flow activity
|
|
12
|
-
* surface.
|
|
13
|
-
*
|
|
12
|
+
* surface. Q4=(D) — activity is owned by the standalone driver; the icon hides gracefully when
|
|
13
|
+
* the host opts out. The steps router only mounts this header on `transferCrypto`, so no
|
|
14
|
+
* additional FSM-state gating is needed.
|
|
14
15
|
*/
|
|
15
16
|
declare function TransferCryptoHeader({
|
|
16
17
|
onBack,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useOptionalActivityDriverInstance as e}from"../../../../../activity/driver/context.js";import{useLingui as t}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{useDepositActions as n}from"../../../../orchestrator/controller.js";import{ChevronLeftIcon as r}from"../../../../../../shared/icons/ChevronLeftIcon.js";import"../../../../../../icons/index.js";import{IconButton as i}from"../../../../../../shared/ui/IconButton/IconButton.js";import{Dialog as a}from"../../../../../../shared/ui/Dialog/Dialog.js";import"../../../../../../shared/ui/Dialog/index.js";import{Card as o}from"../../../../../../shared/ui/Card/Card.js";import{text as s}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{ActivityTrigger as c}from"../../../../../../shared/widgets/activity/ActivityTrigger.js";import"../../../../../../shared/widgets/activity/index.js";import{TRANSFER_CRYPTO_SLOTS as l}from"../TransferCrypto.slots.js";import{styles as u}from"../TransferCrypto.styles.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";import*as p from"@stylexjs/stylex";function m({onBack:m,title:h}){let{_:g}=t(),{openActivity:_}=n(),v=e()!==null,y=h??g({id:`3dqPLT`,message:`Transfer Crypto`});return f(o.Header,{"data-stridge-slot":l.header,...p.props(u.header),children:[f(`div`,{...p.props(u.headerLeft),children:[typeof m==`function`?d(i,{"aria-label":g({id:`iH8pgl`,message:`Back`}),onClick:m,children:d(r,{"aria-hidden":!0,...p.props(u.backIcon)})}):null,d(s.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,style:{margin:0},children:y})]}),f(`div`,{...p.props(u.headerTrailing),children:[v?d(c,{onOpen:_}):null,d(a.CloseButton,{})]})]})}export{m as TransferCryptoHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawState as n}from"../orchestrator/controller.js";import{useWithdraw as r}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as i}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as a}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as o}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{Withdraw as s}from"../widgets/withdraw/compound/Withdraw.js";import"../../../withdraw/compound/index.js";import{
|
|
1
|
+
"use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawState as n}from"../orchestrator/controller.js";import{useWithdraw as r}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as i}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as a}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as o}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{Withdraw as s}from"../widgets/withdraw/compound/Withdraw.js";import"../../../withdraw/compound/index.js";import{WithdrawActivityDetail as c}from"../widgets/activity/WithdrawActivityDetail.js";import{WithdrawActivityList as l}from"../widgets/activity/WithdrawActivityList.js";import{WithdrawError as u}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawForm as d}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as f}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as p}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../withdraw/widgets/index.js";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({container:g,metadata:_,onError:v,balance:y,onSubmit:b,suggestedRecipient:x}={}){let S=n(),{close:C}=r(),w=t(),T=S.name!==`closed`;return i({state:S,settlement:w.settlement,quote:w.quote,metadata:_}),a(),e({...y===void 0?{}:{balance:y},...b?{onSubmit:b}:{},...x?{suggestedRecipient:x}:{}}),m(o,{open:T,onOpenChange:e=>e?void 0:C(),children:m(o.Content,{container:g,children:m(s.Boundary,{...v?{onError:v}:{},children:m(s.Guards,{children:h(s.Steps,{children:[m(s.Step,{name:`form`,children:m(d,{})}),m(s.Step,{name:`inProgress`,children:m(f,{})}),m(s.Step,{name:`success`,children:m(p,{})}),m(s.Step,{name:`error`,children:m(u,{})}),m(s.Step,{name:`activityList`,children:m(l,{})}),m(s.Step,{name:`activityDetail`,children:m(c,{})})]})})})})})}export{g as WithdrawDialog};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Entity, SettlementFailureKind, TxRef } from "../../../shared/driver/types.js";
|
|
2
2
|
import { FormattedField } from "../../../shared/format/types.js";
|
|
3
|
-
import { ActivityHistoryPayload } from "../../../shared/widgets/activity-history/payloads.js";
|
|
4
3
|
import { ReceiveOptionDto, ReceiveOptionsResponse, WithdrawableBalanceDto, WithdrawableBalancesResponse, WithdrawalQuoteDto, WithdrawalQuoteResponse, WithdrawalSettlementDto, WithdrawalSettlementResponse } from "./dto.js";
|
|
5
4
|
import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItemPayload, WithdrawalQuoteBreakdownPayload, WithdrawalQuotePayload, WithdrawalReceiveAssetPayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "./payloads.js";
|
|
6
|
-
import { GatewayPollResponse, GatewayUdaDto } from "@stridge/sdk";
|
|
7
5
|
|
|
8
6
|
//#region src/flows/withdraw/driver/types.d.ts
|
|
9
7
|
/**
|
|
@@ -53,15 +51,6 @@ interface WithdrawSnapshot {
|
|
|
53
51
|
* `<StridgeProvider flows.withdraw.maxAmountUsd>` and constant across the driver's lifetime.
|
|
54
52
|
*/
|
|
55
53
|
maxAmountUsd?: FormattedField<number>;
|
|
56
|
-
/**
|
|
57
|
-
* Owner-scoped recent activity. Backed by the same multi-UDA envelope from
|
|
58
|
-
* `GET /gateway/{owner}` the deposit flow consumes — the list spans both deposit-direction
|
|
59
|
-
* and withdraw-direction settlements for the connected owner. Drives the kit's in-dialog
|
|
60
|
-
* `<ActivityHistory>` surface. `idle` when no fetch has run yet; `loading` during the first
|
|
61
|
-
* fetch; `ready` / `stale` once a list has landed; `error` when the initial fetch failed and
|
|
62
|
-
* the list is empty.
|
|
63
|
-
*/
|
|
64
|
-
history: Entity<ActivityHistoryPayload, ReadonlyArray<GatewayUdaDto>, GatewayPollResponse>;
|
|
65
54
|
}
|
|
66
55
|
/**
|
|
67
56
|
* Input to {@link WithdrawDriver.requestQuote}. The form widget builds this from current field
|
|
@@ -202,29 +191,6 @@ interface WithdrawDriver {
|
|
|
202
191
|
* into its own snapshot. Hosts that surface a static brand-side balance can omit this.
|
|
203
192
|
*/
|
|
204
193
|
watchWithdrawableBalances?(input: WatchWithdrawableBalancesInput, listener: (entity: WithdrawSnapshot["withdrawableBalances"]) => void, signal: AbortSignal): void;
|
|
205
|
-
/**
|
|
206
|
-
* Owner-scoped activity refresh. Calls `GET /gateway/{owner}` without a destination tuple,
|
|
207
|
-
* collapses the multi-UDA envelope into a row payload, and updates {@link
|
|
208
|
-
* WithdrawSnapshot.history} in place. Mirrors the deposit driver's contract — the kit's
|
|
209
|
-
* `<ActivityHistory>` surface is shared between the two dialogs, so both drivers expose the
|
|
210
|
-
* same refresh action. Used as the imperative one-shot trigger — the activity surface's
|
|
211
|
-
* error-view retry button calls this. Steady-state recurring fetches land via
|
|
212
|
-
* {@link watchHistory}. Optional — drivers that don't have a multi-UDA history concept can
|
|
213
|
-
* omit it, in which case the activity header icon is hidden.
|
|
214
|
-
*/
|
|
215
|
-
refreshHistory?(signal: AbortSignal): void;
|
|
216
|
-
/**
|
|
217
|
-
* Long-running adaptive poll of `GET /gateway/{owner}` (unfiltered). Updates
|
|
218
|
-
* {@link WithdrawSnapshot.history} in place every tick. Cadence adapts to the
|
|
219
|
-
* current payload — short interval while any row is `pending`, long interval
|
|
220
|
-
* once all rows are terminal. Mounted by the controller while the FSM is on
|
|
221
|
-
* `history`; aborted on transition out.
|
|
222
|
-
*
|
|
223
|
-
* Optional — drivers that don't have a multi-UDA history concept can omit
|
|
224
|
-
* it. When omitted alongside {@link refreshHistory}, the activity surface
|
|
225
|
-
* stays cold (only the initial paint, no live updates).
|
|
226
|
-
*/
|
|
227
|
-
watchHistory?(signal: AbortSignal): void;
|
|
228
194
|
}
|
|
229
195
|
//#endregion
|
|
230
196
|
export { PrepareWithdrawalInput, RequestWithdrawalQuoteInput, WatchWithdrawableBalancesInput, WatchWithdrawalSettlementInput, WithdrawDriver, WithdrawPreparation, WithdrawSnapshot };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useOptionalActivityDriverInstance as e}from"../../activity/driver/context.js";import{useLingui as t}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{toFailure as n}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as r}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as i}from"../../../shared/orchestrator/useEffectiveState.js";import{useSettlementWatcher as a}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{useWithdrawBindingsRef as o}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawDriverInstance as s}from"../driver/context.js";import{initialState as c,reducer as l}from"./reducer.js";import{createContext as u,use as d,useCallback as f,useEffect as p,useMemo as m,useReducer as h,useRef as g}from"react";import{jsx as _}from"react/jsx-runtime";const v={id:`ldK3jJ`,message:`Failed to submit withdrawal.`},y={id:`kUFhUv`,message:`Withdrawal failed.`},b={id:`srsA0x`,message:`Withdrawal declined.`},x=u(null);x.displayName=`WithdrawControllerContext`;function S(){let e=d(x);if(!e)throw Error(`useWithdraw / WithdrawControllerProvider must be used inside <KitProvider withdraw={…} />. Mount KitProvider once at the host's app root with a withdraw driver.`);return e}function C(){return d(x)}function w(){return S().state}function T(){return S().effectiveState}function E(){return S().actions}function D({children:t}){let n=s(),r=e(),[o,u]=h(l,c),d=k(o,u,n,r),f=o.name===`inProgress`?{form:o.ctx.input,submittedAt:o.ctx.submittedAt,...o.ctx.tx?{tx:o.ctx.tx}:{}}:void 0;a(n,f,f?`${f.submittedAt}|${f.tx?.hash??``}`:void 0),A(r,o.name===`activityList`||o.name===`activityDetail`),j(o,u,n);let p=i(o),g=O(u,d,n);return _(x,{value:m(()=>({state:o,effectiveState:p,dispatch:u,controller:g,actions:d}),[o,p,g,d]),children:t})}function O(e,t,n){let r=g(n);r.current=n;let i=f(t=>(r.current.arm(),e({type:`OPEN`}),!0),[e]),a=f(()=>{e({type:`CLOSE`})},[e]);return m(()=>({open:i,close:a,actions:t}),[i,a,t])}function k(e,r,i,a){let s=g(e);s.current=e;let c=g(i);c.current=i;let l=g(a);l.current=a;let u=g(r);u.current=r;let{i18n:d}=t(),p=g(d);p.current=d;let h=o(),_=f(e=>{let t=c.current;u.current({type:`SUBMIT`,input:e});let r=new AbortController,i={sourceAssetSymbol:e.sourceAssetSymbol,sourceChainId:e.sourceChainId,amount:e.amount,receiveTokenSymbol:e.receiveTokenSymbol,receiveChainId:e.receiveChainId,recipientAddress:e.recipientAddress},a={beginProcessing(e){u.current({type:`BEGIN_PROCESSING`,submittedAt:Date.now(),...e?{tx:e}:{}});try{l.current?.invalidateActivity?.()}catch{}},setTxHash(e){u.current({type:`SET_TX_HASH`,tx:e,submittedAt:Date.now()})},fail(e){u.current({type:`MARK_FAILED`,...e?{failure:e}:{}})},decline(){u.current({type:`SUBMIT_FAILED`,failure:{reason:p.current._(b),code:`UserRejectedRequestError`},input:e})},succeed(){u.current({type:`MARK_SUCCEEDED`})}};t.prepareWithdrawal(i,r.signal).then(i=>{if(r.signal.aborted)return;let o=h.current.onSubmit;if(!o){u.current({type:`SUBMIT_FAILED`,failure:n(Error(`WithdrawDialog onSubmit is missing.`),p.current._(v)),input:e});return}let s=t.getSnapshot().quote,c=s.status===`ready`||s.status===`stale`?s.payload:void 0;try{let t=o({form:e,depositTarget:i.depositTarget,correlation:i.correlation,...c?{quote:c}:{}},a,r.signal);t&&typeof t.catch==`function`&&t.catch(t=>{r.signal.aborted||u.current({type:`SUBMIT_FAILED`,failure:n(t,p.current._(v)),input:e})})}catch(t){if(r.signal.aborted)return;u.current({type:`SUBMIT_FAILED`,failure:n(t,p.current._(v)),input:e})}}).catch(t=>{r.signal.aborted||u.current({type:`SUBMIT_FAILED`,failure:n(t,p.current._(v)),input:e})})},[]),y=f(()=>{u.current({type:`CLOSE`})},[]),x=f(()=>{u.current({type:`RESET`})},[]),S=f(()=>{u.current({type:`CLEAR_NOTICE`})},[]),C=f(()=>{u.current({type:`BACK`})},[]),w=f(()=>{if(l.current==null){process.env.NODE_ENV!==`production`&&console.warn("[@stridge/kit] useWithdrawActions().openActivity() was called but no activity driver is mounted. Wrap the host with `<KitProvider activity={…}>` (or `<StridgeProvider>` with any flow enabled) to enable the activity surface.");return}s.current.name===`form`&&u.current({type:`OPEN_ACTIVITY`})},[]),T=f(e=>{u.current({type:`SELECT_SETTLEMENT`,settlementId:e})},[]);return m(()=>({submit:_,close:y,reset:x,clearNotice:S,back:C,openActivity:w,selectSettlement:T}),[_,y,x,S,C,w,T])}function A(e,t){p(()=>{if(!t||!e)return;let n=new AbortController;return e.watchActivity(n.signal),()=>n.abort()},[t,e])}function j(e,n,i){let a=g(e);a.current=e;let{i18n:o}=t(),s=g(o);s.current=o,r(i,(e,t)=>{if(a.current.name===`inProgress`){if(e===`succeeded`){n({type:`SETTLEMENT_SUCCEEDED`});return}if(e===`failed`){let e=t.settlement,r=e.status===`ready`||e.status===`stale`?e.payload:null,i=r&&r.kind===`failed`?{reason:s.current._(y),code:r.failureKind}:void 0;n({type:`SETTLEMENT_FAILED`,...i?{failure:i}:{}})}}})}export{D as WithdrawControllerProvider,S as useControllerContext,C as useOptionalControllerContext,E as useWithdrawActions,T as useWithdrawEffectiveState,w as useWithdrawState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createActivityReducers as e}from"../../../shared/orchestrator/createActivityReducers.js";import{isUserRejectionFailure as t}from"../../../shared/orchestrator/userRejection.js";import"../../../shared/orchestrator/index.js";const n={name:`closed`},{reduceFromActivityList:r,reduceFromActivityDetail:i}=e({activityList:e=>({name:`activityList`,ctx:{backTarget:e}}),activityDetail:(e,t,n)=>({name:`activityDetail`,ctx:{settlementId:e,backTarget:t,viaList:n}}),closed:()=>({name:`closed`}),restoreFromBackTarget:e=>f(e)});function a(e,t){switch(e.name){case`closed`:return o(t);case`form`:return s(e,t);case`submitting`:return c(e,t);case`inProgress`:return l(e,t);case`success`:return u(e,t);case`error`:return d(e,t);case`activityList`:return r(e,t);case`activityDetail`:return i(e,t);default:return p(e)}}function o(e){return e.type===`OPEN`?{name:`form`}:{name:`closed`}}function s(e,t){switch(t.type){case`SUBMIT`:return{name:`submitting`,ctx:{input:t.input}};case`CLEAR_NOTICE`:return e.ctx?.notice?{name:`form`}:e;case`OPEN_ACTIVITY`:return{name:`activityList`,ctx:{backTarget:{kind:`form`,...e.ctx?.notice?{notice:e.ctx.notice}:{}}}};case`CLOSE`:return{name:`closed`};default:return e}}function c(e,n){switch(n.type){case`BEGIN_PROCESSING`:return{name:`inProgress`,ctx:{input:e.ctx.input,submittedAt:n.submittedAt,...n.tx?{tx:n.tx}:{}}};case`SET_TX_HASH`:return{name:`inProgress`,ctx:{input:e.ctx.input,submittedAt:n.submittedAt,tx:n.tx}};case`MARK_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input}};case`MARK_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,...n.failure?{failure:n.failure}:{}}};case`SUBMIT_FAILED`:return t(n.failure)?{name:`form`,ctx:{notice:n.failure.reason}}:{name:`error`,ctx:{input:n.input,failure:n.failure}};case`CLOSE`:return{name:`closed`};default:return e}}function l(e,t){switch(t.type){case`SET_TX_HASH`:return{name:`inProgress`,ctx:{...e.ctx,tx:t.tx}};case`BEGIN_PROCESSING`:return{name:`inProgress`,ctx:{input:e.ctx.input,submittedAt:e.ctx.submittedAt,...e.ctx.tx?{tx:e.ctx.tx}:t.tx?{tx:t.tx}:{}}};case`MARK_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{}}};case`MARK_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{},...t.failure?{failure:t.failure}:{}}};case`SETTLEMENT_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{}}};case`SETTLEMENT_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{},...t.failure?{failure:t.failure}:{}}};case`CLOSE`:return{name:`closed`};default:return e}}function u(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function d(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function f(e){return e.notice?{name:`form`,ctx:{notice:e.notice}}:{name:`form`}}function p(e){throw Error(`Unhandled withdraw state: ${JSON.stringify(e)}`)}export{n as initialState,a as reducer};
|
|
@@ -31,13 +31,11 @@ interface WithdrawalFormSnapshot {
|
|
|
31
31
|
amountUsd?: string;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Where `BACK` lands when the user exits the activity surface. Encoded once at `
|
|
35
|
-
* time
|
|
36
|
-
*
|
|
37
|
-
* `kind` slot lets the shape grow if the form ever splits into multiple steps (mirrors deposit
|
|
38
|
-
* for cross-flow symmetry).
|
|
34
|
+
* Where `BACK` lands when the user exits the activity surface. Encoded once at `OPEN_ACTIVITY`
|
|
35
|
+
* time — the in-flow header icon is the only way into withdraw activity now (direct-entry
|
|
36
|
+
* migrated to `useActivity()`), so the form is always the source step.
|
|
39
37
|
*/
|
|
40
|
-
interface
|
|
38
|
+
interface ActivityBackTarget {
|
|
41
39
|
kind: "form";
|
|
42
40
|
notice?: string;
|
|
43
41
|
}
|
|
@@ -99,24 +97,28 @@ type WithdrawState = {
|
|
|
99
97
|
};
|
|
100
98
|
} | {
|
|
101
99
|
/**
|
|
102
|
-
* Activity
|
|
103
|
-
* snapshots the source state (including any inline notice) at `
|
|
100
|
+
* Activity list — reachable from `form` via the header icon. `backTarget`
|
|
101
|
+
* snapshots the source state (including any inline notice) at `OPEN_ACTIVITY` time so
|
|
104
102
|
* the back chevron can restore it lossless.
|
|
105
103
|
*/
|
|
106
|
-
name: "
|
|
104
|
+
name: "activityList";
|
|
107
105
|
ctx: {
|
|
108
|
-
backTarget:
|
|
106
|
+
backTarget: ActivityBackTarget;
|
|
109
107
|
};
|
|
110
108
|
} | {
|
|
111
109
|
/**
|
|
112
|
-
* Activity
|
|
113
|
-
* `SELECT_SETTLEMENT`. Carries the selected row's id
|
|
114
|
-
*
|
|
110
|
+
* Activity per-settlement detail — reached from `activityList` via
|
|
111
|
+
* `SELECT_SETTLEMENT`. Carries the selected row's id, the same `backTarget` so `BACK`
|
|
112
|
+
* collapses through `activityList` to the original source step, and a `viaList` flag
|
|
113
|
+
* that disambiguates "reached via the list" from "reached imperatively"; the latter
|
|
114
|
+
* skips the list interlude on `BACK`. For direct-entry into the activity surface,
|
|
115
|
+
* see {@link useActivity}.
|
|
115
116
|
*/
|
|
116
|
-
name: "
|
|
117
|
+
name: "activityDetail";
|
|
117
118
|
ctx: {
|
|
118
119
|
settlementId: string;
|
|
119
|
-
backTarget:
|
|
120
|
+
backTarget: ActivityBackTarget;
|
|
121
|
+
viaList: boolean;
|
|
120
122
|
};
|
|
121
123
|
};
|
|
122
124
|
/**
|
|
@@ -138,7 +140,7 @@ type WithdrawStateName = WithdrawState["name"];
|
|
|
138
140
|
* (e.g. their own settlement verification ran independently of Stridge's poll).
|
|
139
141
|
*/
|
|
140
142
|
type WithdrawEvent = {
|
|
141
|
-
type: "OPEN";
|
|
143
|
+
/** Lifecycle entry. Always lands the FSM on `form`. */type: "OPEN";
|
|
142
144
|
} | {
|
|
143
145
|
type: "CLOSE";
|
|
144
146
|
} | {
|
|
@@ -172,33 +174,44 @@ type WithdrawEvent = {
|
|
|
172
174
|
type: "CLEAR_NOTICE";
|
|
173
175
|
} | {
|
|
174
176
|
/**
|
|
175
|
-
* User tapped the back chevron. Legal only from `
|
|
177
|
+
* User tapped the back chevron. Legal only from `activityList` / `activityDetail` today —
|
|
176
178
|
* the form step has no source to return to (closing the dialog is `CLOSE`). Two-step
|
|
177
|
-
* collapse: `
|
|
179
|
+
* collapse: `activityDetail → activityList → source`.
|
|
178
180
|
*/
|
|
179
181
|
type: "BACK";
|
|
180
182
|
} | {
|
|
181
183
|
/**
|
|
182
|
-
* User tapped the header
|
|
183
|
-
* the source state into a {@link
|
|
184
|
+
* User tapped the header activity icon. Legal from `form`; ignored elsewhere. Snapshots
|
|
185
|
+
* the source state into a {@link ActivityBackTarget} so the back chevron can restore it
|
|
184
186
|
* lossless (including any inline notice surfaced after a recent submit failure).
|
|
185
187
|
*/
|
|
186
|
-
type: "
|
|
188
|
+
type: "OPEN_ACTIVITY";
|
|
187
189
|
} | {
|
|
188
190
|
/**
|
|
189
|
-
* User tapped a row in the activity list. Legal only from `
|
|
190
|
-
* to `
|
|
191
|
+
* User tapped a row in the activity list. Legal only from `activityList`; transitions
|
|
192
|
+
* to `activityDetail` carrying the selected `settlementId`.
|
|
191
193
|
*/
|
|
192
194
|
type: "SELECT_SETTLEMENT";
|
|
193
195
|
settlementId: string;
|
|
194
196
|
};
|
|
197
|
+
/**
|
|
198
|
+
* Public open-input variant accepted by `useWithdraw().open()`. Today the withdraw flow has no
|
|
199
|
+
* `{ method }` arm — opening always lands on `form`.
|
|
200
|
+
*
|
|
201
|
+
* For direct-entry into the activity surface, see {@link useActivity}.
|
|
202
|
+
*/
|
|
203
|
+
type WithdrawOpenInput = undefined;
|
|
195
204
|
/**
|
|
196
205
|
* Imperative controller returned by `useWithdraw()`. Mirrors {@link import("#/flows/deposit/orchestrator").DepositController}'s
|
|
197
206
|
* surface so hosts can drive both flows symmetrically. Stable across re-renders.
|
|
198
207
|
*/
|
|
199
208
|
interface WithdrawController {
|
|
200
|
-
/**
|
|
201
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Open the withdraw dialog on `form`. Returns `true` whenever the open() call advanced the
|
|
211
|
+
* dialog past its guards — there is no per-method disable lever on withdraw, so the only
|
|
212
|
+
* `false` path is reserved for forward compatibility. Idempotent.
|
|
213
|
+
*/
|
|
214
|
+
open(input?: WithdrawOpenInput): boolean;
|
|
202
215
|
/** Close the withdraw dialog. Idempotent. */
|
|
203
216
|
close(): void;
|
|
204
217
|
/**
|
|
@@ -233,20 +246,21 @@ interface WithdrawActions {
|
|
|
233
246
|
*/
|
|
234
247
|
clearNotice(): void;
|
|
235
248
|
/**
|
|
236
|
-
* Back-chevron action. Today the chevron is only rendered on the activity
|
|
249
|
+
* Back-chevron action. Today the chevron is only rendered on the activity step
|
|
237
250
|
* (detail → list → source); other steps either render no chevron or close directly via
|
|
238
251
|
* {@link close}.
|
|
239
252
|
*/
|
|
240
253
|
back(): void;
|
|
241
254
|
/**
|
|
242
255
|
* Header-icon entry into the activity surface. Legal from `form`; ignored elsewhere.
|
|
243
|
-
* Snapshots the current state into a {@link
|
|
244
|
-
* lossless.
|
|
256
|
+
* Snapshots the current state into a {@link ActivityBackTarget} so `back()` can restore it
|
|
257
|
+
* lossless. No-ops with a dev-mode warning when no activity driver is mounted (host wired the
|
|
258
|
+
* action without `<KitProvider activity={…}>`).
|
|
245
259
|
*/
|
|
246
|
-
|
|
260
|
+
openActivity(): void;
|
|
247
261
|
/**
|
|
248
262
|
* Open the detail view for a settlement listed on the activity surface. Legal only from
|
|
249
|
-
* `
|
|
263
|
+
* `activityList`; transitions the FSM to `activityDetail`.
|
|
250
264
|
*/
|
|
251
265
|
selectSettlement(settlementId: string): void;
|
|
252
266
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
//#region src/flows/withdraw/widgets/activity
|
|
5
|
-
interface
|
|
4
|
+
//#region src/flows/withdraw/widgets/activity/WithdrawActivityDetail.d.ts
|
|
5
|
+
interface WithdrawActivityDetailOwnProps {
|
|
6
6
|
/**
|
|
7
|
-
* Optional custom composition forwarded to the underlying `<
|
|
7
|
+
* Optional custom composition forwarded to the underlying `<ActivityDetail>`
|
|
8
8
|
* compound. Defaults to mounting all three per-kind parts.
|
|
9
9
|
*/
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Orchestrated activity
|
|
14
|
-
* {@link import("#/flows/deposit/widgets/activity
|
|
15
|
-
* `null` while the FSM is not on `
|
|
13
|
+
* Orchestrated activity detail wrapper for the withdraw dialog. Mirrors
|
|
14
|
+
* {@link import("#/flows/deposit/widgets/activity").DepositActivityDetail}. Renders
|
|
15
|
+
* `null` while the FSM is not on `activityDetail`.
|
|
16
16
|
*/
|
|
17
|
-
declare function
|
|
17
|
+
declare function WithdrawActivityDetail({
|
|
18
18
|
children
|
|
19
|
-
}:
|
|
20
|
-
declare namespace
|
|
21
|
-
type Props =
|
|
19
|
+
}: WithdrawActivityDetailOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
20
|
+
declare namespace WithdrawActivityDetail {
|
|
21
|
+
type Props = WithdrawActivityDetailOwnProps;
|
|
22
22
|
const Processing: ({
|
|
23
23
|
children
|
|
24
24
|
}: {
|
|
@@ -36,4 +36,4 @@ declare namespace WithdrawHistoryDetail {
|
|
|
36
36
|
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
|
-
export {
|
|
39
|
+
export { WithdrawActivityDetail };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ActivitySourceProvider as e}from"../../../../shared/widgets/activity/compound/context.js";import{ActivityDetail as t}from"../../../../shared/widgets/activity/compound/ActivityDetail.js";import"../../../../shared/widgets/activity/compound/index.js";import{useWithdrawActivitySource as n}from"./useWithdrawActivitySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i}){let{sourceValue:a,step:o}=n();return o!==`activityDetail`||!a?null:r(e,{value:a,children:r(t,{children:i})})}(function(e){e.Processing=t.Processing,e.Succeeded=t.Succeeded,e.Failed=t.Failed})(i||={});export{i as WithdrawActivityDetail};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ActivityHeader, ActivityListHeader } from "../../../../shared/widgets/activity/compound/components/ActivityHeader.js";
|
|
2
|
+
import { ActivityEmpty } from "../../../../shared/widgets/activity/compound/components/Empty.js";
|
|
3
|
+
import { ActivityErrorView } from "../../../../shared/widgets/activity/compound/components/ErrorView.js";
|
|
4
|
+
import { ActivityList } from "../../../../shared/widgets/activity/compound/components/List.js";
|
|
5
|
+
import { ActivityRow } from "../../../../shared/widgets/activity/compound/components/Row.js";
|
|
6
|
+
import { ComponentProps, ReactNode } from "react";
|
|
7
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts
|
|
10
|
+
interface WithdrawActivityListOwnProps {
|
|
11
|
+
/**
|
|
12
|
+
* Optional custom composition forwarded to the underlying `<Activity>` compound.
|
|
13
|
+
* Defaults to the compound's `<Header /> + <List />` shape.
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Orchestrated activity list wrapper for the withdraw dialog. Mirrors
|
|
19
|
+
* {@link import("#/flows/deposit/widgets/activity").DepositActivityList}. Renders
|
|
20
|
+
* `null` while the FSM is not on `activityList`.
|
|
21
|
+
*/
|
|
22
|
+
declare function WithdrawActivityList({
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}: ComponentProps<"div"> & WithdrawActivityListOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
26
|
+
declare namespace WithdrawActivityList {
|
|
27
|
+
type Props = ComponentProps<"div"> & WithdrawActivityListOwnProps;
|
|
28
|
+
const Header: typeof ActivityHeader;
|
|
29
|
+
const ListHeader: typeof ActivityListHeader;
|
|
30
|
+
const List: typeof ActivityList;
|
|
31
|
+
const Row: typeof ActivityRow;
|
|
32
|
+
const Empty: typeof ActivityEmpty;
|
|
33
|
+
const ErrorView: typeof ActivityErrorView;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { WithdrawActivityList };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ActivitySourceProvider as e}from"../../../../shared/widgets/activity/compound/context.js";import{Activity as t}from"../../../../shared/widgets/activity/compound/Activity.js";import"../../../../shared/widgets/activity/compound/index.js";import{useWithdrawActivitySource as n}from"./useWithdrawActivitySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i,...a}){let{sourceValue:o,step:s}=n();return s!==`activityList`||!o?null:r(e,{value:o,children:r(t,{...a,children:i})})}(function(e){e.Header=t.Header,e.ListHeader=t.ListHeader,e.List=t.List,e.Row=t.Row,e.Empty=t.Empty,e.ErrorView=t.ErrorView})(i||={});export{i as WithdrawActivityList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./WithdrawActivityDetail.js";import"./WithdrawActivityList.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useOptionalActivityDriverInstance as e,useOptionalActivitySnapshot as t}from"../../../activity/driver/context.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import"../../orchestrator/index.js";import{defaultBlockExplorers as a}from"../../../../shared/utils/explorers.js";import{useCallback as o,useMemo as s}from"react";function c(){let c=r(),l=e(),u=t(),d=i(),{i18n:f}=n(),p=o(e=>{l?.refreshActivity(e)},[l]),m=d.name===`activityList`||d.name===`activityDetail`,h=d.name===`activityDetail`?d.ctx.settlementId:void 0,g=m;return{sourceValue:s(()=>{if(!m||!u)return null;let e=u.activity,t=e.status===`ready`||e.status===`stale`?e.response.owner:`0x0000000000000000000000000000000000000000`,n=e.status===`ready`||e.status===`stale`?e.payload.brandName:void 0,r={i18n:f,sourceWallet:{name:`Wallet`,address:t},explorers:a(),...n?{brandName:n}:{}};return{entity:u.activity,refresh:p,selectSettlement:c.selectSettlement,...g?{back:c.back}:{},...h===void 0?{}:{settlementId:h},settlementContext:r}},[u,c,m,h,f,p,g]),settlementId:h,step:d.name===`activityList`?`activityList`:d.name===`activityDetail`?`activityDetail`:`other`}}export{c as useWithdrawActivitySource};
|
|
@@ -4,13 +4,14 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
4
4
|
//#region src/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Body part — vertical stack hosting the form fields, selectors, summary row, and breakdown
|
|
7
|
-
* card. Becomes the scrollable region when
|
|
7
|
+
* card. Becomes the scrollable region when a parent (dialog content panel, or canvas-mode
|
|
8
|
+
* consumer that caps the body) imposes a block-size constraint.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* `Card.Body` injects its own scroll-area + viewport + inner-flex chain (see `bodyStyles.root`
|
|
11
|
+
* in `Card.styles.ts`), which wraps the children in an extra `<div>` that isolates them from
|
|
12
|
+
* any padding / gap a caller passes via spread props. We wrap the children in our own slot
|
|
13
|
+
* div so the body's `gap: 22px` and `padding: 28/22/22/22` apply where the fields actually
|
|
14
|
+
* live (i.e. as siblings) instead of getting redirected to the viewport.
|
|
14
15
|
*/
|
|
15
16
|
declare function WithdrawFormBody({
|
|
16
17
|
children,
|
|
@@ -13,10 +13,10 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
13
13
|
* freshness window is meaningful (recipient is valid, amount > 0, balance covers it). Mirrors
|
|
14
14
|
* deposit's confirm-deposit timer.
|
|
15
15
|
*
|
|
16
|
-
* Activity
|
|
17
|
-
* `<ActivityTrigger>` button opens the cross-flow activity surface. Gated on
|
|
18
|
-
*
|
|
19
|
-
* additional FSM-state allow-list would be redundant.
|
|
16
|
+
* Activity trigger — between the optional quote timer and the close X, an
|
|
17
|
+
* `<ActivityTrigger>` button opens the cross-flow activity surface. Gated on a standalone
|
|
18
|
+
* activity driver being mounted via `<KitProvider activity={…}>`; the steps router only mounts
|
|
19
|
+
* this header on `form`, so an additional FSM-state allow-list would be redundant.
|
|
20
20
|
*/
|
|
21
21
|
declare function WithdrawFormHeader({
|
|
22
22
|
onBack,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useOptionalActivityDriverInstance as e}from"../../../../../activity/driver/context.js";import{useLingui as t}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{useWithdrawActions as n}from"../../../../orchestrator/controller.js";import{ChevronLeftIcon as r}from"../../../../../../shared/icons/ChevronLeftIcon.js";import"../../../../../../icons/index.js";import{IconButton as i}from"../../../../../../shared/ui/IconButton/IconButton.js";import{Dialog as a}from"../../../../../../shared/ui/Dialog/Dialog.js";import"../../../../../../shared/ui/Dialog/index.js";import{Card as o}from"../../../../../../shared/ui/Card/Card.js";import{text as s}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{ActivityTrigger as c}from"../../../../../../shared/widgets/activity/ActivityTrigger.js";import"../../../../../../shared/widgets/activity/index.js";import{QuoteTimer as l}from"../../../../../../shared/widgets/confirm-transfer/compound/components/QuoteTimer.js";import{useWithdrawFormContext as u}from"../context.js";import{WITHDRAW_FORM_SLOTS as d}from"../WithdrawForm.slots.js";import{styles as f}from"../WithdrawForm.styles.js";import{jsx as p,jsxs as m}from"react/jsx-runtime";import*as h from"@stylexjs/stylex";function g({onBack:g,title:_}){let{_:v}=t(),y=u(`WithdrawForm.Header`),{openActivity:b}=n(),x=e()!==null,S=_??v({id:`OsyKSt`,message:`Withdraw`}),C=y.quoteSeconds!==void 0&&y.quoteTotalSeconds!==void 0&&y.quoteTotalSeconds>0;return m(o.Header,{"data-stridge-slot":d.header,...h.props(f.header),children:[m(`div`,{...h.props(f.headerLeft),children:[typeof g==`function`?p(i,{"aria-label":v({id:`iH8pgl`,message:`Back`}),onClick:g,children:p(r,{"aria-hidden":!0,...h.props(f.backIcon)})}):null,p(s.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,style:{margin:0},children:S})]}),m(`div`,{...h.props(f.headerRight),children:[C?p(l,{seconds:y.quoteSeconds??0,total:y.quoteTotalSeconds}):null,x?p(c,{onOpen:b}):null,p(a.CloseButton,{})]})]})}export{g as WithdrawFormHeader};
|
package/dist/format/index.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { formatDurationCoarse } from "../shared/format/formatDurationCoarse.js";
|
|
|
2
2
|
import { formatDurationCompact } from "../shared/format/formatDurationCompact.js";
|
|
3
3
|
import { formatNetworkName } from "../shared/format/formatNetworkName.js";
|
|
4
4
|
import { formatPercent } from "../shared/format/formatPercent.js";
|
|
5
|
+
import { formatSmartRelative } from "../shared/format/formatSmartRelative.js";
|
|
5
6
|
import { formatTimestamp } from "../shared/format/formatTimestamp.js";
|
|
6
7
|
import { FormatTokenAmountOptions, formatTokenAmount } from "../shared/format/formatTokenAmount.js";
|
|
7
8
|
import { FormatUsdOptions, formatUsd } from "../shared/format/formatUsd.js";
|
|
8
9
|
import { shortenAddress } from "../shared/format/shortenAddress.js";
|
|
9
10
|
import { FormattedField } from "../shared/format/types.js";
|
|
10
|
-
export { type FormatTokenAmountOptions, type FormatUsdOptions, type FormattedField, formatDurationCoarse, formatDurationCompact, formatNetworkName, formatPercent, formatTimestamp, formatTokenAmount, formatUsd, shortenAddress };
|
|
11
|
+
export { type FormatTokenAmountOptions, type FormatUsdOptions, type FormattedField, formatDurationCoarse, formatDurationCompact, formatNetworkName, formatPercent, formatSmartRelative, formatTimestamp, formatTokenAmount, formatUsd, shortenAddress };
|
package/dist/format/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatDurationCoarse as e}from"../shared/format/formatDurationCoarse.js";import{formatDurationCompact as t}from"../shared/format/formatDurationCompact.js";import{formatNetworkName as n}from"../shared/format/formatNetworkName.js";import{formatPercent as r}from"../shared/format/formatPercent.js";import{formatTimestamp as i}from"../shared/format/formatTimestamp.js";import{
|
|
1
|
+
import{formatDurationCoarse as e}from"../shared/format/formatDurationCoarse.js";import{formatDurationCompact as t}from"../shared/format/formatDurationCompact.js";import{formatNetworkName as n}from"../shared/format/formatNetworkName.js";import{formatPercent as r}from"../shared/format/formatPercent.js";import{formatTimestamp as i}from"../shared/format/formatTimestamp.js";import{formatSmartRelative as a}from"../shared/format/formatSmartRelative.js";import{formatTokenAmount as o}from"../shared/format/formatTokenAmount.js";import{formatUsd as s}from"../shared/format/formatUsd.js";import{shortenAddress as c}from"../shared/format/shortenAddress.js";export{e as formatDurationCoarse,t as formatDurationCompact,n as formatNetworkName,r as formatPercent,a as formatSmartRelative,i as formatTimestamp,o as formatTokenAmount,s as formatUsd,c as shortenAddress};
|