- Name
open- Kind
- property
- Type
boolean- Requirement
- required
DocsAPI referenceUI machinessheet
sheet machine
The public state machine contract for @grassroot/ui-machines/sheet. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/sheet
Package
Service example
sheet.tsts
import { createService } from "@grassroot/statechart";import { sheetMachine } from "@grassroot/ui-machines/sheet"; const service = createService(sheetMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();15 of 15
Exports
SheetChangeReason
typeSheetChangeReasonts
type SheetChangeReason = SheetOpenReason | SheetCloseReason;SheetCloseReason
typeSheetCloseReasonts
type SheetCloseReason = "escape" | "outside-click" | "close-trigger" | "programmatic";SheetCommand
typeSheetCommandts
type SheetCommand = CommandObject & { readonly type: "OPEN_CHANGE_REQUEST"; readonly open: boolean; readonly reason: SheetChangeReason;};Name
Kind
Type
Requirement
openproperty
booleanrequired
reasonproperty
SheetChangeReasonrequired
typeproperty
stringrequired
- Name
reason- Kind
- property
- Type
SheetChangeReason- Requirement
- required
- Name
type- Kind
- property
- Type
string- Requirement
- required
SheetContext
typeSheetContextts
type SheetContext = { readonly mode: "controlled" | "uncontrolled";};Name
Kind
Type
Requirement
modeproperty
"controlled" | "uncontrolled"required
- Name
mode- Kind
- property
- Type
"controlled" | "uncontrolled"- Requirement
- required
SheetDiagnosticCodes
valueSheetDiagnosticCodests
export declare const SheetDiagnosticCodes: readonly DiagnosticCatalogueEntry[];SheetEvent
typeSheetEventts
type SheetEvent = { readonly type: "OPEN"; readonly reason: SheetOpenReason;} | { readonly type: "CLOSE"; readonly reason: SheetCloseReason;};SheetInput
typeSheetInputts
type SheetInput = { readonly open?: boolean; readonly defaultOpen?: boolean; readonly dismissable?: boolean; readonly side?: SheetSide;};Name
Kind
Type
Requirement
defaultOpenproperty
booleanoptional
dismissableproperty
booleanoptional
openproperty
booleanoptional
sideproperty
SheetSideoptional
- Name
defaultOpen- Kind
- property
- Type
boolean- Requirement
- optional
- Name
dismissable- Kind
- property
- Type
boolean- Requirement
- optional
- Name
open- Kind
- property
- Type
boolean- Requirement
- optional
- Name
side- Kind
- property
- Type
SheetSide- Requirement
- optional
sheetMachine
valuesheetMachinets
export declare const sheetMachine: SheetMachine;SheetMachine
typeSheetMachinets
type SheetMachine = Machine<SheetInput, SheetStateValue, SheetContext, SheetEvent, SheetCommand>;SheetOpenReason
typeSheetOpenReasonts
type SheetOpenReason = "trigger" | "programmatic";sheetReplaySequence
valuesheetReplaySequencets
export declare const sheetReplaySequence: readonly SheetEvent[];sheetSelectors
valuesheetSelectorsts
export declare const sheetSelectors: { open: (snapshot: SheetSnapshot) => boolean;};Name
Kind
Type
Requirement
openproperty
(snapshot: SheetSnapshot) => booleanrequired
- Name
open- Kind
- property
- Type
(snapshot: SheetSnapshot) => boolean- Requirement
- required
SheetSide
typeSheetSidets
type SheetSide = "left" | "right" | "bottom" | "top";SheetSnapshot
typeSheetSnapshotts
type SheetSnapshot = Snapshot<SheetStateValue, SheetContext>;SheetStateValue
typeSheetStateValuets
type SheetStateValue = "open" | "closed";