Skip to content

ui

ui

Import from @norbital-ai/ui

@norbital-ai/ui: the views, the field kinds and inputs, Form/Field, and the primitives. Layout is ./layout. The views take the page's ctx as a prop; the shell provides the representation registry once per page. A model-backed view is exported typed by what its naked prop names (Workspace in ./model/types.ts): the component is Svelte's generic-component shape over its own name-erased implementation. Live model rows grouped into state, enum or relation lanes; dragging a card updates its lane field under the viewer's grants.

primitives

Accordion namespace

namespace Accordion

Collapsible sections: Accordion.Root holds Accordion.Items, each a Trigger and its Content.

Source: packages/ui/src/primitives/accordion/index.ts:1

behaviors

AccordionBehavior type

type Accordion = ReturnType<typeof create_accordion>;

Return value of create_accordion.

Members

NameTypeDescription
openreadonly string[]
is_open(key: string) => boolean
toggle(key: string) => void
expand(key: string) => void
collapse(key: string) => void
item(key: string) => import("svelte/attachments").Attachment<HTMLElement>
root_attrs() => { onkeydown: (event: KeyboardEvent) => void; }
trigger_attrs(key: string) => { type: "button"; id: string; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }
content_attrs(key: string) => { id: string; role: "region"; "aria-labelledby": string; hidden: boolean; "data-state": "open" | "closed"; }

Source: packages/ui/src/behaviors/accordion.svelte.ts:1

AccordionMode type

type AccordionMode = 'single' | 'multiple';

Single or multiple expanded sections mode for create_accordion.

Source: packages/ui/src/behaviors/accordion.svelte.ts:9

AccordionOptions type

type AccordionOptions = {
    /** Item keys in visual order. */
    items: () => readonly string[];
    /** Single or multiple expanded sections (default `'single'`). */
    mode?: AccordionMode;
    /** In single mode, allow collapsing the only open item (default `true`). */
    collapsible?: boolean;
    /** Controlled open keys; omit for internal state. */
    open?: () => readonly string[];
    /** Initial open keys when uncontrolled. */
    default_open?: readonly string[];
    /** Called whenever expanded keys change. */
    on_change?: (open: readonly string[]) => void;
    /** Disabled predicate per item key. */
    disabled?: (key: string) => boolean;
    /** Optional semantic control id/label for Norbius's `page` bridge. */
    control?: {
        id: string;
        label?: string;
    };
};

Options for create_accordion.

Members

NameTypeDescription
items() => readonly string[]

Item keys in visual order.

mode?AccordionMode

Single or multiple expanded sections (default 'single').

collapsible?boolean

In single mode, allow collapsing the only open item (default true).

open?() => readonly string[]

Controlled open keys; omit for internal state.

default_open?readonly string[]

Initial open keys when uncontrolled.

on_change?(open: readonly string[]) => void

Called whenever expanded keys change.

disabled?(key: string) => boolean

Disabled predicate per item key.

control?{ id: string; label?: string; }

Optional semantic control id/label for Norbius's page bridge.

Source: packages/ui/src/behaviors/accordion.svelte.ts:12

primitives

Alert namespace

namespace Alert

A message box in a tone (variant) and size: Alert.Root with Alert.Title and Alert.Description.

Source: packages/ui/src/primitives/alert/index.ts:1

behaviors

AnnounceOptions type

type AnnounceOptions = {
    /** Announcement urgency (default `'polite'`). */
    readonly priority?: AnnouncePriority;
    /** Target document (defaults to global `document`). */
    readonly doc?: Document;
};

Options for announce.

Members

NameTypeDescription
priority?AnnouncePriority

Announcement urgency (default 'polite').

doc?Document

Target document (defaults to global document).

Source: packages/ui/src/behaviors/announce.svelte.ts:9

AnnouncePriority type

type AnnouncePriority = 'polite' | 'assertive';

Urgency of a screen-reader announcement ('polite' waits for idle, 'assertive' interrupts).

Source: packages/ui/src/behaviors/announce.svelte.ts:6

approval

ApprovalAccent component

component ApprovalAccent(props: $$ComponentProps)

The right-hand accent a list row or card carries while an open approval request holds its record ($approval), with a one-line tooltip: who asked, where it stands, whom it waits on. Its container is relative.

Props

NameTypeDescription
ctxUiContext

The page context the tooltip's words come from.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
rowunknown

The row or card as read, its $approval included.

Source: packages/ui/src/approval/ApprovalAccent.svelte:1

ApprovalPanel component

component ApprovalPanel(props: ApprovalPanelProps)

A record's approval requests: a scope selector when there are several, the chosen request's timeline (one node for the request, one per step; each node a button whose popover holds that step's back-and-forth), its history as the shared compact timeline (the last entry says where it stands and why), and, for whoever may decide now, a two-step form: pick Approve, Reject, Request changes or (the requester) Withdraw, then give the reason and confirm.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
requestsreadonly ApprovalView[]

The record's requests; the open one is shown first, else the latest.

on_outcome?(outcome: Outcome) => void

Each decision's outcome once it settles (the panel also shows it).

Source: packages/ui/src/approval/ApprovalPanel.svelte:1

client

ApprovalView type

type ApprovalView = {
    id: string;
    model: string;
    record: string;
    action: string;
    /** The record's label as its request or resubmission left it (a record its rollback removed keeps a name), or null. */
    label: string | null;
    at: string;
    /** Pending, ChangesRequested, Approved, Rejected, Superseded or Withdrawn. */
    status: string;
    /** The current step (from 0). */
    step: number;
    steps: readonly ApprovalStep[];
    superseded_by: readonly string[];
    /** Current names of the steps' team and user ids; the captured ids and native eligibility remain authoritative. */
    team_names: Readonly<Record<string, string>>;
    user_names: Readonly<Record<string, string>>;
    requestor: ApprovalWho;
    /** Every move, oldest first, each on the step it was taken at, with what a rollback did. */
    log: readonly {
        move: 'request' | 'approve' | 'reject' | 'request_changes' | 'resubmit' | 'supersede' | 'withdraw';
        by: ApprovalWho;
        at: string;
        from: string | null;
        to: string;
        step: number;
        reason: string | null;
        /** A resubmission's changed fields. */
        changed?: readonly string[] | undefined;
        rolled_back?: readonly {
            model: string;
            id: string;
            action: 'restored' | 'removed' | 'recreated';
        }[] | undefined;
        skipped?: readonly {
            model: string;
            id: string;
            field: string;
            …

One approval request as its participants and authorized record readers see it; the host decides every move.

Members

NameTypeDescription
idstring
modelstring
recordstring
actionstring
labelstring | null

The record's label as its request or resubmission left it (a record its rollback removed keeps a name), or null.

atstring
statusstring

Pending, ChangesRequested, Approved, Rejected, Superseded or Withdrawn.

stepnumber

The current step (from 0).

stepsreadonly ApprovalStep[]
superseded_byreadonly string[]
team_namesReadonly<Record<string, string>>

Current names of the steps' team and user ids; the captured ids and native eligibility remain authoritative.

user_namesReadonly<Record<string, string>>
requestorApprovalWho
logreadonly { move: 'request' | 'approve' | 'reject' | 'request_changes' | 'resubmit' | 'supersede' | 'withdraw'; by: ApprovalWho; at: string; from: string | null; to: string; step: number; reason: string | null; /** A resubmission's changed fields. */ changed?: readonly string[] | undefined; rolled_back?: readonly { model: string; id: string; action: 'restored' | 'removed' | 'recreated'; }[] | unde…

Every move, oldest first, each on the step it was taken at, with what a rollback did.

recordsreadonly { model: string; id: string; op: 'create' | 'update' | 'delete'; }[]

The records the provisional change holds: committed already, rolled back on rejection or withdrawal.

movesreadonly { decision: ApprovalDecision; reason: 'required' | 'optional'; }[]

The decisions this viewer may take now, straight from the host's transition table.

mineboolean
participantboolean
stalledboolean

Pending, and no active member but the requester may decide its current step.

Source: packages/ui/src/client/contract.ts:144

behaviors

AreaBehavior type

type AreaBehavior = ReturnType<typeof create_area>;

Return value of create_area.

Members

NameTypeDescription
valueAreaValue
percent_xnumber
percent_ynumber
draggingboolean
set(next: AreaValue, commitNow?: boolean) => void
surfaceAttachment<HTMLElement>
thumb_attrs() => { role: "slider"; tabindex: number; "aria-label": string | undefined; "aria-valuetext": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/canvas.svelte.ts:131

AreaOptions type

type AreaOptions = {
    readonly value?: () => AreaValue;
    readonly default_value?: AreaValue;
    readonly on_change?: (value: AreaValue) => void;
    readonly on_commit?: (value: AreaValue) => void;
    readonly min_x?: number;
    readonly max_x?: number;
    readonly min_y?: number;
    readonly max_y?: number;
    readonly step_x?: number;
    readonly step_y?: number;
    readonly label?: string;
};

Options for create_area.

Members

NameTypeDescription
value?() => AreaValue
default_value?AreaValue
on_change?(value: AreaValue) => void
on_commit?(value: AreaValue) => void
min_x?number
max_x?number
min_y?number
max_y?number
step_x?number
step_y?number
label?string

Source: packages/ui/src/behaviors/canvas.svelte.ts:116

AreaValue type

type AreaValue = {
    readonly x: number;
    readonly y: number;
};

2D slider coordinates { x, y }.

Members

NameTypeDescription
xnumber
ynumber

Source: packages/ui/src/behaviors/canvas.svelte.ts:113

AriaPattern type

type AriaPattern = 'dialog' | 'menu' | 'menubar' | 'listbox' | 'combobox' | 'tabs' | 'accordion' | 'tree' | 'grid' | 'radiogroup' | 'toolbar' | 'switch' | 'slider' | 'carousel';

Supported WAI-ARIA Authoring Practices Guide widget patterns verified by check_pattern.

Source: packages/ui/src/behaviors/testing.ts:4

AsyncOptions type

type AsyncOptions<T> = ReturnType<typeof create_async_options<T>>;

Return value of create_async_options.

Members

NameTypeDescription
querystring
itemsreadonly T[]
statusAsyncOptionsStatus
loadingboolean
errorunknown
has_moreboolean
set_query(next: string, opts?: { immediate?: boolean; }) => void
load_more() => void
reload() => void
reset() => void
cancel() => void

Source: packages/ui/src/behaviors/async-options.svelte.ts:38

AsyncOptionsContext type

type AsyncOptionsContext = {
    /** Aborted automatically when a newer query or reset supersedes this request. */
    readonly signal: AbortSignal;
    /** Zero-based page index (`0` for fresh query, incremented by `load_more()`). */
    readonly page: number;
};

Context passed to AsyncOptionsOptions.load.

Members

NameTypeDescription
signalAbortSignal

Aborted automatically when a newer query or reset supersedes this request.

pagenumber

Zero-based page index (0 for fresh query, incremented by load_more()).

Source: packages/ui/src/behaviors/async-options.svelte.ts:18

AsyncOptionsOptions type

type AsyncOptionsOptions<T> = {
    /** Fetches matching items for `query` and `ctx.page`, honoring `ctx.signal`. */
    readonly load: (query: string, ctx: AsyncOptionsContext) => Promise<AsyncOptionsPage<T>>;
    /** Initial query (default `''`). */
    readonly initial_query?: string;
    /** Typing debounce window in ms (default `200`). */
    readonly debounce_ms?: number;
    /** Fetch immediately for `initial_query` on mount (default `false`). */
    readonly immediate?: boolean;
};

Options for create_async_options.

Members

NameTypeDescription
load(query: string, ctx: AsyncOptionsContext) => Promise<AsyncOptionsPage<T>>

Fetches matching items for query and ctx.page, honoring ctx.signal.

initial_query?string

Initial query (default '').

debounce_ms?number

Typing debounce window in ms (default 200).

immediate?boolean

Fetch immediately for initial_query on mount (default false).

Source: packages/ui/src/behaviors/async-options.svelte.ts:26

AsyncOptionsPage type

type AsyncOptionsPage<T> = readonly T[] | {
    readonly items: readonly T[];
    readonly has_more?: boolean;
};

Page payload returned by AsyncOptionsOptions.load.

Source: packages/ui/src/behaviors/async-options.svelte.ts:10

AsyncOptionsStatus type

type AsyncOptionsStatus = 'idle' | 'loading' | 'error';

Load lifecycle state of create_async_options.

Source: packages/ui/src/behaviors/async-options.svelte.ts:7

AutoScroll type

type AutoScroll = ReturnType<typeof create_auto_scroll>;

Return value of create_auto_scroll.

Members

NameTypeDescription
update(x: number, y: number) => void
stop() => void

Source: packages/ui/src/behaviors/drag.svelte.ts:164

AutoScrollOptions type

type AutoScrollOptions = {
    /** Edge proximity threshold in px where scrolling begins (default `48`). */
    readonly edge?: number;
    /** Maximum scroll speed in px/frame at the edge (default `18`). */
    readonly speed?: number;
    /** Called after each scrolled frame so drag hit-testing updates under a stationary pointer. */
    readonly on_scroll?: () => void;
    /** Optional element to ignore when hit-testing scrollers underneath the pointer. */
    readonly ignore?: () => Element | null | undefined;
};

Options for create_auto_scroll.

Members

NameTypeDescription
edge?number

Edge proximity threshold in px where scrolling begins (default 48).

speed?number

Maximum scroll speed in px/frame at the edge (default 18).

on_scroll?() => void

Called after each scrolled frame so drag hit-testing updates under a stationary pointer.

ignore?() => Element | null | undefined

Optional element to ignore when hit-testing scrollers underneath the pointer.

Source: packages/ui/src/behaviors/drag.svelte.ts:152

kinds

AutomationExposure type

type AutomationExposure = {
    input: Fields;
    description?: string;
    mode?: 'job' | 'call';
};

A declared automation the caller may start, with the fields its native form renders.

Members

NameTypeDescription
inputFields
description?string
mode?'job' | 'call'

Source: packages/ui/src/kinds/context.ts:79

model

AutomationInputOf type

type AutomationInputOf<N> = N extends keyof Names['automations'] ? Names['automations'][N] : Values;

A declared automation's input, as a native start form sees it.

Source: packages/ui/src/model/types.ts:93

AutomationKey type

type AutomationKey = keyof Names['automations'] & string;

A declared automation and its input as a native start form sees them.

Source: packages/ui/src/model/types.ts:91

primitives

Badge component

component Badge(props: $$ComponentProps)

A small label tag in a colour variant.

Props

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

variant?BadgeVariant

The colour: default/brand, outline, destructive, info, success or warning.

Source: packages/ui/src/primitives/badge/badge.svelte:1

BadgeVariant type

type BadgeVariant = VariantProps<typeof badge_variants>['variant'];

The colour variants of Badge.

Source: packages/ui/src/primitives/badge/badge.svelte:29

behaviors

BindDragOptions type

type BindDragOptions = {
    /** Movement in CSS px before `on_start`/`on_move` fire (default `DRAG_THRESHOLD`). */
    readonly threshold?: number;
    /** Return `false` to reject starting the drag. */
    readonly on_start?: (event: PointerEvent) => boolean | void;
    /** Called at most once per animation frame with latest pointer coordinates. */
    readonly on_move: (sample: PointerSample) => void;
    /** Called when the pointer lifts, cancels, or Escape aborts. */
    readonly on_end?: (event: PointerEvent | KeyboardEvent, canceled: boolean) => void;
    /** Cancel active drag on Escape (default `true`). */
    readonly cancel_on_escape?: boolean;
    /** Stop `pointerdown` propagation so nested drag surfaces do not both capture the gesture. */
    readonly stop_propagation?: boolean;
    /** Disable dragging reactively. */
    readonly disabled?: () => boolean;
};

Options for bind_drag.

Members

NameTypeDescription
threshold?number

Movement in CSS px before on_start/on_move fire (default DRAG_THRESHOLD).

on_start?(event: PointerEvent) => boolean | void

Return false to reject starting the drag.

on_move(sample: PointerSample) => void

Called at most once per animation frame with latest pointer coordinates.

on_end?(event: PointerEvent | KeyboardEvent, canceled: boolean) => void

Called when the pointer lifts, cancels, or Escape aborts.

cancel_on_escape?boolean

Cancel active drag on Escape (default true).

stop_propagation?boolean

Stop pointerdown propagation so nested drag surfaces do not both capture the gesture.

disabled?() => boolean

Disable dragging reactively.

Source: packages/ui/src/behaviors/drag.svelte.ts:21

BindHoldOptions type

type BindHoldOptions = {
    /** Hold duration in ms before `on_hold` fires (default `500`). */
    readonly delay?: number;
    /** Max pointer drift in px before canceling (default `8`). */
    readonly tolerance?: number;
    /** Keys that start a keyboard hold (default `[' ', 'Enter']`). */
    readonly keys?: readonly string[];
    /** Called when press starts. */
    readonly on_start?: (details: {
        readonly event: PointerEvent | KeyboardEvent;
        readonly input: HoldInput;
    }) => void;
    /** Called once the press crosses `delay`. */
    readonly on_hold: (details: {
        readonly event: PointerEvent | KeyboardEvent;
        readonly input: HoldInput;
    }) => void;
    /** Called when the press lifts or cancels. */
    readonly on_end?: (details: {
        readonly event: Event;
        readonly input: HoldInput;
        readonly held: boolean;
        readonly canceled: boolean;
    }) => void;
    /** Disable reactively. */
    readonly disabled?: () => boolean;
};

Options for bind_hold.

Members

NameTypeDescription
delay?number

Hold duration in ms before on_hold fires (default 500).

tolerance?number

Max pointer drift in px before canceling (default 8).

keys?readonly string[]

Keys that start a keyboard hold (default [' ', 'Enter']).

on_start?(details: { readonly event: PointerEvent | KeyboardEvent; readonly input: HoldInput; }) => void

Called when press starts.

on_hold(details: { readonly event: PointerEvent | KeyboardEvent; readonly input: HoldInput; }) => void

Called once the press crosses delay.

on_end?(details: { readonly event: Event; readonly input: HoldInput; readonly held: boolean; readonly canceled: boolean; }) => void

Called when the press lifts or cancels.

disabled?() => boolean

Disable reactively.

Source: packages/ui/src/behaviors/micro.svelte.ts:199

BindRepeatOptions type

type BindRepeatOptions = {
    /** Called immediately on press and repeatedly while held. */
    readonly on_step: (count: number) => void;
    /** Called when the repeating press stops. */
    readonly on_end?: (count: number) => void;
    /** Delay before repeating begins in ms (default `400`). */
    readonly delay?: number;
    /** Interval between repeated steps in ms (default `60`). */
    readonly interval?: number;
    /** Disable reactively. */
    readonly disabled?: () => boolean;
};

Options for bind_repeat.

Members

NameTypeDescription
on_step(count: number) => void

Called immediately on press and repeatedly while held.

on_end?(count: number) => void

Called when the repeating press stops.

delay?number

Delay before repeating begins in ms (default 400).

interval?number

Interval between repeated steps in ms (default 60).

disabled?() => boolean

Disable reactively.

Source: packages/ui/src/behaviors/micro.svelte.ts:334

board

Board component

component Board(props: BoardProps<C, FieldOf<C>, RecordFieldOf<C>>)

A live kanban board of a model's records in lanes by a state, enum or relation field; dropping a card on another lane updates that field, and a refusal rolls it back.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofC

The model whose records are the cards, read in the viewer's output (default when held, else the first named output they hold): a card holds only that output's fields.

byF

The lane field: a state, an enum or a relation.

cardreadonly [] | readonly [K] | readonly [K, K] | readonly [K, K, K] | readonly [K, K, K, K] | Snippet<[{ row: RowOf<C>; }]>

At most four fields (a heavy one is then read), or a snippet.

lanes?readonly Lane[]

Required for a relation by; otherwise the lanes the aggregate finds, in value order.

lane_header?Snippet<[ { value: import('@norbital-ai/store/kind').Value; label: string; count: number | null; } ]>

A lane's title in its header, in place of its dot, label and count (null while searching or recounting); the select and expand controls stay.

on_open?(id: string) => void

Opening a card (a card that stands for another record); default its own record.

columns?number

Lanes per row. Unset is the horizontal reel, which scrolls sideways; a count lays the lanes out in a grid of that many columns whose rows share the board's height.

where?WhereOf<C>

The author's fixed scope (never clearable); the viewer's filter is ANDed under it.

initial_filter?WhereOf<C>

Seed rows of the view popover the viewer may edit or clear.

order_by?OrderByOf<C>

The cards' order within each lane; a viewer's sort replaces it (lane order stays the lanes').

page_size?number

Cards each lane loads per page (default 25); the next page loads as the lane scrolls near its end.

toolbar?Toolbar<RowOf<C>>

The chrome (ViewToolbar): title, description, search, filter and sort (a sort orders the cards within each lane), actions, New.

  • title?: string | false

    Default: the model's label.

  • error?: string

    A form group's semantic error: marks its title and replaces its info text until corrected.

  • description?: string | false

    Behind the info icon. Default: the model's declared description, else its model's.

  • search?: boolean

    Default on where the model declares search fields.

  • filter?: boolean

    The filter-and-sort popover. Default on.

  • actions?: readonly ToolbarItem<R>[] | false

    Author items in the actions menu, in a group of their own; false hides the menu.

  • export?: boolean

    "Export CSV" of the rows in view. Default on; replaced by "Export" when the model's file sync exports.

  • delete?: boolean

    "Delete selected records" when the model declares delete and the viewer may delete (turns selection on). Default on.

  • select?: boolean

    Record checkboxes (Table and Board). Default: on for permitted bulk edits, deletes or selection actions.

  • new?: boolean | (() => void)

    The New button: the record sheet in create mode, or the author's own (a prefilled create). Default: the viewer may create.

  • controls?: Snippet

    A view-local control (a grouping, a lane toggle), placed before search. The page scope (entity, period) is AppShell's actions; never actions.

  • trailing?: Snippet

    Compact task controls at the right edge, before New.

  • context?: { readonly [field: string]: Json; }

    What the view is scoped to ({ company_id, period }), handed to the model's file syncs: the import, its template and the export decode it against the sync's context fields. It narrows and defaults; it never authorizes.

key?string

The URL parameter prefix; defaults to of.

Example

<Board {ctx} of="job" by="status" card={['title', 'assignee']} />

Source: packages/ui/src/board/Board.svelte:1

BoardLane component

component BoardLane(props: Omit<BoardPageProps<C>, "after" | "index" | "on_next">)

One board lane's cards: live keyset pages, the next loading as the lane scrolls near its end.

Props

NameTypeDescription
search?string

The board's search text.

ofC

The model whose records are the cards, read in the viewer's output (default when held, else the first named output they hold): a card holds only that output's fields.

whereJson | undefined

The lane's condition: the board's filter and this lane's value.

cardreadonly [] | readonly [K] | readonly [K, K] | readonly [K, K, K] | readonly [K, K, K, K] | Snippet<[{ row: RowOf<C>; }]>

At most four fields (a heavy one is then read), or a snippet.

moves?readonly { label: string; move: (id: string) => void; }[]

The other lanes a card may move to, where a finger cannot drag it.

order_byJson | undefined

The cards' order within the lane.

grid?boolean

The expanded lane: cards are items of the parent's grid, unwindowed (pages bound them) and not draggable.

ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
lanestring

The lane's label, naming its cards to assistive technology.

page_sizenumber

Cards per loaded page.

selectable?boolean

Each card carries a selection checkbox.

selected?ReadonlySet<RowOf<C>['id']>

The selected cards' ids.

on_select?(id: RowOf<C>['id'], selected: boolean) => void

A card's checkbox changed.

on_rows?(page: symbol, rows: readonly (RowOf<C> & Values)[]) => () => void

A page's loaded cards, keyed by the page; the answer forgets them when the page goes.

on_change?() => void

A loaded page's rows changed live.

on_open?(id: string) => void

Opening a card; default the record sheet.

Source: packages/ui/src/board/BoardLane.svelte:1

BoardProps type

type BoardProps<C = ModelKey, F = FieldOf<C>, K = RecordFieldOf<C>> = {
    /** The page context (`ctx`), passed whole. */
    ctx: UiContext;
    /** The model whose records are the cards, read in the viewer's output (`default` when held, else the first named output they hold): a card holds only that output's fields. */
    of: C;
    /** The lane field: a `state`, an `enum` or a relation. */
    by: F;
    /** At most four fields (a heavy one is then read), or a snippet. */
    card: readonly [] | readonly [K] | readonly [K, K] | readonly [K, K, K] | readonly [K, K, K, K] | Snippet<[{
        row: RowOf<C>;
    }]>;
    /** Required for a relation `by`; otherwise the lanes the aggregate finds, in value order. */
    lanes?: readonly Lane[];
    /**
     * A lane's title in its header, in place of its dot, label and count (`null` while searching or recounting); the
     * select and expand controls stay.
     */
    lane_header?: Snippet<[
        {
            value: import('@norbital-ai/store/kind').Value;
            label: string;
            count: number | null;
        }
    ]>;
    /** Opening a card (a card that stands for another record); default its own record. */
    on_open?: (id: string) => void;
    /**
     * Lanes per row. Unset is the horizontal reel, which scrolls sideways; a count lays the lanes
     * out in a grid of that many columns whose rows share the board's height.
     */
    columns?: number;
    /** The author's fixed scope (never clearable); …

The props of Board, typed by the model of.

Members

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

ofC

The model whose records are the cards, read in the viewer's output (default when held, else the first named output they hold): a card holds only that output's fields.

byF

The lane field: a state, an enum or a relation.

cardreadonly [] | readonly [K] | readonly [K, K] | readonly [K, K, K] | readonly [K, K, K, K] | Snippet<[{ row: RowOf<C>; }]>

At most four fields (a heavy one is then read), or a snippet.

lanes?readonly Lane[]

Required for a relation by; otherwise the lanes the aggregate finds, in value order.

lane_header?Snippet<[ { value: import('@norbital-ai/store/kind').Value; label: string; count: number | null; } ]>

A lane's title in its header, in place of its dot, label and count (null while searching or recounting); the select and expand controls stay.

on_open?(id: string) => void

Opening a card (a card that stands for another record); default its own record.

columns?number

Lanes per row. Unset is the horizontal reel, which scrolls sideways; a count lays the lanes out in a grid of that many columns whose rows share the board's height.

where?WhereOf<C>

The author's fixed scope (never clearable); the viewer's filter is ANDed under it.

initial_filter?WhereOf<C>

Seed rows of the view popover the viewer may edit or clear.

order_by?OrderByOf<C>

The cards' order within each lane; a viewer's sort replaces it (lane order stays the lanes').

page_size?number

Cards each lane loads per page (default 25); the next page loads as the lane scrolls near its end.

toolbar?Toolbar<RowOf<C>>

The chrome (ViewToolbar): title, description, search, filter and sort (a sort orders the cards within each lane), actions, New.

key?string

The URL parameter prefix; defaults to of.

Source: packages/ui/src/board/Board.svelte:27

primitives

Button component

component Button(props: ButtonProps)

A button (or a link, with href) in a variant and size.

Props

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

variant?ButtonVariant

default, brand (the one chromatic action per view), destructive, outline, secondary, ghost or link.

size?ButtonSize

default (the field height), icon (square) or lg (a lone call to action outside forms and toolbars).

readonly?boolean

Inert like disabled but keeps its normal styling.

haptic?HapticKind

A tick on tap where the device has a motor; for decisions, not for every button.

hint?string

A tooltip on hover.

disabled_message?string

The tooltip while disabled, in place of hint: why it cannot be pressed.

readonly_message?string

The tooltip while readonly, in place of hint.

Example

<Button variant="outline" onclick={save}>Save</Button>

Source: packages/ui/src/primitives/button/button.svelte:1

ButtonProps type

type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
    /** `default`, `brand` (the one chromatic action per view), `destructive`, `outline`, `secondary`, `ghost` or `link`. */
    variant?: ButtonVariant;
    /** `default` (the field height), `icon` (square) or `lg` (a lone call to action outside forms and toolbars). */
    size?: ButtonSize;
    /** Inert like `disabled` but keeps its normal styling. */
    readonly?: boolean;
    /** A tick on tap where the device has a motor; for decisions, not for every button. */
    haptic?: HapticKind;
    /** A tooltip on hover. */
    hint?: string;
    /** The tooltip while `disabled`, in place of `hint`: why it cannot be pressed. */
    disabled_message?: string;
    /** The tooltip while `readonly`, in place of `hint`. */
    readonly_message?: string;
};

The props of Button: the button's (or link's) attributes, variant, size and haptic.

Members

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

variant?ButtonVariant

default, brand (the one chromatic action per view), destructive, outline, secondary, ghost or link.

size?ButtonSize

default (the field height), icon (square) or lg (a lone call to action outside forms and toolbars).

readonly?boolean

Inert like disabled but keeps its normal styling.

haptic?HapticKind

A tick on tap where the device has a motor; for decisions, not for every button.

hint?string

A tooltip on hover.

disabled_message?string

The tooltip while disabled, in place of hint: why it cannot be pressed.

readonly_message?string

The tooltip while readonly, in place of hint.

Source: packages/ui/src/primitives/button/button.svelte:45

behaviors

CalendarBehavior type

type CalendarBehavior = ReturnType<typeof create_calendar>;

Return value of create_calendar.

Members

NameTypeDescription
placeholderCalendarDate
monthsreadonly CalendarMonth[]
weekdaysreadonly string[]
set_placeholder(next: DateValue) => void
prev_month() => void
next_month() => void
reset_pending() => void
focusedCalendarDate
focus_day(target: CalendarDate) => void
day_ref(date: CalendarDate) => Attachment<HTMLElement>
day_attrs(date: CalendarDate, month: CalendarDate) => { role: "button"; tabindex: number; "data-value": string; "data-selected": string | undefined; "data-selection-start": string | undefined; "data-selection-end": string | undefined; "data-today": string | undefined; "data-outside-month": string | undefined; "data-disabled": string | undefined; "aria-disabled": true | undefined; "aria-selected": boolean;…

Source: packages/ui/src/behaviors/date-time.svelte.ts:121

event-calendar

CalendarEvent type

type CalendarEvent = {
    /** The caller's key, handed back in callbacks. */
    id: string | number;
    start: Date;
    /** An event starting and ending on one day is a timed box; otherwise it is a bar. */
    end: Date;
    title: string;
    /** A bar in the all-day band whatever its times. */
    all_day?: boolean;
    /** A CSS colour for the event's accent; the brand colour by default. */
    color?: string;
    /** `false` locks a timed event against moving and resizing; `locked_reason` is its tooltip. */
    editable?: boolean;
    locked_reason?: string;
};

One calendar event: id, start and end, title, all-day flag, accent colour, and whether it may be moved.

Members

NameTypeDescription
idstring | number

The caller's key, handed back in callbacks.

startDate
endDate

An event starting and ending on one day is a timed box; otherwise it is a bar.

titlestring
all_day?boolean

A bar in the all-day band whatever its times.

color?string

A CSS colour for the event's accent; the brand colour by default.

editable?boolean

false locks a timed event against moving and resizing; locked_reason is its tooltip.

locked_reason?string

Source: packages/ui/src/event-calendar/calendar.ts:5

behaviors

CalendarMode type

type CalendarMode = 'single' | 'range';

Selection mode for create_calendar.

Source: packages/ui/src/behaviors/date-time.svelte.ts:74

CalendarMonth type

type CalendarMonth = {
    /** First day of this month. */
    readonly value: CalendarDate;
    /** Rows of 7 `CalendarDate` cells (including leading/trailing outside-month days). */
    readonly weeks: readonly (readonly CalendarDate[])[];
};

One month grid returned by create_calendar.

Members

NameTypeDescription
valueCalendarDate

First day of this month.

weeksreadonly (readonly CalendarDate[])[]

Rows of 7 CalendarDate cells (including leading/trailing outside-month days).

Source: packages/ui/src/behaviors/date-time.svelte.ts:85

CalendarOptions type

type CalendarOptions = {
    /** Single-day or date-range selection mode (default `'single'`). */
    readonly mode?: CalendarMode | (() => CalendarMode);
    /** Selected single date when `mode === 'single'`. */
    readonly value?: () => DateValue | undefined;
    /** Selected range when `mode === 'range'`. */
    readonly range?: () => CalendarRange;
    /** Called on single-day selection. */
    readonly on_select?: (date: DateValue) => void;
    /** Called when range selection updates (with `{ start, end }`). */
    readonly on_range_change?: (range: CalendarRange) => void;
    /** Controlled visible anchor month. */
    readonly placeholder?: () => DateValue | undefined;
    /** Called when the visible month changes. */
    readonly on_placeholder_change?: (next: DateValue) => void;
    /** Number of side-by-side months to build (default `1`). */
    readonly number_of_months?: () => number;
    /** BCP-47 locale for weekday order and names (default `'en-US'`). */
    readonly locale?: () => string | undefined;
    /** Minimum selectable date. */
    readonly min?: () => DateValue | undefined;
    /** Maximum selectable date. */
    readonly max?: () => DateValue | undefined;
    /** Disabled state. */
    readonly disabled?: () => boolean;
};

Options for create_calendar.

Members

NameTypeDescription
mode?CalendarMode | (() => CalendarMode)

Single-day or date-range selection mode (default 'single').

value?() => DateValue | undefined

Selected single date when mode === 'single'.

range?() => CalendarRange

Selected range when mode === 'range'.

on_select?(date: DateValue) => void

Called on single-day selection.

on_range_change?(range: CalendarRange) => void

Called when range selection updates (with { start, end }).

placeholder?() => DateValue | undefined

Controlled visible anchor month.

on_placeholder_change?(next: DateValue) => void

Called when the visible month changes.

number_of_months?() => number

Number of side-by-side months to build (default 1).

locale?() => string | undefined

BCP-47 locale for weekday order and names (default 'en-US').

min?() => DateValue | undefined

Minimum selectable date.

max?() => DateValue | undefined

Maximum selectable date.

disabled?() => boolean

Disabled state.

Source: packages/ui/src/behaviors/date-time.svelte.ts:93

CalendarRange type

type CalendarRange = {
    /** First selected date, if any. */
    readonly start: DateValue | undefined;
    /** Last selected date, if any. */
    readonly end: DateValue | undefined;
};

Start and end of a calendar date range.

Members

NameTypeDescription
startDateValue | undefined

First selected date, if any.

endDateValue | undefined

Last selected date, if any.

Source: packages/ui/src/behaviors/date-time.svelte.ts:77

event-calendar

CalendarView type

type CalendarView = 'day' | 'week' | 'month';

An EventCalendar view: one day, a week or a month.

Source: packages/ui/src/event-calendar/calendar.ts:3

behaviors

CarouselBehavior type

type CarouselBehavior = ReturnType<typeof create_carousel>;

Return value of create_carousel.

Members

NameTypeDescription
indexnumber
countnumber
can_prevboolean
can_nextboolean
pausedboolean
go_to(next: number) => void
next() => void
prev() => void
set_paused(p: boolean) => void
rootAttachment<HTMLElement>
trackAttachment<HTMLElement>
root_attrs() => { role: "region"; "aria-roledescription": string; "aria-label": string; onpointerenter: () => boolean; onpointerleave: () => boolean; onfocusin: () => boolean; onfocusout: () => boolean; onkeydown: (event: KeyboardEvent) => void; }
slide_attrs(i: number) => { role: "group"; "aria-roledescription": string; "aria-label": string; "aria-hidden": true | undefined; "data-active": string | undefined; }
dot_attrs(i: number) => { type: "button"; "aria-label": string; "aria-current": "true" | undefined; "data-active": string | undefined; onclick: () => void; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:240

CarouselOptions type

type CarouselOptions = {
    readonly count: () => number;
    readonly index?: () => number;
    readonly default_index?: number;
    readonly on_change?: (index: number) => void;
    readonly loop?: boolean;
    readonly autoplay_ms?: number;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_carousel.

Members

NameTypeDescription
count() => number
index?() => number
default_index?number
on_change?(index: number) => void
loop?boolean
autoplay_ms?number
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:228

CellBounds type

type CellBounds = {
    readonly top: number;
    readonly left: number;
    readonly bottom: number;
    readonly right: number;
};

Normalized inclusive rectangular bounds of a CellRange.

Members

NameTypeDescription
topnumber
leftnumber
bottomnumber
rightnumber

Source: packages/ui/src/behaviors/grid.svelte.ts:15

cell

CellOverflow component

component CellOverflow(props: $$ComponentProps)

A dense cell's value on one line of fixed height; when it is wider or taller than the cell, an expand button opens a bounded, scrollable popover holding it whole: full when given, else text as plain text, else the value again. expand="never" drops it: a table row's cells, since the row opens its record.

Props

NameTypeDescription
text?string

The value as plain text, for the popover when full is absent.

childrenSnippet

The value as the cell shows it.

full?Snippet

The whole value for the popover, when the cell shows a shorter preview of it.

expand?'always' | 'never'

never drops the expand button (default always).

Source: packages/ui/src/cell/Overflow.svelte:1

behaviors

CellRange type

type CellRange = {
    readonly anchor: GridCell;
    readonly end: GridCell;
};

Rectangular cell range from anchor to end.

Members

NameTypeDescription
anchorGridCell
endGridCell

Source: packages/ui/src/behaviors/grid.svelte.ts:12

CellRangeBehavior type

type CellRangeBehavior = ReturnType<typeof create_cell_range>;

Return value of create_cell_range.

Members

NameTypeDescription
rangeCellRange | null
boundsCellBounds | null
draggingboolean
start(cell: GridCell) => void
extend(to: GridCell, from?: GridCell, notify?: boolean) => void
select_row(row: number) => void
select_col(col: number) => void
clear() => void
contains(cell: GridCell) => boolean
to_text(read: (cell: GridCell) => string) => string
cell_attrs(cell: GridCell) => { "aria-selected": boolean; "data-in-range": string | undefined; onpointerdown: (event: PointerEvent) => void; onpointerenter: () => void; }

Source: packages/ui/src/behaviors/grid.svelte.ts:253

CellRangeOptions type

type CellRangeOptions = {
    /** Total row count. */
    readonly rows: () => number;
    /** Total column count. */
    readonly cols: () => number;
    /** Controlled range; omit for internal state. */
    readonly range?: () => CellRange | null;
    /** Called when the selected cell range changes. */
    readonly on_change?: (range: CellRange | null) => void;
    /** Optional live-region message formatter on range updates. */
    readonly message?: (bounds: CellBounds) => string;
};

Options for create_cell_range.

Members

NameTypeDescription
rows() => number

Total row count.

cols() => number

Total column count.

range?() => CellRange | null

Controlled range; omit for internal state.

on_change?(range: CellRange | null) => void

Called when the selected cell range changes.

message?(bounds: CellBounds) => string

Optional live-region message formatter on range updates.

Source: packages/ui/src/behaviors/grid.svelte.ts:239

cell

CellValue component

component CellValue(props: $$ComponentProps)

A value as a view's cell shows it, by its kind.

Props

NameTypeDescription
ctxUiContext

The page context.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
valueimport('@norbital-ai/store/kind').Value | undefined

The stored value.

kind?Kind | undefined

The field's kind; without it the value shows by its shape.

row?Values

The row the value is in: its money currency and custom renderers read it.

ref?Ref | undefined

A relation's target and label (unref), shown as a link opening that record; a many-relation shows its first label and a "+N" chip listing the rest.

  • of: string
  • text: string
  • items?: readonly { id: string; text: string; }[]
  • more?: true
name?string

The field's name, which reaches a custom field's renderer.

dense?boolean

A table cell or card: a structured value previews its fields and opens the same structured renderer.

link?boolean

false in a row that opens its own record: a relation shows as text, so a tap never lands on the related record.

Source: packages/ui/src/cell/Value.svelte:1

behaviors

ChangeSource type

type ChangeSource = 'pointer' | 'keyboard' | 'agent' | 'programmatic';

Who initiated a UI change.

Source: packages/ui/src/behaviors/controls.svelte.ts:7

chart

Chart component

component Chart(props: ChartProps)

A bar, line, area or donut chart over a model (bucketed by x), an aggregate's buckets, a declared query's rows or rows, live while shown: x names the category, y the numbers (count, sum.amount). It fills its parent, down to 18rem.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofModelKey | ViewSource

The data: a model (one aggregate bucketed by x, measuring each y), an aggregate's buckets, a declared query's rows or page, or rows; re-read live while shown.

where?Json

A model's scope: only its rows are measured.

xstring

The category field: one bar, point or slice per value.

ystring | readonly string[]

The numeric field, or several as series in palette order; a donut plots only the first.

kind?'bar' | 'line' | 'area' | 'donut' | 'scatter'

The chart type. Default 'bar'.

interpolation?'linear' | 'step'

Hold each value until the next x position. Applies to line charts.

orientation?'horizontal' | 'vertical'

Bar charts only: 'horizontal' lays categories down the side. Default 'vertical'.

stack?boolean

Bar and area charts: stack the y series instead of grouping (bars) or overlapping (areas). Default false.

title?string

A caption above the chart; also names the data in loading and error states.

Example

<Chart {ctx} of="jobs" x="status" y="count" kind="bar" />

Source: packages/ui/src/chart/Chart.svelte:1

primitives

Checkbox component

component Checkbox(props: $$ComponentProps)

A checkbox, bindable checked (and indeterminate). readonly (or an enclosing readonly form) shows Yes/No as text; disabled keeps the box, muted.

Props

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

checked?boolean

Whether the checkbox is checked; bindable.

indeterminate?boolean

Mixed / indeterminate state; bindable.

readonly?boolean

Shows Yes/No as copyable text.

name?string

The form field name it submits under.

value?string

Submitted form value when checked (default 'on').

required?boolean

Whether the checkbox is required.

on_checked_change?(checked: boolean) => void

Called with the next checked state when the person toggles it.

on_indeterminate_change?(indeterminate: boolean) => void

Called with the next indeterminate state when it changes.

Source: packages/ui/src/primitives/checkbox/checkbox.svelte:1

behaviors

CheckboxGroup type

type CheckboxGroup = ReturnType<typeof create_checkbox_group>;

Return value of create_checkbox_group.

Members

NameTypeDescription
checkedreadonly string[]
all_stateboolean | "indeterminate"
is_checked(key: string) => boolean
toggle(key: string) => void
toggle_all() => void
group_attrs() => { role: "group"; "aria-label": string | undefined; }
all_attrs() => { type: "checkbox"; checked: boolean; "aria-checked": boolean | "mixed"; onchange: () => void; }
item_attrs(key: string) => { type: "checkbox"; checked: boolean; disabled: true | undefined; onchange: () => void; }

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:621

CheckboxGroupOptions type

type CheckboxGroupOptions = {
    /** All selectable item keys. */
    readonly items: () => readonly string[];
    /** Controlled checked keys; omit for internal state. */
    readonly value?: () => readonly string[];
    /** Initial checked keys when uncontrolled. */
    readonly default_value?: readonly string[];
    /** Called when checked keys change. */
    readonly on_change?: (next: readonly string[]) => void;
    /** Per-item disabled predicate. */
    readonly disabled?: (key: string) => boolean;
    /** Accessible label for the group. */
    readonly label?: string;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_checkbox_group.

Members

NameTypeDescription
items() => readonly string[]

All selectable item keys.

value?() => readonly string[]

Controlled checked keys; omit for internal state.

default_value?readonly string[]

Initial checked keys when uncontrolled.

on_change?(next: readonly string[]) => void

Called when checked keys change.

disabled?(key: string) => boolean

Per-item disabled predicate.

label?string

Accessible label for the group.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:603

relations

ChildGrid component

component ChildGrid(props: ChildGridProps)

A related-record grid with explicit child operations, original revisions and parent or independent saves.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofstring

The parent model.

relationstring

The parent's child relation whose records the grid lists.

id?string

The parent record's id; unset (a new parent) reads no rows.

save?'parent' | 'independent'

'parent' (the default inside a record): edits follow the enclosing record form's edit mode and save with the parent through its child contract. 'independent' (the default on its own): the grid has its own Edit toggle and saves each child through the child model's own verbs.

columns?readonly Col<Row>[]

The child columns. Default: the contract's create and update columns, then every exposed field but the parent ref.

where?Json

A filter ANDed with the parent scope.

Source: packages/ui/src/relations/ChildGrid.svelte:1

behaviors

Clipboard type

type Clipboard = ReturnType<typeof create_clipboard>;

Return value of create_clipboard.

Members

NameTypeDescription
copiedboolean
copy(override?: string) => Promise<boolean>
reset() => void

Source: packages/ui/src/behaviors/clipboard.svelte.ts:16

ClipboardOptions type

type ClipboardOptions = {
    /** Text to copy (reactive getter or static string). */
    text: string | (() => string);
    /** How long `copied` stays `true` in ms (default `1500`). */
    timeout_ms?: number;
    /** Optional callback after a copy attempt completes. */
    on_copy?: (ok: boolean, value: string) => void;
};

Options for create_clipboard.

Members

NameTypeDescription
textstring | (() => string)

Text to copy (reactive getter or static string).

timeout_ms?number

How long copied stays true in ms (default 1500).

on_copy?(ok: boolean, value: string) => void

Optional callback after a copy attempt completes.

Source: packages/ui/src/behaviors/clipboard.svelte.ts:6

editors

CodeDiff component

component CodeDiff(props: CodeDiffProps)

One file's change as CodeMirror's unified diff: a header with its path and added and removed line counts, then, once opened, the text with added lines green and removed lines red and long unchanged runs folded away. CodeMirror loads with the first diff shown, never with a page's startup.

Props

NameTypeDescription
pathstring

The file's path, shown in the header.

beforestring

The text before the change.

afterstring

The text after the change.

language?CodeEditorLanguage

Syntax highlighting (default plaintext).

open?boolean

Whether the diff is shown; bindable, closed by default.

Source: packages/ui/src/editors/code-diff.svelte:1

CodeEditor component

component CodeEditor(props: CodeEditorProps)

A CodeMirror code editor for JavaScript (also CEL and TypeScript expressions), JSON or plain text. CodeMirror and its language packs load with the first editor shown, never with a page's startup.

Props

NameTypeDescription
valuestring

The text; an outside change replaces the document without echoing through on_change.

on_change?((next: string) => void) | undefined

Called with the whole text on every edit.

language?CodeEditorLanguage

Syntax highlighting (default plaintext).

readonly?boolean

Not editable; shown on a muted background.

invalid?boolean

Marks the editor invalid (a destructive border).

min_height?string

CSS min-height of the editing area; one line is 2.25rem (a field's height).

size?LayoutSize

content (default): its text's height, down to min_height; fill: the height left in its parent, scrolling inside.

framed?boolean

The field's box (border, radius, shadow). Default true; false for an editor that is a whole pane.

wrap?boolean

Long lines wrap at the editor's width instead of scrolling sideways (an expression, prose).

id?string

The id on the editing area, for <label for>.

aria-label?string

Accessible name of the editing area.

aria-labelledby?string

The id of the element that names the editing area.

Source: packages/ui/src/editors/code-editor.svelte:1

table

Col type

type Col<R = Row, K = R> = {
    [F in keyof K & string]-?: F | ColumnDefinition<R, K, F>;
}[keyof K & string];

A column's field name or configuration, preserving that field's type in a custom cell snippet. Without a custom cell, the kind renderer shows scalar values and relations show their target labels.

Source: packages/ui/src/table/Table.svelte:73

behaviors

ColorPickerBehavior type

type ColorPickerBehavior = ReturnType<typeof create_color_picker>;

Return value of create_color_picker.

Members

NameTypeDescription
valuestring
rgbaRgbaColor
hsvHsvaColor
plane{ readonly value: import("./canvas.svelte.js").AreaValue; readonly percent_x: number; readonly percent_y: number; readonly dragging: boolean; set: (next: import("./canvas.svelte.js").AreaValue, commitNow?: boolean) => void; surface: Attachment<HTMLElement>; thumb_attrs(): { role: "slider"; tabindex: number; 'aria-label': string | undefined; 'aria-valuetext': string; 'data-dragging': string | unde…
hue{ readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; 'aria-orientation': "horizontal" | "vertical"; 'aria-label': string | undefined; 'aria-valuemin': numbe…
alpha{ readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; 'aria-orientation': "horizontal" | "vertical"; 'aria-label': string | undefined; 'aria-valuemin': numbe…
set_text(text: string) => boolean
set_rgba(next: RgbaColor) => void

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:987

ColorPickerOptions type

type ColorPickerOptions = {
    readonly value?: () => string;
    readonly default_value?: string;
    readonly on_change?: (hex: string, rgba: RgbaColor) => void;
    readonly format?: 'hex' | 'rgb' | 'hsl';
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_color_picker.

Members

NameTypeDescription
value?() => string
default_value?string
on_change?(hex: string, rgba: RgbaColor) => void
format?'hex' | 'rgb' | 'hsl'
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:977

ColorSchemeOptions type

type ColorSchemeOptions = {
    readonly storage_key?: string;
    readonly default_value?: ColorSchemePreference;
    readonly apply_class?: boolean;
};

Options for create_color_scheme.

Members

NameTypeDescription
storage_key?string
default_value?ColorSchemePreference
apply_class?boolean

Source: packages/ui/src/behaviors/platform.svelte.ts:165

ColorSchemePreference type

type ColorSchemePreference = 'light' | 'dark' | 'system';

User color-scheme preference.

Source: packages/ui/src/behaviors/platform.svelte.ts:153

table

ColumnMenu component

component ColumnMenu(props: $$ComponentProps)

A column heading's menu: pin or unpin, hide, move left or right, reset its width, and show a hidden column again.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
fieldstring

The column's field.

labelstring

The column's heading.

pinnedboolean

The column is pinned to the left.

firstboolean

The first column: it cannot move left.

lastboolean

The last column: it cannot move right.

onlyboolean

The only column shown: it cannot be hidden.

resizedboolean

The viewer set its width.

hiddenreadonly { readonly field: string; readonly label: string; }[]

The hidden columns, to show again.

on_pin() => void

Pin or unpin the column.

on_hide() => void

Hide the column.

on_move(by: -1 | 1) => void

Move the column one place left (-1) or right (1).

on_reset_width() => void

Drop the viewer's width for the column.

on_show(field: string) => void

Show the hidden column field again.

Source: packages/ui/src/table/ColumnMenu.svelte:1

ColumnsIn type

type ColumnsIn<S> = SourceColumns<S>;

The fields a column may name: a model's whole record (a heavy field is then read) and its many-relations (the related records, each { id, …label }), else the row's.

Source: packages/ui/src/table/Table.svelte:44

primitives

Combobox component

component Combobox(props: ComboboxCommonProps<V> & { multiple?: M | undefined; } & { value: M extends true ? readonly V[] : V | null; on_change(next: M extends true ? readonly V[] : V | null): void; })

The kit's select: a field-like trigger and a searchable option list in a popover, filtered locally or through on_search.

Props

NameTypeDescription
optionsreadonly ComboboxOption<V>[]

The choices, in order; with on_search the caller replaces them per query.

clearable?boolean

Offer a "none" row that clears the value.

placeholder?string

The trigger's text with nothing chosen, and its accessible name without aria-label.

display?string

The trigger's text when value is not among options (a picker's chosen row on another page).

searchable?boolean

Show the search box; defaults to true. Pass false to opt out on fixed short selectors.

on_search?((query: string) => void) | undefined

Each keystroke's query (and '' on open) instead of local filtering; the caller supplies matching options.

on_open_change?((open: boolean) => void) | undefined

Called as the list opens or closes.

loading?boolean

The list shows the loading message in place of options.

failed?boolean

The list shows the failure message in place of options.

variant?'default' | 'ghost'

ghost: no border, fill or shadow; for a combobox in chrome or a toolbar, not a form. Same size either way.

id?string

The trigger's id, for a <label for>; an enclosing Field supplies one.

readonly?boolean

Shows the chosen label as copyable text, no trigger; an enclosing readonly form sets it.

disabled?boolean

The trigger stays, muted and inert; an enclosing disabled form sets it.

invalid?boolean

Marks the trigger aria-invalid (error styling).

class?string

Classes on the trigger.

aria-label?string

The trigger's accessible name; the chosen labels are appended.

header?Snippet

Rendered between the search box and the list (tabs that scope options, with on_search).

footer?Snippet

Rendered below the scrollable option list.

badge?Snippet

Rendered inside the trigger, before its chevron: a status the chosen value carries.

trigger?Snippet<[ComboboxOption<V> | null]>

The trigger's content, in place of the value and chevron (a workspace chip with its avatar).

lead?Snippet<[ComboboxOption<V>]>

A row's leading content, in place of icon (an avatar); its label, suffix and check still follow.

actions?Snippet<[ComboboxOption<V>]>

A row's trailing controls beside its choice (a conversation's Archive and Delete); they never choose the row.

empty?Snippet

A caller's empty state; loading and failed states keep the standard messages.

onkeydown?((event: KeyboardEvent) => void) | undefined

Handle scope shortcuts before list navigation; preventing default resets the active option.

multiple?M

true: value is an array and each pick toggles one choice, the list staying open.

valueM extends true ? readonly V[] : V | null

The chosen value (null for none), or the chosen values when multiple.

on_change(next: M extends true ? readonly V[] : V | null) => void

Called with the next value (or values) on each pick or clear.

Example

<Combobox options={[{ value: 'low', label: 'Low' }, { value: 'high', label: 'High' }]} {value} on_change={(v) => (value = v)} />

Source: packages/ui/src/primitives/combobox/combobox.svelte:1

ComboboxOption type

type ComboboxOption<V extends string = string> = {
    value: V;
    label: string;
    /** Fixed trailing information, kept visible while a long label truncates (e.g. an available balance). */
    suffix?: string;
    description?: string;
    icon?: string;
    group?: string;
    keywords?: string;
};

One choice: label is shown and searched (with keywords); group heads a section.

Members

NameTypeDescription
valueV
labelstring
suffix?string

Fixed trailing information, kept visible while a long label truncates (e.g. an available balance).

description?string
icon?string
group?string
keywords?string

Source: packages/ui/src/primitives/combobox/combobox.svelte:11

editors

CommandItem type

type CommandItem = {
    id: string;
    label: string;
    description?: string;
    icon?: string;
    group?: string;
    /** A visible scope hint or unavailable capability; cannot be picked. */
    disabled?: boolean;
    /** The text that replaces `<char><query>`; default `<char><label> `. `run` alone removes the trigger text. */
    insert?: string;
    /** Keep the menu open after inserting a scope, then search its records. */
    keep?: boolean;
    /** Optional deeper search, selected with Tab, → or the row's explore button. Enter picks the item itself. */
    drill?: {
        insert: string;
        label: string;
    };
    /** Return from an explicit search scope; Escape or Backspace in its empty query uses this row. */
    back?: boolean;
    /** Children revealed beneath their expanded manifest entity. */
    depth?: 1;
    run?(): void;
};

One row of the menu. Picking it replaces the trigger and its query with insert, or runs run, or both.

Members

NameTypeDescription
idstring
labelstring
description?string
icon?string
group?string
disabled?boolean

A visible scope hint or unavailable capability; cannot be picked.

insert?string

The text that replaces <char><query>; default <char><label> . run alone removes the trigger text.

keep?boolean

Keep the menu open after inserting a scope, then search its records.

drill?{ insert: string; label: string; }

Optional deeper search, selected with Tab, → or the row's explore button. Enter picks the item itself.

back?boolean

Return from an explicit search scope; Escape or Backspace in its empty query uses this row.

depth?1

Children revealed beneath their expanded manifest entity.

run?(() => void) | undefined

Source: packages/ui/src/editors/command-menu.ts:8

behaviors

ConnectBehavior type

type ConnectBehavior = ReturnType<typeof create_connect>;

Return value of create_connect.

Members

NameTypeDescription
draftConnectDraft | null
pending_fromstring | null
port(id: string) => Attachment<HTMLElement>
port_attrs(id: string) => { tabindex: number; 'data-connecting': string | undefined; 'data-connect-target': string | undefined; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/canvas.svelte.ts:635

ConnectDraft type

type ConnectDraft = {
    readonly from: string;
    readonly x: number;
    readonly y: number;
    readonly over: string | null;
};

Active wire being dragged from a source port to pointer coordinates.

Members

NameTypeDescription
fromstring
xnumber
ynumber
overstring | null

Source: packages/ui/src/behaviors/canvas.svelte.ts:621

ConnectOptions type

type ConnectOptions = {
    readonly can_connect?: (from: string, to: string) => boolean;
    readonly on_connect: (from: string, to: string) => void;
};

Options for create_connect.

Members

NameTypeDescription
can_connect?(from: string, to: string) => boolean
on_connect(from: string, to: string) => void

Source: packages/ui/src/behaviors/canvas.svelte.ts:629

ControlAction type

type ControlAction = (...args: readonly unknown[]) => void;

Semantic action callback registered on a live UI control.

Source: packages/ui/src/behaviors/controls.svelte.ts:10

ControlChange type

type ControlChange = {
    readonly id: string;
    readonly kind: string;
    readonly label?: string;
    readonly key: string;
    readonly previous: unknown;
    readonly value: unknown;
    readonly source: ChangeSource;
    readonly reason: string;
    readonly redacted?: boolean;
    readonly committed: boolean;
};

Emitted change record for observe_controls and create_ui_history.

Members

NameTypeDescription
idstring
kindstring
label?string
keystring
previousunknown
valueunknown
sourceChangeSource
reasonstring
redacted?boolean
committedboolean

Source: packages/ui/src/behaviors/controls.svelte.ts:74

ControlChoice type

type ControlChoice = {
    readonly value: string;
    readonly label: string;
};

Choice exposed by a selectable control (tabs, combobox, menu, radio group, tree).

Members

NameTypeDescription
valuestring
labelstring

Source: packages/ui/src/behaviors/controls.svelte.ts:13

ControlDescriptor type

type ControlDescriptor = {
    /** Stable semantic identifier, e.g. `'tabs:settings'` or `'combobox:status'`. */
    readonly id: string;
    /** Component kind, e.g. `'tabs'`, `'combobox'`, `'dialog'`, `'input'`, `'checkbox'`, `'menu'`. */
    readonly kind: string;
    /** Optional human-readable label (falls back to accessible name of `element`). */
    readonly label?: string;
    /** Optional root/interactive DOM element for scope filtering and `data-agent-*` marks. */
    readonly element?: () => HTMLElement | null | undefined;
    /** Live snapshot of state (active tab, open state, value, selected count, etc.). */
    readonly state: () => Record<string, unknown>;
    /** Optional choices accepted by selection actions. */
    readonly items?: () => readonly ControlChoice[];
    /** Named semantic actions callable by the host/agent bridge. */
    readonly actions?: Readonly<Record<string, ControlAction>>;
    /** Whether the control is currently disabled or read-only (hides callable actions). */
    readonly disabled?: () => boolean;
    /** Explicit confirmation prompt describing why a person must approve agent actions. */
    readonly confirm?: string | (() => string | undefined);
    /** Marks values as secret (writable by agent, always redacted in snapshots/observations). */
    readonly secret?: boolean | (() => boolean);
    /** Hides this control from agent snapshots and invocation. */
    readonly hidden?: boolean | (() => boolean);
};

Registration descriptor for a live interactive UI control.

Members

NameTypeDescription
idstring

Stable semantic identifier, e.g. 'tabs:settings' or 'combobox:status'.

kindstring

Component kind, e.g. 'tabs', 'combobox', 'dialog', 'input', 'checkbox', 'menu'.

label?string

Optional human-readable label (falls back to accessible name of element).

element?() => HTMLElement | null | undefined

Optional root/interactive DOM element for scope filtering and data-agent-* marks.

state() => Record<string, unknown>

Live snapshot of state (active tab, open state, value, selected count, etc.).

items?() => readonly ControlChoice[]

Optional choices accepted by selection actions.

actions?Readonly<Record<string, ControlAction>>

Named semantic actions callable by the host/agent bridge.

disabled?() => boolean

Whether the control is currently disabled or read-only (hides callable actions).

confirm?string | (() => string | undefined)

Explicit confirmation prompt describing why a person must approve agent actions.

secret?boolean | (() => boolean)

Marks values as secret (writable by agent, always redacted in snapshots/observations).

hidden?boolean | (() => boolean)

Hides this control from agent snapshots and invocation.

Source: packages/ui/src/behaviors/controls.svelte.ts:16

ControlInvokeResult type

type ControlInvokeResult = {
    readonly ok: boolean;
    readonly id?: string;
    readonly label?: string;
    readonly confirm?: string;
    readonly error?: string;
};

Structured result returned by invoke_control.

Members

NameTypeDescription
okboolean
id?string
label?string
confirm?string
error?string

Source: packages/ui/src/behaviors/controls.svelte.ts:65

ControlSnapshot type

type ControlSnapshot = {
    readonly id: string;
    readonly kind: string;
    readonly label?: string;
    readonly state: Record<string, unknown>;
    readonly actions: readonly string[];
    readonly items?: readonly ControlChoice[];
    readonly confirm?: string;
    readonly secret?: boolean;
    readonly disabled?: boolean;
};

Read-only snapshot of a registered UI control's current state, safety marks and actions.

Members

NameTypeDescription
idstring
kindstring
label?string
stateRecord<string, unknown>
actionsreadonly string[]
items?readonly ControlChoice[]
confirm?string
secret?boolean
disabled?boolean

Source: packages/ui/src/behaviors/controls.svelte.ts:42

CookieStorageOptions type

type CookieStorageOptions = {
    readonly path?: string;
    readonly max_age?: number;
    readonly same_site?: 'Lax' | 'Strict' | 'None';
    readonly secure?: boolean;
};

Options for create_cookie_storage.

Members

NameTypeDescription
path?string
max_age?number
same_site?'Lax' | 'Strict' | 'None'
secure?boolean

Source: packages/ui/src/behaviors/platform.svelte.ts:398

CropRect type

type CropRect = {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
};

Normalized (0..1) crop rectangle over an image.

Members

NameTypeDescription
xnumber
ynumber
widthnumber
heightnumber

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1086

kinds

CustomFieldEntry type

type CustomFieldEntry = {
    shape: Kind;
    label?: string;
    renderer?: Component<{
        view: KindView;
        ctx: UiContext;
    }>;
};

A custom field as the ui renders it: its shape, label and optional renderer component; built-ins and tenant fields alike.

Members

NameTypeDescription
shapeKind
label?string
renderer?Component<{ view: KindView; ctx: UiContext; }>

Source: packages/ui/src/kinds/context.ts:121

model

CustomView component

component CustomView(props: CustomViewProps<R>)

The standard toolbar over a custom view (a roster grid, a calendar, cards): title and description, search, the filter and sort popover over the page's own rows, the actions menu and the page's scope controls. The body gets the rows they leave.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofreadonly R[]

The rows the custom view draws; the toolbar narrows and orders them.

fieldsreadonly CustomField<R>[]

The fields the toolbar searches, filters and sorts on; a bare name is labelled by humanizing it.

keystring

The URL prefix of the viewer's filter and sort.

toolbar?Exclude<Toolbar<R>, false>

Title, description, actions, controls, new; export: true adds "Export CSV" of the rows shown.

  • title?: string | false

    Default: the model's label.

  • error?: string

    A form group's semantic error: marks its title and replaces its info text until corrected.

  • description?: string | false

    Behind the info icon. Default: the model's declared description, else its model's.

  • search?: boolean

    Default on where the model declares search fields.

  • filter?: boolean

    The filter-and-sort popover. Default on.

  • actions?: readonly ToolbarItem<R>[] | false

    Author items in the actions menu, in a group of their own; false hides the menu.

  • export?: boolean

    "Export CSV" of the rows in view. Default on; replaced by "Export" when the model's file sync exports.

  • delete?: boolean

    "Delete selected records" when the model declares delete and the viewer may delete (turns selection on). Default on.

  • select?: boolean

    Record checkboxes (Table and Board). Default: on for permitted bulk edits, deletes or selection actions.

  • new?: boolean | (() => void)

    The New button: the record sheet in create mode, or the author's own (a prefilled create). Default: the viewer may create.

  • controls?: Snippet

    A view-local control (a grouping, a lane toggle), placed before search. The page scope (entity, period) is AppShell's actions; never actions.

  • trailing?: Snippet

    Compact task controls at the right edge, before New.

  • context?: { readonly [field: string]: Json; }

    What the view is scoped to ({ company_id, period }), handed to the model's file syncs: the import, its template and the export decode it against the sync's context fields. It narrows and defaults; it never authorizes.

childrenSnippet<[readonly R[]]>

The custom view, over the rows the search, filter and sort leave.

empty?Snippet | false

No rows: the kit's EmptyState by default, this snippet instead, or false to draw the view empty (a calendar).

model?string

The model the view draws (a roster grid of roster_entry): its file syncs' import, template and export join the actions menu, scoped by toolbar.context.

Example

<CustomView {ctx} of={rows} fields={['name', 'team']} key="roster">
{#snippet children(shown)}<RosterGrid rows={shown} />{/snippet}
</CustomView>

Source: packages/ui/src/model/CustomView.svelte:1

behaviors

DRAG_THRESHOLD const

const DRAG_THRESHOLD: 4

Default movement threshold in CSS px before a press becomes a drag.

Source: packages/ui/src/behaviors/drag.svelte.ts:7

DateFieldBehavior type

type DateFieldBehavior = ReturnType<typeof create_date_field>;

Return value of create_date_field.

Members

NameTypeDescription
segmentsreadonly DateTimeSegment[]
segment_ref(part: SegmentPart) => Attachment<HTMLElement>
segment_attrs(seg: DateTimeSegment) => { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segmen…

Source: packages/ui/src/behaviors/date-time.svelte.ts:56

DateFieldOptions type

type DateFieldOptions = {
    /** Controlled `DateValue` getter. */
    readonly value: () => DateValue | undefined;
    /** Called when the complete date/time value changes (or clears to `undefined`). */
    readonly on_change: (next: DateValue | undefined) => void;
    /** Editing precision: `'day'` (date only), `'hour'` (date + hour), or `'minute'` (date + hour + minute). */
    readonly granularity?: () => 'day' | 'hour' | 'minute';
    /** BCP-47 locale for segment order and separators (default `'en-US'`). */
    readonly locale?: () => string | undefined;
    /** Disabled state. */
    readonly disabled?: () => boolean;
    /** Minimum allowed date value. */
    readonly min?: () => DateValue | undefined;
    /** Maximum allowed date value. */
    readonly max?: () => DateValue | undefined;
};

Options for create_date_field.

Members

NameTypeDescription
value() => DateValue | undefined

Controlled DateValue getter.

on_change(next: DateValue | undefined) => void

Called when the complete date/time value changes (or clears to undefined).

granularity?() => 'day' | 'hour' | 'minute'

Editing precision: 'day' (date only), 'hour' (date + hour), or 'minute' (date + hour + minute).

locale?() => string | undefined

BCP-47 locale for segment order and separators (default 'en-US').

disabled?() => boolean

Disabled state.

min?() => DateValue | undefined

Minimum allowed date value.

max?() => DateValue | undefined

Maximum allowed date value.

Source: packages/ui/src/behaviors/date-time.svelte.ts:38

DateTimeSegment type

type DateTimeSegment = {
    /** Segment type (`'year'`, `'month'`, `'day'`, `'hour'`, `'minute'`, or `'literal'`). */
    readonly part: SegmentPart;
    /** Displayed text (zero-padded value, placeholder token or separator). */
    readonly value: string;
    /** Whether the segment is currently showing its placeholder rather than a set value. */
    readonly placeholder: boolean;
};

One rendered segment of a segmented date or time field.

Members

NameTypeDescription
partSegmentPart

Segment type ('year', 'month', 'day', 'hour', 'minute', or 'literal').

valuestring

Displayed text (zero-padded value, placeholder token or separator).

placeholderboolean

Whether the segment is currently showing its placeholder rather than a set value.

Source: packages/ui/src/behaviors/date-time.svelte.ts:28

Debounced class

class Debounced<T> {
    #private;
    constructor(getter: () => T, wait?: number | (() => number));
    /** The latest settled value. */
    get current(): T;
    /** Immediately sets the value and cancels any pending debounce timer. */
    updateImmediately: (value: T) => void;
    /** Cancels any pending scheduled update. */
    cancel: () => void;
}

Reactive debounced value mirroring getter() after wait ms of inactivity.

Members

NameTypeDescription
#privateany
currentT

The latest settled value.

updateImmediately(value: T) => void

Immediately sets the value and cancels any pending debounce timer.

cancel() => void

Cancels any pending scheduled update.

Source: packages/ui/src/behaviors/reactive.svelte.ts:112

client

DescribeStep type

type DescribeStep = {
    readonly id: string;
    readonly label: string;
    readonly detail?: string;
    readonly status: 'running' | 'done' | 'error';
};

One live or completed step recorded while filter.describe builds a filter.

Members

NameTypeDescription
idstring
labelstring
detail?string
status'running' | 'done' | 'error'

Source: packages/ui/src/client/contract.ts:207

form

DescriptionHint component

component DescriptionHint(props: $$ComponentProps)

A field's description as an info button beside its label: a tap or click opens the text, never a paragraph under the control.

Props

NameTypeDescription
textstring

The description, opened in a popover and used as the button's label.

class?string

Extra classes on the button.

Source: packages/ui/src/form/description-hint.svelte:1

primitives

Dialog namespace

namespace Dialog

A modal dialog: Dialog.Root, its Trigger, and Content with a header, title, description and footer.

Source: packages/ui/src/primitives/dialog/index.ts:1

behaviors

Disclosure type

type Disclosure = ReturnType<typeof create_disclosure>;

Return value of create_disclosure.

Members

NameTypeDescription
openboolean
disabledboolean
state"open" | "closed"
set_open(next: boolean) => void
toggle() => void
show() => void
hide() => void
trigger_attrs() => { type: "button"; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; onclick: () => void; }

Spread onto the trigger button (type, aria-expanded, aria-controls, data-state, disabled, onclick).

content_attrs() => { id: string; hidden: boolean; "data-state": "open" | "closed"; }

Spread onto the collapsible content element (id, hidden, data-state).

Source: packages/ui/src/behaviors/disclosure.svelte.ts:21

DisclosureOptions type

type DisclosureOptions = {
    /** Controlled open state; omit for internal state. */
    open?: () => boolean;
    /** Initial open state when uncontrolled (default `false`). */
    default_open?: boolean;
    /** Called whenever the disclosure opens or closes. */
    on_open_change?: (open: boolean) => void;
    /** Whether interaction is disabled. */
    disabled?: () => boolean;
    /** Stable id prefix for `aria-controls`; auto-generated when omitted. */
    id?: string;
};

Options for create_disclosure.

Members

NameTypeDescription
open?() => boolean

Controlled open state; omit for internal state.

default_open?boolean

Initial open state when uncontrolled (default false).

on_open_change?(open: boolean) => void

Called whenever the disclosure opens or closes.

disabled?() => boolean

Whether interaction is disabled.

id?string

Stable id prefix for aria-controls; auto-generated when omitted.

Source: packages/ui/src/behaviors/disclosure.svelte.ts:7

DismissLayer type

type DismissLayer = ReturnType<typeof create_dismiss>;

Return value of create_dismiss.

Members

NameTypeDescription
depthnumber
topmostboolean
surfaceAttachment<HTMLElement>

Source: packages/ui/src/behaviors/dismiss.svelte.ts:24

DismissOptions type

type DismissOptions = {
    /** Whether this layer is currently active/open. */
    open: () => boolean;
    /** Called when the topmost layer should close. */
    on_dismiss: (reason: DismissReason, event: KeyboardEvent | PointerEvent) => void;
    /** Close on Escape key (default `true`). */
    escape?: boolean | (() => boolean);
    /** Close on pointerdown outside the attached surface (default `true`). */
    outside?: boolean | (() => boolean);
    /** Extra elements treated as inside (e.g. an anchor trigger button). */
    ignore?: () => readonly (Element | null | undefined)[];
};

Options for create_dismiss.

Members

NameTypeDescription
open() => boolean

Whether this layer is currently active/open.

on_dismiss(reason: DismissReason, event: KeyboardEvent | PointerEvent) => void

Called when the topmost layer should close.

escape?boolean | (() => boolean)

Close on Escape key (default true).

outside?boolean | (() => boolean)

Close on pointerdown outside the attached surface (default true).

ignore?() => readonly (Element | null | undefined)[]

Extra elements treated as inside (e.g. an anchor trigger button).

Source: packages/ui/src/behaviors/dismiss.svelte.ts:10

DismissReason type

type DismissReason = 'escape' | 'outside';

Why a dismissible layer was closed ('escape' or 'outside').

Source: packages/ui/src/behaviors/dismiss.svelte.ts:7

DragPreviewOptions type

type DragPreviewOptions = {
    /** Reactive active drag coordinates (`null` when not dragging). */
    readonly point: () => {
        readonly x: number;
        readonly y: number;
    } | null;
    /** Offset in px relative to pointer (default `{ x: 12, y: 12 }`). */
    readonly offset?: {
        readonly x: number;
        readonly y: number;
    };
};

Options for bind_drag_preview.

Members

NameTypeDescription
point() => { readonly x: number; readonly y: number; } | null

Reactive active drag coordinates (null when not dragging).

offset?{ readonly x: number; readonly y: number; }

Offset in px relative to pointer (default { x: 12, y: 12 }).

Source: packages/ui/src/behaviors/platform.svelte.ts:294

primitives

Drawer component

component Drawer(props: DrawerProps)

The mobile navigation drawer: a Sheet (the phone's bottom drawer, a left panel on a wide screen) that closes when the route changes. It has no header: the navigation, flush to its edges in the sidebar's one tone, is the whole drawer.

Props

NameTypeDescription
title?string

The heading and accessible name; a record view inside that claims the header names the dialog when this is absent.

childrenSnippet

The body, scrolled below the header.

memory?string

What its dragged width and full-screen state are remembered under, in this browser: a record's sheet passes its model, so every record of that model opens as the last one was left. Default: title, else one shared name.

header?Snippet

Replaces the heading (a record label with badges); the close button stays.

class?string

Classes on the panel.

open?boolean

Whether it shows; bindable.

on_open_change?(open: boolean) => void

Called with false once a close the sheet itself asked for (scrim, Escape, close button, drag) has animated out.

actions?Snippet

Header content beside the close button (record actions).

pathstring

The current route (pathname + search); the drawer closes when it changes.

Source: packages/ui/src/primitives/sheet/drawer.svelte:1

behaviors

DrawerBehavior type

type DrawerBehavior = ReturnType<typeof create_drawer>;

Return value of create_drawer.

Members

NameTypeDescription
openboolean
draggingboolean
offsetnumber
snap_indexnumber
snap_fractionnumber
set_open(next: boolean) => void
set_snap(idx: number) => void
surfaceAttachment<HTMLElement>
handleAttachment<HTMLElement>
surface_attrs() => { role: "dialog"; "aria-modal": true | undefined; "aria-label": string | undefined; "data-side": DrawerSide; "data-dragging": string | undefined; "data-state": "open" | "closed"; style: string | undefined; }

Source: packages/ui/src/behaviors/motion.svelte.ts:122

DrawerOptions type

type DrawerOptions = {
    /** Controlled open state; omit for internal state. */
    readonly open?: () => boolean;
    /** Called when open state changes. */
    readonly on_open_change?: (open: boolean) => void;
    /** Edge the drawer slides from (default `'bottom'`). */
    readonly side?: DrawerSide;
    /** Fractional snap points in `(0, 1]` (default `[1]`, e.g. `[0.4, 0.9]`). */
    readonly snap_points?: readonly number[];
    /** Active snap point index (0-based). */
    readonly active_snap?: () => number;
    /** Called when the active snap point changes. */
    readonly on_snap_change?: (index: number) => void;
    /** Whether dragging past the dismissal threshold closes the drawer (default `true`). */
    readonly dismissible?: boolean;
    /** Trap focus and mark background inert while open (default `true`). */
    readonly modal?: boolean;
    /** Accessible label for the drawer surface. */
    readonly label?: string;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_drawer.

Members

NameTypeDescription
open?() => boolean

Controlled open state; omit for internal state.

on_open_change?(open: boolean) => void

Called when open state changes.

side?DrawerSide

Edge the drawer slides from (default 'bottom').

snap_points?readonly number[]

Fractional snap points in (0, 1] (default [1], e.g. [0.4, 0.9]).

active_snap?() => number

Active snap point index (0-based).

on_snap_change?(index: number) => void

Called when the active snap point changes.

dismissible?boolean

Whether dragging past the dismissal threshold closes the drawer (default true).

modal?boolean

Trap focus and mark background inert while open (default true).

label?string

Accessible label for the drawer surface.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/motion.svelte.ts:98

DrawerSide type

type DrawerSide = 'bottom' | 'top' | 'left' | 'right';

Side from which a swipeable drawer slides in.

Source: packages/ui/src/behaviors/motion.svelte.ts:95

kinds

Editor component

component Editor(props: EditorProps)

The editor of one value by its field kind: every kind's input in one component (derived kinds read-only).

Derived and state values are never typed (a state moves by its transitions); an enum with declared transitions offers only the current state and its next ones; a relation with several targets picks the target model first and writes { model, id }. Cleared text writes null.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
kindKind

The field's kind; it picks the input.

json_schema?JsonSchema

JSON Schema for a generated structured editor; omitted infers the stored structure.

  • $schema?: string
  • $ref?: string
  • type?: string | readonly string[]
  • format?: string
  • title?: string
  • description?: string
  • unit?: string
  • properties?: Readonly<Record<string, JsonSchema>>
  • additionalProperties?: JsonSchema
  • required?: readonly string[]
  • items?: JsonSchema
  • prefixItems?: readonly JsonSchema[]
  • allOf?: readonly JsonSchema[]
  • anyOf?: readonly JsonSchema[]
  • oneOf?: readonly JsonSchema[]
  • if?: JsonSchema
  • then?: JsonSchema
  • else?: JsonSchema
  • not?: JsonSchema
  • enum?: readonly Json[]
  • const?: Json
  • default?: Json
  • readOnly?: boolean
  • minimum?: number
  • maximum?: number
  • exclusiveMinimum?: number
  • exclusiveMaximum?: number
  • minLength?: number
  • maxLength?: number
  • minItems?: number
  • maxItems?: number
  • minProperties?: number
  • maxProperties?: number
  • x-norbital?: { readonly datatype?: string; readonly section?: string; readonly advanced?: boolean; readonly order?: number; }
raw_json?boolean

Edit an untyped value as source JSON, retaining invalid text until it parses.

valueValue

The current value; null when empty.

on_change(next: Value) => void

Called with the next value on every edit; the parent owns the state.

namestring

The field's name (file uploads, custom renderers) and the dotted path errors are keyed by.

id?string

The id on the input, for <label for>.

labelledby?string

The label naming a control that has no single input to point at (a group of boxes).

readonly?boolean

Shows the value as copyable text (Show); an enclosing readonly Form or Field sets it.

disabled?boolean

The editor stays, muted and inert; an enclosing disabled Form or Field sets it.

errors?ReadonlyMap<string, string>

Problems by dotted path under name (lines.0.amount), as a refusal or decode reports them.

row?{ readonly [f: string]: Value; }

The row being edited: a money field's currency sibling.

address?string

A point field's address sibling: its name in row (shown in the search box) and the writer of what is typed or found.

on_address?((address: string | null) => void) | undefined

Called with the address a point field's search typed or found; omitted leaves the address unwritten.

relation?{ targets: readonly string[]; where?: Where | undefined; }

One-relation target(s), when kind is the FK column of a relationship.

  • targets: readonly string[]
  • where?: Where | undefined

Example

```svelte
<Editor {ctx} kind={{ kind: 'date' }} name="start" value={start} on_change={(next) => (start = next)} />
```

Source: packages/ui/src/kinds/editor.svelte:1

primitives

EmptyState component

component EmptyState(props: $$ComponentProps)

A view's empty, no-access or failed state: an icon, a title, a hint and the way forward. size="fill" centres it in the space left in its parent.

Props

NameTypeDescription
titlestring

The heading: what is empty or what went wrong.

hint?string

A line below the title: why, or what to do.

icon?GlyphName

The glyph above the title; default inbox.

tone?'muted' | 'danger'

danger colours it destructive and announces it as an alert (else a status).

variant?'page' | 'inset' | 'card'

card draws its own bordered card; page and inset sit on the surrounding surface.

size?LayoutSize

fill centres it in the space left in its parent; default content (at least 12rem tall).

children?Snippet

The way forward: actions centred below the hint.

read?string

The data-read state it reports to readers and tests; default empty.

Source: packages/ui/src/primitives/empty-state/EmptyState.svelte:1

behaviors

EnterKeyHint type

type EnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';

Label shown on mobile virtual keyboard Return keys (enterkeyhint).

Source: packages/ui/src/behaviors/micro.svelte.ts:432

event-calendar

EventCalendar component

component EventCalendar(props: EventCalendarProps)

Events on a day, week or month grid: timed boxes, all-day bars, month pills; dragging creates, moves and resizes, and the caller writes the change. In a narrow container the month is a grid of days with a dot per event over the chosen day's events in full, and the week is a strip of days over the chosen day. Under touch a finger scrolls: a tap opens an event or creates in a slot.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
eventsreadonly CalendarEvent[]

The events shown; after a create or move, pass the updated list back.

view?CalendarView

The initial view. Default 'week'; the viewer's switch fires on_view_change.

views?readonly CalendarView[]

The views the switcher offers (hidden when only one). Default day, week and month.

date?Date

The day shown first; navigation moves away from it until it changes.

start_hour?number

The time grid's first hour. Default 0.

end_hour?number

The time grid's end hour (exclusive). Default 24.

hour_height?number

Pixels per hour on the time grid.

snap_minutes?number

Drags snap to this many minutes. Default 15.

col_width?number

The narrowest a week column gets before the grid scrolls sideways.

readonly?boolean

No creating, moving or resizing; clicks still open events. Default false.

on_view_change?((view: CalendarView) => void) | undefined

The viewer switched views.

on_date_change?((date: Date) => void) | undefined

The viewer navigated (previous, next, today, or a day picked in the narrow layouts).

on_event_click?((event: CalendarEvent) => void) | undefined

An event was clicked or tapped.

on_event_create?((slot: CreateSlot) => void) | undefined

A drag (or tap, under touch) on empty grid selected this slot.

on_event_move?((event: CalendarEvent, start: Date, end: Date) => void) | undefined

An event was moved or resized to start–end; the calendar does not write it.

event_content?Snippet<[CalendarEvent, EventRenderContext]>

An event's body in place of its title (and time, on a box).

actions?Snippet

Connection or other calendar actions beside the displayed date.

Source: packages/ui/src/event-calendar/event-calendar.svelte:1

form

Field component

component Field(props: FieldProps)

One field of the enclosing Form by name: its label, help, the kind's editor (or an editor snippet) and its error. Readonly, it is a label over the value as copyable text (or a view snippet): no field chrome, and no editor snippet.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
namestring

The field's exposed name in the enclosing Form's model.

label?string | undefined

The label. Default: the field's catalogue label.

help?string

The field's description: an info button beside the label, never text under the control.

editor?Snippet<[FieldEditor]>

A custom editor in place of the kind's, given the value, an on_change and the label's id; unused while readonly.

view?Snippet<[FieldView]>

Renders the value when the field is readonly, in place of the kind's display (a value shaped by another record's schema, say).

address?string

A point field only: the text field its geocoded address is written to.

wide?boolean

Spans its grid's whole row. Default: a structured, long or custom-datatype field does.

readonly?boolean

true keeps this field read-only while its Form edits (shown as its value, never saved from here): <Field name="reference" readonly />. It only adds: false never lifts an enclosing readonly form, and a field the viewer cannot write (no update grant, a state lock) is readonly whatever this says.

disabled?boolean

Overrides the enclosing Form: the editor stays, muted and inert.

dense?true

A table cell keeps its accessible field name while the column heading supplies its visible label.

Example

<Field {ctx} name="email" />

Source: packages/ui/src/form/field.svelte:1

behaviors

FieldBehavior type

type FieldBehavior = ReturnType<typeof create_field>;

Return value of create_field.

Members

NameTypeDescription
idstring
invalidboolean
errorstring | undefined
label_attrs() => { for: string; "data-required": string | undefined; "data-invalid": string | undefined; "data-disabled": string | undefined; }
control_attrs() => { id: string; "aria-describedby": string | undefined; "aria-invalid": true | undefined; "aria-required": true | undefined; disabled: true | undefined; readonly: true | undefined; }
description_attrs() => { id: string; }
error_attrs() => { id: string; role: "alert"; }

Source: packages/ui/src/behaviors/field.svelte.ts:23

FieldBehaviorOptions type

type FieldBehaviorOptions = {
    /** Optional stable id prefix; auto-generated when omitted. */
    id?: string;
    /** Whether a helper description element is rendered. */
    has_description?: () => boolean;
    /** Current validation error message (non-empty marks the control invalid). */
    error?: () => string | undefined | null;
    /** Whether the field is required. */
    required?: () => boolean;
    /** Whether the field is disabled. */
    disabled?: () => boolean;
    /** Whether the field is read-only. */
    readonly?: () => boolean;
};

Options for create_field.

Members

NameTypeDescription
id?string

Optional stable id prefix; auto-generated when omitted.

has_description?() => boolean

Whether a helper description element is rendered.

error?() => string | undefined | null

Current validation error message (non-empty marks the control invalid).

required?() => boolean

Whether the field is required.

disabled?() => boolean

Whether the field is disabled.

readonly?() => boolean

Whether the field is read-only.

Source: packages/ui/src/behaviors/field.svelte.ts:7

form

FieldControl component

component FieldControl(props: $$ComponentProps)

A field's label, help, required and dirty marks and error around its control.

Props

NameTypeDescription
idstring

The control's element id, which the label names.

labelstring

The field's label.

help?string

A hint beside the label, shown when there is no error.

error?string

The field's error, shown in place of help.

readonly?boolean

A value shown, not edited: no required or dirty mark, the label names a group.

required?boolean

Marks the label as required.

dirty?boolean

The draft differs from what the form opened with (the row, else the defaults).

dense?boolean

A compact row (a grid's or inspector's): tighter spacing and no hint.

childrenSnippet

The control.

Source: packages/ui/src/form/field-control.svelte:1

FieldEditor type

type FieldEditor = {
    value: Value;
    kind: Kind;
    name: string;
    disabled: boolean;
    error?: string;
    on_change(next: Value): void;
    /** The id the field's label points at: give it to the control the snippet renders, so it is named by the label. */
    id: string;
    /** The enclosing form: a custom editor reads sibling fields (a schema version, a currency) through it. */
    form: FormState;
};

What a Field editor snippet receives: the field's value and kind, typed by context in the generated alias.

Members

NameTypeDescription
valueValue
kindKind
namestring
disabledboolean
error?string
on_change(next: Value) => void
idstring

The id the field's label points at: give it to the control the snippet renders, so it is named by the label.

formFormState

The enclosing form: a custom editor reads sibling fields (a schema version, a currency) through it.

Source: packages/ui/src/form/field.svelte:14

FieldView type

type FieldView = Pick<FieldEditor, 'value' | 'kind' | 'name' | 'id'>;

What a Field view snippet receives.

Members

NameTypeDescription
valueValue
kindKind
namestring
idstring

The id the field's label points at: give it to the control the snippet renders, so it is named by the label.

Source: packages/ui/src/form/field.svelte:27

lang

Fields type

type Fields = {
    readonly [name: string]: Kind;
};

Named kinds: an object's, an input's or a custom field's fields.

Source: packages/store/src/lang/kind.ts:198

behaviors

FileDropzone type

type FileDropzone = ReturnType<typeof create_file_dropzone>;

Return value of create_file_dropzone.

Members

NameTypeDescription
draggingboolean
disabledboolean
open() => void
process(list: FileList | readonly File[]) => void
zoneAttachment<HTMLElement>
inputAttachment<HTMLInputElement>
input_attrs() => { type: "file"; accept: string | undefined; multiple: boolean | undefined; disabled: true | undefined; onchange: (event: Event) => void; }

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:740

FileDropzoneOptions type

type FileDropzoneOptions = {
    /** Accepted MIME types or extensions (e.g. `['image/*', '.pdf']`). */
    readonly accept?: readonly string[];
    /** Maximum file size in bytes. */
    readonly max_bytes?: number;
    /** Maximum number of files accepted in one drop/selection (default unlimited). */
    readonly max_files?: number;
    /** Disabled state. */
    readonly disabled?: () => boolean;
    /** Called with validated accepted and rejected files. */
    readonly on_files: (result: {
        readonly accepted: readonly File[];
        readonly rejected: readonly RejectedFile[];
    }) => void;
};

Options for create_file_dropzone.

Members

NameTypeDescription
accept?readonly string[]

Accepted MIME types or extensions (e.g. ['image/*', '.pdf']).

max_bytes?number

Maximum file size in bytes.

max_files?number

Maximum number of files accepted in one drop/selection (default unlimited).

disabled?() => boolean

Disabled state.

on_files(result: { readonly accepted: readonly File[]; readonly rejected: readonly RejectedFile[]; }) => void

Called with validated accepted and rejected files.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:726

kinds

FileInput component

component FileInput(props: FileInputProps)

A file field's input, the height of a text input: "Add file(s)" when empty, else the files as chips (each opening its preview, Download and Remove) and a "+" while there is room. Uploads go through the host first (accept and size checked; the limits are the trigger's hint); files dropped anywhere on the field upload too.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
kindKindOf<'file'>

The file kind: its accept list and max size; many allows up to 20 files.

  • storage?: 'int64'
  • many?: true
  • min_items?: number
  • max_items?: number
  • key?: string
  • optional?: true
  • default?: Json
  • label?: string
  • help?: string
  • hidden?: true
  • was?: string

    The name this field had before: a migration renames the column instead of dropping it.

  • kind: 'file'
  • accept: readonly `${string}/${string}`[]
  • max: `${bigint}${'KiB' | 'MiB' | 'GiB' | 'KB' | 'MB' | 'GB'}`
valueValue

The uploaded file ref, or a list of refs when many.

on_change(next: Value) => void

Called with the next ref(s) once an upload finishes or a file is removed.

on_pending_change?((pending: boolean) => void) | undefined

Standalone request forms keep submit disabled while bytes are uploading.

namestring

The field name the upload is checked against.

id?string

The id on the trigger, for <label for>.

disabled?boolean

Blocks uploads and removal.

invalid?boolean

Marks the field invalid.

Source: packages/ui/src/kinds/file-input.svelte:1

filter

FilterEditor component

component FilterEditor(props: FilterEditorProps)

Edits a saved native filter (where and order_by) of one model, apart from any table's viewer preferences and URL.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
modelstring

The model the filter reads.

value?FilterValue

The saved filter; a filter the editor cannot represent is shown as JSON with a Replace button.

  • where?: Json
  • order_by?: Json
readonly?boolean

Shows the filter without editing it. Default false.

variables?FilterVariables

The variables a condition may hold in place of a value, and their validation; default the requestor and clock variables.

  • presets: readonly string[]
  • validate: (text: string, position: Resolved, op: Op) => string | undefined
on_change?((value: FilterValue) => void) | undefined

Each edit: the whole new filter (where and order_by, either omitted when empty).

Source: packages/ui/src/filter/FilterEditor.svelte:1

FilterValue type

type FilterValue = {
    readonly where?: Json;
    readonly order_by?: Json;
};

A saved native filter, independent of a table's viewer preferences and URL.

Members

NameTypeDescription
where?Json
order_by?Json

Source: packages/ui/src/filter/FilterEditor.svelte:10

FilterVariables type

type FilterVariables = {
    readonly presets: readonly string[];
    validate(text: string, position: Resolved, op: Op): string | undefined;
};

A rule-owned expression scope for a saved filter. The owner checks and resolves these variables before querying; ordinary toolbar filters continue to use the requestor and clock scope.

Members

NameTypeDescription
presetsreadonly string[]
validate(text: string, position: Resolved, op: Op) => string | undefined

Source: packages/ui/src/filter/operators.ts:162

behaviors

FindableOptions type

type FindableOptions = {
    /** Whether the panel is currently open/visible. */
    readonly open: () => boolean;
    /** Whether closed content remains findable via browser Ctrl/Cmd+F (default `true`). */
    readonly findable?: () => boolean;
    /** Called when browser find-in-page matches text inside the closed panel (`beforematch`). */
    readonly on_reveal: (event: Event) => void;
};

Options for bind_findable.

Members

NameTypeDescription
open() => boolean

Whether the panel is currently open/visible.

findable?() => boolean

Whether closed content remains findable via browser Ctrl/Cmd+F (default true).

on_reveal(event: Event) => void

Called when browser find-in-page matches text inside the closed panel (beforematch).

Source: packages/ui/src/behaviors/presence.svelte.ts:217

FlatTreeRow type

type FlatTreeRow<T = unknown> = {
    readonly id: string;
    readonly label: string;
    readonly depth: number;
    readonly parent: string | null;
    readonly expandable: boolean;
    readonly expanded: boolean;
    readonly disabled: boolean;
    readonly node: TreeNode<T>;
};

Flattened visible row produced by create_tree with depth and expansion state.

Members

NameTypeDescription
idstring
labelstring
depthnumber
parentstring | null
expandableboolean
expandedboolean
disabledboolean
nodeTreeNode<T>

Source: packages/ui/src/behaviors/tree.svelte.ts:19

Floating type

type Floating = ReturnType<typeof create_floating>;

Return value of create_floating.

Members

NameTypeDescription
xnumber
ynumber
sideFloatingSide
anchor_widthnumber
available_widthnumber
available_heightnumber
positionedboolean
stylestring
set_anchor(next: FloatingAnchor | null) => void

Sets a programmatic element or virtual { x, y } / DOMRect anchor.

update() => void
anchorAttachment<HTMLElement>
contentAttachment<HTMLElement>

Source: packages/ui/src/behaviors/floating.svelte.ts:57

FloatingAlign type

type FloatingAlign = 'start' | 'center' | 'end';

Cross-axis alignment relative to the anchor edge.

Source: packages/ui/src/behaviors/floating.svelte.ts:10

FloatingAnchor type

type FloatingAnchor = HTMLElement | VirtualAnchor;

Either a live DOM element or a virtual point/rectangle anchor.

Source: packages/ui/src/behaviors/floating.svelte.ts:28

FloatingOptions type

type FloatingOptions = {
    /** Whether the floating surface is open. */
    readonly open: () => boolean;
    /** Called when Escape or an outside pointer press dismisses the surface. */
    readonly on_dismiss?: (reason: DismissReason) => void;
    /** Optional reactive anchor element or virtual anchor getter. */
    readonly anchor?: () => FloatingAnchor | null;
    /** Preferred side relative to the anchor (default `'bottom'`). */
    readonly side?: FloatingSide | (() => FloatingSide);
    /** Cross-axis alignment relative to the anchor (default `'center'`). */
    readonly align?: FloatingAlign | (() => FloatingAlign);
    /** Gap between anchor and floating surface in px (default `4`). */
    readonly side_offset?: number | (() => number);
    /** Shift along the cross axis in px (default `0`). */
    readonly align_offset?: number | (() => number);
    /** Viewport edge padding in px (default `8`). */
    readonly padding?: number | (() => number);
    /** Flip to the opposite side when viewport room is insufficient (default `true`). */
    readonly flip?: boolean | (() => boolean);
    /** Close on Escape key (default `true`). */
    readonly escape?: boolean | (() => boolean);
    /** Close on outside pointer press (default `true`). */
    readonly outside?: boolean | (() => boolean);
};

Options for create_floating.

Members

NameTypeDescription
open() => boolean

Whether the floating surface is open.

on_dismiss?(reason: DismissReason) => void

Called when Escape or an outside pointer press dismisses the surface.

anchor?() => FloatingAnchor | null

Optional reactive anchor element or virtual anchor getter.

side?FloatingSide | (() => FloatingSide)

Preferred side relative to the anchor (default 'bottom').

align?FloatingAlign | (() => FloatingAlign)

Cross-axis alignment relative to the anchor (default 'center').

side_offset?number | (() => number)

Gap between anchor and floating surface in px (default 4).

align_offset?number | (() => number)

Shift along the cross axis in px (default 0).

padding?number | (() => number)

Viewport edge padding in px (default 8).

flip?boolean | (() => boolean)

Flip to the opposite side when viewport room is insufficient (default true).

escape?boolean | (() => boolean)

Close on Escape key (default true).

outside?boolean | (() => boolean)

Close on outside pointer press (default true).

Source: packages/ui/src/behaviors/floating.svelte.ts:31

FloatingSide type

type FloatingSide = 'top' | 'bottom' | 'left' | 'right';

Preferred side of the anchor where the floating surface opens.

Source: packages/ui/src/behaviors/floating.svelte.ts:8

FocusRecovery type

type FocusRecovery<T = unknown> = ReturnType<typeof create_focus_recovery<T>>;

Return value of create_focus_recovery.

Members

NameTypeDescription
item(key: string, data?: T) => Attachment<HTMLElement>

Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:23

FocusRecoveryOptions type

type FocusRecoveryOptions<T = unknown> = {
    /** Returns the next element to focus when a bound item unmounts with focus, or null/undefined. */
    readonly fallback: (lost: LostFocus<T>) => HTMLElement | null | undefined;
};

Options for create_focus_recovery.

Members

NameTypeDescription
fallback(lost: LostFocus<T>) => HTMLElement | null | undefined

Returns the next element to focus when a bound item unmounts with focus, or null/undefined.

Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:17

FocusTrap type

type FocusTrap = ReturnType<typeof create_focus_trap>;

Return value of create_focus_trap.

Members

NameTypeDescription
containerAttachment<HTMLElement>

Source: packages/ui/src/behaviors/focus-trap.svelte.ts:48

FocusTrapOptions type

type FocusTrapOptions = {
    /** Whether focus trapping is active. */
    readonly active: () => boolean;
    /** Automatically move focus into the container when activated (default `true`). */
    readonly auto_focus?: boolean | (() => boolean);
    /** Restore focus to the previously active element on close (default `true`). */
    readonly restore_focus?: boolean | (() => boolean);
    /** Keep Tab / focusin strictly contained inside the container (default `true`). */
    readonly trap?: boolean | (() => boolean);
    /** Mark background siblings `inert` while active (default `false`; set `true` on modal dialogs). */
    readonly modal?: boolean | (() => boolean);
    /** Apply ref-counted document scroll lock while active (default `false`). */
    readonly prevent_scroll?: boolean | (() => boolean);
    /** Optional predicate gating focus-trap listeners to only the topmost stacked layer. */
    readonly topmost?: () => boolean;
    /** Cancelable hook invoked before initial autofocus runs. */
    readonly on_open_auto_focus?: (event: Event) => void;
    /** Cancelable hook invoked before focus returns to the previous element on close. */
    readonly on_close_auto_focus?: (event: Event) => void;
    /** Called when focus escapes outside the container while active. */
    readonly on_focus_outside?: (event: FocusEvent) => void;
};

Options for create_focus_trap.

Members

NameTypeDescription
active() => boolean

Whether focus trapping is active.

auto_focus?boolean | (() => boolean)

Automatically move focus into the container when activated (default true).

restore_focus?boolean | (() => boolean)

Restore focus to the previously active element on close (default true).

trap?boolean | (() => boolean)

Keep Tab / focusin strictly contained inside the container (default true).

modal?boolean | (() => boolean)

Mark background siblings inert while active (default false; set true on modal dialogs).

prevent_scroll?boolean | (() => boolean)

Apply ref-counted document scroll lock while active (default false).

topmost?() => boolean

Optional predicate gating focus-trap listeners to only the topmost stacked layer.

on_open_auto_focus?(event: Event) => void

Cancelable hook invoked before initial autofocus runs.

on_close_auto_focus?(event: Event) => void

Cancelable hook invoked before focus returns to the previous element on close.

on_focus_outside?(event: FocusEvent) => void

Called when focus escapes outside the container while active.

Source: packages/ui/src/behaviors/focus-trap.svelte.ts:24

form

Form component

component Form(props: FormProps<S>)

Edits a model row or an automation's input from authorized metadata: permitted fields only, drafts kept until the outcome, only changed values sent. Defaults, required checks, state moves and approval routing come from the declaration; a save routed to approval answers a held outcome that the native approval panel decides, so add no second approval control and repeat no declared default.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofS

What it edits: a model handle, or { automation } for an automation's input (a submit queues a run).

mode?'view' | 'edit' | 'create' | 'update'

create inserts; update/edit save the row id; view is readonly. Default: update with a model id, else create.

id?S extends string ? IdOf<S> : never

The row a model update edits.

record?(S extends string ? RecordOf<S> : never) | null

The stored row, when the page already reads it; else the enclosing RecordShell's shown row (the scrubbed revision while one is picked) when it is this record, else the form reads it once.

values?S extends { automation: infer A; } ? Partial<AutomationInputOf<A>> : Partial<InsertOf<S>>

Create and automation forms start from these direct input values over the defaults.

fields?readonly (S extends { automation: infer A; } ? keyof AutomationInputOf<A> & string : RecordFieldOf<S>)[]

A subset and order of the generated fields.

sections?readonly RecordSection[]

The generated fields grouped into collapsible Sections, in order; fields no section lists follow, untitled.

submit?string

The submit button's label; default the create/save word.

readonly?boolean

Every field shows its value as copyable text, no field chrome, and no submit: the form as a view of the row. It reaches every Field and input beneath through context (a Field may override it). An update the viewer cannot make (no update grant) is readonly whatever this says. A form never inherits an outer mode.

disabled?boolean

Every field stays an editor, muted and inert, and the submit is disabled; a Field may override it.

on_outcome?((outcome: Outcome) => void) | undefined

An automation reports queue admission here; its retained run is followed separately by RunStatus.

on_reset?(() => void) | undefined

Clears the view's external drafts when Cancel or Clear resets this form.

confirm?FormConfirm

Asks before a valid draft saves: the dialog to show for this change, or null to save without asking.

validate?(values: Readonly<Record<string, Value>>) => readonly SemanticIssue[]

Pure semantic checks over the draft. Reuse this validator in the server's guarded write.

children?Snippet<[FormState]>

The page's own layout of Fields, given the FormState; without it every permitted field renders in order.

editors?{ readonly [field: string]: Snippet<[FieldEditor]>; }

The generated fields' own editors by field name, in place of their kinds' (Field editor).

viewers?{ readonly [field: string]: Snippet<[FieldView]>; }

The generated fields' own readonly views by field name, in place of their kinds' (Field view).

actions?Snippet<[FormState]>

Extra buttons beside submit.

acts?() => Readonly<Record<string, readonly Value[]>>

Other writes the view's own editors leave ({ 'jurisdiction_change.create': rows }), committed in this form's act by its one Save, which they enable while any is pending. A view has one Save: never give a section its own.

size?LayoutSize

fill (default): the height left in its parent, its fields scrolling inside; content: its own height.

Example

<Form {ctx} of="invoice" id={row.id} fields={['customer', 'due_on']} />

Source: packages/ui/src/form/form.svelte:1

FormProps type

type FormProps<S = FormSource> = {
    /** The page context (`ctx`), passed whole. */
    ctx: UiContext;
    /** What it edits: a model handle, or `{ automation }` for an automation's input (a submit queues a run). */
    of: S;
    /** `create` inserts; `update`/`edit` save the row `id`; `view` is `readonly`. Default: `update` with a model `id`, else `create`. */
    mode?: 'view' | 'edit' | 'create' | 'update';
    /** The row a model update edits. */
    id?: S extends string ? IdOf<S> : never;
    /** The stored row, when the page already reads it; else the enclosing `RecordShell`'s shown row (the scrubbed revision while one is picked) when it is this record, else the form reads it once. */
    record?: (S extends string ? RecordOf<S> : never) | null;
    /** Create and automation forms start from these direct input values over the defaults. */
    values?: S extends {
        automation: infer A;
    } ? Partial<AutomationInputOf<A>> : Partial<InsertOf<S>>;
    /** A subset and order of the generated fields. */
    fields?: readonly (S extends {
        automation: infer A;
    } ? keyof AutomationInputOf<A> & string : RecordFieldOf<S>)[];
    /** The generated fields grouped into collapsible `Section`s, in order; fields no section lists follow, untitled. */
    sections?: readonly RecordSection[];
    /** The submit button's label; default the create/save word. */
    submit?: string;
    /**
     * Every field shows its value as copyable text, no field chrome, and no…

The props of Form: what it edits (of), create or update, the row id, and the layout of its fields.

Members

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

ofS

What it edits: a model handle, or { automation } for an automation's input (a submit queues a run).

mode?'view' | 'edit' | 'create' | 'update'

create inserts; update/edit save the row id; view is readonly. Default: update with a model id, else create.

id?S extends string ? IdOf<S> : never

The row a model update edits.

record?(S extends string ? RecordOf<S> : never) | null

The stored row, when the page already reads it; else the enclosing RecordShell's shown row (the scrubbed revision while one is picked) when it is this record, else the form reads it once.

values?S extends { automation: infer A; } ? Partial<AutomationInputOf<A>> : Partial<InsertOf<S>>

Create and automation forms start from these direct input values over the defaults.

fields?readonly (S extends { automation: infer A; } ? keyof AutomationInputOf<A> & string : RecordFieldOf<S>)[]

A subset and order of the generated fields.

sections?readonly RecordSection[]

The generated fields grouped into collapsible Sections, in order; fields no section lists follow, untitled.

submit?string

The submit button's label; default the create/save word.

readonly?boolean

Every field shows its value as copyable text, no field chrome, and no submit: the form as a view of the row. It reaches every Field and input beneath through context (a Field may override it). An update the viewer cannot make (no update grant) is readonly whatever this says. A form never inherits an outer mode.

disabled?boolean

Every field stays an editor, muted and inert, and the submit is disabled; a Field may override it.

on_outcome?((outcome: Outcome) => void) | undefined

An automation reports queue admission here; its retained run is followed separately by RunStatus.

on_reset?(() => void) | undefined

Clears the view's external drafts when Cancel or Clear resets this form.

confirm?FormConfirm

Asks before a valid draft saves: the dialog to show for this change, or null to save without asking.

validate?(values: Readonly<Record<string, Value>>) => readonly SemanticIssue[]

Pure semantic checks over the draft. Reuse this validator in the server's guarded write.

children?Snippet<[FormState]>

The page's own layout of Fields, given the FormState; without it every permitted field renders in order.

editors?{ readonly [field: string]: Snippet<[FieldEditor]>; }

The generated fields' own editors by field name, in place of their kinds' (Field editor).

viewers?{ readonly [field: string]: Snippet<[FieldView]>; }

The generated fields' own readonly views by field name, in place of their kinds' (Field view).

actions?Snippet<[FormState]>

Extra buttons beside submit.

acts?() => Readonly<Record<string, readonly Value[]>>

Other writes the view's own editors leave ({ 'jurisdiction_change.create': rows }), committed in this form's act by its one Save, which they enable while any is pending. A view has one Save: never give a section its own.

size?LayoutSize

fill (default): the height left in its parent, its fields scrolling inside; content: its own height.

Source: packages/ui/src/form/form.svelte:43

FormState class

class FormState {
    #private;
    spec: FormSpec;
    mode: "create" | "view" | "edit";
    base: Record<string, import("@norbital-ai/store").Json>;
    values: Record<string, import("@norbital-ai/store").Json>;
    errors: Map<string, string>;
    notice: Notice | null;
    /** The native automation start, whose run status is followed independently of queue admission. */
    run: RunHandle | null;
    pending: boolean;
    capabilities: RecordCapabilities | null | undefined;
    children: Record<string, readonly ChildOperation[]>;
    /** Native child controllers survive a custom body or historical snapshot unmounting. */
    child_forms: Map<string, FormState>;
    /** A draft restored from this browser's storage, so a page does not replace it with fresh defaults. */
    restored: boolean;
    /** Fields the row's state lock leaves read-only (advice; the host enforces). */
    locked: (field: string) => boolean;
    /** Other writes the view's edits leave (`{ 'model.verb': rows }`), sent in this form's act: one Save commits the view. */
    extra: () => Readonly<Record<string, readonly Value[]>>;
    readonly dirty: boolean;
    readonly row: Row;
    /** Every registered rule's current issues; kept apart from `errors` so fixing a value clears its issue at once. */
    readonly semantic_errors: readonly SemanticIssue[];
    /** Explicit check/refusal errors take precedence over semantic issues on the same field. */
    readonly field_errors: ReadonlyMap<string, string>;
…

The draft of one mounted Form: values, errors, notice and pending state, shared with its Fields; values survive a field unmounting.

Members

NameTypeDescription
#privateany
specFormSpec
mode"create" | "view" | "edit"
baseRecord<string, import("@norbital-ai/store").Json>
valuesRecord<string, import("@norbital-ai/store").Json>
errorsMap<string, string>
noticeNotice | null
runRunHandle | null

The native automation start, whose run status is followed independently of queue admission.

pendingboolean
capabilitiesRecordCapabilities | null | undefined
childrenRecord<string, readonly ChildOperation[]>
child_formsMap<string, FormState>

Native child controllers survive a custom body or historical snapshot unmounting.

restoredboolean

A draft restored from this browser's storage, so a page does not replace it with fresh defaults.

locked(field: string) => boolean

Fields the row's state lock leaves read-only (advice; the host enforces).

extra() => Readonly<Record<string, readonly Value[]>>

Other writes the view's edits leave ({ 'model.verb': rows }), sent in this form's act: one Save commits the view.

dirtyboolean
rowRow
semantic_errorsreadonly SemanticIssue[]

Every registered rule's current issues; kept apart from errors so fixing a value clears its issue at once.

field_errorsReadonlyMap<string, string>

Explicit check/refusal errors take precedence over semantic issues on the same field.

child_storage_key(relation: string, key: string) => string | undefined

The storage key for one child row's draft: the parent form's key, the relation and the row id.

child_seeds(relation: string) => readonly Row[]

The child rows a create form was opened with (the previous trial's pigments, say).

refresh(record: Row) => void

A view refreshes from the current row; editing keeps its original revision and draft.

prefill(values: Row) => void

A custom create body's presets fill untouched defaults once.

edit() => void
view() => void
field_dirty(name: string) => boolean

Whether this one field differs from what the form opened with (the row, else the defaults).

expect_capabilities(reset?: boolean) => void
can_submitboolean
can_saveboolean

Permission plus validity: Save stays disabled while any error or broken invariant remains.

add_validation(rule: () => readonly SemanticIssue[]) => () => void

Registers a synchronous invariant rule, re-evaluated reactively; returns its unregister.

semantic_error(field: string) => string | undefined

The first broken invariant's message for exactly this key.

resubmittingboolean

The row's request asks for changes and this draft is its requester's: saving resubmits it (Save reads "Resubmit").

requesting_approvalboolean
readable(field: string) => boolean
restrictions(field: string) => readonly RecordRestriction[]
get(name: string) => Value
id<C extends string>(name: string) => IdOf<C> | null
set(name: string, value: Value) => void
track<A, E extends Error>(work: Effect.Effect<A, E>) => Effect.Effect<A, E>

Holds a submit until work (an upload writing its ref into the draft) settles.

on_outcome(receive: (outcome: Outcome) => void) => () => void
on_reset(reset: () => void) => () => void
before_outcome(receive: (outcome: Outcome) => void) => () => void
before_submit(validate: () => Effect.Effect<boolean>) => () => void
confirm_submit(ask: () => Effect.Effect<boolean>) => () => void

Asked once the draft is valid, before it is sent: false (the person declined) sends nothing.

revisionnumber | undefined
queue_children(relation: string, operations: readonly ChildOperation[]) => void
validate() => boolean
prepare() => Effect.Effect<boolean>
accept(outcome: Outcome, sent?: Row) => void

A parent transaction settles the same native child draft without submitting it separately.

submit() => Effect.Effect<Outcome | null>

Sends the draft; the draft stays until the outcome settles it. Resolves null when nothing was sent.

reset() => void

Source: packages/ui/src/form/form-state.svelte.ts:84

behaviors

GridCell type

type GridCell = {
    readonly row: number;
    readonly col: number;
};

Zero-based (row, col) coordinate in a 2D grid.

Members

NameTypeDescription
rownumber
colnumber

Source: packages/ui/src/behaviors/grid.svelte.ts:9

GridFocus type

type GridFocus = ReturnType<typeof create_grid_focus>;

Return value of create_grid_focus.

Members

NameTypeDescription
activeGridCell | null
focus(cell: GridCell, shift?: boolean) => void
cell(cell: GridCell) => Attachment<HTMLElement>
grid_attrs() => { role: "grid"; "aria-rowcount": number; "aria-colcount": number; onkeydown: (event: KeyboardEvent) => void; }
cell_attrs(cell: GridCell) => { role: "gridcell"; "aria-rowindex": number; "aria-colindex": number; "aria-disabled": true | undefined; "data-active": string | undefined; tabindex: number | undefined; onfocus: () => void; }

Source: packages/ui/src/behaviors/grid.svelte.ts:41

GridFocusOptions type

type GridFocusOptions = {
    /** Total row count. */
    readonly rows: () => number;
    /** Total column count. */
    readonly cols: () => number;
    /** Controlled active cell; omit for internal state. */
    readonly active?: () => GridCell | null;
    /** Called whenever the active cell moves. */
    readonly on_move?: (cell: GridCell, details: {
        readonly from: GridCell | null;
        readonly shift: boolean;
    }) => void;
    /** Rows skipped by PageUp / PageDown (default `10`). */
    readonly page_size?: number | (() => number);
    /** Skip cells matching this predicate. */
    readonly disabled?: (cell: GridCell) => boolean;
    /** Scroll an unrendered virtualized cell into view before focusing. */
    readonly reveal?: (cell: GridCell) => void;
};

Options for create_grid_focus.

Members

NameTypeDescription
rows() => number

Total row count.

cols() => number

Total column count.

active?() => GridCell | null

Controlled active cell; omit for internal state.

on_move?(cell: GridCell, details: { readonly from: GridCell | null; readonly shift: boolean; }) => void

Called whenever the active cell moves.

page_size?number | (() => number)

Rows skipped by PageUp / PageDown (default 10).

disabled?(cell: GridCell) => boolean

Skip cells matching this predicate.

reveal?(cell: GridCell) => void

Scroll an unrendered virtualized cell into view before focusing.

Source: packages/ui/src/behaviors/grid.svelte.ts:23

HoldInput type

type HoldInput = 'mouse' | 'touch' | 'pen' | 'keyboard';

Input modality that started a hold gesture.

Source: packages/ui/src/behaviors/micro.svelte.ts:196

HoverCardBehavior type

type HoverCardBehavior = ReturnType<typeof create_hover_card>;

Return value of create_hover_card.

Members

NameTypeDescription
openboolean
presentboolean
floating{ readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }
set_open(next: boolean) => void
triggerAttachment<HTMLElement>
contentAttachment<HTMLElement>
trigger_attrs() => { "aria-expanded": boolean; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; onfocus: () => void; onblur: () => void; }
content_attrs() => { "data-state": "open" | "closed"; style: string; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:686

HoverCardOptions type

type HoverCardOptions = {
    readonly open?: () => boolean;
    readonly on_open_change?: (open: boolean) => void;
    readonly open_delay?: number;
    readonly close_delay?: number;
    readonly side?: FloatingSide;
    readonly align?: FloatingAlign;
    readonly group?: string;
};

Options for create_hover_card.

Members

NameTypeDescription
open?() => boolean
on_open_change?(open: boolean) => void
open_delay?number
close_delay?number
side?FloatingSide
align?FloatingAlign
group?string

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:675

HoverIntent type

type HoverIntent = ReturnType<typeof create_hover_intent>;

Return value of create_hover_intent.

Members

NameTypeDescription
enter(event?: PointerEvent, isTrigger?: boolean) => void
leave(event?: PointerEvent) => void
clear() => void
open_now() => void
close_now() => void

Source: packages/ui/src/behaviors/hover-intent.svelte.ts:116

HoverIntentOptions type

type HoverIntentOptions = {
    /** Trigger element getter. */
    readonly trigger: () => HTMLElement | null | undefined;
    /** Popup element getter. */
    readonly popup: () => HTMLElement | null | undefined;
    /** Whether the popup is currently open. */
    readonly open: () => boolean;
    /** Opens the popup. */
    readonly on_open: () => void;
    /** Closes the popup. */
    readonly on_close: () => void;
    /** Open delay in ms when cold (default `120`). */
    readonly open_delay?: number | (() => number);
    /** Close delay in ms after leaving the safe corridor (default `80`). */
    readonly close_delay?: number | (() => number);
    /** Shared warm-group key (default `'tooltip'`; pass `null` to opt out). */
    readonly group?: string | null;
    /** Warm window in ms during which sibling hovers open immediately (default `250`). */
    readonly warm_ms?: number;
    /** Allow pointer to travel into popup content without closing (default `true`). */
    readonly hoverable?: boolean | (() => boolean);
};

Options for create_hover_intent.

Members

NameTypeDescription
trigger() => HTMLElement | null | undefined

Trigger element getter.

popup() => HTMLElement | null | undefined

Popup element getter.

open() => boolean

Whether the popup is currently open.

on_open() => void

Opens the popup.

on_close() => void

Closes the popup.

open_delay?number | (() => number)

Open delay in ms when cold (default 120).

close_delay?number | (() => number)

Close delay in ms after leaving the safe corridor (default 80).

group?string | null

Shared warm-group key (default 'tooltip'; pass null to opt out).

warm_ms?number

Warm window in ms during which sibling hovers open immediately (default 250).

hoverable?boolean | (() => boolean)

Allow pointer to travel into popup content without closing (default true).

Source: packages/ui/src/behaviors/hover-intent.svelte.ts:92

HslaColor type

type HslaColor = {
    readonly h: number;
    readonly s: number;
    readonly l: number;
    readonly a: number;
};

HSLA color representation (h in 0..360, s,l in 0..100, a in 0..1).

Members

NameTypeDescription
hnumber
snumber
lnumber
anumber

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:789

HsvaColor type

type HsvaColor = {
    readonly h: number;
    readonly s: number;
    readonly v: number;
    readonly a: number;
};

HSVA color representation (h in 0..360, s,v in 0..100, a in 0..1).

Members

NameTypeDescription
hnumber
snumber
vnumber
anumber

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:797

primitives

Icon component

component Icon(props: $$ComponentProps)

An icon by Iconify name (lucide:users), or a Bolt concept's own icon (concept:approvals).

Props

NameTypeDescription
namestring

An Iconify name (lucide:users), a concept (concept:models), or an entity name from the icon registry (money) resolved to its icon.

class?string

Classes on the svg (size and colour).

Source: packages/ui/src/primitives/icon/icon-wrapper.svelte:1

Image component

component Image(props: ImageProps)

A native image with an animated pending mosaic and a short dissolve when ready. An absent src/srcset stays pending without requesting a placeholder. class reserves the outer span's size; image_class controls the image's fit. Native dimensions, responsive sources and loading attributes pass through; provide alt="" for decorative images.

Props

NameTypeDescription
altstring

Required alternative text; "" marks a decorative image.

image_class?HTMLImgAttributes['class']

Classes on the <img> itself (its fit); class sizes the outer span.

Source: packages/ui/src/primitives/image/image.svelte:1

behaviors

ImageCropperBehavior type

type ImageCropperBehavior = ReturnType<typeof create_image_cropper>;

Return value of create_image_cropper.

Members

NameTypeDescription
cropCropRect
zoomnumber
rotationnumber
mover{ readonly dragging: boolean; handle: Attachment<HTMLElement>; handle_attrs(): { tabindex: number; 'aria-label': string | undefined; 'data-dragging': string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }
resizer{ readonly dragging: boolean; handle_attrs: (mode: "x" | "y" | "xy", label?: string) => { role: "separator"; tabindex: number; 'aria-label': string | undefined; 'data-dragging': string | undefined; onpointerdown: (down: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; }
set_crop(next: CropRect) => void
set_zoom(next: number) => void
rotate(deg?: number) => void
pixel_crop(naturalWidth: number, naturalHeight: number) => { x: number; y: number; width: number; height: number; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1104

ImageCropperOptions type

type ImageCropperOptions = {
    readonly default_crop?: CropRect;
    readonly aspect?: () => number | undefined;
    readonly min_size?: number;
    readonly on_change?: (crop: CropRect, meta: {
        readonly zoom: number;
        readonly rotation: number;
    }) => void;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_image_cropper.

Members

NameTypeDescription
default_crop?CropRect
aspect?() => number | undefined
min_size?number
on_change?(crop: CropRect, meta: { readonly zoom: number; readonly rotation: number; }) => void
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1094

InertHandle type

type InertHandle = (() => void) & {
    /** Exempts an additional element (e.g. a popover portaled into `document.body`) while active. */
    readonly keep: (el: HTMLElement) => () => void;
};

Handle returned by inert_outside allowing portaled child popups to stay interactive.

Members

NameTypeDescription
keep(el: HTMLElement) => () => void

Exempts an additional element (e.g. a popover portaled into document.body) while active.

Source: packages/ui/src/behaviors/modal.svelte.ts:95

InlineEdit type

type InlineEdit = ReturnType<typeof create_inline_edit>;

Return value of create_inline_edit.

Members

NameTypeDescription
editingstring | null
draftstring
is_editing(id: string) => boolean
begin(id: string, reason: InlineEditReason, initial?: string, origin?: HTMLElement | null) => void
commit(reason?: InlineEditReason) => boolean
cancel(reason?: InlineEditReason) => void
inputAttachment<HTMLInputElement | HTMLTextAreaElement>
cell_attrs(id: string) => { "data-editing": string | undefined; ondblclick: (event: MouseEvent) => void; onkeydown: (event: KeyboardEvent) => void; }
input_attrs() => { value: string; oninput: (event: Event) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; }

Source: packages/ui/src/behaviors/grid.svelte.ts:387

InlineEditOptions type

type InlineEditOptions = {
    /** Reads the current text for `id` when editing starts. */
    readonly value: (id: string) => string;
    /** Persists the edited text; return `false` to keep editing (e.g. validation error). */
    readonly commit: (id: string, text: string, reason: InlineEditReason) => boolean | void;
    /** Optional disabled predicate per id. */
    readonly disabled?: (id: string) => boolean;
    /** Called when Tab commits so an enclosing grid can advance to the next/previous cell. */
    readonly on_tab?: (id: string, direction: 1 | -1) => void;
};

Options for create_inline_edit.

Members

NameTypeDescription
value(id: string) => string

Reads the current text for id when editing starts.

commit(id: string, text: string, reason: InlineEditReason) => boolean | void

Persists the edited text; return false to keep editing (e.g. validation error).

disabled?(id: string) => boolean

Optional disabled predicate per id.

on_tab?(id: string, direction: 1 | -1) => void

Called when Tab commits so an enclosing grid can advance to the next/previous cell.

Source: packages/ui/src/behaviors/grid.svelte.ts:375

InlineEditReason type

type InlineEditReason = 'edit-key' | 'type' | 'double-click' | 'enter-key' | 'escape-key' | 'focus-out' | 'tab-key' | 'imperative';

Why an inline edit started or finished.

Source: packages/ui/src/behaviors/grid.svelte.ts:364

primitives

Input component

component Input(props: Props)

A text input (every <input> type), bindable value. type="file" binds files (or on_files) instead: a file input's value is not writable. readonly (or an enclosing readonly form) shows the value as copyable text, no field chrome; disabled (or an enclosing disabled form) keeps the box, muted.

Props

NameTypeDescription
files?FileList | undefined | null

The chosen files of a type="file" input; bindable.

type?'file'

The input type; file binds files instead of value. The input type; default text. A readonly password or non-text type keeps its control, never shown as text.

on_files?(files: FileList | null) => void

Called with the chosen files of a type="file" input on each change.

ref?U | null

The rendered element; bindable (bind:ref).

Source: packages/ui/src/primitives/input/input.svelte:1

behaviors

InputHintKind type

type InputHintKind = 'search' | 'email' | 'tel' | 'url' | 'one-time-code' | 'numeric' | 'decimal' | 'name' | 'username' | 'current-password' | 'new-password' | 'postal-code' | 'message';

Supported semantic input hint presets.

Source: packages/ui/src/behaviors/micro.svelte.ts:435

InputHints type

type InputHints = {
    readonly inputmode?: 'search' | 'email' | 'tel' | 'url' | 'numeric' | 'decimal';
    readonly enterkeyhint?: EnterKeyHint;
    readonly autocomplete?: string;
    readonly autocapitalize?: 'none' | 'sentences' | 'words' | 'characters';
    readonly autocorrect?: 'on' | 'off';
    readonly spellcheck?: boolean;
};

HTML input hint attributes returned by input_hints.

Members

NameTypeDescription
inputmode?'search' | 'email' | 'tel' | 'url' | 'numeric' | 'decimal'
enterkeyhint?EnterKeyHint
autocomplete?string
autocapitalize?'none' | 'sentences' | 'words' | 'characters'
autocorrect?'on' | 'off'
spellcheck?boolean

Source: packages/ui/src/behaviors/micro.svelte.ts:451

InputHistory type

type InputHistory<T = string> = ReturnType<typeof create_input_history<T>>;

Return value of create_input_history.

Members

NameTypeDescription
indexnumber | null
browsingboolean
onkeydown(event: KeyboardEvent) => void
reset() => void

Source: packages/ui/src/behaviors/micro.svelte.ts:22

InputHistoryOptions type

type InputHistoryOptions<T = string> = {
    /** Past entries, oldest first. */
    readonly entries: () => readonly T[];
    /** Reads the current composer value. */
    readonly read: () => T;
    /** Writes a recalled value into the composer; return `false` to cancel navigation. */
    readonly write: (value: T, event: KeyboardEvent) => boolean | void;
    /** Custom edge detector; defaults to first/last line of `<textarea>` or anywhere in `<input>`. */
    readonly at_edge?: (direction: 'up' | 'down', event: KeyboardEvent) => boolean;
};

Options for create_input_history.

Members

NameTypeDescription
entries() => readonly T[]

Past entries, oldest first.

read() => T

Reads the current composer value.

write(value: T, event: KeyboardEvent) => boolean | void

Writes a recalled value into the composer; return false to cancel navigation.

at_edge?(direction: 'up' | 'down', event: KeyboardEvent) => boolean

Custom edge detector; defaults to first/last line of <textarea> or anywhere in <input>.

Source: packages/ui/src/behaviors/micro.svelte.ts:10

InputModality type

type InputModality = 'keyboard' | 'pointer';

Input interaction modality ('keyboard' vs 'pointer').

Source: packages/ui/src/behaviors/platform.svelte.ts:239

model

InsertOf type

type InsertOf<C> = C extends keyof Models ? Models[C]['insert'] : Values;

A model's create input.

Source: packages/ui/src/model/types.ts:76

lang

JsonSchema type

type JsonSchema = boolean | JsonSchemaObject;

JSON Schema data shared by kind projections and renderers; references are never executable code.

Source: packages/store/src/lang/kind.ts:10

Kind type

type Kind = Common & ({
    readonly kind: 'text';
    readonly format?: 'email' | 'phone' | 'url' | 'zone' | 'markdown' | 'cel' | 'policy';
    readonly max?: number;
    readonly many?: true;
    /** A `markdown` text's sibling many-`file` field: pictures pasted or dropped into the text are stored there. */
    readonly images?: string;
} | ({
    readonly kind: 'int';
} & Range) | ({
    readonly kind: 'number';
} & Range) | ({
    readonly kind: 'decimal';
    readonly scale: number;
    readonly precision?: number;
} & Range) | {
    readonly kind: 'money';
    readonly currency?: string;
    readonly scale?: number;
} | {
    readonly kind: 'currency';
} | {
    readonly kind: 'bool';
} | {
    readonly kind: 'point';
} | {
    readonly kind: 'date';
    readonly precision?: DatePrecision;
} | {
    readonly kind: 'instant';
    readonly precision?: Precision;
} | {
    readonly kind: 'time';
    readonly precision?: TimePrecision;
} | {
    readonly kind: 'period';
    readonly of: 'date';
    readonly precision?: DatePrecision;
} | {
    readonly kind: 'period';
    readonly of: 'instant';
    readonly precision?: Precision;
} | {
    readonly kind: 'enum';
    readonly values: readonly string[];
    readonly many?: true;
    /** The states one value may move to; a write naming another transition is refused. */
    readonly transitions?: Readonly<Record<string, readonly string[]>>;
} | {
    readonly kind: 'state';
    readonly initial: string;
    readonly states: {
        readonly [state: string]: {
            readonly to?: readonly string[];
            readonly stamp?: string;
        };
    };
} | {
    readonly kind: 'seq';
    readonly pattern?: `${string}{${string}}${string}`;
    readonly per?: readonly string[];
    readonly start?: {
        readonly [value: string]: number;
    };
} | {
    readonly kind: 'sum';
    readonly of: `${string}.${string}`;
    readonly where?: Where;
    readonly money?: {
        readonly currency?: string;
    };
} | {
    readonly kind: 'count';
    readonly of: string;
    readonly where?: Where;
} | {
    readonly kind: 'json';
    readonly shape?: Kind;
} | {
    readonly kind: 'file';
    readonly accept: readonly `${string}/${string}`[];
    readonly max: `${bigint}${'KiB' | 'MiB' | 'GiB' | 'KB' | 'MB' | 'GB'}`;
} | {
    readonly kind: 'vector';
    readonly dim: number;
    readonly metric: 'l2' | 'cosine' | 'ip';
} | {
    readonly kind: 'custom';
    readonly of: string;
    readonly many?: true;
}
/** A relation: an id of one table, or `{ model, id }` of one of several (polymorphic). */
 | {
    readonly kind: 'ref';
    readonly to: string | readonly string[];
    readonly inverse?: string;
    readonly owned?: true;
    readonly on_delete?: 'restrict' | 'cascade' | 'set_null';
    readonly where?: Where;
} | {
    readonly kind: 'object';
    readonly fields: Fields;
    readonly rest?: Kind;
} | {
    readonly kind: 'union';
    readonly by: string;
    readonly arms: {
        readonly [tag: string]: Fields;
    };
}
/** Untagged: the first scalar arm the value decodes against. */
 | {
    readonly kind: 'union';
    readonly of: readonly ScalarKind[];
} | {
    readonly kind: 'record';
    readonly of: Kind;
});

A kind literal: every stored and input kind with its options, one arm per kind.

Source: packages/store/src/lang/kind.ts:77

kinds

KindsHost type

type KindsHost = {
    catalog?: {
        readonly [model: string]: ModelExposure;
    } | undefined;
    automations?: {
        readonly [automation: string]: AutomationExposure;
    } | undefined;
    custom_fields?: {
        readonly [name: string]: CustomFieldEntry;
    } | undefined;
    /** `bolt.upload`; without it a file field is read-only. */
    upload?(file: File, field: string): Effect.Effect<FileRef, Extract<ActFailure, {
        _tag: 'ActRefused';
    }> | Extract<ReadError, {
        _tag: 'TransportFailed';
    }>>;
    file_url?(ref: FileRef, options?: FileUrlOptions): string;
    /** The host's geocoder; without one, address search uses the keyless `photon_geocoder`. */
    geocoder?: Geocoder;
    /** The read a picker pages through: `bolt.query` of one read request, a page per root. Without it an `id` is typed. */
    query?(request: {
        readonly [path: string]: Json;
    }): Effect.Effect<{
        readonly [root: string]: {
            rows: readonly ({
                readonly id: string;
            } & {
                readonly [f: string]: Value;
            })[];
            next: string | null;
        };
    }, ReadError>;
    locale?: string | undefined;
    zone?: string | undefined;
    /** The workspace default currency for a money field without one. */
    currency?: string | undefined;
};

What the kind editors take from the host: the catalog, custom fields, uploads and file URLs, the geocoder, the picker's read, locale, zone and default currency.

Members

NameTypeDescription
catalog?{ readonly [model: string]: ModelExposure; } | undefined
automations?{ readonly [automation: string]: AutomationExposure; } | undefined
custom_fields?{ readonly [name: string]: CustomFieldEntry; } | undefined
upload?((file: File, field: string) => Effect.Effect<FileRef, Extract<ActFailure, { _tag: "ActRefused"; }> | Extract<ReadError, { _tag: "TransportFailed"; }>>) | undefined

bolt.upload; without it a file field is read-only.

file_url?((ref: FileRef, options?: FileUrlOptions) => string) | undefined
geocoder?Geocoder

The host's geocoder; without one, address search uses the keyless photon_geocoder.

query?((request: { readonly [path: string]: Json; }) => Effect.Effect<{ readonly [root: string]: { rows: readonly ({ readonly id: string; } & { readonly [f: string]: Value; })[]; next: string | null; }; }, ReadError>) | undefined

The read a picker pages through: bolt.query of one read request, a page per root. Without it an id is typed.

locale?string | undefined
zone?string | undefined
currency?string | undefined

The workspace default currency for a money field without one.

Source: packages/ui/src/kinds/context.ts:138

primitives

Label component

component Label(props: WithElementRef<HTMLLabelAttributes, HTMLLabelElement>)

A form label.

Props

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

Source: packages/ui/src/primitives/label/label.svelte:1

board

Lane type

type Lane = import('@norbital-ai/store/kind').Value | {
    value: import('@norbital-ai/store/kind').Value;
    label: string;
    where?: Json;
};

A lane: its by value (for a relation, the target id), a label, and for a relation its Where (default eq).

Source: packages/ui/src/board/Board.svelte:23

behaviors

LassoBehavior type

type LassoBehavior = ReturnType<typeof create_lasso>;

Return value of create_lasso.

Members

NameTypeDescription
rectLassoRect | null
activeboolean
surfaceAttachment<HTMLElement>
item(key: string) => Attachment<HTMLElement>

Source: packages/ui/src/behaviors/canvas.svelte.ts:435

LassoOptions type

type LassoOptions = {
    /** Called continuously as the marquee rectangle changes with intersecting item keys. */
    readonly on_change: (keys: readonly string[], rect: LassoRect) => void;
    /** Called when the marquee drag finishes. */
    readonly on_commit?: (keys: readonly string[]) => void;
};

Options for create_lasso.

Members

NameTypeDescription
on_change(keys: readonly string[], rect: LassoRect) => void

Called continuously as the marquee rectangle changes with intersecting item keys.

on_commit?(keys: readonly string[]) => void

Called when the marquee drag finishes.

Source: packages/ui/src/behaviors/canvas.svelte.ts:427

LassoRect type

type LassoRect = {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
};

Marquee rectangle in container-relative coordinates.

Members

NameTypeDescription
xnumber
ynumber
widthnumber
heightnumber

Source: packages/ui/src/behaviors/canvas.svelte.ts:424

Listbox type

type Listbox<T extends ListboxItem = ListboxItem> = ReturnType<typeof create_listbox<T>>;

Return value of create_listbox.

Members

NameTypeDescription
idstring
querystring
itemsreadonly T[]
activestring
active_idstring | undefined
selectedreadonly string[]
countnumber
is_selected(key: string) => boolean
choose(key: string) => void
toggle(key: string) => void
toggle_all() => void
clear() => void
focus(key: string) => void
highlight(key: string) => void
activate_active() => void
item(key: string) => import("svelte/attachments").Attachment<HTMLElement>
input_attrs(open?: boolean) => { role: "combobox"; "aria-autocomplete": "list"; "aria-expanded": boolean; "aria-controls": string; "aria-activedescendant": string | undefined; onkeydown: (event: KeyboardEvent) => void; }

Spread onto a search/combobox <input> in 'virtual' focus mode (aria-activedescendant, aria-controls, keyboard nav).

list_attrs() => { id: string; role: "listbox"; "aria-multiselectable": true | undefined; onkeydown: (event: KeyboardEvent) => void; }

Spread onto the listbox container (id, role="listbox", aria-multiselectable, keyboard handler).

option_attrs(value: string) => { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-highlighted": string | undefined; tabindex: number | undefined; onfocus: (() => void) | undefined; onpointerdown: ((event: PointerEvent) => void) | undefined; onpointermove: () => void; onclick: (event: MouseEvent) => void; }

Spread onto each option element (id, role="option", aria-selected, data-highlighted, click/hover/focus).

Source: packages/ui/src/behaviors/listbox.svelte.ts:47

ListboxFocusMode type

type ListboxFocusMode = 'dom' | 'virtual';

Focus strategy: 'dom' moves real focus across options; 'virtual' keeps focus in a search input via aria-activedescendant.

Source: packages/ui/src/behaviors/listbox.svelte.ts:18

ListboxItem type

type ListboxItem = {
    readonly value: string;
    readonly label: string;
    readonly keywords?: string;
    readonly disabled?: boolean;
};

One selectable option inside create_listbox.

Members

NameTypeDescription
valuestring
labelstring
keywords?string
disabled?boolean

Source: packages/ui/src/behaviors/listbox.svelte.ts:10

ListboxOptions type

type ListboxOptions<T extends ListboxItem = ListboxItem> = {
    /** All items in visual order. */
    readonly items: () => readonly T[];
    /** Selection mode (default `'single'`). */
    readonly mode?: SelectionMode | (() => SelectionMode);
    /** Focus strategy: `'dom'` (default) or `'virtual'` (`aria-activedescendant`). */
    readonly focus?: ListboxFocusMode;
    /** Controlled selected values; omit for internal state. */
    readonly selected?: () => readonly string[];
    /** Initial selected values when uncontrolled. */
    readonly default_selected?: readonly string[];
    /** Called when selection changes. */
    readonly on_change?: (values: readonly string[]) => void;
    /** Called when an item is explicitly activated (Enter / click in single mode). */
    readonly on_activate?: (item: T) => void;
    /** Optional custom filter; defaults to case-insensitive substring match on label + keywords. Pass `false` for externally filtered/async lists. */
    readonly filter?: false | ((item: T, query: string) => boolean);
    /** Enable incremental typeahead when not typing in a search input (default `true` in `'dom'` mode, `false` in `'virtual'` mode). */
    readonly typeahead?: boolean;
    /** Wrap arrow navigation at list ends (default `true`). */
    readonly loop?: boolean;
    /** Optional stable id prefix for `aria-controls` / `aria-activedescendant`. */
    readonly id?: string;
};

Options for create_listbox.

Members

NameTypeDescription
items() => readonly T[]

All items in visual order.

mode?SelectionMode | (() => SelectionMode)

Selection mode (default 'single').

focus?ListboxFocusMode

Focus strategy: 'dom' (default) or 'virtual' (aria-activedescendant).

selected?() => readonly string[]

Controlled selected values; omit for internal state.

default_selected?readonly string[]

Initial selected values when uncontrolled.

on_change?(values: readonly string[]) => void

Called when selection changes.

on_activate?(item: T) => void

Called when an item is explicitly activated (Enter / click in single mode).

filter?false | ((item: T, query: string) => boolean)

Optional custom filter; defaults to case-insensitive substring match on label + keywords. Pass false for externally filtered/async lists.

typeahead?boolean

Enable incremental typeahead when not typing in a search input (default true in 'dom' mode, false in 'virtual' mode).

loop?boolean

Wrap arrow navigation at list ends (default true).

id?string

Optional stable id prefix for aria-controls / aria-activedescendant.

Source: packages/ui/src/behaviors/listbox.svelte.ts:21

LostFocus type

type LostFocus<T = unknown> = {
    /** Stable key of the removed item. */
    readonly key: string;
    /** Optional caller metadata attached to the item. */
    readonly data: T | undefined;
    /** The removed DOM element. */
    readonly element: HTMLElement;
};

Info about a bound element that left the DOM while holding focus.

Members

NameTypeDescription
keystring

Stable key of the removed item.

dataT | undefined

Optional caller metadata attached to the item.

elementHTMLElement

The removed DOM element.

Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:7

map

Map component

component Map(props: MapProps<C>)

A model's records placed by a point field on our own vector basemap (MapLibre over keyless OpenFreeMap tiles, styled from the design tokens and following the theme), with its toolbar.

Each record is a round mark with its initial; badge (or the label, with labels="always") hangs a pill under it. Marks that crowd one spot draw as one accent-ringed count that splits as the map zooms in (a click zooms to it). Hovering or focusing a mark, or a row of the optional side list, selects it: a floating card shows its title, status, fields as chips and description (or the card snippet); the selected row (or the item snippet) is outlined in the accent. A click on a mark or a row opens the record (or calls on_open). overlays add computed marks and straight connections. Plan route orders up to five stops and opens road directions in Google Maps; it does not invent road paths or travel times. The map fills its parent, down to 18rem.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofC

The model whose records are placed, read in the viewer's output (default when held, else the first named output they hold): a mark holds only that output's fields.

atFieldOf<C>

The point field that places each record; rows without one are left out.

where?WhereOf<C>

The author's fixed scope; the viewer's filter is ANDed under it.

label?RecordFieldOf<C>

The field (or relation, by its target's label) that names each point; default the record label.

status?RecordFieldOf<C>

A field shown beside the title in the card and the list (a state shows as its badge).

badge?RecordFieldOf<C>

A count or metric hung as a pill under each mark.

fields?readonly RecordFieldOf<C>[]

Fields shown as small chips in the selected record's card.

description?RecordFieldOf<C>

A short text shown in the card under the chips.

list?boolean

A list of the places beside the map, synced with its selection.

card?Snippet<[{ row: RowOf<C>; }]>

The selected place's floating card body, in place of its title, status, chips and description.

item?Snippet<[{ row: RowOf<C>; }]>

A side list row's content, in place of its mark, title, status and badge.

on_open?(id: string) => void

Opening a place (one that stands for another record); default its own record.

interactive?boolean

Pan, zoom, selection and click-to-open. Default true; false is a static picture.

limit?number

The most rows read. Default 500.

labels?'hover' | 'always'

always: without a badge, each row's label hangs as the pill under its mark.

overlays?readonly MapOverlay[]

Marks the page computes (a destination, the route to it); they also widen the view to fit.

toolbar?Toolbar<RowOf<C>>

The chrome (ViewToolbar); search and filter narrow the places.

  • title?: string | false

    Default: the model's label.

  • error?: string

    A form group's semantic error: marks its title and replaces its info text until corrected.

  • description?: string | false

    Behind the info icon. Default: the model's declared description, else its model's.

  • search?: boolean

    Default on where the model declares search fields.

  • filter?: boolean

    The filter-and-sort popover. Default on.

  • actions?: readonly ToolbarItem<R>[] | false

    Author items in the actions menu, in a group of their own; false hides the menu.

  • export?: boolean

    "Export CSV" of the rows in view. Default on; replaced by "Export" when the model's file sync exports.

  • delete?: boolean

    "Delete selected records" when the model declares delete and the viewer may delete (turns selection on). Default on.

  • select?: boolean

    Record checkboxes (Table and Board). Default: on for permitted bulk edits, deletes or selection actions.

  • new?: boolean | (() => void)

    The New button: the record sheet in create mode, or the author's own (a prefilled create). Default: the viewer may create.

  • controls?: Snippet

    A view-local control (a grouping, a lane toggle), placed before search. The page scope (entity, period) is AppShell's actions; never actions.

  • trailing?: Snippet

    Compact task controls at the right edge, before New.

  • context?: { readonly [field: string]: Json; }

    What the view is scoped to ({ company_id, period }), handed to the model's file syncs: the import, its template and the export decode it against the sync's context fields. It narrows and defaults; it never authorizes.

key?string

The URL parameter prefix; defaults to of.

Example

```svelte
<Map {ctx} of="sites" at="location" label="name" status="state" fields={['crew', 'due']} badge="open_jobs" list />
```

Source: packages/ui/src/map/Map.svelte:1

editors

MarkdownEditor component

component MarkdownEditor(props: MarkdownEditorProps)

Markdown as plain text with the / block menu and @ mentions, and an optional Write/Preview switch.

Props

NameTypeDescription
valuestring

The Markdown text.

on_change?((next: string) => void) | undefined

Called with the whole text on every keystroke.

readonly?boolean

Renders the text only (ReadonlyMarkdown).

preview?boolean

Adds a Write/Preview switch above the box.

commands?readonly CommandItem[] | ((query: string) => EffectType.Effect<readonly CommandItem[], ReadError | Error>)

The / rows, or a scoped search provider; [] turns / off.

command_start?'line' | 'text' | 'word'

Where / counts: a line's start (Markdown blocks), or only as the text's first character (an agent command).

mentions?((query: string) => EffectType.Effect<readonly CommandItem[], ReadError | Error>) | undefined

The @ mention rows for a query; omitted turns @ off.

placeholder?string

Placeholder of the empty box.

rows?number

Visible text rows (default 8).

id?string

The id on the textarea, for <label for>.

disabled?boolean

Disables the textarea.

invalid?boolean

Marks the textarea invalid.

class?string

Classes for the outer block.

aria-label?string

Accessible name of the textarea.

onkeydown?((event: KeyboardEvent) => void) | undefined

Keydown on the textarea, e.g. to submit on Enter.

onpaste?((event: ClipboardEvent) => void) | undefined

Paste on the textarea, e.g. to take pasted files.

textarea?HTMLTextAreaElement | null

The textarea, bindable: a page inserts at its caret (selectionStart) or focuses it.

Source: packages/ui/src/editors/markdown-editor.svelte:1

behaviors

MatchRange type

type MatchRange = {
    readonly start: number;
    readonly end: number;
};

Half-open character range [start, end) inside the original text string.

Members

NameTypeDescription
startnumber
endnumber

Source: packages/ui/src/behaviors/text-match.ts:5

MatchSegment type

type MatchSegment = {
    readonly text: string;
    readonly matched: boolean;
};

One contiguous highlighted or plain text segment produced by match_segments.

Members

NameTypeDescription
textstring
matchedboolean

Source: packages/ui/src/behaviors/text-match.ts:11

type Menu<T extends MenuItem = MenuItem> = ReturnType<typeof create_menu<T>>;

Return value of create_menu.

Members

NameTypeDescription
openboolean
activestring
floating{ readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }
open_at(point: { x: number; y: number; }) => void
open_menu() => void
close() => void
toggle() => void
triggerAttachment<HTMLElement>
contentAttachment<HTMLElement>
context_areaAttachment<HTMLElement>
item(key: string) => Attachment<HTMLElement>
trigger_attrs() => { type: "button"; "aria-haspopup": "menu"; "aria-expanded": boolean; "aria-controls": string | undefined; "data-state": "open" | "closed"; onclick: () => void; onkeydown: (event: KeyboardEvent) => void; }
menu_attrs() => { id: string; role: "menu"; "aria-label": string | undefined; "data-state": "open" | "closed"; "data-side": FloatingSide; style: string; onkeydown: (event: KeyboardEvent) => void; }
item_attrs(id: string) => { role: "menuitem" | "menuitemcheckbox" | "menuitemradio"; "aria-disabled": true | undefined; "aria-checked": boolean | undefined; "data-highlighted": string | undefined; "data-disabled": string | undefined; tabindex: number | undefined; onfocus: () => void; onpointermove: () => void; onclick: (event: MouseEvent) => void; }

Source: packages/ui/src/behaviors/menu.svelte.ts:45

type MenuItem = {
    readonly id: string;
    readonly label: string;
    readonly disabled?: boolean;
    readonly role?: 'menuitem' | 'menuitemcheckbox' | 'menuitemradio';
    readonly checked?: boolean;
    readonly on_select?: () => void;
};

One menu item descriptor for create_menu.

Members

NameTypeDescription
idstring
labelstring
disabled?boolean
role?'menuitem' | 'menuitemcheckbox' | 'menuitemradio'
checked?boolean
on_select?() => void

Source: packages/ui/src/behaviors/menu.svelte.ts:13

type MenuOptions<T extends MenuItem = MenuItem> = {
    /** Ordered menu items. */
    readonly items: () => readonly T[];
    /** Controlled open state; omit for internal state. */
    readonly open?: () => boolean;
    /** Called when open state changes. */
    readonly on_open_change?: (open: boolean) => void;
    /** Called when any enabled menu item is activated. */
    readonly on_select?: (item: T) => void;
    /** Close the menu after selecting a regular `menuitem` (default `true`). */
    readonly close_on_select?: boolean;
    /** Preferred side relative to trigger (default `'bottom'`). */
    readonly side?: FloatingSide;
    /** Cross-axis alignment relative to trigger (default `'start'`). */
    readonly align?: FloatingAlign;
    /** Accessible name for the menu. */
    readonly label?: string;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_menu.

Members

NameTypeDescription
items() => readonly T[]

Ordered menu items.

open?() => boolean

Controlled open state; omit for internal state.

on_open_change?(open: boolean) => void

Called when open state changes.

on_select?(item: T) => void

Called when any enabled menu item is activated.

close_on_select?boolean

Close the menu after selecting a regular menuitem (default true).

side?FloatingSide

Preferred side relative to trigger (default 'bottom').

align?FloatingAlign

Cross-axis alignment relative to trigger (default 'start').

label?string

Accessible name for the menu.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/menu.svelte.ts:23

type MenubarBehavior = ReturnType<typeof create_menubar>;

Return value of create_menubar.

Members

NameTypeDescription
open_menustring | null
is_open(id: string) => boolean
open(id: string) => void
close() => void
rootAttachment<HTMLElement>
item(key: string) => Attachment<HTMLElement>
root_attrs() => { role: "menubar"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; }
trigger_attrs(id: string) => { type: "button"; role: "menuitem"; "aria-haspopup": "menu"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onclick: () => void; onpointerenter: () => void; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:406

type MenubarOptions = {
    readonly menus: () => readonly string[];
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_menubar.

Members

NameTypeDescription
menus() => readonly string[]
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:399

kinds

ModelExposure type

type ModelExposure = {
    /** The model's `label` fields: a record's title and the picker's search fallback. */
    label: readonly string[];
    /** CEL over the record; `label` contains its read dependencies for projections and picker fallback. */
    record_label?: string;
    label_paths?: readonly string[];
    /** Search fields when the model declares `search.text`; else the picker searches `label`'s text fields. */
    search?: readonly string[];
    /** The model declares `search.semantic` (text or file fields on an embedding model): the toolbar offers `/semantic`. */
    semantic?: true;
    /** The model's own search indexes (`search.indexes`), by their typed `input`: the toolbar offers each as `/<index>`. */
    indexes?: {
        readonly [index: string]: {
            input: Fields;
            description: string;
        };
    };
    /** `false`: it has no audit columns, so `created_at` and `updated_at` exist only if declared in `fields`. */
    audit?: false;
    /** Model fields the caller may read (hidden ones included; `hidden` renders nothing). */
    fields: Fields;
    /** Non-hidden model fields omitted by the caller's read output: rendered in place as redacted without shifting layout. */
    redacted?: Readonly<Record<string, {
        readonly wide?: true;
        readonly label?: string;
    }>>;
    /** One-relations as FK columns: `holder` → `employees`. A polymorphic ref lists every target. */
    relations?: {
        readonly [fk: string]: {…

One model as a form, a picker and a view toolbar need it (generated from its +model.ts and the caller's grants).

Members

NameTypeDescription
labelreadonly string[]

The model's label fields: a record's title and the picker's search fallback.

record_label?string

CEL over the record; label contains its read dependencies for projections and picker fallback.

label_paths?readonly string[]
search?readonly string[]

Search fields when the model declares search.text; else the picker searches label's text fields.

semantic?true

The model declares search.semantic (text or file fields on an embedding model): the toolbar offers /semantic.

indexes?{ readonly [index: string]: { input: Fields; description: string; }; }

The model's own search indexes (search.indexes), by their typed input: the toolbar offers each as /<index>.

audit?false

false: it has no audit columns, so created_at and updated_at exist only if declared in fields.

fieldsFields

Model fields the caller may read (hidden ones included; hidden renders nothing).

redacted?Readonly<Record<string, { readonly wide?: true; readonly label?: string; }>>

Non-hidden model fields omitted by the caller's read output: rendered in place as redacted without shifting layout.

relations?{ readonly [fk: string]: { targets: readonly string[]; optional?: true; label?: string; inverse?: string; /** The relationship's static `where`: a picker offers only the records a write would accept. */ where?: Where; }; }

One-relations as FK columns: holder → employees. A polymorphic ref lists every target.

layers?readonly string[]

The root's declared one-level read layers ('<model>.<rel>''s rel): the relations a list read may nest.

many?readonly string[]

Many-relations (inverses) the model exposes; each child is the model whose relation names it as inverse.

children?Readonly<Record<string, Pick<ChildInput, 'model' | 'parent' | 'owned'>>>

Read-side inverse identities; each child is read independently through its own policy.

output?string

The named read output the caller's views read (absent: default); its fields, relations and layers are these.

create?{ columns: readonly string[]; filled?: readonly string[]; proposal_only?: true; with?: Readonly<Record<string, ChildInput>>; }
update?{ columns: readonly string[]; with?: Readonly<Record<string, ChildInput>>; }
readonly_fields?{ readonly [field: string]: 'sync_owned' | 'owned_parent'; }

Host-declared field restrictions, in addition to ordinary write grants: a read-only sync's fields, an owned parent.

locks?readonly { readonly where: Where; readonly except?: readonly string[]; }[]

Matching constraint predicates restrict writes to their excepted fields and child relations.

description?string

The view toolbar's info text: the model's declared description, else its model's.

delete?true

The caller holds a delete arm.

syncs?{ readonly [sync: string]: SyncExposure; }

The native refresh/file-transfer controls the caller may use from the toolbar.

Source: packages/ui/src/kinds/context.ts:23

MoneyInput component

component MoneyInput(props: MoneyInputProps)

An exact money amount in currency: the currency as the box's leading affix, the amount typed plain and shown grouped in the currency's minor digits once the box loses focus. Kept as its exact decimal text.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
valueValue

The amount as a Decimal; null when empty.

on_change(next: Value) => void

Called with a Decimal once the text is a whole number (null when cleared); half-typed text like 1. is held back.

currency?string

ISO 4217 code shown as the leading affix; sets the minor digits. Omitted, digits are unbounded.

scale?number

Decimal places allowed, overriding the currency's minor digits.

id?string

The id on the input, for <label for>.

readonly?boolean

Shows the formatted amount as copyable text; defaults to the enclosing Form/Field mode.

disabled?boolean

Muted and inert; defaults to the enclosing Form/Field mode.

invalid?boolean

Marks the box invalid (a value problem marks it too).

Example

```svelte
<MoneyInput {ctx} currency="SGD" value={amount} on_change={(next) => (amount = next)} />
```

Source: packages/ui/src/kinds/money-input.svelte:1

behaviors

MoveBehavior type

type MoveBehavior = ReturnType<typeof create_move>;

Return value of create_move.

Members

NameTypeDescription
draggingboolean
handleAttachment<HTMLElement>
handle_attrs() => { tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/canvas.svelte.ts:30

MoveOptions type

type MoveOptions = {
    readonly position: () => MovePoint;
    readonly on_change: (next: MovePoint) => void;
    readonly on_commit?: (final: MovePoint) => void;
    readonly step?: number;
    readonly grid?: number;
    readonly bounds?: () => {
        readonly min_x: number;
        readonly max_x: number;
        readonly min_y: number;
        readonly max_y: number;
    };
    readonly scale?: () => number;
    readonly label?: string;
};

Options for create_move.

Members

NameTypeDescription
position() => MovePoint
on_change(next: MovePoint) => void
on_commit?(final: MovePoint) => void
step?number
grid?number
bounds?() => { readonly min_x: number; readonly max_x: number; readonly min_y: number; readonly max_y: number; }
scale?() => number
label?string

Source: packages/ui/src/behaviors/canvas.svelte.ts:18

MovePoint type

type MovePoint = {
    readonly x: number;
    readonly y: number;
};

2D coordinate point.

Members

NameTypeDescription
xnumber
ynumber

Source: packages/ui/src/behaviors/canvas.svelte.ts:15

type NavigationMenuBehavior = ReturnType<typeof create_navigation_menu>;

Return value of create_navigation_menu.

Members

NameTypeDescription
activestring | null
is_open(id: string) => boolean
open(id: string) => void
close() => void
rootAttachment<HTMLElement>
item(key: string) => Attachment<HTMLElement>
root_attrs() => { "aria-label": string; onpointerleave: () => void; onkeydown: (event: KeyboardEvent) => void; }
trigger_attrs(id: string) => { type: "button"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onpointerenter: () => void; onclick: () => void; }
content_attrs() => { onpointerenter: () => void; onpointerleave: () => void; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:529

type NavigationMenuOptions = {
    readonly items: () => readonly string[];
    readonly open_delay?: number;
    readonly close_delay?: number;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_navigation_menu.

Members

NameTypeDescription
items() => readonly string[]
open_delay?number
close_delay?number
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:520

NumberInputOptions type

type NumberInputOptions = {
    readonly value?: () => number | null;
    readonly default_value?: number | null;
    readonly on_change?: (value: number | null) => void;
    readonly min?: number;
    readonly max?: number;
    readonly step?: number;
    readonly locale?: string;
    readonly disabled?: () => boolean;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_number_input.

Members

NameTypeDescription
value?() => number | null
default_value?number | null
on_change?(value: number | null) => void
min?number
max?number
step?number
locale?string
disabled?() => boolean
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:261

Overflow type

type Overflow<T> = ReturnType<typeof create_overflow<T>>;

Return value of create_overflow.

Members

NameTypeDescription
fitnumber
visiblereadonly T[]
hiddenreadonly T[]
has_overflowboolean
active_in_hiddenboolean
more_openboolean
listAttachment<HTMLElement>
measureAttachment<HTMLElement>

Source: packages/ui/src/behaviors/overflow.svelte.ts:18

OverflowOptions type

type OverflowOptions<T> = {
    /** All items in display order. */
    items: () => readonly T[];
    /** Key extractor for checking whether the active item is currently inside the overflow menu. */
    key?: (item: T) => string;
    /** Currently active key (optional). */
    active?: () => string | undefined;
};

Options for create_overflow.

Members

NameTypeDescription
items() => readonly T[]

All items in display order.

key?(item: T) => string

Key extractor for checking whether the active item is currently inside the overflow menu.

active?() => string | undefined

Currently active key (optional).

Source: packages/ui/src/behaviors/overflow.svelte.ts:8

OverlayEntry type

type OverlayEntry<Payload, Result = unknown> = {
    readonly id: string;
    readonly payload: Payload;
    readonly resolve: (result: Result | undefined) => void;
};

One entry in an imperative create_overlay_stack.

Members

NameTypeDescription
idstring
payloadPayload
resolve(result: Result | undefined) => void

Source: packages/ui/src/behaviors/platform.svelte.ts:448

PageControlsOptions type

type PageControlsOptions = {
    /** Only return controls whose `element()` sits inside this container. */
    readonly within?: Element | null;
    /** Optional substring filter over id, kind, or label. */
    readonly query?: string;
    /** Maximum number of controls to return. */
    readonly limit?: number;
};

Options for filtering page_controls.

Members

NameTypeDescription
within?Element | null

Only return controls whose element() sits inside this container.

query?string

Optional substring filter over id, kind, or label.

limit?number

Maximum number of controls to return.

Source: packages/ui/src/behaviors/controls.svelte.ts:55

Pagination type

type Pagination = ReturnType<typeof create_pagination>;

Return value of create_pagination.

Members

NameTypeDescription
pagenumber
pagesnumber | null
has_previousboolean
has_nextboolean
rangePaginationEntry[]
go(target: number) => void
previous() => void
next() => void
first() => void
last() => void

Source: packages/ui/src/behaviors/pagination.svelte.ts:29

PaginationEntry type

type PaginationEntry = number | 'ellipsis';

One entry in a compact pagination window: a 1-based page number or 'ellipsis'.

Source: packages/ui/src/behaviors/pagination.svelte.ts:6

PaginationOptions type

type PaginationOptions = {
    /** Current 1-based page number (controlled getter, or omit for internal state). */
    page?: () => number;
    /** Initial 1-based page when uncontrolled (default `1`). */
    default_page?: number;
    /** Total page count (`null` when unknown / keyset-paged). */
    total_pages: () => number | null;
    /** Explicit previous availability override (for cursor/keyset pagination). */
    has_previous?: () => boolean;
    /** Explicit next availability override (for cursor/keyset pagination). */
    has_next?: () => boolean;
    /** Called when the page changes. */
    on_page_change?: (page: number) => void;
    /** Sibling pages shown on each side of the current page in `range` (default `1`). */
    siblings?: number;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    control?: {
        id: string;
        label?: string;
    };
};

Options for create_pagination.

Members

NameTypeDescription
page?() => number

Current 1-based page number (controlled getter, or omit for internal state).

default_page?number

Initial 1-based page when uncontrolled (default 1).

total_pages() => number | null

Total page count (null when unknown / keyset-paged).

has_previous?() => boolean

Explicit previous availability override (for cursor/keyset pagination).

has_next?() => boolean

Explicit next availability override (for cursor/keyset pagination).

on_page_change?(page: number) => void

Called when the page changes.

siblings?number

Sibling pages shown on each side of the current page in range (default 1).

control?{ id: string; label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/pagination.svelte.ts:9

PanelGroup type

type PanelGroup = ReturnType<typeof create_panel_group>;

Return value of create_panel_group.

Members

NameTypeDescription
sizesreadonly number[]
draggingnumber | null
size_of(index: number) => number
reset() => void
containerAttachment<HTMLElement>
handle(handleIndex: number) => Attachment<HTMLElement>
handle_attrs(handleIndex: number) => { role: "separator"; tabindex: number; "aria-orientation": "horizontal" | "vertical"; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number; "data-dragging": string | undefined; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:42

PanelGroupOptions type

type PanelGroupOptions = {
    readonly panels: readonly PanelSpec[];
    readonly direction?: 'horizontal' | 'vertical';
    readonly storage_key?: string;
    readonly on_layout?: (sizes: readonly number[]) => void;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_panel_group.

Members

NameTypeDescription
panelsreadonly PanelSpec[]
direction?'horizontal' | 'vertical'
storage_key?string
on_layout?(sizes: readonly number[]) => void
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:33

PanelSpec type

type PanelSpec = {
    readonly id: string;
    readonly default_size: number;
    readonly min_size?: number;
    readonly max_size?: number;
    readonly collapsible?: boolean;
};

Configuration for one pane inside create_panel_group.

Members

NameTypeDescription
idstring
default_sizenumber
min_size?number
max_size?number
collapsible?boolean

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:24

PasswordInput type

type PasswordInput = ReturnType<typeof create_password_input>;

Return value of create_password_input.

Members

NameTypeDescription
visibleboolean
caps_lockboolean
toggle() => void
set_visible(next: boolean) => void
inputAttachment<HTMLInputElement>
input_attrs() => { type: "text" | "password"; "data-agent-secret": string; "aria-label": string | undefined; onkeydown: (event: KeyboardEvent) => void; onkeyup: (event: KeyboardEvent) => void; }
toggle_attrs() => { type: "button"; "aria-pressed": boolean; "aria-label": string; onclick: () => void; }

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:882

PasswordInputOptions type

type PasswordInputOptions = {
    /** Initial visibility (default `false`). */
    readonly default_visible?: boolean;
    /** Accessible label for the password input. */
    readonly label?: string;
    /** Optional semantic control registration (always marked `secret: true`). */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_password_input.

Members

NameTypeDescription
default_visible?boolean

Initial visibility (default false).

label?string

Accessible label for the password input.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration (always marked secret: true).

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:872

PatternViolation type

type PatternViolation = {
    readonly rule: string;
    readonly message: string;
    readonly element?: Element;
};

One contract violation detected by check_pattern or check_direction.

Members

NameTypeDescription
rulestring
messagestring
element?Element

Source: packages/ui/src/behaviors/testing.ts:21

PersistedState class

class PersistedState<T> {
    #private;
    constructor(key: string, initialValue: T, options?: PersistedStateOptions<T>);
    /** Current persisted value. */
    get current(): T;
    set current(value: T);
}

Reactive state synchronized with localStorage or sessionStorage with safe fallback when storage is unavailable or contains malformed JSON.

Members

NameTypeDescription
#privateany
currentT

Current persisted value.

Source: packages/ui/src/behaviors/reactive.svelte.ts:213

PersistedStateOptions type

type PersistedStateOptions<T> = {
    /** Browser storage backend (`'local'` default, or `'session'`). */
    readonly storage?: 'local' | 'session';
    /** Custom serializer; defaults to JSON. */
    readonly serializer?: {
        readonly serialize: (value: T) => string;
        readonly deserialize: (raw: string) => T;
    };
};

Storage options for PersistedState.

Members

NameTypeDescription
storage?'local' | 'session'

Browser storage backend ('local' default, or 'session').

serializer?{ readonly serialize: (value: T) => string; readonly deserialize: (raw: string) => T; }

Custom serializer; defaults to JSON.

Source: packages/ui/src/behaviors/reactive.svelte.ts:195

kinds

PhoneInput component

component PhoneInput(props: PhoneInputProps)

A phone number: a country calling-code picker (flag and code) joined to the number box; the value is E.164.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
valueValue

The E.164 number; null when empty. The region starts at the viewer's locale.

on_change(next: Value) => void

Called on every keystroke; an incomplete number is still written (as + and its digits) so the field's check names it.

id?string

The id on the number box, for <label for>.

disabled?boolean

Disables both the code picker and the number box.

invalid?boolean

Marks the number box invalid.

Source: packages/ui/src/kinds/phone-input.svelte:1

pin-input

PhoneVerify component

component PhoneVerify(props: PhoneVerifyProps)

A mobile number proven on the page: the number and "Send code" side by side; the six-digit code opens in a popover beneath them, and the sixth digit verifies. session sends and checks the code (a Bolt page passes bolt.session, which signs the viewer in, signing a newcomer up where the workspace allows it, and reloads the page as them).

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
sessionCodeSession

Sends the code and checks it; a Bolt page passes bolt.session. A failure's message shows under the field.

  • send_code: (address: string) => Said
  • verify: (address: string, code: string) => Said
label?string

The number's label; the kit's "Mobile number" by default.

id?string

The phone input's id (default phone-verify).

Source: packages/ui/src/pin-input/phone-verify.svelte:1

kinds

Picker component

component Picker(props: PickerProps<C>)

Picks one row of a model by searching it through the viewer's own read grant; the value is the row's id.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofC

The target model's handle.

valuestring | null

The chosen id; any text is shown as not found, never trusted.

on_change(next: IdOf<C> | null) => void

Called with the picked id, or null when cleared.

label?readonly FieldOf<C>[]

Fields that label each row; defaults to the target model's label.

where?WhereOf<C> & Json

Narrows the choices (a versioned catalogue's version in force, say): the caller decides, the picker only reads.

order_by?OrderByOf<C> & Json

Row order; defaults to the label.

limit?number

Rows shown per search (default 20); never caps what is searched.

id?string

The id on the control, for <label for>.

readonly?boolean

Shows the chosen row's label as copyable text; an enclosing readonly form sets it.

disabled?boolean

Muted and inert; defaults to the enclosing Form/Field mode.

invalid?boolean

Marks the control invalid.

Example

```svelte
<Picker {ctx} of="employee" where={{ active: { eq: true } }} value={id} on_change={(next) => (id = next)} />
```

Source: packages/ui/src/kinds/picker.svelte:1

behaviors

PinCell type

type PinCell = {
    /** Zero-based index of this cell. */
    readonly index: number;
    /** Character currently in this cell, or `null` when empty. */
    readonly char: string | null;
    /** Whether this cell holds the active caret position. */
    readonly is_active: boolean;
    /** Whether to draw a blinking caret inside this empty active cell. */
    readonly has_fake_caret: boolean;
};

One visual cell of a PIN / OTP code.

Members

NameTypeDescription
indexnumber

Zero-based index of this cell.

charstring | null

Character currently in this cell, or null when empty.

is_activeboolean

Whether this cell holds the active caret position.

has_fake_caretboolean

Whether to draw a blinking caret inside this empty active cell.

Source: packages/ui/src/behaviors/pin.svelte.ts:6

pin-input

PinInput component

component PinInput(props: Props)

A one-time code in separate digit cells: the sign-in code step. Digits only, one-time-code autofill; focused on mount, since the code step appears only once a code is sent.

Props

NameTypeDescription
autofocus?boolean

Focuses the code input on mount (default true).

aria-invalid?boolean | 'true' | 'false'

Indicates the entered value does not conform to the format expected by the application. Marks the cells invalid.

@see aria-errormessage.

value?string

Current code string; bindable.

maxlength?number

Number of digit cells (default 6).

disabled?boolean

Disables editing.

cell_class?string

Classes added to every cell.

on_value_change?(value: string) => void

Called with the code on every keystroke or paste.

paste_transformer?(text: string) => string

Rewrites pasted text before it fills the cells (strip spaces or dashes).

input_id?string

The id of the hidden input, for a Label for.

name?string

Optional HTML form name passed directly to the underlying <input>.

input_ref?HTMLInputElement | null

The hidden input element (bindable).

on_complete?(value: string) => void

Called with the code once every cell is filled.

Source: packages/ui/src/pin-input/pin-input.svelte:1

behaviors

PinInputBehavior type

type PinInputBehavior = ReturnType<typeof create_pin_input>;

Return value of create_pin_input.

Members

NameTypeDescription
valuestring
cellsreadonly PinCell[]
focusedboolean
set_value(raw: string) => void
input_attrs() => { value: string; maxlength: number; disabled: true | undefined; onfocus: (event: FocusEvent) => void; onblur: () => void; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onselect: (event: Event) => void; }

Spread onto the underlying <input> element that owns focus, typing, paste and autofill.

Source: packages/ui/src/behaviors/pin.svelte.ts:43

PinInputOptions type

type PinInputOptions = {
    /** Number of cells (e.g. `6`). */
    readonly length: number | (() => number);
    /** Controlled value getter; omit for internal state. */
    readonly value?: () => string;
    /** Initial value when uncontrolled. */
    readonly default_value?: string;
    /** Called whenever the sanitized value changes. */
    readonly on_value_change?: (value: string) => void;
    /** Called when the value reaches `length` characters. */
    readonly on_complete?: (value: string) => void;
    /** Allowed character filter regex (default digits only `/^\d+$/`). */
    readonly pattern?: RegExp;
    /** Disabled state. */
    readonly disabled?: () => boolean;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
        readonly secret?: boolean;
        readonly element?: () => HTMLElement | null;
    };
};

Options for create_pin_input.

Members

NameTypeDescription
lengthnumber | (() => number)

Number of cells (e.g. 6).

value?() => string

Controlled value getter; omit for internal state.

default_value?string

Initial value when uncontrolled.

on_value_change?(value: string) => void

Called whenever the sanitized value changes.

on_complete?(value: string) => void

Called when the value reaches length characters.

pattern?RegExp

Allowed character filter regex (default digits only /^\d+$/).

disabled?() => boolean

Disabled state.

control?{ readonly id: string; readonly label?: string; readonly secret?: boolean; readonly element?: () => HTMLElement | null; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/pin.svelte.ts:18

lang

Point type

type Point = {
    readonly lat: number;
    readonly lng: number;
};

A latitude and longitude in degrees.

Members

NameTypeDescription
latnumber
lngnumber

Source: packages/store/src/lang/kind.ts:347

kinds

PointInput component

component PointInput(props: PointInputProps)

Edits a point: a compact trigger opens address suggestions and the map. Typed coordinates, a map click or marker drag, and the browser's location also set the point.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
valueValue

The current point; anything that is not a point counts as empty.

on_change(next: Point | null) => void

Called with the chosen point, or null when cleared.

address?string | null

The sibling address text, shown in the trigger (else the looked-up address, else the coordinates).

on_address?((address: string | null) => void) | undefined

Called with the address typed or looked up for the point.

id?string

The id on the trigger, for <label for>.

disabled?boolean

Muted and inert.

invalid?boolean

Marks the trigger invalid.

map?boolean

Show the map (default true).

Source: packages/ui/src/kinds/point-input.svelte:1

behaviors

PointerKindState type

type PointerKindState = {
    readonly precision: PointerPrecision;
    readonly hover: boolean;
};

Current device pointer capabilities.

Members

NameTypeDescription
precisionPointerPrecision
hoverboolean

Source: packages/ui/src/behaviors/platform.svelte.ts:104

PointerPrecision type

type PointerPrecision = 'coarse' | 'fine';

Primary pointer precision ('coarse' touch vs 'fine' mouse/trackpad).

Source: packages/ui/src/behaviors/platform.svelte.ts:101

PointerSample type

type PointerSample = {
    readonly x: number;
    readonly y: number;
    readonly start_x: number;
    readonly start_y: number;
    readonly dx: number;
    readonly dy: number;
    readonly event: PointerEvent;
};

Live pointer position and delta reported by bind_drag.

Members

NameTypeDescription
xnumber
ynumber
start_xnumber
start_ynumber
dxnumber
dynumber
eventPointerEvent

Source: packages/ui/src/behaviors/drag.svelte.ts:10

primitives

Popover namespace

namespace Popover

Floating content anchored to a trigger: Popover.Root, Popover.Trigger, Popover.Content.

Source: packages/ui/src/primitives/popover/index.ts:1

PortalConfig component

component PortalConfig(props: $$ComponentProps)

Scopes where descendant portaled overlays (dialogs, popovers, tooltips) mount in the DOM.

Props

NameTypeDescription
to?PortalTarget

Mount element or CSS selector for descendant portals (default document.body).

children?Snippet

Scoped subtree.

Source: packages/ui/src/primitives/portal-config.svelte:1

behaviors

PortalOptions type

type PortalOptions = {
    /** Mount element, CSS selector, or `null` to render in place. */
    readonly to?: PortalTarget;
    /** When `true`, keeps the element in place instead of teleporting it. */
    readonly disabled?: boolean;
};

Options object accepted by portal(...).

Members

NameTypeDescription
to?PortalTarget

Mount element, CSS selector, or null to render in place.

disabled?boolean

When true, keeps the element in place instead of teleporting it.

Source: packages/ui/src/behaviors/portal.svelte.ts:13

PortalTarget type

type PortalTarget = HTMLElement | string | null | undefined;

Target element, CSS selector or null to disable teleporting and render in place.

Source: packages/ui/src/behaviors/portal.svelte.ts:10

Presence type

type Presence = ReturnType<typeof create_presence>;

Return value of create_presence.

Members

NameTypeDescription
presentboolean
statePresenceState
exitingboolean
attachAttachment<HTMLElement>

Source: packages/ui/src/behaviors/presence.svelte.ts:18

PresenceOptions type

type PresenceOptions = {
    /** Reactive open getter. */
    readonly open: () => boolean;
    /** Called once enter or exit settles. */
    readonly on_complete?: (open: boolean) => void;
};

Options for create_presence.

Members

NameTypeDescription
open() => boolean

Reactive open getter.

on_complete?(open: boolean) => void

Called once enter or exit settles.

Source: packages/ui/src/behaviors/presence.svelte.ts:10

PresenceState type

type PresenceState = 'entering' | 'open' | 'exiting' | 'closed';

Lifecycle phase of a presence-managed element.

Source: packages/ui/src/behaviors/presence.svelte.ts:7

studio

PreviewFrame component

component PreviewFrame(props: $$ComponentProps)

A resizable preview web view, the only place a preview shows (it is never a destination of its own). One compact header: what it previews, a running build's status, the device (Phone, Tablet, Desktop as icons), the caller's details (ⓘ) and actions (…), Reload. Below, the page sits in a device bezel on a blueprint grid, so it never reads as part of the app around it. The page always lays out at the chosen size in its own CSS pixels — a desktop is a desktop even in a narrow pane — and is scaled down to fit, as a browser's device mode does (width × height · zoom, in the corner). Its right and bottom edges drag to any size. A new build (version) reloads it; the sandbox keeps it from navigating the page around it; the last size is remembered on this device, but a phone always opens at Phone, without the device buttons, and under a coarse pointer the header wraps. Studio's preview pane and the agent panel both use it.

Props

NameTypeDescription
srcstring | null

The page's address; null while there is nothing to show (the Tests pane opens instead).

tests?StudioTestRun | undefined

The latest test run, shown in a Tests pane beside the preview.

  • state: Schema.Literals<readonly ["running", "passed", "failed", "empty"]>
  • id: Schema.String
  • files: Schema.$Array<Schema.Struct<{ readonly path: Schema.String; readonly state: Schema.Literals<readonly ["passed", "failed", "skipped"]>; readonly error: Schema.optionalKey<Schema.String>; readonly tests: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly state: Schema.Literals<readonly ["passed", "failed", "skipped"]>; readonly duration_ms: Schema.optionalKey<Schema.Finite>; reado…
  • commit: Schema.String
  • started_at: Schema.String
  • error?: Schema.optionalKey<Schema.String>
  • summary?: Schema.optionalKey<Schema.Struct<{ readonly files: Schema.Int; readonly total: Schema.Int; readonly passed: Schema.Int; readonly failed: Schema.Int; readonly skipped: Schema.Int; readonly duration_ms: Schema.Finite; }>>
  • finished_at?: Schema.optionalKey<Schema.String>
  • truncated?: Schema.optionalKey<Schema.Literal<true>>
title?string

The frame's accessible title. Default 'Preview'.

label?string | undefined

What it previews (a draft, a commit): the header reads "Preview ·

version?string | undefined

The build it shows: a new one reloads the frame at the same address.

status?string | undefined

A running build ("Building… · 0:05"): shown beside the label with a spinner.

details?Snippet

What the preview runs (data, build, expiry): behind ⓘ.

menu?Snippet<[() => void]>

The caller's actions (rebuild, live data, exit): behind …; each receives a closer for the menu.

expanded?boolean

Expand the same interactive frame into a modal, preserving its page state.

on_close?() => void

Shows a Close button that calls it.

t?(key: string) => string

Translates the frame's English strings (keys are the English text). Default: identity.

Source: packages/ui/src/studio/PreviewFrame.svelte:1

behaviors

PreviewOptions type

type PreviewOptions<T> = {
    /** Committed authoritative value. */
    readonly value: () => T;
    /** Called when a preview is explicitly committed. */
    readonly on_commit: (value: T) => void;
};

Options for create_preview.

Members

NameTypeDescription
value() => T

Committed authoritative value.

on_commit(value: T) => void

Called when a preview is explicitly committed.

Source: packages/ui/src/behaviors/platform.svelte.ts:325

PreviewState type

type PreviewState<T> = ReturnType<typeof create_preview<T>>;

Return value of create_preview.

Members

NameTypeDescription
currentT
previewingboolean
update(next: T) => void
commit(finalValue?: T) => void
cancel() => void

Source: packages/ui/src/behaviors/platform.svelte.ts:333

primitives

Progress component

component Progress(props: $$ComponentProps)

A progress bar of value out of max.

Props

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

max?number

Maximum progress value (default 100).

value?number | null

Current progress value, or null when indeterminate.

Source: packages/ui/src/primitives/progress/progress.svelte:1

Qr component

component Qr(props: $$ComponentProps)

A scannable code. value is the payload the provider published; the matrix is drawn from it here, so nothing is fetched and nothing leaves the browser. Colours are fixed rather than themed: a code is read by a camera, not by a person, and a low-contrast code in dark mode is one that simply does not scan.

Props

NameTypeDescription
valuestring

The payload to encode; '' draws nothing.

size?number

The rendered pixel size; the code keeps its own quiet zone.

alt?string

The image's alternative text; default Scannable code.

class?string

Classes on the image.

Source: packages/ui/src/primitives/qr/qr.svelte:1

behaviors

RadioGroupOptions type

type RadioGroupOptions = {
    readonly items: () => readonly string[];
    readonly value?: () => string | undefined;
    readonly default_value?: string;
    readonly on_change?: (value: string) => void;
    readonly orientation?: RovingOrientation;
    readonly disabled?: (value: string) => boolean;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_radio_group.

Members

NameTypeDescription
items() => readonly string[]
value?() => string | undefined
default_value?string
on_change?(value: string) => void
orientation?RovingOrientation
disabled?(value: string) => boolean
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:86

RatingOptions type

type RatingOptions = {
    readonly max?: number;
    readonly value?: () => number;
    readonly default_value?: number;
    readonly on_change?: (value: number) => void;
    readonly disabled?: () => boolean;
    readonly label?: string;
};

Options for create_rating.

Members

NameTypeDescription
max?number
value?() => number
default_value?number
on_change?(value: number) => void
disabled?() => boolean
label?string

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:414

read

ReadGate component

component ReadGate(props: { ctx: UiContext; state: ReadState<T>; what: string; children: Snippet<[T]>; skeleton?: Snippet; })

A view's loading, no-access and error states around its ready content.

Props

NameTypeDescription
ctxUiContext

The page context.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
stateReadState<T>

The read's state.

whatstring

What the view reads, named in its no-access and error states.

childrenSnippet<[T]>

The ready content, given the read's value.

skeleton?Snippet

Replaces the default loading skeleton (rows of a table) with the view's own shape (a board's cards).

Source: packages/ui/src/read/ReadGate.svelte:1

ReadOnce component

component ReadOnce(props: { effect: Effect.Effect<T, E, never>; pending: Snippet; ready: Snippet<[T]>; })

One read's pending and ready states.

Props

NameTypeDescription
effectEffect.Effect<T, E>

The read, run once per change of it; a failure throws to the nearest boundary.

pendingSnippet

Shown until the read answers.

readySnippet<[T]>

Shown with the read's value.

Source: packages/ui/src/read/ReadOnce.svelte:1

editors

ReadonlyMarkdown component

component ReadonlyMarkdown(props: $$ComponentProps)

Renders Markdown text for reading. The Markdown parser loads with the first text shown, never with a page's startup: until it arrives the text is plain and the block is aria-busy.

Props

NameTypeDescription
valuestring

The Markdown text; raw HTML is escaped and script-capable links neutered.

breaks?boolean

Each newline is a line break, as a person typed it (a chat message), not a soft wrap.

class?string

Classes for the rendered block.

Source: packages/ui/src/editors/readonly-markdown.svelte:1

record

RecordCapabilities type

type RecordCapabilities = {
    model: string;
    id: string;
    revision: number;
    fields: Readonly<Record<string, {
        writable: boolean;
        proposal: boolean;
        reasons: readonly RecordRestriction[];
    }>>;
    update: {
        allowed: boolean;
        proposal: boolean;
        reasons: readonly RecordRestriction[];
    };
    delete: {
        allowed: boolean;
        proposal: boolean;
        reasons: readonly RecordRestriction[];
    };
    moves: Readonly<Record<string, readonly string[]>>;
    proposal_moves: Readonly<Record<string, readonly string[]>>;
};

Read-filtered field and operation permissions, proposal eligibility and restriction reasons for one revision.

Members

NameTypeDescription
modelstring
idstring
revisionnumber
fieldsReadonly<Record<string, { writable: boolean; proposal: boolean; reasons: readonly RecordRestriction[]; }>>
update{ allowed: boolean; proposal: boolean; reasons: readonly RecordRestriction[]; }
delete{ allowed: boolean; proposal: boolean; reasons: readonly RecordRestriction[]; }
movesReadonly<Record<string, readonly string[]>>
proposal_movesReadonly<Record<string, readonly string[]>>

Source: packages/ui/src/record/types.ts:23

RecordForm component

component RecordForm(props: $$ComponentProps)

A record view that is one form: the record frame around the model's form, laid out by the Sections and Fields the representation composes. A +representation.svelte passes its view whole; a create opens its new record as RecordShell does.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
viewRecordView<ModelKey>

What the representation received.

subtitle?readonly string[]

The fields under the heading, each shown by its kind.

actions?Snippet

Placed in the record header.

trailing?Snippet

Beside the label in the chrome.

tabs?readonly RecordTab[]

Authored tabs after the record's own.

runs?readonly RunsForProps[]

Runs whose subject is this record, shown as a Runs tab.

history?RecordHistoryConfig

Related records included in the History popover.

  • fields?: readonly string[]
  • sources?: readonly RecordHistorySource[]
lock?string

A UI-only lock reason: the record reads, and the footer shows the lock instead of Edit.

form_actions?Snippet<[FormState]>

Extra buttons beside the form's submit.

on_outcome?FormProps['on_outcome']

The form's outcome, beside what the frame does with it.

on_done?(outcome: Outcome) => void

A committed or held save, in place of the default (a create opens the new record).

childrenSnippet<[FormState]>

The form's layout of Sections and Fields.

Example

<RecordForm {ctx} {view} subtitle={['customer', 'due_on']}>
<Section first name="general"><Field {ctx} name="customer" /></Section>
</RecordForm>

Source: packages/ui/src/record/RecordForm.svelte:1

RecordHistoryConfig type

type RecordHistoryConfig = {
    fields?: readonly string[];
    sources?: readonly RecordHistorySource[];
};

One record's history plus optional related-record history; no separate event store.

Members

NameTypeDescription
fields?readonly string[]
sources?readonly RecordHistorySource[]

Source: packages/ui/src/record/history.ts:9

model

RecordOf type

type RecordOf<C> = C extends keyof Models ? Models[C]['record'] : Row;

A model's whole row as a record view reads it.

Source: packages/ui/src/model/types.ts:68

record

RecordParentContext type

type RecordParentContext = {
    model: string;
    id: string;
    relation: string;
    revision: number;
};

A nested edit uses one declared parent relation and the parent's observed revision.

Members

NameTypeDescription
modelstring
idstring
relationstring
revisionnumber

Source: packages/ui/src/record/types.ts:16

RecordRestriction type

type RecordRestriction = 'no_grant' | 'state_locked'
/** A read-only sync owns the field. */
 | 'sync_owned' | 'owned_parent' | 'owned_parent_locked'
/** An open approval request holds the record; only its current approvers or (changes requested) its requester edit. */
 | 'under_approval';

Native advisory capabilities of the current record; saving always rechecks the backend rules.

Source: packages/ui/src/record/types.ts:6

form

RecordSection type

type RecordSection = {
    /** The stable key the open state is remembered under. */
    name: string;
    /** The heading; without one the fields render untitled. */
    title?: string;
    /** An Iconify id before the title. */
    icon?: string;
    /** One sentence behind an info icon beside the title. */
    hint?: string;
    /** The fields it holds, in order; a field listed by an earlier section stays there. */
    fields: readonly string[];
    /** Open until the viewer chooses otherwise. Default true. */
    default_open?: boolean;
    /** Shown beside the title while collapsed; a function reads the row shown. */
    summary?: string | ((row: {
        readonly [field: string]: unknown;
    }) => string);
};

A declared section of a generated record view or form (RecordShell/Form sections): its fields, in order. Its title and summary arrive translated; summary may read the row shown (the draft while editing).

Members

NameTypeDescription
namestring

The stable key the open state is remembered under.

title?string

The heading; without one the fields render untitled.

icon?string

An Iconify id before the title.

hint?string

One sentence behind an info icon beside the title.

fieldsreadonly string[]

The fields it holds, in order; a field listed by an earlier section stays there.

default_open?boolean

Open until the viewer chooses otherwise. Default true.

summary?string | ((row: { readonly [field: string]: unknown; }) => string)

Shown beside the title while collapsed; a function reads the row shown.

Source: packages/ui/src/form/section.svelte:54

record

RecordShell component

component RecordShell(props: RecordShellProps<C>)

A record's frame: heading, state pill, actions, tabs, history and runs around its body (a registered representation, the children snippet, or the generated view), with Edit / Save in the footer; a past revision shows read-only.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofC

The record's model.

id?FormProps<C>['id']

The stored row; absent with mode="create".

mode?'view' | 'edit' | 'create'

view (default) reads with an Edit button; edit opens in edit mode; create drafts a new record.

values?Partial<InsertOf<C>>

Create mode: the pre-filled values (a page's scope).

fields?FormProps<C>['fields']

Generated view: create offers these beyond values' keys; update shows only these, in this order (else every field).

validate?FormProps<C>['validate']

Pure draft rules, shared with the model's guarded write.

sections?readonly RecordSection[]

Generated view (read, edit, create): the fields grouped into collapsible Sections, in order; fields no section lists follow in one untitled, always-open group. Titles and summaries arrive translated.

editors?FormProps<C>['editors']

Generated view: a field's own editor by name, in place of its kind's (Field editor).

viewers?FormProps<C>['viewers']

Generated view: a field's own readonly view by name, in place of its kind's (Field view).

title?string

The heading; default the record's label fields by kind (a create: "New ").

eyebrow?boolean

Hide the model noun when the authored heading already identifies the record.

header?boolean

A page-level shell: false drops its heading row and history scrubber when the page header already names the record.

subtitle?string | readonly string[]

A line under the heading: text, or field names shown by kind (['customer', 'due_on'] → Acme · Jan 2, 2026).

icon?string

Iconify id inside the state pill.

badge?string

The state pill's text.

lock?string

A UI-only lock reason: the footer shows a lock instead of Edit while the record is not in edit mode.

hint?string

One sentence behind the pill.

actions?Snippet

Placed in the record header (e.g. an "Approve" action).

trailing?Snippet

Beside the label in the chrome (e.g. a timeline trigger).

footer_actions?Snippet

Beside Edit / Save in the footer (lifecycle actions: promote, transfer, terminate).

footer?string | Snippet

A short line at the start of the footer, opposite Edit / Save (a status, what saving does). While a draft has unsaved changes the footer says so instead.

tabs?readonly RecordTab[]

Authored tabs after the record's own; a tab an enclosing page's strip already shows is not repeated.

history?RecordHistoryConfig

Related records included in the native History popover, scoped by read queries.

  • fields?: readonly string[]
  • sources?: readonly RecordHistorySource[]
runs?readonly RunsForProps[]

Runs whose subject is this record, shown as a Runs tab.

children?Snippet<[RecordView<C>]>

The representation's body; absent → the representation registered for of, else the generated view. It receives the record shown — the scrubbed revision while one is picked — as use_record_view() also does beneath. A model's +representation.svelte takes { view: RecordView<C> } or reads use_record_view(), never $props().row/record.

on_done?(outcome: Outcome) => void

A committed or approval-held save, after it is toasted. Default: a create opens the new record.

Example

<RecordShell {ctx} of="invoice" id={row.id} />

Source: packages/ui/src/record/RecordShell.svelte:1

RecordTab type

type RecordTab = {
    /** The stable key; the record reopens on the tab it was last on. */
    name: string;
    /** The tab's label. */
    title: string;
    /** The tab's content. */
    body: Snippet;
    /** An Iconify id before the title. */
    icon?: string;
    keep_alive?: true;
};

An authored tab; a keep_alive tab stays mounted while hidden, so a form inside it keeps its state.

Members

NameTypeDescription
namestring

The stable key; the record reopens on the tab it was last on.

titlestring

The tab's label.

bodySnippet

The tab's content.

icon?string

An Iconify id before the title.

keep_alive?true

Source: packages/ui/src/record/RecordShell.svelte:21

RecordView type

type RecordView<C extends string = string> = {
    model: C;
    mode: 'view' | 'edit';
    record: RecordOf<C>;
    capabilities?: RecordCapabilities;
} | {
    model: C;
    mode: 'create';
    values: Partial<InsertOf<C>>;
};

What a +representation.svelte receives, { view: RecordView<'<model>'> }.

Source: packages/ui/src/record/types.ts:56

behaviors

RejectedFile type

type RejectedFile = {
    readonly file: File;
    readonly reason: 'type' | 'size' | 'count';
};

One rejected file from create_file_dropzone validation.

Members

NameTypeDescription
fileFile
reason'type' | 'size' | 'count'

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:720

Reorder type

type Reorder = ReturnType<typeof create_reorder>;

Return value of create_reorder.

Members

NameTypeDescription
draggingstring | null
overstring | null
move(fromIndex: number, toIndex: number) => void
move_by(key: string, delta: number) => void
item(key: string) => Attachment<HTMLElement>

Optional pointer-capture drag attachment (works cleanly on touch & supports edge auto-scroll + Escape cancel).

item_attrs(key: string) => { draggable: boolean; "data-dragging": string | undefined; "data-drop-target": string | undefined; ondragstart: (event: DragEvent) => void; ondragover: (event: DragEvent) => void; ondragleave: () => void; ondrop: (event: DragEvent) => void; ondragend: () => void; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/reorder.svelte.ts:26

ReorderOptions type

type ReorderOptions = {
    /** Ordered item keys. */
    readonly items: () => readonly string[];
    /** Invoked with `(fromIndex, toIndex, nextOrder)` when an item moves. */
    readonly on_reorder: (from: number, to: number, next: readonly string[]) => void;
    /** Axis for movement (default `'vertical'`). */
    readonly orientation?: ReorderOrientation;
    /** Disable reordering globally or for a specific key. */
    readonly disabled?: boolean | ((key: string) => boolean);
    /** Optional human-readable label per key for live announcements. */
    readonly label?: (key: string) => string;
};

Options for create_reorder.

Members

NameTypeDescription
items() => readonly string[]

Ordered item keys.

on_reorder(from: number, to: number, next: readonly string[]) => void

Invoked with (fromIndex, toIndex, nextOrder) when an item moves.

orientation?ReorderOrientation

Axis for movement (default 'vertical').

disabled?boolean | ((key: string) => boolean)

Disable reordering globally or for a specific key.

label?(key: string) => string

Optional human-readable label per key for live announcements.

Source: packages/ui/src/behaviors/reorder.svelte.ts:12

ReorderOrientation type

type ReorderOrientation = 'vertical' | 'horizontal';

Axis for keyboard and pointer reordering ('vertical' or 'horizontal').

Source: packages/ui/src/behaviors/reorder.svelte.ts:9

record

RepresentationLoader type

type RepresentationLoader = () => Promise<{
    default: Component<{
        view: RecordView;
        ctx: UiContext;
    }>;
}>;

A model's +representation.svelte, loaded on first use.

Source: packages/ui/src/record/types.ts:60

behaviors

Resize type

type Resize = ReturnType<typeof create_resize>;

Return value of create_resize.

Members

NameTypeDescription
draggingboolean
handle_attrs() => { role: "separator"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number | undefined; tabindex: number; "data-dragging": string | undefined; onpointerdown: (event: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }

Spread onto the resize handle element (role="separator", aria-value*, pointer & keyboard handlers).

Source: packages/ui/src/behaviors/resize.svelte.ts:36

ResizeAxis type

type ResizeAxis = 'horizontal' | 'vertical' | 'both';

Axis of pointer/keyboard resizing ('horizontal', 'vertical', or 2D 'both').

Source: packages/ui/src/behaviors/resize.svelte.ts:6

ResizeBox type

type ResizeBox = {
    readonly width: number;
    readonly height: number;
};

2D dimensions used when axis === 'both' or via create_resize_2d.

Members

NameTypeDescription
widthnumber
heightnumber

Source: packages/ui/src/behaviors/resize.svelte.ts:9

ResizeBoxOptions type

type ResizeBoxOptions = {
    readonly size: () => ResizeBox;
    readonly on_change: (next: ResizeBox) => void;
    readonly on_commit?: (final: ResizeBox) => void;
    readonly min_width?: number;
    readonly max_width?: number;
    readonly min_height?: number;
    readonly max_height?: number;
    readonly scale?: () => number;
    readonly step?: number;
};

Options for 2D create_resize_box (edge & corner handles for preview frames, cards, canvases).

Members

NameTypeDescription
size() => ResizeBox
on_change(next: ResizeBox) => void
on_commit?(final: ResizeBox) => void
min_width?number
max_width?number
min_height?number
max_height?number
scale?() => number
step?number

Source: packages/ui/src/behaviors/resize.svelte.ts:147

ResizeOptions type

type ResizeOptions = {
    /** Current size in pixels (reactive getter). */
    readonly value: () => number;
    /** Called with the clamped pixel size during drag and keyboard nudges. */
    readonly on_change: (next: number) => void;
    /** Called once when a pointer drag finishes. */
    readonly on_commit?: (final: number) => void;
    /** Axis of drag movement (default `'horizontal'`). */
    readonly axis?: 'horizontal' | 'vertical';
    /** Invert drag delta (e.g. dragging a right-docked sheet's left edge leftward widens it). */
    readonly invert?: boolean;
    /** Minimum size in pixels (default `120`). */
    readonly min?: number | (() => number);
    /** Maximum size in pixels (default `Infinity`). */
    readonly max?: number | (() => number);
    /** Optional zoom divisor for scaled canvases/preview frames (default `1`). */
    readonly scale?: number | (() => number);
    /** Keyboard Arrow nudge increment in pixels (default `24`). */
    readonly step?: number;
    /** Accessible label for the separator handle. */
    readonly label?: string;
};

Options for create_resize.

Members

NameTypeDescription
value() => number

Current size in pixels (reactive getter).

on_change(next: number) => void

Called with the clamped pixel size during drag and keyboard nudges.

on_commit?(final: number) => void

Called once when a pointer drag finishes.

axis?'horizontal' | 'vertical'

Axis of drag movement (default 'horizontal').

invert?boolean

Invert drag delta (e.g. dragging a right-docked sheet's left edge leftward widens it).

min?number | (() => number)

Minimum size in pixels (default 120).

max?number | (() => number)

Maximum size in pixels (default Infinity).

scale?number | (() => number)

Optional zoom divisor for scaled canvases/preview frames (default 1).

step?number

Keyboard Arrow nudge increment in pixels (default 24).

label?string

Accessible label for the separator handle.

Source: packages/ui/src/behaviors/resize.svelte.ts:12

ResolvedColorScheme type

type ResolvedColorScheme = 'light' | 'dark';

Resolved concrete color scheme.

Source: packages/ui/src/behaviors/platform.svelte.ts:156

record

RestorePreview type

type RestorePreview = {
    model: string;
    record: string;
    revision: number;
    live: number;
    changes: readonly {
        field: string;
        current: Json;
        restored: Json;
        approval: boolean;
    }[];
    skipped: readonly {
        field: string;
        reason: RestoreSkip;
        current: Json;
        restored: Json;
    }[];
};

history.preview: what restoring past revision would write over the live record (live), field by field, and what it leaves alone and why. approval: that field's write routes to an approval rather than committing.

Members

NameTypeDescription
modelstring
recordstring
revisionnumber
livenumber
changesreadonly { field: string; current: Json; restored: Json; approval: boolean; }[]
skippedreadonly { field: string; reason: RestoreSkip; current: Json; restored: Json; }[]

Source: packages/ui/src/record/types.ts:42

RestoreSkip type

type RestoreSkip = 'deleted_target' | 'read_only' | 'no_grant' | 'state_locked' | 'definition_changed' | 'incompatible';

Why a past value is not written back by a per-record restore.

Source: packages/ui/src/record/types.ts:36

behaviors

RgbaColor type

type RgbaColor = {
    readonly r: number;
    readonly g: number;
    readonly b: number;
    readonly a: number;
};

RGBA color representation with channels r,g,b in 0..255 and alpha a in 0..1.

Members

NameTypeDescription
rnumber
gnumber
bnumber
anumber

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:781

editors

RichMarkdownEditor component

component RichMarkdownEditor(props: $$ComponentProps)

Markdown edited as it reads (WYSIWYG): type Markdown shortcuts (# , - , 1. , > , **bold**, `code`) or use the toolbar; a pasted link links the selection. With upload, pictures pasted, dropped or picked are stored and shown in place. The value in and out is Markdown, so ReadonlyMarkdown shows it the same way. The engine loads on first use.

Props

NameTypeDescription
valuestring

The Markdown shown and edited.

on_change?((next: string) => void) | undefined

Called with the Markdown after each edit.

placeholder?string

Shown while the document is empty.

readonly?boolean

Shows the text as read (an enclosing readonly form sets it).

disabled?boolean

The editor stays, muted and inert (an enclosing disabled form sets it).

invalid?boolean

Marks the editor as holding a refused value.

id?string

The id on the editable document, for <label for>.

class?string

Classes on the editor's frame.

aria-label?string

The editor's accessible name when no label names it.

upload?((file: File) => Effect.Effect<string, Error>) | undefined

Stores a picture and answers the URL it is shown by; without it the editor takes no pictures.

Example

<RichMarkdownEditor value={notes} on_change={(next) => (notes = next)} upload={(file) => store(file)} />

Source: packages/ui/src/editors/rich-markdown-editor.svelte:1

behaviors

RovingFocus type

type RovingFocus = ReturnType<typeof create_roving_focus>;

Return value of create_roving_focus.

Members

NameTypeDescription
activestring
focus(key: string) => void
next() => void
prev() => void
item(key: string) => Attachment<HTMLElement>

Attach to each focusable item for arrow focus & unmount focus recovery.

root_attrs() => { onkeydown: (event: KeyboardEvent) => void; }

Spread onto the container element to handle arrow/Home/End keyboard navigation.

item_attrs(key: string) => { tabindex: number | undefined; "data-roving-active": string | undefined; onfocus: () => void; }

Spread onto each item for roving tabindex, focus syncing and data-roving-active state.

Source: packages/ui/src/behaviors/roving-focus.svelte.ts:29

RovingFocusOptions type

type RovingFocusOptions = {
    /** Keys in navigation order. */
    readonly items: () => readonly string[];
    /** Controlled active key; omit for internal focus tracking. */
    readonly active?: () => string | undefined;
    /** Called when keyboard navigation moves focus to a key. */
    readonly on_active_change?: (key: string) => void;
    /** Axis of arrow navigation (default `'horizontal'`). */
    readonly orientation?: RovingOrientation | (() => RovingOrientation);
    /** Wrap from last back to first and vice versa (default `true`). */
    readonly loop?: boolean;
    /** Skip disabled keys during keyboard movement. */
    readonly disabled?: (key: string) => boolean;
    /** Optional callback invoked when Space or Enter activates the focused item. */
    readonly on_activate?: (key: string) => void;
};

Options for create_roving_focus.

Members

NameTypeDescription
items() => readonly string[]

Keys in navigation order.

active?() => string | undefined

Controlled active key; omit for internal focus tracking.

on_active_change?(key: string) => void

Called when keyboard navigation moves focus to a key.

orientation?RovingOrientation | (() => RovingOrientation)

Axis of arrow navigation (default 'horizontal').

loop?boolean

Wrap from last back to first and vice versa (default true).

disabled?(key: string) => boolean

Skip disabled keys during keyboard movement.

on_activate?(key: string) => void

Optional callback invoked when Space or Enter activates the focused item.

Source: packages/ui/src/behaviors/roving-focus.svelte.ts:11

RovingOrientation type

type RovingOrientation = 'horizontal' | 'vertical' | 'both';

Arrow-key navigation axis ('horizontal', 'vertical', or 'both').

Source: packages/ui/src/behaviors/roving-focus.svelte.ts:8

form

Row type

type Row = {
    readonly [field: string]: Value;
};

A row's values by field name.

Source: packages/ui/src/form/draft.ts:20

table

RowCard component

component RowCard(props: $$ComponentProps)

A row as a phone card: its title, then up to three fields (all of them when it opens nothing). The whole card opens the record; it is not a <button>, so a row's own controls inside keep their tap.

Props

NameTypeDescription
opensboolean

Whether the card opens a record.

title?Snippet

The card's title line.

fieldsreadonly { readonly field: string; readonly label: string; }[]

The fields after the title, in order, each with its label.

valueSnippet<[string]>

A field's value.

on_press(event: MouseEvent) => void

A press anywhere on the card (a link or control inside handles its own).

on_open() => void

Enter or Space on the focused card.

Source: packages/ui/src/table/RowCard.svelte:1

RowIn type

type RowIn<S> = SourceRow<S>;

The row a source yields: the model's caller row, the read's rows, or the array's element.

Source: packages/ui/src/table/Table.svelte:41

RowMenu component

component RowMenu(props: $$ComponentProps)

A row's actions: one shows as its button; two or more fold into one menu, so a row's actions cell stays narrow.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
actionsreadonly { readonly label: string; readonly run: () => void; }[]

Each action's label and handler; a press never also opens the row.

Example

<RowMenu {ctx} actions={[{ label: 'Archive', run: () => archive(row) }]} />

Source: packages/ui/src/table/RowMenu.svelte:1

model

RowOf type

type RowOf<C> = C extends keyof Models ? Models[C]['row'] : Row;

A model's row as a view's read returns it (json, custom and file fields only when selected), its whole row as a record view reads it, its create input, its filter and its sort.

Source: packages/ui/src/model/types.ts:66

relations

Rows component

component Rows(props: RowsProps)

An editable list of child rows inside a parent's form: add, edit and remove rows, reported as the relation operations of the parent's one act.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
rowsreadonly Row[]

The child rows as loaded (empty on create).

columnsreadonly Col[]

The child rows' editable columns.

add() => Row

A new child row's initial values.

min?number

The fewest rows: a row is removable only above it (default 0).

max?number

The most rows: a row is addable only below it (default unbounded).

on_change(ops: RowsOps, current: readonly Row[]) => void

Each edit: the explicit relation ops for the parent's one act, and the rows as shown.

Source: packages/ui/src/relations/Rows.svelte:1

runs

RunStatus component

component RunStatus(props: RunStatusProps)

The live status of one automation run: queued, running with its progress, waiting until it resumes, or its result or error.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
automationstring

The automation's name (jobs.send_pdf).

runstring | { readonly id: string; } | RunRow

The run: its id or RunHandle (watched live), or a row already read (shown as given).

title?string

The automation's name; else its catalog label (automations.<key>.label), else its name in words (jobs.send_pdf → Send pdf).

download?boolean

Download the run's files once when it succeeds: a run the person just started to get a file (a template, an export).

Source: packages/ui/src/runs/RunStatus.svelte:1

RunsFor component

component RunsFor(props: RunsForProps)

The latest runs of one automation matching where, newest first, each with its RunStatus.

Props

NameTypeDescription
ctxUiContext

The page context.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
automationstring

The automation's name.

title?string

Names the automation (else its catalog label automations.<key>.label, else its name in words).

where?Json

Which runs: a Where over their row.

limit?number

How many runs at most (default 5).

Source: packages/ui/src/runs/RunsFor.svelte:1

RunsForProps type

type RunsForProps = {
    /** The page context. */
    ctx: UiContext;
    /** The automation's name. */
    automation: string;
    /** Names the automation (else its catalog label `automations.<key>.label`, else its name in words). */
    title?: string;
    /** Which runs: a `Where` over their row. */
    where?: Json;
    /** How many runs at most (default 5). */
    limit?: number;
};

The latest runs of one automation that match where (e.g. those started for a record), newest first.

Members

NameTypeDescription
ctxUiContext

The page context.

automationstring

The automation's name.

title?string

Names the automation (else its catalog label automations.<key>.label, else its name in words).

where?Json

Which runs: a Where over their row.

limit?number

How many runs at most (default 5).

Source: packages/ui/src/runs/RunsFor.svelte:9

behaviors

ScrollPickerOptions type

type ScrollPickerOptions = {
    /** Called when the centered option changes after scrolling settles. */
    readonly on_select: (index: number) => void;
    /** Scroll axis (default `'vertical'`). */
    readonly orientation?: 'vertical' | 'horizontal';
};

Options for bind_scroll_picker.

Members

NameTypeDescription
on_select(index: number) => void

Called when the centered option changes after scrolling settles.

orientation?'vertical' | 'horizontal'

Scroll axis (default 'vertical').

Source: packages/ui/src/behaviors/canvas.svelte.ts:835

form

Section component

component Section(props: SectionProps)

One titled section of a form or record body: a heading row (title, an optional ⓘ hint, a mark, actions) over its content. A titled section collapses from its heading; the body is hidden, never unmounted, so every field in it still saves. Closed, the heading shows summary so nothing important is out of sight. The viewer's open state is remembered per model and section; a section holding a field with an error opens itself. A section groups at least two controls, or one large control (a structure, a list of objects, a map, code, long text or a custom datatype's editor: a field that spans its row): content that is a single other field folds the section away, and that field joins the flow under its own label. A large field alone keeps the section, and does not repeat the section's title as its own heading. A closed section is its heading alone. Open, size says how it takes height in a bounded column (a record body, a Stack in a sheet): content (the default) is always its whole content, and the column scrolls when they do not fit; fill (a table, a long list) shares the height left, scrolling inside itself, never below min_height (default its content or 16rem, whichever is less). Nothing scrolls sideways.

Props

NameTypeDescription
title?string

The heading. Without one the section is plain content, always open.

icon?string

An Iconify id shown in a box before the title; the toggle shows a chevron while it is hovered.

hint?string

One sentence saying what the section decides, behind an info icon beside the title.

name?string

The stable key the open state is remembered under (default title, which changes with the locale).

first?boolean

No rule above: the first section of a body.

collapsible?boolean

Default true for a titled section.

default_open?boolean

Open until the viewer chooses otherwise. Default true: a secondary section passes false.

summary?string | Snippet

Shown beside the title while collapsed ("3 files", "Not set").

trailing?Snippet

A mark on the title row — a state badge, never a control.

actions?Snippet<[FormState | undefined]>

Controls that act on the section, at the end of the title row, with the enclosing form's draft.

size?'content' | 'fill'

content (default): its whole content; fill: shares the column's height left and scrolls inside itself.

min_height?string

A fill section's floor (a CSS length; default its content or 16rem, whichever is less).

childrenSnippet

The section's content: its fields or a view.

Example

<Section name="basis" title="Evidence basis" icon="lucide:list-checks" size="fill"><Table of="evidence" /></Section>

Source: packages/ui/src/form/section.svelte:1

behaviors

SegmentPart type

type SegmentPart = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'literal';

Editable or literal segment kind inside a segmented date or time field.

Source: packages/ui/src/behaviors/date-time.svelte.ts:25

Selection type

type Selection = ReturnType<typeof create_selection>;

Return value of create_selection.

Members

NameTypeDescription
selectedreadonly string[]
countnumber
all_selectedboolean
some_selectedboolean
is_selected(key: string) => boolean
choose(key: string) => void
toggle(key: string) => void
extend(to: string, opts?: { from?: string | null; additive?: boolean; }) => void
toggle_all() => void
clear() => void
item_attrs(key: string) => { "aria-selected": boolean; "data-selected": string | undefined; "aria-disabled": true | undefined; onclick: (event: MouseEvent) => void; }

Spread onto each selectable item for aria-selected, data-selected and click/Shift/Cmd handling.

Source: packages/ui/src/behaviors/selection.svelte.ts:24

table

SelectionBar component

component SelectionBar(props: $$ComponentProps)

A view's selection line: the page's checkbox (a card list has no header), then the selected count, "select every matching row" and clear; with nothing selected, the range.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
countnumber

The rows selected.

allboolean

Every row of the page is selected.

matching?number | null

The rows the view matches, when known: past the selection, they may all be selected.

busy?boolean

Selecting every matching row is under way.

rangestring

The rows shown ("1–25 of 80"), said while none are selected.

on_page(selected: boolean) => void

The page's checkbox: select or clear every row of the page.

on_matching() => void

Select every matching row.

on_clear() => void

Clear the selection.

Source: packages/ui/src/table/SelectionBar.svelte:1

behaviors

SelectionMode type

type SelectionMode = 'single' | 'multiple';

Single or multiple item selection mode.

Source: packages/ui/src/behaviors/selection.svelte.ts:5

SelectionOptions type

type SelectionOptions = {
    /** Keys in visual order (used for Shift ranges and select-all). */
    order: () => readonly string[];
    /** Single or multiple selection (default `'single'`). */
    mode?: SelectionMode | (() => SelectionMode);
    /** Controlled selected keys; omit for internal state. */
    selected?: () => readonly string[];
    /** Initial selected keys when uncontrolled. */
    default_selected?: readonly string[];
    /** Called with the next selection whenever it changes. */
    on_change?: (keys: readonly string[]) => void;
    /** Whether a key may be selected (default every key). */
    selectable?: (key: string) => boolean;
};

Options for create_selection.

Members

NameTypeDescription
order() => readonly string[]

Keys in visual order (used for Shift ranges and select-all).

mode?SelectionMode | (() => SelectionMode)

Single or multiple selection (default 'single').

selected?() => readonly string[]

Controlled selected keys; omit for internal state.

default_selected?readonly string[]

Initial selected keys when uncontrolled.

on_change?(keys: readonly string[]) => void

Called with the next selection whenever it changes.

selectable?(key: string) => boolean

Whether a key may be selected (default every key).

Source: packages/ui/src/behaviors/selection.svelte.ts:8

primitives

Sheet component

component Sheet(props: SheetProps)

A panel sliding in from an edge over the page, with a heading, header actions and a close button. On a phone every sheet is the same bottom drawer: rounded on top, its grabber or header dragged to resize it, the grabber tapped to take the whole screen, and the page behind held still. On a wide screen a right sheet drags wider or narrower by its left edge and goes full screen from its header.

Props

NameTypeDescription
open?boolean

Whether it shows; bindable.

on_open_change?(open: boolean) => void

Called with false once a close the sheet itself asked for (scrim, Escape, close button, drag) has animated out.

side?'left' | 'right'

The wide-screen edge it slides from; default right. On a phone every sheet is the bottom drawer.

title?string

The heading and accessible name; a record view inside that claims the header names the dialog when this is absent.

header?Snippet

Replaces the heading (a record label with badges); the close button stays.

actions?Snippet

Header content beside the close button (record actions).

childrenSnippet

The body, scrolled below the header.

class?string

Classes on the panel.

memory?string

What its dragged width and full-screen state are remembered under, in this browser: a record's sheet passes its model, so every record of that model opens as the last one was left. Default: title, else one shared name.

Source: packages/ui/src/primitives/sheet/sheet.svelte:1

behaviors

ShortcutBinding type

type ShortcutBinding = {
    /** Shortcut spec such as `'mod+k'`, `'escape'`, `'shift+alt+p'`, `'/'`, or chord `'g i'`. */
    readonly keys: string;
    /** Handler invoked when matched. */
    readonly handler: (event: KeyboardEvent) => void;
    /** Allow firing while focus is inside an input, textarea, select or contenteditable (default `false`). */
    readonly allow_in_input?: boolean;
    /** Call `event.preventDefault()` on match (default `true`). */
    readonly prevent_default?: boolean;
    /** Temporarily disable this shortcut. */
    readonly enabled?: boolean | (() => boolean);
};

One declarative keyboard shortcut binding for create_shortcuts.

Members

NameTypeDescription
keysstring

Shortcut spec such as 'mod+k', 'escape', 'shift+alt+p', '/', or chord 'g i'.

handler(event: KeyboardEvent) => void

Handler invoked when matched.

allow_in_input?boolean

Allow firing while focus is inside an input, textarea, select or contenteditable (default false).

prevent_default?boolean

Call event.preventDefault() on match (default true).

enabled?boolean | (() => boolean)

Temporarily disable this shortcut.

Source: packages/ui/src/behaviors/shortcuts.svelte.ts:6

kinds

Show component

component Show(props: ShowProps)

Shows any stored or input value by its kind; readonly form values stay copyable.

States render as a StateBadge, enums as badges in their catalogue words, refs as the target's label, markdown rendered, objects, lists and JSON as StructuredData, custom kinds through their field renderer; a missing value (or an empty readonly list) shows "none".

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
kindKind

The declared kind that picks the renderer and formatting.

valueValue | undefined

The value to show; undefined and null show "none".

name?string

The field name: scopes enum/state words and labels the value.

row?{ readonly [field: string]: Value; }

The owning row, read for a money field's currency and a custom renderer's context.

class?string

Classes for the rendered value.

readonly?boolean

Form-style read-only output: plain values become copyable, refs a read-only picker, CEL a read-only code view.

relation?{ targets: readonly string[]; }

Relation targets; with readonly, the value shows as a label of the first target model.

  • targets: readonly string[]
address?string

The row field holding an address, handed to a custom renderer.

id?string

The id on the rendered element, for label association.

Example

```svelte
<Show {ctx} kind={{ kind: 'money', currency: 'SGD' }} value={1250} />
```

Source: packages/ui/src/kinds/show.svelte:1

ShowProps type

type ShowProps = {
    /** The page context (`ctx`), passed whole. */
    ctx: UiContext;
    /** The declared kind that picks the renderer and formatting. */
    kind: Kind;
    /** The value to show; `undefined` and `null` show "none". */
    value: Value | undefined;
    /** The field name: scopes enum/state words and labels the value. */
    name?: string;
    /** The owning row, read for a money field's currency and a custom renderer's context. */
    row?: {
        readonly [field: string]: Value;
    };
    /** Classes for the rendered value. */
    class?: string;
    /** Form-style read-only output: plain values become copyable, refs a read-only picker, CEL a read-only code view. */
    readonly?: boolean;
    /** Relation targets; with `readonly`, the value shows as a label of the first target model. */
    relation?: {
        targets: readonly string[];
    };
    /** The row field holding an address, handed to a custom renderer. */
    address?: string;
    /** The id on the rendered element, for label association. */
    id?: string;
};

A value and its declared kind, with optional row/relation context for labels and currency; readonly output remains copyable.

Members

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

kindKind

The declared kind that picks the renderer and formatting.

valueValue | undefined

The value to show; undefined and null show "none".

name?string

The field name: scopes enum/state words and labels the value.

row?{ readonly [field: string]: Value; }

The owning row, read for a money field's currency and a custom renderer's context.

class?string

Classes for the rendered value.

readonly?boolean

Form-style read-only output: plain values become copyable, refs a read-only picker, CEL a read-only code view.

relation?{ targets: readonly string[]; }

Relation targets; with readonly, the value shows as a label of the first target model.

address?string

The row field holding an address, handed to a custom renderer.

id?string

The id on the rendered element, for label association.

Source: packages/ui/src/kinds/show.svelte:20

behaviors

Slider type

type Slider = ReturnType<typeof create_slider>;

Return value of create_slider.

Members

NameTypeDescription
valuenumber
valuesreadonly number[]
percentnumber
percentsnumber[]
draggingboolean
active_thumbnumber
set(next: number, index?: number) => void
trackAttachment<HTMLElement>
thumb_attrs(index?: number) => { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/slider.svelte.ts:42

SliderOptions type

type SliderOptions = {
    /** Controlled numeric value (single-thumb mode); omit for internal state. */
    readonly value?: () => number;
    /** Initial value when uncontrolled (default `min`). */
    readonly default_value?: number;
    /** Called when the quantized value changes (single-thumb mode). */
    readonly on_change?: (value: number) => void;
    /** Called once when a drag or key adjustment settles (single-thumb mode). */
    readonly on_commit?: (value: number) => void;
    /** Controlled multi-thumb values (range slider mode). */
    readonly values?: () => readonly number[];
    /** Initial multi-thumb values when uncontrolled. */
    readonly default_values?: readonly number[];
    /** Called when multi-thumb values change. */
    readonly on_values_change?: (values: readonly number[]) => void;
    /** Called once when a multi-thumb drag or key adjustment settles. */
    readonly on_values_commit?: (values: readonly number[]) => void;
    /** Minimum value (default `0`). */
    readonly min?: number | (() => number);
    /** Maximum value (default `100`). */
    readonly max?: number | (() => number);
    /** Step increment (default `1`). */
    readonly step?: number | (() => number);
    /** Orientation (`'horizontal'` default, or `'vertical'`). */
    readonly orientation?: 'horizontal' | 'vertical';
    /** Disabled state. */
    readonly disabled?: () => boolean;
    /** Accessible label. */
    readonly label?: string;
    /** Optional semantic contr…

Options for create_slider.

Members

NameTypeDescription
value?() => number

Controlled numeric value (single-thumb mode); omit for internal state.

default_value?number

Initial value when uncontrolled (default min).

on_change?(value: number) => void

Called when the quantized value changes (single-thumb mode).

on_commit?(value: number) => void

Called once when a drag or key adjustment settles (single-thumb mode).

values?() => readonly number[]

Controlled multi-thumb values (range slider mode).

default_values?readonly number[]

Initial multi-thumb values when uncontrolled.

on_values_change?(values: readonly number[]) => void

Called when multi-thumb values change.

on_values_commit?(values: readonly number[]) => void

Called once when a multi-thumb drag or key adjustment settles.

min?number | (() => number)

Minimum value (default 0).

max?number | (() => number)

Maximum value (default 100).

step?number | (() => number)

Step increment (default 1).

orientation?'horizontal' | 'vertical'

Orientation ('horizontal' default, or 'vertical').

disabled?() => boolean

Disabled state.

label?string

Accessible label.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/slider.svelte.ts:8

model

SourceColumns type

type SourceColumns<S> = S extends string ? RecordOf<S> & {
    readonly [M in ManyOf<S>]: readonly Row[];
} : SourceRow<S>;

A model's declared cells, including many layers; other sources retain their own row fields.

Source: packages/ui/src/model/types.ts:59

SourceRow type

type SourceRow<S> = S extends string ? RowOf<S> & Values : S extends Query<infer T> ? SourcePageRow<T[keyof T]> : S extends readonly (infer R extends Values)[] ? R : Values;

The row proved by the actual source supplied to a view.

Source: packages/ui/src/model/types.ts:55

behaviors

Span type

type Span = {
    readonly id: string;
    readonly track: string;
    readonly start: number;
    readonly end: number;
};

A range placed on a named track (calendar event, Gantt bar, room booking).

Members

NameTypeDescription
idstring
trackstring
startnumber
endnumber

Source: packages/ui/src/behaviors/canvas.svelte.ts:263

SpansBehavior type

type SpansBehavior<S extends Span = Span> = ReturnType<typeof create_spans<S>>;

Return value of create_spans.

Members

NameTypeDescription
spansreadonly S[]
activestring | null
update_span(id: string, patch: Partial<Pick<Span, "track" | "start" | "end">>, action: "move" | "resize", commitNow?: boolean) => void
create(track: string, start: number, end: number) => void
remove(id: string) => void
cancel() => void
span_attrs(span: S) => { tabindex: number; 'data-span-id': string; 'data-dragging': string | undefined; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/canvas.svelte.ts:318

SpansOptions type

type SpansOptions<S extends Span = Span> = {
    readonly tracks: () => readonly string[];
    readonly spans: () => readonly S[];
    readonly min: number;
    readonly max: number;
    readonly step?: number;
    readonly min_duration?: number;
    readonly on_commit: (next: readonly S[], action: 'draw' | 'move' | 'resize' | 'delete', id: string) => void;
    readonly create_span?: (draft: Span) => S;
};

Options for create_spans.

Members

NameTypeDescription
tracks() => readonly string[]
spans() => readonly S[]
minnumber
maxnumber
step?number
min_duration?number
on_commit(next: readonly S[], action: 'draw' | 'move' | 'resize' | 'delete', id: string) => void
create_span?(draft: Span) => S

Source: packages/ui/src/behaviors/canvas.svelte.ts:306

SpatialDirection type

type SpatialDirection = 'up' | 'down' | 'left' | 'right';

Cardinal direction for nearest_in_direction / spatial_move.

Source: packages/ui/src/behaviors/micro.svelte.ts:493

SpatialRect type

type SpatialRect = {
    readonly left: number;
    readonly top: number;
    readonly width: number;
    readonly height: number;
};

Bounding box used by geometric spatial navigation.

Members

NameTypeDescription
leftnumber
topnumber
widthnumber
heightnumber

Source: packages/ui/src/behaviors/micro.svelte.ts:485

primitives

Spinner component

component Spinner(props: $$ComponentProps)

A loading spinner.

Props

NameTypeDescription
class?string

Classes on the svg; default size 1rem.

label?string

Its accessible name (a status role); default Loading.

Source: packages/ui/src/primitives/spinner/spinner.svelte:1

behaviors

SpringState type

type SpringState = {
    readonly position: number;
    readonly velocity: number;
    readonly settled: boolean;
};

Spring state for one-dimensional spring integration.

Members

NameTypeDescription
positionnumber
velocitynumber
settledboolean

Source: packages/ui/src/behaviors/motion.svelte.ts:69

kinds

StateBadge component

component StateBadge(props: StateBadgeProps)

A state field's value as a coloured pill, in its words (label, else the catalog's, else the value humanized).

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
statestring

The state value; its tone picks the colour.

label?string

Overrides the shown words.

class?string

Classes for the badge.

Source: packages/ui/src/kinds/state-badge.svelte:1

behaviors

StickToBottom type

type StickToBottom = ReturnType<typeof create_stick_to_bottom>;

Return value of create_stick_to_bottom.

Members

NameTypeDescription
stuckboolean
scroll_to_bottom(behavior?: ScrollBehavior) => void
viewportAttachment<HTMLElement>

Source: packages/ui/src/behaviors/stick-to-bottom.svelte.ts:15

StickToBottomOptions type

type StickToBottomOptions = {
    /** Pixel distance from the bottom edge still considered latched (default `32`). */
    threshold?: number;
    /** Start latched to the bottom (default `true`). */
    initial?: boolean;
};

Options for create_stick_to_bottom.

Members

NameTypeDescription
threshold?number

Pixel distance from the bottom edge still considered latched (default 32).

initial?boolean

Start latched to the bottom (default true).

Source: packages/ui/src/behaviors/stick-to-bottom.svelte.ts:7

kinds

StructuredData component

component StructuredData(props: StructuredDataProps)

One compact schema, value, editor and inline comparison. Record lists use the model Table itself; leaf values retain the workspace's native kinds, custom renderers and inherited controls.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
schema?JsonSchema

A JSON Schema for the value; in schema mode, the schema itself shown (or edited with on_change).

  • $schema?: string
  • $ref?: string
  • type?: string | readonly string[]
  • format?: string
  • title?: string
  • description?: string
  • unit?: string
  • properties?: Readonly<Record<string, JsonSchema>>
  • additionalProperties?: JsonSchema
  • required?: readonly string[]
  • items?: JsonSchema
  • prefixItems?: readonly JsonSchema[]
  • allOf?: readonly JsonSchema[]
  • anyOf?: readonly JsonSchema[]
  • oneOf?: readonly JsonSchema[]
  • if?: JsonSchema
  • then?: JsonSchema
  • else?: JsonSchema
  • not?: JsonSchema
  • enum?: readonly Json[]
  • const?: Json
  • default?: Json
  • readOnly?: boolean
  • minimum?: number
  • maximum?: number
  • exclusiveMinimum?: number
  • exclusiveMaximum?: number
  • minLength?: number
  • maxLength?: number
  • minItems?: number
  • maxItems?: number
  • minProperties?: number
  • maxProperties?: number
  • x-norbital?: { readonly datatype?: string; readonly section?: string; readonly advanced?: boolean; readonly order?: number; }
kind?Kind

A native kind for the value; with neither schema nor kind, the structure is inferred from the value.

value?Value

The current data.

before?Value

The prior data compared against in diff mode.

mode?'view' | 'edit' | 'schema' | 'diff'

view, edit, schema (the schema as a field table) or diff; defaults to edit with on_change, else view.

on_change?((next: Value) => void) | undefined

Called with the whole next value on any nested edit.

name?string

The field name; nested controls are named, and errors keyed, by dotted path under it.

id?string

The id on the root control.

readonly?boolean

Renders every leaf read-only; inherited by nested controls.

disabled?boolean

Renders every leaf muted and inert; inherited by nested controls.

errors?ReadonlyMap<string, string>

Problems by dotted path; defaults to the enclosing form's field errors.

row?Values

The owning row, for money currency siblings and custom renderers.

before_row?Values

Prior row context for native currency and related-value formatting.

array_keys?ArrayKeys

Explicit row identities, indexed by JSON Pointer. Unkeyed lists compare by position.

changes_only?boolean

In diff mode, hide unchanged fields and list items.

create?boolean

A new record: schema defaults fill as the editor opens; an edit offers them by control instead.

root?JsonSchema

Internal recursion context.

  • $schema?: string
  • $ref?: string
  • type?: string | readonly string[]
  • format?: string
  • title?: string
  • description?: string
  • unit?: string
  • properties?: Readonly<Record<string, JsonSchema>>
  • additionalProperties?: JsonSchema
  • required?: readonly string[]
  • items?: JsonSchema
  • prefixItems?: readonly JsonSchema[]
  • allOf?: readonly JsonSchema[]
  • anyOf?: readonly JsonSchema[]
  • oneOf?: readonly JsonSchema[]
  • if?: JsonSchema
  • then?: JsonSchema
  • else?: JsonSchema
  • not?: JsonSchema
  • enum?: readonly Json[]
  • const?: Json
  • default?: Json
  • readOnly?: boolean
  • minimum?: number
  • maximum?: number
  • exclusiveMinimum?: number
  • exclusiveMaximum?: number
  • minLength?: number
  • maxLength?: number
  • minItems?: number
  • maxItems?: number
  • minProperties?: number
  • maxProperties?: number
  • x-norbital?: { readonly datatype?: string; readonly section?: string; readonly advanced?: boolean; readonly order?: number; }
path?string

Internal: this node's JSON Pointer within root.

depth?number

Internal: nesting level; past 24 the value falls back to raw JSON.

heading?string

A collapsible section title wrapped around the content.

frame?boolean

false: one border only, the outer one: a first-level section lies flat inside it instead of being its own card.

Source: packages/ui/src/kinds/structured-data.svelte:1

studio

StudioMount type

type StudioMount = {
    update(props: StudioProps): void;
    unmount(): Promise<void>;
};

A mounted Studio: update carries a moved URL in without a remount, so unsaved edits survive a back navigation.

Members

NameTypeDescription
update(props: StudioProps) => void
unmount() => Promise<void>

Source: packages/ui/src/studio/slot.ts:27

StudioProps type

type StudioProps = {
    /** The shell's copy: the workspace's messages, then the framework's. A key it lacks comes back unchanged. */
    readonly t: (key: string) => string;
    readonly locale: string;
    /** ui's chrome strings in that locale. */
    readonly ui_text: {
        readonly [key in UiTextKey]?: string;
    };
    readonly tab: StudioTab;
    readonly on_tab: (tab: StudioTab) => void;
    /** The file the URL names. */
    readonly file: string | null;
    readonly on_file: (path: string) => void;
    readonly admin: boolean;
    /** Hands a request to Norbius and sends it; `null` where the viewer has no Norbius. */
    readonly on_ask: ((prompt: string) => void) | null;
    /** A host's own authenticated endpoint for the Studio routes; absent: the workspace's. */
    readonly base?: string;
};

The plain values the shell hands a host's Studio bundle: copy, locale, the open tab and file, and navigation callbacks.

Members

NameTypeDescription
t(key: string) => string

The shell's copy: the workspace's messages, then the framework's. A key it lacks comes back unchanged.

localestring
ui_text{ readonly [key in UiTextKey]?: string; }

ui's chrome strings in that locale.

tabStudioTab
on_tab(tab: StudioTab) => void
filestring | null

The file the URL names.

on_file(path: string) => void
adminboolean
on_ask((prompt: string) => void) | null

Hands a request to Norbius and sends it; null where the viewer has no Norbius.

base?string

A host's own authenticated endpoint for the Studio routes; absent: the workspace's.

Source: packages/ui/src/studio/slot.ts:9

StudioSlot component

component StudioSlot(props: $$ComponentProps)

Studio's place in a page: an element the host's Studio bundle mounts into with props. The bundle path is read once; new props update the mounted Studio without a remount. It unmounts on leave and shows an empty state when the bundle cannot be loaded.

Props

NameTypeDescription
bundlestring | undefined

The bundle's browser URL; absent: this host serves none.

propsStudioProps

What the shell hands Studio; a change updates the mounted Studio in place.

  • t: (key: string) => string

    The shell's copy: the workspace's messages, then the framework's. A key it lacks comes back unchanged.

  • locale: string
  • ui_text: { readonly [key in UiTextKey]?: string; }

    ui's chrome strings in that locale.

  • tab: StudioTab
  • on_tab: (tab: StudioTab) => void
  • file: string | null

    The file the URL names.

  • on_file: (path: string) => void
  • admin: boolean
  • on_ask: ((prompt: string) => void) | null

    Hands a request to Norbius and sends it; null where the viewer has no Norbius.

  • base?: string

    A host's own authenticated endpoint for the Studio routes; absent: the workspace's.

Source: packages/ui/src/studio/StudioSlot.svelte:1

layout

Surface component

component Surface(props: SurfaceProps)

A semantic surface container (card, subtle, muted, lane, popover, transparent) with standardized hairline border, corner geometry (control 6px, overlay 12px, inset 4px) and spacing — eliminating raw Tailwind border/radius/dark: utility soup in tenant pages.

Props

NameTypeDescription
children?import('svelte').Snippet

Inner surface content.

tone?SurfaceTone

Semantic surface fill (default 'card').

padding?SurfacePadding

Inner padding scale (default 'md').

radius?SurfaceRadius

Corner geometry token (default 'control' — 6px).

bordered?boolean

Hairline semantic border (default true).

interactive?boolean

Subtle hover highlight for clickable/interactive surfaces (default false).

as?'div' | 'section' | 'article' | 'aside' | 'li' | 'header' | 'footer'

Underlying HTML element (default 'div').

Example

<Surface tone="card" padding="md" radius="control">
<Stack gap="sm">...</Stack>
</Surface>

Source: packages/ui/src/layout/surface.svelte:1

SurfacePadding type

type SurfacePadding = 'none' | 'xs' | 'sm' | 'md' | 'lg';

Inner padding scale for Surface.

Source: packages/ui/src/layout/surface.svelte:18

SurfaceProps type

type SurfaceProps = HTMLAttributes<HTMLElement> & {
    /** Semantic surface fill (default `'card'`). */
    tone?: SurfaceTone;
    /** Inner padding scale (default `'md'`). */
    padding?: SurfacePadding;
    /** Corner geometry token (default `'control'` — 6px). */
    radius?: SurfaceRadius;
    /** Hairline semantic border (default `true`). */
    bordered?: boolean;
    /** Subtle hover highlight for clickable/interactive surfaces (default `false`). */
    interactive?: boolean;
    /** Underlying HTML element (default `'div'`). */
    as?: 'div' | 'section' | 'article' | 'aside' | 'li' | 'header' | 'footer';
    /** Inner surface content. */
    children?: Snippet;
};

Props accepted by Surface.

Members

NameTypeDescription
children?import('svelte').Snippet

Inner surface content.

tone?SurfaceTone

Semantic surface fill (default 'card').

padding?SurfacePadding

Inner padding scale (default 'md').

radius?SurfaceRadius

Corner geometry token (default 'control' — 6px).

bordered?boolean

Hairline semantic border (default true).

interactive?boolean

Subtle hover highlight for clickable/interactive surfaces (default false).

as?'div' | 'section' | 'article' | 'aside' | 'li' | 'header' | 'footer'

Underlying HTML element (default 'div').

Source: packages/ui/src/layout/surface.svelte:23

SurfaceRadius type

type SurfaceRadius = 'control' | 'overlay' | 'inset' | 'none';

Corner geometry role for Surface.

Source: packages/ui/src/layout/surface.svelte:20

SurfaceTone type

type SurfaceTone = 'card' | 'subtle' | 'muted' | 'lane' | 'popover' | 'transparent';

Semantic surface fill role.

Source: packages/ui/src/layout/surface.svelte:16

behaviors

SwipeActions type

type SwipeActions = ReturnType<typeof create_swipe_actions>;

Return value of create_swipe_actions.

Members

NameTypeDescription
openSwipeOpen | null
offset{ readonly key: string; readonly x: number; } | null
close() => void
row(key: string) => Attachment<HTMLElement>
row_attrs(key: string) => { 'data-swipe-open': SwipeSide | undefined; style: string; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/canvas.svelte.ts:741

SwipeActionsOptions type

type SwipeActionsOptions = {
    /** Width in px of revealed action tray (default `120`). */
    readonly tray_width?: number;
    /** Fraction of tray width needed to snap open (default `0.5`). */
    readonly open_ratio?: number;
    /** Distance in px triggering immediate full-swipe action (default `220`). */
    readonly full_swipe_px?: number;
    /** Optional full-swipe callback (e.g. archive/delete). */
    readonly on_full_swipe?: (key: string, side: SwipeSide) => void;
};

Options for create_swipe_actions.

Members

NameTypeDescription
tray_width?number

Width in px of revealed action tray (default 120).

open_ratio?number

Fraction of tray width needed to snap open (default 0.5).

full_swipe_px?number

Distance in px triggering immediate full-swipe action (default 220).

on_full_swipe?(key: string, side: SwipeSide) => void

Optional full-swipe callback (e.g. archive/delete).

Source: packages/ui/src/behaviors/canvas.svelte.ts:729

SwipeOpen type

type SwipeOpen = {
    readonly key: string;
    readonly side: SwipeSide;
};

Currently revealed swipe row.

Members

NameTypeDescription
keystring
sideSwipeSide

Source: packages/ui/src/behaviors/canvas.svelte.ts:726

SwipeSide type

type SwipeSide = 'start' | 'end';

Side on which row swipe actions sit.

Source: packages/ui/src/behaviors/canvas.svelte.ts:723

SwitchOptions type

type SwitchOptions = {
    readonly checked?: () => boolean;
    readonly default_checked?: boolean;
    readonly on_change?: (checked: boolean) => void;
    readonly disabled?: () => boolean;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_switch.

Members

NameTypeDescription
checked?() => boolean
default_checked?boolean
on_change?(checked: boolean) => void
disabled?() => boolean
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:13

primitives

TAB_LEVEL const

const TAB_LEVEL: typeof TAB_LEVEL

The context key carrying the enclosing Tabs level; an overlay (a sheet) clears it to start a new hierarchy.

Source: packages/ui/src/primitives/tabs/level.ts:4

TabStrip component

component TabStrip(props: TabStripProps)

A tab strip without bodies, at the one tab size Tabs uses: links (href, the page's own navigation) or buttons that switch a view the caller renders. Its type follows the enclosing Tabs level, or level.

Props

NameTypeDescription
itemsreadonly TabStripItem[]

The items, in order; those that do not fit move to a More menu.

valuestring | undefined

The active item's name.

on_value_change?(value: string) => void

Called with the button item the user selects (links navigate instead).

labelstring

The strip's accessible name.

level?TabLevel

The type's level (1 default, 2 underline, 3 chips); omitted, one below the enclosing Tabs.

class?string

Classes on the list.

Source: packages/ui/src/primitives/tabs/tab-strip.svelte:1

table

Table component

component Table(props: TableProps<S, SourceRow<S>, SourceColumns<S>>)

A paged, searchable, filterable grid of a model's records, a read's rows or a local array, with its toolbar; on a phone it becomes a card list.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
ofS & TableSource<R & Partial<K>>

The rows: a model name (paged, filtered and sorted by the host, read in the viewer's output: default when held, else the first named output they hold), a bolt.query read, or a local array.

columns?readonly Col<R, K>[]

The columns in order. Default: every field the model exposes to the viewer.

where?S extends string ? WhereOf<S> : Where

The author's fixed scope: ANDed under every viewer filter, shown read-only in the view popover, never clearable.

hidden_where?S extends string ? WhereOf<S> : Where

A fixed scope ANDed under every reader filter like where, but not shown in the view popover.

initial_filter?S extends string ? WhereOf<S> : Where

Seed rows of the view popover the viewer may edit or clear; a cleared choice is kept in the URL.

order_by?S extends string ? OrderByOf<S> : OrderBy

The initial sort; a viewer's sort replaces it and clearing restores it.

page_size?10 | 25 | 50 | 100 | 200

Rows per page (default 25); the viewer's choice in the footer replaces it and is remembered.

layout?'responsive' | 'grid'

Financial reports retain a horizontally scrollable grid on narrow screens.

toolbar?Toolbar<R>

The chrome: title, description, search, filter and sort, the actions menu and New (ViewToolbar).

  • title?: string | false

    Default: the model's label.

  • error?: string

    A form group's semantic error: marks its title and replaces its info text until corrected.

  • description?: string | false

    Behind the info icon. Default: the model's declared description, else its model's.

  • search?: boolean

    Default on where the model declares search fields.

  • filter?: boolean

    The filter-and-sort popover. Default on.

  • actions?: readonly ToolbarItem<R>[] | false

    Author items in the actions menu, in a group of their own; false hides the menu.

  • export?: boolean

    "Export CSV" of the rows in view. Default on; replaced by "Export" when the model's file sync exports.

  • delete?: boolean

    "Delete selected records" when the model declares delete and the viewer may delete (turns selection on). Default on.

  • select?: boolean

    Record checkboxes (Table and Board). Default: on for permitted bulk edits, deletes or selection actions.

  • new?: boolean | (() => void)

    The New button: the record sheet in create mode, or the author's own (a prefilled create). Default: the viewer may create.

  • controls?: Snippet

    A view-local control (a grouping, a lane toggle), placed before search. The page scope (entity, period) is AppShell's actions; never actions.

  • trailing?: Snippet

    Compact task controls at the right edge, before New.

  • context?: { readonly [field: string]: Json; }

    What the view is scoped to ({ company_id, period }), handed to the model's file syncs: the import, its template and the export decode it against the sync's context fields. It narrows and defaults; it never authorizes.

footer?Snippet

A host-backed page may supply its own cursor controls in place of the default range and pager.

controlled?boolean

For a supplied row array, the caller owns filtering, sorting and paging; display those rows verbatim.

embedded?boolean

A controlled local matrix inside another surface: content height, no card, toolbar or footer.

row_class?(row: R) => string | undefined

Semantic row treatment, shared by the grid and narrow layout.

row_trailing?Snippet<[R]>

An overlay at the row's right edge, sticky while scrolling; revealed on hover or keyboard focus.

actions?readonly RowAction<R>[]

Per-row actions, in a menu at the row's end when there is more than one.

key?string

The URL parameter prefix; defaults to the source's name.

empty?Snippet

Replaces the default empty state (which offers New when the viewer may create).

on_open?(row: R) => void

A row click. Default: a model row opens its record sheet; other rows do not open.

on_change?(next: R[]) => void

Local arrays only: editable when given; each change is a fresh array.

add?() => R

Local arrays with on_change: the New button appends the row this returns.

remove?boolean

Local arrays with on_change: each row gets a Remove action.

Example

<Table {ctx} of="invoice" columns={['number', 'customer', 'total']} />

Source: packages/ui/src/table/Table.svelte:1

TablePager component

component TablePager(props: $$ComponentProps)

A paged view's pager: the page size, previous and next, and "Page X of Y" (pages unknown: "Page X").

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
sizenumber

Rows per page.

sizes?readonly number[]

The page sizes offered.

pagenumber

The page shown, from 1.

pages?number | null

The page count, or null when unknown.

has_previousboolean

A page comes before this one.

has_nextboolean

A page comes after this one.

on_size(size: number) => void

The viewer picked a page size.

on_previous() => void

Go to the previous page.

on_next() => void

Go to the next page.

Example

<TablePager {ctx} size={25} page={1} pages={4} has_previous={false} has_next on_size={…} on_previous={…} on_next={…} />

Source: packages/ui/src/table/TablePager.svelte:1

TableProps type

type TableProps<S = TableSource, R extends Values = RowIn<S>, K = ColumnsIn<S>> = {
    /** The page context (`ctx`), passed whole. */
    ctx: UiContext;
    /** The rows: a model name (paged, filtered and sorted by the host, read in the viewer's output: `default` when held, else the first named output they hold), a `bolt.query` read, or a local array. */
    of: S & TableSource<R & Partial<K>>;
    /** The columns in order. Default: every field the model exposes to the viewer. */
    columns?: readonly Col<R, K>[];
    /** The author's fixed scope: ANDed under every viewer filter, shown read-only in the view popover, never clearable. */
    where?: S extends string ? WhereOf<S> : Where;
    /** A fixed scope ANDed under every reader filter like `where`, but not shown in the view popover. */
    hidden_where?: S extends string ? WhereOf<S> : Where;
    /** Seed rows of the view popover the viewer may edit or clear; a cleared choice is kept in the URL. */
    initial_filter?: S extends string ? WhereOf<S> : Where;
    /** The initial sort; a viewer's sort replaces it and clearing restores it. */
    order_by?: S extends string ? OrderByOf<S> : OrderBy;
    /** Rows per page (default 25); the viewer's choice in the footer replaces it and is remembered. */
    page_size?: 10 | 25 | 50 | 100 | 200;
    /** Financial reports retain a horizontally scrollable grid on narrow screens. */
    layout?: 'responsive' | 'grid';
    /** The chrome: title, description, search, filter and s…

Typed by the source of names, including the native row and authored column field types.

Members

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

ofS & TableSource<R & Partial<K>>

The rows: a model name (paged, filtered and sorted by the host, read in the viewer's output: default when held, else the first named output they hold), a bolt.query read, or a local array.

columns?readonly Col<R, K>[]

The columns in order. Default: every field the model exposes to the viewer.

where?S extends string ? WhereOf<S> : Where

The author's fixed scope: ANDed under every viewer filter, shown read-only in the view popover, never clearable.

hidden_where?S extends string ? WhereOf<S> : Where

A fixed scope ANDed under every reader filter like where, but not shown in the view popover.

initial_filter?S extends string ? WhereOf<S> : Where

Seed rows of the view popover the viewer may edit or clear; a cleared choice is kept in the URL.

order_by?S extends string ? OrderByOf<S> : OrderBy

The initial sort; a viewer's sort replaces it and clearing restores it.

page_size?10 | 25 | 50 | 100 | 200

Rows per page (default 25); the viewer's choice in the footer replaces it and is remembered.

layout?'responsive' | 'grid'

Financial reports retain a horizontally scrollable grid on narrow screens.

toolbar?Toolbar<R>

The chrome: title, description, search, filter and sort, the actions menu and New (ViewToolbar).

footer?Snippet

A host-backed page may supply its own cursor controls in place of the default range and pager.

controlled?boolean

For a supplied row array, the caller owns filtering, sorting and paging; display those rows verbatim.

embedded?boolean

A controlled local matrix inside another surface: content height, no card, toolbar or footer.

row_class?(row: R) => string | undefined

Semantic row treatment, shared by the grid and narrow layout.

row_trailing?Snippet<[R]>

An overlay at the row's right edge, sticky while scrolling; revealed on hover or keyboard focus.

actions?readonly RowAction<R>[]

Per-row actions, in a menu at the row's end when there is more than one.

key?string

The URL parameter prefix; defaults to the source's name.

empty?Snippet

Replaces the default empty state (which offers New when the viewer may create).

on_open?(row: R) => void

A row click. Default: a model row opens its record sheet; other rows do not open.

on_change?(next: R[]) => void

Local arrays only: editable when given; each change is a fresh array.

add?() => R

Local arrays with on_change: the New button appends the row this returns.

remove?boolean

Local arrays with on_change: each row gets a Remove action.

Source: packages/ui/src/table/Table.svelte:86

read

TableSkeleton component

component TableSkeleton(props: { $$events?: { [evt: string]: CustomEvent<any>; } | undefined; $$slots?: {} | undefined; })

The shape of a short table page while its rows are read: a header band and six skeleton rows. It keeps the ready table's footprint, so the page does not jump when the answer arrives.

Source: packages/ui/src/read/TableSkeleton.svelte:1

primitives

Tabs component

component Tabs(props: TabsProps)

A tab strip with the selected tab's body; keep_alive tabs stay mounted while hidden.

Props

NameTypeDescription
tabsreadonly TabItem[]

The tabs, in order.

value?string

The selected tab's name; bindable. Omitted, the first enabled tab.

on_value_change?(value: string) => void

Called with the tab the user selects.

class?string

Classes on the root (the strip and body grid).

trailing?Snippet

Rendered at the list's end (a toolbar, a trailing action).

leading?Snippet

Rendered before the list (a scope picker the tabs read): the tabs then sit flush right, wrapping below on narrow.

level?TabLevel

The hierarchy level: 1 default (top), 2 underline, 3 chips. Omitted, it is one below the enclosing Tabs (1 at the top); an explicit level out of that order warns in the console.

orientation?'horizontal' | 'vertical'

vertical: a rail on the left of the body, in its level's type (a horizontal scroller on a narrow container). Omitted, horizontal: the body keeps the full width.

Source: packages/ui/src/primitives/tabs/tabs.svelte:1

studio

TestResults component

component TestResults(props: $$ComponentProps)

A Studio test run's report: its state, totals and duration, then each file and test with its error, failed files first and open. run absent reads as not yet run.

Props

NameTypeDescription
runStudioTestRun | undefined

The run to report; absent reads as not yet run.

  • state: Schema.Literals<readonly ["running", "passed", "failed", "empty"]>
  • id: Schema.String
  • files: Schema.$Array<Schema.Struct<{ readonly path: Schema.String; readonly state: Schema.Literals<readonly ["passed", "failed", "skipped"]>; readonly error: Schema.optionalKey<Schema.String>; readonly tests: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly state: Schema.Literals<readonly ["passed", "failed", "skipped"]>; readonly duration_ms: Schema.optionalKey<Schema.Finite>; reado…
  • commit: Schema.String
  • started_at: Schema.String
  • error?: Schema.optionalKey<Schema.String>
  • summary?: Schema.optionalKey<Schema.Struct<{ readonly files: Schema.Int; readonly total: Schema.Int; readonly passed: Schema.Int; readonly failed: Schema.Int; readonly skipped: Schema.Int; readonly duration_ms: Schema.Finite; }>>
  • finished_at?: Schema.optionalKey<Schema.String>
  • truncated?: Schema.optionalKey<Schema.Literal<true>>
t?(key: string) => string

Translates the report's English strings (keys are the English text). Default: identity.

Example

<TestResults run={state.tests} {t} />

Source: packages/ui/src/studio/TestResults.svelte:1

primitives

Textarea component

component Textarea(props: Omit<WithElementRef<HTMLTextareaAttributes>, "children">)

A multi-line text input, bindable value. readonly (or an enclosing readonly form) shows the text, copyable, with no field chrome; disabled keeps the box, muted.

Props

NameTypeDescription
ref?U | null

The rendered element; bindable (bind:ref).

Source: packages/ui/src/primitives/textarea/textarea.svelte:1

behaviors

TimeFieldBehavior type

type TimeFieldBehavior = ReturnType<typeof create_time_field>;

Return value of create_time_field.

Members

NameTypeDescription
segmentsreadonly DateTimeSegment[]
segment_ref(part: SegmentPart) => Attachment<HTMLElement>
segment_attrs(seg: DateTimeSegment) => { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segmen…

Source: packages/ui/src/behaviors/date-time.svelte.ts:71

TimeFieldOptions type

type TimeFieldOptions = {
    /** Controlled `Time` getter. */
    readonly value: () => Time | undefined;
    /** Called when the time value changes (or clears to `undefined`). */
    readonly on_change: (next: Time | undefined) => void;
    /** Editing precision: `'hour'` or `'minute'` (default `'minute'`). */
    readonly granularity?: () => 'hour' | 'minute';
    /** Disabled state. */
    readonly disabled?: () => boolean;
};

Options for create_time_field.

Members

NameTypeDescription
value() => Time | undefined

Controlled Time getter.

on_change(next: Time | undefined) => void

Called when the time value changes (or clears to undefined).

granularity?() => 'hour' | 'minute'

Editing precision: 'hour' or 'minute' (default 'minute').

disabled?() => boolean

Disabled state.

Source: packages/ui/src/behaviors/date-time.svelte.ts:59

kinds

TimeInput component

component TimeInput(props: TimeInputProps<TimeValue>)

Edits dates, instants, clocks or reporting months, singly or as an array.

Props

NameTypeDescription
max?string

The latest pickable value, in the stored format of of.

min?string

The earliest pickable value, in the stored format of of.

precision?Precision

The unit picked and emitted, snapped to its start (a field's declared precision): year, month and week (from Monday) pick from a unit grid, day from the calendar, hour a day and an hour; minute (the default of an instant or a time) as typed. An instant snaps in the viewer's zone.

of?'date' | 'instant' | 'time' | 'month'

date → YYYY-MM-DD; instant → ISO UTC; time → HH:MM; month → YYYY-MM.

readonly?boolean

Shows the value as copyable text; an enclosing readonly form sets it.

id?string

The id on the first segment, for <label for>.

invalid?boolean

Marks the control invalid.

disabled?boolean

Muted and inert.

ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
valuestring | null

The stored text, or null when empty. The ordered list of values; each entry edits on its own row.

on_change((next: string | null) => void) | ((next: readonly (string | null)[]) => void)

Called with the next stored text, or null when cleared. Called with the whole next list.

Example

```svelte
<TimeInput {ctx} of="date" precision="month" value={from} on_change={(next: string | null) => (from = next)} />
```

Source: packages/ui/src/kinds/time-input.svelte:1

TimeRangeInput component

component TimeRangeInput(props: TimeRangeInputProps)

Edits date, instant or clock ranges, singly or as an array, at the requested precision.

Props

NameTypeDescription
precision?Precision

The unit both ends are picked in (a field's declared precision), snapped: a date period runs from the first day of its first unit to the last day of its last; an instant period from the start of its first unit to the start of the unit after its last (closed-open). year, month, week pick from unit grids; day and hour from the calendar.

readonly?boolean

Shows the value as copyable text; an enclosing readonly form sets it.

id?string

The id on the trigger, for <label for>.

invalid?boolean

Marks the control invalid.

disabled?boolean

Muted and inert.

ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
variant?'picker' | 'input'

A range summary trigger; use input for directly editable date/time segments.

of'date' | 'instant' | 'time'

date → { from, to } (inclusive); instant → { start, end } (closed-open); time → { start, end } clocks.

valueValue

One range, or a list of ranges each edited on its own row.

on_change(next: Value) => void

Called with the next range or list, matching the shape of value.

aria-label?string

Accessible name for the range control.

Source: packages/ui/src/kinds/time-range-input.svelte:1

timeline

Timeline component

component Timeline(props: { entries: readonly T[]; label?: string; item?: Snippet<[T]> | undefined; trailing?: Snippet<[T]> | undefined; empty?: Snippet; })

A vertical timeline for chronological series: approval logs, revision history, dated contracts/facts, change logs, and activity streams. Each entry is an icon node on a shared rail with a header line and optional expandable or always-visible content below.

Props

NameTypeDescription
entriesreadonly T[]

Newest or oldest first, as the owner orders them.

label?string

The list's accessible name.

item?Snippet<[T]>

Optional body rendered under an entry's header (shown only while expanded when disclosure is enabled).

trailing?Snippet<[T]>

Optional trailing controls on the entry header row, outside its pick/toggle button.

empty?Snippet

Shown when entries is empty.

Source: packages/ui/src/timeline/Timeline.svelte:1

behaviors

TimelineBehavior type

type TimelineBehavior = ReturnType<typeof create_timeline>;

Return value of create_timeline.

Members

NameTypeDescription
expandedreadonly string[]
is_expanded(id: string) => boolean
toggle(id: string) => void
item(key: string) => Attachment<HTMLElement>
root_attrs() => { role: "feed"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; }
item_attrs(id: string) => { role: "article"; "aria-expanded": boolean; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1344

timeline

TimelineEntry type

type TimelineEntry = {
    /** Stable list key for this entry. */
    readonly key: string;
    /** Optional group label (e.g. a formatted day) clustering consecutive entries that share the same day under one header on the rail. */
    readonly group?: string;
    /** Built-in action glyph (approvals and record history); optional when `icon` is given. */
    readonly action?: TimelineAction;
    /** Iconify icon name (e.g. `lucide:calendar`) for domain timelines; overrides `action`. */
    readonly icon?: string;
    /** Semantic ring and icon colour for domain entries (`default` muted, `brand`, `info`, `success`, `warning`, `danger`). */
    readonly tone?: TimelineTone;
    /** Visual progression for upcoming/active approval steps; absent for past entries. */
    readonly status?: 'active' | 'changes' | 'future';
    /** Primary headline shown above or beside `line` for domain timelines (date, version, subject). */
    readonly title?: string;
    /** Quiet label parts joined with ` · ` (what, who, when). */
    readonly line?: readonly string[];
    /** The payload that matters, quoted: a decision's reason. */
    readonly quote?: string | null;
    /** Quiet notes under the line (changed fields, a rollback), each tagged `data-note={kind}`. */
    readonly notes?: readonly {
        readonly kind: string;
        readonly text: string;
        readonly warn?: boolean;
    }[];
    /** A short mark at the line's end ("Current", "In force"); pass `variant` to render as a `B…

One entry on a vertical timeline: an icon node, a header line (title and/or quiet metadata parts), and optional payload or body below.

Members

NameTypeDescription
keystring

Stable list key for this entry.

group?string

Optional group label (e.g. a formatted day) clustering consecutive entries that share the same day under one header on the rail.

action?TimelineAction

Built-in action glyph (approvals and record history); optional when icon is given.

icon?string

Iconify icon name (e.g. lucide:calendar) for domain timelines; overrides action.

tone?TimelineTone

Semantic ring and icon colour for domain entries (default muted, brand, info, success, warning, danger).

status?'active' | 'changes' | 'future'

Visual progression for upcoming/active approval steps; absent for past entries.

title?string

Primary headline shown above or beside line for domain timelines (date, version, subject).

line?readonly string[]

Quiet label parts joined with · (what, who, when).

quote?string | null

The payload that matters, quoted: a decision's reason.

notes?readonly { readonly kind: string; readonly text: string; readonly warn?: boolean; }[]

Quiet notes under the line (changed fields, a rollback), each tagged data-note={kind}.

mark?{ readonly text: string; readonly warn?: boolean; readonly variant?: BadgeVariant; }

A short mark at the line's end ("Current", "In force"); pass variant to render as a Badge.

current?boolean

The entry the view shows now.

expanded?boolean

Disclosure state when the entry expands in place; omit for always-open or header-only entries.

ontoggle?() => void

Toggles an expandable entry in place.

onpick?() => void

Picking the entry (opens a record or selects a revision).

data?Readonly<Record<`data-${string}`, string | number | boolean>>

The entry's own data-* hooks.

Source: packages/ui/src/timeline/timeline.ts:30

behaviors

TimelineOptions type

type TimelineOptions = {
    readonly items: () => readonly string[];
    readonly default_expanded?: readonly string[];
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_timeline.

Members

NameTypeDescription
items() => readonly string[]
default_expanded?readonly string[]
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1336

timeline

TimelineTone type

type TimelineTone = 'default' | 'brand' | 'info' | 'success' | 'warning' | 'danger';

Semantic tone of a timeline node's ring and icon.

Source: packages/ui/src/timeline/timeline.ts:11

toast

Toaster component

component Toaster(props: Record<string, never>)

The page's toasts, bottom right (bottom centre on a phone, above the safe area). Mount one, in the shell.

Source: packages/ui/src/toast/toaster.svelte:1

behaviors

ToggleGroupOptions type

type ToggleGroupOptions = {
    readonly items: () => readonly string[];
    readonly mode?: 'single' | 'multiple';
    readonly value?: () => readonly string[];
    readonly default_value?: readonly string[];
    readonly on_change?: (values: readonly string[]) => void;
    readonly orientation?: RovingOrientation;
    readonly disabled?: (key: string) => boolean;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_toggle_group.

Members

NameTypeDescription
items() => readonly string[]
mode?'single' | 'multiple'
value?() => readonly string[]
default_value?readonly string[]
on_change?(values: readonly string[]) => void
orientation?RovingOrientation
disabled?(key: string) => boolean
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:170

TokenInput type

type TokenInput = ReturnType<typeof create_token_input>;

Return value of create_token_input.

Members

NameTypeDescription
valuesreadonly string[]
input_textstring
active_indexnumber | null
editing_indexnumber | null
editing_textstring
errorstring | null
add(raw: string) => boolean
remove_at(index: number) => void
commit_input() => void
start_edit(index: number) => void
commit_edit() => void
cancel_edit() => void
inputAttachment<HTMLInputElement>
chip(index: number) => Attachment<HTMLElement>
input_attrs() => { value: string; disabled: true | undefined; "aria-label": string | undefined; onfocus: () => void; oninput: (event: Event) => void; onpaste: (event: ClipboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; }
chip_attrs(index: number) => { tabindex: number; "data-active": string | undefined; "data-editing": string | undefined; onfocus: () => void; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:38

TokenInputOptions type

type TokenInputOptions = {
    /** Controlled tokens; omit for internal state. */
    readonly value?: () => readonly string[];
    /** Initial tokens when uncontrolled. */
    readonly default_value?: readonly string[];
    /** Called whenever tokens change. */
    readonly on_change?: (next: readonly string[]) => void;
    /** Delimiter characters that split tokens (default `[',']`). */
    readonly delimiters?: readonly string[];
    /** Allow duplicate tokens (default `false`). */
    readonly allow_duplicates?: boolean;
    /** Maximum token count (optional). */
    readonly max?: number;
    /** Optional validator returning an error message string when rejected, or `null`/`undefined` if valid. */
    readonly validate?: (token: string) => string | null | undefined;
    /** Disabled state. */
    readonly disabled?: () => boolean;
    /** Accessible label. */
    readonly label?: string;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_token_input.

Members

NameTypeDescription
value?() => readonly string[]

Controlled tokens; omit for internal state.

default_value?readonly string[]

Initial tokens when uncontrolled.

on_change?(next: readonly string[]) => void

Called whenever tokens change.

delimiters?readonly string[]

Delimiter characters that split tokens (default [',']).

allow_duplicates?boolean

Allow duplicate tokens (default false).

max?number

Maximum token count (optional).

validate?(token: string) => string | null | undefined

Optional validator returning an error message string when rejected, or null/undefined if valid.

disabled?() => boolean

Disabled state.

label?string

Accessible label.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:14

model

Toolbar type

type Toolbar<R = Row> = false | {
    /** Default: the model's label. */
    title?: string | false;
    /** A form group's semantic error: marks its title and replaces its info text until corrected. */
    error?: string;
    /** Behind the info icon. Default: the model's declared description, else its model's. */
    description?: string | false;
    /** Default on where the model declares search fields. */
    search?: boolean;
    /** The filter-and-sort popover. Default on. */
    filter?: boolean;
    /** Author items in the actions menu, in a group of their own; `false` hides the menu. */
    actions?: readonly ToolbarItem<R>[] | false;
    /** "Export CSV" of the rows in view. Default on; replaced by "Export" when the model's file sync exports. */
    export?: boolean;
    /** "Delete selected records" when the model declares delete and the viewer may delete (turns selection on). Default on. */
    delete?: boolean;
    /** Record checkboxes (`Table` and `Board`). Default: on for permitted bulk edits, deletes or selection actions. */
    select?: boolean;
    /** The New button: the record sheet in create mode, or the author's own (a prefilled create). Default: the viewer may create. */
    new?: boolean | (() => void);
    /** A view-local control (a grouping, a lane toggle), placed before search. The page scope (entity, period) is AppShell's `actions`; never actions. */
    controls?: Snippet;
    /** Compact task controls at the right edge, before New. */
    trai…

A view's whole chrome, one shape on Table, Board and Map. Every key defaults from the model's declaration and the viewer's grants; toolbar={false} renders none. A model with a declared file sync gets Import, Export and Template automatically (the sync's parsers and context); do not wire file buttons again.

Source: packages/ui/src/model/ViewToolbar.svelte:69

ToolbarItem type

type ToolbarItem<R = Row> = {
    /** An Iconify id (`lucide:upload`). */
    icon: string;
    /** The item's label. */
    name: string;
    /** One line under the name. */
    description?: string;
    /** The handler, given the selected record ids (empty without selection). */
    run: (selected: IdIn<R>[]) => Effect.Effect<unknown, Error> | void;
    /** Turns row selection on; the item is disabled until records are selected. */
    requires_selection?: true;
    /** Why the item cannot run now (over this selection), or null when it can; shown instead of `description`. */
    disabled?: (selected: IdIn<R>[]) => string | null;
};

An author's actions-menu item: an icon, a name, a line of description and the handler itself. The menu owns the rest: a promise the handler returns is the item's pending state, a rejection or a refused outcome its error (in place and as a toast), an Outcome (ctx.act) is toasted, and a run handle (ctx.run) shows its run under the toolbar. A handler that returns nothing closes the menu (it opened a sheet or a file picker of its own).

Members

NameTypeDescription
iconstring

An Iconify id (lucide:upload).

namestring

The item's label.

description?string

One line under the name.

run(selected: IdIn<R>[]) => Effect.Effect<unknown, Error> | void

The handler, given the selected record ids (empty without selection).

requires_selection?true

Turns row selection on; the item is disabled until records are selected.

disabled?(selected: IdIn<R>[]) => string | null

Why the item cannot run now (over this selection), or null when it can; shown instead of description.

Source: packages/ui/src/model/ViewToolbar.svelte:50

behaviors

ToolbarOptions type

type ToolbarOptions = {
    readonly items: () => readonly string[];
    readonly orientation?: RovingOrientation;
    readonly disabled?: (key: string) => boolean;
    readonly label?: string;
};

Options for create_toolbar.

Members

NameTypeDescription
items() => readonly string[]
orientation?RovingOrientation
disabled?(key: string) => boolean
label?string

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:493

model

ToolbarSearch component

component ToolbarSearch(props: ToolbarSearchProps)

A toolbar search trigger and popover with a bound text value or a custom indexed-search body.

Props

NameTypeDescription
open?boolean

Whether the popover is open (bindable). Enter or Escape in the default input closes it.

value?string

The search text (bindable), edited by the default input.

labelstring

The trigger's hint and accessible name, and the input's placeholder.

active?boolean

Highlights the trigger as searching. Default: value is not empty.

panel_class?string

Extra classes on the popover panel.

on_open_auto_focus?ComponentProps<typeof PopoverControls.Content>['on_open_auto_focus']

Replaces the default focus of the input when the popover opens.

children?Snippet

A custom body in place of the default input.

Example

<ToolbarSearch label="Search people" bind:value={q} />

Source: packages/ui/src/model/toolbar/ToolbarSearch.svelte:1

primitives

Tooltip component

component Tooltip(props: $$ComponentProps)

A tooltip on hover or focus of its trigger, with a text or snippet body; where nothing hovers, a tap opens it as a popover.

Props

NameTypeDescription
open?boolean

Controlled open state; bindable.

delay_duration?number

Hover open delay in ms.

disabled?boolean

When true, renders the trigger without a tooltip.

ignore_non_keyboard_focus?boolean

Only open on keyboard :focus-visible, not pointer clicks.

side?FloatingSide

The trigger's side it opens on; default top.

side_offset?number

The gap from the trigger, in px; default 4.

align?FloatingAlign

Its alignment along that side: start, center or end.

avoid_collisions?boolean

Flip/shift the content to keep it on screen (default true).

collision_padding?number

The viewport gutter kept while avoiding collisions, in px; default 8.

text?string | undefined

Simple string body. Prefer content for richer markup.

content_class?string

Classes on the content surface.

triggerSnippet<[{ props: Record<string, unknown>; }]>

The element it describes; spread the given props onto it.

content?Snippet

A rich body, in place of text.

on_open_change?(open: boolean) => void

Called as it opens or closes.

on_open_change_complete?(open: boolean) => void

Called once open or close settles.

disable_hoverable_content?boolean

Close immediately as the pointer leaves the trigger.

disable_close_on_trigger_click?boolean

Keep an open tooltip open when clicking the trigger.

Source: packages/ui/src/primitives/tooltip/tooltip.svelte:1

behaviors

Transfer type

type Transfer = ReturnType<typeof create_transfer>;

Return value of create_transfer.

Members

NameTypeDescription
listsReadonly<Record<string, readonly string[]>>
draftTransferDraft | null
draggingstring | null
move(key: string, to: string, index: number, commitNow?: boolean) => void
container(id: string) => Attachment<HTMLElement>
item(key: string) => Attachment<HTMLElement>
item_attrs(key: string) => { "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/drag.svelte.ts:281

TransferDraft type

type TransferDraft = {
    readonly key: string;
    readonly from: string;
    readonly lists: TransferLists;
};

Live draft while an item is being transferred across containers.

Members

NameTypeDescription
keystring
fromstring
listsTransferLists

Source: packages/ui/src/behaviors/drag.svelte.ts:258

TransferLists type

type TransferLists = Readonly<Record<string, readonly string[]>>;

Map of container keys to their ordered item keys.

Source: packages/ui/src/behaviors/drag.svelte.ts:255

TransferOptions type

type TransferOptions = {
    /** Ordered container keys (e.g. Kanban lane ids). */
    readonly containers: () => readonly string[];
    /** Current lists per container. */
    readonly lists: () => TransferLists;
    /** Called once on drop or keyboard commit with the next container map. */
    readonly on_commit: (next: TransferLists, move: {
        readonly key: string;
        readonly from: string;
        readonly to: string;
        readonly index: number;
    }) => void;
    /** Optional predicate rejecting moves into a container. */
    readonly can_drop?: (key: string, toContainer: string) => boolean;
    /** Human-readable item label for screen-reader announcements. */
    readonly item_label?: (key: string) => string;
    /** Human-readable container label for screen-reader announcements. */
    readonly container_label?: (container: string) => string;
};

Options for create_transfer.

Members

NameTypeDescription
containers() => readonly string[]

Ordered container keys (e.g. Kanban lane ids).

lists() => TransferLists

Current lists per container.

on_commit(next: TransferLists, move: { readonly key: string; readonly from: string; readonly to: string; readonly index: number; }) => void

Called once on drop or keyboard commit with the next container map.

can_drop?(key: string, toContainer: string) => boolean

Optional predicate rejecting moves into a container.

item_label?(key: string) => string

Human-readable item label for screen-reader announcements.

container_label?(container: string) => string

Human-readable container label for screen-reader announcements.

Source: packages/ui/src/behaviors/drag.svelte.ts:265

Tree type

type Tree<T = unknown> = ReturnType<typeof create_tree<T>>;

Return value of create_tree.

Members

NameTypeDescription
rowsFlatTreeRow<T>[]
expandedreadonly string[]
selectedreadonly string[]
activestring
expand(id: string) => void
collapse(id: string) => void
toggle_expand(id: string) => void
is_expanded(id: string) => boolean
is_selected(key: string) => boolean
item(key: string) => import("svelte/attachments").Attachment<HTMLElement>
root_attrs() => { role: "tree"; onkeydown: (event: KeyboardEvent) => void; }
item_attrs(id: string) => { role: "treeitem"; "aria-level": number; "aria-expanded": boolean | undefined; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; onclick: (event: MouseEvent) => void; }

Source: packages/ui/src/behaviors/tree.svelte.ts:57

TreeCheckStrategy type

type TreeCheckStrategy = 'leaf' | 'trunk' | 'branch' | 'independent';

Tri-state checkbox cascade strategy for hierarchical trees.

Source: packages/ui/src/behaviors/tree.svelte.ts:31

TreeCheckedState type

type TreeCheckedState = boolean | 'indeterminate';

Tri-state checkbox value for one tree node.

Source: packages/ui/src/behaviors/tree.svelte.ts:34

TreeNode type

type TreeNode<T = unknown> = {
    readonly id: string;
    readonly label: string;
    readonly children?: readonly TreeNode<T>[];
    readonly disabled?: boolean;
    readonly data?: T;
};

One hierarchical node supplied to create_tree.

Members

NameTypeDescription
idstring
labelstring
children?readonly TreeNode<T>[]
disabled?boolean
data?T

Source: packages/ui/src/behaviors/tree.svelte.ts:10

TreeOptions type

type TreeOptions<T = unknown> = {
    /** Root tree nodes. */
    readonly nodes: () => readonly TreeNode<T>[];
    /** Initial expanded node ids. */
    readonly default_expanded?: readonly string[];
    /** Controlled expanded node ids. */
    readonly expanded?: () => readonly string[];
    /** Called when expanded node ids change. */
    readonly on_expanded_change?: (ids: readonly string[]) => void;
    /** Selection mode (default `'single'`). */
    readonly mode?: SelectionMode;
    /** Controlled selected ids. */
    readonly selected?: () => readonly string[];
    /** Called when selection changes. */
    readonly on_select?: (ids: readonly string[]) => void;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_tree.

Members

NameTypeDescription
nodes() => readonly TreeNode<T>[]

Root tree nodes.

default_expanded?readonly string[]

Initial expanded node ids.

expanded?() => readonly string[]

Controlled expanded node ids.

on_expanded_change?(ids: readonly string[]) => void

Called when expanded node ids change.

mode?SelectionMode

Selection mode (default 'single').

selected?() => readonly string[]

Controlled selected ids.

on_select?(ids: readonly string[]) => void

Called when selection changes.

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/tree.svelte.ts:37

TreePlace type

type TreePlace = {
    readonly target: string;
    readonly position: 'before' | 'inside' | 'after';
};

Drop placement relative to a target tree row.

Members

NameTypeDescription
targetstring
position'before' | 'inside' | 'after'

Source: packages/ui/src/behaviors/drag.svelte.ts:466

TreeReorder type

type TreeReorder = ReturnType<typeof create_tree_reorder>;

Return value of create_tree_reorder.

Members

NameTypeDescription
draggingstring | null
dropTreePlace | null
commit(id: string, place: TreePlace) => void
item(id: string) => Attachment<HTMLElement>
item_attrs(id: string) => { "data-dragging": string | undefined; "data-drop-position": "before" | "inside" | "after" | undefined; onkeydown: (event: KeyboardEvent) => void; }

Source: packages/ui/src/behaviors/drag.svelte.ts:491

TreeReorderOptions type

type TreeReorderOptions = {
    /** Visible pre-order tree rows. */
    readonly rows: () => readonly TreeReorderRow[];
    /** Invoked when a node (with its subtree) moves to `place`. */
    readonly on_move: (id: string, place: TreePlace) => void;
    /** Optional predicate forbidding drops into/around a target. */
    readonly can_drop?: (id: string, place: TreePlace) => boolean;
};

Options for create_tree_reorder.

Members

NameTypeDescription
rows() => readonly TreeReorderRow[]

Visible pre-order tree rows.

on_move(id: string, place: TreePlace) => void

Invoked when a node (with its subtree) moves to place.

can_drop?(id: string, place: TreePlace) => boolean

Optional predicate forbidding drops into/around a target.

Source: packages/ui/src/behaviors/drag.svelte.ts:481

TreeReorderRow type

type TreeReorderRow = {
    readonly id: string;
    readonly depth: number;
    readonly parent: string | null;
    readonly label?: string;
};

One flattened row accepted by create_tree_reorder.

Members

NameTypeDescription
idstring
depthnumber
parentstring | null
label?string

Source: packages/ui/src/behaviors/drag.svelte.ts:458

TriggerMatch type

type TriggerMatch = {
    readonly trigger: string;
    readonly query: string;
    readonly start: number;
    readonly end: number;
};

Active trigger match inside a text field.

Members

NameTypeDescription
triggerstring
querystring
startnumber
endnumber

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:348

TriggerMenu type

type TriggerMenu<T extends TriggerMenuItem = TriggerMenuItem> = ReturnType<typeof create_trigger_menu<T>>;

Return value of create_trigger_menu.

Members

NameTypeDescription
openboolean
matchTriggerMatch | null
itemsreadonly T[]
pathreadonly T[]
active_indexnumber
floating{ readonly x: number; readonly y: number; readonly side: import("./floating.svelte.js").FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Att…
close() => void
select(item: T) => void
pop_level() => void
fieldAttachment<HTMLInputElement | HTMLTextAreaElement>
contentAttachment<HTMLElement>
input_attrs() => { "aria-expanded": boolean; "aria-haspopup": "listbox"; "aria-activedescendant": string | undefined; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; }
option_attrs(item: T, index: number) => { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-highlighted": string | undefined; onpointerenter: () => void; onmousedown: (event: MouseEvent) => void; onclick: () => void; }

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:368

TriggerMenuItem type

type TriggerMenuItem = {
    readonly id: string;
    readonly label: string;
    readonly keywords?: string;
    readonly insert?: string;
    readonly disabled?: boolean;
    readonly children?: readonly TriggerMenuItem[];
};

One item offered by create_trigger_menu.

Members

NameTypeDescription
idstring
labelstring
keywords?string
insert?string
disabled?boolean
children?readonly TriggerMenuItem[]

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:338

TriggerMenuOptions type

type TriggerMenuOptions<T extends TriggerMenuItem = TriggerMenuItem> = {
    /** Trigger prefixes that open the menu (e.g. `['@', '/']`). */
    readonly triggers: readonly string[];
    /** Returns items for the active trigger & nested level stack. */
    readonly items: (trigger: string, query: string, path: readonly T[]) => readonly T[];
    /** Called when a leaf item is picked (receives item and replacement range). */
    readonly on_select: (item: T, match: TriggerMatch, insertText: string) => void;
    /** Optional semantic control registration for Norbius's `page` bridge. */
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_trigger_menu.

Members

NameTypeDescription
triggersreadonly string[]

Trigger prefixes that open the menu (e.g. ['@', '/']).

items(trigger: string, query: string, path: readonly T[]) => readonly T[]

Returns items for the active trigger & nested level stack.

on_select(item: T, match: TriggerMatch, insertText: string) => void

Called when a leaf item is picked (receives item and replacement range).

control?{ readonly id: string; readonly label?: string; }

Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:356

Typeahead type

type Typeahead = ReturnType<typeof create_typeahead>;

Return value of create_typeahead.

Members

NameTypeDescription
onkeydown(event: KeyboardEvent) => void
reset() => void
querystring

Source: packages/ui/src/behaviors/typeahead.svelte.ts:20

TypeaheadItem type

type TypeaheadItem = {
    key: string;
    text: string;
    disabled?: boolean;
};

One searchable item supplied to create_typeahead.

Members

NameTypeDescription
keystring
textstring
disabled?boolean

Source: packages/ui/src/behaviors/typeahead.svelte.ts:5

TypeaheadOptions type

type TypeaheadOptions = {
    /** Candidate items in visual order. */
    items: () => readonly TypeaheadItem[];
    /** Currently active key (search wraps starting after this item). */
    active?: () => string | undefined;
    /** Invoked with the matched item's key. */
    on_match: (key: string) => void;
    /** Buffer reset delay in ms (default `500`). */
    timeout_ms?: number;
};

Options for create_typeahead.

Members

NameTypeDescription
items() => readonly TypeaheadItem[]

Candidate items in visual order.

active?() => string | undefined

Currently active key (search wraps starting after this item).

on_match(key: string) => void

Invoked with the matched item's key.

timeout_ms?number

Buffer reset delay in ms (default 500).

Source: packages/ui/src/behaviors/typeahead.svelte.ts:8

client

UiContext type

type UiContext = {
    readonly ui: {
        readonly bolt?: ViewBolt | undefined;
        readonly kinds: KindsHost;
    };
};

What every view, input and editor takes as its ctx prop: pass the page's ctx whole (<Table {ctx} of="projects">), and a view hands it on to what it renders. ui.bolt is the view client (absent: controlled local views render without one); ui.kinds is what kind editors learn from the host.

Members

NameTypeDescription
ui{ readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }

Source: packages/ui/src/client/contract.ts:203

behaviors

UiHistory type

type UiHistory = ReturnType<typeof create_ui_history>;

Return value of create_ui_history.

Members

NameTypeDescription
entriesreadonly UiHistoryEntry[]
positionnumber
can_undoboolean
can_redoboolean
undo() => boolean
redo() => boolean
undo_source(source: ChangeSource) => number
destroy() => void

Source: packages/ui/src/behaviors/controls.svelte.ts:420

UiHistoryEntry type

type UiHistoryEntry = ControlChange & {
    readonly seq: number;
    readonly reverted?: boolean;
};

Recorded entry inside create_ui_history.

Members

NameTypeDescription
idstring
kindstring
label?string
keystring
previousunknown
valueunknown
sourceChangeSource
reasonstring
redacted?boolean
committedboolean
seqnumber
reverted?boolean

Source: packages/ui/src/behaviors/controls.svelte.ts:405

UiHistoryOptions type

type UiHistoryOptions = {
    readonly within?: Element | (() => Element | null | undefined);
    /** Only record state keys in this list (defaults to all keys). */
    readonly keys?: readonly string[];
    /** Coalesce consecutive edits to the same `(id, key, source)` within 500ms (default `true`). */
    readonly coalesce?: boolean;
};

Options for create_ui_history.

Members

NameTypeDescription
within?Element | (() => Element | null | undefined)
keys?readonly string[]

Only record state keys in this list (defaults to all keys).

coalesce?boolean

Coalesce consecutive edits to the same (id, key, source) within 500ms (default true).

Source: packages/ui/src/behaviors/controls.svelte.ts:411

i18n

UiTextKey type

type UiTextKey = keyof typeof UI_TEXT;

A key of the kit's own chrome strings.

Source: packages/ui/src/i18n.ts:140

behaviors

UndoStack type

type UndoStack<T> = ReturnType<typeof create_undo_stack<T>>;

Return value of create_undo_stack.

Members

NameTypeDescription
currentT
can_undoboolean
can_redoboolean
lengthnumber
record(next: T, opts?: { readonly group?: string; readonly time?: number; }) => void
undo() => T
redo() => T
reset(value: T) => void

Source: packages/ui/src/behaviors/micro.svelte.ts:109

UndoStackOptions type

type UndoStackOptions = {
    /** Maximum history depth (default `100`). */
    readonly limit?: number;
    /** Coalescing window in ms for edits sharing the same `group` (default `500`). */
    readonly group_delay_ms?: number;
};

Options for create_undo_stack.

Members

NameTypeDescription
limit?number

Maximum history depth (default 100).

group_delay_ms?number

Coalescing window in ms for edits sharing the same group (default 500).

Source: packages/ui/src/behaviors/micro.svelte.ts:101

chart

UsageChart component

component UsageChart(props: UsageChartProps)

One metric's trend over time as an inline SVG line chart: the first line is the use, dashed lines are what bounds it (a capacity, a machine's total). Hovering reads every line at that time.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
titlestring

The metric's name above the chart; also its accessible label.

unitstring

How values read: bytes, MiB, micro-SGD, seconds, load per core, else a suffix.

linesReadonlyArray<UsageChartLine>

The series: the first is the use; the x axis follows its sample times.

utilization?number | null

Peak use as a fraction of capacity (0–1), shown as a percentage beside the title; null hides it.

Source: packages/ui/src/chart/UsageChart.svelte:1

lang

Value type

type Value = Json;

A value: JSON; a decimal is its exact text.

Source: packages/store/src/lang/kind.ts:351

client

ViewBolt type

type ViewBolt = {
    /** Re-reads mounted queries without a polling timer. */
    refresh(): Effect.Effect<void, Error>;
    /**
     * One read request (`query({ <root>: { where?, fields?, order_by?, limit?, after?, search? }, '<root>.<layer>': { … } })`),
     * answered as a page per root; a declared layer nests under its relation in each row.
     */
    query(request: {
        readonly [path: string]: Json;
    }): Query<QueryAnswer>;
    /** Internal model-view read: the host selects and validates every promised default-output list field. */
    model_query<C extends ModelKey>(model: C, request: Readonly<Record<string, Json>>, mode: 'list'): Query<QueryAnswer<RowOf<C> & Row>>;
    /** Internal record-view read: the host selects and validates the complete default-output record. */
    model_query<C extends ModelKey>(model: C, request: Readonly<Record<string, Json>>, mode: 'record'): Query<QueryAnswer<RecordOf<C> & Row>>;
    /** Internal source-linked model branch; a request or local source keeps its own original producer instead. */
    source_query<S extends ViewSource>(source: S, request: Readonly<Record<string, Json>>): Query<QueryAnswer<SourceRow<S> & Partial<SourceColumns<S>>>>;
    /** Internal projection for an authored representation; null leaves narrower authorized data with the native view. */
    project_record<C extends ModelKey>(model: C, record: Row): (RecordOf<C> & Row) | null;
    /** Without `by`, one row over the scope (`Values`); with `by`, a page …

The client a view reads and acts through, as a page context's ui.bolt carries it to the views. Dynamic reads have fixed structural answers; model reads derive their row from the actual model input.

Members

NameTypeDescription
refresh() => Effect.Effect<void, Error>

Re-reads mounted queries without a polling timer.

query(request: { readonly [path: string]: Json; }) => Query<QueryAnswer>

One read request (query({ <root>: { where?, fields?, order_by?, limit?, after?, search? }, '<root>.<layer>': { … } })), answered as a page per root; a declared layer nests under its relation in each row.

model_query{ <C extends ModelKey>(model: C, request: Readonly<Record<string, Json>>, mode: "list"): Query<QueryAnswer<RowOf<C> & Row>>; <C extends ModelKey>(model: C, request: Readonly<Record<string, Json>>, mode: "record"): Query<QueryAnswer<RecordOf<C> & Row>>; }

Internal model-view read: the host selects and validates every promised default-output list field. Internal record-view read: the host selects and validates the complete default-output record.

source_query<S extends ViewSource>(source: S, request: Readonly<Record<string, Json>>) => Query<QueryAnswer<SourceRow<S> & Partial<SourceColumns<S>>>>

Internal source-linked model branch; a request or local source keeps its own original producer instead.

project_record<C extends ModelKey>(model: C, record: Row) => (RecordOf<C> & Row) | null

Internal projection for an authored representation; null leaves narrower authorized data with the native view.

aggregate{ (model: string, args: Values & { readonly by: Value; }): Query<Page<Values>>; (model: string, args: Value): Query<Values | Page<Values>>; }

Without by, one row over the scope (Values); with by, a page of buckets (Page<Values>).

history{ <C extends ModelKey>(model: C, id: string, options: { at?: Json; output?: string; view: true; }): Query<(HistorySnapshot & { readonly projection: (RecordOf<C> & Row) | null; }) | null>; (model: string, id: string, options?: { at?: Json; output?: string; }): Query<readonly HistoryEntry[]>; }

A record's revisions, newest first, or from at ({ instant } | { revision } | { before }).

clock(unit?: "minute" | "hour" | "day") => Clock

With a unit, reactive (it changes at each minute, hour or day in the workspace zone); without, the page's open.

record_capabilities?((model: string, id: string, parent?: RecordParentContext) => Effect.Effect<RecordCapabilities | null, Error>) | undefined
delete_verdict?((model: string, ids: readonly string[]) => Effect.Effect<"allow" | "approve" | "refuse", Error>) | undefined

Whether deleting these records would commit, be held for approval or be refused: one read for them all.

act(acts: Readonly<Record<string, Value>>, options?: { key?: string; }) => Effect.Effect<ActSuccess, ActFailure>
restore?{ preview(model: string, record: string, revision: number): Effect.Effect<RestorePreview, Error>; run(model: string, record: string, revision: number, live: number): Effect.Effect<ActSuccess, ActFailure>; }

Per-record restore: preview says what taking a live record's own fields back to a past revision would write; run writes it as one update observed at live, recorded in history as restored from that revision.

run(automation: string, input: Value | readonly Value[]) => AutomationHandle
sync_control(model: string, sync: string, input: Value) => RunHandle

Native manual refresh/file transfer; these are never authored automation starts.

runs?((automation: string, options: { where?: Json; limit: number; }) => Live<Page<RunRow>>) | undefined

runs(automation, { where?, limit }); absent until the client serves it (views then say so).

file_url(ref: Pick<FileRef, "id">, options?: FileUrlOptions) => string
decode?((model: string, q: { where?: Json; order_by?: Json; }) => { where: Json; order_by?: Json; dropped: readonly { path: string; message: string; }[]; }) | undefined

The where check in the browser: each top-level condition and sort key kept or dropped alone. Absent → the view's own check.

describe?((model: string, text: string, fields?: readonly { name: string; label: string; kind: 'text' | 'number' | 'bool'; optional?: boolean; }[], onStep?: (step: DescribeStep) => void) => Effect.Effect<{ where?: Json; order_by?: Json; steps?: readonly DescribeStep[]; }, Error>) | undefined

filter.describe: present only when the host binds decisions or ai; rejects when no filter could be built.

options?((model: string, fields?: readonly { name: string; label: string; kind: "text" | "number" | "bool"; optional?: boolean; }[]) => Effect.Effect<{ fields: readonly Offer[]; }, Error>) | undefined

filter.options: the same condition catalogue a description is offered, so the builder renders exactly what it may author.

approvals{ /** Decides the request's current step; `reason` is required for `reject` and `request_changes` (and a superseder's approve); the requester may `withdraw`. */ decide(request_id: string, decision: { decision: ApprovalDecision; reason?: string; }): Effect.Effect<ActSuccess, ActFailure>; /** The approval view: the request, its steps and timeline, and what the viewer may do; `null` when not visible…
actorJson
localestring
t(key: string, vars?: { readonly [name: string]: string | number; }) => string

Source: packages/ui/src/client/contract.ts:217

model

ViewSource type

type ViewSource<R extends Values = Values> = ModelKey | Query<Readonly<Record<string, SourceData<R>>>> | readonly R[];

A model, a request with its own decoded answer, or caller-owned rows.

Source: packages/ui/src/model/types.ts:51

behaviors

ViewportBehavior type

type ViewportBehavior = ReturnType<typeof create_viewport>;

Return value of create_viewport.

Members

NameTypeDescription
xnumber
ynumber
zoomnumber
panningboolean
transformstring
set_camera(next: Partial<ViewportCamera>) => void
zoom_at(factor: number, originX: number, originY: number) => void
reset() => void
surfaceAttachment<HTMLElement>

Source: packages/ui/src/behaviors/canvas.svelte.ts:528

ViewportCamera type

type ViewportCamera = {
    readonly x: number;
    readonly y: number;
    readonly zoom: number;
};

Camera state of a pan/zoom canvas viewport.

Members

NameTypeDescription
xnumber
ynumber
zoomnumber

Source: packages/ui/src/behaviors/canvas.svelte.ts:517

ViewportOptions type

type ViewportOptions = {
    readonly initial?: ViewportCamera;
    readonly min_zoom?: number;
    readonly max_zoom?: number;
    readonly on_change?: (camera: ViewportCamera) => void;
};

Options for create_viewport.

Members

NameTypeDescription
initial?ViewportCamera
min_zoom?number
max_zoom?number
on_change?(camera: ViewportCamera) => void

Source: packages/ui/src/behaviors/canvas.svelte.ts:520

ViewportState type

type ViewportState = {
    readonly width: number;
    readonly height: number;
    readonly offset_top: number;
    readonly offset_left: number;
    readonly scale: number;
    /** Estimated height in px occluded by an on-screen mobile keyboard (`0` on desktop). */
    readonly keyboard_height: number;
};

Live visual viewport & software keyboard metrics from bind_viewport.

Members

NameTypeDescription
widthnumber
heightnumber
offset_topnumber
offset_leftnumber
scalenumber
keyboard_heightnumber

Estimated height in px occluded by an on-screen mobile keyboard (0 on desktop).

Source: packages/ui/src/behaviors/platform.svelte.ts:8

VirtualAnchor type

type VirtualAnchor = {
    readonly x: number;
    readonly y: number;
} | {
    readonly getBoundingClientRect: () => VirtualRect;
};

Virtual anchor: either a { x, y } pointer coordinate or a getBoundingClientRect() provider.

Source: packages/ui/src/behaviors/floating.svelte.ts:23

VirtualRect type

type VirtualRect = {
    readonly left: number;
    readonly top: number;
    readonly right: number;
    readonly bottom: number;
    readonly width: number;
    readonly height: number;
};

Rect subset needed to position against a non-element virtual anchor.

Members

NameTypeDescription
leftnumber
topnumber
rightnumber
bottomnumber
widthnumber
heightnumber

Source: packages/ui/src/behaviors/floating.svelte.ts:13

WatchOptions type

type WatchOptions = {
    /** Skip the initial effect run and only invoke on subsequent changes (default `false`). */
    readonly lazy?: boolean;
    /** Stop reacting after the first invocation (default `false`). */
    readonly once?: boolean;
};

Options controlling whether watch skips its initial run (lazy) or only runs once (once).

Members

NameTypeDescription
lazy?boolean

Skip the initial effect run and only invoke on subsequent changes (default false).

once?boolean

Stop reacting after the first invocation (default false).

Source: packages/ui/src/behaviors/reactive.svelte.ts:6

WaterfallBehavior type

type WaterfallBehavior<T extends WaterfallItem = WaterfallItem> = ReturnType<typeof create_waterfall<T>>;

Return value of create_waterfall.

Members

NameTypeDescription
rowsimport("./tree.svelte.js").FlatTreeRow<T>[]
minnumber
maxnumber
view_startnumber
view_endnumber
tree{ readonly rows: import("./tree.svelte.js").FlatTreeRow<T>[]; readonly expanded: readonly string[]; readonly selected: readonly string[]; readonly active: string; expand: (id: string) => void; collapse: (id: string) => void; toggle_expand: (id: string) => void; is_expanded(id: string): boolean; is_selected: (key: string) => boolean; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { …
bar_rect(item: WaterfallItem) => { readonly left_pct: number; readonly width_pct: number; }
zoom(start: number, end: number) => void
reset_zoom() => void

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1238

WaterfallItem type

type WaterfallItem = {
    readonly id: string;
    readonly label: string;
    readonly parent?: string | null;
    readonly start: number;
    readonly end: number;
};

One timed span item in create_waterfall.

Members

NameTypeDescription
idstring
labelstring
parent?string | null
startnumber
endnumber

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1221

WaterfallOptions type

type WaterfallOptions<T extends WaterfallItem = WaterfallItem> = {
    readonly items: () => readonly T[];
    readonly on_select?: (id: string) => void;
    readonly label?: string;
    readonly control?: {
        readonly id: string;
        readonly label?: string;
    };
};

Options for create_waterfall.

Members

NameTypeDescription
items() => readonly T[]
on_select?(id: string) => void
label?string
control?{ readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1230

model

Workspace interface

interface Workspace {
}

The workspace's names as its views see them. Empty here, so ui stays workspace-agnostic: @norbital-ai/bolt fills names from the workspace's generated index, and of, columns, values, record and ids are then checked per model. Unfilled (a host, ui's own tests), any name and any row goes.

Members

NameTypeDescription
namesViewNames

Source: packages/ui/src/model/types.ts:17

workspaces

WorkspaceOperations component

component WorkspaceOperations(props: WorkspaceOperationsProps)

A workspace's operations panel: bundle, telemetry, logs, users, activity and improvements views over data its owner reads for the chosen scope.

Props

NameTypeDescription
ctxUiContext

The page context (ctx), passed whole.

  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }
dataWorkspaceOperationsData

Everything the views show, read by the owner for the current scope.

  • can_inspect: boolean
  • as_of: string
  • usage: readonly Omit<UsageChartProps, 'ctx'>[]
  • members: readonly WorkspaceMember[] | null
  • studio: Readonly<{ commit: string; message: string; builds: readonly ReleaseBuild[]; releases: readonly ReleaseVersion[]; environments: readonly ReleaseEnvironment[]; changes: readonly WorkspaceChange[]; log: readonly BuildLine[]; diagnostics: readonly unknown[]; build: Readonly<{ build: ReleaseBuild; log: readonly BuildLine[]; diagnostics: readonly unknown[]; }> | null; }> | null
  • logs: readonly Readonly<{ id: string; at: string; severity: 'info' | 'warn' | 'error'; event: string; invocation: string; run: string | null; conversation: string | null; turn: string | null; attributes: unknown; }>[] | null
  • bundles: Readonly<{ commit: string | null; live: boolean; name: string; digest: string; content_address: string | null; contract: string; schema: string; asset_count: number | null; assets: readonly Readonly<{ path: string; sha256: string; bytes: number | null; }>[]; truncated: boolean; total_bytes: number | null; }> | null
  • cache: Readonly<{ budget_bytes: number; host_bytes: number; host_entries: number; release_bytes: number; release_entries: number; assets: readonly Readonly<{ path: string; sha256: string; cached_bytes: number; variants: readonly Readonly<{ encoding: 'identity' | 'br' | 'gzip'; bytes: number; }>[]; }>[]; }> | null
  • errors: Readonly<{ access: string | null; studio: string | null; logs: string | null; bundles: string | null; cache: string | null; build: string | null; }> | null
  • filters: Readonly<{ level: 'info' | 'warn' | 'error' | null; text: string; run: string; build: string | null; }>
  • health?: Readonly<{ artifact_bytes: number | null; file_count: number | null; packages: readonly Readonly<{ name: string; version: string; source: 'artifact' | 'runtime'; }>[]; errors: readonly string[]; cleanup: readonly Readonly<{ change_id: string; title: string; state: 'open' | 'merged' | 'closed'; environment: string; status: 'active' | 'shelved' | 'cleared' | 'leftover' | 'unknown'; reason: string; …
  • activity: Readonly<{ people: number; pages: readonly Readonly<{ route: string; views: number; people: number; dwell_ms: number | null; }>[]; turns: readonly Readonly<{ audience: string; turns: number; failed: number; steps: number; tool_errors: number; cost: number; }>[]; }> | null

    How the workspace was used over the range; null: the host does not serve it, or it was not asked for.

  • improvements: Readonly<{ threads: readonly Readonly<{ id: string; kind: 'feedback' | 'request' | 'failure'; status: string; title: string; seen: number; updated_at: string; last: string | null; change: string | null; conversation: string | null; }>[]; }> | null

    The improvement threads; null: the host does not serve them, or they were not asked for.

rangeWorkspaceRange

The telemetry trend window.

viewWorkspaceView

The view shown.

viewsreadonly WorkspaceView[]

The views to offer, in order; with one, it renders without its own tab strip.

busy?boolean

Marks the panel busy while the owner reads. Default false.

on_change(next: WorkspaceScope) => void

The viewer changed the view, range or run filter: only the changed keys; the owner rereads data.

t?(key: string) => string

Translates the panel's English strings (keys are the English text). Default: identity.

release?string | null

The release whose logs Logs shows, by its publication instant (at); omitted or null, every release. Bind it to read the selection (the owner scopes its own log read to release_window).

actions?Snippet

Trailing controls on the Logs header line (an Auto-refresh toggle).

on_conversation?(id: string) => void

Opens an improvement thread's agent conversation; without it, the board's cards do not open.

Source: packages/ui/src/workspaces/WorkspaceOperations.svelte:1

WorkspaceOperationsData type

type WorkspaceOperationsData = Readonly<{
    can_inspect: boolean;
    as_of: string;
    usage: readonly Omit<UsageChartProps, 'ctx'>[];
    members: readonly WorkspaceMember[] | null;
    studio: Readonly<{
        commit: string;
        message: string;
        builds: readonly ReleaseBuild[];
        releases: readonly ReleaseVersion[];
        environments: readonly ReleaseEnvironment[];
        changes: readonly WorkspaceChange[];
        log: readonly BuildLine[];
        diagnostics: readonly unknown[];
        build: Readonly<{
            build: ReleaseBuild;
            log: readonly BuildLine[];
            diagnostics: readonly unknown[];
        }> | null;
    }> | null;
    logs: readonly Readonly<{
        id: string;
        at: string;
        severity: 'info' | 'warn' | 'error';
        event: string;
        invocation: string;
        run: string | null;
        conversation: string | null;
        turn: string | null;
        attributes: unknown;
    }>[] | null;
    bundles: Readonly<{
        commit: string | null;
        live: boolean;
        name: string;
        digest: string;
        content_address: string | null;
        contract: string;
        schema: string;
        asset_count: number | null;
        assets: readonly Readonly<{
            path: string;
            sha256: string;
            bytes: number | null;
        }>[];
        truncated: boolean;
        total_bytes: number | null;
    }> | null;
    cache: Readonly<{
        …

Plain operational data rendered identically in tenant Studio and Realm. Host boundaries decode its native schema.

Members

NameTypeDescription
can_inspectboolean
as_ofstring
usagereadonly Omit<UsageChartProps, 'ctx'>[]
membersreadonly WorkspaceMember[] | null
studioReadonly<{ commit: string; message: string; builds: readonly ReleaseBuild[]; releases: readonly ReleaseVersion[]; environments: readonly ReleaseEnvironment[]; changes: readonly WorkspaceChange[]; log: readonly BuildLine[]; diagnostics: readonly unknown[]; build: Readonly<{ build: ReleaseBuild; log: readonly BuildLine[]; diagnostics: readonly unknown[]; }> | null; }> | null
logsreadonly Readonly<{ id: string; at: string; severity: 'info' | 'warn' | 'error'; event: string; invocation: string; run: string | null; conversation: string | null; turn: string | null; attributes: unknown; }>[] | null
bundlesReadonly<{ commit: string | null; live: boolean; name: string; digest: string; content_address: string | null; contract: string; schema: string; asset_count: number | null; assets: readonly Readonly<{ path: string; sha256: string; bytes: number | null; }>[]; truncated: boolean; total_bytes: number | null; }> | null
cacheReadonly<{ budget_bytes: number; host_bytes: number; host_entries: number; release_bytes: number; release_entries: number; assets: readonly Readonly<{ path: string; sha256: string; cached_bytes: number; variants: readonly Readonly<{ encoding: 'identity' | 'br' | 'gzip'; bytes: number; }>[]; }>[]; }> | null
errorsReadonly<{ access: string | null; studio: string | null; logs: string | null; bundles: string | null; cache: string | null; build: string | null; }> | null
filtersReadonly<{ level: 'info' | 'warn' | 'error' | null; text: string; run: string; build: string | null; }>
health?Readonly<{ artifact_bytes: number | null; file_count: number | null; packages: readonly Readonly<{ name: string; version: string; source: 'artifact' | 'runtime'; }>[]; errors: readonly string[]; cleanup: readonly Readonly<{ change_id: string; title: string; state: 'open' | 'merged' | 'closed'; environment: string; status: 'active' | 'shelved' | 'cleared' | 'leftover' | 'unknown'; reason: string; …
activityReadonly<{ people: number; pages: readonly Readonly<{ route: string; views: number; people: number; dwell_ms: number | null; }>[]; turns: readonly Readonly<{ audience: string; turns: number; failed: number; steps: number; tool_errors: number; cost: number; }>[]; }> | null

How the workspace was used over the range; null: the host does not serve it, or it was not asked for.

improvementsReadonly<{ threads: readonly Readonly<{ id: string; kind: 'feedback' | 'request' | 'failure'; status: string; title: string; seen: number; updated_at: string; last: string | null; change: string | null; conversation: string | null; }>[]; }> | null

The improvement threads; null: the host does not serve them, or they were not asked for.

Source: packages/ui/src/workspaces/types.ts:54

WorkspaceRange type

type WorkspaceRange = '24h' | '7d' | '30d';

The time window shown by workspace monitoring.

Source: packages/ui/src/workspaces/types.ts:5

WorkspaceScope type

type WorkspaceScope = Readonly<{
    view?: WorkspaceView;
    range?: WorkspaceRange;
    build?: string | null;
    run?: string | null;
}>;

The monitoring view, time window and optional build or run selection.

Members

NameTypeDescription
view?WorkspaceView
range?WorkspaceRange
build?string | null
run?string | null

Source: packages/ui/src/workspaces/types.ts:15

WorkspaceView type

type WorkspaceView = 'bundle' | 'telemetry' | 'logs' | 'users' | 'activity' | 'improvements';

The selected workspace monitoring view.

Source: packages/ui/src/workspaces/types.ts:7

behaviors

act_on_control function

function act_on_control(id: string, action: string, args?: readonly unknown[]): boolean

Invokes a named semantic action on a registered control by id or label; returns whether it ran.

Parameters

NameTypeDescription
idstring
actionstring
args?readonly unknown[]

Source: packages/ui/src/behaviors/controls.svelte.ts:381

announce function

function announce(text: string, options?: AnnounceOptions): void

Announces text to assistive technologies. Repeating identical text still triggers a fresh reading by clearing the region before writing.

Parameters

NameTypeDescription
textstring
options?AnnounceOptions

Source: packages/ui/src/behaviors/announce.svelte.ts:61

aria_keyshortcuts function

function aria_keyshortcuts(spec: string, platform?: "mac" | "other"): string

Converts a shortcut spec into a WAI-ARIA aria-keyshortcuts attribute value (e.g. 'Meta+K' or 'Control+K').

Parameters

NameTypeDescription
specstring
platform?'mac' | 'other'

Source: packages/ui/src/behaviors/shortcuts.svelte.ts:104

actions

automation_outcome function

function automation_outcome(handle: AutomationHandle): Effect.Effect<Outcome, ProtocolFailure>

Native forms present call results as a completed action and job receipts as their queue admission.

Parameters

NameTypeDescription
handleAutomationHandle

Source: packages/ui/src/actions/outcome.ts:57

utilities

begin_workspace_navigation function

function begin_workspace_navigation(message: string): () => void

Report a normal workspace handoff without replacing its current screen or moving focus.

Parameters

NameTypeDescription
messagestring

Source: packages/ui/src/utilities/workspace-navigation.ts:2

behaviors

bind_avoid_keyboard function

function bind_avoid_keyboard(options?: { readonly mode?: "padding" | "translate"; }): Attachment<HTMLElement>

Shifts a fixed bottom bar, composer or sheet above the mobile software keyboard using visualViewport keyboard-height measurements (padding-bottom or transform).

Parameters

NameTypeDescription
options?{ readonly mode?: 'padding' | 'translate'; }

Source: packages/ui/src/behaviors/platform.svelte.ts:80

bind_drag function

function bind_drag(options: BindDragOptions): Attachment<HTMLElement>

Pointer-capture drag attachment ({@attach bind_drag(...)}) with movement threshold, animation-frame batching and optional Escape cancellation.

Parameters

NameTypeDescription
optionsBindDragOptions
  • threshold?: number

    Movement in CSS px before on_start/on_move fire (default DRAG_THRESHOLD).

  • on_start?: (event: PointerEvent) => boolean | void

    Return false to reject starting the drag.

  • on_move: (sample: PointerSample) => void

    Called at most once per animation frame with latest pointer coordinates.

  • on_end?: (event: PointerEvent | KeyboardEvent, canceled: boolean) => void

    Called when the pointer lifts, cancels, or Escape aborts.

  • cancel_on_escape?: boolean

    Cancel active drag on Escape (default true).

  • stop_propagation?: boolean

    Stop pointerdown propagation so nested drag surfaces do not both capture the gesture.

  • disabled?: () => boolean

    Disable dragging reactively.

Source: packages/ui/src/behaviors/drag.svelte.ts:42

bind_drag_preview function

function bind_drag_preview(options: DragPreviewOptions): Attachment<HTMLElement>

Positions a custom floating drag-ghost element under the pointer without HTML5 drag ghost clipping.

Parameters

NameTypeDescription
optionsDragPreviewOptions
  • point: () => { readonly x: number; readonly y: number; } | null

    Reactive active drag coordinates (null when not dragging).

  • offset?: { readonly x: number; readonly y: number; }

    Offset in px relative to pointer (default { x: 12, y: 12 }).

Source: packages/ui/src/behaviors/platform.svelte.ts:304

bind_findable function

function bind_findable(options: FindableOptions): Attachment<HTMLElement>

Attachment keeping a closed panel discoverable by browser find-in-page (hidden="until-found"). When the user searches text inside the closed panel, on_reveal fires so the panel opens cleanly.

Parameters

NameTypeDescription
optionsFindableOptions
  • open: () => boolean

    Whether the panel is currently open/visible.

  • findable?: () => boolean

    Whether closed content remains findable via browser Ctrl/Cmd+F (default true).

  • on_reveal: (event: Event) => void

    Called when browser find-in-page matches text inside the closed panel (beforematch).

Source: packages/ui/src/behaviors/presence.svelte.ts:230

bind_hold function

function bind_hold(options: BindHoldOptions): Attachment<HTMLElement>

Long-press attachment ({@attach bind_hold(...)}) with movement tolerance, Escape/blur cancel and automatic click suppression after a completed hold.

Parameters

NameTypeDescription
optionsBindHoldOptions
  • delay?: number

    Hold duration in ms before on_hold fires (default 500).

  • tolerance?: number

    Max pointer drift in px before canceling (default 8).

  • keys?: readonly string[]

    Keys that start a keyboard hold (default [' ', 'Enter']).

  • on_start?: (details: { readonly event: PointerEvent | KeyboardEvent; readonly input: HoldInput; }) => void

    Called when press starts.

  • on_hold: (details: { readonly event: PointerEvent | KeyboardEvent; readonly input: HoldInput; }) => void

    Called once the press crosses delay.

  • on_end?: (details: { readonly event: Event; readonly input: HoldInput; readonly held: boolean; readonly canceled: boolean; }) => void

    Called when the press lifts or cancels.

  • disabled?: () => boolean

    Disable reactively.

Source: packages/ui/src/behaviors/micro.svelte.ts:220

bind_repeat function

function bind_repeat(options: BindRepeatOptions): Attachment<HTMLElement>

Press-and-hold repeating attachment ({@attach bind_repeat(...)}) for number-input steppers and scrub buttons. Fires once immediately, waits delay, then repeats every interval.

Parameters

NameTypeDescription
optionsBindRepeatOptions
  • on_step: (count: number) => void

    Called immediately on press and repeatedly while held.

  • on_end?: (count: number) => void

    Called when the repeating press stops.

  • delay?: number

    Delay before repeating begins in ms (default 400).

  • interval?: number

    Interval between repeated steps in ms (default 60).

  • disabled?: () => boolean

    Disable reactively.

Source: packages/ui/src/behaviors/micro.svelte.ts:351

bind_scroll_picker function

function bind_scroll_picker(options: ScrollPickerOptions): Attachment<HTMLElement>

Scroll-snap wheel picker attachment ({@attach bind_scroll_picker(...)}) that writes --picker-offset (-1..1 normalized distance from center) on each child option and reports the centered index on scroll settle.

Parameters

NameTypeDescription
optionsScrollPickerOptions
  • on_select: (index: number) => void

    Called when the centered option changes after scrolling settles.

  • orientation?: 'vertical' | 'horizontal'

    Scroll axis (default 'vertical').

Source: packages/ui/src/behaviors/canvas.svelte.ts:847

bind_viewport function

function bind_viewport(on_change?: (state: ViewportState) => void): Attachment<HTMLElement>

Tracks window.visualViewport resize/scroll changes and writes --viewport-height, --keyboard-height and --keyboard-inset CSS custom properties onto the bound element (or document.documentElement).

Parameters

NameTypeDescription
on_change?(state: ViewportState) => void

Source: packages/ui/src/behaviors/platform.svelte.ts:49

bridge_between function

function bridge_between(trigger: Rect, popup: Rect, pad?: number): (x: number, y: number) => boolean

Returns a point-in-corridor predicate spanning the convex hull of trigger and popup (padded slightly so hairline gaps never drop hover during diagonal transit).

Parameters

NameTypeDescription
triggerRect
popupRect
pad?number

Source: packages/ui/src/behaviors/hover-intent.svelte.ts:55

record

carried_contexts function

function carried_contexts(model: string, id: string): ReadonlyMap<unknown, unknown> | undefined

The contexts the last open_record of this record carried, taken once: the shell's sheet sets them above its RecordShell; an opening that carried none (a reload, a link) takes the page's own (page_contexts).

Parameters

NameTypeDescription
modelstring
idstring

Source: packages/ui/src/record/navigation.ts:85

behaviors

cell_bounds function

function cell_bounds(range: CellRange): CellBounds

Normalizes any CellRange into { top, left, bottom, right } inclusive bounds.

Parameters

NameTypeDescription
rangeCellRange
  • anchor: GridCell
  • end: GridCell

Source: packages/ui/src/behaviors/grid.svelte.ts:207

cells_to_text function

function cells_to_text(bounds: CellBounds, read: (cell: GridCell) => string): string

Serializes a 2D cell range to spreadsheet-compatible tab-separated text (TSV).

Parameters

NameTypeDescription
boundsCellBounds
  • top: number
  • left: number
  • bottom: number
  • right: number
read(cell: GridCell) => string

Source: packages/ui/src/behaviors/grid.svelte.ts:217

check_direction function

function check_direction(root: Element, expected: "ltr" | "rtl"): readonly PatternViolation[]

Verifies that an element resolves to the expected writing direction ('ltr' or 'rtl') via inherited dir attribute / computed style.

Parameters

NameTypeDescription
rootElement
expected'ltr' | 'rtl'

Source: packages/ui/src/behaviors/testing.ts:192

check_pattern function

function check_pattern(root: Element, pattern: AriaPattern): readonly PatternViolation[]

Audits a rendered DOM subtree against WAI-ARIA APG structural, naming and keyboard focus requirements for pattern. Returns an array of violations (empty means compliant).

Parameters

NameTypeDescription
rootElement
patternAriaPattern

Source: packages/ui/src/behaviors/testing.ts:59

primitives

cn function

function cn(...inputs: ClassValue[]): string

Joins class names and merges conflicting Tailwind classes (the last wins).

Parameters

NameTypeDescription
inputsClassValue[]

Source: packages/ui/src/primitives/utils.ts:36

behaviors

color_scheme_of function

function color_scheme_of(): ResolvedColorScheme

Reads the operating system's current preferred color scheme.

Source: packages/ui/src/behaviors/platform.svelte.ts:159

color_scheme_script function

function color_scheme_script(storageKey: string): string

Generates a minimal inline script body to apply stored color scheme before first paint (no FOUC).

Parameters

NameTypeDescription
storageKeystring

Source: packages/ui/src/behaviors/platform.svelte.ts:233

primitives

confirm_action function

function confirm_action(options: ConfirmOptions): Effect.Effect<boolean>

true when the person confirmed; false on cancel, Escape or dismissal.

Parameters

NameTypeDescription
optionsConfirmOptions
  • title: string
  • body?: string | undefined
  • confirm_label: string

    The accept button's label: the action itself ("Disconnect"), never a bare "OK".

  • cancel_label?: string | undefined

    Defaults to the UI kit's "Cancel".

  • destructive?: boolean | undefined

    Draws the accept button as destructive.

Source: packages/ui/src/primitives/dialog/confirm.ts:20

behaviors

contrast_ratio function

function contrast_ratio(a: RgbaColor, b: RgbaColor): number

Computes WCAG 2.1 contrast ratio (1..21) between two colors.

Parameters

NameTypeDescription
aRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number
bRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:957

create_accordion function

function create_accordion(options: AccordionOptions): { readonly open: readonly string[]; is_open(key: string): boolean; toggle: (key: string) => void; expand: (key: string) => void; collapse: (key: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs: () => { onkeydown: (event: KeyboardEvent) => void; }; trigger_attrs(key: string): { type: "button"; id: string; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }; content_attrs(key: string): { id: string; role: "region"; "aria-labelledby": string; hidden: boolean; "data-state": "open" | "closed"; }; }

Headless composable accordion built on create_roving_focus + register_control.

Parameters

NameTypeDescription
optionsAccordionOptions
  • items: () => readonly string[]

    Item keys in visual order.

  • mode?: AccordionMode

    Single or multiple expanded sections (default 'single').

  • collapsible?: boolean

    In single mode, allow collapsing the only open item (default true).

  • open?: () => readonly string[]

    Controlled open keys; omit for internal state.

  • default_open?: readonly string[]

    Initial open keys when uncontrolled.

  • on_change?: (open: readonly string[]) => void

    Called whenever expanded keys change.

  • disabled?: (key: string) => boolean

    Disabled predicate per item key.

  • control?: { id: string; label?: string; }

    Optional semantic control id/label for Norbius's page bridge.

Source: packages/ui/src/behaviors/accordion.svelte.ts:37

create_area function

function create_area(options?: AreaOptions): { readonly value: AreaValue; readonly percent_x: number; readonly percent_y: number; readonly dragging: boolean; set: (next: AreaValue, commitNow?: boolean) => void; surface: Attachment<HTMLElement>; thumb_attrs(): { role: "slider"; tabindex: number; "aria-label": string | undefined; "aria-valuetext": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }

Headless 2D XY slider plane (e.g. color saturation/lightness picker or 2D joystick control).

Parameters

NameTypeDescription
options?AreaOptions

Source: packages/ui/src/behaviors/canvas.svelte.ts:143

create_async_options function

function create_async_options<T>(options: AsyncOptionsOptions<T>): { query: string; readonly items: readonly T[]; readonly status: AsyncOptionsStatus; readonly loading: boolean; readonly error: unknown; readonly has_more: boolean; set_query: (next: string, opts?: { immediate?: boolean; }) => void; load_more: () => void; reload: () => void; reset: () => void; cancel: () => void; }

Headless debounced, abortable, paginated async option loader.

Parameters

NameTypeDescription
optionsAsyncOptionsOptions<T>
  • load: (query: string, ctx: AsyncOptionsContext) => Promise<AsyncOptionsPage<T>>

    Fetches matching items for query and ctx.page, honoring ctx.signal.

  • initial_query?: string

    Initial query (default '').

  • debounce_ms?: number

    Typing debounce window in ms (default 200).

  • immediate?: boolean

    Fetch immediately for initial_query on mount (default false).

Source: packages/ui/src/behaviors/async-options.svelte.ts:48

create_auto_scroll function

function create_auto_scroll(options?: AutoScrollOptions): { update: (x: number, y: number) => void; stop: () => void; }

Scrolls the innermost scrollable container under a dragging pointer (falling back to the window) when the pointer approaches its edges.

Parameters

NameTypeDescription
options?AutoScrollOptions

Source: packages/ui/src/behaviors/drag.svelte.ts:184

create_calendar function

function create_calendar(options: CalendarOptions): { readonly placeholder: CalendarDate; readonly months: readonly CalendarMonth[]; readonly weekdays: readonly string[]; set_placeholder: (next: DateValue) => void; prev_month(): void; next_month(): void; reset_pending(): void; readonly focused: CalendarDate; focus_day: (target: CalendarDate) => void; day_ref(date: CalendarDate): Attachment<HTMLElement>; day_attrs(date: CalendarDate, month: CalendarDate): { role: "button"; tabindex: number; "data-value": string; "data-selected": string | undefined; "data-selection-start": string | undefined; "data-selection-end": string | undefined; "data-today": string | undefined; "data-outside-month": string | undefined; "data-disabled": string | undefined; "aria-disabled": true | undefined; "aria-selected": boolean; onfocus: () => void; onclick: () => void; onpointerenter: () => void; onkeydown: (e: KeyboardEvent) => void; }; }

Headless single-day and date-range calendar grid behavior over @internationalized/date. Builds localized month grids, weekday headers, prev/next month controls, range hover previews and keyboard Arrow/PageUp/PageDown day navigation.

Parameters

NameTypeDescription
optionsCalendarOptions
  • mode?: CalendarMode | (() => CalendarMode)

    Single-day or date-range selection mode (default 'single').

  • value?: () => DateValue | undefined

    Selected single date when mode === 'single'.

  • range?: () => CalendarRange

    Selected range when mode === 'range'.

  • on_select?: (date: DateValue) => void

    Called on single-day selection.

  • on_range_change?: (range: CalendarRange) => void

    Called when range selection updates (with { start, end }).

  • placeholder?: () => DateValue | undefined

    Controlled visible anchor month.

  • on_placeholder_change?: (next: DateValue) => void

    Called when the visible month changes.

  • number_of_months?: () => number

    Number of side-by-side months to build (default 1).

  • locale?: () => string | undefined

    BCP-47 locale for weekday order and names (default 'en-US').

  • min?: () => DateValue | undefined

    Minimum selectable date.

  • max?: () => DateValue | undefined

    Maximum selectable date.

  • disabled?: () => boolean

    Disabled state.

Source: packages/ui/src/behaviors/date-time.svelte.ts:648

function create_carousel(options: CarouselOptions): { readonly index: number; readonly count: number; readonly can_prev: boolean; readonly can_next: boolean; readonly paused: boolean; go_to: (next: number) => void; next: () => void; prev: () => void; set_paused(p: boolean): void; root: Attachment<HTMLElement>; track: Attachment<HTMLElement>; root_attrs(): { role: "region"; "aria-roledescription": string; "aria-label": string; onpointerenter: () => boolean; onpointerleave: () => boolean; onfocusin: () => boolean; onfocusout: () => boolean; onkeydown: (event: KeyboardEvent) => void; }; slide_attrs(i: number): { role: "group"; "aria-roledescription": string; "aria-label": string; "aria-hidden": true | undefined; "data-active": string | undefined; }; dot_attrs(i: number): { type: "button"; "aria-label": string; "aria-current": "true" | undefined; "data-active": string | undefined; onclick: () => void; }; }

Accessible slide carousel (aria-roledescription="carousel") with Arrow/Home/End navigation, optional looping, indicator dots, autoplay that pauses on hover/focus/reduced-motion, and control registration.

Parameters

NameTypeDescription
optionsCarouselOptions
  • count: () => number
  • index?: () => number
  • default_index?: number
  • on_change?: (index: number) => void
  • loop?: boolean
  • autoplay_ms?: number
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:246

create_cell_range function

function create_cell_range(options: CellRangeOptions): { readonly range: CellRange | null; readonly bounds: CellBounds | null; readonly dragging: boolean; start: (cell: GridCell) => void; extend: (to: GridCell, from?: GridCell, notify?: boolean) => void; select_row: (row: number) => void; select_col: (col: number) => void; clear: () => void; contains: (cell: GridCell) => boolean; to_text(read: (cell: GridCell) => string): string; cell_attrs(cell: GridCell): { "aria-selected": boolean; "data-in-range": string | undefined; onpointerdown: (event: PointerEvent) => void; onpointerenter: () => void; }; }

Rectangular spreadsheet cell-range selection with pointer drag painting, Shift-click/arrow extension, Ctrl+Space column / Shift+Space row selection, TSV copy/paste and screen-reader announcements.

Parameters

NameTypeDescription
optionsCellRangeOptions
  • rows: () => number

    Total row count.

  • cols: () => number

    Total column count.

  • range?: () => CellRange | null

    Controlled range; omit for internal state.

  • on_change?: (range: CellRange | null) => void

    Called when the selected cell range changes.

  • message?: (bounds: CellBounds) => string

    Optional live-region message formatter on range updates.

Source: packages/ui/src/behaviors/grid.svelte.ts:259

create_checkbox_group function

function create_checkbox_group(options: CheckboxGroupOptions): { readonly checked: readonly string[]; readonly all_state: boolean | "indeterminate"; is_checked(key: string): boolean; toggle: (key: string) => void; toggle_all: () => void; group_attrs(): { role: "group"; "aria-label": string | undefined; }; all_attrs(): { type: "checkbox"; checked: boolean; "aria-checked": boolean | "mixed"; onchange: () => void; }; item_attrs(key: string): { type: "checkbox"; checked: boolean; disabled: true | undefined; onchange: () => void; }; }

Headless flat checkbox group with tri-state Select All parent (true | false | 'indeterminate') and Norbius control registration.

Parameters

NameTypeDescription
optionsCheckboxGroupOptions
  • items: () => readonly string[]

    All selectable item keys.

  • value?: () => readonly string[]

    Controlled checked keys; omit for internal state.

  • default_value?: readonly string[]

    Initial checked keys when uncontrolled.

  • on_change?: (next: readonly string[]) => void

    Called when checked keys change.

  • disabled?: (key: string) => boolean

    Per-item disabled predicate.

  • label?: string

    Accessible label for the group.

  • control?: { readonly id: string; readonly label?: string; }

    Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:627

create_clipboard function

function create_clipboard(options: ClipboardOptions): { readonly copied: boolean; copy: (override?: string) => Promise<boolean>; reset(): void; }

Headless clipboard copy behavior with transient copied indicator and embedded-frame fallback.

Parameters

NameTypeDescription
optionsClipboardOptions
  • text: string | (() => string)

    Text to copy (reactive getter or static string).

  • timeout_ms?: number

    How long copied stays true in ms (default 1500).

  • on_copy?: (ok: boolean, value: string) => void

    Optional callback after a copy attempt completes.

Source: packages/ui/src/behaviors/clipboard.svelte.ts:39

create_color_picker function

function create_color_picker(options?: ColorPickerOptions): { readonly value: string; readonly rgba: RgbaColor; readonly hsv: HsvaColor; readonly plane: { readonly value: import("./canvas.svelte.js").AreaValue; readonly percent_x: number; readonly percent_y: number; readonly dragging: boolean; set: (next: import("./canvas.svelte.js").AreaValue, commitNow?: boolean) => void; surface: Attachment<HTMLElement>; thumb_attrs(): { role: "slider"; tabindex: number; "aria-label": string | undefined; "aria-valuetext": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }; readonly hue: { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }; }; readonly alpha: { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }; }; set_text: (text: string) => boolean; set_rgba: (next: RgbaColor) => void; }

Headless color picker composing 2D saturation/brightness create_area, hue & alpha create_slider, color parsing/formatting and Norbius control registration.

Parameters

NameTypeDescription
options?ColorPickerOptions

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:993

create_color_scheme function

function create_color_scheme(options?: ColorSchemeOptions): { readonly preference: ColorSchemePreference; readonly system: ResolvedColorScheme; readonly resolved: ResolvedColorScheme; set: (next: ColorSchemePreference) => void; }

Reactive color-scheme preference ('light' | 'dark' | 'system') synced with OS and optional storage.

Parameters

NameTypeDescription
options?ColorSchemeOptions

Source: packages/ui/src/behaviors/platform.svelte.ts:172

create_connect function

function create_connect(options: ConnectOptions): { readonly draft: ConnectDraft | null; readonly pending_from: string | null; port: (id: string) => Attachment<HTMLElement>; port_attrs: (id: string) => { tabindex: number; "data-connecting": string | undefined; "data-connect-target": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }

Headless node-graph port wiring behavior (pointer drag from port to port + keyboard Enter pick/connect).

Parameters

NameTypeDescription
optionsConnectOptions
  • can_connect?: (from: string, to: string) => boolean
  • on_connect: (from: string, to: string) => void

Source: packages/ui/src/behaviors/canvas.svelte.ts:640

function create_cookie_storage(options?: CookieStorageOptions): { get: (name: string) => string | null; set: (name: string, value: string) => void; remove: (name: string) => void; }

Simple browser cookie storage adapter (get, set, remove) for SSR-readable UI preferences.

Parameters

NameTypeDescription
options?CookieStorageOptions

Source: packages/ui/src/behaviors/platform.svelte.ts:406

create_date_field function

function create_date_field(options: DateFieldOptions): { readonly segments: readonly DateTimeSegment[]; segment_ref(part: SegmentPart): Attachment<HTMLElement>; segment_attrs(seg: DateTimeSegment): { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segment": "day" | "month" | "year" | "hour" | "minute"; "aria-label": "day" | "month" | "year" | "hour" | "minute"; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number | undefined; "aria-valuetext": string; "aria-disabled": true | undefined; onkeydown: (e: KeyboardEvent) => void; onblur: () => void; "aria-hidden"?: undefined; }; }

Headless locale-aware segmented date/instant field behavior. Supports multi-digit buffered typing (waiting for the full digit count before committing), ArrowUp/Down stepping, ArrowLeft/Right segment focus and Backspace clearing.

Parameters

NameTypeDescription
optionsDateFieldOptions
  • value: () => DateValue | undefined

    Controlled DateValue getter.

  • on_change: (next: DateValue | undefined) => void

    Called when the complete date/time value changes (or clears to undefined).

  • granularity?: () => 'day' | 'hour' | 'minute'

    Editing precision: 'day' (date only), 'hour' (date + hour), or 'minute' (date + hour + minute).

  • locale?: () => string | undefined

    BCP-47 locale for segment order and separators (default 'en-US').

  • disabled?: () => boolean

    Disabled state.

  • min?: () => DateValue | undefined

    Minimum allowed date value.

  • max?: () => DateValue | undefined

    Maximum allowed date value.

Source: packages/ui/src/behaviors/date-time.svelte.ts:222

create_disclosure function

function create_disclosure(options?: DisclosureOptions): { readonly open: boolean; readonly disabled: boolean; readonly state: "open" | "closed"; set_open: (next: boolean) => void; toggle: () => void; show: () => void; hide: () => void; trigger_attrs(): { type: "button"; "aria-expanded": boolean; "aria-controls": string; "data-state": "open" | "closed"; disabled: true | undefined; onclick: () => void; }; content_attrs(): { id: string; hidden: boolean; "data-state": "open" | "closed"; }; }

Headless disclosure state + ARIA attribute getters (trigger_attrs, content_attrs). Composes directly onto any button/panel without wrapper elements.

Parameters

NameTypeDescription
options?DisclosureOptions

Source: packages/ui/src/behaviors/disclosure.svelte.ts:27

create_dismiss function

function create_dismiss(options: DismissOptions): { readonly depth: number; readonly topmost: boolean; surface: Attachment<HTMLElement>; }

Headless LIFO overlay dismissal behavior. Attach surface to the floating/dialog element so nested overlays dismiss one layer at a time on Escape or outside click.

Parameters

NameTypeDescription
optionsDismissOptions
  • open: () => boolean

    Whether this layer is currently active/open.

  • on_dismiss: (reason: DismissReason, event: KeyboardEvent | PointerEvent) => void

    Called when the topmost layer should close.

  • escape?: boolean | (() => boolean)

    Close on Escape key (default true).

  • outside?: boolean | (() => boolean)

    Close on pointerdown outside the attached surface (default true).

  • ignore?: () => readonly (Element | null | undefined)[]

    Extra elements treated as inside (e.g. an anchor trigger button).

Source: packages/ui/src/behaviors/dismiss.svelte.ts:43

create_drawer function

function create_drawer(options?: DrawerOptions): { readonly open: boolean; readonly dragging: boolean; readonly offset: number; readonly snap_index: number; readonly snap_fraction: number; set_open: (next: boolean) => void; set_snap: (idx: number) => void; surface: Attachment<HTMLElement>; handle: Attachment<HTMLElement>; surface_attrs(): { role: "dialog"; "aria-modal": true | undefined; "aria-label": string | undefined; "data-side": DrawerSide; "data-dragging": string | undefined; "data-state": "open" | "closed"; style: string | undefined; }; }

Swipeable snap-point drawer / mobile bottom sheet with rubber-band overdrag, velocity fling dismissal, LIFO Escape/backdrop dismiss, modal focus trap + inert background and control registration.

Parameters

NameTypeDescription
options?DrawerOptions

Source: packages/ui/src/behaviors/motion.svelte.ts:128

create_field function

function create_field(options?: FieldBehaviorOptions): { readonly id: string; readonly invalid: boolean; readonly error: string | undefined; label_attrs(): { for: string; "data-required": string | undefined; "data-invalid": string | undefined; "data-disabled": string | undefined; }; control_attrs(): { id: string; "aria-describedby": string | undefined; "aria-invalid": true | undefined; "aria-required": true | undefined; disabled: true | undefined; readonly: true | undefined; }; description_attrs(): { id: string; }; error_attrs(): { id: string; role: "alert"; }; }

Headless field ARIA wiring (label_attrs, control_attrs, description_attrs, error_attrs).

Parameters

NameTypeDescription
options?FieldBehaviorOptions

Source: packages/ui/src/behaviors/field.svelte.ts:28

create_file_dropzone function

function create_file_dropzone(options: FileDropzoneOptions): { readonly dragging: boolean; readonly disabled: boolean; open(): void; process: (list: FileList | readonly File[]) => void; zone: Attachment<HTMLElement>; input: Attachment<HTMLInputElement>; input_attrs(): { type: "file"; accept: string | undefined; multiple: boolean | undefined; disabled: true | undefined; onchange: (event: Event) => void; }; }

Headless file dropzone & batch validator: depth-counted drag-over state (zero child flicker), accept MIME/extension, max size and max count filtering, and file-input bridge.

Parameters

NameTypeDescription
optionsFileDropzoneOptions
  • accept?: readonly string[]

    Accepted MIME types or extensions (e.g. ['image/*', '.pdf']).

  • max_bytes?: number

    Maximum file size in bytes.

  • max_files?: number

    Maximum number of files accepted in one drop/selection (default unlimited).

  • disabled?: () => boolean

    Disabled state.

  • on_files: (result: { readonly accepted: readonly File[]; readonly rejected: readonly RejectedFile[]; }) => void

    Called with validated accepted and rejected files.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:764

create_floating function

function create_floating(options: FloatingOptions): { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }

Headless anchor-relative floating behavior with flip/shift collision avoidance, virtual anchors, --available-height/--available-width CSS variables and LIFO dismiss.

Parameters

NameTypeDescription
optionsFloatingOptions
  • open: () => boolean

    Whether the floating surface is open.

  • on_dismiss?: (reason: DismissReason) => void

    Called when Escape or an outside pointer press dismisses the surface.

  • anchor?: () => FloatingAnchor | null

    Optional reactive anchor element or virtual anchor getter.

  • side?: FloatingSide | (() => FloatingSide)

    Preferred side relative to the anchor (default 'bottom').

  • align?: FloatingAlign | (() => FloatingAlign)

    Cross-axis alignment relative to the anchor (default 'center').

  • side_offset?: number | (() => number)

    Gap between anchor and floating surface in px (default 4).

  • align_offset?: number | (() => number)

    Shift along the cross axis in px (default 0).

  • padding?: number | (() => number)

    Viewport edge padding in px (default 8).

  • flip?: boolean | (() => boolean)

    Flip to the opposite side when viewport room is insufficient (default true).

  • escape?: boolean | (() => boolean)

    Close on Escape key (default true).

  • outside?: boolean | (() => boolean)

    Close on outside pointer press (default true).

Source: packages/ui/src/behaviors/floating.svelte.ts:117

create_focus_recovery function

function create_focus_recovery<T = undefined>(options: FocusRecoveryOptions<T>): { item: (key: string, data?: T) => Attachment<HTMLElement>; }

Tracks focus across dynamically mounted items ({@attach recovery.item(key, data)}). When the currently focused item unmounts, fallback runs after removal settles and restores keyboard focus.

Parameters

NameTypeDescription
optionsFocusRecoveryOptions<T>
  • fallback: (lost: LostFocus<T>) => HTMLElement | null | undefined

    Returns the next element to focus when a bound item unmounts with focus, or null/undefined.

Source: packages/ui/src/behaviors/focus-recovery.svelte.ts:29

create_focus_trap function

function create_focus_trap(options: FocusTrapOptions): { container: Attachment<HTMLElement>; }

Headless focus trap + focus restoration + optional modal inert_outside & ref-counted lock_scroll attachment ({@attach trap.container}).

Parameters

NameTypeDescription
optionsFocusTrapOptions
  • active: () => boolean

    Whether focus trapping is active.

  • auto_focus?: boolean | (() => boolean)

    Automatically move focus into the container when activated (default true).

  • restore_focus?: boolean | (() => boolean)

    Restore focus to the previously active element on close (default true).

  • trap?: boolean | (() => boolean)

    Keep Tab / focusin strictly contained inside the container (default true).

  • modal?: boolean | (() => boolean)

    Mark background siblings inert while active (default false; set true on modal dialogs).

  • prevent_scroll?: boolean | (() => boolean)

    Apply ref-counted document scroll lock while active (default false).

  • topmost?: () => boolean

    Optional predicate gating focus-trap listeners to only the topmost stacked layer.

  • on_open_auto_focus?: (event: Event) => void

    Cancelable hook invoked before initial autofocus runs.

  • on_close_auto_focus?: (event: Event) => void

    Cancelable hook invoked before focus returns to the previous element on close.

  • on_focus_outside?: (event: FocusEvent) => void

    Called when focus escapes outside the container while active.

Source: packages/ui/src/behaviors/focus-trap.svelte.ts:57

create_grid_focus function

function create_grid_focus(options: GridFocusOptions): { readonly active: GridCell | null; focus: (cell: GridCell, shift?: boolean) => void; cell(cell: GridCell): Attachment<HTMLElement>; grid_attrs(): { role: "grid"; "aria-rowcount": number; "aria-colcount": number; onkeydown: (event: KeyboardEvent) => void; }; cell_attrs(cell: GridCell): { role: "gridcell"; "aria-rowindex": number; "aria-colindex": number; "aria-disabled": true | undefined; "data-active": string | undefined; tabindex: number | undefined; onfocus: () => void; }; }

Headless WAI-ARIA 2D grid roving focus manager supporting Arrow keys (RTL-aware), Home/End, Ctrl/Cmd+Home/End, PageUp/PageDown and virtualized row reveal.

Parameters

NameTypeDescription
optionsGridFocusOptions
  • rows: () => number

    Total row count.

  • cols: () => number

    Total column count.

  • active?: () => GridCell | null

    Controlled active cell; omit for internal state.

  • on_move?: (cell: GridCell, details: { readonly from: GridCell | null; readonly shift: boolean; }) => void

    Called whenever the active cell moves.

  • page_size?: number | (() => number)

    Rows skipped by PageUp / PageDown (default 10).

  • disabled?: (cell: GridCell) => boolean

    Skip cells matching this predicate.

  • reveal?: (cell: GridCell) => void

    Scroll an unrendered virtualized cell into view before focusing.

Source: packages/ui/src/behaviors/grid.svelte.ts:51

create_hover_card function

function create_hover_card(options?: HoverCardOptions): { readonly open: boolean; readonly present: boolean; readonly floating: { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }; set_open: (next: boolean) => void; trigger: Attachment<HTMLElement>; content: Attachment<HTMLElement>; trigger_attrs(): { "aria-expanded": boolean; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; onfocus: () => void; onblur: () => void; }; content_attrs(): { "data-state": "open" | "closed"; style: string; onpointerenter: (e: PointerEvent) => void; onpointerleave: (e: PointerEvent) => void; }; }

Rich non-modal hover preview card composing create_hover_intent, create_floating, create_presence and Escape dismissal (pointer safe-corridor keeps the card open while moving into it).

Parameters

NameTypeDescription
options?HoverCardOptions

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:692

create_hover_intent function

function create_hover_intent(options: HoverIntentOptions): { enter: (event?: PointerEvent, isTrigger?: boolean) => void; leave: (event?: PointerEvent) => void; clear: () => void; open_now: () => void; close_now: () => void; }

Headless hover-intent manager with safe-polygon pointer corridor and warm-group delay sharing.

Parameters

NameTypeDescription
optionsHoverIntentOptions
  • trigger: () => HTMLElement | null | undefined

    Trigger element getter.

  • popup: () => HTMLElement | null | undefined

    Popup element getter.

  • open: () => boolean

    Whether the popup is currently open.

  • on_open: () => void

    Opens the popup.

  • on_close: () => void

    Closes the popup.

  • open_delay?: number | (() => number)

    Open delay in ms when cold (default 120).

  • close_delay?: number | (() => number)

    Close delay in ms after leaving the safe corridor (default 80).

  • group?: string | null

    Shared warm-group key (default 'tooltip'; pass null to opt out).

  • warm_ms?: number

    Warm window in ms during which sibling hovers open immediately (default 250).

  • hoverable?: boolean | (() => boolean)

    Allow pointer to travel into popup content without closing (default true).

Source: packages/ui/src/behaviors/hover-intent.svelte.ts:121

create_image_cropper function

function create_image_cropper(options?: ImageCropperOptions): { readonly crop: CropRect; readonly zoom: number; readonly rotation: number; readonly mover: { readonly dragging: boolean; handle: Attachment<HTMLElement>; handle_attrs(): { tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }; readonly resizer: { readonly dragging: boolean; handle_attrs: (mode: "x" | "y" | "xy", label?: string) => { role: "separator"; tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onpointerdown: (down: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; }; set_crop: (next: CropRect) => void; set_zoom: (next: number) => void; rotate: (deg?: number) => void; pixel_crop(naturalWidth: number, naturalHeight: number): { x: number; y: number; width: number; height: number; }; }

Headless image cropper with aspect-locked move & resize, zoom, rotation, pixel-crop export and Norbius control registration.

Parameters

NameTypeDescription
options?ImageCropperOptions

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1110

create_inline_edit function

function create_inline_edit(options: InlineEditOptions): { readonly editing: string | null; draft: string; is_editing(id: string): boolean; begin: (id: string, reason: InlineEditReason, initial?: string, origin?: HTMLElement | null) => void; commit: (reason?: InlineEditReason) => boolean; cancel: (reason?: InlineEditReason) => void; input: Attachment<HTMLInputElement | HTMLTextAreaElement>; cell_attrs(id: string): { "data-editing": string | undefined; ondblclick: (event: MouseEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; input_attrs(): { value: string; oninput: (event: Event) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; }; }

Headless edit-in-place behavior for table cells, card titles and tree labels: Enter/F2/double-click edits preserving value, printable key replaces value, Enter/blur/Tab commits, Escape reverts and focus restores to the originating cell.

Parameters

NameTypeDescription
optionsInlineEditOptions
  • value: (id: string) => string

    Reads the current text for id when editing starts.

  • commit: (id: string, text: string, reason: InlineEditReason) => boolean | void

    Persists the edited text; return false to keep editing (e.g. validation error).

  • disabled?: (id: string) => boolean

    Optional disabled predicate per id.

  • on_tab?: (id: string, direction: 1 | -1) => void

    Called when Tab commits so an enclosing grid can advance to the next/previous cell.

Source: packages/ui/src/behaviors/grid.svelte.ts:394

create_input_history function

function create_input_history<T = string>(options: InputHistoryOptions<T>): { readonly index: number | null; readonly browsing: boolean; onkeydown: (event: KeyboardEvent) => void; reset: () => void; }

Terminal / chat-composer ArrowUp & ArrowDown history recall that preserves the user's unsent draft and only triggers when the caret sits on the first (ArrowUp) or last (ArrowDown) line.

Parameters

NameTypeDescription
optionsInputHistoryOptions<T>
  • entries: () => readonly T[]

    Past entries, oldest first.

  • read: () => T

    Reads the current composer value.

  • write: (value: T, event: KeyboardEvent) => boolean | void

    Writes a recalled value into the composer; return false to cancel navigation.

  • at_edge?: (direction: 'up' | 'down', event: KeyboardEvent) => boolean

    Custom edge detector; defaults to first/last line of <textarea> or anywhere in <input>.

Source: packages/ui/src/behaviors/micro.svelte.ts:40

create_lasso function

function create_lasso(options: LassoOptions): { readonly rect: LassoRect | null; readonly active: boolean; surface: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; }

Headless marquee / rubber-band drag selection over spatially positioned items.

Parameters

NameTypeDescription
optionsLassoOptions
  • on_change: (keys: readonly string[], rect: LassoRect) => void

    Called continuously as the marquee rectangle changes with intersecting item keys.

  • on_commit?: (keys: readonly string[]) => void

    Called when the marquee drag finishes.

Source: packages/ui/src/behaviors/canvas.svelte.ts:440

create_listbox function

function create_listbox<T extends ListboxItem = ListboxItem>(options: ListboxOptions<T>): { readonly id: string; query: string; readonly items: readonly T[]; readonly active: string; readonly active_id: string | undefined; readonly selected: readonly string[]; readonly count: number; is_selected: (key: string) => boolean; choose: (key: string) => void; toggle: (key: string) => void; toggle_all: () => void; clear: () => void; focus: (key: string) => void; highlight: (key: string) => void; activate_active(): void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; input_attrs(open?: boolean): { role: "combobox"; "aria-autocomplete": "list"; "aria-expanded": boolean; "aria-controls": string; "aria-activedescendant": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; list_attrs(): { id: string; role: "listbox"; "aria-multiselectable": true | undefined; onkeydown: (event: KeyboardEvent) => void; }; option_attrs(value: string): { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-highlighted": string | undefined; tabindex: number | undefined; onfocus: (() => void) | undefined; onpointerdown: ((event: PointerEvent) => void) | undefined; onpointermove: () => void; onclick: (event: MouseEvent) => void; }; }

Headless composable listbox combining create_selection, create_roving_focus (or virtual aria-activedescendant highlighting), create_typeahead and live query filtering.

Parameters

NameTypeDescription
optionsListboxOptions<T>
  • items: () => readonly T[]

    All items in visual order.

  • mode?: SelectionMode | (() => SelectionMode)

    Selection mode (default 'single').

  • focus?: ListboxFocusMode

    Focus strategy: 'dom' (default) or 'virtual' (aria-activedescendant).

  • selected?: () => readonly string[]

    Controlled selected values; omit for internal state.

  • default_selected?: readonly string[]

    Initial selected values when uncontrolled.

  • on_change?: (values: readonly string[]) => void

    Called when selection changes.

  • on_activate?: (item: T) => void

    Called when an item is explicitly activated (Enter / click in single mode).

  • filter?: false | ((item: T, query: string) => boolean)

    Optional custom filter; defaults to case-insensitive substring match on label + keywords. Pass false for externally filtered/async lists.

  • typeahead?: boolean

    Enable incremental typeahead when not typing in a search input (default true in 'dom' mode, false in 'virtual' mode).

  • loop?: boolean

    Wrap arrow navigation at list ends (default true).

  • id?: string

    Optional stable id prefix for aria-controls / aria-activedescendant.

Example

const lb = create_listbox({
  items: () => items.map((i) => ({ value: i.id, label: i.title })),
  on_activate: (item) => openItem(item.value)
});
// <input bind:value={lb.query} />
// <div {...lb.list_attrs()}>
//   {#each lb.items as item (item.value)}
//     <div {...lb.option_attrs(item.value)}>{item.label}</div>
//   {/each}
// </div>

Source: packages/ui/src/behaviors/listbox.svelte.ts:71

create_menu function

function create_menu<T extends MenuItem = MenuItem>(options: MenuOptions<T>): { readonly open: boolean; readonly active: string; readonly floating: { readonly x: number; readonly y: number; readonly side: FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }; open_at: (point: { x: number; y: number; }) => void; open_menu: () => void; close: () => void; toggle: () => void; trigger: Attachment<HTMLElement>; content: Attachment<HTMLElement>; context_area: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; trigger_attrs(): { type: "button"; "aria-haspopup": "menu"; "aria-expanded": boolean; "aria-controls": string | undefined; "data-state": "open" | "closed"; onclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; menu_attrs(): { id: string; role: "menu"; "aria-label": string | undefined; "data-state": "open" | "closed"; "data-side": FloatingSide; style: string; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "menuitem" | "menuitemcheckbox" | "menuitemradio"; "aria-disabled": true | undefined; "aria-checked": boolean | undefined; "data-highlighted": string | undefined; "data-disabled": string | undefined; tabindex: number | undefined; onfocus: () => void; onpointermove: () => void; onclick: (event: MouseEvent) => void; }; }

Headless WAI-ARIA menu & context-menu behavior built on create_floating, create_roving_focus and create_typeahead.

Parameters

NameTypeDescription
optionsMenuOptions<T>
  • items: () => readonly T[]

    Ordered menu items.

  • open?: () => boolean

    Controlled open state; omit for internal state.

  • on_open_change?: (open: boolean) => void

    Called when open state changes.

  • on_select?: (item: T) => void

    Called when any enabled menu item is activated.

  • close_on_select?: boolean

    Close the menu after selecting a regular menuitem (default true).

  • side?: FloatingSide

    Preferred side relative to trigger (default 'bottom').

  • align?: FloatingAlign

    Cross-axis alignment relative to trigger (default 'start').

  • label?: string

    Accessible name for the menu.

  • control?: { readonly id: string; readonly label?: string; }

    Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/menu.svelte.ts:51

create_menubar function

function create_menubar(options: MenubarOptions): { readonly open_menu: string | null; is_open(id: string): boolean; open(id: string): void; close(): void; root: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { role: "menubar"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; }; trigger_attrs(id: string): { type: "button"; role: "menuitem"; "aria-haspopup": "menu"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onclick: () => void; onpointerenter: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Desktop application role="menubar" coordinator: horizontal roving focus across top-level menu triggers, hover-switch when any menu is open, cross-menu ArrowLeft/ArrowRight handoff and Escape close.

Parameters

NameTypeDescription
optionsMenubarOptions
  • menus: () => readonly string[]
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:412

create_move function

function create_move(options: MoveOptions): { readonly dragging: boolean; handle: Attachment<HTMLElement>; handle_attrs(): { tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }

Headless 2D free-move behavior (pointer drag + Arrow keys, optional grid snap & bounds).

Parameters

NameTypeDescription
optionsMoveOptions
  • position: () => MovePoint
  • on_change: (next: MovePoint) => void
  • on_commit?: (final: MovePoint) => void
  • step?: number
  • grid?: number
  • bounds?: () => { readonly min_x: number; readonly max_x: number; readonly min_y: number; readonly max_y: number; }
  • scale?: () => number
  • label?: string

Source: packages/ui/src/behaviors/canvas.svelte.ts:40

create_navigation_menu function

function create_navigation_menu(options: NavigationMenuOptions): { readonly active: string | null; is_open(id: string): boolean; open(id: string): void; close(): void; root: Attachment<HTMLElement>; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { "aria-label": string; onpointerleave: () => void; onkeydown: (event: KeyboardEvent) => void; }; trigger_attrs(id: string): { type: "button"; "aria-expanded": boolean; "data-state": "open" | "closed"; tabindex: number | undefined; onfocus: () => void; onpointerenter: () => void; onclick: () => void; }; content_attrs(): { onpointerenter: () => void; onpointerleave: () => void; }; }

Site/app mega-menu navigation behavior: hover-intent opening with shared warm group, click toggle, keyboard roving focus across top-level triggers and Escape/outside dismissal.

Parameters

NameTypeDescription
optionsNavigationMenuOptions
  • items: () => readonly string[]
  • open_delay?: number
  • close_delay?: number
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:535

create_number_input function

function create_number_input(options?: NumberInputOptions): { readonly value: number | null; readonly text: string; set: (next: number | null) => void; increment: () => void; decrement: () => void; increment_button: import("svelte/attachments").Attachment<HTMLElement>; decrement_button: import("svelte/attachments").Attachment<HTMLElement>; input_attrs(): { role: "spinbutton"; inputmode: "decimal" | "numeric"; value: string; disabled: true | undefined; "aria-label": string | undefined; "aria-valuemin": number | undefined; "aria-valuemax": number | undefined; "aria-valuenow": number | undefined; oninput: (event: Event) => void; onblur: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless WAI-ARIA spinbutton number input with clamped stepping, Arrow/Page/Home/End keys, press-and-hold increment/decrement attachments (bind_repeat) and clean empty/numeric parsing.

Parameters

NameTypeDescription
options?NumberInputOptions

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:278

create_overflow function

function create_overflow<T>(options: OverflowOptions<T>): { readonly fit: number; readonly visible: readonly T[]; readonly hidden: readonly T[]; readonly has_overflow: boolean; readonly active_in_hidden: boolean; more_open: boolean; list: Attachment<HTMLElement>; measure: Attachment<HTMLElement>; }

Headless ResizeObserver-backed overflow behavior. Attach list to the visible strip and measure to an off-screen mirror containing every item plus the trailing overflow trigger; read visible, hidden and active_in_hidden reactively.

Parameters

NameTypeDescription
optionsOverflowOptions<T>
  • items: () => readonly T[]

    All items in display order.

  • key?: (item: T) => string

    Key extractor for checking whether the active item is currently inside the overflow menu.

  • active?: () => string | undefined

    Currently active key (optional).

Source: packages/ui/src/behaviors/overflow.svelte.ts:25

create_overlay_stack function

function create_overlay_stack<Payload, Result = unknown>(): { readonly stack: readonly OverlayEntry<Payload, Result>[]; readonly top: OverlayEntry<Payload, Result> | null; readonly count: number; open: (payload: Payload) => { readonly id: string; readonly promise: Promise<Result | undefined>; }; close: (id: string, result?: Result) => void; close_top: (result?: Result) => void; close_all: () => void; }

Imperative LIFO overlay/modal stack manager: open(payload) returns a Promise that settles when close(id, result) or Escape dismisses that overlay layer.

Source: packages/ui/src/behaviors/platform.svelte.ts:458

create_pagination function

function create_pagination(options: PaginationOptions): { readonly page: number; readonly pages: number | null; readonly has_previous: boolean; readonly has_next: boolean; readonly range: PaginationEntry[]; go: (target: number) => void; previous: () => void; next: () => void; first: () => void; last: () => void; }

Headless pagination behavior supporting both offset (total_pages) and keyset (has_previous/has_next) views.

Parameters

NameTypeDescription
optionsPaginationOptions
  • page?: () => number

    Current 1-based page number (controlled getter, or omit for internal state).

  • default_page?: number

    Initial 1-based page when uncontrolled (default 1).

  • total_pages: () => number | null

    Total page count (null when unknown / keyset-paged).

  • has_previous?: () => boolean

    Explicit previous availability override (for cursor/keyset pagination).

  • has_next?: () => boolean

    Explicit next availability override (for cursor/keyset pagination).

  • on_page_change?: (page: number) => void

    Called when the page changes.

  • siblings?: number

    Sibling pages shown on each side of the current page in range (default 1).

  • control?: { id: string; label?: string; }

    Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/pagination.svelte.ts:61

create_panel_group function

function create_panel_group(options: PanelGroupOptions): { readonly sizes: readonly number[]; readonly dragging: number | null; size_of(index: number): number; reset: () => void; container: Attachment<HTMLElement>; handle: (handleIndex: number) => Attachment<HTMLElement>; handle_attrs(handleIndex: number): { role: "separator"; tabindex: number; "aria-orientation": "horizontal" | "vertical"; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number; "data-dragging": string | undefined; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Multi-pane percentage resizable layout group (role="separator" handles between adjacent panes) with min/max clamping, collapsible snap-to-zero, double-click reset, keyboard stepping and optional persistence.

Parameters

NameTypeDescription
optionsPanelGroupOptions
  • panels: readonly PanelSpec[]
  • direction?: 'horizontal' | 'vertical'
  • storage_key?: string
  • on_layout?: (sizes: readonly number[]) => void
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:48

create_password_input function

function create_password_input(options?: PasswordInputOptions): { readonly visible: boolean; readonly caps_lock: boolean; toggle: () => void; set_visible(next: boolean): void; input: Attachment<HTMLInputElement>; input_attrs(): { type: "text" | "password"; "data-agent-secret": string; "aria-label": string | undefined; onkeydown: (event: KeyboardEvent) => void; onkeyup: (event: KeyboardEvent) => void; }; toggle_attrs(): { type: "button"; "aria-pressed": boolean; "aria-label": string; onclick: () => void; }; }

Headless password input behavior: visibility toggle, CapsLock warning detection and automatic data-agent-secret protection so secret values never leak into agent snapshots.

Parameters

NameTypeDescription
options?PasswordInputOptions

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:888

create_pin_input function

function create_pin_input(options: PinInputOptions): { readonly value: string; readonly cells: readonly PinCell[]; readonly focused: boolean; set_value: (raw: string) => void; input_attrs(): { value: string; maxlength: number; disabled: true | undefined; onfocus: (event: FocusEvent) => void; onblur: () => void; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onselect: (event: Event) => void; }; }

Headless PIN / OTP input behavior exposing reactive cells, value and native input_attrs().

Parameters

NameTypeDescription
optionsPinInputOptions
  • length: number | (() => number)

    Number of cells (e.g. 6).

  • value?: () => string

    Controlled value getter; omit for internal state.

  • default_value?: string

    Initial value when uncontrolled.

  • on_value_change?: (value: string) => void

    Called whenever the sanitized value changes.

  • on_complete?: (value: string) => void

    Called when the value reaches length characters.

  • pattern?: RegExp

    Allowed character filter regex (default digits only /^\d+$/).

  • disabled?: () => boolean

    Disabled state.

  • control?: { readonly id: string; readonly label?: string; readonly secret?: boolean; readonly element?: () => HTMLElement | null; }

    Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/pin.svelte.ts:48

create_pointer_kind function

function create_pointer_kind(): { readonly precision: PointerPrecision; readonly hover: boolean; readonly coarse: boolean; }

Reactive primary pointer precision (coarse/fine) and hover capability store.

Source: packages/ui/src/behaviors/platform.svelte.ts:120

create_presence function

function create_presence(options: PresenceOptions): { readonly present: boolean; readonly state: PresenceState; readonly exiting: boolean; attach: Attachment<HTMLElement>; }

Keeps an element mounted while closing until its CSS/WAAPI exit animation finishes. Writes data-starting-style on the first frame after mount and data-ending-style during exit. In environments without animations (or under reduced motion), unmounts synchronously.

Parameters

NameTypeDescription
optionsPresenceOptions
  • open: () => boolean

    Reactive open getter.

  • on_complete?: (open: boolean) => void

    Called once enter or exit settles.

Source: packages/ui/src/behaviors/presence.svelte.ts:115

create_preview function

function create_preview<T>(options: PreviewOptions<T>): { readonly current: T; readonly previewing: boolean; update: (next: T) => void; commit: (finalValue?: T) => void; cancel: () => void; }

Holds a live transient pointer-drag/scrub preview value over an authoritative value, with clean commit() and cancel() transitions.

Parameters

NameTypeDescription
optionsPreviewOptions<T>
  • value: () => T

    Committed authoritative value.

  • on_commit: (value: T) => void

    Called when a preview is explicitly committed.

Source: packages/ui/src/behaviors/platform.svelte.ts:339

create_radio_group function

function create_radio_group(options: RadioGroupOptions): { readonly value: string | undefined; select: (next: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "radiogroup"; "aria-label": string | undefined; "aria-orientation": "horizontal" | "vertical"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(key: string): { type: "button"; role: "radio"; "aria-checked": boolean; "aria-disabled": true | undefined; "data-state": "checked" | "unchecked"; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }; }

Headless WAI-ARIA radiogroup (also powers Segmented Controls): single tab stop, arrow keys move focus and select simultaneously.

Parameters

NameTypeDescription
optionsRadioGroupOptions
  • items: () => readonly string[]
  • value?: () => string | undefined
  • default_value?: string
  • on_change?: (value: string) => void
  • orientation?: RovingOrientation
  • disabled?: (value: string) => boolean
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:101

create_rating function

function create_rating(options?: RatingOptions): { readonly value: number; readonly hovered: number | null; readonly display: number; items: number[]; rate: (next: number) => void; item: (score: number) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "radiogroup"; "aria-label": string; onpointerleave: () => void; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(score: number): { type: "button"; role: "radio"; "aria-checked": boolean; "aria-label": string; "data-filled": string | undefined; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onpointerenter: () => void; onclick: () => void; }; }

Headless star/score rating picker (radiogroup, hover preview, Arrow/Home/End keys).

Parameters

NameTypeDescription
options?RatingOptions

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:424

create_reorder function

function create_reorder(options: ReorderOptions): { readonly dragging: string | null; readonly over: string | null; move(fromIndex: number, toIndex: number): void; move_by: (key: string, delta: number) => void; item(key: string): Attachment<HTMLElement>; item_attrs(key: string): { draggable: boolean; "data-dragging": string | undefined; "data-drop-target": string | undefined; ondragstart: (event: DragEvent) => void; ondragover: (event: DragEvent) => void; ondragleave: () => void; ondrop: (event: DragEvent) => void; ondragend: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless pointer + keyboard reordering behavior for queues, lanes, checklists and columns.

Parameters

NameTypeDescription
optionsReorderOptions
  • items: () => readonly string[]

    Ordered item keys.

  • on_reorder: (from: number, to: number, next: readonly string[]) => void

    Invoked with (fromIndex, toIndex, nextOrder) when an item moves.

  • orientation?: ReorderOrientation

    Axis for movement (default 'vertical').

  • disabled?: boolean | ((key: string) => boolean)

    Disable reordering globally or for a specific key.

  • label?: (key: string) => string

    Optional human-readable label per key for live announcements.

Source: packages/ui/src/behaviors/reorder.svelte.ts:42

create_resize function

function create_resize(options: ResizeOptions): { readonly dragging: boolean; handle_attrs(): { role: "separator"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuenow": number; "aria-valuemin": number; "aria-valuemax": number | undefined; tabindex: number; "data-dragging": string | undefined; onpointerdown: (event: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless 1D pointer + keyboard resize handle behavior (handle_attrs()).

Parameters

NameTypeDescription
optionsResizeOptions
  • value: () => number

    Current size in pixels (reactive getter).

  • on_change: (next: number) => void

    Called with the clamped pixel size during drag and keyboard nudges.

  • on_commit?: (final: number) => void

    Called once when a pointer drag finishes.

  • axis?: 'horizontal' | 'vertical'

    Axis of drag movement (default 'horizontal').

  • invert?: boolean

    Invert drag delta (e.g. dragging a right-docked sheet's left edge leftward widens it).

  • min?: number | (() => number)

    Minimum size in pixels (default 120).

  • max?: number | (() => number)

    Maximum size in pixels (default Infinity).

  • scale?: number | (() => number)

    Optional zoom divisor for scaled canvases/preview frames (default 1).

  • step?: number

    Keyboard Arrow nudge increment in pixels (default 24).

  • label?: string

    Accessible label for the separator handle.

Source: packages/ui/src/behaviors/resize.svelte.ts:41

create_resize_box function

function create_resize_box(options: ResizeBoxOptions): { readonly dragging: boolean; handle_attrs: (mode: "x" | "y" | "xy", label?: string) => { role: "separator"; tabindex: number; "aria-label": string | undefined; "data-dragging": string | undefined; onpointerdown: (down: PointerEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless 2D edge & corner resize behavior supporting 'x', 'y' and 'xy' handles with zoom scaling.

Parameters

NameTypeDescription
optionsResizeBoxOptions
  • size: () => ResizeBox
  • on_change: (next: ResizeBox) => void
  • on_commit?: (final: ResizeBox) => void
  • min_width?: number
  • max_width?: number
  • min_height?: number
  • max_height?: number
  • scale?: () => number
  • step?: number

Source: packages/ui/src/behaviors/resize.svelte.ts:162

create_roving_focus function

function create_roving_focus(options: RovingFocusOptions): { readonly active: string; focus(key: string): void; next(): void; prev(): void; item(key: string): Attachment<HTMLElement>; root_attrs(): { onkeydown: (event: KeyboardEvent) => void; }; item_attrs(key: string): { tabindex: number | undefined; "data-roving-active": string | undefined; onfocus: () => void; }; }

Headless roving-tabindex focus manager with automatic focus recovery when items leave the DOM.

Parameters

NameTypeDescription
optionsRovingFocusOptions
  • items: () => readonly string[]

    Keys in navigation order.

  • active?: () => string | undefined

    Controlled active key; omit for internal focus tracking.

  • on_active_change?: (key: string) => void

    Called when keyboard navigation moves focus to a key.

  • orientation?: RovingOrientation | (() => RovingOrientation)

    Axis of arrow navigation (default 'horizontal').

  • loop?: boolean

    Wrap from last back to first and vice versa (default true).

  • disabled?: (key: string) => boolean

    Skip disabled keys during keyboard movement.

  • on_activate?: (key: string) => void

    Optional callback invoked when Space or Enter activates the focused item.

Source: packages/ui/src/behaviors/roving-focus.svelte.ts:34

create_selection function

function create_selection(options: SelectionOptions): { readonly selected: readonly string[]; readonly count: number; readonly all_selected: boolean; readonly some_selected: boolean; is_selected(key: string): boolean; choose: (key: string) => void; toggle: (key: string) => void; extend: (to: string, opts?: { from?: string | null; additive?: boolean; }) => void; toggle_all: () => void; clear: () => void; item_attrs(key: string): { "aria-selected": boolean; "data-selected": string | undefined; "aria-disabled": true | undefined; onclick: (event: MouseEvent) => void; }; }

Headless single/multi/range selection behavior for lists, tables, boards, timelines and pickers. Spread item_attrs(key) onto each item to get aria-selected, data-selected and native click / Shift+click / Cmd+click handling automatically.

Parameters

NameTypeDescription
optionsSelectionOptions
  • order: () => readonly string[]

    Keys in visual order (used for Shift ranges and select-all).

  • mode?: SelectionMode | (() => SelectionMode)

    Single or multiple selection (default 'single').

  • selected?: () => readonly string[]

    Controlled selected keys; omit for internal state.

  • default_selected?: readonly string[]

    Initial selected keys when uncontrolled.

  • on_change?: (keys: readonly string[]) => void

    Called with the next selection whenever it changes.

  • selectable?: (key: string) => boolean

    Whether a key may be selected (default every key).

Source: packages/ui/src/behaviors/selection.svelte.ts:58

create_shortcuts function

function create_shortcuts(bindings: readonly ShortcutBinding[] | (() => readonly ShortcutBinding[]), options?: { readonly target?: () => EventTarget | null; readonly chord_timeout_ms?: number; }): void

Binds one or more keyboard shortcuts (including multi-key chord sequences like 'g i') while mounted, cleaning up automatically when the enclosing component tears down.

Parameters

NameTypeDescription
bindingsreadonly ShortcutBinding[] | (() => readonly ShortcutBinding[])
options?{ readonly target?: () => EventTarget | null; readonly chord_timeout_ms?: number; }

Source: packages/ui/src/behaviors/shortcuts.svelte.ts:153

create_slider function

function create_slider(options?: SliderOptions): { readonly value: number; readonly values: readonly number[]; readonly percent: number; readonly percents: number[]; readonly dragging: boolean; readonly active_thumb: number; set(next: number, index?: number): void; track: Attachment<HTMLElement>; thumb_attrs(index?: number): { role: "slider"; "aria-orientation": "horizontal" | "vertical"; "aria-label": string | undefined; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number; "aria-disabled": true | undefined; tabindex: number | undefined; "data-dragging": string | undefined; onfocus: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless single- or multi-thumb slider behavior (track attachment + thumb_attrs(index?)).

Parameters

NameTypeDescription
options?SliderOptions

Source: packages/ui/src/behaviors/slider.svelte.ts:54

create_spans function

function create_spans<S extends Span = Span>(options: SpansOptions<S>): { readonly spans: readonly S[]; readonly active: string | null; update_span: (id: string, patch: Partial<Pick<Span, "track" | "start" | "end">>, action: "move" | "resize", commitNow?: boolean) => void; create: (track: string, start: number, end: number) => void; remove: (id: string) => void; cancel(): void; span_attrs: (span: S) => { tabindex: number; "data-span-id": string; "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }

Headless track-span editor (week calendars, Gantt charts, room schedulers): move along or across tracks, resize start/end edges, draw new spans and delete — all snapped to step with keyboard support.

Parameters

NameTypeDescription
optionsSpansOptions<S>
  • tracks: () => readonly string[]
  • spans: () => readonly S[]
  • min: number
  • max: number
  • step?: number
  • min_duration?: number
  • on_commit: (next: readonly S[], action: 'draw' | 'move' | 'resize' | 'delete', id: string) => void
  • create_span?: (draft: Span) => S

Source: packages/ui/src/behaviors/canvas.svelte.ts:324

create_stick_to_bottom function

function create_stick_to_bottom(options?: StickToBottomOptions): { readonly stuck: boolean; scroll_to_bottom: (behavior?: ScrollBehavior) => void; viewport: Attachment<HTMLElement>; }

Headless tail-latching scroll attachment ({@attach tail.viewport}).

Parameters

NameTypeDescription
options?StickToBottomOptions

Source: packages/ui/src/behaviors/stick-to-bottom.svelte.ts:20

create_swipe_actions function

function create_swipe_actions(options?: SwipeActionsOptions): { readonly open: SwipeOpen | null; readonly offset: { readonly key: string; readonly x: number; } | null; close: () => void; row: (key: string) => Attachment<HTMLElement>; row_attrs: (key: string) => { "data-swipe-open": SwipeSide | undefined; style: string; onkeydown: (event: KeyboardEvent) => void; }; }

Mail-style row swipe-to-reveal actions with rubber-band resistance, full-swipe trigger and ArrowLeft/ArrowRight/Escape keyboard parity.

Parameters

NameTypeDescription
options?SwipeActionsOptions

Source: packages/ui/src/behaviors/canvas.svelte.ts:747

create_switch function

function create_switch(options?: SwitchOptions): { readonly checked: boolean; readonly disabled: boolean; set_checked: (next: boolean) => void; toggle: () => void; attrs(): { type: "button"; role: "switch"; "aria-checked": boolean; "aria-label": string | undefined; "data-state": "checked" | "unchecked"; disabled: true | undefined; onclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless WAI-ARIA switch behavior (role="switch", aria-checked, Space/Enter toggle).

Parameters

NameTypeDescription
options?SwitchOptions

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:23

create_time_field function

function create_time_field(options: TimeFieldOptions): { readonly segments: readonly DateTimeSegment[]; segment_ref(part: SegmentPart): Attachment<HTMLElement>; segment_attrs(seg: DateTimeSegment): { "aria-hidden": true; "data-segment": "literal"; role?: undefined; tabindex?: undefined; "aria-label"?: undefined; "aria-valuemin"?: undefined; "aria-valuemax"?: undefined; "aria-valuenow"?: undefined; "aria-valuetext"?: undefined; "aria-disabled"?: undefined; onkeydown?: undefined; onblur?: undefined; } | { role: "spinbutton"; tabindex: number | undefined; "data-segment": "hour" | "minute"; "aria-label": "hour" | "minute"; "aria-valuemin": number; "aria-valuemax": number; "aria-valuenow": number | undefined; "aria-valuetext": string; "aria-disabled": true | undefined; onkeydown: (e: KeyboardEvent) => void; onblur: () => void; "aria-hidden"?: undefined; }; }

Headless 24-hour segmented time-of-day field behavior (hour and optional minute).

Parameters

NameTypeDescription
optionsTimeFieldOptions
  • value: () => Time | undefined

    Controlled Time getter.

  • on_change: (next: Time | undefined) => void

    Called when the time value changes (or clears to undefined).

  • granularity?: () => 'hour' | 'minute'

    Editing precision: 'hour' or 'minute' (default 'minute').

  • disabled?: () => boolean

    Disabled state.

Source: packages/ui/src/behaviors/date-time.svelte.ts:437

create_timeline function

function create_timeline(options: TimelineOptions): { readonly expanded: readonly string[]; is_expanded(id: string): boolean; toggle: (id: string) => void; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { role: "feed"; "aria-label": string; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "article"; "aria-expanded": boolean; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; }; }

Accessible activity timeline behavior (role="feed" / ordered expandable entries) with vertical keyboard navigation, per-entry expand/collapse and Norbius control registration.

Parameters

NameTypeDescription
optionsTimelineOptions
  • items: () => readonly string[]
  • default_expanded?: readonly string[]
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1350

create_toggle_group function

function create_toggle_group(options: ToggleGroupOptions): { readonly pressed: readonly string[]; is_pressed(key: string): boolean; toggle: (key: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "group"; "aria-label": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(key: string): { type: "button"; "aria-pressed": boolean; "data-state": "on" | "off"; disabled: true | undefined; tabindex: number | undefined; onfocus: () => void; onclick: () => void; }; }

Headless toggle button group (aria-pressed, single or multi-select, roving focus).

Parameters

NameTypeDescription
optionsToggleGroupOptions
  • items: () => readonly string[]
  • mode?: 'single' | 'multiple'
  • value?: () => readonly string[]
  • default_value?: readonly string[]
  • on_change?: (values: readonly string[]) => void
  • orientation?: RovingOrientation
  • disabled?: (key: string) => boolean
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:183

create_token_input function

function create_token_input(options?: TokenInputOptions): { readonly values: readonly string[]; input_text: string; readonly active_index: number | null; readonly editing_index: number | null; editing_text: string; readonly error: string | null; add: (raw: string) => boolean; remove_at: (index: number) => void; commit_input: () => void; start_edit: (index: number) => void; commit_edit: () => void; cancel_edit: () => void; input: Attachment<HTMLInputElement>; chip: (index: number) => Attachment<HTMLElement>; input_attrs(): { value: string; disabled: true | undefined; "aria-label": string | undefined; onfocus: () => void; oninput: (event: Event) => void; onpaste: (event: ClipboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; onblur: () => void; }; chip_attrs(index: number): { tabindex: number; "data-active": string | undefined; "data-editing": string | undefined; onfocus: () => void; ondblclick: () => void; onkeydown: (event: KeyboardEvent) => void; }; }

Headless chip/tag/recipient token input: splits on delimiters & paste, navigates chips with ArrowLeft/ArrowRight/Home/End, Backspace selects/deletes the last chip, supports inline chip editing and registers with Norbius's control bridge.

Parameters

NameTypeDescription
options?TokenInputOptions

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:45

create_toolbar function

function create_toolbar(options: ToolbarOptions): { readonly active: string; focus: (key: string) => void; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "toolbar"; "aria-label": string | undefined; "aria-orientation": "horizontal" | "vertical"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs: (key: string) => { tabindex: number | undefined; "data-roving-active": string | undefined; onfocus: () => void; }; }

Headless WAI-ARIA role="toolbar" single-tab-stop roving container.

Parameters

NameTypeDescription
optionsToolbarOptions
  • items: () => readonly string[]
  • orientation?: RovingOrientation
  • disabled?: (key: string) => boolean
  • label?: string

Source: packages/ui/src/behaviors/controls-extra.svelte.ts:501

create_transfer function

function create_transfer(options: TransferOptions): { readonly lists: Readonly<Record<string, readonly string[]>>; readonly draft: TransferDraft | null; readonly dragging: string | null; move: (key: string, to: string, index: number, commitNow?: boolean) => void; container(id: string): Attachment<HTMLElement>; item(key: string): Attachment<HTMLElement>; item_attrs(key: string): { "data-dragging": string | undefined; onkeydown: (event: KeyboardEvent) => void; }; }

Headless cross-container drag-and-drop + keyboard transfer (Kanban boards, folder lists, team rosters) with live draft preview, edge auto-scrolling and screen-reader announcements.

Parameters

NameTypeDescription
optionsTransferOptions
  • containers: () => readonly string[]

    Ordered container keys (e.g. Kanban lane ids).

  • lists: () => TransferLists

    Current lists per container.

  • on_commit: (next: TransferLists, move: { readonly key: string; readonly from: string; readonly to: string; readonly index: number; }) => void

    Called once on drop or keyboard commit with the next container map.

  • can_drop?: (key: string, toContainer: string) => boolean

    Optional predicate rejecting moves into a container.

  • item_label?: (key: string) => string

    Human-readable item label for screen-reader announcements.

  • container_label?: (container: string) => string

    Human-readable container label for screen-reader announcements.

Source: packages/ui/src/behaviors/drag.svelte.ts:299

create_tree function

function create_tree<T = unknown>(options: TreeOptions<T>): { readonly rows: FlatTreeRow<T>[]; readonly expanded: readonly string[]; readonly selected: readonly string[]; readonly active: string; expand: (id: string) => void; collapse: (id: string) => void; toggle_expand: (id: string) => void; is_expanded(id: string): boolean; is_selected: (key: string) => boolean; item: (key: string) => import("svelte/attachments").Attachment<HTMLElement>; root_attrs(): { role: "tree"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "treeitem"; "aria-level": number; "aria-expanded": boolean | undefined; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; onclick: (event: MouseEvent) => void; }; }

Headless WAI-ARIA tree behavior with ArrowRight expand/descend, ArrowLeft collapse/ascend, typeahead, roving tabindex, focus recovery on collapse, selection and optional agent control registration.

Parameters

NameTypeDescription
optionsTreeOptions<T>
  • nodes: () => readonly TreeNode<T>[]

    Root tree nodes.

  • default_expanded?: readonly string[]

    Initial expanded node ids.

  • expanded?: () => readonly string[]

    Controlled expanded node ids.

  • on_expanded_change?: (ids: readonly string[]) => void

    Called when expanded node ids change.

  • mode?: SelectionMode

    Selection mode (default 'single').

  • selected?: () => readonly string[]

    Controlled selected ids.

  • on_select?: (ids: readonly string[]) => void

    Called when selection changes.

  • control?: { readonly id: string; readonly label?: string; }

    Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/tree.svelte.ts:240

create_tree_reorder function

function create_tree_reorder(options: TreeReorderOptions): { readonly dragging: string | null; readonly drop: TreePlace | null; commit: (id: string, place: TreePlace) => void; item(id: string): Attachment<HTMLElement>; item_attrs(id: string): { "data-dragging": string | undefined; "data-drop-position": "before" | "inside" | "after" | undefined; onkeydown: (event: KeyboardEvent) => void; }; }

Headless hierarchical tree reordering (pointer drop zones: top 25% before, middle 50% inside, bottom 25% after; plus Alt+ArrowUp/Down/Left/Right keyboard reparenting) with subtree cycle guard.

Parameters

NameTypeDescription
optionsTreeReorderOptions
  • rows: () => readonly TreeReorderRow[]

    Visible pre-order tree rows.

  • on_move: (id: string, place: TreePlace) => void

    Invoked when a node (with its subtree) moves to place.

  • can_drop?: (id: string, place: TreePlace) => boolean

    Optional predicate forbidding drops into/around a target.

Source: packages/ui/src/behaviors/drag.svelte.ts:497

create_trigger_menu function

function create_trigger_menu<T extends TriggerMenuItem = TriggerMenuItem>(options: TriggerMenuOptions<T>): { readonly open: boolean; readonly match: TriggerMatch | null; readonly items: readonly T[]; readonly path: readonly T[]; readonly active_index: number; readonly floating: { readonly x: number; readonly y: number; readonly side: import("./floating.svelte.js").FloatingSide; readonly anchor_width: number; readonly available_width: number; readonly available_height: number; readonly positioned: boolean; readonly style: string; set_anchor(next: import("./floating.svelte.js").FloatingAnchor | null): void; update: () => void; anchor: Attachment<HTMLElement>; content: Attachment<HTMLElement>; }; close: () => void; select: (item: T) => void; pop_level(): void; field: Attachment<HTMLInputElement | HTMLTextAreaElement>; content: Attachment<HTMLElement>; input_attrs(): { "aria-expanded": boolean; "aria-haspopup": "listbox"; "aria-activedescendant": string | undefined; oninput: (event: Event) => void; onkeyup: (event: KeyboardEvent) => void; onkeydown: (event: KeyboardEvent) => void; }; option_attrs(item: T, index: number): { id: string; role: "option"; "aria-selected": boolean; "aria-disabled": true | undefined; "data-highlighted": string | undefined; onpointerenter: () => void; onmousedown: (event: MouseEvent) => void; onclick: () => void; }; }

Inline @mention / / slash-command trigger menu for <input> and <textarea>: tracks caret trigger matches, fuzzy-filters items, supports nested sub-menus (children), keyboard navigation (ArrowUp/ArrowDown/Enter/Tab/Escape), floating anchor positioning and Norbius control registration.

Parameters

NameTypeDescription
optionsTriggerMenuOptions<T>
  • triggers: readonly string[]

    Trigger prefixes that open the menu (e.g. ['@', '/']).

  • items: (trigger: string, query: string, path: readonly T[]) => readonly T[]

    Returns items for the active trigger & nested level stack.

  • on_select: (item: T, match: TriggerMatch, insertText: string) => void

    Called when a leaf item is picked (receives item and replacement range).

  • control?: { readonly id: string; readonly label?: string; }

    Optional semantic control registration for Norbius's page bridge.

Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:397

create_typeahead function

function create_typeahead(options: TypeaheadOptions): { onkeydown: (event: KeyboardEvent) => void; reset: () => void; readonly query: string; }

Headless incremental typeahead behavior. Pass onkeydown to any listbox, menu, rail or tab strip (composes directly alongside create_roving_focus).

Parameters

NameTypeDescription
optionsTypeaheadOptions
  • items: () => readonly TypeaheadItem[]

    Candidate items in visual order.

  • active?: () => string | undefined

    Currently active key (search wraps starting after this item).

  • on_match: (key: string) => void

    Invoked with the matched item's key.

  • timeout_ms?: number

    Buffer reset delay in ms (default 500).

Source: packages/ui/src/behaviors/typeahead.svelte.ts:28

create_ui_history function

function create_ui_history(options?: UiHistoryOptions): { readonly entries: readonly UiHistoryEntry[]; readonly position: number; readonly can_undo: boolean; readonly can_redo: boolean; undo: () => boolean; redo: () => boolean; undo_source: (source: ChangeSource) => number; destroy: () => void; }

Records live control changes via observe_controls and supports stepping backward/forward or reverting every non-redacted change made by one source (e.g. history.undo_source('agent')).

Parameters

NameTypeDescription
options?UiHistoryOptions

Source: packages/ui/src/behaviors/controls.svelte.ts:436

create_undo_stack function

function create_undo_stack<T>(initial: T, options?: UndoStackOptions): { readonly current: T; readonly can_undo: boolean; readonly can_redo: boolean; readonly length: number; record: (next: T, opts?: { readonly group?: string; readonly time?: number; }) => void; undo: () => T; redo: () => T; reset: (value: T) => void; }

Grouped undo/redo stack for any immutable state value. Consecutive edits with the same group arriving within group_delay_ms coalesce into one undo entry.

Parameters

NameTypeDescription
initialT
options?UndoStackOptions

Source: packages/ui/src/behaviors/micro.svelte.ts:115

create_velocity_tracker function

function create_velocity_tracker(): { add(position: number, time?: number): void; velocity(): number; reset(): void; }

Exponentially weighted pointer velocity tracker (pixels per millisecond).

Source: packages/ui/src/behaviors/motion.svelte.ts:18

create_viewport function

function create_viewport(options?: ViewportOptions): { readonly x: number; readonly y: number; readonly zoom: number; readonly panning: boolean; readonly transform: string; set_camera: (next: Partial<ViewportCamera>) => void; zoom_at: (factor: number, originX: number, originY: number) => void; reset(): void; surface: Attachment<HTMLElement>; }

Headless pan/zoom canvas viewport with pointer panning, wheel-to-zoom around cursor, fit and reset.

Parameters

NameTypeDescription
options?ViewportOptions

Source: packages/ui/src/behaviors/canvas.svelte.ts:533

create_waterfall function

function create_waterfall<T extends WaterfallItem = WaterfallItem>(options: WaterfallOptions<T>): { readonly rows: import("./tree.svelte.js").FlatTreeRow<T>[]; readonly min: number; readonly max: number; readonly view_start: number; readonly view_end: number; readonly tree: { readonly rows: import("./tree.svelte.js").FlatTreeRow<T>[]; readonly expanded: readonly string[]; readonly selected: readonly string[]; readonly active: string; expand: (id: string) => void; collapse: (id: string) => void; toggle_expand: (id: string) => void; is_expanded(id: string): boolean; is_selected: (key: string) => boolean; item: (key: string) => Attachment<HTMLElement>; root_attrs(): { role: "tree"; onkeydown: (event: KeyboardEvent) => void; }; item_attrs(id: string): { role: "treeitem"; "aria-level": number; "aria-expanded": boolean | undefined; "aria-selected": boolean; "aria-disabled": true | undefined; "data-selected": string | undefined; "data-expanded": string | undefined; tabindex: number | undefined; onfocus: () => void; onclick: (event: MouseEvent) => void; }; }; bar_rect: (item: WaterfallItem) => { readonly left_pct: number; readonly width_pct: number; }; zoom(start: number, end: number): void; reset_zoom(): void; }

Hierarchical trace/Gantt waterfall behavior composing create_tree with automatic time-domain bounds, zoomable [view_start, view_end] window and percentage bar placement (bar_rect).

Parameters

NameTypeDescription
optionsWaterfallOptions<T>
  • items: () => readonly T[]
  • on_select?: (id: string) => void
  • label?: string
  • control?: { readonly id: string; readonly label?: string; }

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:1244

current_modality function

function current_modality(): InputModality

Returns the current global input modality ('keyboard' or 'pointer').

Source: packages/ui/src/behaviors/platform.svelte.ts:270

current_source function

function current_source(): ChangeSource

Returns the currently attributed change source ('pointer' | 'keyboard' | 'agent' | 'programmatic').

Source: packages/ui/src/behaviors/controls.svelte.ts:108

describe_controls function

function describe_controls(options?: PageControlsOptions): string

Concise one-line summary of registered controls for Norbius's pageScreen() context.

Parameters

NameTypeDescription
options?PageControlsOptions

Source: packages/ui/src/behaviors/controls.svelte.ts:390

studio

elapsed_text function

function elapsed_text(ms: number): string

A running step's elapsed time as m:ss.

Parameters

NameTypeDescription
msnumber

Source: packages/ui/src/studio/elapsed.ts:2

kinds

enum_text function

function enum_text(value: string, o?: EnumScope): string

An enum or state value as words: its catalog key, else humanized (not_sent → Not sent, PENDING_REVIEW → Pending review). An upper-case word without a vowel or with a digit stays an acronym (SG_CPF → SG CPF), as does an upper-case word inside a lower-case value (sent_to_HR).

Parameters

NameTypeDescription
valuestring
o?EnumScope

Source: packages/ui/src/kinds/kind.ts:147

utilities

files_summary function

function files_summary(bolt: Text, ...values: readonly unknown[]): string

"No files" / "1 file" / "3 files" over every file field given (one file, a list, or nothing).

Parameters

NameTypeDescription
boltText
  • t: (key: string, vars?: { readonly [name: string]: string | number; }) => string
valuesreadonly unknown[]

Source: packages/ui/src/utilities/summary.ts:22

kinds

format function

function format(kind: Kind, value: Value | undefined, o?: ShowOptions): string

One value as text in the viewer's locale; '' for none. Structured values render through Show, this is their summary.

Parameters

NameTypeDescription
kindKind
valueValue | undefined
o?ShowOptions

Source: packages/ui/src/kinds/kind.ts:242

behaviors

format_color function

function format_color(color: RgbaColor, format?: "hex" | "rgb" | "hsl"): string

Formats an RgbaColor as 'hex', 'rgb' or 'hsl'.

Parameters

NameTypeDescription
colorRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number
format?'hex' | 'rgb' | 'hsl'

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:929

primitives

format_file_size function

function format_file_size(bytes: number): string

A byte count as short text in binary units (512.0 B, 12.0 KB, 3.4 MB); 0 B for none.

Parameters

NameTypeDescription
bytesnumber

Source: packages/ui/src/primitives/utils.ts:74

kinds

format_handle function

function format_handle(transport: string | null, handle: string, name?: string | null): string

A message sender or recipient for reading: its display name when there is one; a WhatsApp number (a JID such as 6591234567:14@s.whatsapp.net, the device suffix dropped; Twilio's whatsapp:+6591234567; bare digits on whatsapp) as its phone (+65 9123 4567, +<digits> for an unknown calling code); anything else (email, Telegram, Slack, Discord and WeChat ids, a @lid or group JID) as given.

Parameters

NameTypeDescription
transportstring | null
handlestring
name?string | null

Source: packages/ui/src/kinds/phone.ts:79

chart

format_metric_value function

function format_metric_value(unit: string, value: number | null, locale?: string): string

A reading in its unit, for people.

Parameters

NameTypeDescription
unitstring
valuenumber | null
locale?string

Source: packages/ui/src/chart/UsageChart.svelte:36

behaviors

format_shortcut function

function format_shortcut(spec: string, platform?: "mac" | "other"): string

Formats a shortcut spec for human-readable UI badges (e.g. '⌘K' on macOS, 'Ctrl+K' elsewhere).

Parameters

NameTypeDescription
specstring
platform?'mac' | 'other'

Source: packages/ui/src/behaviors/shortcuts.svelte.ts:122

kinds

format_value function

function format_value(value: Value | undefined, locale?: string): string

One native value as text, shared by views and kind renderers.

Parameters

NameTypeDescription
valueValue | undefined
locale?string

Source: packages/ui/src/kinds/kind.ts:334

behaviors

fuzzy_score function

function fuzzy_score(query: string, text: string): number

Accent- and case-insensitive fuzzy match score for query against text. Returns 0 when query does not match, or a positive relevance score (higher is better).

Parameters

NameTypeDescription
querystring
textstring

Source: packages/ui/src/behaviors/text-match.ts:125

get_portal_target function

function get_portal_target(): PortalTarget

Reads the inherited portal target from context, if configured.

Source: packages/ui/src/behaviors/portal.svelte.ts:29

editors

highlighted_line function

function highlighted_line(code: string): { text: string; class: string; }[]

An expression as highlighted tokens on one line: each line break becomes a space. Plain text until the JavaScript parser has loaded (with the first highlighted line), then highlighted.

Parameters

NameTypeDescription
codestring

Source: packages/ui/src/editors/highlight.svelte.ts:9

behaviors

hsl_to_rgb function

function hsl_to_rgb(color: HslaColor): RgbaColor

Converts HSL (h: 0..360, s: 0..100, l: 0..100) to RGBA (0..255).

Parameters

NameTypeDescription
colorHslaColor
  • h: number
  • s: number
  • l: number
  • a: number

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:828

hsv_to_rgb function

function hsv_to_rgb(color: HsvaColor): RgbaColor

Converts HSV (h: 0..360, s: 0..100, v: 0..100) to RGBA (0..255).

Parameters

NameTypeDescription
colorHsvaColor
  • h: number
  • s: number
  • v: number
  • a: number

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:867

inert_outside function

function inert_outside(keep: HTMLElement | readonly HTMLElement[]): InertHandle

Marks every sibling tree outside keep as inert (ref-counted across nested modals) while keeping live announcer regions active. Call .keep(el) to exempt a portaled overlay opened inside.

Parameters

NameTypeDescription
keepHTMLElement | readonly HTMLElement[]

Source: packages/ui/src/behaviors/modal.svelte.ts:145

input_hints function

function input_hints(kind: InputHintKind, overrides?: { readonly enterkeyhint?: EnterKeyHint; }): InputHints

Returns consistent mobile keyboard, autocomplete and spellcheck attributes for a semantic field kind.

Parameters

NameTypeDescription
kindInputHintKind
overrides?{ readonly enterkeyhint?: EnterKeyHint; }

Source: packages/ui/src/behaviors/micro.svelte.ts:461

invoke_control function

function invoke_control(ref: string, action: string, args?: readonly unknown[], options?: { readonly within?: Element | null; readonly allow_confirm?: boolean; }): ControlInvokeResult

Invokes a named semantic action on a registered control by id or accessible label, attributing the change to 'agent' and enforcing disabled/hidden/confirmation guards.

Parameters

NameTypeDescription
refstring
actionstring
args?readonly unknown[]
options?{ readonly within?: Element | null; readonly allow_confirm?: boolean; }

Source: packages/ui/src/behaviors/controls.svelte.ts:328

is_focus_from_keyboard function

function is_focus_from_keyboard(): boolean

Returns whether the most recent user interaction was keyboard-driven (for focus-visible heuristics).

Source: packages/ui/src/behaviors/platform.svelte.ts:264

kinds

is_json_schema function

function is_json_schema(value: unknown): value is JsonSchema

Whether a stored value is a JSON Schema in the keywords this renderer reads: decode once where a schema enters a page.

Parameters

NameTypeDescription
valueunknown

Source: packages/ui/src/kinds/json-schema.ts:64

behaviors

is_span_free function

function is_span_free(spans: readonly Span[], track: string, start: number, end: number, ignoreId?: string): boolean

Returns whether [start, end) overlaps no existing span on track (excluding ignoreId).

Parameters

NameTypeDescription
spansreadonly Span[]
trackstring
startnumber
endnumber
ignoreId?string

Source: packages/ui/src/behaviors/canvas.svelte.ts:271

utilities

joined_summary function

function joined_summary(bolt: Text, values: readonly unknown[]): string

The set values joined by ·, or "Not set".

Parameters

NameTypeDescription
boltText
  • t: (key: string, vars?: { readonly [name: string]: string | number; }) => string
valuesreadonly unknown[]

Source: packages/ui/src/utilities/summary.ts:9

kinds

json_schema_kind function

function json_schema_kind(schema: JsonSchema): Kind

A conservative rendering plan. Validation remains the caller/server's JSON Schema validator. A datatype is chosen explicitly (format: '<datatype>', or x-norbital.datatype for a custom one) or implicitly by an exact shape (DATATYPE_SHAPES); explicit wins. An exact shape matches required keys, key set and types ({from,to} dates, {start,end} instants, {lat,lng} numbers); a near-miss stays an ordinary object, while an explicit name whose shape mismatches fails bolt check on a seeded schema. A string duration keeps JSON Schema's ISO meaning.

Parameters

NameTypeDescription
schemaJsonSchema

Source: packages/ui/src/kinds/json-schema.ts:207

behaviors

keep_focus function

function keep_focus(): Attachment<HTMLElement>

Attachment ({@attach keep_focus()}) that prevents pointerdown / mousedown on a button or toolbar control from stealing DOM focus away from an active text editor or input.

Source: packages/ui/src/behaviors/platform.svelte.ts:279

text

label function

function label(bolt: Pick<ViewBolt, "t">, model: string, field?: string, declared?: string): string

A model's or field's label: the catalog key, else the field's declared label, else the humanized name; a FK names its target (project_id → Project).

Parameters

NameTypeDescription
boltPick<ViewBolt, 't'>
  • t: (key: string, vars?: { readonly [name: string]: string | number; }) => string
modelstring
field?string
declared?string

Source: packages/ui/src/text/messages.ts:351

behaviors

lock_scroll function

function lock_scroll(doc?: Document | undefined): () => void

Reference-counted document scroll lock. The first holder freezes the scroller without horizontal gutter shift; only the last release restores styles. Safe to call release multiple times.

Parameters

NameTypeDescription
doc?Document | undefined

Source: packages/ui/src/behaviors/modal.svelte.ts:70

match_ranges function

function match_ranges(query: string, text: string): readonly MatchRange[]

Returns sorted, non-overlapping [start, end) highlight spans where query matches text, or an empty array when query is blank or does not match.

Parameters

NameTypeDescription
querystring
textstring

Source: packages/ui/src/behaviors/text-match.ts:133

match_segments function

function match_segments(query: string, text: string): readonly MatchSegment[]

Splits text into alternating plain and matched segments for rendering search highlights without injecting raw HTML.

Parameters

NameTypeDescription
querystring
textstring

Source: packages/ui/src/behaviors/text-match.ts:141

matches_shortcut function

function matches_shortcut(event: KeyboardEvent, spec: string, options?: MatchShortcutOptions): boolean

Returns whether event matches a single-step shortcut string such as 'mod+k' or 'shift+escape'.

Parameters

NameTypeDescription
eventKeyboardEvent
specstring
options?MatchShortcutOptions

Source: packages/ui/src/behaviors/shortcuts.svelte.ts:87

mix_colors function

function mix_colors(a: RgbaColor, b: RgbaColor, t: number): RgbaColor

Linearly mixes two RGBA colors (t = 0 -> a, t = 1 -> b).

Parameters

NameTypeDescription
aRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number
bRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number
tnumber

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:966

move_item function

function move_item<T>(list: readonly T[], from: number, to: number): T[]

Returns a new array with the item at from moved to to.

Parameters

NameTypeDescription
listreadonly T[]
fromnumber
tonumber

Source: packages/ui/src/behaviors/reorder.svelte.ts:29

nearest_in_direction function

function nearest_in_direction(from: SpatialRect, candidates: readonly SpatialRect[], direction: SpatialDirection): number

Returns the index of the nearest candidate rectangle strictly in direction from from, or -1.

Parameters

NameTypeDescription
fromSpatialRect
  • left: number
  • top: number
  • width: number
  • height: number
candidatesreadonly SpatialRect[]
directionSpatialDirection

Source: packages/ui/src/behaviors/micro.svelte.ts:496

nearest_snap_point function

function nearest_snap_point(position: number, velocity: number, points: readonly number[], options?: { readonly projection_ms?: number; }): number

Projects a position using release velocity and returns the nearest snap point.

Parameters

NameTypeDescription
positionnumber
velocitynumber
pointsreadonly number[]
options?{ readonly projection_ms?: number; }

Source: packages/ui/src/behaviors/motion.svelte.ts:45

utilities

notes_summary function

function notes_summary(bolt: Text, value: unknown): string

A text's first 60 characters (an ellipsis past them), or "None".

Parameters

NameTypeDescription
boltText
  • t: (key: string, vars?: { readonly [name: string]: string | number; }) => string
valueunknown

Source: packages/ui/src/utilities/summary.ts:15

behaviors

notify_control_change function

function notify_control_change(change: { readonly id: string; readonly kind?: string; readonly label?: string; readonly key: string; readonly previous: unknown; readonly value: unknown; readonly reason?: string; readonly source?: ChangeSource; readonly committed?: boolean; }): void

Emits a structured UI state change to every matching observe_controls listener.

Parameters

NameTypeDescription
change{ readonly id: string; readonly kind?: string; readonly label?: string; readonly key: string; readonly previous: unknown; readonly value: unknown; readonly reason?: string; readonly source?: ChangeSource; readonly committed?: boolean; }
  • id: string
  • kind?: string
  • label?: string
  • key: string
  • previous: unknown
  • value: unknown
  • reason?: string
  • source?: ChangeSource
  • committed?: boolean

Source: packages/ui/src/behaviors/controls.svelte.ts:207

actions

notify_outcome function

function notify_outcome<O extends OutcomeFeedback>(bolt: Pick<ViewBolt, "t">, o: O, saved?: string): void

Toasts o; saved replaces the generic "Saved" (a delete says "Deleted").

Parameters

NameTypeDescription
boltPick<ViewBolt, 't'>
  • t: (key: string, vars?: { readonly [name: string]: string | number; }) => string
oO
saved?string

Source: packages/ui/src/actions/outcome.ts:1

behaviors

observe_controls function

function observe_controls(listener: (change: ControlChange) => void, options?: { readonly within?: Element | (() => Element | null | undefined); readonly live?: boolean; }): () => void

Subscribes to structured control state changes (settled commits by default; live: true for drag steps).

Parameters

NameTypeDescription
listener(change: ControlChange) => void
options?{ readonly within?: Element | (() => Element | null | undefined); readonly live?: boolean; }

Source: packages/ui/src/behaviors/controls.svelte.ts:250

record

on_page_contexts function

function on_page_contexts(listener: () => void): () => void

Subscribes to a view offering its contexts after a reader asked; the returned function unsubscribes.

Parameters

NameTypeDescription
listener() => void

Source: packages/ui/src/record/navigation.ts:77

open_record function

function open_record(model: string, id: string | "new", contexts?: ReadonlyMap<unknown, unknown>): void

Opens the shell's record sheet: ?record=<model>/<id|new>, the form the shell's bolt.href writes and reads, stacked on any sheet already open. The sheet mounts outside the page, so contexts (the opener's getAllContexts(), taken at its init) carry the page's scope into it: a create opened from a scoped page keeps its presets and narrowed pickers. They live in memory only.

Parameters

NameTypeDescription
modelstring
idstring | 'new'
contexts?ReadonlyMap<unknown, unknown>

Source: packages/ui/src/record/navigation.ts:19

page_contexts function

function page_contexts(model: string): ReadonlyMap<unknown, unknown> | undefined

The page's contexts for model: a view's own model first; else the page's ('*', offered by AppShell).

Parameters

NameTypeDescription
modelstring

Source: packages/ui/src/record/navigation.ts:75

behaviors

page_controls function

function page_controls(options?: PageControlsOptions): ControlSnapshot[]

Returns a deterministic snapshot of registered visible UI controls on the current page.

Parameters

NameTypeDescription
options?PageControlsOptions

Source: packages/ui/src/behaviors/controls.svelte.ts:263

page_range function

function page_range(current: number, total: number, siblings?: number): PaginationEntry[]

Computes a compact 1-based page range with 'ellipsis' gaps.

Parameters

NameTypeDescription
currentnumber
totalnumber
siblings?number

Source: packages/ui/src/behaviors/pagination.svelte.ts:32

parse_color function

function parse_color(input: string): RgbaColor | null

Parses CSS #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(...) or hsl(...) strings into RgbaColor.

Parameters

NameTypeDescription
inputstring

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:887

pointer_kind_of function

function pointer_kind_of(): PointerKindState

Reads current device pointer precision and hover support synchronously.

Source: packages/ui/src/behaviors/platform.svelte.ts:110

portal function

function portal(target?: PortalTarget | PortalOptions): Attachment<HTMLElement>

Svelte attachment that moves the element into the resolved portal container while mounted and restores or removes it cleanly on teardown.

Parameters

NameTypeDescription
target?PortalTarget | PortalOptions

Source: packages/ui/src/behaviors/portal.svelte.ts:55

prepare_announcements function

function prepare_announcements(doc?: Document | undefined): void

Pre-creates polite and assertive live regions so the very first announcement is never dropped.

Parameters

NameTypeDescription
doc?Document | undefined

Source: packages/ui/src/behaviors/announce.svelte.ts:49

runs

progressOf function

function progressOf(run: Pick<RunRow, "progress">): number | null

The native ctx.progress({ ratio, text }) payload's fraction.

Parameters

NameTypeDescription
runPick<RunRow, 'progress'>
  • progress?: Value

Source: packages/ui/src/runs/facts.ts:6

progressText function

function progressText(run: Pick<RunRow, "progress">): string | null

The native run's current stage, without inventing a percentage for work that reports only text.

Parameters

NameTypeDescription
runPick<RunRow, 'progress'>
  • progress?: Value

Source: packages/ui/src/runs/facts.ts:11

record

provide_representations function

function provide_representations(map: { readonly [model: string]: RepresentationLoader; }): { readonly [model: string]: RepresentationLoader; }

The workspace's representations per model (the generated registry), set by the shell above every page.

Parameters

NameTypeDescription
map{ readonly [model: string]: RepresentationLoader; }

Source: packages/ui/src/record/context.ts:12

behaviors

register_control function

function register_control(descriptor: ControlDescriptor): () => void

Registers a live UI control while mounted and returns its cleanup function. Designed for use inside $effect or Svelte attachments ({@attach ...}).

Parameters

NameTypeDescription
descriptorControlDescriptor
  • id: string

    Stable semantic identifier, e.g. 'tabs:settings' or 'combobox:status'.

  • kind: string

    Component kind, e.g. 'tabs', 'combobox', 'dialog', 'input', 'checkbox', 'menu'.

  • label?: string

    Optional human-readable label (falls back to accessible name of element).

  • element?: () => HTMLElement | null | undefined

    Optional root/interactive DOM element for scope filtering and data-agent-* marks.

  • state: () => Record<string, unknown>

    Live snapshot of state (active tab, open state, value, selected count, etc.).

  • items?: () => readonly ControlChoice[]

    Optional choices accepted by selection actions.

  • actions?: Readonly<Record<string, ControlAction>>

    Named semantic actions callable by the host/agent bridge.

  • disabled?: () => boolean

    Whether the control is currently disabled or read-only (hides callable actions).

  • confirm?: string | (() => string | undefined)

    Explicit confirmation prompt describing why a person must approve agent actions.

  • secret?: boolean | (() => boolean)

    Marks values as secret (writable by agent, always redacted in snapshots/observations).

  • hidden?: boolean | (() => boolean)

    Hides this control from agent snapshots and invocation.

Source: packages/ui/src/behaviors/controls.svelte.ts:197

workspaces

release_window function

function release_window(releases: ReadonlyArray<ReleaseVersion>, at: string | null): { readonly since?: string; readonly until?: string; }

The time a release served, named by its publication instant (at): from it until the next publication. null is every release (no bound).

Parameters

NameTypeDescription
releasesReadonlyArray<ReleaseVersion>
atstring | null

Source: packages/ui/src/workspaces/filters.ts:29

behaviors

reset_hover_group function

function reset_hover_group(group?: string): void

Clears warm-group state (handy between tests).

Parameters

NameTypeDescription
group?string

Source: packages/ui/src/behaviors/hover-intent.svelte.ts:87

resolve_control function

function resolve_control(ref: string, options?: { readonly within?: Element | null; }): { readonly entry: ControlDescriptor; readonly snapshot: ControlSnapshot; } | { readonly error: string; }

Resolves a registered control by exact id, exact label (case-insensitive), or unique label substring.

Parameters

NameTypeDescription
refstring
options?{ readonly within?: Element | null; }

Source: packages/ui/src/behaviors/controls.svelte.ts:284

rgb_to_hsl function

function rgb_to_hsl(color: RgbaColor): HslaColor

Converts RGB (0..255) + alpha (0..1) to HSL (h: 0..360, s: 0..100, l: 0..100).

Parameters

NameTypeDescription
colorRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:808

rgb_to_hsv function

function rgb_to_hsv(color: RgbaColor): HsvaColor

Converts RGB (0..255) to HSV (h: 0..360, s: 0..100, v: 0..100).

Parameters

NameTypeDescription
colorRgbaColor
  • r: number
  • g: number
  • b: number
  • a: number

Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:848

rubber_band function

function rubber_band(offset: number, dimension: number, constant?: number): number

Applies iOS-style asymptotic rubber-band resistance beyond [0, limit].

Parameters

NameTypeDescription
offsetnumber
dimensionnumber
constant?number

Source: packages/ui/src/behaviors/motion.svelte.ts:10

set_announcer function

function set_announcer(fn: CustomAnnouncer | undefined): void

Replaces live-region output (useful in headless unit tests); pass undefined to restore.

Parameters

NameTypeDescription
fnCustomAnnouncer | undefined

Source: packages/ui/src/behaviors/announce.svelte.ts:23

set_portal_target function

function set_portal_target(target: PortalTarget | PortalGetter): void

Sets the default portal mount target for every descendant overlay.

Parameters

NameTypeDescription
targetPortalTarget | PortalGetter

Source: packages/ui/src/behaviors/portal.svelte.ts:23

primitives

set_ui_text function

function set_ui_text(text: Partial<Record<UiTextKey, string>>): Partial<Record<"peak" | "close" | "expand" | "collapse" | "resize" | "save" | "saving" | "requestApproval" | "cancel" | "clear" | "create" | "add" | "remove" | "none" | "yes" | "no" | "upload" | "uploading" | "useMyLocation" | "latitude" | "longitude" | "searchAddress" | "pickOnMap" | "mapUnavailable" | "addressSearchUnavailable" | "locationDenied" | "from" | "to" | "openEnded" | "pending_approval" | "conflict" | "unknown" | "running" | "select" | "selectItem" | "searching" | "explore" | "back" | "search" | "noResults" | "optionsUnavailable" | "required" | "invalid" | "noAccess" | "redacted" | "not_found" | "recordUnavailable" | "field" | "kind" | "optional" | "useDefault" | "fields" | "today" | "previous" | "next" | "more" | "selectedCount" | "day" | "week" | "month" | "year" | "openCalendar" | "notifications" | "fullScreen" | "exitFullScreen" | "createdAt" | "updatedAt" | "sync_owned" | "owned_parent" | "no_grant" | "state_locked" | "owned_parent_locked" | "under_approval" | "unsaved" | "discard" | "discardDraft" | "copy" | "copied" | "addFiles" | "addFile" | "upToFiles" | "fileSize" | "fileType" | "uploaded" | "uploadedBy" | "sizeEach" | "fileCount" | "download" | "preview" | "retry" | "uploadFailed" | "bold" | "italic" | "strikethrough" | "heading" | "bulletList" | "numberedList" | "quote" | "codeBlock" | "addImage" | "countryCode" | "invalidPhone" | "currency" | "mobileNumber" | "send_code" | "resendCode" | "verify" | "code" | "codeSent" | "enterCode" | "changeNumber" | "searchMeaning" | "searchPick" | "searchClear" | "searchRun" | "searchRaw" | "searchView" | "searchNone" | "searchFields" | "searchCommands" | "schemaField" | "schemaKey" | "schemaType" | "schemaLabel" | "schemaValues" | "schemaHelp" | "schemaValue" | "moreTabs" | "additionalProperties" | "addProperty" | "propertyName" | "peakCapacity" | "maximum" | "overTime" | "unavailable", string>>

Sets the kit's chrome strings for everything beneath (the shell passes the workspace locale's text once).

Parameters

NameTypeDescription
textPartial<Record<UiTextKey, string>>

Source: packages/ui/src/primitives/utils.ts:109

behaviors

settle_draft function

function settle_draft<T>(current: Readonly<Record<string, T>>, submitted: Readonly<Record<string, T>>, equals?: (a: T, b: T) => boolean): Record<string, T>

Race-safe optimistic draft settler: removes keys whose current draft value still equals the snapshot that just committed, while preserving newer edits typed while the save was in flight.

Parameters

NameTypeDescription
currentReadonly<Record<string, T>>
submittedReadonly<Record<string, T>>
equals?(a: T, b: T) => boolean

Source: packages/ui/src/behaviors/platform.svelte.ts:378

text

singular function

function singular(bolt: Pick<ViewBolt, "t">, model: string): string

One record of a model: the catalog's models.<c>.singular, else its label made singular (Categories → Category).

Parameters

NameTypeDescription
boltPick<ViewBolt, 't'>
  • t: (key: string, vars?: { readonly [name: string]: string | number; }) => string
modelstring

Source: packages/ui/src/text/messages.ts:367

behaviors

spatial_move function

function spatial_move(current: HTMLElement, elements: readonly HTMLElement[], direction: SpatialDirection): HTMLElement | null

Finds the nearest focusable element in direction from current among elements.

Parameters

NameTypeDescription
currentHTMLElement
elementsreadonly HTMLElement[]
directionSpatialDirection

Source: packages/ui/src/behaviors/micro.svelte.ts:529

stack_spans function

function stack_spans<S extends Span>(spans: readonly S[]): readonly (S & { readonly lane: number; readonly lanes: number; })[]

Packs overlapping spans on one track into non-overlapping visual lanes (lane index & lanes total).

Parameters

NameTypeDescription
spansreadonly S[]

Source: packages/ui/src/behaviors/canvas.svelte.ts:286

step_spring function

function step_spring(state: { readonly position: number; readonly velocity: number; }, target: number, config?: { readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly precision?: number; }, dt?: number): SpringState

Advances a 1D damped harmonic spring by dt seconds toward target.

Parameters

NameTypeDescription
state{ readonly position: number; readonly velocity: number; }
  • position: number
  • velocity: number
targetnumber
config?{ readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly precision?: number; }
dt?number

Source: packages/ui/src/behaviors/motion.svelte.ts:76

subtree_end function

function subtree_end(rows: readonly TreeReorderRow[], index: number): number

Returns the exclusive index past the subtree rooted at index in a pre-order flat row array.

Parameters

NameTypeDescription
rowsreadonly TreeReorderRow[]
indexnumber

Source: packages/ui/src/behaviors/drag.svelte.ts:472

supports_hidden_until_found function

function supports_hidden_until_found(): boolean

Whether this browser supports find-in-page revelation via hidden="until-found" and beforematch.

Source: packages/ui/src/behaviors/presence.svelte.ts:212

tabbable_elements function

function tabbable_elements(root: HTMLElement): HTMLElement[]

Returns all visible, enabled tabbable descendants inside root.

Parameters

NameTypeDescription
rootHTMLElement

Source: packages/ui/src/behaviors/focus-trap.svelte.ts:17

text_to_cells function

function text_to_cells(text: string): string[][]

Parses tab-separated clipboard text (TSV) into a 2D matrix of strings.

Parameters

NameTypeDescription
textstring

Source: packages/ui/src/behaviors/grid.svelte.ts:231

toast

toast const

const toast: ((text: string, options?: ToastOptions) => number) & { success: (text: string, options?: ToastOptions) => number; info: (text: string, options?: ToastOptions) => number; warning: (text: string, options?: ToastOptions) => number; error: (text: string, options?: ToastOptions) => number; pause: typeof pause; resume: typeof resume; dismiss: typeof dismiss; }

Shows a toast; toast.success, .info, .warning and .error pick its tone. Returns its id (dismiss).

Members

NameTypeDescription
success(text: string, options?: ToastOptions) => number
info(text: string, options?: ToastOptions) => number
warning(text: string, options?: ToastOptions) => number
error(text: string, options?: ToastOptions) => number
pausetypeof pause
resumetypeof resume
dismisstypeof dismiss

Source: packages/ui/src/toast/toast.svelte.ts:99

behaviors

toggle_tree_checked function

function toggle_tree_checked<T>(nodes: readonly TreeNode<T>[], checked: readonly string[], id: string, strategy?: TreeCheckStrategy): string[]

Toggles id in a hierarchical tree checkbox model and returns the normalized checked id array for strategy.

Parameters

NameTypeDescription
nodesreadonly TreeNode<T>[]
checkedreadonly string[]
idstring
strategy?TreeCheckStrategy

Source: packages/ui/src/behaviors/tree.svelte.ts:168

tree_checked_states function

function tree_checked_states<T>(nodes: readonly TreeNode<T>[], checked: readonly string[], strategy?: TreeCheckStrategy): ReadonlyMap<string, TreeCheckedState>

Computes checked / unchecked / 'indeterminate' state for every node in nodes.

Parameters

NameTypeDescription
nodesreadonly TreeNode<T>[]
checkedreadonly string[]
strategy?TreeCheckStrategy

Source: packages/ui/src/behaviors/tree.svelte.ts:129

tree_from_paths function

function tree_from_paths(paths: readonly string[]): TreeNode<{ readonly dir: boolean; readonly path: string; }>[]

Builds a sorted directory-first TreeNode[] from slash-delimited file paths (e.g. Studio files).

Parameters

NameTypeDescription
pathsreadonly string[]

Source: packages/ui/src/behaviors/tree.svelte.ts:60

primitives

ui_text function

function ui_text(): (key: UiTextKey) => string

Resolve once per component (it reads context); returns t(key).

Source: packages/ui/src/primitives/utils.ts:111

i18n

ui_text_for function

function ui_text_for(locale: string): Partial<Record<UiTextKey, string>>

The kit's chrome in a locale. English uses the built-in defaults.

Parameters

NameTypeDescription
localestring

Source: packages/ui/src/i18n.ts:281

actions

use_act function

function use_act(ctx: UiContext): { readonly pending: boolean; run<A, E extends ActFailure>(effect: Effect.Effect<A, E>, options?: { readonly saved?: string; readonly then?: (success: A) => void; }): void; }

A page's writes in one call each (call it while the component initializes): const save = use_act(ctx), then save.run(ctx.act({ … }), { saved, then }). pending is true while one runs, and a second run waits for it to end (ignored). The commit, the hold or the typed failure is toasted in the shared words (saved replaces "Saved"); then receives the success. A fiber ends with the mounted edge.

Parameters

NameTypeDescription
ctxUiContext
  • ui: { readonly bolt?: ViewBolt | undefined; readonly kinds: KindsHost; }

Source: packages/ui/src/actions/act.svelte.ts:22

behaviors

use_debounce function

function use_debounce<A extends readonly unknown[]>(callback: (...args: A) => void, wait?: number | (() => number)): ((...args: A) => void) & { readonly cancel: () => void; }

Debounced callback wrapper with .cancel() support for input-driven queries.

Parameters

NameTypeDescription
callback(...args: A) => void
wait?number | (() => number)

Source: packages/ui/src/behaviors/reactive.svelte.ts:169

model

use_enum_text function

function use_enum_text(ctx: () => UiContext): (value: string, field?: string) => string

An enum or state value's words beneath a view: models.<c>.fields.<field>.<value> through the page's t when a view client and a model are above, else the value in words (enum_text). Call it at a component's init.

Parameters

NameTypeDescription
ctx() => UiContext

Source: packages/ui/src/model/context.ts:21

form

use_form function

function use_form(): FormState | undefined

The enclosing Form's state, or undefined outside a form.

Source: packages/ui/src/form/form-state.svelte.ts:609

use_record_controller function

function use_record_controller(): RecordControllerScope | undefined

The enclosing native record controller; check historical before refreshing or entering edit mode after an action.

Source: packages/ui/src/form/form-state.svelte.ts:620

kinds

value_object function

function value_object(v: unknown): v is { readonly [k: string]: Value; }

A Value that is a plain object (not a list): the one narrowing of the union's object arm.

Parameters

NameTypeDescription
vunknown

Source: packages/ui/src/kinds/kind.ts:180

primitives

virtual_list function

function virtual_list(o: VirtualOptions): { readonly on: boolean; readonly start: number; readonly end: number; readonly before: number; readonly after: number; slice<T>(items: readonly T[]): readonly T[]; anchor: (el: HTMLElement) => () => void; measure(key: string): Attachment<Element>; reveal(index: number): void; }

Windows a long list to the rows in view (measuring each row's height), so a page renders only what is visible; a short list renders whole.

Parameters

NameTypeDescription
oVirtualOptions
  • count: () => number
  • key: (index: number) => string

    Stable identity of item i (its id): measured heights follow it.

  • estimate: number

    An unmeasured item's height in px.

  • threshold?: number

    Render every item at or below this count (default 60).

  • overscan?: number

    Items rendered beyond each edge of the visible band (default 8).

  • tail?: () => boolean

    Window the last visible rows while a bottom-origin viewport is latched to its tail.

Source: packages/ui/src/primitives/virtual/virtual.svelte.ts:37

behaviors

watch const

const watch: typeof watch

Reactively watches one or more getter sources and invokes callback(current, previous) without tracking reads inside callback. Supports { lazy: true } and watch.pre(...).

Members

NameTypeDescription
pre{ <T>(source: Getter<T>, callback: WatchCallback<T>, options?: WatchOptions): void; <const S extends readonly Getter<unknown>[]>(source: S, callback: WatchCallback<GetterValues<S>>, options?: WatchOptions): void; }

Source: packages/ui/src/behaviors/reactive.svelte.ts:70

watch_pre function

function watch_pre<T>(source: Getter<T>, callback: WatchCallback<T>, options?: WatchOptions): void
function watch_pre<const S extends readonly Getter<unknown>[]>(source: S, callback: WatchCallback<GetterValues<S>>, options?: WatchOptions): void

Pre-DOM variant of watch backed by $effect.pre.

Parameters

NameTypeDescription
sourceGetter<T>
callbackWatchCallback<T>
options?WatchOptions

Source: packages/ui/src/behaviors/reactive.svelte.ts:89

with_source function

function with_source<T>(source: ChangeSource, fn: () => T): T

Runs fn with source attributed to any UI control changes emitted synchronously inside it.

Parameters

NameTypeDescription
sourceChangeSource
fn() => T

Source: packages/ui/src/behaviors/controls.svelte.ts:97