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

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.
@@ -5,6 +5,7 @@ import { KitScope } from "./scope/KitScope.js";
5
5
  import { KitI18nConfig } from "./shared/i18n/createKitI18n.js";
6
6
  import { IntercomMerchantContext } from "./shared/support/useIntercomMerchantContext.js";
7
7
  import { SupportConfig } from "./shared/support/types.js";
8
+ import { TermsConfig } from "./shared/terms/types.js";
8
9
  import { KitStoragePersistence } from "./storage/types.js";
9
10
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
10
11
 
@@ -54,6 +55,7 @@ declare function KitProvider({
54
55
  storageNamespace,
55
56
  support,
56
57
  merchantContext,
58
+ terms,
57
59
  attribution,
58
60
  ...scopeProps
59
61
  }: KitProvider.Props): _$react_jsx_runtime0.JSX.Element;
@@ -108,6 +110,10 @@ declare namespace KitProvider {
108
110
  * Merchant and user triage metadata passed to merchant-owned support callbacks.
109
111
  */
110
112
  merchantContext?: IntercomMerchantContext;
113
+ /**
114
+ * Merchant-configurable terms link for direct `<KitProvider />` mounts.
115
+ */
116
+ terms?: TermsConfig;
111
117
  }
112
118
  }
113
119
  //#endregion
