@stridge/kit 0.1.0-alpha.51 → 0.1.0-alpha.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/dist/KitProvider.d.ts +11 -0
  2. package/dist/KitProvider.js +1 -1
  3. package/dist/_internal/activity/driver/index.d.ts +3 -0
  4. package/dist/_internal/activity/driver/index.js +1 -0
  5. package/dist/_internal/drivers/stridge/index.d.ts +2 -1
  6. package/dist/_internal/drivers/stridge/index.js +1 -1
  7. package/dist/_internal/drivers/stridge-mock/index.d.ts +2 -1
  8. package/dist/_internal/drivers/stridge-mock/index.js +1 -1
  9. package/dist/activity/compound/index.d.ts +19 -0
  10. package/dist/activity/compound/index.js +1 -0
  11. package/dist/activity/dialog/index.d.ts +3 -0
  12. package/dist/activity/dialog/index.js +1 -0
  13. package/dist/activity/widgets/index.d.ts +4 -0
  14. package/dist/activity/widgets/index.js +1 -0
  15. package/dist/deposit/compound/index.d.ts +9 -9
  16. package/dist/deposit/widgets/index.d.ts +3 -3
  17. package/dist/deposit/widgets/index.js +1 -1
  18. package/dist/drivers/stridge/createStridgeActivityDriver.d.ts +44 -0
  19. package/dist/drivers/stridge/createStridgeActivityDriver.js +1 -0
  20. package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
  21. package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
  22. package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.d.ts +44 -0
  23. package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
  24. package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +0 -2
  25. package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
  26. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +1 -2
  27. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
  28. package/dist/drivers/stridge-mock/fixtures.js +1 -1
  29. package/dist/flows/activity/compound/ActivityFlow.d.ts +46 -0
  30. package/dist/flows/activity/compound/ActivityFlow.js +1 -0
  31. package/dist/flows/activity/compound/components/Boundary.d.ts +29 -0
  32. package/dist/flows/activity/compound/components/Boundary.js +1 -0
  33. package/dist/flows/activity/compound/components/Steps.d.ts +24 -0
  34. package/dist/flows/activity/compound/components/Steps.js +1 -0
  35. package/dist/flows/activity/dialog/ActivityDialog.d.ts +38 -0
  36. package/dist/flows/activity/dialog/ActivityDialog.js +1 -0
  37. package/dist/flows/activity/dialog/ActivityFlowBoundary.d.ts +1 -0
  38. package/dist/flows/activity/dialog/ActivityFlowBoundary.js +1 -0
  39. package/dist/flows/activity/driver/context.d.ts +38 -0
  40. package/dist/flows/activity/driver/context.js +1 -0
  41. package/dist/flows/activity/driver/types.d.ts +58 -0
  42. package/dist/flows/activity/orchestrator/controller.d.ts +11 -0
  43. package/dist/flows/activity/orchestrator/controller.js +1 -0
  44. package/dist/flows/activity/orchestrator/index.d.ts +4 -0
  45. package/dist/flows/activity/orchestrator/index.js +1 -0
  46. package/dist/flows/activity/orchestrator/reducer.d.ts +1 -0
  47. package/dist/flows/activity/orchestrator/reducer.js +1 -0
  48. package/dist/flows/activity/orchestrator/types.d.ts +71 -0
  49. package/dist/flows/activity/orchestrator/useActivity.d.ts +94 -0
  50. package/dist/flows/activity/orchestrator/useActivity.js +1 -0
  51. package/dist/flows/activity/widgets/ActivityDetail.d.ts +41 -0
  52. package/dist/flows/activity/widgets/ActivityDetail.js +1 -0
  53. package/dist/flows/activity/widgets/ActivityList.d.ts +38 -0
  54. package/dist/flows/activity/widgets/ActivityList.js +1 -0
  55. package/dist/flows/activity/widgets/useStandaloneActivitySource.js +1 -0
  56. package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -1
  57. package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
  58. package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -1
  59. package/dist/flows/deposit/driver/types.d.ts +1 -38
  60. package/dist/flows/deposit/orchestrator/controller.js +1 -1
  61. package/dist/flows/deposit/orchestrator/reducer.js +1 -1
  62. package/dist/flows/deposit/orchestrator/types.d.ts +43 -29
  63. package/dist/flows/deposit/widgets/{activity-history/DepositHistoryDetail.d.ts → activity/DepositActivityDetail.d.ts} +11 -11
  64. package/dist/flows/deposit/widgets/activity/DepositActivityDetail.js +1 -0
  65. package/dist/flows/deposit/widgets/activity/DepositActivityList.d.ts +38 -0
  66. package/dist/flows/deposit/widgets/activity/DepositActivityList.js +1 -0
  67. package/dist/flows/deposit/widgets/activity/index.d.ts +2 -0
  68. package/dist/flows/deposit/widgets/activity/index.js +1 -0
  69. package/dist/flows/deposit/widgets/activity/useDepositActivitySource.js +1 -0
  70. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
  71. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
  72. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
  73. package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
  74. package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +7 -6
  75. package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
  76. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
  77. package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
  78. package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
  79. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +4 -3
  80. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
  81. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
  82. package/dist/flows/withdraw/driver/types.d.ts +0 -34
  83. package/dist/flows/withdraw/orchestrator/controller.js +1 -1
  84. package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
  85. package/dist/flows/withdraw/orchestrator/types.d.ts +44 -30
  86. package/dist/flows/withdraw/widgets/{activity-history/WithdrawHistoryDetail.d.ts → activity/WithdrawActivityDetail.d.ts} +11 -11
  87. package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.js +1 -0
  88. package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts +36 -0
  89. package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.js +1 -0
  90. package/dist/flows/withdraw/widgets/activity/index.d.ts +2 -0
  91. package/dist/flows/withdraw/widgets/activity/index.js +1 -0
  92. package/dist/flows/withdraw/widgets/activity/useWithdrawActivitySource.js +1 -0
  93. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +7 -6
  94. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +4 -4
  95. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
  96. package/dist/format/index.d.ts +2 -1
  97. package/dist/format/index.js +1 -1
  98. package/dist/i18n/locales/ar.js +1 -1
  99. package/dist/i18n/locales/es.js +1 -1
  100. package/dist/i18n/locales/source-keys.d.ts +1 -1
  101. package/dist/icons/index.d.ts +2 -2
  102. package/dist/icons/index.js +1 -1
  103. package/dist/index.d.ts +8 -2
  104. package/dist/index.js +1 -1
  105. package/dist/package.js +1 -1
  106. package/dist/shared/format/formatSmartRelative.d.ts +25 -0
  107. package/dist/shared/format/formatSmartRelative.js +1 -0
  108. package/dist/shared/format/formatUsd.js +1 -1
  109. package/dist/shared/icons/{HistoryIcon.d.ts → ActivityIcon.d.ts} +4 -4
  110. package/dist/shared/icons/{HistoryIcon.js → ActivityIcon.js} +1 -1
  111. package/dist/shared/orchestrator/activityOpenInput.d.ts +21 -0
  112. package/dist/shared/orchestrator/createActivityReducers.js +1 -0
  113. package/dist/shared/orchestrator/index.d.ts +2 -0
  114. package/dist/shared/orchestrator/index.js +1 -1
  115. package/dist/shared/orchestrator/resolveActivityEntry.d.ts +1 -0
  116. package/dist/shared/orchestrator/resolveActivityEntry.js +1 -0
  117. package/dist/shared/ui/Card/Card.d.ts +12 -9
  118. package/dist/shared/ui/Card/Card.js +1 -1
  119. package/dist/shared/ui/Card/Card.styles.js +1 -1
  120. package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +1 -1
  121. package/dist/shared/widgets/activity/ActivityTrigger.js +1 -0
  122. package/dist/shared/widgets/{activity-history → activity}/ActivityTrigger.styles.js +1 -1
  123. package/dist/shared/widgets/activity/adapters/settlementToWidgetProps.js +1 -0
  124. package/dist/shared/widgets/activity/compound/Activity.d.ts +95 -0
  125. package/dist/shared/widgets/activity/compound/Activity.js +1 -0
  126. package/dist/shared/widgets/activity/compound/Activity.slots.d.ts +22 -0
  127. package/dist/shared/widgets/activity/compound/Activity.slots.js +1 -0
  128. package/dist/shared/widgets/activity/compound/Activity.styles.js +1 -0
  129. package/dist/shared/widgets/{activity-history/compound/ActivityHistoryDetail.d.ts → activity/compound/ActivityDetail.d.ts} +24 -17
  130. package/dist/shared/widgets/activity/compound/ActivityDetail.js +1 -0
  131. package/dist/shared/widgets/activity/compound/Row.slots.d.ts +21 -0
  132. package/dist/shared/widgets/activity/compound/Row.slots.js +1 -0
  133. package/dist/shared/widgets/activity/compound/Row.styles.js +1 -0
  134. package/dist/shared/widgets/{activity-history/compound/components/HistoryHeader.d.ts → activity/compound/components/ActivityHeader.d.ts} +8 -8
  135. package/dist/shared/widgets/activity/compound/components/ActivityHeader.js +1 -0
  136. package/dist/shared/widgets/{activity-history → activity}/compound/components/Empty.d.ts +3 -3
  137. package/dist/shared/widgets/activity/compound/components/Empty.js +1 -0
  138. package/dist/shared/widgets/{activity-history → activity}/compound/components/ErrorView.d.ts +7 -7
  139. package/dist/shared/widgets/activity/compound/components/ErrorView.js +1 -0
  140. package/dist/shared/widgets/activity/compound/components/List.d.ts +23 -0
  141. package/dist/shared/widgets/activity/compound/components/List.js +1 -0
  142. package/dist/shared/widgets/{activity-history → activity}/compound/components/Row.d.ts +13 -16
  143. package/dist/shared/widgets/activity/compound/components/Row.js +1 -0
  144. package/dist/shared/widgets/activity/compound/components/StatusPip.js +1 -0
  145. package/dist/shared/widgets/activity/compound/context.d.ts +95 -0
  146. package/dist/shared/widgets/activity/compound/context.js +1 -0
  147. package/dist/shared/widgets/activity/compound/index.d.ts +8 -0
  148. package/dist/shared/widgets/activity/compound/index.js +1 -0
  149. package/dist/shared/widgets/activity/payloads.d.ts +108 -0
  150. package/dist/shared/widgets/activity/transformers/activityResponseToPayload.js +1 -0
  151. package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +1 -1
  152. package/dist/shared/widgets/amount-entry/compound/types.d.ts +2 -3
  153. package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +1 -1
  154. package/dist/shared/widgets/asset-picker/compound/types.d.ts +2 -2
  155. package/dist/stridge/StridgeProvider.d.ts +10 -6
  156. package/dist/stridge/StridgeProvider.js +1 -1
  157. package/dist/stridge/stubs.js +1 -1
  158. package/dist/styles/index.css +4 -0
  159. package/dist/withdraw/compound/index.d.ts +6 -6
  160. package/dist/withdraw/widgets/index.d.ts +3 -3
  161. package/dist/withdraw/widgets/index.js +1 -1
  162. package/package.json +14 -6
  163. package/dist/activity-history/compound/index.d.ts +0 -9
  164. package/dist/activity-history/compound/index.js +0 -1
  165. package/dist/flows/deposit/widgets/activity-history/DepositHistoryDetail.js +0 -1
  166. package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.d.ts +0 -38
  167. package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.js +0 -1
  168. package/dist/flows/deposit/widgets/activity-history/index.d.ts +0 -2
  169. package/dist/flows/deposit/widgets/activity-history/index.js +0 -1
  170. package/dist/flows/deposit/widgets/activity-history/useDepositActivityHistorySource.js +0 -1
  171. package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryDetail.js +0 -1
  172. package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.d.ts +0 -36
  173. package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.js +0 -1
  174. package/dist/flows/withdraw/widgets/activity-history/index.d.ts +0 -2
  175. package/dist/flows/withdraw/widgets/activity-history/index.js +0 -1
  176. package/dist/flows/withdraw/widgets/activity-history/useWithdrawActivityHistorySource.js +0 -1
  177. package/dist/shared/widgets/activity-history/ActivityTrigger.js +0 -1
  178. package/dist/shared/widgets/activity-history/adapters/settlementToWidgetProps.js +0 -1
  179. package/dist/shared/widgets/activity-history/compound/ActivityHistory.d.ts +0 -95
  180. package/dist/shared/widgets/activity-history/compound/ActivityHistory.js +0 -1
  181. package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.d.ts +0 -22
  182. package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.js +0 -1
  183. package/dist/shared/widgets/activity-history/compound/ActivityHistory.styles.js +0 -1
  184. package/dist/shared/widgets/activity-history/compound/ActivityHistoryDetail.js +0 -1
  185. package/dist/shared/widgets/activity-history/compound/Row.slots.d.ts +0 -21
  186. package/dist/shared/widgets/activity-history/compound/Row.slots.js +0 -1
  187. package/dist/shared/widgets/activity-history/compound/Row.styles.js +0 -1
  188. package/dist/shared/widgets/activity-history/compound/components/Empty.js +0 -1
  189. package/dist/shared/widgets/activity-history/compound/components/ErrorView.js +0 -1
  190. package/dist/shared/widgets/activity-history/compound/components/HistoryHeader.js +0 -1
  191. package/dist/shared/widgets/activity-history/compound/components/List.d.ts +0 -23
  192. package/dist/shared/widgets/activity-history/compound/components/List.js +0 -1
  193. package/dist/shared/widgets/activity-history/compound/components/Row.js +0 -1
  194. package/dist/shared/widgets/activity-history/compound/components/StatusPip.js +0 -1
  195. package/dist/shared/widgets/activity-history/compound/context.d.ts +0 -79
  196. package/dist/shared/widgets/activity-history/compound/context.js +0 -1
  197. package/dist/shared/widgets/activity-history/payloads.d.ts +0 -81
  198. package/dist/shared/widgets/activity-history/transformers/historyResponseToPayload.js +0 -1
  199. /package/dist/shared/widgets/{activity-history → activity}/index.js +0 -0
  200. /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 history trigger** — `<ActivityTrigger>` button. Gated on the host driver
