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
| Name | Type | Description |
|---|---|---|
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"; } |
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
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | Item keys in visual order. |
mode? | AccordionMode | Single or multiple expanded sections (default |
collapsible? | boolean | In single mode, allow collapsing the only open item (default |
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 |
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
| Name | Type | Description |
|---|---|---|
priority? | AnnouncePriority | Announcement urgency (default |
doc? | Document | Target document (defaults to global |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context the tooltip's words come from.
|
row | unknown | The row or card as read, its |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
requests | readonly 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
| Name | Type | Description |
|---|---|---|
id | string | |
model | string | |
record | string | |
action | string | |
label | string | null | The record's label as its request or resubmission left it (a record its rollback removed keeps a name), or null. |
at | string | |
status | string | Pending, ChangesRequested, Approved, Rejected, Superseded or Withdrawn. |
step | number | The current step (from 0). |
steps | readonly ApprovalStep[] | |
superseded_by | readonly string[] | |
team_names | Readonly<Record<string, string>> | Current names of the steps' team and user ids; the captured ids and native eligibility remain authoritative. |
user_names | Readonly<Record<string, string>> | |
requestor | ApprovalWho | |
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'; }[] | unde… | Every move, oldest first, each on the step it was taken at, with what a rollback did. |
records | readonly { model: string; id: string; op: 'create' | 'update' | 'delete'; }[] | The records the provisional change holds: committed already, rolled back on rejection or withdrawal. |
moves | readonly { decision: ApprovalDecision; reason: 'required' | 'optional'; }[] | The decisions this viewer may take now, straight from the host's transition table. |
mine | boolean | |
participant | boolean | |
stalled | boolean | 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
| Name | Type | Description |
|---|---|---|
value | AreaValue | |
percent_x | number | |
percent_y | number | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number |
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
| Name | Type | Description |
|---|---|---|
query | string | |
items | readonly T[] | |
status | AsyncOptionsStatus | |
loading | boolean | |
error | unknown | |
has_more | boolean | |
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
| Name | Type | Description |
|---|---|---|
signal | AbortSignal | Aborted automatically when a newer query or reset supersedes this request. |
page | number | Zero-based page index ( |
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
| Name | Type | Description |
|---|---|---|
load | (query: string, ctx: AsyncOptionsContext) => Promise<AsyncOptionsPage<T>> | Fetches matching items for |
initial_query? | string | Initial query (default |
debounce_ms? | number | Typing debounce window in ms (default |
immediate? | boolean | Fetch immediately for |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
edge? | number | Edge proximity threshold in px where scrolling begins (default |
speed? | number | Maximum scroll speed in px/frame at the edge (default |
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
| Name | Type | Description |
|---|---|---|
input | Fields | |
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
variant? | BadgeVariant | The colour: |
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
| Name | Type | Description |
|---|---|---|
threshold? | number | Movement in CSS px before |
on_start? | (event: PointerEvent) => boolean | void | Return |
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 |
stop_propagation? | boolean | Stop |
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
| Name | Type | Description |
|---|---|---|
delay? | number | Hold duration in ms before |
tolerance? | number | Max pointer drift in px before canceling (default |
keys? | readonly string[] | Keys that start a keyboard hold (default |
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 |
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
| Name | Type | Description |
|---|---|---|
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 |
interval? | number | Interval between repeated steps in ms (default |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | C | The model whose records are the cards, read in the viewer's output ( |
by | F | The lane field: a |
card | readonly [] | 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 |
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 ( |
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 (
|
key? | string | The URL parameter prefix; defaults to |
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
| Name | Type | Description |
|---|---|---|
search? | string | The board's search text. |
of | C | The model whose records are the cards, read in the viewer's output ( |
where | Json | undefined | The lane's condition: the board's filter and this lane's value. |
card | readonly [] | 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_by | Json | 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. |
ctx | UiContext | The page context (
|
lane | string | The lane's label, naming its cards to assistive technology. |
page_size | number | 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context ( |
of | C | The model whose records are the cards, read in the viewer's output ( |
by | F | The lane field: a |
card | readonly [] | 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 |
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 ( |
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 ( |
key? | string | The URL parameter prefix; defaults to |
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
variant? | ButtonVariant |
|
size? | ButtonSize |
|
readonly? | boolean | Inert like |
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 |
readonly_message? | string | The tooltip while |
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
variant? | ButtonVariant |
|
size? | ButtonSize |
|
readonly? | boolean | Inert like |
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 |
readonly_message? | string | The tooltip while |
Source: packages/ui/src/primitives/button/button.svelte:45
behaviors
CalendarBehavior type
type CalendarBehavior = ReturnType<typeof create_calendar>; Return value of create_calendar.
Members
| Name | Type | Description |
|---|---|---|
placeholder | CalendarDate | |
months | readonly CalendarMonth[] | |
weekdays | readonly string[] | |
set_placeholder | (next: DateValue) => void | |
prev_month | () => void | |
next_month | () => void | |
reset_pending | () => void | |
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;… |
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
| Name | Type | Description |
|---|---|---|
id | string | number | The caller's key, handed back in callbacks. |
start | Date | |
end | Date | An event starting and ending on one day is a timed box; otherwise it is a bar. |
title | string | |
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 |
|
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
| Name | Type | Description |
|---|---|---|
value | CalendarDate | First day of this month. |
weeks | readonly (readonly CalendarDate[])[] | Rows of 7 |
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
| Name | Type | Description |
|---|---|---|
mode? | CalendarMode | (() => CalendarMode) | Single-day or date-range selection mode (default |
value? | () => DateValue | undefined | Selected single date when |
range? | () => CalendarRange | Selected range when |
on_select? | (date: DateValue) => void | Called on single-day selection. |
on_range_change? | (range: CalendarRange) => void | Called when range selection updates (with |
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 |
locale? | () => string | undefined | BCP-47 locale for weekday order and names (default |
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
| Name | Type | Description |
|---|---|---|
start | DateValue | undefined | First selected date, if any. |
end | DateValue | 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
| Name | Type | Description |
|---|---|---|
index | number | |
count | number | |
can_prev | boolean | |
can_next | boolean | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
top | number | |
left | number | |
bottom | number | |
right | number |
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
| Name | Type | Description |
|---|---|---|
text? | string | The value as plain text, for the popover when |
children | Snippet | 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' |
|
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
| Name | Type | Description |
|---|---|---|
anchor | GridCell | |
end | GridCell |
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
| Name | Type | Description |
|---|---|---|
range | CellRange | null | |
bounds | CellBounds | null | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context.
|
value | import('@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 (
|
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 |
|
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | ModelKey | ViewSource | The data: a model (one aggregate bucketed by |
where? | Json | A model's scope: only its rows are measured. |
x | string | The category field: one bar, point or slice per value. |
y | string | 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 |
interpolation? | 'linear' | 'step' | Hold each value until the next x position. Applies to line charts. |
orientation? | 'horizontal' | 'vertical' | Bar charts only: |
stack? | boolean | Bar and area charts: stack the |
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
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 |
required? | boolean | Whether the checkbox is required. |
on_checked_change? | (checked: boolean) => void | Called with the next |
on_indeterminate_change? | (indeterminate: boolean) => void | Called with the next |
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
| Name | Type | Description |
|---|---|---|
checked | readonly string[] | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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 |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | string | The parent model. |
relation | string | 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' |
|
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
| Name | Type | Description |
|---|---|---|
copied | boolean | |
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
| Name | Type | Description |
|---|---|---|
text | string | (() => string) | Text to copy (reactive getter or static string). |
timeout_ms? | number | How long |
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
| Name | Type | Description |
|---|---|---|
path | string | The file's path, shown in the header. |
before | string | The text before the change. |
after | string | The text after the change. |
language? | CodeEditorLanguage | Syntax highlighting (default |
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
| Name | Type | Description |
|---|---|---|
value | string | The text; an outside change replaces the document without echoing through |
on_change? | ((next: string) => void) | undefined | Called with the whole text on every edit. |
language? | CodeEditorLanguage | Syntax highlighting (default |
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 |
size? | LayoutSize |
|
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 |
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
| Name | Type | Description |
|---|---|---|
value | string | |
rgba | RgbaColor | |
hsv | HsvaColor | |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
field | string | The column's field. |
label | string | The column's heading. |
pinned | boolean | The column is pinned to the left. |
first | boolean | The first column: it cannot move left. |
last | boolean | The last column: it cannot move right. |
only | boolean | The only column shown: it cannot be hidden. |
resized | boolean | The viewer set its width. |
hidden | readonly { 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 ( |
on_reset_width | () => void | Drop the viewer's width for the column. |
on_show | (field: string) => void | Show the hidden column |
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
| Name | Type | Description |
|---|---|---|
options | readonly ComboboxOption<V>[] | The choices, in order; with |
clearable? | boolean | Offer a "none" row that clears the value. |
placeholder? | string | The trigger's text with nothing chosen, and its accessible name without |
display? | string | The trigger's text when |
searchable? | boolean | Show the search box; defaults to true. Pass |
on_search? | ((query: string) => void) | undefined | Each keystroke's query (and |
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' |
|
id? | string | The trigger's id, for a |
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 |
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 |
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 |
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 |
|
value | M extends true ? readonly V[] : V | null | The chosen value ( |
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
| Name | Type | Description |
|---|---|---|
value | V | |
label | string | |
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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
description? | string | |
icon? | string | |
group? | string | |
disabled? | boolean | A visible scope hint or unavailable capability; cannot be picked. |
insert? | string | The text that replaces |
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
| Name | Type | Description |
|---|---|---|
draft | ConnectDraft | null | |
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; } |
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
| Name | Type | Description |
|---|---|---|
from | string | |
x | number | |
y | number | |
over | string | 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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
id | string | |
kind | string | |
label? | string | |
key | string | |
previous | unknown | |
value | unknown | |
source | ChangeSource | |
reason | string | |
redacted? | boolean | |
committed | boolean |
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
| Name | Type | Description |
|---|---|---|
value | string | |
label | string |
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
| Name | Type | Description |
|---|---|---|
id | string | Stable semantic identifier, e.g. |
kind | string | Component kind, e.g. |
label? | string | Optional human-readable label (falls back to accessible name of |
element? | () => HTMLElement | null | undefined | Optional root/interactive DOM element for scope filtering and |
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
| Name | Type | Description |
|---|---|---|
ok | boolean | |
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
| Name | Type | Description |
|---|---|---|
id | string | |
kind | string | |
label? | string | |
state | Record<string, unknown> | |
actions | readonly 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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
width | number | |
height | number |
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
| Name | Type | Description |
|---|---|---|
shape | Kind | |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | readonly R[] | The rows the custom view draws; the toolbar narrows and orders them. |
fields | readonly CustomField<R>[] | The fields the toolbar searches, filters and sorts on; a bare name is labelled by humanizing it. |
key | string | The URL prefix of the viewer's filter and sort. |
toolbar? | Exclude<Toolbar<R>, false> | Title, description,
|
children | Snippet<[readonly R[]]> | The custom view, over the rows the search, filter and sort leave. |
empty? | Snippet | false | No rows: the kit's |
model? | string | The model the view draws (a roster grid of |
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
| Name | Type | Description |
|---|---|---|
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-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
| Name | Type | Description |
|---|---|---|
value | () => DateValue | undefined | Controlled |
on_change | (next: DateValue | undefined) => void | Called when the complete date/time value changes (or clears to |
granularity? | () => 'day' | 'hour' | 'minute' | Editing precision: |
locale? | () => string | undefined | BCP-47 locale for segment order and separators (default |
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
| Name | Type | Description |
|---|---|---|
part | SegmentPart | Segment type ( |
value | string | Displayed text (zero-padded value, placeholder token or separator). |
placeholder | boolean | 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
| Name | Type | Description |
|---|---|---|
#private | any | |
current | T | 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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
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
| Name | Type | Description |
|---|---|---|
text | string | 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
| Name | Type | Description |
|---|---|---|
open | boolean | |
disabled | boolean | |
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 ( |
content_attrs | () => { id: string; hidden: boolean; "data-state": "open" | "closed"; } | Spread onto the collapsible content element ( |
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
| Name | Type | Description |
|---|---|---|
open? | () => boolean | Controlled open state; omit for internal state. |
default_open? | boolean | Initial open state when uncontrolled (default |
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 |
Source: packages/ui/src/behaviors/disclosure.svelte.ts:7
DismissLayer type
type DismissLayer = ReturnType<typeof create_dismiss>; Return value of create_dismiss.
Members
| Name | Type | Description |
|---|---|---|
depth | number | |
topmost | boolean | |
surface | Attachment<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
| Name | Type | Description |
|---|---|---|
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 |
outside? | boolean | (() => boolean) | Close on pointerdown outside the attached surface (default |
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
| Name | Type | Description |
|---|---|---|
point | () => { readonly x: number; readonly y: number; } | null | Reactive active drag coordinates ( |
offset? | { readonly x: number; readonly y: number; } | Offset in px relative to pointer (default |
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
| Name | Type | Description |
|---|---|---|
title? | string | The heading and accessible name; a record view inside that claims the header names the dialog when this is absent. |
children | Snippet | 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: |
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 |
actions? | Snippet | Header content beside the close button (record actions). |
path | string | 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
| Name | Type | Description |
|---|---|---|
open | boolean | |
dragging | boolean | |
offset | number | |
snap_index | number | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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 |
snap_points? | readonly number[] | Fractional snap points in |
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 |
modal? | boolean | Trap focus and mark background inert while open (default |
label? | string | Accessible label for the drawer surface. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
kind | Kind | The field's kind; it picks the input. |
json_schema? | JsonSchema | JSON Schema for a generated structured editor; omitted infers the stored structure.
|
raw_json? | boolean | Edit an untyped value as source JSON, retaining invalid text until it parses. |
value | Value | The current value; |
on_change | (next: Value) => void | Called with the next value on every edit; the parent owns the state. |
name | string | The field's name (file uploads, custom renderers) and the dotted path errors are keyed by. |
id? | string | The id on the input, 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 ( |
disabled? | boolean | The editor stays, muted and inert; an enclosing disabled |
errors? | ReadonlyMap<string, string> | Problems by dotted path under |
row? | { readonly [f: string]: Value; } | The row being edited: a money field's currency sibling. |
address? | string | A |
on_address? | ((address: string | null) => void) | undefined | Called with the address a |
relation? | { targets: readonly string[]; where?: Where | undefined; } | One-relation target(s), when
|
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
| Name | Type | Description |
|---|---|---|
title | string | 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 |
tone? | 'muted' | 'danger' |
|
variant? | 'page' | 'inset' | 'card' |
|
size? | LayoutSize |
|
children? | Snippet | The way forward: actions centred below the hint. |
read? | string | The |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
events | readonly CalendarEvent[] | The events shown; after a create or move, pass the updated list back. |
view? | CalendarView | The initial view. Default |
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 |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
name | string | The field's exposed name in the enclosing |
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 |
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 |
wide? | boolean | Spans its grid's whole row. Default: a structured, long or custom-datatype field does. |
readonly? | boolean |
|
disabled? | boolean | Overrides the enclosing |
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
| Name | Type | Description |
|---|---|---|
id | string | |
invalid | boolean | |
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"; } |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
id | string | The control's element id, which the label names. |
label | string | 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 |
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. |
children | Snippet | 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
| Name | Type | Description |
|---|---|---|
value | Value | |
kind | Kind | |
name | string | |
disabled | boolean | |
error? | string | |
on_change | (next: Value) => void | |
id | string | The id the field's label points at: give it to the control the snippet renders, so it is named by the label. |
form | FormState | 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
| Name | Type | Description |
|---|---|---|
value | Value | |
kind | Kind | |
name | string | |
id | string | 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
| Name | Type | Description |
|---|---|---|
dragging | boolean | |
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; } |
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
| Name | Type | Description |
|---|---|---|
accept? | readonly string[] | Accepted MIME types or extensions (e.g. |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
kind | KindOf<'file'> | The
|
value | Value | The uploaded file ref, or a list of refs when |
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. |
name | string | The field name the upload is checked against. |
id? | string | The id on the trigger, 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
model | string | The model the filter reads. |
value? | FilterValue | The saved filter; a filter the editor cannot represent is shown as JSON with a Replace button.
|
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.
|
on_change? | ((value: FilterValue) => void) | undefined | Each edit: the whole new filter ( |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
presets | readonly 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
| Name | Type | Description |
|---|---|---|
open | () => boolean | Whether the panel is currently open/visible. |
findable? | () => boolean | Whether closed content remains findable via browser Ctrl/Cmd+F (default |
on_reveal | (event: Event) => void | Called when browser find-in-page matches text inside the closed panel ( |
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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
depth | number | |
parent | string | null | |
expandable | boolean | |
expanded | boolean | |
disabled | boolean | |
node | TreeNode<T> |
Source: packages/ui/src/behaviors/tree.svelte.ts:19
Floating type
type Floating = ReturnType<typeof create_floating>; Return value of create_floating.
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
side | FloatingSide | |
anchor_width | number | |
available_width | number | |
available_height | number | |
positioned | boolean | |
style | string | |
set_anchor | (next: FloatingAnchor | null) => void | Sets a programmatic element or virtual |
update | () => void | |
anchor | Attachment<HTMLElement> | |
content | Attachment<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
| Name | Type | Description |
|---|---|---|
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 |
align? | FloatingAlign | (() => FloatingAlign) | Cross-axis alignment relative to the anchor (default |
side_offset? | number | (() => number) | Gap between anchor and floating surface in px (default |
align_offset? | number | (() => number) | Shift along the cross axis in px (default |
padding? | number | (() => number) | Viewport edge padding in px (default |
flip? | boolean | (() => boolean) | Flip to the opposite side when viewport room is insufficient (default |
escape? | boolean | (() => boolean) | Close on Escape key (default |
outside? | boolean | (() => boolean) | Close on outside pointer press (default |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
container | Attachment<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
| Name | Type | Description |
|---|---|---|
active | () => boolean | Whether focus trapping is active. |
auto_focus? | boolean | (() => boolean) | Automatically move focus into the container when activated (default |
restore_focus? | boolean | (() => boolean) | Restore focus to the previously active element on close (default |
trap? | boolean | (() => boolean) | Keep Tab / focusin strictly contained inside the container (default |
modal? | boolean | (() => boolean) | Mark background siblings |
prevent_scroll? | boolean | (() => boolean) | Apply ref-counted document scroll lock while active (default |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | S | What it edits: a model handle, or |
mode? | 'view' | 'edit' | 'create' | 'update' |
|
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 |
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 |
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 |
disabled? | boolean | Every field stays an editor, muted and inert, and the submit is disabled; a |
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 |
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 |
editors? | { readonly [field: string]: Snippet<[FieldEditor]>; } | The generated fields' own editors by field name, in place of their kinds' ( |
viewers? | { readonly [field: string]: Snippet<[FieldView]>; } | The generated fields' own readonly views by field name, in place of their kinds' ( |
actions? | Snippet<[FormState]> | Extra buttons beside submit. |
acts? | () => Readonly<Record<string, readonly Value[]>> | Other writes the view's own editors leave ( |
size? | LayoutSize |
|
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context ( |
of | S | What it edits: a model handle, or |
mode? | 'view' | 'edit' | 'create' | 'update' |
|
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 |
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 |
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 |
disabled? | boolean | Every field stays an editor, muted and inert, and the submit is disabled; a |
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 |
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 |
editors? | { readonly [field: string]: Snippet<[FieldEditor]>; } | The generated fields' own editors by field name, in place of their kinds' ( |
viewers? | { readonly [field: string]: Snippet<[FieldView]>; } | The generated fields' own readonly views by field name, in place of their kinds' ( |
actions? | Snippet<[FormState]> | Extra buttons beside submit. |
acts? | () => Readonly<Record<string, readonly Value[]>> | Other writes the view's own editors leave ( |
size? | LayoutSize |
|
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
| Name | Type | Description |
|---|---|---|
#private | any | |
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 | |
run | RunHandle | null | The native automation start, whose run status is followed independently of queue admission. |
pending | boolean | |
capabilities | RecordCapabilities | null | undefined | |
children | Record<string, readonly ChildOperation[]> | |
child_forms | Map<string, FormState> | Native child controllers survive a custom body or historical snapshot unmounting. |
restored | boolean | 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 ( |
dirty | boolean | |
row | Row | |
semantic_errors | readonly SemanticIssue[] | Every registered rule's current issues; kept apart from |
field_errors | ReadonlyMap<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_submit | boolean | |
can_save | boolean | 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. |
resubmitting | boolean | The row's request asks for changes and this draft is its requester's: saving resubmits it (Save reads "Resubmit"). |
requesting_approval | boolean | |
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 |
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: |
revision | number | 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 |
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
| Name | Type | Description |
|---|---|---|
row | number | |
col | number |
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
| Name | Type | Description |
|---|---|---|
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; } |
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
| Name | Type | Description |
|---|---|---|
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 |
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
| Name | Type | Description |
|---|---|---|
open | boolean | |
present | boolean | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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 |
close_delay? | number | (() => number) | Close delay in ms after leaving the safe corridor (default |
group? | string | null | Shared warm-group key (default |
warm_ms? | number | Warm window in ms during which sibling hovers open immediately (default |
hoverable? | boolean | (() => boolean) | Allow pointer to travel into popup content without closing (default |
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
| Name | Type | Description |
|---|---|---|
h | number | |
s | number | |
l | number | |
a | number |
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
| Name | Type | Description |
|---|---|---|
h | number | |
s | number | |
v | number | |
a | number |
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
| Name | Type | Description |
|---|---|---|
name | string | An Iconify name ( |
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
| Name | Type | Description |
|---|---|---|
alt | string | Required alternative text; |
image_class? | HTMLImgAttributes['class'] | Classes on the |
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
| Name | Type | Description |
|---|---|---|
crop | CropRect | |
zoom | number | |
rotation | number | |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
keep | (el: HTMLElement) => () => void | Exempts an additional element (e.g. a popover portaled into |
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
| Name | Type | Description |
|---|---|---|
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; } |
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
| Name | Type | Description |
|---|---|---|
value | (id: string) => string | Reads the current text for |
commit | (id: string, text: string, reason: InlineEditReason) => boolean | void | Persists the edited text; return |
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
| Name | Type | Description |
|---|---|---|
files? | FileList | undefined | null | The chosen files of a |
type? | 'file' | The input type; |
on_files? | (files: FileList | null) => void | Called with the chosen files of a |
ref? | U | null | The rendered element; bindable ( |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
index | number | null | |
browsing | boolean | |
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
| Name | Type | Description |
|---|---|---|
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 |
at_edge? | (direction: 'up' | 'down', event: KeyboardEvent) => boolean | Custom edge detector; defaults to first/last line of |
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
| Name | Type | Description |
|---|---|---|
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 |
|
file_url? | ((ref: FileRef, options?: FileUrlOptions) => string) | undefined | |
geocoder? | Geocoder | The host's geocoder; without one, address search uses the keyless |
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: |
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
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
| Name | Type | Description |
|---|---|---|
rect | LassoRect | null | |
active | boolean | |
surface | Attachment<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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
width | number | |
height | number |
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
| Name | Type | Description |
|---|---|---|
id | string | |
query | string | |
items | readonly T[] | |
active | string | |
active_id | string | undefined | |
selected | readonly string[] | |
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; } | Spread onto a search/combobox |
list_attrs | () => { id: string; role: "listbox"; "aria-multiselectable": true | undefined; onkeydown: (event: KeyboardEvent) => void; } | Spread onto the listbox container ( |
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 ( |
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
| Name | Type | Description |
|---|---|---|
value | string | |
label | string | |
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
| Name | Type | Description |
|---|---|---|
items | () => readonly T[] | All items in visual order. |
mode? | SelectionMode | (() => SelectionMode) | Selection mode (default |
focus? | ListboxFocusMode | Focus strategy: |
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 |
typeahead? | boolean | Enable incremental typeahead when not typing in a search input (default |
loop? | boolean | Wrap arrow navigation at list ends (default |
id? | string | Optional stable id prefix for |
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
| Name | Type | Description |
|---|---|---|
key | string | Stable key of the removed item. |
data | T | undefined | Optional caller metadata attached to the item. |
element | HTMLElement | 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | C | The model whose records are placed, read in the viewer's output ( |
at | FieldOf<C> | The |
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 |
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 |
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' |
|
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 (
|
key? | string | The URL parameter prefix; defaults to |
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
| Name | Type | Description |
|---|---|---|
value | string | The Markdown text. |
on_change? | ((next: string) => void) | undefined | Called with the whole text on every keystroke. |
readonly? | boolean | Renders the text only ( |
preview? | boolean | Adds a Write/Preview switch above the box. |
commands? | readonly CommandItem[] | ((query: string) => EffectType.Effect<readonly CommandItem[], ReadError | Error>) | The |
command_start? | 'line' | 'text' | 'word' | Where |
mentions? | ((query: string) => EffectType.Effect<readonly CommandItem[], ReadError | Error>) | undefined | The |
placeholder? | string | Placeholder of the empty box. |
rows? | number | Visible text rows (default 8). |
id? | string | The id on the textarea, 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 ( |
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
| Name | Type | Description |
|---|---|---|
start | number | |
end | number |
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
| Name | Type | Description |
|---|---|---|
text | string | |
matched | boolean |
Source: packages/ui/src/behaviors/text-match.ts:11
Menu type
type Menu<T extends MenuItem = MenuItem> = ReturnType<typeof create_menu<T>>; Return value of create_menu.
Members
| Name | Type | Description |
|---|---|---|
open | boolean | |
active | string | |
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; } |
Source: packages/ui/src/behaviors/menu.svelte.ts:45
MenuItem type
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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
disabled? | boolean | |
role? | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | |
checked? | boolean | |
on_select? | () => void |
Source: packages/ui/src/behaviors/menu.svelte.ts:13
MenuOptions type
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
| Name | Type | Description |
|---|---|---|
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 |
side? | FloatingSide | Preferred side relative to trigger (default |
align? | FloatingAlign | Cross-axis alignment relative to trigger (default |
label? | string | Accessible name for the menu. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
Source: packages/ui/src/behaviors/menu.svelte.ts:23
MenubarBehavior type
type MenubarBehavior = ReturnType<typeof create_menubar>; Return value of create_menubar.
Members
| Name | Type | Description |
|---|---|---|
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; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:406
MenubarOptions type
type MenubarOptions = {
readonly menus: () => readonly string[];
readonly label?: string;
readonly control?: {
readonly id: string;
readonly label?: string;
};
}; Options for create_menubar.
Members
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
label | readonly string[] | The model's |
record_label? | string | CEL over the record; |
label_paths? | readonly string[] | |
search? | readonly string[] | Search fields when the model declares |
semantic? | true | The model declares |
indexes? | { readonly [index: string]: { input: Fields; description: string; }; } | The model's own search indexes ( |
audit? | false |
|
fields | Fields | Model fields the caller may read (hidden ones included; |
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: |
layers? | readonly string[] | The root's declared one-level read layers ( |
many? | readonly string[] | Many-relations (inverses) the model exposes; each child is the model whose relation names it as |
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: |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
value | Value | The amount as a Decimal; |
on_change | (next: Value) => void | Called with a Decimal once the text is a whole number ( |
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 |
readonly? | boolean | Shows the formatted amount as copyable text; defaults to the enclosing |
disabled? | boolean | Muted and inert; defaults to the enclosing |
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
| Name | Type | Description |
|---|---|---|
dragging | boolean | |
handle | Attachment<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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number |
Source: packages/ui/src/behaviors/canvas.svelte.ts:15
NavigationMenuBehavior type
type NavigationMenuBehavior = ReturnType<typeof create_navigation_menu>; Return value of create_navigation_menu.
Members
| Name | Type | Description |
|---|---|---|
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; } |
Source: packages/ui/src/behaviors/widgets-extra.svelte.ts:529
NavigationMenuOptions type
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
fit | number | |
visible | readonly T[] | |
hidden | readonly T[] | |
has_overflow | boolean | |
active_in_hidden | boolean | |
more_open | boolean | |
list | Attachment<HTMLElement> | |
measure | Attachment<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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
id | string | |
payload | Payload | |
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
| Name | Type | Description |
|---|---|---|
within? | Element | null | Only return controls whose |
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
| Name | Type | Description |
|---|---|---|
page | number | |
pages | number | null | |
has_previous | boolean | |
has_next | boolean | |
range | PaginationEntry[] | |
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
| Name | Type | Description |
|---|---|---|
page? | () => number | Current 1-based page number (controlled getter, or omit for internal state). |
default_page? | number | Initial 1-based page when uncontrolled (default |
total_pages | () => number | null | Total page count ( |
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 |
control? | { id: string; label?: string; } | Optional semantic control registration for Norbius's |
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
| Name | Type | Description |
|---|---|---|
sizes | readonly number[] | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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: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
| Name | Type | Description |
|---|---|---|
id | string | |
default_size | number | |
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
| Name | Type | Description |
|---|---|---|
visible | boolean | |
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; } |
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
| Name | Type | Description |
|---|---|---|
default_visible? | boolean | Initial visibility (default |
label? | string | Accessible label for the password input. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration (always marked |
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
| Name | Type | Description |
|---|---|---|
rule | string | |
message | string | |
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
| Name | Type | Description |
|---|---|---|
#private | any | |
current | T | 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
| Name | Type | Description |
|---|---|---|
storage? | 'local' | 'session' | Browser storage backend ( |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
value | Value | The E.164 number; |
on_change | (next: Value) => void | Called on every keystroke; an incomplete number is still written (as |
id? | string | The id on the number box, 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
session | CodeSession | Sends the code and checks it; a Bolt page passes
|
label? | string | The number's label; the kit's "Mobile number" by default. |
id? | string | The phone input's |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | C | The target model's handle. |
value | string | 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 |
label? | readonly FieldOf<C>[] | Fields that label each row; defaults to the target model's |
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 |
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 |
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
| Name | Type | Description |
|---|---|---|
index | number | Zero-based index of this cell. |
char | string | null | Character currently in this cell, or |
is_active | boolean | Whether this cell holds the active caret position. |
has_fake_caret | boolean | 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
| Name | Type | Description |
|---|---|---|
autofocus? | boolean | Focuses the code input on mount (default |
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 |
name? | string | Optional HTML form |
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
| Name | Type | Description |
|---|---|---|
value | string | |
cells | readonly PinCell[] | |
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; } | Spread onto the underlying |
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
| Name | Type | Description |
|---|---|---|
length | number | (() => number) | Number of cells (e.g. |
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 |
pattern? | RegExp | Allowed character filter regex (default digits only |
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 |
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
| Name | Type | Description |
|---|---|---|
lat | number | |
lng | number |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
value | Value | The current point; anything that is not a point counts as empty. |
on_change | (next: Point | null) => void | Called with the chosen point, or |
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 |
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
| Name | Type | Description |
|---|---|---|
precision | PointerPrecision | |
hover | boolean |
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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
start_x | number | |
start_y | number | |
dx | number | |
dy | number | |
event | PointerEvent |
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
| Name | Type | Description |
|---|---|---|
to? | PortalTarget | Mount element or CSS selector for descendant portals (default |
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
| Name | Type | Description |
|---|---|---|
to? | PortalTarget | Mount element, CSS selector, or |
disabled? | boolean | When |
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
| Name | Type | Description |
|---|---|---|
present | boolean | |
state | PresenceState | |
exiting | boolean | |
attach | Attachment<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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
src | string | null | The page's address; |
tests? | StudioTestRun | undefined | The latest test run, shown in a Tests pane beside the preview.
|
title? | string | The frame's accessible title. Default |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
current | T | |
previewing | boolean | |
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
max? | number | Maximum progress value (default |
value? | number | null | Current progress value, or |
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
| Name | Type | Description |
|---|---|---|
value | string | The payload to encode; |
size? | number | The rendered pixel size; the code keeps its own quiet zone. |
alt? | string | The image's alternative text; default |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context.
|
state | ReadState<T> | The read's state. |
what | string | What the view reads, named in its no-access and error states. |
children | Snippet<[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
| Name | Type | Description |
|---|---|---|
effect | Effect.Effect<T, E> | The read, run once per change of it; a failure throws to the nearest boundary. |
pending | Snippet | Shown until the read answers. |
ready | Snippet<[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
| Name | Type | Description |
|---|---|---|
value | string | 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
| Name | Type | Description |
|---|---|---|
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[]>> |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
view | RecordView<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.
|
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). |
children | Snippet<[FormState]> | The form's layout of |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
model | string | |
id | string | |
relation | string | |
revision | number |
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
| Name | Type | Description |
|---|---|---|
name | string | 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. |
fields | readonly 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | C | The record's model. |
id? | FormProps<C>['id'] | The stored row; absent with |
mode? | 'view' | 'edit' | 'create' |
|
values? | Partial<InsertOf<C>> | Create mode: the pre-filled values (a page's scope). |
fields? | FormProps<C>['fields'] | Generated view: create offers these beyond |
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 |
editors? | FormProps<C>['editors'] | Generated view: a field's own editor by name, in place of its kind's ( |
viewers? | FormProps<C>['viewers'] | Generated view: a field's own readonly view by name, in place of its kind's ( |
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 ( |
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.
|
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 |
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
| Name | Type | Description |
|---|---|---|
name | string | The stable key; the record reopens on the tab it was last on. |
title | string | The tab's label. |
body | Snippet | 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
| Name | Type | Description |
|---|---|---|
file | File | |
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
| Name | Type | Description |
|---|---|---|
dragging | string | null | |
over | string | 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
| Name | Type | Description |
|---|---|---|
items | () => readonly string[] | Ordered item keys. |
on_reorder | (from: number, to: number, next: readonly string[]) => void | Invoked with |
orientation? | ReorderOrientation | Axis for movement (default |
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
| Name | Type | Description |
|---|---|---|
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; } | Spread onto the resize handle element ( |
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
| Name | Type | Description |
|---|---|---|
width | number | |
height | number |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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 |
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 |
max? | number | (() => number) | Maximum size in pixels (default |
scale? | number | (() => number) | Optional zoom divisor for scaled canvases/preview frames (default |
step? | number | Keyboard Arrow nudge increment in pixels (default |
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
| Name | Type | Description |
|---|---|---|
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; }[] |
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
| Name | Type | Description |
|---|---|---|
r | number | |
g | number | |
b | number | |
a | number |
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
| Name | Type | Description |
|---|---|---|
value | string | 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 |
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
| Name | Type | Description |
|---|---|---|
active | string | |
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 |
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
| Name | Type | Description |
|---|---|---|
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 |
loop? | boolean | Wrap from last back to first and vice versa (default |
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
| Name | Type | Description |
|---|---|---|
opens | boolean | Whether the card opens a record. |
title? | Snippet | The card's title line. |
fields | readonly { readonly field: string; readonly label: string; }[] | The fields after the title, in order, each with its label. |
value | Snippet<[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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
actions | readonly { 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
rows | readonly Row[] | The child rows as loaded (empty on create). |
columns | readonly 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
automation | string | The automation's name ( |
run | string | { readonly id: string; } | RunRow | The run: its id or |
title? | string | The automation's name; else its catalog label ( |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context.
|
automation | string | The automation's name. |
title? | string | Names the automation (else its catalog label |
where? | Json | Which runs: a |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context. |
automation | string | The automation's name. |
title? | string | Names the automation (else its catalog label |
where? | Json | Which runs: a |
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
| Name | Type | Description |
|---|---|---|
on_select | (index: number) => void | Called when the centered option changes after scrolling settles. |
orientation? | 'vertical' | 'horizontal' | Scroll axis (default |
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
| Name | Type | Description |
|---|---|---|
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 |
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 |
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' |
|
min_height? | string | A |
children | Snippet | 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
| Name | Type | Description |
|---|---|---|
selected | readonly string[] | |
count | number | |
all_selected | boolean | |
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; } | Spread onto each selectable item for |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
count | number | The rows selected. |
all | boolean | 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. |
range | string | 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
| Name | Type | Description |
|---|---|---|
order | () => readonly string[] | Keys in visual order (used for Shift ranges and select-all). |
mode? | SelectionMode | (() => SelectionMode) | Single or multiple selection (default |
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
| Name | Type | Description |
|---|---|---|
open? | boolean | Whether it shows; bindable. |
on_open_change? | (open: boolean) => void | Called with |
side? | 'left' | 'right' | The wide-screen edge it slides from; default |
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). |
children | Snippet | 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: |
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
| Name | Type | Description |
|---|---|---|
keys | string | Shortcut spec such as |
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 |
prevent_default? | boolean | Call |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
kind | Kind | The declared kind that picks the renderer and formatting. |
value | Value | undefined | The value to show; |
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
|
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context ( |
kind | Kind | The declared kind that picks the renderer and formatting. |
value | Value | undefined | The value to show; |
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 |
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
| Name | Type | Description |
|---|---|---|
value | number | |
values | readonly number[] | |
percent | number | |
percents | number[] | |
dragging | boolean | |
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; } |
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
| Name | Type | Description |
|---|---|---|
value? | () => number | Controlled numeric value (single-thumb mode); omit for internal state. |
default_value? | number | Initial value when uncontrolled (default |
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 |
max? | number | (() => number) | Maximum value (default |
step? | number | (() => number) | Step increment (default |
orientation? | 'horizontal' | 'vertical' | Orientation ( |
disabled? | () => boolean | Disabled state. |
label? | string | Accessible label. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
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
| Name | Type | Description |
|---|---|---|
id | string | |
track | string | |
start | number | |
end | number |
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
| Name | Type | Description |
|---|---|---|
spans | readonly S[] | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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: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
| Name | Type | Description |
|---|---|---|
left | number | |
top | number | |
width | number | |
height | number |
Source: packages/ui/src/behaviors/micro.svelte.ts:485
primitives
Spinner component
component Spinner(props: $$ComponentProps) A loading spinner.
Props
| Name | Type | Description |
|---|---|---|
class? | string | Classes on the svg; default size 1rem. |
label? | string | Its accessible name (a |
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
| Name | Type | Description |
|---|---|---|
position | number | |
velocity | number | |
settled | boolean |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
state | string | 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
| Name | Type | Description |
|---|---|---|
stuck | boolean | |
scroll_to_bottom | (behavior?: ScrollBehavior) => void | |
viewport | Attachment<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
| Name | Type | Description |
|---|---|---|
threshold? | number | Pixel distance from the bottom edge still considered latched (default |
initial? | boolean | Start latched to the bottom (default |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
schema? | JsonSchema | A JSON Schema for the value; in
|
kind? | Kind | A native kind for the value; with neither |
value? | Value | The current data. |
before? | Value | The prior data compared against in |
mode? | 'view' | 'edit' | 'schema' | 'diff' |
|
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 |
create? | boolean | A new record: schema defaults fill as the editor opens; an edit offers them by control instead. |
root? | JsonSchema | Internal recursion context.
|
path? | string | Internal: this node's JSON Pointer within |
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 |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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; |
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
| Name | Type | Description |
|---|---|---|
bundle | string | undefined | The bundle's browser URL; absent: this host serves none. |
props | StudioProps | What the shell hands Studio; a change updates the mounted Studio in place.
|
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
| Name | Type | Description |
|---|---|---|
children? | import('svelte').Snippet | Inner surface content. |
tone? | SurfaceTone | Semantic surface fill (default |
padding? | SurfacePadding | Inner padding scale (default |
radius? | SurfaceRadius | Corner geometry token (default |
bordered? | boolean | Hairline semantic border (default |
interactive? | boolean | Subtle hover highlight for clickable/interactive surfaces (default |
as? | 'div' | 'section' | 'article' | 'aside' | 'li' | 'header' | 'footer' | Underlying HTML element (default |
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
| Name | Type | Description |
|---|---|---|
children? | import('svelte').Snippet | Inner surface content. |
tone? | SurfaceTone | Semantic surface fill (default |
padding? | SurfacePadding | Inner padding scale (default |
radius? | SurfaceRadius | Corner geometry token (default |
bordered? | boolean | Hairline semantic border (default |
interactive? | boolean | Subtle hover highlight for clickable/interactive surfaces (default |
as? | 'div' | 'section' | 'article' | 'aside' | 'li' | 'header' | 'footer' | Underlying HTML element (default |
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
| Name | Type | Description |
|---|---|---|
open | SwipeOpen | 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
| Name | Type | Description |
|---|---|---|
tray_width? | number | Width in px of revealed action tray (default |
open_ratio? | number | Fraction of tray width needed to snap open (default |
full_swipe_px? | number | Distance in px triggering immediate full-swipe action (default |
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
| Name | Type | Description |
|---|---|---|
key | string | |
side | SwipeSide |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
items | readonly TabStripItem[] | The items, in order; those that do not fit move to a More menu. |
value | string | undefined | The active item's |
on_value_change? | (value: string) => void | Called with the button item the user selects (links navigate instead). |
label | string | The strip's accessible name. |
level? | TabLevel | The type's level (1 default, 2 underline, 3 chips); omitted, one below the enclosing |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
of | S & TableSource<R & Partial<K>> | The rows: a model name (paged, filtered and sorted by the host, read in the viewer's output: |
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 |
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 (
|
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 |
remove? | boolean | Local arrays with |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
size | number | Rows per page. |
sizes? | readonly number[] | The page sizes offered. |
page | number | The page shown, from 1. |
pages? | number | null | The page count, or |
has_previous | boolean | A page comes before this one. |
has_next | boolean | 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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context ( |
of | S & TableSource<R & Partial<K>> | The rows: a model name (paged, filtered and sorted by the host, read in the viewer's output: |
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 |
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 ( |
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 |
remove? | boolean | Local arrays with |
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
| Name | Type | Description |
|---|---|---|
tabs | readonly TabItem[] | The tabs, in order. |
value? | string | The selected tab's |
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 |
orientation? | 'horizontal' | 'vertical' |
|
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
| Name | Type | Description |
|---|---|---|
run | StudioTestRun | undefined | The run to report; absent reads as not yet run.
|
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
| Name | Type | Description |
|---|---|---|
ref? | U | null | The rendered element; bindable ( |
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
| Name | Type | Description |
|---|---|---|
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-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
| Name | Type | Description |
|---|---|---|
value | () => Time | undefined | Controlled |
on_change | (next: Time | undefined) => void | Called when the time value changes (or clears to |
granularity? | () => 'hour' | 'minute' | Editing precision: |
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
| Name | Type | Description |
|---|---|---|
max? | string | The latest pickable value, in the stored format of |
min? | string | The earliest pickable value, in the stored format of |
precision? | Precision | The unit picked and emitted, snapped to its start (a field's declared |
of? | 'date' | 'instant' | 'time' | 'month' |
|
readonly? | boolean | Shows the value as copyable text; an enclosing readonly form sets it. |
id? | string | The id on the first segment, for |
invalid? | boolean | Marks the control invalid. |
disabled? | boolean | Muted and inert. |
ctx | UiContext | The page context (
|
value | string | null | The stored text, or |
on_change | ((next: string | null) => void) | ((next: readonly (string | null)[]) => void) | Called with the next stored text, or |
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
| Name | Type | Description |
|---|---|---|
precision? | Precision | The unit both ends are picked in (a field's declared |
readonly? | boolean | Shows the value as copyable text; an enclosing readonly form sets it. |
id? | string | The id on the trigger, for |
invalid? | boolean | Marks the control invalid. |
disabled? | boolean | Muted and inert. |
ctx | UiContext | The page context (
|
variant? | 'picker' | 'input' | A range summary trigger; use input for directly editable date/time segments. |
of | 'date' | 'instant' | 'time' |
|
value | Value | 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 |
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
| Name | Type | Description |
|---|---|---|
entries | readonly 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 |
trailing? | Snippet<[T]> | Optional trailing controls on the entry header row, outside its pick/toggle button. |
empty? | Snippet | Shown when |
Source: packages/ui/src/timeline/Timeline.svelte:1
behaviors
TimelineBehavior type
type TimelineBehavior = ReturnType<typeof create_timeline>; Return value of create_timeline.
Members
| Name | Type | Description |
|---|---|---|
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; } |
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
| Name | Type | Description |
|---|---|---|
key | string | 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? | string | Iconify icon name (e.g. |
tone? | TimelineTone | Semantic ring and icon colour for domain entries ( |
status? | 'active' | 'changes' | 'future' | Visual progression for upcoming/active approval steps; absent for past entries. |
title? | string | Primary headline shown above or beside |
line? | readonly string[] | Quiet label parts joined with |
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 |
mark? | { readonly text: string; readonly warn?: boolean; readonly variant?: BadgeVariant; } | A short mark at the line's end ("Current", "In force"); pass |
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 |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
values | readonly string[] | |
input_text | string | |
active_index | number | null | |
editing_index | number | null | |
editing_text | string | |
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; } |
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
| Name | Type | Description |
|---|---|---|
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 |
max? | number | Maximum token count (optional). |
validate? | (token: string) => string | null | undefined | Optional validator returning an error message string when rejected, or |
disabled? | () => boolean | Disabled state. |
label? | string | Accessible label. |
control? | { readonly id: string; readonly label?: string; } | Optional semantic control registration for Norbius's |
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
| Name | Type | Description |
|---|---|---|
icon | string | An Iconify id ( |
name | string | 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 |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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. |
label | string | The trigger's hint and accessible name, and the input's placeholder. |
active? | boolean | Highlights the trigger as searching. Default: |
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
| Name | Type | Description |
|---|---|---|
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 |
side? | FloatingSide | The trigger's side it opens on; default |
side_offset? | number | The gap from the trigger, in px; default 4. |
align? | FloatingAlign | Its alignment along that side: |
avoid_collisions? | boolean | Flip/shift the content to keep it on screen (default |
collision_padding? | number | The viewport gutter kept while avoiding collisions, in px; default 8. |
text? | string | undefined | Simple string body. Prefer |
content_class? | string | Classes on the content surface. |
trigger | Snippet<[{ props: Record<string, unknown>; }]> | The element it describes; spread the given |
content? | Snippet | A rich body, in place of |
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
| Name | Type | Description |
|---|---|---|
lists | Readonly<Record<string, readonly string[]>> | |
draft | TransferDraft | null | |
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; } |
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
| Name | Type | Description |
|---|---|---|
key | string | |
from | string | |
lists | TransferLists |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
rows | FlatTreeRow<T>[] | |
expanded | readonly string[] | |
selected | readonly string[] | |
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; } |
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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
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
| Name | Type | Description |
|---|---|---|
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 |
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 |
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
| Name | Type | Description |
|---|---|---|
target | string | |
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
| Name | Type | Description |
|---|---|---|
dragging | string | null | |
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; } |
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
| Name | Type | Description |
|---|---|---|
rows | () => readonly TreeReorderRow[] | Visible pre-order tree rows. |
on_move | (id: string, place: TreePlace) => void | Invoked when a node (with its subtree) moves to |
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
| Name | Type | Description |
|---|---|---|
id | string | |
depth | number | |
parent | string | 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
| Name | Type | Description |
|---|---|---|
trigger | string | |
query | string | |
start | number | |
end | number |
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
| Name | Type | Description |
|---|---|---|
open | boolean | |
match | TriggerMatch | null | |
items | readonly T[] | |
path | readonly T[] | |
active_index | number | |
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 | |
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; } |
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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
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
| Name | Type | Description |
|---|---|---|
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 |
Source: packages/ui/src/behaviors/inputs-extra.svelte.ts:356
Typeahead type
type Typeahead = ReturnType<typeof create_typeahead>; Return value of create_typeahead.
Members
| Name | Type | Description |
|---|---|---|
onkeydown | (event: KeyboardEvent) => void | |
reset | () => void | |
query | string |
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
| Name | Type | Description |
|---|---|---|
key | string | |
text | string | |
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
| Name | Type | Description |
|---|---|---|
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 |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
entries | readonly UiHistoryEntry[] | |
position | number | |
can_undo | boolean | |
can_redo | boolean | |
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
| Name | Type | Description |
|---|---|---|
id | string | |
kind | string | |
label? | string | |
key | string | |
previous | unknown | |
value | unknown | |
source | ChangeSource | |
reason | string | |
redacted? | boolean | |
committed | boolean | |
seq | number | |
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
| Name | Type | Description |
|---|---|---|
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 |
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
| Name | Type | Description |
|---|---|---|
current | T | |
can_undo | boolean | |
can_redo | boolean | |
length | number | |
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
| Name | Type | Description |
|---|---|---|
limit? | number | Maximum history depth (default |
group_delay_ms? | number | Coalescing window in ms for edits sharing the same |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
title | string | The metric's name above the chart; also its accessible label. |
unit | string | How values read: |
lines | ReadonlyArray<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
| Name | Type | Description |
|---|---|---|
refresh | () => Effect.Effect<void, Error> | Re-reads mounted queries without a polling timer. |
query | (request: { readonly [path: string]: Json; }) => Query<QueryAnswer> | One read request ( |
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 |
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 |
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: |
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 |
|
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 |
|
options? | ((model: string, fields?: readonly { name: string; label: string; kind: "text" | "number" | "bool"; optional?: boolean; }[]) => Effect.Effect<{ fields: readonly Offer[]; }, Error>) | undefined |
|
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… | |
actor | Json | |
locale | string | |
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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
zoom | number | |
panning | boolean | |
transform | string | |
set_camera | (next: Partial<ViewportCamera>) => void | |
zoom_at | (factor: number, originX: number, originY: number) => void | |
reset | () => void | |
surface | Attachment<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
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
zoom | number |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
offset_top | number | |
offset_left | number | |
scale | number | |
keyboard_height | number | Estimated height in px occluded by an on-screen mobile keyboard ( |
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
| Name | Type | Description |
|---|---|---|
left | number | |
top | number | |
right | number | |
bottom | number | |
width | number | |
height | number |
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
| Name | Type | Description |
|---|---|---|
lazy? | boolean | Skip the initial effect run and only invoke on subsequent changes (default |
once? | boolean | Stop reacting after the first invocation (default |
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
| Name | Type | Description |
|---|---|---|
rows | import("./tree.svelte.js").FlatTreeRow<T>[] | |
min | number | |
max | number | |
view_start | number | |
view_end | number | |
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
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
parent? | string | null | |
start | number | |
end | number |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
names | ViewNames |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext | The page context (
|
data | WorkspaceOperationsData | Everything the views show, read by the owner for the current scope.
|
range | WorkspaceRange | The telemetry trend window. |
view | WorkspaceView | The view shown. |
views | readonly 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 |
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 ( |
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
| Name | Type | Description |
|---|---|---|
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; |
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; |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
id | string | |
action | string | |
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
| Name | Type | Description |
|---|---|---|
text | string | |
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
| Name | Type | Description |
|---|---|---|
spec | string | |
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
| Name | Type | Description |
|---|---|---|
handle | AutomationHandle |
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
| Name | Type | Description |
|---|---|---|
message | string |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | BindDragOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | DragPreviewOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | FindableOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | BindHoldOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | BindRepeatOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | ScrollPickerOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
trigger | Rect | |
popup | Rect | |
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
| Name | Type | Description |
|---|---|---|
model | string | |
id | string |
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
| Name | Type | Description |
|---|---|---|
range | CellRange |
|
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
| Name | Type | Description |
|---|---|---|
bounds | CellBounds |
|
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
| Name | Type | Description |
|---|---|---|
root | Element | |
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
| Name | Type | Description |
|---|---|---|
root | Element | |
pattern | AriaPattern |
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
| Name | Type | Description |
|---|---|---|
inputs | ClassValue[] |
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
| Name | Type | Description |
|---|---|---|
storageKey | string |
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
| Name | Type | Description |
|---|---|---|
options | ConfirmOptions |
|
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
| Name | Type | Description |
|---|---|---|
a | RgbaColor |
|
b | RgbaColor |
|
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
| Name | Type | Description |
|---|---|---|
options | AccordionOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | AsyncOptionsOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | CalendarOptions |
|
Source: packages/ui/src/behaviors/date-time.svelte.ts:648
create_carousel function
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
| Name | Type | Description |
|---|---|---|
options | CarouselOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | CellRangeOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | CheckboxGroupOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | ClipboardOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | ConnectOptions |
|
Source: packages/ui/src/behaviors/canvas.svelte.ts:640
create_cookie_storage function
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | DateFieldOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | DismissOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | FileDropzoneOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | FloatingOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | FocusRecoveryOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | FocusTrapOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | GridFocusOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | HoverIntentOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | InlineEditOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | InputHistoryOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | LassoOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | ListboxOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | MenuOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | MenubarOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | MoveOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | NavigationMenuOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | OverflowOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | PaginationOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | PanelGroupOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | PinInputOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | PresenceOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | PreviewOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | RadioGroupOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | ReorderOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | ResizeOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | ResizeBoxOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | RovingFocusOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | SelectionOptions |
|
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
| Name | Type | Description |
|---|---|---|
bindings | readonly 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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | SpansOptions<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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | TimeFieldOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | TimelineOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | ToggleGroupOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | ToolbarOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | TransferOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | TreeOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | TreeReorderOptions |
|
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
| Name | Type | Description |
|---|---|---|
options | TriggerMenuOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
options | TypeaheadOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
initial | T | |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
options | WaterfallOptions<T> |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
ms | number |
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
| Name | Type | Description |
|---|---|---|
value | string | |
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
| Name | Type | Description |
|---|---|---|
bolt | Text |
|
values | readonly 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
| Name | Type | Description |
|---|---|---|
kind | Kind | |
value | Value | 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
| Name | Type | Description |
|---|---|---|
color | RgbaColor |
|
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
| Name | Type | Description |
|---|---|---|
bytes | number |
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
| Name | Type | Description |
|---|---|---|
transport | string | null | |
handle | string | |
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
| Name | Type | Description |
|---|---|---|
unit | string | |
value | number | 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
| Name | Type | Description |
|---|---|---|
spec | string | |
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
| Name | Type | Description |
|---|---|---|
value | Value | 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
| Name | Type | Description |
|---|---|---|
query | string | |
text | string |
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
| Name | Type | Description |
|---|---|---|
code | string |
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
| Name | Type | Description |
|---|---|---|
color | HslaColor |
|
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
| Name | Type | Description |
|---|---|---|
color | HsvaColor |
|
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
| Name | Type | Description |
|---|---|---|
keep | HTMLElement | 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
| Name | Type | Description |
|---|---|---|
kind | InputHintKind | |
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
| Name | Type | Description |
|---|---|---|
ref | string | |
action | string | |
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
| Name | Type | Description |
|---|---|---|
value | unknown |
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
| Name | Type | Description |
|---|---|---|
spans | readonly Span[] | |
track | string | |
start | number | |
end | number | |
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
| Name | Type | Description |
|---|---|---|
bolt | Text |
|
values | readonly 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
| Name | Type | Description |
|---|---|---|
schema | JsonSchema |
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
| Name | Type | Description |
|---|---|---|
bolt | Pick<ViewBolt, 't'> |
|
model | string | |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
query | string | |
text | string |
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
| Name | Type | Description |
|---|---|---|
query | string | |
text | string |
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
| Name | Type | Description |
|---|---|---|
event | KeyboardEvent | |
spec | string | |
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
| Name | Type | Description |
|---|---|---|
a | RgbaColor |
|
b | RgbaColor |
|
t | number |
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
| Name | Type | Description |
|---|---|---|
list | readonly T[] | |
from | number | |
to | number |
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
| Name | Type | Description |
|---|---|---|
from | SpatialRect |
|
candidates | readonly SpatialRect[] | |
direction | SpatialDirection |
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
| Name | Type | Description |
|---|---|---|
position | number | |
velocity | number | |
points | readonly 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
| Name | Type | Description |
|---|---|---|
bolt | Text |
|
value | unknown |
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
| Name | Type | Description |
|---|---|---|
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; } |
|
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
| Name | Type | Description |
|---|---|---|
bolt | Pick<ViewBolt, 't'> |
|
o | O | |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
model | string | |
id | string | '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
| Name | Type | Description |
|---|---|---|
model | string |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
current | number | |
total | number | |
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
| Name | Type | Description |
|---|---|---|
input | string |
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
run | Pick<RunRow, 'progress'> |
|
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
| Name | Type | Description |
|---|---|---|
run | Pick<RunRow, 'progress'> |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
descriptor | ControlDescriptor |
|
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
| Name | Type | Description |
|---|---|---|
releases | ReadonlyArray<ReleaseVersion> | |
at | string | 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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
ref | string | |
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
| Name | Type | Description |
|---|---|---|
color | RgbaColor |
|
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
| Name | Type | Description |
|---|---|---|
color | RgbaColor |
|
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
| Name | Type | Description |
|---|---|---|
offset | number | |
dimension | number | |
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
| Name | Type | Description |
|---|---|---|
fn | CustomAnnouncer | 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
| Name | Type | Description |
|---|---|---|
target | PortalTarget | 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
| Name | Type | Description |
|---|---|---|
text | Partial<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
| Name | Type | Description |
|---|---|---|
current | Readonly<Record<string, T>> | |
submitted | Readonly<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
| Name | Type | Description |
|---|---|---|
bolt | Pick<ViewBolt, 't'> |
|
model | string |
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
| Name | Type | Description |
|---|---|---|
current | HTMLElement | |
elements | readonly HTMLElement[] | |
direction | SpatialDirection |
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
| Name | Type | Description |
|---|---|---|
spans | readonly 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
| Name | Type | Description |
|---|---|---|
state | { readonly position: number; readonly velocity: number; } |
|
target | number | |
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
| Name | Type | Description |
|---|---|---|
rows | readonly TreeReorderRow[] | |
index | number |
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
| Name | Type | Description |
|---|---|---|
root | HTMLElement |
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
| Name | Type | Description |
|---|---|---|
text | string |
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
| Name | Type | Description |
|---|---|---|
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 |
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
| Name | Type | Description |
|---|---|---|
nodes | readonly TreeNode<T>[] | |
checked | readonly string[] | |
id | string | |
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
| Name | Type | Description |
|---|---|---|
nodes | readonly TreeNode<T>[] | |
checked | readonly 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
| Name | Type | Description |
|---|---|---|
paths | readonly 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
| Name | Type | Description |
|---|---|---|
locale | string |
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
| Name | Type | Description |
|---|---|---|
ctx | UiContext |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
v | unknown |
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
| Name | Type | Description |
|---|---|---|
o | VirtualOptions |
|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
source | Getter<T> | |
callback | WatchCallback<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
| Name | Type | Description |
|---|---|---|
source | ChangeSource | |
fn | () => T |