Skip to main content

std-input

Level: Atom | Entity: TextInput | Persistence: runtime

3 states, 5 events, 8 transitions

Live Preview

orbital TextInputOrbital {
entity TextInput [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
value : string
inputStatus : string
}
trait TextInputInput -> TextInput [interaction] {
initial: idle
state idle {
INIT -> idle
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Type to enter a value.", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "typography", variant: "caption", color: "muted", content: ["object/get", ["array/first", "@entity"], "value"] }] })
FOCUS -> focused
(set @entity.inputStatus focused)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Type to enter a value.", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "typography", variant: "caption", color: "muted", content: ["object/get", ["array/first", "@entity"], "value"] }] })
}
state focused {
CHANGE -> focused
(set @entity.value @payload.value)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Type to enter a value.", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "typography", variant: "caption", color: "muted", content: ["object/get", ["array/first", "@entity"], "value"] }] })
BLUR -> idle
(set @entity.inputStatus idle)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Type to enter a value.", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "typography", variant: "caption", color: "muted", content: ["object/get", ["array/first", "@entity"], "value"] }] })
VALIDATE -> validating
(set @entity.inputStatus validating)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Validating...", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "alert", variant: "info", message: "Validating input..." }] })
INIT -> focused
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Type to enter a value.", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "typography", variant: "caption", color: "muted", content: ["object/get", ["array/first", "@entity"], "value"] }] })
}
state validating {
BLUR -> idle
(set @entity.inputStatus idle)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Type to enter a value.", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "typography", variant: "caption", color: "muted", content: ["object/get", ["array/first", "@entity"], "value"] }] })
INIT -> validating
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "text-cursor-input", size: "lg" }, { type: "typography", content: "TextInput", variant: "h2" }] }, { type: "divider" }, { type: "form-field", label: "TextInput", hint: "Validating...", children: [{ type: "input", placeholder: "Enter textinput...", event: "CHANGE" }] }, { type: "alert", variant: "info", message: "Validating input..." }] })
}
}
page "/textinputs/input" -> TextInputInput
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

FieldTypeDefault
idstring-
namestring-
descriptionstring-
statusstring"active"
createdAtstring-
valuestring""
inputStatusstring"idle"

States

StateType
idleInitial
focused-
validating-

Events

EventPayload
INIT-
FOCUS-
BLUR-
CHANGEvalue: string
VALIDATE-

Transitions

FromEventToEffects
idleINITidle1 effect
idleFOCUSfocused2 effects
focusedCHANGEfocused2 effects
focusedBLURidle2 effects
focusedVALIDATEvalidating2 effects
validatingBLURidle2 effects
focusedINITfocused1 effect
validatingINITvalidating1 effect