- Name
service- Kind
- parameter
- Type
DialogService- Requirement
- required
DocsAPI referenceHeadlessdialog-connect
dialog-connect headless API
The core connector and vanilla mount are always visible. Use the framework choice to inspect native composition, props, outputs, context and hooks for the selected adapter.
@grassroot/ui-headless-core/dialog-connect
Core connector and vanilla API
activateDialogManagers
functionManager lifecycle helper (spec's "Managers" section) — pushes a modal layer (which holds its own ref-counted `lockScroll` handle for its lifetime per the amendment) whose `onDismiss` forwards straight to `service.send({ type: "CLOSE", reason })` (dismissal never forks state — the machine's own `dismissable` guard decides whether it becomes a transition), with `getElements` covering the mounted Content *and* Trigger (so a trigger click while open is never treated as an outside click), and installs `trapFocus` on the mounted Content. Callers (adapters/`mountDialog`) invoke this once the overlay commits open, and call the returned `release()` on close-commit or unmount. Requires Content (and ideally Trigger) to already be registered in `scope` — this is a mount-time-only manager wire-up, never called at SSR or before the overlay's DOM exists (mirrors the shared layer's "pushing while unmounted is a development error" stance for its `document` argument).
declare function activateDialogManagers(service: DialogService, scope: PartScope, doc: Document): () => void;serviceDialogServicescopePartScopedocDocumentreturn() => void- Name
scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
doc- Kind
- parameter
- Type
Document- Requirement
- required
- Name
return- Kind
- return value
- Type
() => void- Requirement
- n/a
connectDialog
functiondeclare function connectDialog(service: DialogService, scope: PartScope, _options?: DialogConnectOptions): DialogApi;serviceDialogServicescopePartScope_optionsDialogConnectOptionsreturnDialogApi- Name
service- Kind
- parameter
- Type
DialogService- Requirement
- required
- Name
scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
_options- Kind
- parameter
- Type
DialogConnectOptions- Requirement
- optional
- Name
return- Kind
- return value
- Type
DialogApi- Requirement
- n/a
DialogApi
interfaceinterface DialogApi { triggerProps(): PartProps; backdropProps(): PartProps; positionerProps(): PartProps; contentProps(): PartProps; titleProps(): PartProps; descriptionProps(): PartProps; closeTriggerProps(): PartProps; readonly open: boolean;}backdropProps() => PartPropscloseTriggerProps() => PartPropscontentProps() => PartPropsdescriptionProps() => PartPropsopenbooleanpositionerProps() => PartPropstitleProps() => PartPropstriggerProps() => PartProps- Name
backdropProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
closeTriggerProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
contentProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
descriptionProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
open- Kind
- property
- Type
boolean- Requirement
- required
- Name
positionerProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
titleProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
triggerProps- Kind
- method
- Type
() => PartProps- Requirement
- required
DialogConnectOptions
interfaceinterface DialogConnectOptions {}DialogService
typetype DialogService = Service<DialogInput, DialogStateValue, DialogContext, DialogEvent, DialogCommand>;runDialogCommand
functionDialog-shaped command runner — mirrors `runTooltipCommand`. Pass this as the `runCommand` option when constructing the Dialog `Service` (never called by `connectDialog` itself). Resolves `OPEN_CHANGE_REQUEST` against an optional `onOpenChange` callback.
declare function runDialogCommand(command: DialogCommand, _scope: PartScope, options?: { readonly onOpenChange?: (detail: { open: boolean; reason: DialogChangeReason; }) => void;}): void;commandDialogCommand_scopePartScopeoptions{
readonly onOpenChange?: (detail: {
open: boolean;
reason: DialogChangeReason;
}) => void;
}returnvoid- Name
command- Kind
- parameter
- Type
DialogCommand- Requirement
- required
- Name
_scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
options- Kind
- parameter
- Type
{ readonly onOpenChange?: (detail: { open: boolean; reason: DialogChangeReason; }) => void; }- Requirement
- optional
- Name
return- Kind
- return value
- Type
void- Requirement
- n/a
Framework adapters
Each panel keeps its adapter's public vocabulary. React compound exports, Vue composables, standalone Angular declarations, Svelte components, and Solid hooks stay native to their framework.
This entry is core-only. No framework adapter package ships for dialog-connect yet — mount it through the vanilla API above.