@stridge/kit 0.1.0-alpha.53 → 0.1.0-alpha.54

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.
@@ -1,3 +1,4 @@
1
+ import { Presentation, PresentationConfig, PresentationMode } from "../../shared/presentation/types.js";
1
2
  import { ActivityBoundary, Props } from "../../flows/activity/compound/components/Boundary.js";
2
3
  import { ActivityDialog } from "../../flows/activity/dialog/ActivityDialog.js";
3
- export { ActivityDialog, ActivityBoundary as ActivityFlowBoundary, type Props as ActivityFlowBoundaryProps };
4
+ export { ActivityDialog, ActivityBoundary as ActivityFlowBoundary, type Props as ActivityFlowBoundaryProps, type Presentation, type PresentationConfig, type PresentationMode };
@@ -1,4 +1,5 @@
1
+ import { Presentation, PresentationConfig, PresentationMode } from "../../shared/presentation/types.js";
1
2
  import { DialogShell, DialogShellControls, DialogShellProps } from "../../shared/dialog/DialogShell.js";
2
3
  import { ActivityDetail } from "../../flows/activity/widgets/ActivityDetail.js";
3
4
  import { ActivityList } from "../../flows/activity/widgets/ActivityList.js";
4
- export { ActivityDetail, ActivityList, DialogShell, type DialogShellControls, type DialogShellProps };
5
+ export { ActivityDetail, ActivityList, DialogShell, type DialogShellControls, type DialogShellProps, type Presentation, type PresentationConfig, type PresentationMode };
@@ -1,2 +1,3 @@
1
+ import { Presentation, PresentationConfig, PresentationMode } from "../../shared/presentation/types.js";
1
2
  import { DepositDialog } from "../../flows/deposit/dialog/DepositDialog.js";
2
- export { DepositDialog };
3
+ export { DepositDialog, type Presentation, type PresentationConfig, type PresentationMode };
@@ -1,3 +1,4 @@
1
+ import { Presentation, PresentationConfig, PresentationMode } from "../../shared/presentation/types.js";
1
2
  import { DialogShell, DialogShellControls, DialogShellProps } from "../../shared/dialog/DialogShell.js";
2
3
  import { DepositActivityDetail } from "../../flows/deposit/widgets/activity/DepositActivityDetail.js";
3
4
  import { DepositActivityList } from "../../flows/deposit/widgets/activity/DepositActivityList.js";
@@ -10,4 +11,4 @@ import { ErrorState } from "../../flows/deposit/widgets/error-state/ErrorState.j
10
11
  import { ProcessingState } from "../../flows/deposit/widgets/processing-state/ProcessingState.js";
11
12
  import { SuccessState } from "../../flows/deposit/widgets/success-state/SuccessState.js";
12
13
  import { TransferCrypto } from "../../flows/deposit/widgets/transfer-crypto/TransferCrypto.js";
13
- export { AmountEntry, AssetPicker, ConfirmDeposit, Deposit, DepositActivityDetail, DepositActivityList, DepositStatusBanner, DialogShell, type DialogShellControls, type DialogShellProps, ErrorState, ProcessingState, SuccessState, TransferCrypto };
14
+ export { AmountEntry, AssetPicker, ConfirmDeposit, Deposit, DepositActivityDetail, DepositActivityList, DepositStatusBanner, DialogShell, type DialogShellControls, type DialogShellProps, ErrorState, type Presentation, type PresentationConfig, type PresentationMode, ProcessingState, SuccessState, TransferCrypto };
@@ -1,3 +1,4 @@
1
+ import { Presentation } from "../../../shared/presentation/types.js";
1
2
  import { ErrorInfo } from "react";
2
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
4
 
@@ -16,7 +17,8 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
16
17
  */
17
18
  declare function ActivityDialog({
18
19
  container,
19
- onError
20
+ onError,
21
+ presentation
20
22
  }?: ActivityDialog.Props): _$react_jsx_runtime0.JSX.Element;
21
23
  declare namespace ActivityDialog {
22
24
  interface Props {
@@ -32,6 +34,13 @@ declare namespace ActivityDialog {
32
34
  * `useActivity().close()`.
33
35
  */
34
36
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
37
+ /**
38
+ * Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
39
+ * containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
40
+ * force one surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600).
41
+ * Wins over the provider's `appearance.presentation`; omit to inherit it.
42
+ */
43
+ presentation?: Presentation;
35
44
  }
36
45
  }
37
46
  //#endregion
@@ -1 +1 @@
1
- "use client";import{useActivityControllerContext as e}from"../orchestrator/controller.js";import"../orchestrator/index.js";import{useIntercomShutdownOnUnmount as t}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as n}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{ActivityFlow as r}from"../compound/ActivityFlow.js";import"../../../activity/compound/index.js";import{ActivityDetail as i}from"../widgets/ActivityDetail.js";import{ActivityList as a}from"../widgets/ActivityList.js";import"../../../activity/widgets/index.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({container:c,onError:l}={}){let{state:u,controller:d}=e(),f=u.name!==`closed`;return t(),o(n,{open:f,onOpenChange:e=>{e||d.close()},children:o(n.Content,{container:c,children:o(r.Boundary,{...l?{onError:l}:{},children:s(r.Steps,{children:[o(r.Step,{name:`activityList`,children:o(a,{})}),o(r.Step,{name:`activityDetail`,children:o(i,{})})]})})})})}export{c as ActivityDialog};
1
+ "use client";import{useActivityControllerContext as e}from"../orchestrator/controller.js";import"../orchestrator/index.js";import{useIntercomShutdownOnUnmount as t}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as n}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{ActivityFlow as r}from"../compound/ActivityFlow.js";import"../../../activity/compound/index.js";import{ActivityDetail as i}from"../widgets/ActivityDetail.js";import{ActivityList as a}from"../widgets/ActivityList.js";import"../../../activity/widgets/index.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({container:c,onError:l,presentation:u}={}){let{state:d,controller:f}=e(),p=d.name!==`closed`;return t(),o(n,{open:p,onOpenChange:e=>{e||f.close()},container:c,...u?{presentation:u}:{},children:o(r.Boundary,{...l?{onError:l}:{},children:s(r.Steps,{children:[o(r.Step,{name:`activityList`,children:o(a,{})}),o(r.Step,{name:`activityDetail`,children:o(i,{})})]})})})}export{c as ActivityDialog};
@@ -1,3 +1,4 @@
1
+ import { Presentation } from "../../../shared/presentation/types.js";
1
2
  import { ErrorInfo } from "react";
2
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
4
 
@@ -22,7 +23,8 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
22
23
  declare function DepositDialog({
23
24
  container,
24
25
  metadata,
25
- onError
26
+ onError,
27
+ presentation
26
28
  }?: DepositDialog.Props): _$react_jsx_runtime0.JSX.Element;