14
- * implementing `refreshHistory` (BYO drivers that don't expose history get the icon hidden
15
- * gracefully). FSM-state gating is handled upstream by the steps router this header only
16
- * mounts on the `deposit` (method-picker) state, so a separate state allow-list would be
17
- * redundant. Tap fires `actions.openHistory()` which transitions the FSM into
18
- * `historyList` with the source step snapshotted into `ctx.backTarget`.
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{useDepositDriverInstance as e}from"../../../../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-history/ActivityTrigger.js";import"../../../../../../shared/widgets/activity-history/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(),{openHistory:g}=n(),_=typeof e().refreshHistory==`function`,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
+ "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{useDepositSnapshot as n}from"../../driver/context.js";import{useLingui as r}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.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=n(),u=a().name,{resumeToProcessing:f,resumeToSuccess:m,resumeToError:g}=i(),{_:v}=r(),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
+ "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{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as n}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.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=e(),p=i(),{tryAgain:m}=r(),{_:h}=t(),g=n();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
+ "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{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.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=e(),d=r(),{back:f}=n(),{_:p}=t();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};
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-history trigger — when the host driver implements `refreshHistory`, an
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. The steps router only mounts this header on `transferCrypto`, so no additional
13
- * FSM-state gating is needed.
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{useDepositDriverInstance as e}from"../../../../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-history/ActivityTrigger.js";import"../../../../../../shared/widgets/activity-history/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(),{openHistory:_}=n(),v=typeof e().refreshHistory==`function`,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
+ "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{WithdrawHistoryDetail as c}from"../widgets/activity-history/WithdrawHistoryDetail.js";import{WithdrawHistoryList as l}from"../widgets/activity-history/WithdrawHistoryList.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:`historyList`,children:m(l,{})}),m(s.Step,{name:`historyDetail`,children:m(c,{})})]})})})})})}export{g as WithdrawDialog};
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{useLingui as e}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{toFailure as t}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as n}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as r}from"../../../shared/orchestrator/useEffectiveState.js";import{useSettlementWatcher as i}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{useWithdrawBindingsRef as a}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawDriverInstance as o}from"../driver/context.js";import{initialState as s,reducer as c}from"./reducer.js";import{createContext as l,use as u,useCallback as d,useEffect as f,useMemo as p,useReducer as m,useRef as h}from"react";import{jsx as g}from"react/jsx-runtime";const _={id:`ldK3jJ`,message:`Failed to submit withdrawal.`},v={id:`kUFhUv`,message:`Withdrawal failed.`},y={id:`srsA0x`,message:`Withdrawal declined.`},b=l(null);b.displayName=`WithdrawControllerContext`;function x(){let e=u(b);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 S(){return u(b)}function C(){return x().state}function w(){return x().effectiveState}function T(){return x().actions}function E({children:e}){let t=o(),[n,a]=m(c,s),l=O(n,a,t),u=n.name===`inProgress`?{form:n.ctx.input,submittedAt:n.ctx.submittedAt,...n.ctx.tx?{tx:n.ctx.tx}:{}}:void 0;i(t,u,u?`${u.submittedAt}|${u.tx?.hash??``}`:void 0),k(t,n.name===`historyList`||n.name===`historyDetail`),A(n,a,t);let d=r(n),f=D(a,l,t);return g(b,{value:p(()=>({state:n,effectiveState:d,dispatch:a,controller:f,actions:l}),[n,d,f,l]),children:e})}function D(e,t,n){let r=h(n);r.current=n;let i=d(()=>{r.current.arm(),e({type:`OPEN`})},[e]),a=d(()=>{e({type:`CLOSE`})},[e]);return p(()=>({open:i,close:a,actions:t}),[i,a,t])}function O(n,r,i){let o=h(n);o.current=n;let s=h(i);s.current=i;let c=h(r);c.current=r;let{i18n:l}=e(),u=h(l);u.current=l;let f=a(),m=d(e=>{let n=s.current;c.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){c.current({type:`BEGIN_PROCESSING`,submittedAt:Date.now(),...e?{tx:e}:{}})},setTxHash(e){c.current({type:`SET_TX_HASH`,tx:e,submittedAt:Date.now()})},fail(e){c.current({type:`MARK_FAILED`,...e?{failure:e}:{}})},decline(){c.current({type:`SUBMIT_FAILED`,failure:{reason:u.current._(y),code:`UserRejectedRequestError`},input:e})},succeed(){c.current({type:`MARK_SUCCEEDED`})}};n.prepareWithdrawal(i,r.signal).then(i=>{if(r.signal.aborted)return;let o=f.current.onSubmit;if(!o){c.current({type:`SUBMIT_FAILED`,failure:t(Error(`WithdrawDialog onSubmit is missing.`),u.current._(_)),input:e});return}let s=n.getSnapshot().quote,l=s.status===`ready`||s.status===`stale`?s.payload:void 0;try{let n=o({form:e,depositTarget:i.depositTarget,correlation:i.correlation,...l?{quote:l}:{}},a,r.signal);n&&typeof n.catch==`function`&&n.catch(n=>{r.signal.aborted||c.current({type:`SUBMIT_FAILED`,failure:t(n,u.current._(_)),input:e})})}catch(n){if(r.signal.aborted)return;c.current({type:`SUBMIT_FAILED`,failure:t(n,u.current._(_)),input:e})}}).catch(n=>{r.signal.aborted||c.current({type:`SUBMIT_FAILED`,failure:t(n,u.current._(_)),input:e})})},[]),g=d(()=>{c.current({type:`CLOSE`})},[]),v=d(()=>{c.current({type:`RESET`})},[]),b=d(()=>{c.current({type:`CLEAR_NOTICE`})},[]),x=d(()=>{c.current({type:`BACK`})},[]),S=d(()=>{o.current.name===`form`&&c.current({type:`OPEN_HISTORY`})},[]),C=d(e=>{c.current({type:`SELECT_SETTLEMENT`,settlementId:e})},[]);return p(()=>({submit:m,close:g,reset:v,clearNotice:b,back:x,openHistory:S,selectSettlement:C}),[m,g,v,b,x,S,C])}function k(e,t){f(()=>{if(!t||!e.watchHistory)return;let n=new AbortController;return e.watchHistory(n.signal),()=>n.abort()},[t,e])}function A(t,r,i){let a=h(t);a.current=t;let{i18n:o}=e(),s=h(o);s.current=o,n(i,(e,t)=>{if(a.current.name===`inProgress`){if(e===`succeeded`){r({type:`SETTLEMENT_SUCCEEDED`});return}if(e===`failed`){let e=t.settlement,n=e.status===`ready`||e.status===`stale`?e.payload:null,i=n&&n.kind===`failed`?{reason:s.current._(v),code:n.failureKind}:void 0;r({type:`SETTLEMENT_FAILED`,...i?{failure:i}:{}})}}})}export{E as WithdrawControllerProvider,x as useControllerContext,S as useOptionalControllerContext,T as useWithdrawActions,w as useWithdrawEffectiveState,C as useWithdrawState};
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{isUserRejectionFailure as e}from"../../../shared/orchestrator/userRejection.js";import"../../../shared/orchestrator/index.js";const t={name:`closed`};function n(e,t){switch(e.name){case`closed`:return r(t);case`form`:return i(e,t);case`submitting`:return a(e,t);case`inProgress`:return o(e,t);case`success`:return s(e,t);case`error`:return c(e,t);case`historyList`:return l(e,t);case`historyDetail`:return u(e,t);default:return f(e)}}function r(e){return e.type===`OPEN`?{name:`form`}:{name:`closed`}}function i(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_HISTORY`:return{name:`historyList`,ctx:{backTarget:{kind:`form`,...e.ctx?.notice?{notice:e.ctx.notice}:{}}}};case`CLOSE`:return{name:`closed`};default:return e}}function a(t,n){switch(n.type){case`BEGIN_PROCESSING`:return{name:`inProgress`,ctx:{input:t.ctx.input,submittedAt:n.submittedAt,...n.tx?{tx:n.tx}:{}}};case`SET_TX_HASH`:return{name:`inProgress`,ctx:{input:t.ctx.input,submittedAt:n.submittedAt,tx:n.tx}};case`MARK_SUCCEEDED`:return{name:`success`,ctx:{input:t.ctx.input}};case`MARK_FAILED`:return{name:`error`,ctx:{input:t.ctx.input,...n.failure?{failure:n.failure}:{}}};case`SUBMIT_FAILED`:return e(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 t}}function o(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 s(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function c(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function l(e,t){switch(t.type){case`SELECT_SETTLEMENT`:return{name:`historyDetail`,ctx:{settlementId:t.settlementId,backTarget:e.ctx.backTarget}};case`BACK`:return d(e.ctx.backTarget);case`CLOSE`:return{name:`closed`};default:return e}}function u(e,t){switch(t.type){case`BACK`:return{name:`historyList`,ctx:{backTarget:e.ctx.backTarget}};case`CLOSE`:return{name:`closed`};default:return e}}function d(e){return e.kind===`form`?e.notice?{name:`form`,ctx:{notice:e.notice}}:{name:`form`}:f(e.kind)}function f(e){throw Error(`Unhandled withdraw state: ${JSON.stringify(e)}`)}export{t as initialState,n as reducer};
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 `OPEN_HISTORY`
35
- * time so the back chevron can restore the source state lossless. The withdraw flow's only
36
- * pre-submit step is `form`, so the discriminated union is single-variant today keeping the
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 HistoryBackTarget {
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 history list — reachable from `form` via the header icon. `backTarget`
103
- * snapshots the source state (including any inline notice) at `OPEN_HISTORY` time so
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: "historyList";
104
+ name: "activityList";
107
105
  ctx: {
108
- backTarget: HistoryBackTarget;
106
+ backTarget: ActivityBackTarget;
109
107
  };
110
108
  } | {
111
109
  /**
112
- * Activity history per-settlement detail — reached from `historyList` via
113
- * `SELECT_SETTLEMENT`. Carries the selected row's id and the same `backTarget` so
114
- * `BACK` collapses to `historyList` first, then to the original source step.
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: "historyDetail";
117
+ name: "activityDetail";
117
118
  ctx: {
118
119
  settlementId: string;
119
- backTarget: HistoryBackTarget;
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 `historyList` / `historyDetail` today —
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: `historyDetailhistoryList → source`.
179
+ * collapse: `activityDetailactivityList → source`.
178
180
  */
179
181
  type: "BACK";
180
182
  } | {
181
183
  /**
182
- * User tapped the header history icon. Legal from `form`; ignored elsewhere. Snapshots
183
- * the source state into a {@link HistoryBackTarget} so the back chevron can restore it
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: "OPEN_HISTORY";
188
+ type: "OPEN_ACTIVITY";
187
189
  } | {
188
190
  /**
189
- * User tapped a row in the activity list. Legal only from `historyList`; transitions
190
- * to `historyDetail` carrying the selected `settlementId`.
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
- /** Open the withdraw dialog. Idempotent. */
201
- open(): void;
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 history step
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 HistoryBackTarget} so `back()` can restore it
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
- openHistory(): void;
260
+ openActivity(): void;
247
261
  /**
248
262
  * Open the detail view for a settlement listed on the activity surface. Legal only from
249
- * `historyList`; transitions the FSM to `historyDetail`.
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-history/WithdrawHistoryDetail.d.ts
5
- interface WithdrawHistoryDetailOwnProps {
4
+ //#region src/flows/withdraw/widgets/activity/WithdrawActivityDetail.d.ts
5
+ interface WithdrawActivityDetailOwnProps {
6
6
  /**
7
- * Optional custom composition forwarded to the underlying `<ActivityHistoryDetail>`
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-history detail wrapper for the withdraw dialog. Mirrors
14
- * {@link import("#/flows/deposit/widgets/activity-history").DepositHistoryDetail}. Renders
15
- * `null` while the FSM is not on `historyDetail`.
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 WithdrawHistoryDetail({
17
+ declare function WithdrawActivityDetail({
18
18
  children
19
- }: WithdrawHistoryDetailOwnProps): _$react_jsx_runtime0.JSX.Element | null;
20
- declare namespace WithdrawHistoryDetail {
21
- type Props = WithdrawHistoryDetailOwnProps;
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 { WithdrawHistoryDetail };
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,2 @@
1
+ import { WithdrawActivityDetail } from "./WithdrawActivityDetail.js";
2
+ import { WithdrawActivityList } from "./WithdrawActivityList.js";
@@ -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 the widget is mounted inside `Dialog.Content`.
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
- * In dialog mode, `Card.Body` injects its own scroll-area + viewport + inner-flex chain (see
10
- * `bodyStyles.root` in `Card.styles.ts`), which wraps the children in an extra `<div>` that
11
- * isolates them from any padding / gap a caller passes via spread props. We wrap the children
12
- * in our own slot div so the body's `gap: 22px` and `padding: 28/22/22/22` apply where the
13
- * fields actually live (i.e. as siblings) instead of getting redirected to the viewport.
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-history trigger — between the optional quote timer and the close X, an
17
- * `<ActivityTrigger>` button opens the cross-flow activity surface. Gated on the host driver
18
- * implementing `refreshHistory`; the steps router only mounts this header on `form`, so an
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{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{useWithdrawDriverInstance as t}from"../../../../driver/context.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-history/ActivityTrigger.js";import"../../../../../../shared/widgets/activity-history/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}=e(),y=u(`WithdrawForm.Header`),{openHistory:b}=n(),x=typeof t().refreshHistory==`function`,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};
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};
@@ -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 };
@@ -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{formatTokenAmount as a}from"../shared/format/formatTokenAmount.js";import{formatUsd as o}from"../shared/format/formatUsd.js";import{shortenAddress as s}from"../shared/format/shortenAddress.js";export{e as formatDurationCoarse,t as formatDurationCompact,n as formatNetworkName,r as formatPercent,i as formatTimestamp,a as formatTokenAmount,o as formatUsd,s as shortenAddress};
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};