@@ -1 +1 @@
1
- "use client";import{KitStorageProvider as e}from"./storage/context.js";import"./storage/index.js";import{DepositDriverProvider as t}from"./flows/deposit/driver/context.js";import{getLocaleDirection as n}from"./shared/i18n/getLocaleDirection.js";import{KitI18nProvider as r}from"./shared/i18n/KitI18nProvider.js";import"./i18n/index.js";import{GatewayController as i}from"./flows/deposit/orchestrator/controller.js";import{WithdrawBindingsProvider as a}from"./flows/withdraw/bindings/WithdrawBindings.js";import"./flows/withdraw/bindings/index.js";import{WithdrawDriverProvider as o}from"./flows/withdraw/driver/context.js";import{WithdrawControllerProvider as s}from"./flows/withdraw/orchestrator/controller.js";import{KitScope as c}from"./scope/KitScope.js";import"./scope/index.js";import{SupportConfigContext as l}from"./shared/support/SupportConfigContext.js";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{LazyMotion as f,domMax as p}from"motion/react";function m({children:m,i18n:h,direction:g,deposit:_,depositMethods:v,withdraw:y,storage:b,storageNamespace:x,support:S,merchantContext:C,attribution:w=`visible`,...T}){let E=n(h?.locale),D=m;y&&(D=d(a,{children:d(o,{driver:y,children:d(s,{children:D})})})),_&&(D=d(t,{driver:_,children:d(i,{methodsConfig:v,children:D})}));let O=u(()=>({config:S,merchantContext:C??null}),[S,C]),k=S!==void 0||C!==void 0,A=d(r,{locale:h?.locale,messages:h?.messages,children:d(c,{...T,direction:g??E,locale:h?.locale,attribution:w,children:d(e,{storage:b,namespace:x,children:D})})});return d(f,{features:p,children:k?d(l.Provider,{value:O,children:A}):A})}export{m as KitProvider};
1
+ "use client";import{KitStorageProvider as e}from"./storage/context.js";import"./storage/index.js";import{DepositDriverProvider as t}from"./flows/deposit/driver/context.js";import{getLocaleDirection as n}from"./shared/i18n/getLocaleDirection.js";import{KitI18nProvider as r}from"./shared/i18n/KitI18nProvider.js";import"./i18n/index.js";import{GatewayController as i}from"./flows/deposit/orchestrator/controller.js";import{WithdrawBindingsProvider as a}from"./flows/withdraw/bindings/WithdrawBindings.js";import"./flows/withdraw/bindings/index.js";import{WithdrawDriverProvider as o}from"./flows/withdraw/driver/context.js";import{WithdrawControllerProvider as s}from"./flows/withdraw/orchestrator/controller.js";import{KitScope as c}from"./scope/KitScope.js";import"./scope/index.js";import{SupportConfigContext as l}from"./shared/support/SupportConfigContext.js";import{TermsConfigContext as u}from"./shared/terms/TermsConfigContext.js";import{useMemo as d}from"react";import{jsx as f}from"react/jsx-runtime";import{LazyMotion as p,domMax as m}from"motion/react";function h({children:h,i18n:g,direction:_,deposit:v,depositMethods:y,withdraw:b,storage:x,storageNamespace:S,support:C,merchantContext:w,terms:T,attribution:E=`visible`,...D}){let O=n(g?.locale),k=h;b&&(k=f(a,{children:f(o,{driver:b,children:f(s,{children:k})})})),v&&(k=f(t,{driver:v,children:f(i,{methodsConfig:y,children:k})}));let A=d(()=>({config:C,merchantContext:w??null}),[C,w]),j=C!==void 0||w!==void 0,M=d(()=>({config:T}),[T]),N=T!==void 0,P=f(r,{locale:g?.locale,messages:g?.messages,children:f(c,{...D,direction:_??O,locale:g?.locale,attribution:E,children:f(e,{storage:x,namespace:S,children:k})})});return j&&(P=f(l.Provider,{value:A,children:P})),N&&(P=f(u.Provider,{value:M,children:P})),f(p,{features:m,children:P})}export{h as KitProvider};
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{BRAND_LINKS as t}from"../../../../../../shared/constants/brand-links.js";import{ExternalLink as n}from"../../../../../../shared/ui/ExternalLink/ExternalLink.js";import"../../../../../../shared/ui/ExternalLink/index.js";import{CopyIcon as r}from"../../../../../../shared/icons/CopyIcon.js";import{InfoIcon as i}from"../../../../../../shared/icons/InfoIcon.js";import"../../../../../../icons/index.js";import{Button as a}from"../../../../../../shared/ui/Button/Button.js";import"../../../../../../shared/ui/Button/index.js";import{Card as o}from"../../../../../../shared/ui/Card/Card.js";import{text as s}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{useCopyToClipboard as c}from"../../../../../../shared/utils/useCopyToClipboard.js";import{useTransferCryptoContext as l}from"../context.js";import{TRANSFER_CRYPTO_SLOTS as u}from"../TransferCrypto.slots.js";import{styles as d}from"../TransferCrypto.styles.js";import{InfoTooltip as f}from"./InfoTooltip.js";import{useCallback as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import*as g from"@stylexjs/stylex";function _(){let _=l(`TransferCrypto.Address`),{_:v}=e(),{isCopied:y,copy:b}=c(_.depositAddress),x=v({id:`6D8qH6`,message:`Send the selected token on the selected chain to this address. Funds appear in your account once the network confirms the transfer.`}),S=p(async()=>{await b()&&_.onCopy?.(_.depositAddress)},[b,_]);return h(`div`,{"data-stridge-slot":u.address,...g.props(d.addressSection),children:[h(`div`,{...g.props(d.addressLabelRow),children:[h(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,...g.props(d.addressLabel),children:[v({id:`pCzTTC`,message:`Your deposit address`}),m(f,{content:x,children:m(i,{"aria-hidden":!0,...g.props(d.addressLabelInfo)})})]}),m(n,{href:t.terms,...g.props(d.termsLink),children:m(s.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:v({id:`cGYrpE`,message:`Terms apply`})})})]}),h(o,{variant:`subdued`,dir:`ltr`,...g.props(d.addressPill),children:[m(s.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,...g.props(d.addressText),children:_.depositAddress}),h(a,{variant:`secondary`,onClick:S,"aria-label":v({id:`SOVBoe`,message:`Copy deposit address`}),...g.props(d.copyButton),children:[m(r,{"aria-hidden":!0,...g.props(d.copyIcon)}),m(s.span,{size:`meta`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`inherit`,children:v(y?{id:`PiH3UR`,message:`Copied!`}:{id:`he3ygx`,message:`Copy`})})]})]})]})}export{_ as TransferCryptoAddress};
1
+ "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{CopyIcon as t}from"../../../../../../shared/icons/CopyIcon.js";import{InfoIcon as n}from"../../../../../../shared/icons/InfoIcon.js";import"../../../../../../icons/index.js";import{Button as r}from"../../../../../../shared/ui/Button/Button.js";import"../../../../../../shared/ui/Button/index.js";import{Card as i}from"../../../../../../shared/ui/Card/Card.js";import{text as a}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{TermsLink as o}from"../../../../../../shared/terms/TermsLink.js";import"../../../../../../shared/terms/index.js";import{useCopyToClipboard as s}from"../../../../../../shared/utils/useCopyToClipboard.js";import{useTransferCryptoContext as c}from"../context.js";import{TRANSFER_CRYPTO_SLOTS as l}from"../TransferCrypto.slots.js";import{styles as u}from"../TransferCrypto.styles.js";import{InfoTooltip as d}from"./InfoTooltip.js";import{useCallback as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import*as h from"@stylexjs/stylex";function g(){let g=c(`TransferCrypto.Address`),{_}=e(),{isCopied:v,copy:y}=s(g.depositAddress),b=_({id:`6D8qH6`,message:`Send the selected token on the selected chain to this address. Funds appear in your account once the network confirms the transfer.`}),x=f(async()=>{await y()&&g.onCopy?.(g.depositAddress)},[y,g]);return m(`div`,{"data-stridge-slot":l.address,...h.props(u.addressSection),children:[m(`div`,{...h.props(u.addressLabelRow),children:[m(a.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,...h.props(u.addressLabel),children:[_({id:`pCzTTC`,message:`Your deposit address`}),p(d,{content:b,children:p(n,{"aria-hidden":!0,...h.props(u.addressLabelInfo)})})]}),p(o,{...h.props(u.termsLink),children:p(a.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:_({id:`cGYrpE`,message:`Terms apply`})})})]}),m(i,{variant:`subdued`,dir:`ltr`,...h.props(u.addressPill),children:[p(a.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,...h.props(u.addressText),children:g.depositAddress}),m(r,{variant:`secondary`,onClick:x,"aria-label":_({id:`SOVBoe`,message:`Copy deposit address`}),...h.props(u.copyButton),children:[p(t,{"aria-hidden":!0,...h.props(u.copyIcon)}),p(a.span,{size:`meta`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`inherit`,children:_(v?{id:`PiH3UR`,message:`Copied!`}:{id:`he3ygx`,message:`Copy`})})]})]})]})}export{g as TransferCryptoAddress};
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { useKitConfig } from "./scope/context.js";
10
10
  import { KitPortalScope } from "./scope/KitPortalScope.js";
11
11
  import { IntercomMerchantContext } from "./shared/support/useIntercomMerchantContext.js";
12
12
  import { SupportConfig, SupportOpenContext } from "./shared/support/types.js";
13
+ import { TermsConfig, TermsSelectContext } from "./shared/terms/types.js";
13
14
  import { createLocalStorageAdapter, createMemoryStorageAdapter, createSessionStorageAdapter, resolveStorageAdapter } from "./storage/adapters.js";
14
15
  import { createKitStorage } from "./storage/createKitStorage.js";
15
16
  import { DEFAULT_KIT_STORAGE_NAMESPACE, KitStorageProvider, useKitStorage, useKitStorageValue } from "./storage/context.js";
@@ -26,4 +27,4 @@ import { useWithdrawState } from "./flows/withdraw/orchestrator/controller.js";
26
27
  import { useOptionalWithdraw, useWithdraw } from "./flows/withdraw/orchestrator/useWithdraw.js";
27
28
  import { useOptionalStridge, useStridge } from "./stridge/StridgeContext.js";
28
29
  import { StridgeAppearance, StridgeAsset, StridgeDepositDestination, StridgeDepositFlowConfig, StridgeDepositMethodConfig, StridgeDepositMethodsConfig, StridgeFlowOwner, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig } from "./stridge/StridgeProvider.js";
29
- export { type BannerAckBucket, type ChainLogoInput, type ChainLogoMeta, type ChainType, DEFAULT_KIT_STORAGE_NAMESPACE, type DepositActions, type DepositController, type DepositMethod, type DepositMethodConfig, type DepositMethodsConfig, type OpenInput as DepositOpenInput, type DepositSnapshot, type DepositState, type DepositStateName, type FailureInfo, type IntercomMerchantContext, KitPortalScope, KitStorageProvider, type LogosNamespace, type StridgeAppearance, type StridgeAsset, type StridgeDepositDestination, type StridgeDepositFlowConfig, type StridgeDepositMethodConfig, type StridgeDepositMethodsConfig, type StridgeEnvironment, type StridgeFlowOwner, StridgeProvider, type StridgeStorageConfig, type StridgeWithdrawFlowConfig, type SupportConfig, type SupportOpenContext, type TokenLogoInput, type TxRef, type WithdrawActions, type WithdrawBalanceInput, type WithdrawBindings, type WithdrawController, type WithdrawSnapshot, type WithdrawState, type WithdrawStateName, type WithdrawSubmitActions, type WithdrawSubmitCallback, type WithdrawSubmitInput, type WithdrawSuggestedRecipient, type WithdrawalFormSnapshot, bannerAckStorageKey, bucketFromSettlement, createKitStorage, createLocalStorageAdapter, createMemoryStorageAdapter, createSessionStorageAdapter, isValidAddressForChainType, isValidEvmAddress, isValidTronAddress, logos, resolveStorageAdapter, toChainType, useBannerAck, useBannerAckForSettlement, useDeposit, useDepositSnapshot, useDepositState, useKitConfig, useKitStorage, useKitStorageValue, useOptionalDeposit, useOptionalStridge, useOptionalWithdraw, useStridge, useWithdraw, useWithdrawBindings, useWithdrawSnapshot, useWithdrawState };
30
+ export { type BannerAckBucket, type ChainLogoInput, type ChainLogoMeta, type ChainType, DEFAULT_KIT_STORAGE_NAMESPACE, type DepositActions, type DepositController, type DepositMethod, type DepositMethodConfig, type DepositMethodsConfig, type OpenInput as DepositOpenInput, type DepositSnapshot, type DepositState, type DepositStateName, type FailureInfo, type IntercomMerchantContext, KitPortalScope, KitStorageProvider, type LogosNamespace, type StridgeAppearance, type StridgeAsset, type StridgeDepositDestination, type StridgeDepositFlowConfig, type StridgeDepositMethodConfig, type StridgeDepositMethodsConfig, type StridgeEnvironment, type StridgeFlowOwner, StridgeProvider, type StridgeStorageConfig, type StridgeWithdrawFlowConfig, type SupportConfig, type SupportOpenContext, type TermsConfig, type TermsSelectContext, type TokenLogoInput, type TxRef, type WithdrawActions, type WithdrawBalanceInput, type WithdrawBindings, type WithdrawController, type WithdrawSnapshot, type WithdrawState, type WithdrawStateName, type WithdrawSubmitActions, type WithdrawSubmitCallback, type WithdrawSubmitInput, type WithdrawSuggestedRecipient, type WithdrawalFormSnapshot, bannerAckStorageKey, bucketFromSettlement, createKitStorage, createLocalStorageAdapter, createMemoryStorageAdapter, createSessionStorageAdapter, isValidAddressForChainType, isValidEvmAddress, isValidTronAddress, logos, resolveStorageAdapter, toChainType, useBannerAck, useBannerAckForSettlement, useDeposit, useDepositSnapshot, useDepositState, useKitConfig, useKitStorage, useKitStorageValue, useOptionalDeposit, useOptionalStridge, useOptionalWithdraw, useStridge, useWithdraw, useWithdrawBindings, useWithdrawSnapshot, useWithdrawState };
package/dist/package.js CHANGED
@@ -1 +1 @@
1
- var e=`0.1.0-alpha.29`;export{e as version};
1
+ var e=`0.1.0-alpha.30`;export{e as version};
@@ -0,0 +1 @@
1
+ import { ComponentProps, ReactNode } from "react";
@@ -0,0 +1 @@
1
+ "use client";import{styles as e}from"../ui/ExternalLink/ExternalLink.styles.js";import{joinClassNames as t}from"../utils/joinClassNames.js";import{jsx as n}from"react/jsx-runtime";import*as r from"@stylexjs/stylex";function i({children:i,className:s,style:c,...l}){let u=r.props(e.root,a.button),d=t(u.className,s);return n(`button`,{"data-stridge-slot":o.root,type:`button`,...l,className:d,style:{...u.style,...c},children:i})}const a={button:{"TermsButton__termsButtonStyles.button":`TermsButton__termsButtonStyles.button`,"appearance-kysU6D":`xjyslct`,"padding-kmVPX3":`x1717udv`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`x1heor9g`,"cursor-kkrTdU":`x1ypdohk`,"textAlign-k9WMMc":`x16tdsg8`,$$css:`@stridge/kit:src/shared/terms/TermsButton.tsx:28`}},o={root:`terms-button`};export{i as TermsButton};
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ "use client";import{createContext as e,use as t}from"react";const n=e({config:void 0});n.displayName=`TermsConfigContext`;function r(){return t(n)}export{n as TermsConfigContext,r as useTermsConfig};
@@ -0,0 +1 @@
1
+ import { CSSProperties, MouseEventHandler, ReactNode } from "react";
@@ -0,0 +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};
@@ -0,0 +1 @@
1
+ import { TermsConfig, TermsSelectContext } from "./types.js";
@@ -0,0 +1 @@
1
+ import"./TermsConfigContext.js";import"./resolveTerms.js";import"./TermsButton.js";import"./TermsLink.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ function e(e){return e?.onSelect?e.url?{kind:`custom`,onSelect:e.onSelect,url:e.url}:{kind:`custom`,onSelect:e.onSelect}:e?.url?{kind:`url`,url:e.url}:{kind:`stridge`}}export{e as resolveTerms};
@@ -0,0 +1,43 @@
1
+ import { MouseEvent } from "react";
2
+
3
+ //#region src/shared/terms/types.d.ts
4
+ /**
5
+ * Configures the kit's "terms" entry point — the terms link rendered inside the confirm-deposit
6
+ * disclaimer and next to the deposit-address row in the transfer-crypto widget.
7
+ *
8
+ * Omit `terms` to navigate to {@link https://stridge.com/terms | Stridge's terms page}. Provide
9
+ * `url`, `onSelect`, or both to point at merchant-owned legal copy. Empty values (`{}` or
10
+ * `{ url: "" }`) fall back to the Stridge default.
11
+ *
12
+ * Treated as static across the kit's lifetime. Switching modes after mount is not supported —
13
+ * resolve the configuration before the first render of `<StridgeProvider>`.
14
+ */
15
+ interface TermsConfig {
16
+ /**
17
+ * URL used as the terms anchor `href`.
18
+ *
19
+ * Empty string is treated as if the field were omitted.
20
+ */
21
+ url?: string;
22
+ /**
23
+ * Custom handler invoked when the user activates the terms link.
24
+ *
25
+ * Fires on plain left-click with the click event. Modified clicks (cmd / ctrl / shift / alt /
26
+ * middle button) keep anchor navigation when `url` is set so merchants don't lose
27
+ * "open in new tab" affordances.
28
+ */
29
+ onSelect?: (ctx: TermsSelectContext) => void;
30
+ }
31
+ /**
32
+ * Argument passed to {@link TermsConfig.onSelect}.
33
+ *
34
+ * Terms are merchant-owned legal copy with no triage requirements — the context is intentionally
35
+ * narrow so consumers can render an in-app modal, route to a privacy router, or log an analytics
36
+ * event without inheriting any kit-side metadata they don't need.
37
+ */
38
+ interface TermsSelectContext {
39
+ /** React synthetic event for the click that triggered the handler. */
40
+ event: MouseEvent<HTMLElement>;
41
+ }
42
+ //#endregion
43
+ export { TermsConfig, TermsSelectContext };
@@ -4,9 +4,10 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
  //#region src/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts
