@stridge/kit 0.1.0-alpha.30 → 0.1.0-alpha.32

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 (82) hide show
  1. package/dist/_internal/drivers/stridge/index.d.ts +2 -2
  2. package/dist/_internal/drivers/stridge/index.js +1 -1
  3. package/dist/deposit/compound/index.d.ts +1 -1
  4. package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
  5. package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +16 -1
  6. package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
  7. package/dist/drivers/stridge/types.d.ts +13 -10
  8. package/dist/drivers/stridge/types.js +1 -1
  9. package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +2 -2
  10. package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
  11. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +12 -0
  12. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
  13. package/dist/drivers/stridge-mock/fixtures.d.ts +6 -6
  14. package/dist/drivers/stridge-mock/fixtures.js +1 -1
  15. package/dist/events/bus/createBus.d.ts +7 -0
  16. package/dist/events/bus/createBus.js +1 -0
  17. package/dist/events/bus/flowIdRegistry.d.ts +17 -0
  18. package/dist/events/bus/flowIdRegistry.js +1 -0
  19. package/dist/events/bus/index.js +1 -0
  20. package/dist/events/bus/metadata.js +1 -0
  21. package/dist/events/context.js +1 -0
  22. package/dist/events/emit/index.js +1 -0
  23. package/dist/events/emit/mapFailure.js +1 -0
  24. package/dist/events/emit/useDepositEmissions.js +1 -0
  25. package/dist/events/emit/useKitEmitter.js +1 -0
  26. package/dist/events/emit/useWithdrawEmissions.js +1 -0
  27. package/dist/events/hooks/index.d.ts +6 -0
  28. package/dist/events/hooks/index.js +1 -0
  29. package/dist/events/hooks/useCurrentFlowId.d.ts +6 -0
  30. package/dist/events/hooks/useCurrentFlowId.js +1 -0
  31. package/dist/events/hooks/useStableHandler.js +1 -0
  32. package/dist/events/hooks/useStridgeEvent.d.ts +8 -0
  33. package/dist/events/hooks/useStridgeEvent.js +1 -0
  34. package/dist/events/hooks/useStridgeEventBus.d.ts +33 -0
  35. package/dist/events/hooks/useStridgeEventBus.js +1 -0
  36. package/dist/events/hooks/useStridgeEvents.d.ts +6 -0
  37. package/dist/events/hooks/useStridgeEvents.js +1 -0
  38. package/dist/events/hooks/useStridgeFlowEvent.d.ts +8 -0
  39. package/dist/events/hooks/useStridgeFlowEvent.js +1 -0
  40. package/dist/events/hooks/useStridgeFlowEvents.d.ts +6 -0
  41. package/dist/events/hooks/useStridgeFlowEvents.js +1 -0
  42. package/dist/events/index.d.ts +14 -0
  43. package/dist/events/index.js +1 -0
  44. package/dist/events/publish.js +1 -0
  45. package/dist/events/types/deposit.d.ts +235 -0
  46. package/dist/events/types/envelope.d.ts +145 -0
  47. package/dist/events/types/index.d.ts +31 -0
  48. package/dist/events/types/kit.d.ts +23 -0
  49. package/dist/events/types/withdraw.d.ts +150 -0
  50. package/dist/flows/deposit/dialog/DepositDialog.d.ts +14 -81
  51. package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
  52. package/dist/flows/deposit/driver/payloads.d.ts +10 -4
  53. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -1
  54. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -1
  55. package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -1
  56. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +1 -1
  57. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
  58. package/dist/flows/deposit/widgets/amount-entry/footerIntent.js +1 -0
  59. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
  60. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
  61. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +1 -1
  62. package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +27 -109
  63. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
  64. package/dist/flows/withdraw/driver/types.d.ts +16 -2
  65. package/dist/flows/withdraw/orchestrator/controller.js +1 -1
  66. package/dist/flows/withdraw/orchestrator/types.d.ts +18 -1
  67. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +5 -13
  68. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
  69. package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
  70. package/dist/i18n/locales/ar.js +1 -1
  71. package/dist/i18n/locales/es.js +1 -1
  72. package/dist/i18n/locales/source-keys.d.ts +1 -1
  73. package/dist/index.d.ts +9 -1
  74. package/dist/index.js +1 -1
  75. package/dist/package.js +1 -1
  76. package/dist/shared/support/SupportLink.js +1 -1
  77. package/dist/shared/terms/TermsLink.js +1 -1
  78. package/dist/stridge/StridgeProvider.d.ts +25 -3
  79. package/dist/stridge/StridgeProvider.js +1 -1
  80. package/package.json +7 -3
  81. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +0 -36
  82. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +0 -1
@@ -1 +1 @@
1
- "use client";import{useSupportConfig as e}from"./SupportConfigContext.js";import{resolveSupport as t}from"./resolveSupport.js";import{SupportButton as n}from"./SupportButton.js";import{BRAND_LINKS as r}from"../constants/brand-links.js";import{ExternalLink as i}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{SupportSpinner as a}from"./SupportSpinner.js";import{useSupportTrigger as o}from"./useSupportTrigger.js";import{useCallback as s}from"react";import{jsx as c}from"react/jsx-runtime";const l={cursor:`not-allowed`,opacity:.6,pointerEvents:`none`};function u(n){let{config:r,merchantContext:i}=e(),a=t(r);return a.kind===`stridge`?c(d,{...n}):a.kind===`url`?c(f,{...n,url:a.url}):c(p,{...n,url:a.url,onOpen:a.onOpen,merchantContext:i})}function d({children:e,suffix:t,onClick:n,style:u,...d}){let f=o(),p=f.status===`loading`,m=s(e=>{n?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),f.open()))},[f,n]),h=p?{...u,...l}:u;return c(i,{...d,href:r.support,suffix:p?c(a,{}):t,onClick:m,"aria-busy":p||void 0,"aria-disabled":p||void 0,style:h,children:e})}function f({url:e,children:t,...n}){return c(i,{...n,href:e,children:t})}function p({url:e,onOpen:t,merchantContext:r,children:a,suffix:o,onClick:l,...u}){let d=s(e=>{l?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t({event:e,...m(r)})))},[l,t,r]),f=s(e=>{l?.(e),!e.defaultPrevented&&t({event:e,...m(r)})},[l,t,r]);return e?c(i,{...u,href:e,suffix:o,onClick:d,children:a}):c(n,{...u,suffix:o,onClick:f,children:a})}function m(e){return e??{gatewayKey:``,environment:``,assetChain:``,assetSymbol:``}}export{u as SupportLink};
1
+ "use client";import{useSupportConfig as e}from"./SupportConfigContext.js";import{resolveSupport as t}from"./resolveSupport.js";import{SupportButton as n}from"./SupportButton.js";import{useKitEmitter as r}from"../../events/emit/useKitEmitter.js";import"../../events/emit/index.js";import{BRAND_LINKS as i}from"../constants/brand-links.js";import{ExternalLink as a}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{SupportSpinner as o}from"./SupportSpinner.js";import{useSupportTrigger as s}from"./useSupportTrigger.js";import{useCallback as c}from"react";import{jsx as l}from"react/jsx-runtime";const u={cursor:`not-allowed`,opacity:.6,pointerEvents:`none`};function d(n){let{config:r,merchantContext:i}=e(),a=t(r);return a.kind===`stridge`?l(f,{...n}):a.kind===`url`?l(p,{...n,url:a.url}):l(m,{...n,url:a.url,onOpen:a.onOpen,merchantContext:i})}function f({children:e,suffix:t,onClick:n,style:d,...f}){let p=s(),m=p.status===`loading`,h=r(),g=c(e=>{n?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),h({type:`kit.support.clicked`,flow:`kit`,tier:`ui`,payload:{context:{event:e}}}),p.open()))},[h,p,n]),_=m?{...d,...u}:d;return l(a,{...f,href:i.support,suffix:m?l(o,{}):t,onClick:g,"aria-busy":m||void 0,"aria-disabled":m||void 0,style:_,children:e})}function p({url:e,children:t,onClick:n,...i}){let o=r(),s=c(e=>{o({type:`kit.support.clicked`,flow:`kit`,tier:`ui`,payload:{context:{event:e}}}),n?.(e)},[o,n]);return l(a,{...i,href:e,onClick:s,children:t})}function m({url:e,onOpen:t,merchantContext:i,children:o,suffix:s,onClick:u,...d}){let f=r(),p=c(e=>{if(u?.(e),e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;e.preventDefault();let n={event:e,...h(i)};f({type:`kit.support.clicked`,flow:`kit`,tier:`ui`,payload:{context:n}}),t(n)},[f,u,t,i]),m=c(e=>{if(u?.(e),e.defaultPrevented)return;let n={event:e,...h(i)};f({type:`kit.support.clicked`,flow:`kit`,tier:`ui`,payload:{context:n}}),t(n)},[f,u,t,i]);return e?l(a,{...d,href:e,suffix:s,onClick:p,children:o}):l(n,{...d,suffix:s,onClick:m,children:o})}function h(e){return e??{gatewayKey:``,environment:``,assetChain:``,assetSymbol:``}}export{d as SupportLink};
@@ -1 +1 @@
1
- "use client";import{useTermsConfig as e}from"./TermsConfigContext.js";import{BRAND_LINKS as t}from"../constants/brand-links.js";import{ExternalLink as n}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{resolveTerms as r}from"./resolveTerms.js";import{TermsButton as i}from"./TermsButton.js";import{useCallback as a}from"react";import{jsx as o}from"react/jsx-runtime";function s(t){let{config:n}=e(),i=r(n);return i.kind===`stridge`?o(c,{...t}):i.kind===`url`?o(l,{...t,url:i.url}):o(u,{...t,url:i.url,onSelect:i.onSelect})}function c(e){return o(n,{...e,href:t.terms})}function l({url:e,...t}){return o(n,{...t,href:e})}function u({url:e,onSelect:t,children:r,onClick:s,...c}){let l=a(e=>{s?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t({event:e})))},[s,t]),u=a(e=>{s?.(e),!e.defaultPrevented&&t({event:e})},[s,t]);return e?o(n,{...c,href:e,onClick:l,children:r}):o(i,{...c,onClick:u,children:r})}export{s as TermsLink};
1
+ "use client";import{useTermsConfig as e}from"./TermsConfigContext.js";import{useKitEmitter as t}from"../../events/emit/useKitEmitter.js";import"../../events/emit/index.js";import{BRAND_LINKS as n}from"../constants/brand-links.js";import{ExternalLink as r}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{resolveTerms as i}from"./resolveTerms.js";import{TermsButton as a}from"./TermsButton.js";import{useCallback as o}from"react";import{jsx as s}from"react/jsx-runtime";function c(t){let{config:n}=e(),r=i(n);return r.kind===`stridge`?s(l,{...t}):r.kind===`url`?s(u,{...t,url:r.url}):s(d,{...t,url:r.url,onSelect:r.onSelect})}function l({onClick:e,...i}){let a=t(),c=o(t=>{a({type:`kit.terms.clicked`,flow:`kit`,tier:`ui`,payload:{context:{event:t}}}),e?.(t)},[a,e]);return s(r,{...i,href:n.terms,onClick:c})}function u({url:e,onClick:n,...i}){let a=t(),c=o(e=>{a({type:`kit.terms.clicked`,flow:`kit`,tier:`ui`,payload:{context:{event:e}}}),n?.(e)},[a,n]);return s(r,{...i,href:e,onClick:c})}function d({url:e,onSelect:n,children:i,onClick:c,...l}){let u=t(),d=o(e=>{c?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),u({type:`kit.terms.clicked`,flow:`kit`,tier:`ui`,payload:{context:{event:e}}}),n({event:e})))},[u,c,n]),f=o(e=>{c?.(e),!e.defaultPrevented&&(u({type:`kit.terms.clicked`,flow:`kit`,tier:`ui`,payload:{context:{event:e}}}),n({event:e}))},[u,c,n]);return e?s(r,{...l,href:e,onClick:d,children:i}):s(a,{...l,onClick:f,children:i})}export{c as TermsLink};
@@ -64,10 +64,20 @@ interface StridgeDepositFlowConfig {
64
64
  */
65
65
  owner?: StridgeFlowOwner;
66
66
  /**
67
- * Low-balance / amount-entry USD floor. Defaults to the kit's internal default
68
- * (`STRIDGE_DEFAULT_MIN_DEPOSIT_USD`) when omitted.
67
+ * Lower USD bound on the deposit amount. Drives the asset-picker's "Low Balance" pill,
68
+ * prefills the amount-entry hero, and gates the confirm CTA — typing below the floor flips
69
+ * the footer to "Update order" and snaps the amount up on click. The kit ships no default:
70
+ * omit to leave the deposit without a host-configured floor (the picker still surfaces any
71
+ * per-chain `min_deposit_usd` the gateway publishes).
69
72
  */
70
- minDepositUsd?: number;
73
+ minAmountUsd?: number;
74
+ /**
75
+ * Upper USD bound on the deposit amount. When set, the effective ceiling is
76
+ * `min(walletBalanceUsd, maxAmountUsd)`. Typing above it surfaces an inline notice and the
77
+ * footer CTA snaps the amount down to the cap on click. Omit to let the wallet balance be
78
+ * the only ceiling.
79
+ */
80
+ maxAmountUsd?: number;
71
81
  /**
72
82
  * Metadata persisted on the UDA at `gateway/start` time. Echoed back on `gateway/{owner}`
73
83
  * and webhook payloads. Treat as untrusted display data.
@@ -121,6 +131,18 @@ interface StridgeWithdrawFlowConfig {
121
131
  * party broadcasting the source-chain tx to the UDA.
122
132
  */
123
133
  owner: StridgeFlowOwner;
134
+ /**
135
+ * Lower USD bound on the withdraw amount. When set, the form blocks submit with a localized
136
+ * "Min $X" CTA while the typed amount sits below the floor. Omit to leave the form without a
137
+ * lower bound (only the wallet balance / non-zero gate apply).
138
+ */
139
+ minAmountUsd?: number;
140
+ /**
141
+ * Upper USD bound on the withdraw amount. When set, the form blocks submit with a localized
142
+ * "Max $X" CTA while the typed amount sits above the cap. Omit to let the brand-currency
143
+ * balance be the only ceiling.
144
+ */
145
+ maxAmountUsd?: number;
124
146
  /**
125
147
  * Metadata persisted on every UDA the withdraw flow provisions. Merged under the kit-set
126
148
  * `kit_flow` / `kit_version` / `source` keys (kit keys win).
@@ -1 +1 @@
1
- "use client";import{createKitI18n as e}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{StridgeContext as t}from"./StridgeContext.js";import{createStridgeDepositDriver as n}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as r}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{KitProvider as i}from"../KitProvider.js";import{resolveSupport as a}from"../shared/support/resolveSupport.js";import{useIntercomMerchantContext as o}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as s}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useOptionalWagmi as c}from"./optionalWagmi.js";import{createStubDepositDriver as l,createStubWithdrawDriver as u}from"./stubs.js";import{useMemo as d,useRef as f,useSyncExternalStore as p}from"react";import{jsx as m}from"react/jsx-runtime";function h({gatewayKey:h,environment:g,asset:_,flows:v,appearance:y,i18n:b,storage:x,dev:S,support:C,terms:w,className:T,children:E}){if(!v.deposit&&!v.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!_)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:D,address:O}=c(),k=d(()=>e(b??{}),[b?.locale,b?.messages]),A=f(k);A.current=k;let j=_.networkId,M=_.symbol,N=v.deposit,P=v.withdraw,F=N?.owner?.address??O??S?.userAddressOverride,I=P?.owner.address,L=d(()=>{if(!(!N||!F))return n({userAddress:F,projectKey:h,destination:{network_id:j,asset_symbol:M,to_address:N.destination.address},wagmiConfig:D,getI18n:()=>A.current,...g?{environment:g}:{},...N.minDepositUsd===void 0?{}:{minDepositUsd:N.minDepositUsd},...N.metadata?{metadata:N.metadata}:{}})},[N,F,h,g,j,M,D]),R=d(()=>l(),[]),z=N?L??R:void 0,B=d(()=>{if(!(!P||!I))return r({userAddress:I,projectKey:h,currency:{networkId:j,assetSymbol:M},wagmiConfig:D,getI18n:()=>A.current,...g?{environment:g}:{},...P.metadata?{metadata:P.metadata}:{}})},[P,I,h,g,j,M,D]),V=d(()=>u(),[]),H=P?B??V:void 0,U=L??B,W=p(e=>U?.subscribe(e)??(()=>{}),()=>{if(L){let e=L.getSnapshot();return e.brand.status===`ready`&&e.target.status===`ready`}return B?B.getSnapshot().receiveOptions.status===`ready`:!1},()=>!1),G=F??I,K=s({gatewayKey:h,environment:g??`production`,assetChain:j,assetSymbol:M,...G?{userAddress:G}:{},...L?{depositDriver:L}:{}});return o(a(C).kind===`stridge`?K:null),m(t,{value:d(()=>({isReady:W,driver:L}),[W,L]),children:m(i,{theme:y?.theme,accent:y?.accent,radius:y?.radius,direction:y?.direction,attribution:y?.attribution,i18n:b,storage:x?.driver,storageNamespace:x?.namespace,className:T,support:C,merchantContext:K,terms:w,...z?{deposit:z}:{},...N?.methods?{depositMethods:N.methods}:{},...H?{withdraw:H}:{},children:E})})}export{h as StridgeProvider};
1
+ "use client";import{StridgeEventsContext as e}from"../events/context.js";import{createKitI18n as t}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{StridgeContext as n}from"./StridgeContext.js";import{createStridgeDepositDriver as r}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as i}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{createBus as a}from"../events/bus/createBus.js";import{createFlowIdRegistry as o}from"../events/bus/flowIdRegistry.js";import{createMetadataStore as s}from"../events/bus/metadata.js";import"../events/bus/index.js";import{KitProvider as c}from"../KitProvider.js";import{resolveSupport as l}from"../shared/support/resolveSupport.js";import{useIntercomMerchantContext as u}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as d}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useOptionalWagmi as f}from"./optionalWagmi.js";import{createStubDepositDriver as p,createStubWithdrawDriver as m}from"./stubs.js";import{useMemo as h,useRef as g,useSyncExternalStore as _}from"react";import{jsx as v}from"react/jsx-runtime";function y({gatewayKey:y,environment:b,asset:x,flows:S,appearance:C,i18n:w,storage:T,dev:E,support:D,terms:O,className:k,children:A}){if(!S.deposit&&!S.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!x)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:j,address:M}=f(),N=h(()=>t(w??{}),[w?.locale,w?.messages]),P=g(N);P.current=N;let F=x.networkId,I=x.symbol,L=S.deposit,R=S.withdraw,z=L?.owner?.address??M??E?.userAddressOverride,B=R?.owner.address,V=h(()=>{if(!(!L||!z))return r({userAddress:z,projectKey:y,destination:{network_id:F,asset_symbol:I,to_address:L.destination.address},wagmiConfig:j,getI18n:()=>P.current,...b?{environment:b}:{},...L.minAmountUsd===void 0?{}:{minAmountUsd:L.minAmountUsd},...L.maxAmountUsd===void 0?{}:{maxAmountUsd:L.maxAmountUsd},...L.metadata?{metadata:L.metadata}:{}})},[L,z,y,b,F,I,j]),H=h(()=>p(),[]),U=L?V??H:void 0,W=h(()=>{if(!(!R||!B))return i({userAddress:B,projectKey:y,currency:{networkId:F,assetSymbol:I},wagmiConfig:j,getI18n:()=>P.current,...b?{environment:b}:{},...R.minAmountUsd===void 0?{}:{minAmountUsd:R.minAmountUsd},...R.maxAmountUsd===void 0?{}:{maxAmountUsd:R.maxAmountUsd},...R.metadata?{metadata:R.metadata}:{}})},[R,B,y,b,F,I,j]),G=h(()=>m(),[]),K=R?W??G:void 0,q=V??W,J=_(e=>q?.subscribe(e)??(()=>{}),()=>{if(V){let e=V.getSnapshot();return e.brand.status===`ready`&&e.target.status===`ready`}return W?W.getSnapshot().receiveOptions.status===`ready`:!1},()=>!1),Y=z??B,X=d({gatewayKey:y,environment:b??`production`,assetChain:F,assetSymbol:I,...Y?{userAddress:Y}:{},...V?{depositDriver:V}:{}});u(l(D).kind===`stridge`?X:null);let Z=h(()=>({isReady:J,driver:V}),[J,V]);return v(e,{value:h(()=>({bus:a(),flowIds:o(),metadata:s()}),[]),children:v(n,{value:Z,children:v(c,{theme:C?.theme,accent:C?.accent,radius:C?.radius,direction:C?.direction,attribution:C?.attribution,i18n:w,storage:T?.driver,storageNamespace:T?.namespace,className:k,support:D,merchantContext:X,terms:O,...U?{deposit:U}:{},...L?.methods?{depositMethods:L.methods}:{},...K?{withdraw:K}:{},children:A})})})}export{y as StridgeProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stridge/kit",
3
- "version": "0.1.0-alpha.30",
3
+ "version": "0.1.0-alpha.32",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -14,6 +14,10 @@
14
14
  "import": "./dist/index.js"
15
15
  },
16
16
  "./styles.css": "./dist/styles/index.css",
17
+ "./events": {
18
+ "types": "./dist/events/index.d.ts",
19
+ "import": "./dist/events/index.js"
20
+ },
17
21
  "./deposit/compound": {
18
22
  "types": "./dist/deposit/compound/index.d.ts",
19
23
  "import": "./dist/deposit/compound/index.js"
@@ -135,8 +139,8 @@
135
139
  },
136
140
  "scripts": {
137
141
  "build": "pnpm run i18n:compile && tsdown",
138
- "check:api": "api-extractor run && api-extractor run --config api-extractor.i18n.json",
139
- "check:api:update": "api-extractor run --local && api-extractor run --local --config api-extractor.i18n.json",
142
+ "check:api": "api-extractor run && api-extractor run --config api-extractor.i18n.json && api-extractor run --config api-extractor.events.json",
143
+ "check:api:update": "api-extractor run --local && api-extractor run --local --config api-extractor.i18n.json && api-extractor run --local --config api-extractor.events.json",
140
144
  "check:attw": "attw --pack . --profile esm-only --exclude-entrypoints ./styles.css",
141
145
  "check:isolation": "depcruise src",
142
146
  "check:publint": "publint",
@@ -1,36 +0,0 @@
1
- import { ReceiveChainPayload, ReceiveTokenOptionPayload } from "../driver/payloads.js";
2
- import { RequestWithdrawalQuoteInput } from "../driver/types.js";
3
- import { ReactNode } from "react";
4
- //#region src/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts
5
- /**
6
- * Form-level event payload — the parsed amount the user typed, alongside the raw input string.
7
- * `numeric` is `null` when the input is empty or unparseable; the host can treat that as "user
8
- * cleared the amount" rather than re-parse the raw string.
9
- */
10
- interface AmountChangedPayload {
11
- raw: string;
12
- numeric: number | null;
13
- }
14
- /**
15
- * Form-level callbacks reading off `WithdrawForm`'s local state. Optional — hosts wiring
16
- * `<WithdrawDialog>` configure them via the `events` prop, hosts using `<WithdrawForm>` directly
17
- * pass them via the form's `events` prop.
18
- */
19
- interface WithdrawFormEventCallbacks {
20
- /** Fires on every recipient-input change (no debounce). */
21
- onRecipientChanged?: (value: string) => void;
22
- /** Fires on every amount-input change with both the raw string and the parsed numeric value. */
23
- onAmountChanged?: (payload: AmountChangedPayload) => void;
24
- /** Fires when the user picks a different receive token in the form's receive-token dropdown. */
25
- onReceiveTokenChanged?: (token: ReceiveTokenOptionPayload) => void;
26
- /** Fires when the user picks a different receive chain in the form's receive-chain dropdown. */
27
- onReceiveChainChanged?: (chain: ReceiveChainPayload) => void;
28
- /**
29
- * Fires when the form fires a fresh `requestQuote` (after the 400ms debounce). The input
30
- * carries everything the driver received so the host can mirror the request shape into
31
- * analytics or pre-warm host-side caches.
32
- */
33
- onQuoteRequested?: (input: RequestWithdrawalQuoteInput) => void;
34
- }
35
- //#endregion
36
- export { WithdrawFormEventCallbacks };
@@ -1 +0,0 @@
1
- "use client";import{createContext as e,use as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=e({});r.displayName=`WithdrawDialogEventsContext`;function i({events:e,children:t}){return n(r,{value:e,children:t})}function a(){return t(r)}export{i as WithdrawDialogEventsProvider,a as useWithdrawDialogEvents};