shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Packages
Search packages... ⌘K
  • Data & Persistence
    • Databases 3
    • Object Storage 1
    • File Formats 2
    • Enumerations 2
    • Content 1
    • Codegen 2
  • System Integration
    • Secrets 1
    • CLI Tools 5
    • Media Processing 2
    • Adapters 2
  • UI & Components
    • Primitives 1
    • Blocks 1
    • Sections & Layouts 1
    • Entities 1
    • Media 1
    • Utilities 1
    • State & Presenter 1
    • Branding & Style 1
  • Game Engine
    • Framework 1
    • Engine 2
    • Presets 1
    • Vendor 1
Packages/ UI & Components/ State & Presenter/ Core Ui State
SvelteKit Package

core-ui-state

State management & presenter — StateMachine, Flow, presenter registry, view adapters

SvelteKit Ready MD
State Machine typescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { StateMachine, Flow } from '@sbx/core-ui/state';

// Typed state machine
const auth = new StateMachine({
  initial: 'idle',
  states: {
    idle:    { LOGIN: 'authenticating' },
    authenticating: { SUCCESS: 'authenticated', FAILURE: 'idle' },
    authenticated:  { LOGOUT: 'idle' },
  }
});

auth.send('LOGIN');  // → 'authenticating'

// Async flow
const fetchFlow = new Flow<User[]>();
fetchFlow.loading();
const users = await api.getUsers();
fetchFlow.success(users);  // or fetchFlow.error(err)

About

Application state and presentation infrastructure. StateMachine provides finite-state-machine with typed transitions. Flow manages async operation lifecycle (idle → loading → success/error). The presenter layer includes a component registry for dynamic rendering, fixture loading for storybook-style previews, and view adapters for transforming API data into component props.

Public API

NameKindSignature
StateMachinetypeclass StateMachine<S, E> — states, transitions, current, send(event)
Flowtypeclass Flow<T> — idle, loading, success(data), error(err)
componentRegistryfunccomponentRegistry: Map<string, ComponentRepresentation>
PresenterFixturestypeclass PresenterFixtures — load(name), list(), register(fixture)
FixtureLoadertypeclass FixtureLoader — loadAll(glob), loadOne(path)
ActivityRegistrytypeclass ActivityRegistry — register(type, handler), dispatch(activity)
MotionTokenstypeMotionTokens — duration, easing, stagger constants

Dependencies

Imported By (2)

core-ui-blocks SvelteKit Ready

Composite UI blocks — NavRail, CommandPalette, ChatWidget, FileTree, Editors

svelte-5componentsnavigationeditorsdata-displaypresenter-driven
15 exports 2 deps
core-ui-sections SvelteKit Ready

Page sections & layouts — AdminTemplate, ContentSidebar, EntityDetail, Canvas

svelte-5layoutsidebarentity-vieweradmin-templatecanvas
16 exports 2 deps

Related Packages

core-ui-branding SvelteKit Ready

Branding & style system — brand config, CSS custom properties, contrast validation

design-systembrandingcss-custom-propertiesthemingwcagcontraststyle-presets
6 exports 3 deps
core-ui-blocks SvelteKit Ready

Composite UI blocks — NavRail, CommandPalette, ChatWidget, FileTree, Editors

svelte-5componentsnavigationeditorsdata-displaypresenter-driven
15 exports 2 deps

Source

@sbx/core-ui/state
state-machinepresenterfixturesview-layermotion-tokensasync-flow
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |