- Name
open- Kind
- property
- Type
boolean- Requirement
- required
DocsAPI referenceUI machinesalert-dialog
alert-dialog machine
The public state machine contract for @grassroot/ui-machines/alert-dialog. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/alert-dialog
Package
Service example
alert-dialog.tsts
import { createService } from "@grassroot/statechart";import { alertDialogMachine } from "@grassroot/ui-machines/alert-dialog"; const service = createService(alertDialogMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();14 of 14
Exports
AlertDialogChangeReasonts
type AlertDialogChangeReason = AlertDialogOpenReason | AlertDialogCloseReason;AlertDialogCloseReasonts
type AlertDialogCloseReason = "escape" | "outside-click" | "close-trigger" | "programmatic";AlertDialogCommand
typeAlertDialogCommandts
type AlertDialogCommand = CommandObject & { readonly type: "OPEN_CHANGE_REQUEST"; readonly open: boolean; readonly reason: AlertDialogChangeReason;};Name
Kind
Type
Requirement
openproperty
booleanrequired
reasonproperty
AlertDialogChangeReasonrequired
typeproperty
stringrequired
- Name
reason- Kind
- property
- Type
AlertDialogChangeReason- Requirement
- required
- Name
type- Kind
- property
- Type
string- Requirement
- required
AlertDialogContext
typeAlertDialogContextts
type AlertDialogContext = { readonly mode: "controlled" | "uncontrolled";};Name
Kind
Type
Requirement
modeproperty
"controlled" | "uncontrolled"required
- Name
mode- Kind
- property
- Type
"controlled" | "uncontrolled"- Requirement
- required
AlertDialogDiagnosticCodests
export declare const AlertDialogDiagnosticCodes: readonly DiagnosticCatalogueEntry[];AlertDialogEvent
typeAlertDialogEventts
type AlertDialogEvent = { readonly type: "OPEN"; readonly reason: AlertDialogOpenReason;} | { readonly type: "CLOSE"; readonly reason: AlertDialogCloseReason;};AlertDialogInput
typeAlertDialogInputts
type AlertDialogInput = { readonly open?: boolean; readonly defaultOpen?: boolean; readonly dismissable?: boolean;};Name
Kind
Type
Requirement
defaultOpenproperty
booleanoptional
dismissableproperty
booleanoptional
openproperty
booleanoptional
- Name
defaultOpen- Kind
- property
- Type
boolean- Requirement
- optional
- Name
dismissable- Kind
- property
- Type
boolean- Requirement
- optional
- Name
open- Kind
- property
- Type
boolean- Requirement
- optional
alertDialogMachine
valuealertDialogMachinets
export declare const alertDialogMachine: AlertDialogMachine;AlertDialogMachine
typeAlertDialogMachinets
type AlertDialogMachine = Machine<AlertDialogInput, AlertDialogStateValue, AlertDialogContext, AlertDialogEvent, AlertDialogCommand>;AlertDialogOpenReasonts
type AlertDialogOpenReason = "trigger" | "programmatic";alertDialogReplaySequencets
export declare const alertDialogReplaySequence: readonly AlertDialogEvent[];alertDialogSelectors
valuealertDialogSelectorsts
export declare const alertDialogSelectors: { open: (snapshot: AlertDialogSnapshot) => boolean;};Name
Kind
Type
Requirement
openproperty
(snapshot: AlertDialogSnapshot) => booleanrequired
- Name
open- Kind
- property
- Type
(snapshot: AlertDialogSnapshot) => boolean- Requirement
- required
AlertDialogSnapshot
typeAlertDialogSnapshotts
type AlertDialogSnapshot = Snapshot<AlertDialogStateValue, AlertDialogContext>;AlertDialogStateValuets
type AlertDialogStateValue = "open" | "closed";