27
29
  declare namespace DepositDialog {
28
30
  interface Props {
@@ -44,6 +46,13 @@ declare namespace DepositDialog {
44
46
  * boundary's `onReset` is wired automatically through `useDeposit().close()`.
45
47
  */
46
48
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
49
+ /**
50
+ * Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
51
+ * containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
52
+ * force one surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600).
53
+ * Wins over the provider's `appearance.presentation`; omit to inherit it.
54
+ */
55
+ presentation?: Presentation;
47
56
  }
48
57
  }
49
58
  //#endregion
@@ -1 +1 @@
1
- "use client";import{useDepositSnapshot as e}from"../driver/context.js";import{useControllerContext as t}from"../orchestrator/controller.js";import{useDepositEmissions as n}from"../../../events/emit/useDepositEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as r}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as i}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{Deposit as a}from"../widgets/deposit/compound/Deposit.js";import"../widgets/deposit/compound/index.js";import{DepositActivityDetail as o}from"../widgets/activity/DepositActivityDetail.js";import{DepositActivityList as s}from"../widgets/activity/DepositActivityList.js";import"../widgets/activity/index.js";import{AmountEntry as c}from"../widgets/amount-entry/AmountEntry.js";import"../widgets/amount-entry/index.js";import{AssetPicker as l}from"../widgets/asset-picker/AssetPicker.js";import"../widgets/asset-picker/index.js";import{ConfirmDeposit as u}from"../widgets/confirm-deposit/ConfirmDeposit.js";import"../widgets/confirm-deposit/index.js";import{Deposit as d}from"../widgets/deposit/Deposit.js";import"../widgets/deposit/index.js";import{DepositStatusBanner as f}from"../widgets/deposit-status-banner/DepositStatusBanner.js";import"../widgets/deposit-status-banner/index.js";import{ErrorState as p}from"../widgets/error-state/ErrorState.js";import"../widgets/error-state/index.js";import{ProcessingState as m}from"../widgets/processing-state/ProcessingState.js";import"../widgets/processing-state/index.js";import{SuccessState as h}from"../widgets/success-state/SuccessState.js";import"../widgets/success-state/index.js";import{TransferCrypto as g}from"../widgets/transfer-crypto/TransferCrypto.js";import"../widgets/transfer-crypto/index.js";import{jsx as _,jsxs as v}from"react/jsx-runtime";function y({container:y,metadata:b,onError:x}={}){let{state:S,controller:C}=t(),w=e(),T=S.name!==`closed`;return n({state:S,settlement:w.settlement,quote:w.quote,metadata:b}),r(),_(i,{open:T,onOpenChange:e=>{e||C.close()},children:_(i.Content,{container:y,children:v(a.Boundary,{...x?{onError:x}:{},children:[_(a.Guards,{children:v(a.Steps,{children:[_(a.Step,{name:`deposit`,children:_(d,{})}),_(a.Step,{name:`assetPicker`,children:_(l,{})}),_(a.Step,{name:`amountEntry`,children:_(c,{})}),_(a.Step,{name:`confirmDeposit`,children:_(u,{})}),_(a.Step,{name:`transferCrypto`,children:_(g,{})}),_(a.Step,{name:`processing`,children:_(m,{})}),_(a.Step,{name:`success`,children:_(h,{})}),_(a.Step,{name:`error`,children:_(p,{})}),_(a.Step,{name:`activityList`,children:_(s,{})}),_(a.Step,{name:`activityDetail`,children:_(o,{})})]})}),_(f,{})]})})})}export{y as DepositDialog};
1
+ "use client";import{useDepositSnapshot as e}from"../driver/context.js";import{useControllerContext as t}from"../orchestrator/controller.js";import{useDepositEmissions as n}from"../../../events/emit/useDepositEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as r}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as i}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{Deposit as a}from"../widgets/deposit/compound/Deposit.js";import"../widgets/deposit/compound/index.js";import{DepositActivityDetail as o}from"../widgets/activity/DepositActivityDetail.js";import{DepositActivityList as s}from"../widgets/activity/DepositActivityList.js";import"../widgets/activity/index.js";import{AmountEntry as c}from"../widgets/amount-entry/AmountEntry.js";import"../widgets/amount-entry/index.js";import{AssetPicker as l}from"../widgets/asset-picker/AssetPicker.js";import"../widgets/asset-picker/index.js";import{ConfirmDeposit as u}from"../widgets/confirm-deposit/ConfirmDeposit.js";import"../widgets/confirm-deposit/index.js";import{Deposit as d}from"../widgets/deposit/Deposit.js";import"../widgets/deposit/index.js";import{DepositStatusBanner as f}from"../widgets/deposit-status-banner/DepositStatusBanner.js";import"../widgets/deposit-status-banner/index.js";import{ErrorState as p}from"../widgets/error-state/ErrorState.js";import"../widgets/error-state/index.js";import{ProcessingState as m}from"../widgets/processing-state/ProcessingState.js";import"../widgets/processing-state/index.js";import{SuccessState as h}from"../widgets/success-state/SuccessState.js";import"../widgets/success-state/index.js";import{TransferCrypto as g}from"../widgets/transfer-crypto/TransferCrypto.js";import"../widgets/transfer-crypto/index.js";import{jsx as _,jsxs as v}from"react/jsx-runtime";function y({container:y,metadata:b,onError:x,presentation:S}={}){let{state:C,controller:w}=t(),T=e(),E=C.name!==`closed`;return n({state:C,settlement:T.settlement,quote:T.quote,metadata:b}),r(),_(i,{open:E,onOpenChange:e=>{e||w.close()},container:y,...S?{presentation:S}:{},children:v(a.Boundary,{...x?{onError:x}:{},children:[_(a.Guards,{children:v(a.Steps,{children:[_(a.Step,{name:`deposit`,children:_(d,{})}),_(a.Step,{name:`assetPicker`,children:_(l,{})}),_(a.Step,{name:`amountEntry`,children:_(c,{})}),_(a.Step,{name:`confirmDeposit`,children:_(u,{})}),_(a.Step,{name:`transferCrypto`,children:_(g,{})}),_(a.Step,{name:`processing`,children:_(m,{})}),_(a.Step,{name:`success`,children:_(h,{})}),_(a.Step,{name:`error`,children:_(p,{})}),_(a.Step,{name:`activityList`,children:_(s,{})}),_(a.Step,{name:`activityDetail`,children:_(o,{})})]})}),_(f,{})]})})}export{y as DepositDialog};
@@ -1,3 +1,4 @@
1
+ import { Presentation } from "../../../shared/presentation/types.js";
1
2
  import { WithdrawSubmitCallback } from "../orchestrator/types.js";
2
3
  import { WithdrawBalanceInput, WithdrawSuggestedRecipient } from "../bindings/WithdrawBindings.js";
3
4
  import { ErrorInfo } from "react";
@@ -23,7 +24,8 @@ declare function WithdrawDialog({
23
24
  onError,
24
25
  balance,
25
26
  onSubmit,
26
- suggestedRecipient
27
+ suggestedRecipient,
28
+ presentation
27
29
  }?: WithdrawDialog.Props): _$react_jsx_runtime0.JSX.Element;
28
30
  declare namespace WithdrawDialog {
29
31
  interface Props {
@@ -61,6 +63,13 @@ declare namespace WithdrawDialog {
61
63
  * explicit address you trust the user wants to fill with. Omit to hide the chip.
62
64
  */
63
65
  suggestedRecipient?: WithdrawSuggestedRecipient;
66
+ /**
67
+ * Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
68
+ * containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
69
+ * force one surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600).
70
+ * Wins over the provider's `appearance.presentation`; omit to inherit it.
71
+ */
72
+ presentation?: Presentation;
64
73
  }
65
74
  }
66
75
  //#endregion
@@ -1 +1 @@
1
- "use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawState as n}from"../orchestrator/controller.js";import{useWithdraw as r}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as i}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as a}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as o}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{Withdraw as s}from"../widgets/withdraw/compound/Withdraw.js";import"../../../withdraw/compound/index.js";import{WithdrawActivityDetail as c}from"../widgets/activity/WithdrawActivityDetail.js";import{WithdrawActivityList as l}from"../widgets/activity/WithdrawActivityList.js";import{WithdrawError as u}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawForm as d}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as f}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as p}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../withdraw/widgets/index.js";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({container:g,metadata:_,onError:v,balance:y,onSubmit:b,suggestedRecipient:x}={}){let S=n(),{close:C}=r(),w=t(),T=S.name!==`closed`;return i({state:S,settlement:w.settlement,quote:w.quote,metadata:_}),a(),e({...y===void 0?{}:{balance:y},...b?{onSubmit:b}:{},...x?{suggestedRecipient:x}:{}}),m(o,{open:T,onOpenChange:e=>e?void 0:C(),children:m(o.Content,{container:g,children:m(s.Boundary,{...v?{onError:v}:{},children:m(s.Guards,{children:h(s.Steps,{children:[m(s.Step,{name:`form`,children:m(d,{})}),m(s.Step,{name:`inProgress`,children:m(f,{})}),m(s.Step,{name:`success`,children:m(p,{})}),m(s.Step,{name:`error`,children:m(u,{})}),m(s.Step,{name:`activityList`,children:m(l,{})}),m(s.Step,{name:`activityDetail`,children:m(c,{})})]})})})})})}export{g as WithdrawDialog};
1
+ "use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawState as n}from"../orchestrator/controller.js";import{useWithdraw as r}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as i}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as a}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as o}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{Withdraw as s}from"../widgets/withdraw/compound/Withdraw.js";import"../../../withdraw/compound/index.js";import{WithdrawActivityDetail as c}from"../widgets/activity/WithdrawActivityDetail.js";import{WithdrawActivityList as l}from"../widgets/activity/WithdrawActivityList.js";import{WithdrawError as u}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawForm as d}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as f}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as p}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../withdraw/widgets/index.js";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({container:g,metadata:_,onError:v,balance:y,onSubmit:b,suggestedRecipient:x,presentation:S}={}){let C=n(),{close:w}=r(),T=t(),E=C.name!==`closed`;return i({state:C,settlement:T.settlement,quote:T.quote,metadata:_}),a(),e({...y===void 0?{}:{balance:y},...b?{onSubmit:b}:{},...x?{suggestedRecipient:x}:{}}),m(o,{open:E,onOpenChange:e=>e?void 0:w(),container:g,...S?{presentation:S}:{},children:m(s.Boundary,{...v?{onError:v}:{},children:m(s.Guards,{children:h(s.Steps,{children:[m(s.Step,{name:`form`,children:m(d,{})}),m(s.Step,{name:`inProgress`,children:m(f,{})}),m(s.Step,{name:`success`,children:m(p,{})}),m(s.Step,{name:`error`,children:m(u,{})}),m(s.Step,{name:`activityList`,children:m(l,{})}),m(s.Step,{name:`activityDetail`,children:m(c,{})})]})})})})}export{g as WithdrawDialog};
package/dist/package.js CHANGED
@@ -1 +1 @@
1
- var e=`0.1.0-alpha.53`;export{e as version};
1
+ var e=`0.1.0-alpha.54`;export{e as version};
@@ -1,3 +1,4 @@
1
+ import { Presentation } from "../presentation/types.js";
1
2
  import { ReactElement, ReactNode } from "react";
2
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
4
 
@@ -22,18 +23,30 @@ interface DialogShellControls {
22
23
  }
23
24
  interface DialogShellProps extends DialogShellControls {
24
25
  /**
25
- * Widget JSX rendered inside `Dialog.Content`. Each widget detects
26
- * the dialog context and swaps to its bare frame, so the same
26
+ * Element the surface portals into. Defaults to `document.body`. Doubles as the measured
27
+ * containing block for `"auto"` presentation the dialog-vs-drawer breakpoint is measured
28
+ * against this element's width when supplied, else the viewport.
29
+ */
30
+ container?: HTMLElement | null;
31
+ /**
32
+ * Surface override forwarded to {@link AdaptiveSurface}. Falls back to the provider's
33
+ * `appearance.presentation`, then `"auto"`. Omit to inherit the provider default.
34
+ */
35
+ presentation?: Presentation;
36
+ /**
37
+ * Widget JSX rendered inside the surface. Each widget detects the
38
+ * surface context and swaps to its bare frame, so the same
27
39
  * composition that works inline as `Card variant="frame"` paints
28
40
  * the same surface chrome here.
29
41
  */
30
42
  children?: ReactNode;
31
43
  }
32
44
  /**
33
- * Pre-composed dialog shell for a kit widget. Wraps `Dialog.Root` +
34
- * (optional) `Dialog.Trigger` + `Dialog.Content` so consumers don't
35
- * re-stitch those three primitives every time they want to open a
36
- * widget in a modal.
45
+ * Pre-composed dialog shell for a kit widget. Wraps {@link AdaptiveSurface}
46
+ * so consumers don't re-stitch the surface primitives every time they want
47
+ * to open a widget in a modal. The surface is responsive — a centred dialog
48
+ * on wide containers, a bottom-sheet drawer below the breakpoint — and the
49
+ * widget renders its bare frame inside either via the shared surface context.
37
50
  *
38
51
  * Each widget also exposes a typed `.Dialog` form (`Deposit.Dialog`,
39
52
  * `AssetPicker.Dialog`, …) that wraps this shell and forwards the
@@ -57,6 +70,8 @@ declare function DialogShell({
57
70
  defaultOpen,
58
71
  onOpenChange,
59
72
  trigger,
73
+ container,
74
+ presentation,
60
75
  children
61
76
  }: DialogShellProps): _$react_jsx_runtime0.JSX.Element;
62
77
  //#endregion
@@ -1 +1 @@
1
- "use client";import{Dialog as e}from"../ui/Dialog/Dialog.js";import"../ui/Dialog/index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({open:r,defaultOpen:i,onOpenChange:a,trigger:o,children:s}){return n(e,{open:r,defaultOpen:i,onOpenChange:a,children:[o?t(e.Trigger,{render:o}):null,t(e.Content,{children:s})]})}export{r as DialogShell};
1
+ "use client";import{AdaptiveSurface as e}from"../ui/AdaptiveSurface/AdaptiveSurface.js";import"../ui/AdaptiveSurface/index.js";import{jsx as t}from"react/jsx-runtime";function n({open:n,defaultOpen:r,onOpenChange:i,trigger:a,container:o,presentation:s,children:c}){return t(e,{open:n,defaultOpen:r,onOpenChange:i,...a?{trigger:a}:{},container:o,...s?{presentation:s}:{},children:c})}export{n as DialogShell};
@@ -1 +1 @@
1
- "use client";import{useEffect as e,useLayoutEffect as t,useRef as n}from"react";import{jsx as r}from"react/jsx-runtime";import{AnimatePresence as i,m as a}from"motion/react";const o=[.3,0,.06,1],s={enter:e=>({opacity:0,x:e>=0?16:-16,filter:`blur(6px)`}),center:{opacity:1,x:0,filter:`blur(0px)`,transition:{duration:.22,delay:.12,ease:o}},exit:e=>({opacity:0,x:e>=0?-16:16,filter:`blur(6px)`,transition:{duration:.14,ease:o}})};function c({stateKey:o,children:c}){let l=n([]),u=n(null),d=l.current,f=d[d.length-1],p=0;o!==f&&(p=d.indexOf(o)>=0?-1:1);let m=n(null),h=n(o),g=n(null),_=n(null);return e(()=>{let e=l.current;if(e[e.length-1]===o)return;let t=e.indexOf(o);l.current=t>=0?e.slice(0,t+1):[...e,o]},[o]),t(()=>{let e=u.current;if(!e)return;let t=e.getBoundingClientRect().height;if(h.current===o){m.current=t;return}let n=m.current;if(h.current=o,m.current=t,n===null||n===t||document.visibilityState===`hidden`)return;let r=e.style.transition;e.style.transition=`none`,e.style.height=`${n}px`,e.offsetHeight,e.style.transition=r,_.current!==null&&window.cancelAnimationFrame(_.current),_.current=window.requestAnimationFrame(()=>{_.current=null,u.current&&(u.current.style.height=`${t}px`)}),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null;let e=u.current;e&&(e.style.height=``)},320)}),e(()=>{let e=()=>{if(document.visibilityState!==`hidden`)return;_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),g.current!==null&&(window.clearTimeout(g.current),g.current=null);let e=u.current;e&&(e.style.height=``)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null)}},[]),r(`div`,{ref:u,style:{position:`relative`,overflow:`hidden`,transition:`height 260ms cubic-bezier(0.3, 0, 0.06, 1)`,flex:`0 1 auto`,minHeight:0,display:`flex`,flexDirection:`column`},children:r(i,{mode:`popLayout`,custom:p,initial:!1,children:r(a.div,{custom:p,variants:s,initial:`enter`,animate:`center`,exit:`exit`,tabIndex:-1,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0,outline:`none`},children:c},o)})})}export{c as StepTransition};
1
+ "use client";import{useEffect as e,useLayoutEffect as t,useRef as n}from"react";import{jsx as r}from"react/jsx-runtime";import{AnimatePresence as i,m as a}from"motion/react";const o=[.3,0,.06,1],s={enter:e=>({opacity:0,x:e>=0?16:-16,filter:`blur(6px)`}),center:{opacity:1,x:0,filter:`blur(0px)`,transition:{duration:.22,delay:.12,ease:o}},exit:e=>({opacity:0,x:e>=0?-16:16,filter:`blur(6px)`,transition:{duration:.14,ease:o}})};function c({stateKey:o,children:c}){let l=n([]),u=n(null),d=l.current,f=d[d.length-1],p=0;o!==f&&(p=d.indexOf(o)>=0?-1:1);let m=n(null),h=n(o),g=n(null),_=n(null);return e(()=>{let e=l.current;if(e[e.length-1]===o)return;let t=e.indexOf(o);l.current=t>=0?e.slice(0,t+1):[...e,o]},[o]),t(()=>{let e=u.current;if(!e)return;let t=Array.from(e.children).find(e=>e instanceof HTMLElement&&getComputedStyle(e).position!==`absolute`),n=t?t.scrollHeight:e.getBoundingClientRect().height;if(h.current===o){m.current=n;return}let r=m.current;if(h.current=o,m.current=n,r===null||r===n||document.visibilityState===`hidden`)return;let i=e.style.transition;e.style.transition=`none`,e.style.height=`${r}px`,e.offsetHeight,e.style.transition=i,_.current!==null&&window.cancelAnimationFrame(_.current),_.current=window.requestAnimationFrame(()=>{_.current=null,u.current&&(u.current.style.height=`${n}px`)}),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null;let e=u.current;e&&(e.style.height=``)},320)}),e(()=>{let e=()=>{if(document.visibilityState!==`hidden`)return;_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),g.current!==null&&(window.clearTimeout(g.current),g.current=null);let e=u.current;e&&(e.style.height=``)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null)}},[]),r(`div`,{ref:u,style:{position:`relative`,overflow:`hidden`,transition:`height 260ms cubic-bezier(0.3, 0, 0.06, 1)`,flex:`0 1 auto`,minHeight:0,display:`flex`,flexDirection:`column`},children:r(i,{mode:`popLayout`,custom:p,initial:!1,children:r(a.div,{custom:p,variants:s,initial:`enter`,animate:`center`,exit:`exit`,tabIndex:-1,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0,outline:`none`},children:c},o)})})}export{c as StepTransition};
@@ -1 +1 @@
1
- "use client";import{resolvePresentation as e}from"./types.js";import{useEffect as t,useLayoutEffect as n,useState as r}from"react";const i=typeof window>`u`?t:n;function a(e){return typeof window>`u`?null:e?e.getBoundingClientRect().width:document.documentElement.clientWidth}function o({container:t,presentation:n}){let{mode:o,breakpoint:s}=e(n),[c,l]=r(`dialog`);return i(()=>{if(o!==`auto`)return;let e=()=>{let e=a(t);l(e!==null&&e<s?`drawer`:`dialog`)};if(e(),t){if(typeof ResizeObserver>`u`)return;let n=new ResizeObserver(e);return n.observe(t),()=>n.disconnect()}if(!(typeof window>`u`))return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[o,s,t]),o===`auto`?c:o}export{o as useResolvedSurfaceKind};
1
+ "use client";import{resolvePresentation as e}from"./types.js";import{useEffect as t,useLayoutEffect as n,useState as r}from"react";const i=typeof window>`u`?t:n;function a(e){if(typeof window>`u`)return null;let t=e?e.getBoundingClientRect().width:document.documentElement.clientWidth;return t>0?t:null}function o({container:t,presentation:n}){let{mode:o,breakpoint:s}=e(n),[c,l]=r(`dialog`);return i(()=>{if(o!==`auto`)return;let e=()=>{let e=a(t);l(e!==null&&e<s?`drawer`:`dialog`)};if(e(),t){if(typeof ResizeObserver>`u`)return;let n=new ResizeObserver(e);return n.observe(t),()=>n.disconnect()}if(!(typeof window>`u`))return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[o,s,t]),o===`auto`?c:o}export{o as useResolvedSurfaceKind};
@@ -1 +1 @@
1
- "use client";import{useKitConfig as e}from"../../../scope/context.js";import{Dialog as t}from"../Dialog/Dialog.js";import"../Dialog/index.js";import{useResolvedSurfaceKind as n}from"../../presentation/useResolvedSurfaceKind.js";import"../../presentation/index.js";import{Drawer as r}from"../Drawer/Drawer.js";import"../Drawer/index.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({open:o,defaultOpen:s,onOpenChange:c,trigger:l,container:u,presentation:d,children:f}){let p=e();return n({container:u,presentation:d??p.presentation})===`drawer`?a(r,{open:o,defaultOpen:s,onOpenChange:c,children:[l?i(r.Trigger,{render:l}):null,i(r.Content,{container:u,children:f})]}):a(t,{open:o,defaultOpen:s,onOpenChange:c,children:[l?i(t.Trigger,{render:l}):null,i(t.Content,{container:u,children:f})]})}export{o as AdaptiveSurface};
1
+ "use client";import{useKitConfig as e}from"../../../scope/context.js";import{useResolvedSurfaceKind as t}from"../../presentation/useResolvedSurfaceKind.js";import"../../presentation/index.js";import{Dialog as n}from"../Dialog/Dialog.js";import"../Dialog/index.js";import{Drawer as r}from"../Drawer/Drawer.js";import"../Drawer/index.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({open:o,defaultOpen:s,onOpenChange:c,trigger:l,container:u,presentation:d,children:f}){let p=e();return t({container:u,presentation:d??p.presentation})===`drawer`?a(r,{open:o,defaultOpen:s,onOpenChange:c,children:[l?i(r.Trigger,{render:l}):null,i(r.Content,{container:u,children:f})]}):a(n,{open:o,defaultOpen:s,onOpenChange:c,children:[l?i(n.Trigger,{render:l}):null,i(n.Content,{container:u,children:f})]})}export{o as AdaptiveSurface};
@@ -1 +1 @@
1
- const e={overlay:{"Drawer__styles.overlay":`Drawer__styles.overlay`,"position-kVAEAm":`xixxii4`,"inset-kpwlN0":`x10a8y8t`,"zIndex-kY2c9j":`xg4qres`,"backgroundColor-kWkggS":`xyxldge`,"opacity-kSiTet":`x1hc1fzr`,"transitionProperty-k1ekBW":`x19991ni`,"transitionDuration-kIyJzY":`x1s4mzch`,"transitionTimingFunction-kAMwcw":`x1xv5090`,":is([data-starting-style], [data-ending-style])_opacity-kdD3Bq":`x1i2unn7`,"@media (prefers-reduced-motion: reduce)_transitionProperty-kXHXEI":`x4wkmsb`,"@media (prefers-reduced-motion: reduce)_transitionDuration-k6CgDc":`x12w9bfk`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:9`},viewport:{"Drawer__styles.viewport":`Drawer__styles.viewport`,"position-kVAEAm":`xixxii4`,"insetBlock-kYYq5F":`x10no89f`,"insetInline-kkqhue":`x17y0mx6`,"zIndex-kY2c9j":`x51lqrf`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"justifyContent-kjj79g":`x13a6bvl`,"alignItems-kGNEyG":`x1qjc9v5`,"pointerEvents-kfzvcC":`x47corl`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:32`},content:{"Drawer__styles.content":`Drawer__styles.content`,"pointerEvents-kfzvcC":`x67bb7w`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"width-kzqmXN":`xh8yej3`,"minHeight-kAzted":`x2lwn1j`,"maxHeight-kskxy":`x96tae4`,"borderStartStartRadius-krdFHd":`x8htq0b`,"borderStartEndRadius-kfmiAY":`x1af6ir8`,"borderTopWidth-kEafiO":`x178xt8z`,"borderInlineWidth-kjGldf":`x1l0rsgs`,"borderBottomWidth-kt9PQ7":`x1qhh985`,"borderStyle-ksu8eU":`x1y0btm7`,"borderColor-kVAM5u":`x1aqcfi1`,"backgroundColor-kWkggS":`x3cgcfv`,"color-kMwMTN":`xzn0pkc`,"boxShadow-kGVxlE":`xa2vu2y`,"fontFamily-kMv6JI":`xlaww2m`,"outline-kI3sdo":`x1a2a7pz`,"overflow-kVQacm":`x7giv3`,"transform-k3aq6I":`xacbhai`,"transitionProperty-k1ekBW":`x11xpdln`,"transitionDuration-kIyJzY":`x1s4mzch`,"transitionTimingFunction-kAMwcw":`xr4whw6`,":is([data-starting-style], [data-ending-style])_transform-koVVf4":`xjvuu2i`,"[data-swiping]_transitionDuration-kRUqrN":`xsqp3co`,"@media (prefers-reduced-motion: reduce)_transitionProperty-kXHXEI":`x4wkmsb`,"@media (prefers-reduced-motion: reduce)_transitionDuration-k6CgDc":`x12w9bfk`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:56`},handle:{"Drawer__styles.handle":`Drawer__styles.handle`,"flexShrink-kmuXW":`x2lah0s`,"width-kzqmXN":`x19k59d4`,"height-kZKoxP":`xl3s093`,"marginInline-kUOVxO":`xvueqy4`,"marginTop-keoZOQ":`xq9mr0s`,"marginBottom-k1K539":`x1782xsq`,"borderRadius-kaIpWk":`x1npxkrn`,"backgroundColor-kWkggS":`x1p0xf7o`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:95`},header:{"Drawer__styles.header":`Drawer__styles.header`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,"paddingTop-kLKAdn":`x1cnzs8`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingBottom-kGO01o":`x1hhzuzn`,"paddingInlineStart-kZCmMZ":`xz7312c`,"borderBottomWidth-kt9PQ7":`xso031l`,"borderBottomStyle-kfdmCh":`x1q0q8m5`,"borderBottomColor-kL6WhQ":`x188r5k3`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:106`},body:{"Drawer__styles.body":`Drawer__styles.body`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"flex-kUk6DE":`x12lumcd`,"minHeight-kAzted":`x2lwn1j`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:120`},bodyScrollArea:{"Drawer__styles.bodyScrollArea":`Drawer__styles.bodyScrollArea`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"flex-kUk6DE":`x12lumcd`,"minHeight-kAzted":`x2lwn1j`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:126`},bodyScrollViewport:{"Drawer__styles.bodyScrollViewport":`Drawer__styles.bodyScrollViewport`,"flex-kUk6DE":`x845mor`,"minHeight-kAzted":`x2lwn1j`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x193iq5w`,"height-kZKoxP":`xt7dq6l`,"maxHeight-kskxy":`xmz0i5r`,"overflowX-kXHlph":`x6ikm8r`,"overflowY-kORKVm":`x1odjw0f`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:132`},bodyInner:{"Drawer__styles.bodyInner":`Drawer__styles.bodyInner`,"boxSizing-kB7OPa":`x9f619`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x193iq5w`,"minWidth-k7Eaqz":`xeuugli`,"paddingTop-kLKAdn":`x1h03h88`,"paddingBottom-kGO01o":`xfvigk`,"paddingInlineStart-kZCmMZ":`xz7312c`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:142`},footer:{"Drawer__styles.footer":`Drawer__styles.footer`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,"borderTopWidth-kEafiO":`x178xt8z`,"borderTopStyle-kPef9Z":`x13fuv20`,"borderTopColor-kLZC3w":`x1wc9ssx`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:153`},title:{"Drawer__styles.title":`Drawer__styles.title`,"marginTop-keoZOQ":`xdj266r`,"marginBottom-k1K539":`xat24cr`,"color-kMwMTN":`xzn0pkc`,"fontFamily-kMv6JI":`xlaww2m`,"fontSize-kGuDYH":`x126f79r`,"fontWeight-k63SB2":`x1qvi77d`,"lineHeight-kLWn49":`xfh9y1j`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:162`},description:{"Drawer__styles.description":`Drawer__styles.description`,"marginTop-keoZOQ":`xdj266r`,"marginBottom-k1K539":`xat24cr`,"color-kMwMTN":`xi96bwj`,"fontFamily-kMv6JI":`xlaww2m`,"fontSize-kGuDYH":`x14qa7mu`,"lineHeight-kLWn49":`x14vj8e1`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:171`}};export{e as styles};
1
+ const e={overlay:{"Drawer__styles.overlay":`Drawer__styles.overlay`,"position-kVAEAm":`xixxii4`,"inset-kpwlN0":`x10a8y8t`,"zIndex-kY2c9j":`xg4qres`,"backgroundColor-kWkggS":`xyxldge`,"opacity-kSiTet":`x1hc1fzr`,"transitionProperty-k1ekBW":`x19991ni`,"transitionDuration-kIyJzY":`x1s4mzch`,"transitionTimingFunction-kAMwcw":`x1xv5090`,":is([data-starting-style], [data-ending-style])_opacity-kdD3Bq":`x1i2unn7`,"@media (prefers-reduced-motion: reduce)_transitionProperty-kXHXEI":`x4wkmsb`,"@media (prefers-reduced-motion: reduce)_transitionDuration-k6CgDc":`x12w9bfk`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:9`},viewport:{"Drawer__styles.viewport":`Drawer__styles.viewport`,"position-kVAEAm":`xixxii4`,"insetBlock-kYYq5F":`x10no89f`,"insetInline-kkqhue":`x17y0mx6`,"zIndex-kY2c9j":`x51lqrf`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"justifyContent-kjj79g":`x13a6bvl`,"alignItems-kGNEyG":`x6s0dn4`,"pointerEvents-kfzvcC":`x47corl`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:34`},content:{"Drawer__styles.content":`Drawer__styles.content`,"pointerEvents-kfzvcC":`x67bb7w`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x1qvtwti`,"minHeight-kAzted":`x2lwn1j`,"maxHeight-kskxy":`x96tae4`,"borderStartStartRadius-krdFHd":`x8htq0b`,"borderStartEndRadius-kfmiAY":`x1af6ir8`,"borderTopWidth-kEafiO":`x178xt8z`,"borderInlineWidth-kjGldf":`x1l0rsgs`,"borderBottomWidth-kt9PQ7":`x1qhh985`,"borderStyle-ksu8eU":`x1y0btm7`,"borderColor-kVAM5u":`x1aqcfi1`,"backgroundColor-kWkggS":`x3cgcfv`,"color-kMwMTN":`xzn0pkc`,"boxShadow-kGVxlE":`xa2vu2y`,"fontFamily-kMv6JI":`xlaww2m`,"outline-kI3sdo":`x1a2a7pz`,"overflow-kVQacm":`x7giv3`,"transform-k3aq6I":`xacbhai`,"transitionProperty-k1ekBW":`x11xpdln`,"transitionDuration-kIyJzY":`x1s4mzch`,"transitionTimingFunction-kAMwcw":`xr4whw6`,":is([data-starting-style], [data-ending-style])_transform-koVVf4":`xjvuu2i`,"[data-swiping]_transitionDuration-kRUqrN":`xsqp3co`,"@media (prefers-reduced-motion: reduce)_transitionProperty-kXHXEI":`x4wkmsb`,"@media (prefers-reduced-motion: reduce)_transitionDuration-k6CgDc":`x12w9bfk`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:61`},handle:{"Drawer__styles.handle":`Drawer__styles.handle`,"flexShrink-kmuXW":`x2lah0s`,"width-kzqmXN":`x19k59d4`,"height-kZKoxP":`xl3s093`,"marginInline-kUOVxO":`xvueqy4`,"marginTop-keoZOQ":`xq9mr0s`,"marginBottom-k1K539":`x1782xsq`,"borderRadius-kaIpWk":`x1npxkrn`,"backgroundColor-kWkggS":`x1p0xf7o`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:101`},header:{"Drawer__styles.header":`Drawer__styles.header`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,"paddingTop-kLKAdn":`x1cnzs8`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,"paddingBottom-kGO01o":`x1hhzuzn`,"paddingInlineStart-kZCmMZ":`xz7312c`,"borderBottomWidth-kt9PQ7":`xso031l`,"borderBottomStyle-kfdmCh":`x1q0q8m5`,"borderBottomColor-kL6WhQ":`x188r5k3`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:112`},body:{"Drawer__styles.body":`Drawer__styles.body`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"flex-kUk6DE":`x12lumcd`,"minHeight-kAzted":`x2lwn1j`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:126`},bodyScrollArea:{"Drawer__styles.bodyScrollArea":`Drawer__styles.bodyScrollArea`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"flex-kUk6DE":`x12lumcd`,"minHeight-kAzted":`x2lwn1j`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:132`},bodyScrollViewport:{"Drawer__styles.bodyScrollViewport":`Drawer__styles.bodyScrollViewport`,"flex-kUk6DE":`x845mor`,"minHeight-kAzted":`x2lwn1j`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x193iq5w`,"height-kZKoxP":`xt7dq6l`,"maxHeight-kskxy":`xmz0i5r`,"overflowX-kXHlph":`x6ikm8r`,"overflowY-kORKVm":`x1odjw0f`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:138`},bodyInner:{"Drawer__styles.bodyInner":`Drawer__styles.bodyInner`,"boxSizing-kB7OPa":`x9f619`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x193iq5w`,"minWidth-k7Eaqz":`xeuugli`,"paddingTop-kLKAdn":`x1h03h88`,"paddingBottom-kGO01o":`xfvigk`,"paddingInlineStart-kZCmMZ":`xz7312c`,"paddingInlineEnd-kwRFfy":`x1o5r3ls`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:148`},footer:{"Drawer__styles.footer":`Drawer__styles.footer`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,"borderTopWidth-kEafiO":`x178xt8z`,"borderTopStyle-kPef9Z":`x13fuv20`,"borderTopColor-kLZC3w":`x1wc9ssx`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:159`},title:{"Drawer__styles.title":`Drawer__styles.title`,"marginTop-keoZOQ":`xdj266r`,"marginBottom-k1K539":`xat24cr`,"color-kMwMTN":`xzn0pkc`,"fontFamily-kMv6JI":`xlaww2m`,"fontSize-kGuDYH":`x126f79r`,"fontWeight-k63SB2":`x1qvi77d`,"lineHeight-kLWn49":`xfh9y1j`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:168`},description:{"Drawer__styles.description":`Drawer__styles.description`,"marginTop-keoZOQ":`xdj266r`,"marginBottom-k1K539":`xat24cr`,"color-kMwMTN":`xi96bwj`,"fontFamily-kMv6JI":`xlaww2m`,"fontSize-kGuDYH":`x14qa7mu`,"lineHeight-kLWn49":`x14vj8e1`,$$css:`@stridge/kit:src/shared/ui/Drawer/Drawer.styles.ts:177`}};export{e as styles};
@@ -1,4 +1,5 @@
1
1
  import { DepositMethodConfig, DepositMethodsConfig } from "../flows/deposit/orchestrator/types.js";
2
+ import { Presentation } from "../shared/presentation/types.js";
2
3
  import { KitI18nConfig } from "../shared/i18n/createKitI18n.js";
3
4
  import { SupportConfig } from "../shared/support/types.js";
4
5
  import { TermsConfig } from "../shared/terms/types.js";
@@ -130,6 +131,13 @@ interface StridgeAppearance {
130
131
  * Controls the "Powered by Stridge" attribution row inside every gateway widget frame.
131
132
  */
132
133
  attribution?: "visible" | "hidden";
134
+ /**
135
+ * How gateway dialogs present themselves. `"auto"` (default) renders a centred dialog on wide
136
+ * containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"` force one
137
+ * surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600). Measured against
138
+ * the dialog's containing block (its portal `container`, else the viewport).
139
+ */
140
+ presentation?: Presentation;
133
141
  }
134
142
  /**
135
143
  * Development / preview-only knobs. Grouped under a single `dev` prop so production integrations
@@ -1 +1 @@
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{createStridgeCatalog as n}from"../drivers/stridge/catalog.js";import{createStridgeActivityDriver as r}from"../drivers/stridge/createStridgeActivityDriver.js";import{createStridgeDepositDriver as i}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as a}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{createBus as ee}from"../events/bus/createBus.js";import{createFlowIdRegistry as te}from"../events/bus/flowIdRegistry.js";import{createMetadataStore as o}from"../events/bus/metadata.js";import"../events/bus/index.js";import{KitProvider as s}from"../KitProvider.js";import{resolveMerchantLink as c}from"../shared/merchant-link/resolveMerchantLink.js";import"../shared/merchant-link/index.js";import{useIntercomMerchantContext as l}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as u}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useDeepMemo as d}from"../shared/utils/useDeepMemo.js";import{ConnectWalletContext as f}from"../shared/wallet/ConnectWalletContext.js";import{DepositOwnerContext as p}from"./depositOwner.js";import{useOptionalWagmi as m}from"./optionalWagmi.js";import{createStubDepositDriver as h,createStubWithdrawDriver as g}from"./stubs.js";import{useEffect as _,useMemo as v,useRef as y}from"react";import{jsx as b}from"react/jsx-runtime";function x({gatewayKey:x,environment:S,asset:C,flows:w,appearance:T,i18n:E,storage:D,dev:O,support:k,terms:ne,prefetch:A,connectWallet:j,className:re,children:ie}){if(!w.deposit&&!w.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!C)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:M,address:N}=m(),P=v(()=>t(E??{}),[E?.locale,E?.messages]),F=y(P);F.current=P;let I=d(C),L=d(w.deposit),R=d(w.withdraw),z=I.networkId,B=I.symbol,V=L?.owner?.address??N??O?.userAddressOverride,H=R?.owner.address,U=v(()=>n({projectKey:x,...S?{environment:S}:{}}),[x,S]),W=v(()=>{if(!(!L||!V))return i({userAddress:V,projectKey:x,destination:{network_id:z,asset_symbol:B,to_address:L.destination.address},wagmiConfig:M,catalog:U,getI18n:()=>F.current,...S?{environment:S}:{},...L.minAmountUsd===void 0?{}:{minAmountUsd:L.minAmountUsd},...L.maxAmountUsd===void 0?{}:{maxAmountUsd:L.maxAmountUsd},...L.metadata?{metadata:L.metadata}:{}})},[L,V,x,S,z,B,M,U]),G=v(()=>h(),[]),K=L?W??G:void 0,q=v(()=>{if(!(!R||!H))return a({userAddress:H,projectKey:x,currency:{networkId:z,assetSymbol:B},wagmiConfig:M,catalog:U,getI18n:()=>F.current,...S?{environment:S}:{},...R.minAmountUsd===void 0?{}:{minAmountUsd:R.minAmountUsd},...R.maxAmountUsd===void 0?{}:{maxAmountUsd:R.maxAmountUsd},...R.metadata?{metadata:R.metadata}:{}})},[R,H,x,S,z,B,M,U]),J=v(()=>g(),[]),Y=R?q??J:void 0,X=(L?V:void 0)??(R?H:void 0),Z=v(()=>{if(X)return r({userAddress:X,projectKey:x,catalog:U,...S?{environment:S}:{}})},[X,x,S,U]);_(()=>{if(!A)return;let e=A===!0||A.includes(`deposit`),t=A===!0||A.includes(`withdraw`),n=A===!0||A.includes(`activity`)||e||t;e&&W?.arm(),t&&q?.arm(),n&&Z?.arm()},[A,W,q,Z]);let ae=v(()=>L?{resolved:V!==void 0}:null,[L,V]),oe=v(()=>j?{onClick:j.onClick,...j.label===void 0?{}:{label:j.label}}:null,[j?.onClick,j?.label]),Q=V??H,$=u({gatewayKey:x,environment:S??`production`,assetChain:z,assetSymbol:B,...Q?{userAddress:Q}:{},...W?{depositDriver:W}:{}});return l(c(k?{url:k.url,onSelect:k.onOpen}:void 0).kind===`default`?$:null),b(e,{value:v(()=>({bus:ee(),flowIds:te(),metadata:o()}),[]),children:b(f,{value:oe,children:b(p,{value:ae,children:b(s,{theme:T?.theme,accent:T?.accent,radius:T?.radius,direction:T?.direction,attribution:T?.attribution,i18n:E,storage:D?.driver,storageNamespace:D?.namespace,className:re,support:k,merchantContext:$,terms:ne,...K?{deposit:K}:{},...L?.methods?{depositMethods:L.methods}:{},...Y?{withdraw:Y}:{},...Z?{activity:Z}:{},children:ie})})})})}export{x 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{createStridgeCatalog as n}from"../drivers/stridge/catalog.js";import{createStridgeActivityDriver as r}from"../drivers/stridge/createStridgeActivityDriver.js";import{createStridgeDepositDriver as i}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as a}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{createBus as ee}from"../events/bus/createBus.js";import{createFlowIdRegistry as te}from"../events/bus/flowIdRegistry.js";import{createMetadataStore as o}from"../events/bus/metadata.js";import"../events/bus/index.js";import{KitProvider as s}from"../KitProvider.js";import{resolveMerchantLink as c}from"../shared/merchant-link/resolveMerchantLink.js";import"../shared/merchant-link/index.js";import{useIntercomMerchantContext as l}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as u}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useDeepMemo as d}from"../shared/utils/useDeepMemo.js";import{ConnectWalletContext as f}from"../shared/wallet/ConnectWalletContext.js";import{DepositOwnerContext as p}from"./depositOwner.js";import{useOptionalWagmi as m}from"./optionalWagmi.js";import{createStubDepositDriver as h,createStubWithdrawDriver as g}from"./stubs.js";import{useEffect as _,useMemo as v,useRef as y}from"react";import{jsx as b}from"react/jsx-runtime";function x({gatewayKey:x,environment:S,asset:C,flows:w,appearance:T,i18n:E,storage:D,dev:O,support:k,terms:ne,prefetch:A,connectWallet:j,className:re,children:ie}){if(!w.deposit&&!w.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!C)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:M,address:N}=m(),P=v(()=>t(E??{}),[E?.locale,E?.messages]),F=y(P);F.current=P;let I=d(C),L=d(w.deposit),R=d(w.withdraw),z=I.networkId,B=I.symbol,V=L?.owner?.address??N??O?.userAddressOverride,H=R?.owner.address,U=v(()=>n({projectKey:x,...S?{environment:S}:{}}),[x,S]),W=v(()=>{if(!(!L||!V))return i({userAddress:V,projectKey:x,destination:{network_id:z,asset_symbol:B,to_address:L.destination.address},wagmiConfig:M,catalog:U,getI18n:()=>F.current,...S?{environment:S}:{},...L.minAmountUsd===void 0?{}:{minAmountUsd:L.minAmountUsd},...L.maxAmountUsd===void 0?{}:{maxAmountUsd:L.maxAmountUsd},...L.metadata?{metadata:L.metadata}:{}})},[L,V,x,S,z,B,M,U]),G=v(()=>h(),[]),K=L?W??G:void 0,q=v(()=>{if(!(!R||!H))return a({userAddress:H,projectKey:x,currency:{networkId:z,assetSymbol:B},wagmiConfig:M,catalog:U,getI18n:()=>F.current,...S?{environment:S}:{},...R.minAmountUsd===void 0?{}:{minAmountUsd:R.minAmountUsd},...R.maxAmountUsd===void 0?{}:{maxAmountUsd:R.maxAmountUsd},...R.metadata?{metadata:R.metadata}:{}})},[R,H,x,S,z,B,M,U]),J=v(()=>g(),[]),Y=R?q??J:void 0,X=(L?V:void 0)??(R?H:void 0),Z=v(()=>{if(X)return r({userAddress:X,projectKey:x,catalog:U,...S?{environment:S}:{}})},[X,x,S,U]);_(()=>{if(!A)return;let e=A===!0||A.includes(`deposit`),t=A===!0||A.includes(`withdraw`),n=A===!0||A.includes(`activity`)||e||t;e&&W?.arm(),t&&q?.arm(),n&&Z?.arm()},[A,W,q,Z]);let ae=v(()=>L?{resolved:V!==void 0}:null,[L,V]),oe=v(()=>j?{onClick:j.onClick,...j.label===void 0?{}:{label:j.label}}:null,[j?.onClick,j?.label]),Q=V??H,$=u({gatewayKey:x,environment:S??`production`,assetChain:z,assetSymbol:B,...Q?{userAddress:Q}:{},...W?{depositDriver:W}:{}});return l(c(k?{url:k.url,onSelect:k.onOpen}:void 0).kind===`default`?$:null),b(e,{value:v(()=>({bus:ee(),flowIds:te(),metadata:o()}),[]),children:b(f,{value:oe,children:b(p,{value:ae,children:b(s,{theme:T?.theme,accent:T?.accent,radius:T?.radius,direction:T?.direction,attribution:T?.attribution,presentation:T?.presentation,i18n:E,storage:D?.driver,storageNamespace:D?.namespace,className:re,support:k,merchantContext:$,terms:ne,...K?{deposit:K}:{},...L?.methods?{depositMethods:L.methods}:{},...Y?{withdraw:Y}:{},...Z?{activity:Z}:{},children:ie})})})})}export{x as StridgeProvider};
@@ -66,6 +66,7 @@
66
66
  --stridge-kit-z-tooltip: 1070;
67
67
  --stridge-kit-overlay: oklch(0% 0 0 / .4);
68
68
  --stridge-kit-dialog-width: 480px;
69
+ --stridge-kit-drawer-max-inline-size: var(--stridge-kit-dialog-width);
69
70
  --stridge-kit-drawer-max-block-size: calc(100% - 2rem);
70
71
  --stridge-kit-drawer-handle-size: 36px;
71
72
  --stridge-kit-drawer-handle-thickness: 4px;
@@ -274,6 +275,16 @@
274
275
  --stridge-kit-shadow-xl: 0 24px 56px -12px oklch(0% 0 0 / .1), 0 8px 16px -4px oklch(0% 0 0 / .06);
275
276
  }
276
277
 
278
+ [data-stridge-scope] {
279
+ -webkit-user-select: none;
280
+ user-select: none;
281
+ }
282
+
283
+ [data-stridge-scope] :is(input, textarea, [contenteditable="true"]) {
284
+ -webkit-user-select: text;
285
+ user-select: text;
286
+ }
287
+
277
288
  @stylex;
278
289
 
279
290
  @layer priority1;
@@ -2942,6 +2953,10 @@
2942
2953
  max-width: min(var(--stridge-kit-dialog-width),calc(100% - 2rem));
2943
2954
  }
2944
2955
 
2956
+ .x1qvtwti {
2957
+ max-width: var(--stridge-kit-drawer-max-inline-size);
2958
+ }
2959
+
2945
2960
  .x2lwn1j {
2946
2961
  min-height: 0;
2947
2962
  }
@@ -1,4 +1,5 @@
1
+ import { Presentation, PresentationConfig, PresentationMode } from "../../shared/presentation/types.js";
1
2
  import { WithdrawSubmitActions, WithdrawSubmitCallback, WithdrawSubmitInput } from "../../flows/withdraw/orchestrator/types.js";
2
3
  import { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient } from "../../flows/withdraw/bindings/WithdrawBindings.js";
3
4
  import { WithdrawDialog } from "../../flows/withdraw/dialog/WithdrawDialog.js";
4
- export { type WithdrawBalanceInput, type WithdrawBindings, WithdrawDialog, type WithdrawSubmitActions, type WithdrawSubmitCallback, type WithdrawSubmitInput, type WithdrawSuggestedRecipient };
5
+ export { type Presentation, type PresentationConfig, type PresentationMode, type WithdrawBalanceInput, type WithdrawBindings, WithdrawDialog, type WithdrawSubmitActions, type WithdrawSubmitCallback, type WithdrawSubmitInput, type WithdrawSuggestedRecipient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stridge/kit",
3
- "version": "0.1.0-alpha.53",
3
+ "version": "0.1.0-alpha.54",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [