@stridge/kit 0.1.0-alpha.43 → 0.1.0-alpha.45
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/deposit/compound/index.d.ts +2 -1
- package/dist/flows/deposit/dialog/DepositDialog.d.ts +9 -4
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +31 -4
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +22 -4
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +37 -4
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +33 -4
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +32 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.d.ts +28 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.d.ts +24 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +34 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +39 -4
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +30 -4
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
- package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +38 -4
- package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +34 -3
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts +60 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts +13 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts +25 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts +27 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.d.ts +3 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +45 -2
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +29 -1
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +37 -2
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +46 -2
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
- package/dist/package.js +1 -1
- package/dist/shared/ui/Steps/Steps.d.ts +52 -0
- package/dist/shared/ui/Steps/Steps.js +1 -0
- package/dist/shared/ui/Steps/Steps.slots.d.ts +7 -0
- package/dist/shared/ui/Steps/Steps.slots.js +1 -0
- package/dist/shared/ui/Steps/Steps.styles.js +1 -0
- package/dist/shared/ui/Steps/index.d.ts +2 -0
- package/dist/shared/ui/Steps/index.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +4 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Notice.d.ts +7 -0
- package/dist/shared/widgets/amount-entry/compound/components/Notice.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +12 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -1
- package/dist/styles/index.css +8 -0
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +1 -1
- package/dist/withdraw/compound/index.d.ts +4 -1
- package/dist/withdraw/compound/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ErrorStateBodyProps, ErrorStateRowProps } from "../../../../shared/widgets/error-state/compound/types.js";
|
|
2
|
+
import { ErrorStateActions } from "../../../../shared/widgets/error-state/compound/components/Actions.js";
|
|
3
|
+
import { ErrorStateDetails } from "../../../../shared/widgets/error-state/compound/components/Details.js";
|
|
4
|
+
import { ErrorStateHeader } from "../../../../shared/widgets/error-state/compound/components/Header.js";
|
|
5
|
+
import { ErrorStateHelpInfo } from "../../../../shared/widgets/error-state/compound/components/HelpInfo.js";
|
|
6
|
+
import { ErrorStateHero } from "../../../../shared/widgets/error-state/compound/components/Hero.js";
|
|
7
|
+
import { ErrorStateMoreDetails } from "../../../../shared/widgets/error-state/compound/components/MoreDetails.js";
|
|
8
|
+
import { ErrorStateDestinationRow, ErrorStateFailedAtRow, ErrorStateFillStatusRow, ErrorStateSourceRow, ErrorStateSubmittedAtRow, ErrorStateYouReceiveRow } from "../../../../shared/widgets/error-state/compound/components/Rows.js";
|
|
9
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
10
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
11
|
|
|
4
12
|
//#region src/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts
|
|
@@ -17,6 +25,41 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
17
25
|
*
|
|
18
26
|
* The CTA wires to `actions.reset()` so clicking `Try again` returns the user to the empty form.
|
|
19
27
|
*/
|
|
20
|
-
|
|
28
|
+
interface WithdrawErrorOwnProps {
|
|
29
|
+
/**
|
|
30
|
+
* Optional custom composition. Defaults vary by branch — settlement-derived failures render
|
|
31
|
+
* the receipt (`<Header />` + `<Body><Hero /><Details>…rows…</Details><HelpInfo /></Body>` +
|
|
32
|
+
* `<Actions />`); FSM-derived failures render the minimal headline-only shape. Pass children
|
|
33
|
+
* once and they apply to whichever branch renders.
|
|
34
|
+
*/
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function WithdrawError({
|
|
38
|
+
children,
|
|
39
|
+
...props
|
|
40
|
+
}: ComponentProps<"div"> & WithdrawErrorOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
41
|
+
/**
|
|
42
|
+
* Withdraw-tuned default for the source-tx row label. Without this wrapper, hosts composing
|
|
43
|
+
* `<WithdrawError.DepositTxRow />` would inherit the deposit-flow's "Deposit tx" default —
|
|
44
|
+
* the wrong copy for a withdrawal. Host-supplied `label` overrides.
|
|
45
|
+
*/
|
|
46
|
+
declare function WithdrawErrorDepositTxRow(props?: ErrorStateRowProps): _$react_jsx_runtime0.JSX.Element;
|
|
47
|
+
declare namespace WithdrawError {
|
|
48
|
+
type Props = ComponentProps<"div"> & WithdrawErrorOwnProps;
|
|
49
|
+
const Header: typeof ErrorStateHeader;
|
|
50
|
+
const Body: (props: ErrorStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
51
|
+
const Hero: typeof ErrorStateHero;
|
|
52
|
+
const Details: typeof ErrorStateDetails;
|
|
53
|
+
const FillStatusRow: typeof ErrorStateFillStatusRow;
|
|
54
|
+
const SourceRow: typeof ErrorStateSourceRow;
|
|
55
|
+
const DestinationRow: typeof ErrorStateDestinationRow;
|
|
56
|
+
const YouReceiveRow: typeof ErrorStateYouReceiveRow;
|
|
57
|
+
const MoreDetails: typeof ErrorStateMoreDetails;
|
|
58
|
+
const DepositTxRow: typeof WithdrawErrorDepositTxRow;
|
|
59
|
+
const SubmittedAtRow: typeof ErrorStateSubmittedAtRow;
|
|
60
|
+
const FailedAtRow: typeof ErrorStateFailedAtRow;
|
|
61
|
+
const HelpInfo: typeof ErrorStateHelpInfo;
|
|
62
|
+
const Actions: typeof ErrorStateActions;
|
|
63
|
+
}
|
|
21
64
|
//#endregion
|
|
22
65
|
export { WithdrawError };
|
|
@@ -1 +1 @@
|
|
|
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{useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import{ErrorState as a}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";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{useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import{ErrorState as a}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";function u({children:u,...d}){let f=n(),p=i(),{reset: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.ctx.failure,b=h({id:`KTNWsg`,message:`Withdrawal failed`}),x=v?g(v.failureKind):y?.reason;if(!v)return c(a,{...d,headerTitle:b,headline:b,reason:x,onTryAgain:m,children:u??l(s,{children:[c(a.Header,{}),c(a.Body,{children:c(a.Hero,{})}),c(a.Actions,{})]})});let S=v,C={address:S.recipient.formatted},w=o(S.receiveAsset)??{symbol:S.receiveAsset.symbol},T=S.txHash?{hash:S.txHash.formatted,explorerUrl:S.txExplorerUrl}:void 0;return c(a,{...d,headerTitle:b,headline:b,reason:x,destination:C,receiveAmount:S.receiveAmount.formatted,receiveAsset:w,depositTx:T,submittedAt:S.submittedAt.formatted,failedAt:S.failedAt.formatted,onTryAgain:m,children:u??l(s,{children:[c(a.Header,{}),l(a.Body,{children:[c(a.Hero,{}),l(a.Details,{children:[c(a.FillStatusRow,{}),c(a.DestinationRow,{}),c(a.YouReceiveRow,{}),l(a.MoreDetails,{children:[T?c(a.DepositTxRow,{label:h({id:`60ahSE`,message:`Withdrawal tx`})}):null,c(a.SubmittedAtRow,{}),c(a.FailedAtRow,{})]})]}),c(a.HelpInfo,{})]}),c(a.Actions,{})]})})}function d(t={}){let{_:n}=e();return c(a.DepositTxRow,{...t,label:t.label??n({id:`60ahSE`,message:`Withdrawal tx`})})}(function(e){e.Header=a.Header,e.Body=a.Body,e.Hero=a.Hero,e.Details=a.Details,e.FillStatusRow=a.FillStatusRow,e.SourceRow=a.SourceRow,e.DestinationRow=a.DestinationRow,e.YouReceiveRow=a.YouReceiveRow,e.MoreDetails=a.MoreDetails,e.DepositTxRow=d,e.SubmittedAtRow=a.SubmittedAtRow,e.FailedAtRow=a.FailedAtRow,e.HelpInfo=a.HelpInfo,e.Actions=a.Actions})(u||={});export{u as WithdrawError};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { WithdrawFormAmountField } from "./compound/components/AmountField.js";
|
|
2
|
+
import { WithdrawFormBody } from "./compound/components/Body.js";
|
|
3
|
+
import { WithdrawFormBreakdownCard } from "./compound/components/BreakdownCard.js";
|
|
4
|
+
import { WithdrawFormFooter } from "./compound/components/Footer.js";
|
|
5
|
+
import { WithdrawFormHeader } from "./compound/components/Header.js";
|
|
6
|
+
import { WithdrawFormReceiveSelectors } from "./compound/components/ReceiveSelectors.js";
|
|
7
|
+
import { WithdrawFormRecipientField } from "./compound/components/RecipientField.js";
|
|
8
|
+
import { ReactNode } from "react";
|
|
1
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
10
|
|
|
3
11
|
//#region src/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts
|
|
@@ -16,6 +24,26 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
16
24
|
* `withdraw.receive.token.changed`, `withdraw.receive.chain.changed`, `withdraw.submit.clicked`)
|
|
17
25
|
* flow through the unified event bus — the form takes no callback props.
|
|
18
26
|
*/
|
|
19
|
-
|
|
27
|
+
interface WithdrawFormOwnProps {
|
|
28
|
+
/**
|
|
29
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><RecipientField />
|
|
30
|
+
* <AmountField /><ReceiveSelectors /><BreakdownCard /></Body>` + `<Footer />`. Pass children
|
|
31
|
+
* to interleave your own elements between compound parts.
|
|
32
|
+
*/
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
declare function WithdrawForm({
|
|
36
|
+
children
|
|
37
|
+
}?: WithdrawFormOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
38
|
+
declare namespace WithdrawForm {
|
|
39
|
+
type Props = WithdrawFormOwnProps;
|
|
40
|
+
const Header: typeof WithdrawFormHeader;
|
|
41
|
+
const Body: typeof WithdrawFormBody;
|
|
42
|
+
const RecipientField: typeof WithdrawFormRecipientField;
|
|
43
|
+
const AmountField: typeof WithdrawFormAmountField;
|
|
44
|
+
const ReceiveSelectors: typeof WithdrawFormReceiveSelectors;
|
|
45
|
+
const BreakdownCard: typeof WithdrawFormBreakdownCard;
|
|
46
|
+
const Footer: typeof WithdrawFormFooter;
|
|
47
|
+
}
|
|
20
48
|
//#endregion
|
|
21
49
|
export { WithdrawForm };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{isValidAddressForChainType as e}from"../../../../shared/chains/index.js";import{useKitI18n as t}from"../../../../shared/i18n/useKitI18n.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawBindingsValue as
|
|
1
|
+
"use client";import{isValidAddressForChainType as e}from"../../../../shared/chains/index.js";import{useKitI18n as t}from"../../../../shared/i18n/useKitI18n.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawBindingsValue as ee}from"../../bindings/WithdrawBindings.js";import"../../bindings/index.js";import{useWithdrawDriverInstance as r,useWithdrawSnapshot as te}from"../../driver/context.js";import{useWithdrawActions as ne,useWithdrawEffectiveState as re}from"../../orchestrator/controller.js";import{formatTokenAmount as ie}from"../../../../shared/format/formatTokenAmount.js";import{useKitEmitter as ae}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{parseAmountInputValue as oe}from"../../../../shared/ui/AmountInput/utils.js";import"../../../../shared/ui/AmountInput/index.js";import{toAssetDescriptor as i}from"../../../../shared/widgets/asset-descriptor.js";import{useQuoteCountdown as se}from"../../../../shared/quote/useQuoteCountdown.js";import"../../../../shared/quote/index.js";import{WithdrawForm as a}from"./compound/WithdrawForm.js";import"./compound/index.js";import{resolveSubmitLabel as ce}from"./validation.js";import{useCallback as o,useEffect as s,useMemo as c,useRef as le,useState as l}from"react";import{Fragment as ue,jsx as u,jsxs as de}from"react/jsx-runtime";function fe({children:fe}={}){let d=te(),f=r(),p=re(),m=ne(),{i18n:pe,_:h}=n(),g=ae(),{balance:_,suggestedRecipient:me}=ee(),[v,he]=l(``),[ge,_e]=l(``),y=p.name===`submitting`,b=p.name===`form`?p.ctx?.notice:void 0,ve=le(b);ve.current=b;let x=d.withdrawableBalances.status===`ready`||d.withdrawableBalances.status===`stale`?d.withdrawableBalances.payload[0]:void 0,S=c(()=>i(x)??{symbol:`USDC`},[x]),ye=c(()=>i(x?{symbol:x.networkName,eip155Id:x.eip155Id,isNative:!0,logoUrl:x.chainLogoUrl}:void 0)??{symbol:`BSC`},[x]),C=typeof _==`number`?_:typeof _==`object`?_.amount:void 0,be=x?.symbol??S.symbol,w=C??x?.amount.value,xe=C===void 0?x?.symbol:be,T=w!==void 0&&xe!==void 0?{amount:C===void 0?x?.amount.formatted??ie(w,pe):ie(C,pe),symbol:xe}:void 0,E=d.receiveOptions.status===`ready`||d.receiveOptions.status===`stale`?d.receiveOptions.payload:[],D=x?.eip155Id?Number(x.eip155Id):void 0,O=x?.symbol??S.symbol,k=c(()=>{let e=new Map;for(let t of E)for(let n of t.tokens){let ee=n.symbol.toUpperCase(),r=e.get(ee);r?r.push({chain:t,token:n}):e.set(ee,[{chain:t,token:n}])}return e},[E]),A=c(()=>{if(k.size===0)return;let e=O.toUpperCase();return k.has(e)?e:k.keys().next().value},[k,O]),j=o(e=>{let t=k.get(e);if(!(!t||t.length===0))return(D===void 0?void 0:t.find(e=>e.chain.eip155Id===D))??t[0]},[k,D]),[M,N]=l(void 0),[P,F]=l(void 0);s(()=>{if(P||!A)return;let e=j(A);e&&(N(e.chain),F(e.token))},[A,j,P]);let I=o(()=>{ve.current&&m.clearNotice()},[m]),Se=o(e=>{I(),he(e),g({type:`withdraw.recipient.changed`,flow:`withdraw`,tier:`ui`,payload:{value:e}})},[I,g]),L=t().locale,R=o(e=>{I(),_e(e),g({type:`withdraw.amount.changed`,flow:`withdraw`,tier:`ui`,payload:{raw:e,numeric:oe(e,L)}})},[I,g,L]),Ce=o(e=>{I();let t=e.symbol.toUpperCase(),n=k.get(t)?.find(e=>e.chain.eip155Id===M?.eip155Id)??j(t);n&&(N(n.chain),F(n.token),g({type:`withdraw.receive.token.changed`,flow:`withdraw`,tier:`ui`,payload:{token:n.token}}),n.chain.eip155Id!==M?.eip155Id&&g({type:`withdraw.receive.chain.changed`,flow:`withdraw`,tier:`ui`,payload:{chain:n.chain}}))},[I,g,k,j,M?.eip155Id]),we=o(e=>{I(),N(e);let t=P?.symbol.toUpperCase(),n=(t?e.tokens.find(e=>e.symbol.toUpperCase()===t):void 0)??e.tokens[0];n&&F(n),g({type:`withdraw.receive.chain.changed`,flow:`withdraw`,tier:`ui`,payload:{chain:e}}),n!==void 0&&(P===void 0||n.address!==P.address)&&g({type:`withdraw.receive.token.changed`,flow:`withdraw`,tier:`ui`,payload:{token:n}})},[I,g,P]),z=oe(ge,L),B=z!==null&&z>0,Te=v.trim(),Ee=Te.length>0,De=M?.chainType??`unknown`,V=e(Te,De),H=M!==void 0&&P!==void 0,U=B&&w!==void 0&&z>w,W=d.minAmountUsd,G=d.maxAmountUsd,Oe=x?.amountUsd&&x.amount.value>0?x.amountUsd.value/x.amount.value:void 0,K=Oe!==void 0&&z!==null?z*Oe:void 0,q=B&&K!==void 0&&W!==void 0&&W.value>0&&K<W.value,J=B&&K!==void 0&&G!==void 0&&G.value>0&&K>G.value,[Y,ke]=l(null),X=(d.quote.status===`ready`||d.quote.status===`stale`)&&Ee&&B&&H&&Y!==null&&Y.recipient===v&&Y.amount===z&&Y.receiveChainId===M.eip155Id&&Y.receiveSymbol===P.symbol?d.quote.payload:void 0,Ae=c(()=>k.size===0?[S]:[...k.values()].map(e=>{let t=e[0];return i({symbol:t.token.symbol,eip155Id:t.chain.eip155Id,address:t.token.address,isNative:t.token.isNative,logoUrl:t.token.assetLogoUrl})??{symbol:t.token.symbol}}),[k,S]),je=c(()=>{let e=P?.symbol.toUpperCase(),t=e?k.get(e):void 0;return(t?t.map(e=>e.chain):E).map(e=>i({symbol:e.networkName,eip155Id:e.eip155Id,isNative:!0,logoUrl:e.chainLogoUrl})??{symbol:e.networkName})},[P?.symbol,k,E]),Me=P?i({symbol:P.symbol,eip155Id:M?.eip155Id,address:P.address,isNative:P.isNative,logoUrl:P.assetLogoUrl}):S,Ne=M?i({symbol:M.networkName,eip155Id:M.eip155Id,isNative:!0,logoUrl:M.chainLogoUrl}):ye,Pe=c(()=>{if(X?.breakdown)return{route:X.breakdown.selectedRoute?.label,networkCost:X.breakdown.networkCost?.formatted,priceImpact:X.breakdown.priceImpact?.formatted}},[X]),Z=c(()=>{if(B)return X?.receiveAmountUsd?X.receiveAmountUsd.formatted:`$${z.toFixed(2)}`},[z,B,X]),Fe=X&&B?X.receiveAmount.formatted:void 0,Ie=X?.receiveAmountUsd?.formatted,Le=V&&B&&!U&&!q&&!J&&H&&X===void 0&&d.quote.status!==`error`,Q=V&&B&&!U&&!q&&!J&&H&&X!==void 0,Re=se({expiresAt:X?.expiresAt,enabled:Q}),ze=Q&&X?X.quoteTotalSeconds:void 0,[$,Be]=l(!1);s(()=>{Be(!1)},[v,z,M?.eip155Id,P?.symbol,p.name]),s(()=>{if(!Q||!X||p.name!==`form`||$)return;let e=Math.max(0,X.expiresAt-Date.now()),t=setTimeout(()=>{Be(!0),g({type:`withdraw.quote.expired`,flow:`withdraw`,tier:`flow`,payload:{}})},e);return()=>clearTimeout(t)},[g,Q,X,p.name,$]),s(()=>{if(!$||p.name!==`form`||D===void 0||!M||!P||!V||!B||U||q||J)return;let e=new AbortController,t={recipient:v,amount:z??0,receiveChainId:M.eip155Id,receiveSymbol:P.symbol},n={sourceAssetSymbol:O,sourceChainId:D,amount:z??0,receiveTokenSymbol:P.symbol,receiveChainId:M.eip155Id,recipientAddress:v};return g({type:`withdraw.quote.requested`,flow:`withdraw`,tier:`flow`,payload:{input:n}}),f.requestQuote(n,e.signal).then(()=>{e.signal.aborted||ke(t)}).catch(()=>{}).finally(()=>{e.signal.aborted||Be(!1)}),()=>e.abort()},[g,$,f,v,z,V,B,U,q,J,D,O,M,P,p.name]);let Ve=!V||!B||U||q||J||!H||Le||$,He=ce({enterRecipientAddress:h({id:`nr03QI`,message:`Enter Recipient Address`}),enterValidRecipientAddress:h({id:`GZPxmc`,message:`Enter Valid Recipient Address`}),enterAmount:h({id:`yH9V_J`,message:`Enter Amount`}),insufficientBalance:h({id:`N2DUxS`,message:`Insufficient Balance`}),...W?{belowMinimumAmount:h({id:`WkRH60`,message:`Min {0}`,values:{0:W.formatted}})}:{},...G?{aboveCapAmount:h({id:`AHyker`,message:`Max {0}`,values:{0:G.formatted}})}:{},regeneratingQuote:h({id:`Ly6geA`,message:`Regenerating quote…`}),estimatingQuote:h({id:`Uevt3L`,message:`Estimating quote`})},{isRecipientFilled:Ee,isRecipientValid:V,isAmountValid:B,exceedsBalance:U,belowMinimum:q,aboveCap:J,quoteEstimating:Le,quoteRegenerating:$}),Ue=le(null);s(()=>{if(Ue.current?.abort(),!V||!B||U||q||J||!H||p.name!==`form`||D===void 0)return;let e=new AbortController;Ue.current=e;let t={recipient:v,amount:z,receiveChainId:M.eip155Id,receiveSymbol:P.symbol},n=setTimeout(()=>{let n={sourceAssetSymbol:O,sourceChainId:D,amount:z,receiveTokenSymbol:P.symbol,receiveChainId:M.eip155Id,recipientAddress:v};g({type:`withdraw.quote.requested`,flow:`withdraw`,tier:`flow`,payload:{input:n}}),f.requestQuote(n,e.signal).then(()=>{e.signal.aborted||ke(t)}).catch(()=>{})},400);return()=>{clearTimeout(n),e.abort()}},[g,f,v,z,V,B,U,q,J,H,D,O,M?.eip155Id,P?.symbol,p.name]);let We=o(()=>{T&&(R(T.amount),g({type:`withdraw.max.clicked`,flow:`withdraw`,tier:`ui`,payload:{}}))},[T,g,R]),Ge=o(()=>{g({type:`withdraw.submit.clicked`,flow:`withdraw`,tier:`ui`,payload:{}}),!(y||Ve)&&(D===void 0||!M||!P||m.submit({sourceAssetSymbol:O,sourceChainId:D,amount:z??0,recipientAddress:v,receiveTokenSymbol:P.symbol,receiveChainId:M.eip155Id,...Z?{amountUsd:Z}:{}}))},[m,z,Z,g,D,O,M,P,v,Ve,y]),Ke=o(e=>{let t=E.find(t=>String(t.eip155Id)===String(e.chainId));t&&we(t)},[we,E]),qe=o(e=>{let t=e.symbol.toUpperCase(),n=k.get(t);!n||n.length===0||Ce((n.find(e=>e.chain.eip155Id===M?.eip155Id)??n[0]).token)},[Ce,k,M?.eip155Id]);return p.name!==`form`&&p.name!==`submitting`?null:u(a,{recipientAddress:v,onRecipientChange:Se,recipientChainType:De,...me?{suggestedRecipient:me}:{},amount:ge,onAmountChange:R,onAmountMax:We,sourceAsset:S,sourceChain:ye,receiveAsset:Me,receiveChain:Ne,receiveAssetOptions:Ae,onReceiveAssetChange:qe,receiveChainOptions:je,onReceiveChainChange:Ke,balance:T,amountUsd:Z,receiveAmount:Fe,receiveAmountUsd:Ie,breakdown:Pe,quoteEstimating:Le,quoteRegenerating:$,...Re===void 0?{}:{quoteSeconds:Re},...ze===void 0?{}:{quoteTotalSeconds:ze},submitting:y,submitDisabled:Ve,submitLabel:He,...b?{notice:b}:{},onSubmit:Ge,onBreakdownOpenChange:e=>g({type:`withdraw.breakdown.clicked`,flow:`withdraw`,tier:`ui`,payload:{open:e}}),children:fe??de(ue,{children:[u(a.Header,{}),de(a.Body,{children:[u(a.RecipientField,{}),u(a.AmountField,{}),u(a.ReceiveSelectors,{}),u(a.BreakdownCard,{})]}),u(a.Footer,{})]})})}(function(e){e.Header=a.Header,e.Body=a.Body,e.RecipientField=a.RecipientField,e.AmountField=a.AmountField,e.ReceiveSelectors=a.ReceiveSelectors,e.BreakdownCard=a.BreakdownCard,e.Footer=a.Footer})(fe||={});export{fe as WithdrawForm};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProcessingStateBodyProps, ProcessingStateRowProps } from "../../../../shared/widgets/processing-state/compound/types.js";
|
|
2
|
+
import { ProcessingStateDetails } from "../../../../shared/widgets/processing-state/compound/components/Details.js";
|
|
3
|
+
import { ProcessingStateHeader } from "../../../../shared/widgets/processing-state/compound/components/Header.js";
|
|
4
|
+
import { ProcessingStateHero } from "../../../../shared/widgets/processing-state/compound/components/Hero.js";
|
|
5
|
+
import { ProcessingStateDetectedAtRow, ProcessingStateSourceRow, ProcessingStateSubmittedAtRow } from "../../../../shared/widgets/processing-state/compound/components/Rows.js";
|
|
6
|
+
import { ProcessingStateStatusPill } from "../../../../shared/widgets/processing-state/compound/components/StatusPill.js";
|
|
7
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
8
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
9
|
|
|
4
10
|
//#region src/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts
|
|
@@ -15,6 +21,35 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
15
21
|
*
|
|
16
22
|
* Renders only while the FSM is on `inProgress`.
|
|
17
23
|
*/
|
|
18
|
-
|
|
24
|
+
interface WithdrawInProgressOwnProps {
|
|
25
|
+
/**
|
|
26
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><Hero /><StatusPill />
|
|
27
|
+
* <Details><SourceTxRow label="Withdrawal tx" /><SubmittedAtRow /></Details></Body>`. Pass
|
|
28
|
+
* children to interleave your own elements between compound parts.
|
|
29
|
+
*/
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
declare function WithdrawInProgress({
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}: ComponentProps<"div"> & WithdrawInProgressOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
36
|
+
/**
|
|
37
|
+
* Withdraw-tuned default for the source-tx row label. Without this wrapper, hosts composing
|
|
38
|
+
* `<WithdrawInProgress.SourceTxRow />` would inherit the deposit-flow's "Deposit tx" default —
|
|
39
|
+
* the wrong copy for a withdrawal. Host-supplied `label` overrides.
|
|
40
|
+
*/
|
|
41
|
+
declare function WithdrawInProgressSourceTxRow(props?: ProcessingStateRowProps): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
declare namespace WithdrawInProgress {
|
|
43
|
+
type Props = ComponentProps<"div"> & WithdrawInProgressOwnProps;
|
|
44
|
+
const Header: typeof ProcessingStateHeader;
|
|
45
|
+
const Body: (props: ProcessingStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
46
|
+
const Hero: typeof ProcessingStateHero;
|
|
47
|
+
const StatusPill: typeof ProcessingStateStatusPill;
|
|
48
|
+
const Details: typeof ProcessingStateDetails;
|
|
49
|
+
const SourceRow: typeof ProcessingStateSourceRow;
|
|
50
|
+
const SourceTxRow: typeof WithdrawInProgressSourceTxRow;
|
|
51
|
+
const SubmittedAtRow: typeof ProcessingStateSubmittedAtRow;
|
|
52
|
+
const DetectedAtRow: typeof ProcessingStateDetectedAtRow;
|
|
53
|
+
}
|
|
19
54
|
//#endregion
|
|
20
55
|
export { WithdrawInProgress };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawSnapshot as t}from"../../driver/context.js";import{useWithdrawEffectiveState as n}from"../../orchestrator/controller.js";import{ProcessingState as r}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{toAssetDescriptor as i}from"../../../../shared/widgets/asset-descriptor.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawSnapshot as t}from"../../driver/context.js";import{useWithdrawEffectiveState as n}from"../../orchestrator/controller.js";import{ProcessingState as r}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{toAssetDescriptor as i}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";function c({children:c,...l}){let u=t(),d=n(),{_:f}=e(),p=u.settlement,m=(p.status===`ready`||p.status===`stale`)&&p.payload.kind===`pending`?p.payload:void 0;if(d.name!==`inProgress`)return null;let h=d.ctx.input,g=m?.txHash?.formatted,_=m?.txExplorerUrl,v=m?.recipient.formatted,y=u.quote,b=y.status===`ready`||y.status===`stale`?y.payload:void 0,x=i(m?.receiveAsset??b?.receiveAsset)??{symbol:h.receiveTokenSymbol},S=m?.receiveAmount,C=S&&S.value>0?S.formatted:b?.receiveAmount.formatted,w=C===void 0,T=m?.receiveAmountUsd?.formatted??b?.receiveAmountUsd?.formatted??h.amountUsd,E=g?{hash:g,explorerUrl:_}:void 0;return o(r,{...l,headerTitle:f({id:`w-2VR9`,message:`Withdrawal in progress…`}),amount:C??``,...T?{amountUsd:T}:{},...w?{loading:!0}:{},creditedAsset:x,creditedTo:v,sourceTx:E,submittedAt:m?.submittedAt.formatted,children:c??s(a,{children:[o(r.Header,{}),s(r.Body,{children:[o(r.Hero,{}),o(r.StatusPill,{}),s(r.Details,{children:[o(r.SourceTxRow,{label:f({id:`60ahSE`,message:`Withdrawal tx`})}),o(r.SubmittedAtRow,{})]})]})]})})}function l(t={}){let{_:n}=e();return o(r.SourceTxRow,{...t,label:t.label??n({id:`60ahSE`,message:`Withdrawal tx`})})}(function(e){e.Header=r.Header,e.Body=r.Body,e.Hero=r.Hero,e.StatusPill=r.StatusPill,e.Details=r.Details,e.SourceRow=r.SourceRow,e.SourceTxRow=l,e.SubmittedAtRow=r.SubmittedAtRow,e.DetectedAtRow=r.DetectedAtRow})(c||={});export{c as WithdrawInProgress};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SuccessStateBodyProps, SuccessStateRowProps } from "../../../../shared/widgets/success-state/compound/types.js";
|
|
2
|
+
import { SuccessStateActions } from "../../../../shared/widgets/success-state/compound/components/Actions.js";
|
|
3
|
+
import { SuccessStateDetails } from "../../../../shared/widgets/success-state/compound/components/Details.js";
|
|
4
|
+
import { SuccessStateHeader } from "../../../../shared/widgets/success-state/compound/components/Header.js";
|
|
5
|
+
import { SuccessStateHeadline } from "../../../../shared/widgets/success-state/compound/components/Headline.js";
|
|
6
|
+
import { SuccessStateMoreDetails } from "../../../../shared/widgets/success-state/compound/components/MoreDetails.js";
|
|
7
|
+
import { SuccessStateCompletionTxRow, SuccessStateDestinationRow, SuccessStateFillStatusRow, SuccessStateFilledAtRow, SuccessStateSourceRow, SuccessStateSubmittedAtRow, SuccessStateTotalTimeRow, SuccessStateYouReceiveRow } from "../../../../shared/widgets/success-state/compound/components/Rows.js";
|
|
8
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
10
|
|
|
4
11
|
//#region src/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts
|
|
@@ -15,6 +22,43 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
15
22
|
*
|
|
16
23
|
* Renders only when the FSM is on `success`.
|
|
17
24
|
*/
|
|
18
|
-
|
|
25
|
+
interface WithdrawSuccessOwnProps {
|
|
26
|
+
/**
|
|
27
|
+
* Optional custom composition. Defaults to the withdraw-tuned receipt: `<Header />` +
|
|
28
|
+
* `<Body><Headline /><Details><FillStatusRow /><TotalTimeRow /><DestinationRow />
|
|
29
|
+
* <YouReceiveRow /><MoreDetails>…tx rows…</MoreDetails></Details></Body>` + `<Actions />`.
|
|
30
|
+
* The default conditionally mounts `<MoreDetails>` when at least one of the tx / timestamp
|
|
31
|
+
* fields is available. Pass children to interleave your own elements.
|
|
32
|
+
*/
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
declare function WithdrawSuccess({
|
|
36
|
+
children,
|
|
37
|
+
...props
|
|
38
|
+
}: ComponentProps<"div"> & WithdrawSuccessOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
39
|
+
/**
|
|
40
|
+
* Withdraw-tuned default for the source-tx row label. Without this wrapper, hosts composing
|
|
41
|
+
* `<WithdrawSuccess.DepositTxRow />` would inherit the deposit-flow's "Deposit tx" default —
|
|
42
|
+
* the wrong copy for a withdrawal. Host-supplied `label` overrides.
|
|
43
|
+
*/
|
|
44
|
+
declare function WithdrawSuccessDepositTxRow(props?: SuccessStateRowProps): _$react_jsx_runtime0.JSX.Element;
|
|
45
|
+
declare namespace WithdrawSuccess {
|
|
46
|
+
type Props = ComponentProps<"div"> & WithdrawSuccessOwnProps;
|
|
47
|
+
const Header: typeof SuccessStateHeader;
|
|
48
|
+
const Body: (props: SuccessStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
49
|
+
const Headline: typeof SuccessStateHeadline;
|
|
50
|
+
const Details: typeof SuccessStateDetails;
|
|
51
|
+
const FillStatusRow: typeof SuccessStateFillStatusRow;
|
|
52
|
+
const TotalTimeRow: typeof SuccessStateTotalTimeRow;
|
|
53
|
+
const SourceRow: typeof SuccessStateSourceRow;
|
|
54
|
+
const DestinationRow: typeof SuccessStateDestinationRow;
|
|
55
|
+
const YouReceiveRow: typeof SuccessStateYouReceiveRow;
|
|
56
|
+
const MoreDetails: typeof SuccessStateMoreDetails;
|
|
57
|
+
const DepositTxRow: typeof WithdrawSuccessDepositTxRow;
|
|
58
|
+
const CompletionTxRow: typeof SuccessStateCompletionTxRow;
|
|
59
|
+
const SubmittedAtRow: typeof SuccessStateSubmittedAtRow;
|
|
60
|
+
const FilledAtRow: typeof SuccessStateFilledAtRow;
|
|
61
|
+
const Actions: typeof SuccessStateActions;
|
|
62
|
+
}
|
|
19
63
|
//#endregion
|
|
20
64
|
export { WithdrawSuccess };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawSnapshot as t}from"../../driver/context.js";import{useWithdrawActions as n,useWithdrawEffectiveState as r}from"../../orchestrator/controller.js";import{SuccessState as i}from"../../../../shared/widgets/success-state/compound/SuccessState.js";import"../../../../shared/widgets/success-state/compound/index.js";import{toAssetDescriptor as a}from"../../../../shared/widgets/asset-descriptor.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawSnapshot as t}from"../../driver/context.js";import{useWithdrawActions as n,useWithdrawEffectiveState as r}from"../../orchestrator/controller.js";import{SuccessState as i}from"../../../../shared/widgets/success-state/compound/SuccessState.js";import"../../../../shared/widgets/success-state/compound/index.js";import{toAssetDescriptor as a}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";function l({children:l,...u}){let d=t(),f=r(),{close:p}=n(),{_:m}=e();if(f.name!==`success`)return null;let h=d.settlement,g=(h.status===`ready`||h.status===`stale`)&&h.payload.kind===`succeeded`?h.payload:void 0,_=f.ctx.input,v=d.quote,y=v.status===`ready`||v.status===`stale`?v.payload:void 0,b=a(g?.receiveAsset??y?.receiveAsset)??{symbol:_.receiveTokenSymbol},x=g?.receiveAmount.formatted??y?.receiveAmount.formatted??``,S=g?.recipient.formatted,C=g?.txHash?{hash:g.txHash.formatted,explorerUrl:g.txExplorerUrl}:void 0,w=g?.completionTx?{hash:g.completionTx.hash.formatted,...g.completionTx.explorerUrl?{explorerUrl:g.completionTx.explorerUrl}:{}}:void 0;return s(i,{...u,amount:x,creditedAsset:b,creditedTo:S,depositTx:C,...w?{completionTx:w}:{},submittedAt:g?.submittedAt.formatted,filledAt:g?.filledAt.formatted,totalTime:g?.totalTime.formatted,headerTitle:m({id:`q32Nt8`,message:`Withdrawal complete`}),headlineTitle:m({id:`_girqu`,message:`Withdrawal successful`}),headlineDescription:m({id:`flMR3h`,message:`Your funds were successfully withdrawn.`}),onDone:p,doneLabel:m({id:`DPfwMq`,message:`Done`}),children:l??c(o,{children:[s(i.Header,{}),c(i.Body,{children:[s(i.Headline,{}),c(i.Details,{children:[s(i.FillStatusRow,{}),s(i.TotalTimeRow,{}),s(i.DestinationRow,{}),s(i.YouReceiveRow,{}),C||w||g?.submittedAt||g?.filledAt?c(i.MoreDetails,{children:[s(i.DepositTxRow,{label:m({id:`60ahSE`,message:`Withdrawal tx`})}),s(i.CompletionTxRow,{}),s(i.SubmittedAtRow,{}),s(i.FilledAtRow,{})]}):null]})]}),s(i.Actions,{})]})})}function u(t={}){let{_:n}=e();return s(i.DepositTxRow,{...t,label:t.label??n({id:`60ahSE`,message:`Withdrawal tx`})})}(function(e){e.Header=i.Header,e.Body=i.Body,e.Headline=i.Headline,e.Details=i.Details,e.FillStatusRow=i.FillStatusRow,e.TotalTimeRow=i.TotalTimeRow,e.SourceRow=i.SourceRow,e.DestinationRow=i.DestinationRow,e.YouReceiveRow=i.YouReceiveRow,e.MoreDetails=i.MoreDetails,e.DepositTxRow=u,e.CompletionTxRow=i.CompletionTxRow,e.SubmittedAtRow=i.SubmittedAtRow,e.FilledAtRow=i.FilledAtRow,e.Actions=i.Actions})(l||={});export{l as WithdrawSuccess};
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.1.0-alpha.
|
|
1
|
+
var e=`0.1.0-alpha.45`;export{e as version};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/ui/Steps/Steps.d.ts
|
|
5
|
+
interface StepsProps {
|
|
6
|
+
/**
|
|
7
|
+
* The active step's name. Determines which `<Step name="..." />` child renders. Pass the
|
|
8
|
+
* current FSM state name — typically piped through the flow-level wrapper that calls
|
|
9
|
+
* `useDepositEffectiveState()` / `useWithdrawEffectiveState()` so the matched step stays
|
|
10
|
+
* mounted through the parent dialog's close animation.
|
|
11
|
+
*/
|
|
12
|
+
activeStep: string;
|
|
13
|
+
/**
|
|
14
|
+
* When true, the matched step renders without the kit's animated `StepTransition` wrapper.
|
|
15
|
+
* Use for static slot routing — for example when the consumer mounts their own animation
|
|
16
|
+
* primitive around `Steps`, or wants no transition at all.
|
|
17
|
+
*/
|
|
18
|
+
plain?: boolean;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
interface StepProps {
|
|
22
|
+
/** Matches against the `activeStep` of the enclosing `Steps`. */
|
|
23
|
+
name: string;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Declarative slot consumed by {@link Steps}. The component itself renders nothing — its
|
|
28
|
+
* `children` are lifted by the enclosing `Steps` when `name` matches the active step.
|
|
29
|
+
* Outside a `Steps` container the component is a no-op.
|
|
30
|
+
*/
|
|
31
|
+
declare function Step(_props: StepProps): null;
|
|
32
|
+
declare namespace Step {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Slot-routing primitive for FSM-driven multi-screen composition. Renders only the `Step`
|
|
37
|
+
* child whose `name` matches `activeStep`; everything else is dropped from the tree.
|
|
38
|
+
*
|
|
39
|
+
* By default the matched child is wrapped in the kit's `StepTransition` (slide + blur on
|
|
40
|
+
* step change, animated height between commits). Pass `plain` to route without animation
|
|
41
|
+
* when the consumer wraps `Steps` in their own transition primitive.
|
|
42
|
+
*
|
|
43
|
+
* Unknown `activeStep` values render nothing (no fallback child). When two `Step` children
|
|
44
|
+
* declare the same `name`, the first one in source order wins.
|
|
45
|
+
*/
|
|
46
|
+
declare function Steps({
|
|
47
|
+
activeStep,
|
|
48
|
+
plain,
|
|
49
|
+
children
|
|
50
|
+
}: StepsProps): _$react_jsx_runtime0.JSX.Element;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Step, Steps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{StepTransition as e}from"../../dialog/StepTransition.js";import{STEPS_SLOTS as t}from"./Steps.slots.js";import{styles as n}from"./Steps.styles.js";import{Children as r,isValidElement as i,useMemo as a}from"react";import{jsx as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";function c(e){return null}c.displayName=`Steps.Step`;function l({activeStep:r,plain:i=!1,children:c}){let l=a(()=>u(c,r),[c,r]),d=o(`div`,{"data-stridge-slot":t.root,...s.props(n.root),children:l});return i?d:o(e,{stateKey:r,children:d})}function u(e,t){let n=null;return r.forEach(e,e=>{if(n!==null||!i(e)||e.type!==c)return;let r=e.props;r.name===t&&(n=r.children)}),n}export{c as Step,l as Steps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:`steps-root`};export{e as STEPS_SLOTS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:{"Steps__styles.root":`Steps__styles.root`,"display-k1xSpc":`xjp7ctv`,$$css:`@stridge/kit:src/shared/ui/Steps/Steps.styles.ts:7`}};export{e as styles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Steps.slots.js";import"./Steps.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AmountEntryBodyProps, AmountEntryDialogProps, AmountEntryFlowProps, AmountEntryFooterProps, AmountEntryHeaderProps, AmountEntryHeroProps, AmountEntryPillsProps, AmountEntryProps } from "./types.js";
|
|
1
|
+
import { AmountEntryBodyProps, AmountEntryDialogProps, AmountEntryFlowProps, AmountEntryFooterProps, AmountEntryHeaderProps, AmountEntryHeroProps, AmountEntryNoticeProps, AmountEntryPillsProps, AmountEntryProps } from "./types.js";
|
|
2
2
|
import { AmountEntryFlow } from "./components/Flow.js";
|
|
3
3
|
import { AmountEntryFooter } from "./components/Footer.js";
|
|
4
4
|
import { AmountEntryHeader } from "./components/Header.js";
|
|
5
5
|
import { AmountEntryHero } from "./components/Hero/Hero.js";
|
|
6
|
+
import { AmountEntryNotice } from "./components/Notice.js";
|
|
6
7
|
import { AmountEntryPills } from "./components/Pills.js";
|
|
7
8
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
9
|
|
|
@@ -46,6 +47,7 @@ declare namespace AmountEntry {
|
|
|
46
47
|
type PillsProps = AmountEntryPillsProps;
|
|
47
48
|
type FlowProps = AmountEntryFlowProps;
|
|
48
49
|
type FooterProps = AmountEntryFooterProps;
|
|
50
|
+
type NoticeProps = AmountEntryNoticeProps;
|
|
49
51
|
type DialogProps = AmountEntryDialogProps;
|
|
50
52
|
const Header: typeof AmountEntryHeader;
|
|
51
53
|
const Body: typeof AmountEntryBody;
|
|
@@ -53,6 +55,7 @@ declare namespace AmountEntry {
|
|
|
53
55
|
const Pills: typeof AmountEntryPills;
|
|
54
56
|
const Flow: typeof AmountEntryFlow;
|
|
55
57
|
const Footer: typeof AmountEntryFooter;
|
|
58
|
+
const Notice: typeof AmountEntryNotice;
|
|
56
59
|
const Dialog: typeof AmountEntryDialog;
|
|
57
60
|
}
|
|
58
61
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{DialogShell as e}from"../../../dialog/DialogShell.js";import{Card as t}from"../../../ui/Card/Card.js";import{Tooltip as n}from"../../../ui/Tooltip/Tooltip.js";import"../../../ui/Tooltip/index.js";import"../../../../ui/index.js";import{Frame as r}from"../../../dialog/Frame.js";import{AMOUNT_ENTRY_SLOTS as i}from"./AmountEntry.slots.js";import{styles as a}from"./AmountEntry.styles.js";import{AmountEntryContext as o}from"./context.js";import{AmountEntryFlow as s}from"./components/Flow.js";import{AmountEntryFooter as c}from"./components/Footer.js";import{AmountEntryHeader as l}from"./components/Header.js";import{AmountEntryHero as u}from"./components/Hero/Hero.js";import"./components/Hero/index.js";import{
|
|
1
|
+
"use client";import{DialogShell as e}from"../../../dialog/DialogShell.js";import{Card as t}from"../../../ui/Card/Card.js";import{Tooltip as n}from"../../../ui/Tooltip/Tooltip.js";import"../../../ui/Tooltip/index.js";import"../../../../ui/index.js";import{Frame as r}from"../../../dialog/Frame.js";import{AMOUNT_ENTRY_SLOTS as i}from"./AmountEntry.slots.js";import{styles as a}from"./AmountEntry.styles.js";import{AmountEntryContext as o}from"./context.js";import{AmountEntryFlow as s}from"./components/Flow.js";import{AmountEntryFooter as c}from"./components/Footer.js";import{AmountEntryHeader as l}from"./components/Header.js";import{AmountEntryHero as u}from"./components/Hero/Hero.js";import"./components/Hero/index.js";import{AmountEntryNotice as d}from"./components/Notice.js";import{AmountEntryPills as f}from"./components/Pills.js";import{useMemo as p}from"react";import{jsx as m}from"react/jsx-runtime";import*as h from"@stylexjs/stylex";const g={useGrouping:!0,maximumFractionDigits:8},_=[];function v(e){let{amount:t,sendToken:s,receiveToken:c,locale:l,format:u,min:d=0,max:f,onAmountChange:v,headerTitle:y,onBack:b,currencySymbol:x,subLine:S,subLineAmount:C,presets:w=_,activePreset:T,onPresetSelect:E,bridge:D,footerLabel:O,onContinue:k,notice:A,children:j}=e,M=p(()=>({amount:t,sendToken:s,receiveToken:c,locale:l,format:u??g,min:d,max:f,onAmountChange:v,headerTitle:y,onBack:b,currencySymbol:x,subLine:S,subLineAmount:C,presets:w,activePreset:T,onPresetSelect:E,bridge:D,footerLabel:O,onContinue:k,notice:A}),[t,s,c,l,u,d,f,v,y,b,x,S,C,w,T,E,D,O,k,A]);return m(o.Provider,{value:M,children:m(n.Provider,{children:m(r,{"data-stridge-slot":i.root,...h.props(a.root),children:j})})})}function y(e){return m(t.Body,{"data-stridge-slot":i.body,...e})}function b({open:t,defaultOpen:n,onOpenChange:r,trigger:i,children:a,...o}){return m(e,{open:t,defaultOpen:n,onOpenChange:r,trigger:i,children:m(v,{...o,children:a})})}(function(e){e.Header=l,e.Body=y,e.Hero=u,e.Pills=f,e.Flow=s,e.Footer=c,e.Notice=d,e.Dialog=b})(v||={});export{v as AmountEntry};
|
|
@@ -9,6 +9,7 @@ declare const AMOUNT_ENTRY_SLOTS: {
|
|
|
9
9
|
readonly hero: "amount-entry-hero";
|
|
10
10
|
readonly heroBand: "amount-entry-hero-band";
|
|
11
11
|
readonly heroSwap: "amount-entry-hero-swap";
|
|
12
|
+
readonly notice: "amount-entry-notice";
|
|
12
13
|
};
|
|
13
14
|
type AmountEntrySlot = (typeof AMOUNT_ENTRY_SLOTS)[keyof typeof AMOUNT_ENTRY_SLOTS];
|
|
14
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={root:`amount-entry`,header:`amount-entry-header`,body:`amount-entry-body`,footer:`amount-entry-footer`,flow:`amount-entry-flow`,pills:`amount-entry-pills`,hero:`amount-entry-hero`,heroBand:`amount-entry-hero-band`,heroSwap:`amount-entry-hero-swap`};export{e as AMOUNT_ENTRY_SLOTS};
|
|
1
|
+
const e={root:`amount-entry`,header:`amount-entry-header`,body:`amount-entry-body`,footer:`amount-entry-footer`,flow:`amount-entry-flow`,pills:`amount-entry-pills`,hero:`amount-entry-hero`,heroBand:`amount-entry-hero-band`,heroSwap:`amount-entry-hero-swap`,notice:`amount-entry-notice`};export{e as AMOUNT_ENTRY_SLOTS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={root:{"AmountEntry__styles.root":`AmountEntry__styles.root`,"position-kVAEAm":`x1n2onr6`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x17fpy1y`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:18`},header:{"AmountEntry__styles.header":`AmountEntry__styles.header`,"gap-kOIVth":`x1v2ro7d`,"paddingTop-kLKAdn":`xyamay9`,"paddingInlineEnd-kwRFfy":`x1x5flf6`,"paddingBottom-kGO01o":`x1l90r2v`,"paddingInlineStart-kZCmMZ":`xf7dkkf`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:25`},headerTitle:{"AmountEntry__styles.headerTitle":`AmountEntry__styles.headerTitle`,"margin-kogj98":`x1ghz6dp`,"flexGrow-kzQI83":`x1iyjqo2`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:32`},backIcon:{"AmountEntry__styles.backIcon":`AmountEntry__styles.backIcon`,"color-kMwMTN":`xzn0pkc`,"strokeWidth-kfJifR":`xhxwl1`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:36`},closeIcon:{"AmountEntry__styles.closeIcon":`AmountEntry__styles.closeIcon`,"color-kMwMTN":`xzn0pkc`,"strokeWidth-kfJifR":`xhr4kjn`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:40`},heroBlock:{"AmountEntry__styles.heroBlock":`AmountEntry__styles.heroBlock`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"alignItems-kGNEyG":`x6s0dn4`,"paddingTop-kLKAdn":`x1byr4rc`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingBottom-kGO01o":`xwib8y2`,"paddingInlineStart-kZCmMZ":`xz7312c`,"gap-kOIVth":`x167g77z`,"textAlign-k9WMMc":`x2b8uid`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:52`},hero:{"AmountEntry__styles.hero":`AmountEntry__styles.hero`,"gap-kOIVth":`x1nj97wv`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:68`},heroCurrency:{"AmountEntry__styles.heroCurrency":`AmountEntry__styles.heroCurrency`,"display-k1xSpc":`x1rg5ohu`,"fontSize-kGuDYH":`xsfzzmd`,"lineHeight-kLWn49":`xo5v014`,"letterSpacing-kb6lSQ":`x1b4dsll`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:71`},heroAmount:{"AmountEntry__styles.heroAmount":`AmountEntry__styles.heroAmount`,"fontSize-kGuDYH":`xrv4cvt`,"lineHeight-kLWn49":`xo5v014`,"letterSpacing-kb6lSQ":`xo2cfqc`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:77`},subLine:{"AmountEntry__styles.subLine":`AmountEntry__styles.subLine`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x17d4w8g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:82`},subLineIcon:{"AmountEntry__styles.subLineIcon":`AmountEntry__styles.subLineIcon`,"width-kzqmXN":`x6jxa94`,"height-kZKoxP":`x1v9usgg`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:88`},bigSlot:{"AmountEntry__styles.bigSlot":`AmountEntry__styles.bigSlot`,"position-kVAEAm":`x1n2onr6`,"zIndex-kY2c9j":`x1fina04`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x1pha0wt`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:97`},swapToggle:{"AmountEntry__styles.swapToggle":`AmountEntry__styles.swapToggle`,"appearance-kysU6D":`xjyslct`,"display-k1xSpc":`x3nfvp2`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x17d4w8g`,"backgroundColor-kWkggS":`x1qkydf4`,"margin-kogj98":`x1ghz6dp`,"paddingBlock-k8WAf4":`x12ulsxz`,"paddingInline-kg3NbH":`x1awh872`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`xi96bwj`,"cursor-kkrTdU":`x1ypdohk`,"borderRadius-kaIpWk":`x1npxkrn`,"transitionProperty-k1ekBW":`xs2xxs2`,"transitionDuration-kIyJzY":`x9dyr19`,"transitionTimingFunction-kAMwcw":`x9lcvmn`,":hover_backgroundColor-kGzVvX":`x1tkvd9a`,":hover_color-kDPRdz":`xpscirx`,":focus-visible_outline-k3Woio":`x67ar3w`,":focus-visible_outlineOffset-kiEn40":`x7s97pk`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:104`},swapIcon:{"AmountEntry__styles.swapIcon":`AmountEntry__styles.swapIcon`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"width-kzqmXN":`x6jxa94`,"height-kZKoxP":`x1v9usgg`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x1heor9g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:131`},swapTextWrap:{"AmountEntry__styles.swapTextWrap":`AmountEntry__styles.swapTextWrap`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:140`},swapText:{"AmountEntry__styles.swapText":`AmountEntry__styles.swapText`,"position-kVAEAm":`x1n2onr6`,"zIndex-kY2c9j":`x11uqc5h`,"display-k1xSpc":`x1rg5ohu`,"fontSize-kGuDYH":`xkpwil5`,"lineHeight-kLWn49":`x132q4wb`,"fontWeight-k63SB2":`xk50ysn`,"letterSpacing-kb6lSQ":`xjat59b`,"whiteSpace-khDVqt":`xuxw1ft`,"color-kMwMTN":`x1heor9g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:144`},swapSymbol:{"AmountEntry__styles.swapSymbol":`AmountEntry__styles.swapSymbol`,"display-k1xSpc":`x1rg5ohu`,"fontSize-kGuDYH":`xkpwil5`,"lineHeight-kLWn49":`x132q4wb`,"fontWeight-k63SB2":`xk50ysn`,"letterSpacing-kb6lSQ":`xjat59b`,"whiteSpace-khDVqt":`x1sdyfia`,"color-kMwMTN":`x1heor9g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:155`},swapBackdrop:{"AmountEntry__styles.swapBackdrop":`AmountEntry__styles.swapBackdrop`,"position-kVAEAm":`x10l6tqk`,"inset-kpwlN0":`x1v1xp8j`,"zIndex-kY2c9j":`x8knxv4`,"filter-ku685b":`x1qgin71`,"pointerEvents-kfzvcC":`x47corl`,"backgroundImage-kKwaWg":`x1bmns5n`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:165`},pills:{"AmountEntry__styles.pills":`AmountEntry__styles.pills`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"width-kzqmXN":`xh8yej3`,"gap-kOIVth":`x167g77z`,"paddingTop-kLKAdn":`x9desvi`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:178`},flowWrap:{"AmountEntry__styles.flowWrap":`AmountEntry__styles.flowWrap`,"display-k1xSpc":`x78zum5`,"justifyContent-kjj79g":`xl56j7k`,"paddingTop-kLKAdn":`x9desvi`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:191`},flow:{"AmountEntry__styles.flow":`AmountEntry__styles.flow`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"backgroundColor-kWkggS":`x12obg9s`,"borderColor-kVAM5u":`x1bue7yx`,"borderStyle-ksu8eU":`x1y0btm7`,"borderWidth-kMzoRj":`xmkeg23`,"borderRadius-kaIpWk":`x1npxkrn`,"paddingBlock-k8WAf4":`xxlmvz2`,"paddingInline-kg3NbH":`x65v0h`,"gap-kOIVth":`x1c1vhfx`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:198`},flowSide:{"AmountEntry__styles.flowSide":`AmountEntry__styles.flowSide`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x1v2ro7d`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:212`},flowLabels:{"AmountEntry__styles.flowLabels":`AmountEntry__styles.flowLabels`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x12mrbbr`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:219`},flowBridge:{"AmountEntry__styles.flowBridge":`AmountEntry__styles.flowBridge`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:225`},flowBridgeIcon:{"AmountEntry__styles.flowBridgeIcon":`AmountEntry__styles.flowBridgeIcon`,"width-kzqmXN":`x1kky2od`,"height-kZKoxP":`xlup9mm`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,"strokeWidth-kfJifR":`xhr4kjn`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:232`},footer:{"AmountEntry__styles.footer":`AmountEntry__styles.footer`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x167g77z`,"paddingTop-kLKAdn":`x9desvi`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingBottom-kGO01o":`x1t4gjm`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:240`},cta:{"AmountEntry__styles.cta":`AmountEntry__styles.cta`,"width-kzqmXN":`xh8yej3`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:250`},ctaInteractive:{"AmountEntry__styles.ctaInteractive":`AmountEntry__styles.ctaInteractive`,"cursor-kkrTdU":`x1ypdohk`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:253`},ctaInert:{"AmountEntry__styles.ctaInert":`AmountEntry__styles.ctaInert`,"cursor-kkrTdU":`xt0e3qv`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:256`}};export{e as styles};
|
|
1
|
+
const e={root:{"AmountEntry__styles.root":`AmountEntry__styles.root`,"position-kVAEAm":`x1n2onr6`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x17fpy1y`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:18`},header:{"AmountEntry__styles.header":`AmountEntry__styles.header`,"gap-kOIVth":`x1v2ro7d`,"paddingTop-kLKAdn":`xyamay9`,"paddingInlineEnd-kwRFfy":`x1x5flf6`,"paddingBottom-kGO01o":`x1l90r2v`,"paddingInlineStart-kZCmMZ":`xf7dkkf`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:25`},headerTitle:{"AmountEntry__styles.headerTitle":`AmountEntry__styles.headerTitle`,"margin-kogj98":`x1ghz6dp`,"flexGrow-kzQI83":`x1iyjqo2`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:32`},backIcon:{"AmountEntry__styles.backIcon":`AmountEntry__styles.backIcon`,"color-kMwMTN":`xzn0pkc`,"strokeWidth-kfJifR":`xhxwl1`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:36`},closeIcon:{"AmountEntry__styles.closeIcon":`AmountEntry__styles.closeIcon`,"color-kMwMTN":`xzn0pkc`,"strokeWidth-kfJifR":`xhr4kjn`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:40`},heroBlock:{"AmountEntry__styles.heroBlock":`AmountEntry__styles.heroBlock`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"alignItems-kGNEyG":`x6s0dn4`,"paddingTop-kLKAdn":`x1byr4rc`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingBottom-kGO01o":`xwib8y2`,"paddingInlineStart-kZCmMZ":`xz7312c`,"gap-kOIVth":`x167g77z`,"textAlign-k9WMMc":`x2b8uid`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:52`},hero:{"AmountEntry__styles.hero":`AmountEntry__styles.hero`,"gap-kOIVth":`x1nj97wv`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:68`},heroCurrency:{"AmountEntry__styles.heroCurrency":`AmountEntry__styles.heroCurrency`,"display-k1xSpc":`x1rg5ohu`,"fontSize-kGuDYH":`xsfzzmd`,"lineHeight-kLWn49":`xo5v014`,"letterSpacing-kb6lSQ":`x1b4dsll`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:71`},heroAmount:{"AmountEntry__styles.heroAmount":`AmountEntry__styles.heroAmount`,"fontSize-kGuDYH":`xrv4cvt`,"lineHeight-kLWn49":`xo5v014`,"letterSpacing-kb6lSQ":`xo2cfqc`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:77`},subLine:{"AmountEntry__styles.subLine":`AmountEntry__styles.subLine`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x17d4w8g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:82`},subLineIcon:{"AmountEntry__styles.subLineIcon":`AmountEntry__styles.subLineIcon`,"width-kzqmXN":`x6jxa94`,"height-kZKoxP":`x1v9usgg`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:88`},bigSlot:{"AmountEntry__styles.bigSlot":`AmountEntry__styles.bigSlot`,"position-kVAEAm":`x1n2onr6`,"zIndex-kY2c9j":`x1fina04`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x1pha0wt`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:97`},swapToggle:{"AmountEntry__styles.swapToggle":`AmountEntry__styles.swapToggle`,"appearance-kysU6D":`xjyslct`,"display-k1xSpc":`x3nfvp2`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x17d4w8g`,"backgroundColor-kWkggS":`x1qkydf4`,"margin-kogj98":`x1ghz6dp`,"paddingBlock-k8WAf4":`x12ulsxz`,"paddingInline-kg3NbH":`x1awh872`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`xi96bwj`,"cursor-kkrTdU":`x1ypdohk`,"borderRadius-kaIpWk":`x1npxkrn`,"transitionProperty-k1ekBW":`xs2xxs2`,"transitionDuration-kIyJzY":`x9dyr19`,"transitionTimingFunction-kAMwcw":`x9lcvmn`,":hover_backgroundColor-kGzVvX":`x1tkvd9a`,":hover_color-kDPRdz":`xpscirx`,":focus-visible_outline-k3Woio":`x67ar3w`,":focus-visible_outlineOffset-kiEn40":`x7s97pk`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:104`},swapIcon:{"AmountEntry__styles.swapIcon":`AmountEntry__styles.swapIcon`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"width-kzqmXN":`x6jxa94`,"height-kZKoxP":`x1v9usgg`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x1heor9g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:131`},swapTextWrap:{"AmountEntry__styles.swapTextWrap":`AmountEntry__styles.swapTextWrap`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:140`},swapText:{"AmountEntry__styles.swapText":`AmountEntry__styles.swapText`,"position-kVAEAm":`x1n2onr6`,"zIndex-kY2c9j":`x11uqc5h`,"display-k1xSpc":`x1rg5ohu`,"fontSize-kGuDYH":`xkpwil5`,"lineHeight-kLWn49":`x132q4wb`,"fontWeight-k63SB2":`xk50ysn`,"letterSpacing-kb6lSQ":`xjat59b`,"whiteSpace-khDVqt":`xuxw1ft`,"color-kMwMTN":`x1heor9g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:144`},swapSymbol:{"AmountEntry__styles.swapSymbol":`AmountEntry__styles.swapSymbol`,"display-k1xSpc":`x1rg5ohu`,"fontSize-kGuDYH":`xkpwil5`,"lineHeight-kLWn49":`x132q4wb`,"fontWeight-k63SB2":`xk50ysn`,"letterSpacing-kb6lSQ":`xjat59b`,"whiteSpace-khDVqt":`x1sdyfia`,"color-kMwMTN":`x1heor9g`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:155`},swapBackdrop:{"AmountEntry__styles.swapBackdrop":`AmountEntry__styles.swapBackdrop`,"position-kVAEAm":`x10l6tqk`,"inset-kpwlN0":`x1v1xp8j`,"zIndex-kY2c9j":`x8knxv4`,"filter-ku685b":`x1qgin71`,"pointerEvents-kfzvcC":`x47corl`,"backgroundImage-kKwaWg":`x1bmns5n`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:165`},pills:{"AmountEntry__styles.pills":`AmountEntry__styles.pills`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"width-kzqmXN":`xh8yej3`,"gap-kOIVth":`x167g77z`,"paddingTop-kLKAdn":`x9desvi`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:178`},flowWrap:{"AmountEntry__styles.flowWrap":`AmountEntry__styles.flowWrap`,"display-k1xSpc":`x78zum5`,"justifyContent-kjj79g":`xl56j7k`,"paddingTop-kLKAdn":`x9desvi`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:191`},flow:{"AmountEntry__styles.flow":`AmountEntry__styles.flow`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"backgroundColor-kWkggS":`x12obg9s`,"borderColor-kVAM5u":`x1bue7yx`,"borderStyle-ksu8eU":`x1y0btm7`,"borderWidth-kMzoRj":`xmkeg23`,"borderRadius-kaIpWk":`x1npxkrn`,"paddingBlock-k8WAf4":`xxlmvz2`,"paddingInline-kg3NbH":`x65v0h`,"gap-kOIVth":`x1c1vhfx`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:198`},flowSide:{"AmountEntry__styles.flowSide":`AmountEntry__styles.flowSide`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x1v2ro7d`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:212`},flowLabels:{"AmountEntry__styles.flowLabels":`AmountEntry__styles.flowLabels`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x12mrbbr`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:219`},flowBridge:{"AmountEntry__styles.flowBridge":`AmountEntry__styles.flowBridge`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:225`},flowBridgeIcon:{"AmountEntry__styles.flowBridgeIcon":`AmountEntry__styles.flowBridgeIcon`,"width-kzqmXN":`x1kky2od`,"height-kZKoxP":`xlup9mm`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,"strokeWidth-kfJifR":`xhr4kjn`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:232`},footer:{"AmountEntry__styles.footer":`AmountEntry__styles.footer`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"gap-kOIVth":`x167g77z`,"paddingTop-kLKAdn":`x9desvi`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingBottom-kGO01o":`x1t4gjm`,"paddingInlineStart-kZCmMZ":`xz7312c`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:240`},cta:{"AmountEntry__styles.cta":`AmountEntry__styles.cta`,"width-kzqmXN":`xh8yej3`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:250`},ctaInteractive:{"AmountEntry__styles.ctaInteractive":`AmountEntry__styles.ctaInteractive`,"cursor-kkrTdU":`x1ypdohk`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:253`},ctaInert:{"AmountEntry__styles.ctaInert":`AmountEntry__styles.ctaInert`,"cursor-kkrTdU":`xt0e3qv`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:256`},noticeText:{"AmountEntry__styles.noticeText":`AmountEntry__styles.noticeText`,"marginBlock-kqGvvJ":`x10im51j`,"textAlign-k9WMMc":`x2b8uid`,$$css:`@stridge/kit:src/shared/widgets/amount-entry/compound/AmountEntry.styles.ts:260`}};export{e as styles};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AmountEntryNoticeProps } from "../types.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/widgets/amount-entry/compound/components/Notice.d.ts
|
|
5
|
+
declare function AmountEntryNotice(_props?: AmountEntryNoticeProps): _$react_jsx_runtime0.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { AmountEntryNotice };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{text as e}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{AMOUNT_ENTRY_SLOTS as t}from"../AmountEntry.slots.js";import{styles as n}from"../AmountEntry.styles.js";import{useAmountEntryContext as r}from"../context.js";import{jsx as i}from"react/jsx-runtime";import{AnimatePresence as a,m as o}from"motion/react";import*as s from"@stylexjs/stylex";const c={enter:{opacity:0,height:0,filter:`blur(2px)`},center:{opacity:1,height:`auto`,filter:`blur(0px)`,transition:{duration:.22,delay:.05}},exit:{opacity:0,height:0,filter:`blur(2px)`,transition:{duration:.18}}};function l(l={}){let u=r(`AmountEntry.Notice`);return i(a,{initial:!1,children:u.notice?i(o.div,{variants:c,initial:`enter`,animate:`center`,exit:`exit`,style:{overflow:`hidden`},"data-stridge-slot":t.notice,role:`status`,"aria-live":`polite`,children:i(e.p,{size:`sm`,color:`subdued`,...s.props(n.noticeText),children:u.notice})},`notice-slot`):null})}export{l as AmountEntryNotice};
|
|
@@ -127,9 +127,20 @@ interface AmountEntryProps {
|
|
|
127
127
|
* Footer CTA click handler. When undefined the CTA renders inert.
|
|
128
128
|
*/
|
|
129
129
|
onContinue?: () => void;
|
|
130
|
+
/**
|
|
131
|
+
* Validation hint surfaced below the swap-direction Flow row when the typed amount sits
|
|
132
|
+
* outside the host's allowed range (min / max / above balance). Omit when no hint is
|
|
133
|
+
* applicable; the {@link AmountEntry.Notice} part renders nothing in that case.
|
|
134
|
+
*/
|
|
135
|
+
notice?: ReactNode;
|
|
130
136
|
/** Compound parts; see `AmountEntry.Header`, `AmountEntry.Hero`, etc. */
|
|
131
137
|
children?: ReactNode;
|
|
132
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Notice part props — typically rendered without explicit props; the part reads `notice` from
|
|
141
|
+
* the {@link AmountEntry} root via context.
|
|
142
|
+
*/
|
|
143
|
+
type AmountEntryNoticeProps = ComponentProps<"div">;
|
|
133
144
|
/**
|
|
134
145
|
* Body slot part props. Forwards every native `<div>` prop through to the
|
|
135
146
|
* underlying `Card.Body`, which becomes the scrollable region when the
|
|
@@ -221,4 +232,4 @@ interface AmountEntryFooterProps {
|
|
|
221
232
|
onContinue?: () => void;
|
|
222
233
|
}
|
|
223
234
|
//#endregion
|
|
224
|
-
export { AmountEntryBodyProps, AmountEntryDialogProps, AmountEntryFlowProps, AmountEntryFooterProps, AmountEntryHeaderProps, AmountEntryHeroProps, AmountEntryPercentPreset, AmountEntryPillsProps, AmountEntryProps, AmountEntryToken };
|
|
235
|
+
export { AmountEntryBodyProps, AmountEntryDialogProps, AmountEntryFlowProps, AmountEntryFooterProps, AmountEntryHeaderProps, AmountEntryHeroProps, AmountEntryNoticeProps, AmountEntryPercentPreset, AmountEntryPillsProps, AmountEntryProps, AmountEntryToken };
|
|
@@ -13,6 +13,6 @@ declare function ErrorStateMoreDetails({
|
|
|
13
13
|
open: openProp,
|
|
14
14
|
onOpenChange,
|
|
15
15
|
children
|
|
16
|
-
}: ErrorStateMoreDetailsProps): _$react_jsx_runtime0.JSX.Element;
|
|
16
|
+
}: ErrorStateMoreDetailsProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { ErrorStateMoreDetails };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ChevronRightIcon as t}from"../../../../icons/ChevronRightIcon.js";import"../../../../../icons/index.js";import{Collapsible as n}from"../../../../ui/Collapsible/Collapsible.js";import"../../../../ui/Collapsible/index.js";import{Details as r}from"../../../../ui/Details/Details.js";import"../../../../ui/Details/index.js";import{useDirectionalChevronTransform as i}from"../../../../dialog/useDirectionalChevronTransform.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ChevronRightIcon as t}from"../../../../icons/ChevronRightIcon.js";import"../../../../../icons/index.js";import{Collapsible as n}from"../../../../ui/Collapsible/Collapsible.js";import"../../../../ui/Collapsible/index.js";import{Details as r}from"../../../../ui/Details/Details.js";import"../../../../ui/Details/index.js";import{useDirectionalChevronTransform as i}from"../../../../dialog/useDirectionalChevronTransform.js";import{useErrorStateContext as a}from"../context.js";import{ERROR_STATE_SLOTS as o}from"../ErrorState.slots.js";import{styles as s}from"../ErrorState.styles.js";import{useCallback as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"@stylexjs/stylex";function p({label:p,defaultOpen:m=!1,open:h,onOpenChange:g,children:_}){let v=a(`ErrorState.MoreDetails`),{_:y}=e();if(!v.depositTx&&v.submittedAt===void 0&&v.failedAt===void 0)return null;let b=p??y({id:`LEbOpR`,message:`More details`}),x=typeof h==`boolean`,[S,C]=l(m),w=x?h:S,T=c(e=>{x||C(e),g?.(e)},[x,g]),E=f.props(s.moreDetailsTrigger,w?null:s.moreDetailsTriggerClosed),D=f.props(s.moreDetailsChevron),O=i(w);return d(n,{open:w,onOpenChange:T,children:[u(n.Trigger,{nativeButton:!1,render:u(r.Row,{"data-stridge-slot":o.moreDetailsTrigger,label:b,className:E.className,style:E.style,children:u(t,{"aria-hidden":!0,className:D.className,style:{...D.style,transform:O}})})}),u(n.Panel,{children:_})]})}export{p as ErrorStateMoreDetails};
|
|
@@ -14,6 +14,6 @@ declare function SuccessStateMoreDetails({
|
|
|
14
14
|
open: openProp,
|
|
15
15
|
onOpenChange,
|
|
16
16
|
children
|
|
17
|
-
}: SuccessStateMoreDetailsProps): _$react_jsx_runtime0.JSX.Element;
|
|
17
|
+
}: SuccessStateMoreDetailsProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SuccessStateMoreDetails };
|