5
5
  /**
6
6
  * Disclaimer part — soft-tinted notice row with an info glyph and legal copy.
7
- * Defaults to "By clicking Confirm Deposit, you agree to our terms.", with
8
- * `terms` linking to the Stridge terms page. Pass `children` to override the
9
- * full copy (link included).
7
+ * Defaults to "By clicking Confirm Deposit, you agree to our terms.", with the
8
+ * `terms` link routed through {@link TermsLink} so consumers can swap in their
9
+ * own URL or click handler via `<StridgeProvider terms>`. Pass `children` to
10
+ * override the full copy (link included).
10
11
  */
11
12
  declare function ConfirmTransferDisclaimer({
12
13
  children
@@ -1 +1 @@
1
- "use client";import{Trans as e}from"../../../../i18n/Trans.js";import"../../../../../i18n/index.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{InfoIcon as r}from"../../../../icons/InfoIcon.js";import"../../../../../icons/index.js";import{Alert as i}from"../../../../ui/Alert/Alert.js";import"../../../../../ui/index.js";import{CONFIRM_TRANSFER_SLOTS as a}from"../ConfirmTransfer.slots.js";import{styles as o}from"../ConfirmTransfer.styles.js";import{jsx as s}from"react/jsx-runtime";import*as c from"@stylexjs/stylex";const l=s(e,{id:`kR8ayx`,message:`By clicking Confirm Deposit, you agree to our <0>terms</0>.`,components:{0:s(n,{href:t.terms,...c.props(o.disclaimerTermsLink)})}});function u({children:e=l}){return s(i,{"data-stridge-slot":a.disclaimer,variant:`default`,icon:s(r,{}),...c.props(o.section),children:e})}export{u as ConfirmTransferDisclaimer};
1
+ "use client";import{Trans as e}from"../../../../i18n/Trans.js";import"../../../../../i18n/index.js";import{InfoIcon as t}from"../../../../icons/InfoIcon.js";import"../../../../../icons/index.js";import{Alert as n}from"../../../../ui/Alert/Alert.js";import"../../../../../ui/index.js";import{TermsLink as r}from"../../../../terms/TermsLink.js";import"../../../../terms/index.js";import{CONFIRM_TRANSFER_SLOTS as i}from"../ConfirmTransfer.slots.js";import{styles as a}from"../ConfirmTransfer.styles.js";import{jsx as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";const c=o(e,{id:`kR8ayx`,message:`By clicking Confirm Deposit, you agree to our <0>terms</0>.`,components:{0:o(r,{...s.props(a.disclaimerTermsLink)})}});function l({children:e=c}){return o(n,{"data-stridge-slot":i.disclaimer,variant:`default`,icon:o(t,{}),...s.props(a.section),children:e})}export{l as ConfirmTransferDisclaimer};
@@ -1,6 +1,7 @@
1
1
  import { DepositMethodConfig, DepositMethodsConfig } from "../flows/deposit/orchestrator/types.js";
2
2
  import { KitI18nConfig } from "../shared/i18n/createKitI18n.js";
3
3
  import { SupportConfig } from "../shared/support/types.js";
4
+ import { TermsConfig } from "../shared/terms/types.js";
4
5
  import { StridgeEnvironment } from "../drivers/stridge/types.js";
5
6
  import { Address } from "viem";
6
7
  import { ReactNode } from "react";
@@ -233,6 +234,14 @@ declare namespace StridgeProvider {
233
234
  * support and opt out of Stridge messenger globals.
234
235
  */
235
236
  support?: SupportConfig;
237
+ /**
238
+ * Terms link configuration.
239
+ *
240
+ * Omit to point the kit's "terms" links at Stridge's terms page. Provide `url`,
241
+ * `onSelect`, or both to swap in merchant-owned legal copy. Covers both the
242
+ * confirm-deposit disclaimer and the transfer-crypto address row.
243
+ */
244
+ terms?: TermsConfig;
236
245
  /** Optional className applied to the kit's scope root `<div>`. */
237
246
  className?: string;
238
247
  children?: ReactNode;
@@ -273,6 +282,7 @@ declare function StridgeProvider({
273
282
  storage,
274
283
  dev,
275
284
  support,
285
+ terms,
276
286
  className,
277
287
  children
278
288
  }: StridgeProvider.Props): _$react_jsx_runtime0.JSX.Element;
@@ -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,className:w,children:T}){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:E,address:D}=c(),O=d(()=>e(b??{}),[b?.locale,b?.messages]),k=f(O);k.current=O;let A=_.networkId,j=_.symbol,M=v.deposit,N=v.withdraw,P=M?.owner?.address??D??S?.userAddressOverride,F=N?.owner.address,I=d(()=>{if(!(!M||!P))return n({userAddress:P,projectKey:h,destination:{network_id:A,asset_symbol:j,to_address:M.destination.address},wagmiConfig:E,getI18n:()=>k.current,...g?{environment:g}:{},...M.minDepositUsd===void 0?{}:{minDepositUsd:M.minDepositUsd},...M.metadata?{metadata:M.metadata}:{}})},[M,P,h,g,A,j,E]),L=d(()=>l(),[]),R=M?I??L:void 0,z=d(()=>{if(!(!N||!F))return r({userAddress:F,projectKey:h,currency:{networkId:A,assetSymbol:j},wagmiConfig:E,getI18n:()=>k.current,...g?{environment:g}:{},...N.metadata?{metadata:N.metadata}:{}})},[N,F,h,g,A,j,E]),B=d(()=>u(),[]),V=N?z??B:void 0,H=I??z,U=p(e=>H?.subscribe(e)??(()=>{}),()=>{if(I){let e=I.getSnapshot();return e.brand.status===`ready`&&e.target.status===`ready`}return z?z.getSnapshot().receiveOptions.status===`ready`:!1},()=>!1),W=P??F,G=s({gatewayKey:h,environment:g??`production`,assetChain:A,assetSymbol:j,...W?{userAddress:W}:{},...I?{depositDriver:I}:{}});return o(a(C).kind===`stridge`?G:null),m(t,{value:d(()=>({isReady:U,driver:I}),[U,I]),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:w,support:C,merchantContext:G,...R?{deposit:R}:{},...M?.methods?{depositMethods:M.methods}:{},...V?{withdraw:V}:{},children:T})})}export{h as StridgeProvider};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stridge/kit",
3
- "version": "0.1.0-alpha.29",
3
+ "version": "0.1.0-alpha.30",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [