Skip to content

@calternal/ui

Public UI exports; keep shared controls and picker types beside their component contracts (#412, #506, #723, DESIGN §35).

The §34 desktop presentation: a wide viewport with a precise pointer.

  • MediaQuery

new SurfaceViewport(): SurfaceViewport

SurfaceViewport

MediaQuery.constructor


new Warmth(now?): Warmth

Parameter Type
now? () => number

Warmth

cool(): void

Forget the warm state (Escape, a scroll, a press).

void

delay(): number

Delay before the next tooltip shows: 0 while warm, else the cold delay.

number

hidden(): void

void

isWarm(): boolean

boolean

shown(): void

void

One inline activity deck for a kind, hour and Photo date role.

Property Type Description
added? boolean This is the Photo’s upload date, shown as <N> Added (#624).
addedItems? GridItem[] Stable Calendar items used by the upload-date preview carousel (#624).
count number -
files CalendarFile[] -
hour number Hour of day, 0–23.
kind ActivityKind -
notes CalendarNote[] -

Property Type Description
attachment CalendarAttachment -
family AttachmentFamily -
fullName string Full name for the shared warm tooltip.
key string Stable key inside one entry: targets are unique per entry.
kind "task" | "note" | "file" | "link" -
label string Accessible name of the card’s button.
missing boolean The linked local item is absent and must not open as a live file.
name string Display name: the link text, else the last path segment.
thumbUrl string | null Files thumb route URL, or null for a glyph tile.

A file linked under a log entry (- [text](target) child bullet).

Property Type Description
displayName? string | null Friendly photo or file title, when the API has one.
embed boolean -
fullName? string | null Full indexed file name for the shared warm tooltip.
itemId? string | null Files item ID (/f/<id>), when the target is indexed and visible.
kind "task" | "note" | "file" -
mediaType? string | null Indexed media type of the target file.
missing? boolean A local target that no longer has a live Files, Note or Task item.
noteId? string | null The target Note’s calternal-id (/n/<id>).
target string -
text string -
thumb? string | null Content hash for a supported file’s Files thumbnail.
thumbnailKind? ThumbnailKind | null Files renderer kind, so the same content hash selects its own preview.
thumbnailUrl? string | null Already validated API thumbnail URL for standalone Calendar items (#822).

Sorted horizontal bounds for the rendered Calendar columns. Drag handlers use this binary lookup after capturing layout once per gesture (#751, §39).

Property Type
date string
left number
right number

Property Type Description
continuedLogs CalendarLogPart[] Render-only Log parts that started on the preceding Daily note.
counts DayCounts -
cover CalendarFile | null The day’s most recent photo, used as the Month cell’s faint cover.
date string -
eventColor string | null First visible subscription layer colour for dense day markers.
events CalendarEvent[] -
eventTag string | null First Event category for dense views that only draw a day dot.
fileHours HourGroup[] -
items GridItem[] Standalone activity rows for the Week and Day grid, in time order (#589).
logs CalendarLog[] -
notes CalendarNote[] -
photoHours HourGroup[] -
tasks CalendarTask[] -

An Event: planned CalDAV or a read-only URL subscription item (#431).

Property Type Description
allDay boolean -
color? string | null The User-selected colour of an external subscription layer.
continuesAfter? boolean This daily part ends before the Event’s last day.
continuesBefore? boolean This daily part starts after the Event’s first day.
end string | null -
endsAt? string | null -
endsOn? string | null -
id string -
location? string | null Place attached by the Event provider.
provider string The Event’s Calendar display name.
readOnly? boolean URL-subscribed Events open read-only and can be copied to a CalDAV Calendar.
recurring? boolean Recurring Event instances cannot be edited until the API supports occurrence writes (#536).
sourceId? string | null Stable URL subscription ID for an external read-only calendar layer.
start string | null HH:MM local start, or null for an all-day event.
startsAt? string | null The whole event’s start and end (RFC 3339), when it spans more than this day’s part.
startsOn? string | null Full all-day occurrence bounds, with an exclusive end date.
tags string[] Ordered tags from the provider; the first tag supplies this Event’s tint.
timezone string The zone the event was saved in at its provider.
title string -

Property Type Description
id string | null -
mediaType? string | null -
name string -
path string -
taken? boolean Calendar item date: true means this is the Photo’s capture date (#624).
thumb string | null Content hash for the Files thumbnail route when a preview is supported.
thumbnailKind? ThumbnailKind | null Files renderer kind for hash URLs that can refer to several previews.
time string HH:MM local time of the last save.

One shared action label, accessible name, icon, and behavior flags. Issues #581 and #628; DESIGN §34.

Property Type
accessibleLabel string
destructive? boolean
group CalendarItemActionGroup
icon "link" | "paperclip" | "mic" | "pencil" | "eye-off" | "copy" | "calendar" | "trash"
id CalendarItemActionId
label string
shortcut? "calendar.attach" | "calendar.recordVoice" | "calendar.duplicate"

A log entry: the record of something the user did (actual time).

Property Type Description
attachments CalendarAttachment[] -
awaitingProjection? boolean The server acknowledged the Log, but its Calendar projection is not indexed yet (#468).
end string | null -
id string | null The line’s ^block-id, or a temporary pending: identity before ack.
pending? boolean The entry is visible while its one durable Log batch is in flight (#468).
place? { id: string; name: string; } | null Saved place identity and name snapshot recorded with the Log (#391, DESIGN §47).
start string -
tags string[] -
timezone? string | null The zone the entry was logged in, when the Index knows it.
title string -

A rendered part of one Log entry; its data stays on sourceDate (#469).

Property Type Description Inherited from
continuesAfter boolean - CalendarTimePart.continuesAfter
continuesBefore boolean - CalendarTimePart.continuesBefore
date string - CalendarTimePart.date
end string | null A point Log has no stored end; range parts have an exclusive end. -
log CalendarLog - -
rangeEnd number - -
rangeStart number Whole Log range, in minutes from its source day’s midnight, for drag edits. -
sourceDate string - -
start string - CalendarTimePart.start

Property Type Description
id string -
path string -
time string HH:MM local time of the last save.
title string -

Inputs for the shared priority resolver used by create, move, resize and keyboard nudges.

Property Type Description
altKey? boolean -
excludeKey? string The active item does not attract its own move or resize gesture.
gridMode? "none" | "floor" | "round" New-range starts preserve the existing floor behavior; none keeps keyboard step deltas.
hourPixels number -
itemEdges? readonly CalendarSnapItemEdge[] Same-day edges sorted by minute so the resolver can bound its scan.
itemIntervals? readonly CalendarSnapItemInterval[] Cached interval pairs keep pointer-frame create checks allocation-free (#714).
keyboardFrom? number Source minute for a keyboard step that must stop on crossed item edges (#714).
maxMinute? number Keep this at 1440 for a day edge, or extend it while resizing overnight.
minute number -
nowMinute? number -
snapInsideItem? "after" | "before" Clamp a create edge inside an interval to that interval’s safe boundary (#714).
snapToItems? boolean -
snapToNow? boolean -
stepMinutes number -

One visible boundary that a Calendar drag can line up with (#536).

Property Type
edge "end" | "start"
key string
minute number

A same-day item interval, prebuilt with edge candidates when Calendar data changes.

Property Type
end number
key string
start number

Property Type Description
continuesAfter? boolean -
continuesBefore? boolean -
createdClock? string | null -
createdDate? string | null User-zone creation day and minute for a Task without explicit placement (#655).
dueClock? string | null Clock half of a timed due property, normalized to HH:MM.
dueDate? string | null Date half of a timed due property returned by the Task API.
id string -
kind? "file" | "inline" Only file Tasks have a stable property write route for Calendar drag edits (#536).
priority string | null -
readOnly? boolean Shared Calendar reads have no Task write authority (#655 review, DESIGN §54).
role string Why the Task is on this day, including one generated recurrence occurrence (#659).
scheduledClock? string | null Clock half of a timed scheduled property, normalized to HH:MM.
scheduledDate? string | null Date half of a timed scheduled property returned by the Task API.
source string -
startClock? string | null Clock half of a timed start property, normalized to HH:MM.
startDate? string | null Date half of a timed start property returned by the Task API.
status string -
tags string[] -
timeEnd? string | null Exclusive end clock for a timed task part (24:00 is day end).
timeSourceDate? string | null Source day that owns a multi-day timed Task.
timeStart? string | null Start clock for a timed task part; absent means it stays in the all-day lane.
title string -

One half-open part of a timed item, clipped to a local Calendar day (#469).

Property Type Description
continuesAfter boolean -
continuesBefore boolean -
date string -
end string Exclusive end; 24:00 means the next local day’s midnight.
start string -

Property Type
anchor string
span number

What the collection needs to draw one entry.

Property Type Description
detail? string Caller-owned context: Trash origin or Shared Group (#1028).
dir boolean -
key string -
kind FileGlyphKind -
kindLabel string -
modified string Secondary columns, already formatted by the caller.
name string -
shared boolean -
size string -
thumb string | null -

A page-owned capsule surface that temporarily occupies the shared bottom chrome row. offsetX moves the measured Tab Bar stage with the same spring when a card belongs in the content column beside the sidebar (#640, §45).

Property Type Description
component Component<any> -
offsetX? string Optional CSS length used to centre a morph card over the content column.
props? Record<string, unknown> -

A range selected on the hour grid for creation, in minutes after midnight.

Property Type
date string
end number
start number

Property Type
date_format "system" | "dmy_slash_padded_short" | "mdy_slash_short" | "dmy_slash_short" | "mdy_slash_long" | "dmy_slash_padded_long" | "dmy_dot" | "dmy_dash" | "ymd_slash" | "ymd_dot" | "iso"
first_day_of_week "system" | "sunday" | "monday" | "saturday"
time_format "system" | "24_hour" | "12_hour"

Per-kind totals. The API sends counts beside capped item lists, and the Year payload sends counts only, so every total reads from here.

Property Type
events number
files number
logs number
notes number
photos number
tasks number

A day’s #53 diagnostics: unparsed lines plus Log heading problems.

Property Type
duplicateHeadings number
lines RepairLine[]
missingHeading boolean

draggablePopover: move a persistent popover freely around the screen (owner, 2026-09-25: a selected Calendar item’s popover). Apply it to the popover’s surface; it only acts while enabled is true. It lives with the shared popover primitives so every popover can take it.

  • A press on a NON-text, NON-control area (the padding, the header background, empty space) starts a drag after a small movement threshold (DRAG_THRESHOLD_PX), so a click is never a drag. Text stays selectable; buttons, links, chips and fields keep working.
  • Touch: a long press (LONG_PRESS_MS, still) on a non-text area, then drag; a finger that moves first is scrolling and cancels.
  • The position is clamped inside the viewport (MARGIN_PX), written as left/top on the surface (the popover is position: fixed), and reported through onmove so the owner stops re-anchoring it.
  • Keyboard: while the surface itself has focus, the arrow keys move it by KEY_STEP_PX (Shift: 5 × that) and onannounce('Moved') is called for a polite live region.
  • The draggable areas show a grab cursor (data-draggable on the surface, styled by the owner); grabbing while a drag runs. No inertia, so reduced motion needs nothing extra.
Property Type Description
enabled boolean -
onannounce? (message) => void Polite announcement for a keyboard move.
onmove? (left, top) => void The popover moved (by pointer or keys); left/top in px.

Property Type Description
background string A theme-aware soft fill from the shared tag palette or layer colour.
color string The tag foreground, validated layer colour or neutral marker for an untagged Event.
hover string Slightly stronger than the resting fill for hover.
past string The resting fill with a quieter category mix for past Events.
pastText string Past text retains readable contrast on the quiet fill.
selected string Stronger than hover while selected or open.
text string Tag-hued text or theme ink chosen to keep text readable over the fill.

A standalone item on the Week and Day grid: a file, Photo, Note or bookmark saved on its own, placed at its own time and packed beside overlapping timed entries (#589). Attachments of a Log entry stay on the entry (DESIGN §39).

Property Type Description
at? string Original indexed time, used to pick the newest three deck cards.
itemId string | null -
kind "note" | "file" | "photo" | "bookmark" -
mediaType string -
name string File name, or the Note or bookmark title.
noteId string | null -
ownerId string The Home that holds the item (a Share can show another User’s items).
path string Home-relative path in the owner’s Home.
taken boolean True when this Calendar row is the capture date; false for its upload date.
thumb string | null Files thumb route URL for images and videos; null draws a glyph tile.
time string HH:MM local time: taken or added for photos, saved for the rest.
url string | null The page address of a bookmark.

Files or photos saved in one hour: the true count plus a few representatives.

Property Type Description
count number -
hour number Hour of day, 0–23.
items CalendarFile[] -

Reactive state for the shared voice memo player. Playback helpers own its lifecycle (#622, #822; DESIGN §38).

Property Type Description
currentTime number -
duration number -
failed boolean -
key string | null -
playing boolean -
rate number Playback speed, kept across sounds like a podcast player.

What one control shows for its key: reactive when read in a template.

Property Type Description
active boolean -
currentTime number Seconds; 0 until the browser has decoded the length.
duration number -
playing boolean -
progress number 0–1 share of the sound already played.

Property Modifier Type Description
current readonly number Current position in the caller’s units.
target readonly number Current target in the caller’s units.
velocity readonly number Current velocity in caller-units per second.

cancel(): void

Stop scheduling frames and preserve the current position and velocity.

void

follow(value, time?): void

Follow direct manipulation while keeping a velocity sample for release.

Parameter Type
value number
time? number

void

hold(time?): number

Stop at the current position and retain velocity for a later retarget.

Parameter Type
time? number

number

retarget(target): void

Move to a new target from the current position and velocity.

Parameter Type
target number

void


Property Type Description
onRest? (target) => void -
reducedMotion? () => boolean Read the live preference so reduced motion makes every retarget immediate.
scheduler? SpringFrameScheduler Frame source; injectable to make the motion contract deterministic in tests.

One activity deck on the grid. Upload-day Photos use one Added deck per day.

Property Type Description
added boolean -
first number The first item’s own time, minutes after midnight.
items GridItem[] Items of one kind close in time, or all Photos added on this date.
start number Start of the fixed interval, or earliest upload time for an Added deck.

Property Type
href string
title string

Property Type Description
copyLabel? string Optional Copy link action, for Canvas membership (#977, DESIGN §60).
excerpt string | null The referring line, or null when it could not be read.
href string -
key string -
label string -

Changed fields of one log entry; end: null clears the end.

Property Type
end? string | null
start? string
tags? string[]
title? string

Property Type Description
localeOrder? boolean Use locale order even when the User chose a different numeric date pattern.
month? "long" | "short" -
timeZone? string -
weekday? false | "long" | "short" | "narrow" -
weekdaySeparator? string -
year? boolean -

Optional visible section caption. The menu keeps its icon and text columns aligned around the caption.

Property Type
label string
type "header"

Property Type Description
ariaLabel? string Optional spoken name when an internal navigation row uses a shorter label.
checked? boolean -
children? MenuNode[] Submenu items. Presence alone makes this item open a flyout instead of firing onaction directly (Enter/Space/click open it, matching macOS).
danger? boolean -
detail? string Short status text at the trailing edge, for example “In use”.
disabled? boolean -
dropTarget? boolean Optional drop target, used by folded breadcrumb links.
fontFamily? string Local preview face for the label (for example, the Fonts settings menu).
icon? string | MenuIcon Lucide component for this action. Trusted static SVG path data remains supported for existing callers.
id string -
kbd? KbdKey[] Shortcut keys — renders a trailing Kbd AND sets aria-keyshortcuts.
label string -
onDragLeave? () => void -
onDragOver? (event) => void -
onDrop? (event) => void -
shortcut? any Registry shortcut — preferred when the action has a reusable binding.
swatch? string A validated hex colour chip in the menu’s leading glyph column.
type? "item" -
variant? "default" | "radio" | "checkbox" ‘radio’/‘checkbox’ show a trailing check when selected and set the matching ARIA role; ‘default’ is a plain action.

Property Type
type "separator"

Property Type Description
bounds? object Keep the full surface inside this visible rectangle when supplied.
bounds.bottom number -
bounds.left number -
bounds.right number -
bounds.top number -
gap? number Gap from the pointer to the surface (default: 8 CSS px).
margin? number Minimum gap from each safe-area edge (default: 8 CSS px).
vertical? "below" | "center" Put the surface below the pointer, or centre it on the point.
viewport? object Override the viewport size in non-browser callers and tests.
viewport.h number -
viewport.w number -

Property Type Description Inherited from
availableWidth number Maximum width that keeps the selected side clear of the point. -
left number - PlaceResult.left
placement "up" | "down" The direction in which the element actually opened: ‘down’ — below the anchor (normal case) ‘up’ — above the anchor (flipped because the bottom edge was too close) PlaceResult.placement
side "left" | "right" Horizontal side selected after checking available room. -
top number - PlaceResult.top

Property Type
key string
value string

Property Type Description
actions? PageChromeAction[] -
back? object A nested page’s parent action, shown in the leading header slot.
back.label string -
back.onaction () => void -
breadcrumbs? PageChromeBreadcrumb[] Visible path segments. Every segment remains a deep link.
canDropBreadcrumb? (path, event) => boolean Drop handlers for shared file targets in the visible breadcrumb row.
center? Snippet<[PageChromeContext]> A control group centred between the title and the page actions.
contextualBar? ContextualBar A selection or editing bar that replaces the bottom capsule.
copyLink? object The current view’s stable URL, rendered with the shared CopyLink control.
copyLink.href string -
copyLink.label string -
copyLink.shortcut? any -
inlineTitle? boolean The page’s large title is in its content; the compact header title dissolves in as it passes under the progressive blur.
morphCard? ContextualBar A page surface that expands the Tab Bar capsule over the current view.
onaction (id, anchor?) => void | Promise<void> -
onbreadcrumbdrop? (path, event) => void -
onprimaryshortcut? () => void Run or open the primary action when page chrome replaces the pill (#1128).
onviewmode? (id) => void -
overflow? MenuNode[] -
primary? PageChromeAction The mode’s primary action: the pill beside the mode tray.
title? string The header title; omit to keep the sub-view name.
titleContent? Snippet<[]> Draws the title (for example with a morph); title stays its name.
tools? Snippet<[PageChromeContext]> -
viewMode? string -
viewModes? PageChromeViewMode[] A page’s adjacent view choices, shown in one shared PillGroup capsule.

Property Type Description
contextMenu? MenuNode[] Secondary actions shown by right-click or touch long-press on the primary action.
disabled? boolean -
expanded? boolean aria-expanded for an action that toggles a popover (the Inspector).
icon IconComponent -
id string -
label string -
menu? MenuNode[] -
popup? "dialog" | "menu" aria-haspopup for an action that opens a dialog (the Inspector).
shortcut? any -

The size context that page-owned center and tools snippets render in.

Property Type Description
compact boolean A narrow row: page tools should collapse secondary controls into one action.
phone boolean A phone-width row: controls that do not fit can collapse.

One view choice in the contextual Top row capsule (DESIGN §34, #582).

Property Type
icon IconComponent
id string
label string

Type Parameter
T
Property Type Description
cluster? number The overlap cluster (a run of items that overlap in time), numbered in time order.
column number Column inside its overlap cluster and the cluster’s column count.
columns number -
end number -
item T -
layoutEnd number End used for overlap packing when the rendered card needs a title-line floor (#384).
layoutStart number Start used for a short visual floor when it grows upward at midnight (#384, #469).
point boolean -
start number -

Property Type Description
align? HAlign Horizontal alignment of the floating element relative to anchor.x. ‘left’ (default) — anchor.x is the natural left edge of the element. ‘right’ — anchor.x is the natural left edge of a right-aligned element (e.g. buttonRight − menuWidth). The clamping logic is identical in both cases; this is a semantic label for callers.
bounds? object Visible clipping band in viewport coordinates. When provided, placement is clamped to this band instead of the whole window. This is the shared edge-aware path for floating UI inside a scroll container: callers pass the intersection of the container and the browser viewport.
bounds.bottom number -
bounds.left number -
bounds.right number -
bounds.top number -
flipY? number The hinge for an upward flip: the element’s BOTTOM edge when it opens up (default: anchor.y, the same pixel as the downward hinge). A caller that anchors to a trigger ELEMENT passes trigger.top − gap here, so a flipped menu sits above the trigger instead of covering it (see anchorToRect).
margin? number Minimum safe gap from every viewport edge in CSS px (default: 8).
preferUp? boolean Force upward placement regardless of available space below (default: false). Useful when the trigger is known to sit near the bottom of the screen.
viewport? object Override viewport dimensions (default: window.innerWidth / innerHeight). Useful for unit tests that run outside a browser environment.
viewport.h number -
viewport.w number -

Property Type Description
left number -
placement "up" | "down" The direction in which the element actually opened: ‘down’ — below the anchor (normal case) ‘up’ — above the anchor (flipped because the bottom edge was too close)
top number -

Property Type Description
allowAwayFromTop? boolean Explicitly allow this registered surface to arm away from document top. Defaults to false so every existing pullDown caller keeps top-only behavior.
bandPx? () => number Optional TOP-BAND arming: when set, a downward pry ALSO arms if the pointer started within bandPx() of the viewport top — even when the feed is scrolled down. This is what lets a pull-down originating in the date-strip band open the palette mid-feed (refine-2). Without it, only the scroll-top pull arms.
canPull? () => boolean are we allowed to pull at all? When false the pull is ignored entirely. Defaults to always-allowed; this is an early bail, not the only guard.
isBusy? () => boolean true while the action’s target is already open/busy — pulls become a no-op (don’t re-trigger). The consumer wires this to e.g. paletteOpen.
maxPull? number max indicator travel (px) the rubber-band asymptotes toward
oncancel? () => void drag ended/aborted without committing (snap back to 0)
oncommit? (outcome) => void | Promise<void> released with a non-cancel outcome. Awaited so the action can hold the indicator until it settles.
onmove? (offset) => void live indicator offset while dragging (px, ≥0)
onstart? () => boolean | void Reserve shared ownership once downward vertical intent wins. Returning false rejects this pointer without claiming or preventing its movement.
reduced? () => boolean true to skip the elastic curve + clamp linearly (prefers-reduced-motion)
resolveOutcome? (offset) => PullActionOutcome optionally resolves a release to one of multiple actions; when omitted, pullDown keeps its legacy single-threshold refresh behavior.
scrollTop? () => number scroll position getter — a pull always arms when this is ~0 (at the very top). Defaults to the app route feed (#718), then Window for other hosts.
threshold? number indicator offset (px) at which a release commits
tolerance? number dead zone (px) before a vertical drag is treated as a pull

A trigger-anchored placement request (see anchorToRect).

Property Type Description
flipY number Upward hinge (PlaceOptions.flipY): gap px above the trigger’s top edge.
originX number The trigger’s horizontal centre — where the surface’s transform-origin goes.
x number Horizontal hinge: the trigger’s left edge (‘left’) or right edge (‘right’).
y number Downward hinge: gap px below the trigger’s bottom edge.

An unparsed line inside a day’s Log section, with an optional fix (#53).

Property Type
hash string
raw string
suggestion string | null

resizableEdge: make a side panel resizable by dragging its edge (owner rule in CLAUDE.md, issue #66). Apply it to an empty element that straddles the panel edge; the action turns that element into the invisible hit zone.

  • No visible handle. The zone is transparent, ~8 px wide, with a col-resize cursor. Nothing is drawn at rest, on hover or while dragging (the owner rejected invented borders).
  • Live resize runs on requestAnimationFrame and writes ONE custom property (--<id>-width) on the target element, so the drag never forces layout from script and a frame never repeats work.
  • Min/max clamp; dragging below min - snap snaps the panel collapsed. Reopening restores the last width (the caller shows the panel again and the stored width is still there).
  • Double-click resets to the default width.
  • Keyboard and assistive tech: role="separator", aria-orientation, aria-valuenow/min/max; ←/→ resize by step, Shift for 4 × step, Home/End jump to min/max, Enter collapses.
  • Persistence: the width is stored per panel under calternal.panel.<id> in this Installation’s local storage. This action does not send widths to the server. readPanelWidth lets a layout apply the stored width before first paint, so there is no layout shift on load.
  • Coarse pointers (phones) do not get the zone: there the panels are sheets. Tablets with a fine-enough pointer still resize.
Property Type Description
edge "end" | "start" Which edge of the panel the zone sits on. end = right edge of a left panel (the sidebar); start = left edge of a right panel.
id string Stable panel ID; names the CSS property and the storage key.
initial number Default width in px; double-click restores it.
label string Accessible name, e.g. “Resize sidebar”.
max number -
min number -
onchange? (width) => void Called after every committed width (drag end, key, reset).
oncollapse? () => void Called when a drag or Enter collapses the panel. Omit to disable snap-to-collapse.
snap? number How far below min a drag must go to collapse. Default 48 px.
step? number Keyboard step in px. Default 16.
target () => HTMLElement | null Element that receives the --<id>-width custom property.

Property Type Description
ariaLabel? string Accessible name; falls back to label when omitted.
disabled? boolean A disabled member. TAB semantics: focusable-but-disabled (the Tasks tab). It announces (aria-disabled), stays focusable, and on activation ALWAYS calls onblocked — never the re-pick no-op. RADIO semantics: an unavailable choice (the composer’s Event/Task modes while it is bound to an event’s “Add note”). It announces aria-disabled, recedes visually, is never tabbable, is skipped by arrow/Home/End selection, and ignores activation. A disabled radio is never the selected value in practice; the consumer keeps value on an enabled option.
icon? string SVG path d (e.g. from modeGlyphs) → renders a decorative glyph. When set, the label is icons-only unless showLabels.
id string -
label string -
modeIconId? string Shared Tab artwork when this option represents an app Tab (#1095–#1097).
tooltip? object The warm tooltip for this option (DESIGN §34), with its shortcut.
tooltip.icon? TooltipIconName -
tooltip.label string -
tooltip.shortcut? any -

Property Type
disabled? boolean
href? string
icon Component
id string
label string
shortcut? any

Property Type
disabled? boolean
label string
value string

Property Type
at number
darkAfter boolean
kind "sunrise" | "sunset"

Property Type
latitude number
longitude number

Property Type Description
polarState "day" | "night" | null Solar state at local noon when the date has no sunrise or sunset.
sunrise number | null UTC epoch milliseconds, or null during the corresponding polar season.
sunset number | null UTC epoch milliseconds, or null during the corresponding polar season.

cancel(id): void

Parameter Type
id number

void

now(): number

number

request(callback): number

Parameter Type
callback FrameRequestCallback

number


A single cell in the date strip.

Property Type Description
date string YYYY-MM-DD
day number day-of-month, e.g. 23
dow string single-letter weekday initial, locale-aware, e.g. “M”
isToday boolean true if this is the device’s today
week number ISO week number this date falls in (1..53). The “W38” blob shows the ISO number on purpose: ISO numbering is a fixed, shared standard (it matches calendars and work planning tools), while where a week STARTS follows the locale (weekStart below).
weekStart boolean true if this date is the first day of its LOCALE week (lib/weekStart.ts: Sunday in the US, Monday in GB/DE, …) — used for subtle week-boundary separators in the strip.

Property Type Description
enabled? () => boolean Backward-compatible alias for pointerSwipeEnabled. It only gates pointer swipe ownership; long press and wheel ownership remain independent.
leftThreshold? number px of travel to commit a LEFT swipe; defaults to threshold. Make this larger for a destructive left action so it’s hard to trigger by accident.
longPressMs? number -
moveTolerance? number movement (px) that cancels a long-press
oncancel? () => void drag ended without committing (snap back)
onlongpress? (x, y) => void long-press fired (ms held without moving)
onLongPressClaim? () => void App-specific protection when a long press opens a menu over selectable text.
onmove? (dx) => void live drag offset (px, signed)
onswipe? (dir) => void committed swipe in a direction
pointerSwipeEnabled? () => boolean Dynamic gate for pointer swipe ownership. Long-press/context-menu handling remains available when this is false, and wheel ownership is controlled by wheelEnabled independently. Defaults true so every existing caller preserves its current behavior.
pointerTypes? ("touch" | "pen" | "mouse")[] #27 B §C.1 — restrict which pointer types can ARM this gesture (default: all — the original behavior, unchanged for every pre-existing caller). The composer’s in-input swipe passes ['touch', 'pen']: on desktop a horizontal MOUSE drag inside a textarea is ordinary text selection and must stay text selection — hijacking it as a stack/discard swipe would break click-drag-to-select. Desktop gets the keyboard + named a11y actions instead (§C.2/§C.3), never the gesture.
selectionEl? () => { selectionEnd: number | null; selectionStart: number | null; } | null #27 B §C.1 — selection/caret guard (feasibility finding). When set, the gesture arms ONLY if this element’s selection is COLLAPSED at pointerdown (selectionStart === selectionEnd) — a drag starting on selected text / a caret handle is real iOS Safari behavior starting a native text-selection drag, never a stack/discard swipe. While armed we also watch selectionchange: if the selection un-collapses MID-drag (WebKit can start a selection a few px into an already-armed gesture — the pointerdown check alone isn’t a complete guard), the gesture aborts as a cancel — snap back, never commit a swipe. A getter (not a plain value) so a caller can pass a live ref to a textarea that may not exist yet at mount time (e.g. Composer’s () => textarea). Additive to pointerTypes above, not a replacement for it.
shouldStart? (target) => boolean Keep controls, editors and nested gesture owners outside this action.
threshold? number px of travel to commit a RIGHT swipe (and the default for both)
wheelBurstKey? string Stable owner key for a discrete pager whose DOM node can remount during a wheel burst. The key suppresses trailing horizontal packets until idle.
wheelDominance? number Horizontal-to-vertical ratio required to lock a wheel sequence to x.
wheelEnabled? boolean | (() => boolean) Opt-in horizontal mouse/trackpad wheel recognition. It is deliberately false by default: text inputs and other existing swipe surfaces must not start reacting to wheel input until their owner explicitly opts in. The wheel listener is attached ONLY while this resolves true, evaluated at mount and on every action update(). A non-passive wheel listener makes the compositor wait for the main thread before it scrolls over the node, so a feed of cards must not pay that cost while the setting is off. Pass a plain boolean from a Svelte template (for example wheelEnabled: settings.trackpadSwipes) so a setting change re-runs update(). A getter is still honoured per event, but a getter that turns true after mount only takes effect on the next update().
wheelIdleMs? number Inactivity window after the last wheel event that ends a sequence.
wheelThreshold? number Minimum accumulated normalized wheel travel for a commit. Defaults to the direction-specific pointer threshold when omitted.
wheelTolerance? number Accumulated wheel travel dead zone before axis lock.

Property Type Description
dark boolean -
group ThemeGroup -
id ThemeId -
label string -
swatch string Representative swatch from this palette’s accent.

Property Type Description
dark ThemeId -
darkVariants? readonly ThemeId[] Alternate dark palettes; this curated set has no alternate light palettes.
id ThemeFamilyId -
label string -
light ThemeId -

Property Type
city string
latitude number
longitude number

Property Type
aria-keyshortcuts? string
data-tooltip string
data-tooltip-fallback? string
data-tooltip-icon? TooltipIconName
data-tooltip-keys? string
data-tooltip-side? "top" | "bottom"

Property Type
excerpt object
excerpt.after string
excerpt.before string
excerpt.match string
href string
key string
label string

Property Type Description
badge? string | null A short badge after the name (“RAW”, “LIVE”, “5”).
decodable? boolean The browser can decode src as an image.
download? string | null Download URL; omitted when the viewer may not download.
downloadName? string Original file name for the download when name is a friendly display title.
headers? Record<string, string> Request headers for fetches (public link password).
hls? string | null Video: an HLS playlist to fall back to when direct play fails.
key string -
kind FileGlyphKind -
link? string | null In-app deep link (/f/<id>); enables Copy link.
meta? string One line under the name: size · modified.
motion? string | null Live Photo: the motion clip, played on hover or press.
name string -
preview? string | null Fast preview (server thumbnail); shown first, and alone for RAW/HEIC.
src string | null Inline URL for the bytes (image, PDF, media, text).

A normalized wheel delta. WheelEvent.deltaMode can report pixels, lines or pages depending on the input device and browser, so wheel gesture decisions must use one unit before accumulating a sequence.

Property Type
x number
y number

ActivityKind = "notes" | "files" | "photos"


AgendaList = ReturnType<typeof AgendaList>


AttachmentDeck = ReturnType<typeof AttachmentDeck>


AttachmentFamily = "image" | "video" | "audio" | "voice-memo" | "archive" | "document" | "other"


Axis = "x" | "y"


CalendarActionItem = Extract<PreviewItem, { kind: "log" | "event" | "task"; }>

A Log entry, Event, or Task preview that can have Calendar item actions (#581, #628; DESIGN §34).


CalendarItemActionAvailability = Partial<Record<CalendarItemActionId, boolean>>

Availability flags for Calendar actions; an omitted or false flag hides that action (#581, #628; DESIGN §34).


CalendarItemActionGroup = "title" | "leading" | "trailing"

The action position in a preview or context menu: title, leading, or trailing. Issues #581 and #628; DESIGN §34.


CalendarItemActionId = "copy-link" | "attach-file" | "voice-memo" | "edit" | "hide" | "duplicate" | "copy-to-calendar" | "delete"

Stable IDs for actions in Calendar item previews and context menus. Issues #581 and #628; DESIGN §34.


CalendarPlanMoveMode = "move" | "resize-start" | "resize-end"

Pointer edit mode for a timed Calendar item (#536).


CalendarPopover = ReturnType<typeof CalendarPopover>


CalendarSnapTarget = { edge: "start" | "end"; key: string; kind: "item"; } | { kind: "now"; } | { kind: "grid"; } | { kind: "free"; }

The magnetic target currently controlling a drag preview.


CalendarTimedPlan = { continuesAfter?: boolean; continuesBefore?: boolean; date: string; end: string | null; event: CalendarEvent; kind: "event"; start: string; } | { continuesAfter?: boolean; continuesBefore?: boolean; date: string; end: string | null; kind: "task"; start: string; task: CalendarTask; }

The Event or Task interval drawn in one timed Calendar day column (#536).


CalendarTimeStep = typeof CALENDAR_TIME_STEPS[number]


CalendarTitle = ReturnType<typeof CalendarTitle>


CalendarTools = ReturnType<typeof CalendarTools>


CalendarView = "today" | "day" | "week" | "month" | "year"


Card = ReturnType<typeof Card>

Public exports for the shared UI package; request states, picker scheme types and their contracts stay beside shared controls (#506, #869, DESIGN §35).


Checkbox = ReturnType<typeof Checkbox>


CheckboxMode = "control" | "input" | "mark"


CheckboxState = "none" | "some" | "all"

State and rendering modes for the shared Checkbox, including the indeterminate state (#406, DESIGN §35).


CheckboxVariant = "file" | "tile" | "form" | "editor" | "photo" | "menu"


ChromeActions = ReturnType<typeof ChromeActions>


CollectionSortKey = "name" | "kind" | "size" | "modified"


CollectionView = "list" | "grid"


ComposerModeId = keyof typeof COMPOSER_MODE_GLYPHS


ComposerModePill = ReturnType<typeof ComposerModePill>


CopyableValue = ReturnType<typeof CopyableValue>

Make a displayed value a copy control. value is copied in full; displayValue changes only the visible text. Keep secrets out of label, which forms the accessible name. Issue #723.


CopyLink = ReturnType<typeof CopyLink>


CopyLinkVariant = "pill" | "segment" | "menu-item" | "value"


DateFormat = typeof DATE_FORMATS[number]


DateStrip = ReturnType<typeof DateStrip>


Disclosure = ReturnType<typeof Disclosure>


DraftStack = ReturnType<typeof DraftStack>


Fab = ReturnType<typeof Fab>


FieldPopover = ReturnType<typeof FieldPopover>


FileCollection = ReturnType<typeof FileCollection>


FileGlyphKind = "folder" | "image" | "pdf" | "video" | "audio" | "voice-memo" | "markdown" | "code" | "text" | "archive" | "other"


FileName = ReturnType<typeof FileName>


FileThumb = ReturnType<typeof FileThumb>


FirstDayOfWeek = typeof FIRST_DAY_CHOICES[number]


FloatingSidebar = ReturnType<typeof FloatingSidebar>


FloatingSurface = ReturnType<typeof FloatingSurface>


HAlign = "left" | "right"

Horizontal alignment hint provided by the caller.


HighlightOverlay = ReturnType<typeof HighlightOverlay>


IconLabel = ReturnType<typeof IconLabel>


InlineRename = ReturnType<typeof InlineRename>

Let a User edit a name in place. Bind value and set textAlignment to match the static name. The caller must save or cancel the edit. Issue #1017; DESIGN §34.


Inspector = ReturnType<typeof Inspector>


InspectorRow = ReturnType<typeof InspectorRow>

Add one label and value to InspectorSection. The label appears as dt; put the value in the child snippet. Issue #659; DESIGN §34.


InspectorSection = ReturnType<typeof InspectorSection>

Group Inspector content under a named heading. By default, children go inside a description list. Set rows to false for content such as loading or error text. busy sets aria-busy. Issue #659; DESIGN §34.


ItemCard = ReturnType<typeof ItemCard>

Show a non-interactive summary for an item. Set kind and title; optional text and media come from props. The host owns selection and actions. size controls the layout. Issue #822; DESIGN §§38–39.


ItemPreview = ReturnType<typeof ItemPreview>


Kbd = ReturnType<typeof Kbd>


LinkedHeading = ReturnType<typeof LinkedHeading>


LinkedHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6


LogEntryEditor = ReturnType<typeof LogEntryEditor>


MentionLoadState = "loading" | "ready" | "error"


Menu = ReturnType<typeof Menu>


MenuNode = MenuItemNode | MenuSeparatorNode | MenuHeaderNode


MiniMonth = ReturnType<typeof MiniMonth>


ModeHeader = ReturnType<typeof ModeHeader>


ModeIcon = ReturnType<typeof ModeIcon>

Show the decorative glyph for a Tab. Set modeId to the Tab ID. The Calendar glyph also shows the current day and updates when that day changes. Issues #1095–#1097; DESIGN §34.


MonthGrid = ReturnType<typeof MonthGrid>


NoteMentionsCard = ReturnType<typeof NoteMentionsCard>


NoteProperties = ReturnType<typeof NoteProperties>


OverlaySurface = ReturnType<typeof OverlaySurface>


Pill = ReturnType<typeof Pill>


PillGroup = ReturnType<typeof PillGroup>


PopoverSurface = ReturnType<typeof PopoverSurface>


PreviewItem = { date: string; kind: "log"; log: CalendarLog; } | { date: string; kind: "task"; task: CalendarTask; } | { date: string; event: CalendarEvent; kind: "event"; } | { date: string; kind: "stack"; stack: ActivityStack; } | { date: string; end: number; items: GridItem[]; kind: "items"; start: number; }

What a popover previews: one timed item, an activity deck or a summary stack.


PrimaryPill = ReturnType<typeof PrimaryPill>


ProgressiveBlur = ReturnType<typeof ProgressiveBlur>


PullAction = "refresh" | "update"


PullActionOutcome = { kind: PullAction; } | { kind: "cancel"; }


PullOutcome = { kind: "refresh"; } | { kind: "cancel"; }


QuickLook = ReturnType<typeof QuickLook>


RepairList = ReturnType<typeof RepairList>


RequestState = ReturnType<typeof RequestState>

Show the loading or error state for a request. Retry appears only when both its label and callback are set. Use variant="card" for the shared page Card treatment. Issue #869; DESIGN §34.


SegmentedControl = ReturnType<typeof SegmentedControl>


Select = ReturnType<typeof Select>


SelectionBar = ReturnType<typeof SelectionBar>


SettingRow = ReturnType<typeof SettingRow>


SidebarSectionHeader = ReturnType<typeof SidebarSectionHeader>


StatusPill = ReturnType<typeof StatusPill>


SwipeOutcome = { dir: "left" | "right"; kind: "swipe"; } | { kind: "cancel"; } | { kind: "none"; }


TabBar = ReturnType<typeof TabBar>


TagPill = ReturnType<typeof TagPill>


TextInput = ReturnType<typeof TextInput>

Show a text field with shared colours and focus styling. Bind value; other native input attributes pass through to the field. Issue #407; DESIGN §3.


TextView = ReturnType<typeof TextView>


ThemeFamilyId = "paper" | "meridian" | "bloom" | "mono" | "solarized" | "catppuccin" | "rose-pine" | "ayu" | "github" | "one" | "tokyo-night" | "gruvbox" | "everforest" | "kanagawa" | "dracula" | "nord"


ThemeGroup = "Light" | "Dark" | "Mono"


ThemeId = "paper" | "meridian" | "bloom" | "latte" | "solarized" | "solarized-dark" | "rose-pine-dawn" | "mono" | "midnight" | "ember" | "forest" | "tokyo-night-day" | "tokyo-night" | "gruvbox-light" | "gruvbox" | "frappe" | "macchiato" | "mocha" | "noir" | "one-light" | "ayu-light" | "github-light" | "nord-light" | "nord" | "alucard" | "dracula" | "one-dark" | "everforest-light" | "everforest" | "kanagawa-lotus" | "kanagawa" | "rose-pine" | "rose-pine-moon" | "ayu-dark" | "ayu-mirage" | "github-dark"


ThemePicker = ReturnType<typeof ThemePicker>


ThemeSchemePreference = "auto" | "system" | "light" | "dark"

Saved colour scheme choices; Auto and System can resolve to either active scheme.


ThemeVariantSelections = Record<VariantFamilyId, ThemeId>


ThumbnailKind = "media" | "pdf" | "text-card"

Renderer families used by the Files thumbnail cache (#510/#547).


TimeFormat = typeof TIME_FORMATS[number]


TimeGrid = ReturnType<typeof TimeGrid>


TimeZoneChip = ReturnType<typeof TimeZoneChip>

Show a time zone beside a Calendar time. The chip stays hidden when the zone matches userZone. If userZone is omitted, the User’s system time zone is used for comparison. DESIGN §29 C12 and §34 (Calendar preview).


TodayButton = ReturnType<typeof TodayButton>


Toggle = ReturnType<typeof Toggle>


TooltipIconName = "list" | "calendar-days" | "columns-3" | "grid-3x3" | "calendar-range"


TooltipLayer = ReturnType<typeof TooltipLayer>


TooltipShortcut = FileIcon | readonly FileIcon[]

A registry shortcut id, or a raw combo for a key not in the registry.


UIHeading = ReturnType<typeof UIHeading>


VariantFamilyId = "catppuccin" | "rose-pine" | "ayu"


VoicePill = ReturnType<typeof VoicePill>

Show idle, requesting, recording, or error controls for a voice memo. The caller manages capture, saving, discard confirmation, and Undo. Issue #617; DESIGN §38.


VoicePillState = "idle" | "requesting" | "recording" | "attach-error" | "error"

States shown by VoicePill; the host owns transitions and recording data. Issue #617; DESIGN §38.


VoicePlayback = ReturnType<typeof VoicePlayback>

Play a voice memo with seek and speed controls. Use the same stable key as compact controls so all surfaces share one playback state. If omitted, src is the key. Issues #617, #622, #822; DESIGN §38.


VoicePlayToggle = ReturnType<typeof VoicePlayToggle>

Show the shared play or pause button for a voice memo row. The host handles onplay because it can resolve the audio source. Use the same key as VoicePlayback. The button stops clicks from reaching its row. Issue #822; DESIGN §38.


VoiceRecordingPill = ReturnType<typeof VoiceRecordingPill>

Show recording controls for Composer or Calendar. The caller manages microphone access and saving. This component manages focus and asks for confirmation before Escape discards an active recording. Issue #619; DESIGN §34.


WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6

First day of the week: 0 = Sunday … 6 = Saturday.


YearHeatmap = ReturnType<typeof YearHeatmap>

const ACTIVITY_DECK_MAX_SIZE: 160 = 160

Maximum Activity thumbnail edge; 160 px keeps Day decks visible without taking over the lane (#589).


const ACTIVITY_KINDS: readonly ActivityKind[]


const AGENDA_INITIAL_DAYS: 2 = 2

Today fetches and immediately mounts this many days; older days page in. The adapter, preloader and Agenda share this bound to avoid extra work (#549).


const AgendaList: Component


const AttachmentDeck: Component


const CALENDAR_TIME_STEPS: readonly [5, 10, 15, 30]

Supported grid increments for pointer and keyboard Calendar edits (#536).


const CALENDAR_VIEW_OPTIONS: readonly object[]


const CALENDAR_VIEWS: readonly CalendarView[]


const CalendarPopover: Component


const CalendarTitle: Component


const CalendarTools: Component


const CAPSULE_MOTION: object

Kept as a descriptive alias for capsule components and existing callers.

Name Type
cap 500
countRoll 180
dampingRatio 1.08
easeOutQuint string
exitFade 120
firstItemDelay 90
itemOffset 12
itemRise 310
itemStagger 25
maxStaggerIndex 4
morph 200

const capsuleItemDelay: typeof cascadeItemDelay

Capsule-specific name retained for the toolbar and shortcut-card callers.


const capsuleItemTransition: typeof cascadeItemTransition


const capsuleOverdamped: typeof cascadeOverdamped


const Card: Component

Public exports for the shared UI package; request states, picker scheme types and their contracts stay beside shared controls (#506, #869, DESIGN §35).


const Checkbox: Component


const ChromeActions: Component


const CLOCK_LANE_MINIMUM_WIDTH: 96 = 96

Minimum width that keeps a complete Calendar time range readable (#969).


const COLD_DELAY_MS: 500 = 500

First tooltip after a cool-down: long enough that a passing pointer does not flash tooltips, short enough to feel like help, not like a wait.


const COMPOSER_MODE_GLYPHS: object

Name Type Description
event "M8 2v4M16 2v4M3 10h18M5 6h14a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z" An Event: a calendar page (a planned time).
log "M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z" A Log entry: a clock face (something done at a time).
note "M4 4h16v12l-6 4H4z M14 20v-4h4" -
task "M9 11l3 3 8-8M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" -

const COMPOSER_MODE_LABELS: Record<ComposerModeId, string>


const ComposerModePill: Component


const COPY_FEEDBACK_MS: 500 = 500

How long the check glyph stays after a successful copy. calternal.js DateDivider’s day-copy value; CopyLink and CopyableValue share it.


const CopyableValue: Component

Make a displayed value a copy control. value is copied in full; displayValue changes only the visible text. Keep secrets out of label, which forms the accessible name. Issue #723.


const CopyLink: Component


const DATE_FORMATS: readonly ["system", "dmy_slash_padded_short", "mdy_slash_short", "dmy_slash_short", "mdy_slash_long", "dmy_slash_padded_long", "dmy_dot", "dmy_dash", "ymd_slash", "ymd_dot", "iso"]


const DATE_TIME_SEPARATOR: " · " = “ \u00B7 “

The one separator between a date and its clock in compact item labels (“Sun, 4 Oct · 09:30”). Callers join through formatItemDateTime instead of writing the dot in a template, where Svelte can drop the leading space.


const DateStrip: Component


const DEFAULT_DARK: ThemeId

First-use system defaults keep the current monochrome light/dark pair.


const DEFAULT_DATE_TIME_PREFERENCES: DateTimePreferences


const DEFAULT_FAMILY: ThemeFamilyId


const DEFAULT_HOUR_HEIGHT: 48 = 48


const DEFAULT_LIGHT: ThemeId


const DEFAULT_THEME: ThemeId


const DEFAULT_VARIANTS: ThemeVariantSelections


const Disclosure: Component


const DraftStack: Component


const DUR: object

Shared durations in seconds for Motion’s JavaScript API. These roles keep the existing CSS timings exact while letting new CSS use the same tokens.

Name Type
ambient 1.4
brief 0.14
close 0.12
fast 0.1
feedback 0.3
highlight 1.2
instant 0.000001
long 0.22
longAmbient 2.4
medium 0.2
morph 0.24
open 0.18
press 0.12
quick 0.15
search 0.26
settle 0.32
short 0.16

const EASE: object

Shared easing roles. Keep the overdamped spring for interruptible movement; the bounce and reveal curves preserve the existing CSS roles that do not have spring semantics.

Name Type
bounce [number, number, number, number]
drawer [number, number, number, number]
feedback [number, number, number, number]
inOut [number, number, number, number]
out [number, number, number, number]
reveal [number, number, number, number]
spring [number, number, number, number]

const EASE_CSS: object

CSS forms of EASE, including the native curves used by existing controls.

Name Type
bounce string
drawer string
feedback string
inOut string
linear "linear"
out string
reveal string
spring string
standard "ease"
standardIn "ease-in"
standardInOut "ease-in-out"
standardOut "ease-out"

const EDGE_SWIPE_ZONE_PX: 20 = 20

The iOS back-swipe zone: a touch that starts this close to the left edge may open the sidebar sheet; anywhere else it may not (the Calendar’s horizontal day scroll keeps every other horizontal swipe).


const Fab: Component


const FieldPopover: Component


const FileCollection: Component


FileIcon: any


const FileName: Component


const FileThumb: Component


const FIRST_DAY_CHOICES: readonly ["system", "sunday", "monday", "saturday"]


const FloatingSidebar: Component


const FloatingSurface: Component


const HighlightOverlay: Component


const IconLabel: Component


const inlineAudioPlayback: InlineAudioPlaybackState

Shared playback state for Calendar, Search, and voice memo controls. Playback helpers own its updates (#622, #822; DESIGN §38).


const InlineRename: Component

Let a User edit a name in place. Bind value and set textAlignment to match the static name. The caller must save or cancel the edit. Issue #1017; DESIGN §34.


const Inspector: Component


const InspectorRow: Component

Add one label and value to InspectorSection. The label appears as dt; put the value in the child snippet. Issue #659; DESIGN §34.


const InspectorSection: Component

Group Inspector content under a named heading. By default, children go inside a description list. Set rows to false for content such as loading or error text. busy sets aria-busy. Issue #659; DESIGN §34.


const ItemCard: Component

Show a non-interactive summary for an item. Set kind and title; optional text and media come from props. The host owns selection and actions. size controls the layout. Issue #822; DESIGN §§38–39.


const ItemPreview: Component


const Kbd: Component


const KEY_ZOOM_STEP: 1.25 = 1.25

The keyboard step (Cmd/Ctrl + and −).


const LinkedHeading: Component


const LOD_HYSTERESIS: 3 = 3

A zoom must pass a threshold by this much to switch, so resting on it never flickers.


const LOD2_HOUR: 44 = 44

Level-of-detail tiers (§39): 1 titles, 2 time and tags (from 44 px an hour), 3 attachment decks (from 84).


const LOD3_HOUR: 84 = 84


const LogEntryEditor: Component


const MAX_HOUR_HEIGHT: 160 = 160


Menu: Component<Props, { }, "surfaceEl">


const MIN_HOUR_HEIGHT: 24 = 24

The smallest, default and largest hour height in CSS pixels.


const MiniMonth: Component


const ModeHeader: Component


const ModeIcon: Component

Show the decorative glyph for a Tab. Set modeId to the Tab ID. The Calendar glyph also shows the current day and updates when that day changes. Issues #1095–#1097; DESIGN §34.


const MonthGrid: Component


const NOTE_LINK_INTENT_REST_MS: 180 = 180

Shared intent timing for delayed prefetch in pointer and keyboard UI paths. A 180 ms rest cancels quick flyovers while giving a deliberate Note link time to warm its route and body (#608, #639).


const NoteMentionsCard: Component


const NoteProperties: Component


const OPENING_MOTION: object

Shared opening choreography for the bottom capsule, menus and popovers. The last staggered item settles at exactly 500 ms: 90 ms + (4 × 25 ms) + 310 ms. Keep the CSS morph on this same contract.

The 1.08 damping ratio is overdamped, so items rise to rest without a bounce. The width/height curve is the shared cubic approximation of easeOutQuint.

Name Type
cap 500
countRoll 180
dampingRatio 1.08
easeOutQuint string
exitFade 120
firstItemDelay 90
itemOffset 12
itemRise 310
itemStagger 25
maxStaggerIndex 4
morph 200

const OverlaySurface: Component


const Pill: Component


const PillGroup: Component


const POINT_ENTRY_MINUTES: 20 = 20

A log entry without an end is a point in time; give it a visual length.


const PopoverSurface: Component


const PrimaryPill: Component


const ProgressiveBlur: Component


const QuickLook: Component


const RECENTRE_MARGIN: 150 = 150

A settled scroll closer than this many days to an edge re-centres.


const RepairList: Component


const REQUEST_NEXT_STEP: "Check your connection, then try again." = "Check your connection, then try again."

The plain next step for a titled failure whose cause the client cannot name (#869). The heading already says what failed, so the message under it says what to do. Callers pass it in place of a sentence that repeats the title.


const RequestState: Component

Show the loading or error state for a request. Retry appears only when both its label and callback are set. Use variant="card" for the shared page Card treatment. Issue #869; DESIGN §34.


const SegmentedControl: Component


const Select: Component


const SelectionBar: Component<Props, { }, "">


const SettingRow: Component


const SidebarSectionHeader: Component


const StatusPill: Component


const TabBar: Component


const TagPill: Component


const TextInput: Component

Show a text field with shared colours and focus styling. Bind value; other native input attributes pass through to the field. Issue #407; DESIGN §3.


const TextView: Component


const THEME_FAMILIES: ThemeFamilyDef[]


const THEME_FAMILY_IDS: ThemeFamilyId[]


const THEME_GROUPS: object[]

Themes grouped by palette scheme for callers that still need the registry view.

Name Type
group ThemeGroup
themes ThemeDef[]

const THEME_IDS: ThemeId[]


const ThemePicker: Component


const THEMES: ThemeDef[]


const TIME_FORMATS: readonly ["system", "24_hour", "12_hour"]


const TIME_ZONE_CHIP_CLASS: "cal-time-zone-chip" = "cal-time-zone-chip"

Shared inline time-zone label contract for Calendar and Daily Log text.


const TimeGrid: Component


const TIMEZONE_CITIES: Readonly<Record<string, TimezoneCity>>


const TimeZoneChip: Component

Show a time zone beside a Calendar time. The chip stays hidden when the zone matches userZone. If userZone is omitted, the User’s system time zone is used for comparison. DESIGN §29 C12 and §34 (Calendar preview).


const TodayButton: Component


const Toggle: Component


const TOOLTIP_GAP: 8 = 8

Space between the trigger and the bubble (px).


const TOOLTIP_MARGIN: 8 = 8

Minimum space between the bubble and a viewport edge (px).


const TooltipLayer: Component<Record<string, never>, { }, "">


const TRACK_DAYS: 2001 = 2001


const UIHeading: Component


const VoicePill: Component

Show idle, requesting, recording, or error controls for a voice memo. The caller manages capture, saving, discard confirmation, and Undo. Issue #617; DESIGN §38.


const VoicePlayback: Component

Play a voice memo with seek and speed controls. Use the same stable key as compact controls so all surfaces share one playback state. If omitted, src is the key. Issues #617, #622, #822; DESIGN §38.


const VoicePlayToggle: Component

Show the shared play or pause button for a voice memo row. The host handles onplay because it can resolve the audio source. Use the same key as VoicePlayback. The button stops clicks from reaching its row. Issue #822; DESIGN §38.


const VoiceRecordingPill: Component

Show recording controls for Composer or Calendar. The caller manages microphone access and saving. This component manages focus and asks for confirmation before Escape discards an active recording. Issue #619; DESIGN §34.


const WARM_WINDOW_MS: 400 = 400

How long the group stays warm after a tooltip closes.


const WEEK_LANE_MINIMUM_WIDTH: 64 = 64

A Week card needs one short title word plus its horizontal padding (#969).


const YearHeatmap: Component

absoluteLink(path): string

Absolute URL for an in-app deep link path (DESIGN §33).

Parameter Type
path string

string


activityCount(day): number

Activity count used by the Year heat map and Month density.

Parameter Type
day CalendarDay | undefined

number


activityDeckLaneWidth(columnWidth, columns, maxLanes, scale): number

Calculate the horizontal space available to one packed Activity lane (#589).

Parameter Type
columnWidth number
columns number
maxLanes number
scale number

number


activityDeckPresentation(laneWidth, verticalSpan, scale, added): object

Keep a deck inside its lane and free time, reserving room for the Added count when it fits (#589, #624).

Parameter Type
laneWidth number
verticalSpan number
scale number
added boolean

object

Name Type
compact boolean
size number

activityPlanDurationMinutes(hourHeight): number

Return the time interval that can display one Activity thumbnail at this zoom (#589).

Parameter Type
hourHeight number

number


activityStacks(day, visible): ActivityStack[]

Busy days (DESIGN §30 C8): one stack per kind, hour and Photo date role. Added Photos use the same Calendar items as Week and Day, so the upload-day deck can show the shared carousel while legacy range rows stay a fallback. Stacks sort by hour and kind so the row reads in time order.

Parameter Type
day CalendarDay | undefined
visible ReadonlySet<ActivityKind>

ActivityStack[]


addDays(date, delta): string

Add N days to a YYYY-MM-DD date string, returning a new YYYY-MM-DD.

Parameter Type
date string
delta number

string


addMonths(date, delta): string

Parameter Type
date string
delta number

string


addYears(date, delta): string

Parameter Type
date string
delta number

string


anchoredScrollTop(options): number

The scroll position that keeps the time under anchorY in place when the hour height changes from from to to. anchorY is the pointer’s offset from the scroller’s top edge; contentTop is the offset of 00:00 from the top of the scrolled content (the sticky header plus padding).

Parameter Type
options { anchorY: number; contentTop: number; from: number; scrollTop: number; to: number; }
options.anchorY number
options.contentTop number
options.from number
options.scrollTop number
options.to number

number


anchorToRect(rect, align?, gap?): RectAnchor

Anchor a floating surface to its trigger’s rect: open gap px below it, flip to gap px above it when there is no room below, and align the surface’s left edge ('left') or right edge ('right') with the trigger’s. The scale-in origin is the trigger’s centre, so the surface grows out of the control that opened it (Apple/Emil origin-aware popovers).

Pure (takes a rect, not an element) so it is unit-testable without layout; FloatingSurface reads the rect at placement time and on resize.

Parameter Type
rect { bottom: number; left: number; right: number; top: number; }
rect.bottom number
rect.left? number
rect.right? number
rect.top? number
align? HAlign
gap? number

RectAnchor


attachmentCountLabel(count): string

Parameter Type
count number

string


attachmentFamily(target, mediaType?, displayName?): AttachmentFamily

Resolve attachment family from API metadata, file extension, or recorder label (#628).

Parameter Type
target string
mediaType? string | null
displayName? string | null

AttachmentFamily


attachmentFileName(target): string

The indexed file name behind an optional attachment label.

Parameter Type
target string

string


attachmentKindLabel(attachment): string

Return the short kind label shown in Calendar preview rows (#628). The full indexed name remains in the shared tooltip so a narrow row stays scannable.

Parameter Type
attachment CalendarAttachment

string


attachmentRefs(attachments): AttachmentRef[]

Build bounded view data from real API attachments without resolving paths on the client.

Parameter Type
attachments readonly CalendarAttachment[]

AttachmentRef[]


attachmentShareHref(attachment): string | null

Build a shareable link only from stable API identities or a web URL (#628).

Parameter Type
attachment CalendarAttachment

string | null


attachmentThumbUrl(hash, size?): string

Build a thumbnail URL from its content hash; callers never pass a path.

Parameter Type
hash string
size? number

string


audioDisplayName(fileName, displayName?): string

Give an audio attachment one display name in the Agenda, preview and Quick Look. Keep the indexed name for tooltips and downloads; only the visible title drops its extension. Recorder names become stable clock labels even when Files adds a unique prefix before the preserved recorder display title.

Parameter Type
fileName string
displayName? string | null

string


buildRange(opts?): string[]

Build the strip’s date range as an ascending list of YYYY-MM-DD strings.

We anchor on today and extend pastDays into the past and futureDays into the future, then widen to whole locale weeks on both ends so the week-boundary markers and the week blob read cleanly. The feed’s loaded days are unioned in via coverDates, so scrolling back through history that predates the default window still lights up matching cells.

Defaults: ~2 weeks back + the current week forward — a sensible, extensible window (DESIGN: “recent ~2 weeks, extensible”).

Parameter Type Description
opts? { coverDates?: string[]; firstDay?: WeekDay; futureDays?: number; pastDays?: number; today?: string; } -
opts.coverDates? string[] -
opts.firstDay? WeekDay First day of the week; defaults to the user’s locale.
opts.futureDays? number -
opts.pastDays? number -
opts.today? string -

string[]


calendarDateInTimeZone(instant, timeZone): string

Stable ISO calendar date for comparing instants inside one named zone.

Parameter Type
instant string | number | Date
timeZone string

string


calendarHref(view, date): string

Parameter Type
view CalendarView
date string

string


calendarItemActions(item, available): CalendarItemAction[]

Build the one ordered action list used by Calendar’s hover card and item context menu. Callers only supply availability; labels, order and groups stay shared as DESIGN §34 and issue #581 require.

Parameter Type
item CalendarActionItem
available CalendarItemActionAvailability

CalendarItemAction[]


calendarLogPartForDay(sourceDate, log, date): CalendarLogPart | null

Return the Log part that belongs in date, while keeping the original Log and its Daily note date intact for links, previews and edits (#469).

Parameter Type
sourceDate string
log CalendarLog
date string

CalendarLogPart | null


calendarSnapEdges(day): CalendarSnapItemEdge[]

Return the stable, visible edges that a drag in one day column can meet. The caller memoizes this by CalendarDay so pointer movement only scans the short edge list; continued Logs keep their source-day identity (#536).

Parameter Type
day CalendarDay

CalendarSnapItemEdge[]


calendarTaskPartForDay(task, date): CalendarTask | null

Add the timed part of a Task to one date. A timed start-to-due pair is a half-open range; one timed property is a point on its property date. When a Task has no explicit placement, its creation minute is a timed point. Old date-only Tasks remain in the all-day lane (#469, #655; DESIGN §30 C12).

Parameter Type
task CalendarTask
date string

CalendarTask | null


calendarTimePartForDay(startDate, start, endDate, end, date): CalendarTimePart | null

Return one visible local-day part of a timed range (#469).

Parameter Type
startDate string
start string
endDate string
end string
date string

CalendarTimePart | null


calendarTimeZone(): string

The selected User zone, or this Installation’s system zone before a switch.

string


calendarWindowRange(window): { from: string; to: string; } | null

Return the inclusive range a MiniMonth should mark, or null for no band.

Parameter Type
window CalendarWindow | null

{ from: string; to: string; } | null


canonicalTimeZone(timeZone): string

Canonical IANA identifier reported by Intl for a supported time zone.

Parameter Type
timeZone string

string


capsuleCountTransition(_node, params?, options?): { css: (t) => string; duration: number; easing?: undefined; } | { css: (t) => string; duration: 180; easing: (t) => number; }

Roll a changed selection count upward while the replacement enters below.

Parameter Type
_node Element
params? { enabled?: boolean; reducedMotion?: boolean; }
params.enabled? boolean
params.reducedMotion? boolean
options? { direction?: "in" | "out" | "both"; }
options.direction? "in" | "out" | "both"

{ css: (t) => string; duration: number; easing?: undefined; }


{ css: (t) => string; duration: 180; easing: (t) => number; }

Name Type
css() (t) => string
duration 180
easing() (t) => number

capsulePaneTransition(_node, params?, _options?): { css: (t) => string; duration: number; easing?: undefined; } | { css: (t) => string; duration: 200; easing: (t) => number; }

Cross-fade panes; keep a returning capsule surface through its measured morph.

Parameter Type
_node Element
params? { enabled?: boolean; morphOut?: boolean; reducedMotion?: boolean; }
params.enabled? boolean
params.morphOut? boolean
params.reducedMotion? boolean
_options? { direction?: "in" | "out" | "both"; }
_options.direction? "in" | "out" | "both"

{ css: (t) => string; duration: number; easing?: undefined; }


{ css: (t) => string; duration: 200; easing: (t) => number; }

Name Type
css() (t) => string
duration 200
easing() (t) => number

cascadeItemDelay(index): number

One capped delay keeps long, scrolling toolbars and surface lists inside the 500 ms cap.

Parameter Type
index number

number


cascadeItemTransition(_node, params?, options?): { css: (t) => string; delay: number; duration: number; easing?: undefined; } | { css: (t) => string; delay?: undefined; duration: 120; easing?: undefined; } | { css: (t) => string; delay: number; duration: 310; easing: (t) => number; }

Svelte transition used by opening surfaces and capsule action rows.

Parameter Type
_node Element
params? { enabled?: boolean; index?: number; reducedMotion?: boolean; visibleOnly?: boolean; }
params.enabled? boolean
params.index? number
params.reducedMotion? boolean
params.visibleOnly? boolean
options? { direction?: "in" | "out" | "both"; }
options.direction? "in" | "out" | "both"

{ css: (t) => string; delay: number; duration: number; easing?: undefined; }


{ css: (t) => string; delay?: undefined; duration: 120; easing?: undefined; }


{ css: (t) => string; delay: number; duration: 310; easing: (t) => number; }

Name Type
css() (t) => string
delay number
duration 310
easing() (t) => number

cascadeOverdamped(t): number

Normalised step response for an overdamped spring. Eight natural time units fit the requested stiffness into the 310 ms rise while retaining ζ = 1.08.

Parameter Type
t number

number


claimAudioFocus(owner): void

Give audio focus to media outside the shared player. The shared player and the previous foreign element pause, so only one sound plays in the app.

Parameter Type
owner { pause: void; }
owner.pause

void


clampHour(height): number

Parameter Type
height number

number


clearInlineAudioPlayback(): void

Release the single player when its owning page leaves the view.

void


configureDateTimePreferences(value): DateTimePreferences

Apply the User’s saved date, time and week-start choices to every UI surface.

Parameter Type
value unknown

DateTimePreferences


copyLink(href): Promise<boolean>

Copy a deep link (DESIGN §33): an in-app path or an absolute URL, resolved against the current origin at call time. Every Copy link surface (the CopyLink control, context menus, sheets) copies through this one function.

Parameter Type
href string

Promise<boolean>


copyText(text): Promise<boolean>

Copy plain text. Resolves true on success and false on any failure.

Parameter Type
text string

Promise<boolean>


createCalendarWindow(anchor, span): CalendarWindow

Create the initial snapshot that the active page wraps in Svelte state.

Parameter Type
anchor string
span number

CalendarWindow


createInteractiveSpring(initial, onUpdate, options?): InteractiveSpring

A single-value, retargetable overdamped spring for finger-driven surfaces. Its natural frequency comes from the capsule’s eight-time-unit response and 310 ms rise. A retarget samples the live position and velocity before it builds the next curve, so interrupted gestures do not jump or restart cold. Keyboard retargets use the same spring as pointer retargets (#611). The shared 500 ms cap also bounds a release with unusually high momentum.

Parameter Type
initial number
onUpdate (value) => void
options? InteractiveSpringOptions

InteractiveSpring


createLatestPointerFrameQueue(requestFrame?, cancelFrame?): object

Coalesce a single pointer’s preview work to its latest sample per animation frame. Pointer-up flushes that sample so a drop keeps the final position (#751).

Parameter Type
requestFrame? (callback) => number
cancelFrame? (handle) => void

object

Name Type
cancel() (pointer?) => void
enqueue() (pointer, update) => void
flush() (pointer) => void

crossesMidnight(entry): boolean

True for a range that ends on the next day (23:00 - 01:00, #99).

Parameter Type
entry { end: string | null; start: string; }
entry.end string | null
entry.start string

boolean


currentDateTimePreferences(): DateTimePreferences

Current formatter preferences, including their reactive Svelte state.

DateTimePreferences


dateFormat(locale, options): DateTimeFormat

A shared, memoised new Intl.DateTimeFormat(locale, options). Use it for every app-owned date label, including fixed-locale chart labels; the cache keeps repeated render and tooltip work off the formatter constructor.

Parameter Type
locale LocalesArgument
options DateTimeFormatOptions

DateTimeFormat


dayDiff(from, to): number

Whole days from from to to (DST-safe: counts calendar days).

Parameter Type
from string
to string

number


draggablePopover(node, initial): object

Parameter Type
node HTMLElement
initial DraggablePopoverOptions

object

Name Type
destroy() () => void
update() (next) => void

durationMs(seconds): number

Convert shared seconds for Svelte and honor reduced motion.

Parameter Type
seconds number

number


emptyDay(date): CalendarDay

Parameter Type
date string

CalendarDay


entryRange(entry): object

Parameter Type
entry { end: string | null; start: string; }
entry.end string | null
entry.start string

object

Name Type
end number
point boolean
start number

eventDotBackground(tags, overrides?): string

The CSS background of an event’s colour dot (EntryCard row marker, Composer event chip). Area tags are an event’s primary categories: several blend into one radial swatch. Without area tags the first visible tag is the fallback (older/imported entries); an untagged event uses the theme accent. Reserved _calternal/* tags never colour a dot. One helper so the chip that names an event always matches the dot on its card.

Parameter Type
tags readonly string[]
overrides? Record<string, string>

string


eventHref(id, date?, sourceId?): string

Build an Event deep link; URL layers use their stable source ID and day.

Parameter Type
id string
date? string
sourceId? string | null

string


eventTint(tags, layerColor?): EventTint

Resolve a tag tint or validated external layer colour for every Calendar surface.

Parameter Type
tags readonly string[]
layerColor? string | null

EventTint


familyForTheme(id): ThemeFamilyId

Return the family that owns a saved palette id.

Parameter Type
id ThemeId

ThemeFamilyId


familyVariants(family, preference): readonly ThemeId[]

Return the variant choices allowed by a saved colour scheme choice (#506, DESIGN §35).

Parameter Type
family ThemeFamilyId
preference ThemeSchemePreference

readonly ThemeId[]


fileGlyphKind(name, mime?, path?): FileGlyphKind

Pick a preview kind from Files’ indexed MIME; path is only for voice-memo identity (#620/#851).

Parameter Type
name string
mime? string | null
path? string | null

FileGlyphKind


fileHref(id): string

Parameter Type
id string

string


filesThumbnailUrl(hash, size?, kind?): string

Build the shared Files thumbnail route with its renderer-specific cache key.

Parameter Type
hash string
size? 256 | 1024
kind? ThumbnailKind

string


findCalendarColumnDateAt(columns, clientX): string | null

Find a rendered date column at a viewport x coordinate without scanning all columns (#751).

Parameter Type
columns readonly CalendarColumnBounds[]
clientX number

string | null


firstVisibleIndex(scrollLeft, columnWidth): number

The first column whose left edge is at or before scrollLeft (snapped within half a pixel).

Parameter Type
scrollLeft number
columnWidth number

number


fixedContainingBlockOrigin(parent): object

The viewport position of the containing block that a position: fixed child of parent would be placed against: { x: 0, y: 0 } for the viewport itself, or the origin of the nearest containing-block ancestor’s padding box, minus its scroll offset (a fixed child scrolls with that ancestor’s content). Subtract this from viewport coordinates before writing top/left. Transforms that scale or rotate are not compensated; menus never sit inside those.

Parameter Type
parent Element | null

object

Name Type
x number
y number

formatClockRange(start, end?, locale?): string

Format one local clock value or a range with the shared spaced en dash (§38, #413).

Parameter Type
start string | null | undefined
end? string | null
locale? LocalesArgument

string


formatClockTime(clock, locale?): string

Format a local-naive clock with the selected cycle. UTC is a formatting anchor, not the User’s zone: these labels must not convert wall times (#549).

Parameter Type
clock string
locale? LocalesArgument

string


formatCompactClockTime(clock, locale?): string

A compact clock label for the Calendar’s now pill, without its day period.

Parameter Type
clock string
locale? LocalesArgument

string


formatDateInTimeZone(instant, timeZone, locale?): string

Format the calendar date for an absolute instant in an explicit time zone. Auto uses this for its next-boundary label so date patterns remain owned by the shared formatter instead of each feature constructing Intl formatters.

Parameter Type
instant string | number | Date
timeZone string
locale? LocalesArgument

string


formatDateParts(date): object

Parameter Type
date string

object

Name Type
day string
relative string
sub string

formatDateRange(startValue, endValue, locale?): string

Format a date range with the selected short-date pattern or system locale. Without a confirmed User time zone, the date values already use this Installation’s local zone; compare their years directly. Resolving the system zone for every visible range cell rebuilt Intl formatters on each picker page turn (#391, DESIGN §47). With an override, compare dates in that zone so ranges that cross its year boundary keep the year in the label.

Parameter Type
startValue DateInput
endValue DateInput
locale? LocalesArgument

string


formatDateTime(value, locale?, timeZone?): string

A short date and selected time, used for edited/modified timestamps.

Parameter Type
value DateInput
locale? LocalesArgument
timeZone? string

string


formatDateTitleParts(value, locale?): object

Calendar header pieces keep the emphasis on the date’s primary unit.

Parameter Type
value DateInput
locale? LocalesArgument

object

Name Type
rest string
short string
strong string
sub string

formatDuration(milliseconds): string

Clock form for a media duration in milliseconds: “0:42” or “1:02:05”.

Parameter Type
milliseconds number

string


formatHour(value, locale?, timeZone?): string

Format an hour label with the selected cycle and no minute field.

Parameter Type
value DateInput
locale? LocalesArgument
timeZone? string

string


formatHours(minutes, locale?, fractionDigits?): string

Format a minute total as locale-aware hours. By default up to 2 decimals with no trailing zeroes (“5.25”, “5”). With fractionDigits, exactly that many decimals (“3.7”, “1.0”), for a caller that needs a fixed-width shape (the analytics delta chip). The decimal separator follows the locale (“3,7” in de).

Parameter Type
minutes number
locale? LocalesArgument
fractionDigits? number

string


formatInstantDateTime(instant, timeZone, locale?): string

Format an absolute instant with the selected date and time preferences.

Parameter Type
instant string | Date
timeZone string
locale? LocalesArgument

string


formatInstantTime(instant, timeZone, locale?): string

Format an absolute instant in the selected time cycle and requested zone.

Parameter Type
instant string | Date
timeZone string
locale? LocalesArgument

string


formatItemDate(value, locale?): string

The compact date for item details (Inspector rows, Task dates, links to a day): short weekday and month, and the year only outside the current year. One format keeps “Linked from”, “Created” and “Where” consistent (#659).

Parameter Type
value DateInput
locale? LocalesArgument

string


formatItemDateTime(value, clock?, locale?): string

formatItemDate plus an optional local-naive clock, joined by DATE_TIME_SEPARATOR.

Parameter Type
value DateInput
clock? string | null
locale? LocalesArgument

string


formatLocalClock(clock, locale?): string

Format a local wall-clock value without changing its time zone.

Parameter Type
clock string
locale? LocalesArgument

string


formatLocaleDate(date, locale?): string

Format a YYYY-MM-DD as a numeric calendar date in the requested locale.

Day-file dates are local-naive values. Constructing the Date with numeric local parts keeps a date near midnight in a negative offset zone from crossing into the previous day, unlike new Date('YYYY-MM-DD'), which is specified as UTC. Passing no locale lets the browser choose its preferred numeric order and separators; the optional locale is useful for tests and deterministic previews.

Parameter Type
date string
locale? LocalesArgument

string


formatLocalTime(date, clock, locale?): string

Format a local-naive clock value on its Daily note date.

The journal API returns start as HH:MM, not as a timestamp. Combining those local-naive fields avoids parsing the clock as an invalid Date and keeps the displayed time tied to the date selected in the DateStrip.

Parameter Type
date string
clock string
locale? LocalesArgument

string


formatLongDate(value, options?, locale?): string

Format a date with localized month and weekday names in the selected or explicit locale order.

Parameter Type
value DateInput
options? LongDateOptions
locale? LocalesArgument

string


formatMonth(value, width?, locale?, timeZone?): string

Parameter Type
value DateInput
width? "long" | "short" | "narrow"
locale? LocalesArgument
timeZone? string

string


formatMonthYear(value, width?, locale?, timeZone?): string

Parameter Type
value DateInput
width? "long" | "short"
locale? LocalesArgument
timeZone? string

string


formatNavDate(date, locale?): string

Compact day label for navigation crumbs: “17 Sep” (day, short month in the user’s locale); null is today.

Parameter Type
date string | null
locale? LocalesArgument

string


formatNumber(value, locale?, options?): string

Locale-aware number grouping for counts and sizes across UI surfaces. A decimal string ("-1234.56") is formatted exactly, without a detour through floating point: Money amounts use this (DESIGN §48).

Parameter Type
value number | `${number}`
locale? LocalesArgument
options? NumberFormatOptions

string


formatRelativeDate(value, now?, locale?): string

Day label for relative surfaces. Older dates follow the chosen short format.

Parameter Type
value DateInput
now? Date
locale? LocalesArgument

string


formatShortDate(value, locale?, preference?): string

Format a date with the User’s selected short-date pattern or system locale.

Parameter Type
value DateInput
locale? LocalesArgument
preference? "system" | "dmy_slash_padded_short" | "mdy_slash_short" | "dmy_slash_short" | "mdy_slash_long" | "dmy_slash_padded_long" | "dmy_dot" | "dmy_dash" | "ymd_slash" | "ymd_dot" | "iso"

string


formatStamp(d?): string

Local-naive YYYY-MM-DD HH:MM:SS stamp for a new day file’s frontmatter. Ported from the CLI’s vault formatStamp so a web-minted day file’s frontmatter matches the CLI byte-for-byte (common daily-note convention; no timezone).

Parameter Type
d? Date

string


formatTime(value, locale?, timeZone?, seconds?): string

Format a time using the selected cycle; include seconds for detailed media metadata.

Parameter Type
value DateInput
locale? LocalesArgument
timeZone? string
seconds? boolean

string


formatTimeGridRangeLabels(start, end, endClock?, locale?): object

The same formatted clock values used by the live drag labels and drop announcement.

Parameter Type
start number
end number
endClock? string
locale? LocalesArgument

object

Name Type
announcement string
combined string
end string
start string

formatTimeZoneLabel(timezone): string

Match Calendar’s readable spelling without changing the stored zone ID.

Parameter Type
timezone string

string


formatWeekday(value, width?, locale?, timeZone?): string

Localized weekday names in the device zone or an explicit time zone.

Parameter Type
value DateInput
width? "long" | "short" | "narrow"
locale? LocalesArgument
timeZone? string

string


formatYear(value, locale?): string

Format a year using the Installation’s locale.

Parameter Type
value DateInput
locale? LocalesArgument

string


fromMinutes(minutes): string

Parameter Type
minutes number

string


gridItemAttachment(item): CalendarAttachment

Adapt the range API’s standalone item to the shared deck without rebuilding a path (#822, §39).

Parameter Type
item GridItem

CalendarAttachment


gridItemHref(entry): string | null

A standalone Calendar item’s own stable link (DESIGN §33): Notes /n/, Photos /p/, other files /f/. Null when the item has no stable ID yet. Calendar previews and the Activity context menu share it (#822).

Parameter Type
entry Pick<GridItem, "kind" | "itemId" | "noteId">

string | null


heatLevels(counts): (count) => 0 | 1 | 2 | 3 | 4

Heat level 0–4 for the Year map. Quantiles keep one busy day from flattening the rest.

Parameter Type
counts readonly number[]

(count) => 0 | 1 | 2 | 3 | 4


hourLabel(hour): string

Hour label follows the User’s selected time format.

Parameter Type
hour number

string


hourLabelFadeMinutes(hourHeightPx, scale?): number

Hide an hour label only when its on-screen box meets the now pill. Caption text is 12 px at scale 1 (--text-caption-base in tokens.css); the pill adds about 2 px of vertical padding and normal line-height, then a 4 px gap keeps the two labels from crowding. Keep this in pixels so zooming the hour does not make the fade zone grow in minutes.

Parameter Type
hourHeightPx number
scale? number

number


inlineAudioClock(key): string

The Compact clock for one key: “0:12 / 1:05” while it owns the player and the length is decoded, otherwise empty. The length is known only after a play or seek, because rows never prefetch audio.

Parameter Type
key string | null | undefined

string


inlineAudioView(key): InlineAudioView

Read the shared state for one key; other keys see an idle player.

Parameter Type
key string | null | undefined

InlineAudioView


instantForLocalDateTime(date, clock, timeZone): Date

Convert a User-zone local day and clock to the matching UTC instant.

Parameter Type
date string
clock string
timeZone string

Date


isCalendarView(value): value is CalendarView

Parameter Type
value string

value is CalendarView


isDarkTheme(id): boolean

Parameter Type
id ThemeId

boolean


isoWeek(date): number

ISO-8601 week number (1..53). The ISO week belongs to the year that owns its Thursday; weeks start on Monday. Standard algorithm, computed from a local-naive date so it matches what the user sees.

Parameter Type
date string

number


isSolarDaylight(instant, coordinates, timeZone): boolean

Return true while the sun is above the apparent sunrise horizon.

Parameter Type
instant number
coordinates SolarCoordinates
timeZone string

boolean


isThemeFamilyId(value): value is ThemeFamilyId

Parameter Type
value unknown

value is ThemeFamilyId


isThemeId(value): value is ThemeId

Parameter Type
value unknown

value is ThemeId


isValidDate(s): boolean

Returns true if s is a structurally and calendrically valid YYYY-MM-DD. The regex rejects non-date shapes; the real-date round-trip rejects February-30, April-31, etc. (Date() normalises those to the next month). Used by the deep-link intent parser to reject malformed /d/<date> params before they cause a silent no-op or a misleading “no entries” announce.

Parameter Type
s string

boolean


isVoiceMemoPath(target): boolean

.webm is ambiguous to extension-only MIME guessers: recorded audio uses that container, while the generic guess is video/webm. The designated Voice memos folder and recorder extensions retain the audio meaning for Calendar cards until Files stores the upload’s actual media type.

Parameter Type
target string

boolean


itemRepresentationKind(kind, name, mediaType?): "log" | "task" | "note" | "file" | "photo" | "link" | "video" | "document" | "mail" | "folder" | "voice"

Map real item metadata into one presentation kind; text identities win over thumbnails (#822).

Parameter Type
kind string
name string
mediaType? string | null

"log" | "task" | "note" | "file" | "photo" | "link" | "video" | "document" | "mail" | "folder" | "voice"


itemSlots(items, minutes?): ItemSlot[]

Standalone items (issue #589) grouped by kind into fixed intervals. Photos added on one date form one deck even when their upload timestamps differ; captured Photos remain grouped near their captured time. Items in one deck are newest first. GridColumn derives the square’s layout interval from zoom; this grouping stays stable while that interval changes.

Parameter Type
items readonly GridItem[]
minutes? number

ItemSlot[]


layoutColumns<T>(items): Placed<T>[]

Apple-style side-by-side layout: items that overlap in time form a cluster, each item takes the first free column in its cluster, and every item in the cluster shares the cluster’s column count so widths line up. layoutEnd may extend a short card to its minimum drawn title line without changing its actual end; at midnight the floor grows upward so it stays inside the day. Neighbouring cards pack against this visual interval (#384, #469, DESIGN §39).

Type Parameter
T extends object
Parameter Type
items readonly T[]

Placed<T>[]


layoutPlanActual<E, L, A>(events, logs, minimumDurationMinutes?, activities?): object

Plan beside actual and activity decks, only where they overlap (Apple’s overlap layout with a Toggl-style twist). Items form clusters of transitive time overlap; a cluster with one item keeps the full column width. Inside a cluster, events (plan) take the left columns. Logs and activity decks share the actual side and pack into the first free lane, so either takes space only while another participant actually overlaps it. layoutStart and layoutEnd describe visual occupancy, including an upward floor at midnight; start and end stay the real times for labels and status (DESIGN §39, #384, #469).

Type Parameter Default type
E extends object -
L extends object -
A extends object never
Parameter Type
events readonly E[]
logs readonly L[]
minimumDurationMinutes? number
activities? readonly A[]

object

Name Type
activities Placed<A>[]
events Placed<E>[]
logs Placed<L>[]

localDate(d?): string

Local-naive YYYY-MM-DD for a Date.

Parameter Type
d? Date

string


lodTier(height, current): 1 | 2 | 3

The tier for height, given the current tier (0 when there is none yet).

Parameter Type
height number
current number

1 | 2 | 3


logEntryHref(date, id): string

A log entry’s stable link: its day plus its block anchor.

Parameter Type
date string
id string | null

string


minimumGridDurationMinutes(hourHeightPx): number

Minimum duration that yields one caption title line at the chosen zoom. Caption is 12 px, line-height is 1.25, vertical padding totals 6 px, and the block stack gap is 2.5 px (tokens.css and GridColumn). UI scale cancels from both pixel terms and hour height. Layout packs against this visual end while labels keep the Log’s real end (#384, DESIGN §39).

Parameter Type
hourHeightPx number

number


monthGrid(date, firstDay): string[]

The 42 dates (six weeks) a month page shows, first weekday first.

Parameter Type
date string
firstDay WeekDay

string[]


motionDurationMs(milliseconds, reducedMotion?): number

Resolve a shared duration, preserving the same timing for every input modality (#611).

Parameter Type
milliseconds number
reducedMotion? boolean

number


movedEnd(entry, start): string | null

The end of an entry moved to start (minutes). The entry keeps its real length, so a range across midnight stays one (#99) although the grid draws it only to midnight. A point entry has no end.

Parameter Type
entry { end: string | null; start: string; }
entry.end string | null
entry.start string
start number

string | null


nearestIndex(scrollLeft, columnWidth): number

The nearest column edge for a released scroll (the snap target).

Parameter Type
scrollLeft number
columnWidth number

number


nextSolarBoundary(instant, coordinates, timeZone): SolarBoundary | null

Find the next sunrise or sunset which changes the current colour scheme.

Parameter Type
instant number
coordinates SolarCoordinates
timeZone string

SolarBoundary | null


normalizeDateTimePreferences(value): DateTimePreferences

Keep unknown settings from a newer or hand-edited settings file harmless.

Parameter Type
value unknown

DateTimePreferences


normalizeWheelDelta(event, linePx?, pagePx?): WheelDelta

Convert a WheelEvent-like value to pixel-equivalent units. The defaults are intentionally conservative browser conventions (16px per line and an 800px page); the action supplies its measured viewport width for page-mode input. Non-finite deltas are treated as zero so malformed synthetic events cannot arm a gesture.

Parameter Type
event Pick<WheelEvent, "deltaX" | "deltaY" | "deltaMode">
linePx? number
pagePx? number

WheelDelta


noteHref(id): string

A note’s stable link: its calternal-id, never its path (DESIGN §33).

Parameter Type
id string

string


nowMinutes(now?): number

Parameter Type
now? Date

number


officeFileLabel(_name, mime?): string | null

Give indexed Office MIME types a short label when no page thumbnail is available.

Parameter Type
_name string
mime? string | null

string | null


opensCalendarItemDirectly(event): boolean

Detect keyboard, touch and double-click opens for standalone Calendar items (#1115, DESIGN §34).

Parameter Type
event MouseEvent

boolean


originFor(date): string

Parameter Type
date string

string


overlapLaneCapacity(columnWidth, minimumLaneWidth, scale?, reservesMore?): number

Return how many overlap lanes fit without shrinking below their declared width. The math mirrors GridColumn’s 8 px edge insets, 2 px lane gap and, when present, 34 px reserved More pill; it uses no text or DOM measurements (DESIGN §39, #427, #969).

Parameter Type
columnWidth number
minimumLaneWidth number
scale? number
reservesMore? boolean

number


overlapLaneWidth(columnWidth, laneCount, scale?, reservesMore?): number

Return the actual block width produced by GridColumn’s lane CSS, including the More pill reservation for overflow clusters (#427, #969).

Parameter Type
columnWidth number
laneCount number
scale? number
reservesMore? boolean

number


paletteForAppearance(mode, lightPalette, darkPalette, systemDark): ThemeId

Resolve a legacy pair while old local settings migrate to a theme family.

Parameter Type
mode "system" | "light" | "dark"
lightPalette ThemeId
darkPalette ThemeId
systemDark boolean

ThemeId


paletteForFamily(family, scheme, variants?): ThemeId

Resolve a family palette, applying its remembered dark variant if present.

Parameter Type
family ThemeFamilyId
scheme "light" | "dark"
variants? Partial<ThemeVariantSelections>

ThemeId


paletteForMode(mode, selected, systemDark): ThemeId

Pick a legacy theme for an old saved system, light, or dark appearance.

Parameter Type
mode "system" | "light" | "dark"
selected ThemeId
systemDark boolean

ThemeId


panelWidthProperty(id): string

Parameter Type
id string

string


parseDate(date): Date

Parameter Type
date string

Date


parseTooltipKeys(value): KbdKey[]

Reads a data-tooltip-keys value back into a combo.

Parameter Type
value string | null | undefined

KbdKey[]


pauseInlineAudioPlayback(): void

Stop the current sound but retain its elapsed position for the visible chip.

void


pauseInlineAudioPlaybackFor(key): void

Pause only when key owns the player, so one surface cannot stop another’s sound.

Parameter Type
key string

void


photoHref(id): string

A photo opens in the Photos viewer over its day (DESIGN §33 /p/<item-id>).

Parameter Type
id string

string


pinchMetrics(a, b): object

One geometry contract for touch pinch owners. Each surface chooses its own zoom bounds and whether a discrete density step or continuous scale fits.

Parameter Type
a { x: number; y: number; }
a.x number
a.y number
b { x: number; y: number; }
b.x number
b.y number

object

Name Type
distance number
x number
y number

placeBeside(rect, size, gap?, viewport?, margin?): { left: number; side: "left" | "right"; top: number; } | null

Beside the anchor (Finder’s Get Info next to the selected item): right of it when the surface fits, else left of it, top-aligned with the anchor and clamped into the viewport. Null when neither side has room (a full-width row on a phone); the caller then falls back to below/above placement.

Parameter Type
rect { left: number; right: number; top: number; }
rect.left number
rect.right number
rect.top? number
size? { h: number; w: number; }
size.h? number
size.w? number
gap? number
viewport? { h: number; w: number; }
viewport.h? number
viewport.w? number
margin? number

{ left: number; side: "left" | "right"; top: number; } | null


placeNearPoint(point, size, options?): NearPointResult

Place a floating surface beside a point, preferring its right side and opening left when the right side does not fit. Below placement flips above the point when needed, then the shared viewport rule clamps every edge. The centre mode keeps chart readouts beside their datum while sharing the same horizontal flip and bounds logic (#421, #504).

Parameter Type
point { x: number; y: number; }
point.x number
point.y number
size? { h: number; w: number; }
size.h? number
size.w? number
options? NearPointOptions

NearPointResult


placeTooltip(trigger, bubble, viewport, side?, obstacles?): TooltipPlacement

Centres the bubble on the trigger, below it by default. It goes above when side asks for it or when there is no room below (the bottom mode tray), and it is clamped inside the viewport. When a caller supplies nearby controls, it tries alternate horizontal and vertical lanes so the tooltip does not hide them.

Parameter Type
trigger Box
bubble { height: number; width: number; }
bubble.height number
bubble.width number
viewport? { height: number; width: number; }
viewport.height? number
viewport.width? number
side? "top" | "bottom" | null
obstacles? readonly Box[]

TooltipPlacement


placeWithinViewport(anchor, size, opts?): PlaceResult

Compute a viewport-clamped { top, left } for a floating element so it never clips outside the visible area.

anchor.y is the hinge shared by both directions: opening down → element top edge = anchor.y opening up → element bottom edge = anchor.y → top = anchor.y − size.h

Callers should pass the natural “just below the trigger” coordinate (e.g. button.bottom + gap) and let this function flip direction automatically when there is not enough room below.

Parameter Type
anchor { x: number; y: number; }
anchor.x number
anchor.y number
size? { h: number; w: number; }
size.h? number
size.w? number
opts? PlaceOptions

PlaceResult

— ⋯ button, right-aligned menu:
const r = btn.getBoundingClientRect();
const { top, left, placement } = placeWithinViewport(
{ x: r.right - menuWidth, y: r.bottom + 6 },
{ w: menuWidth, h: menuHeight },
);
— Long-press at pointer coords:
const { top, left } = placeWithinViewport(
{ x: pointerX, y: pointerY },
{ w: menuWidth, h: menuHeight },
);

portal(node, enabled?): object

Move a whole Svelte branch into the shared overlay layer.

Parameter Type
node HTMLElement
enabled? boolean

object

Name Type
destroy() () => void
update() (next) => void

portalTarget(): HTMLElement | null

Return the shared mount target for framework portals such as React charts.

HTMLElement | null


previewAnchor(node, item): object

Svelte action: register item for this card while it is mounted.

Parameter Type
node HTMLElement
item PreviewItem

object

Name Type
destroy() () => void
update() (next) => void

previewForAnchor(node): PreviewItem | null

The item a registered card shows, or null for any other element.

Parameter Type
node Element

PreviewItem | null


pullActionOutcome(offset, refreshThreshold, updateThreshold): PullActionOutcome

Choose the short-pull refresh or longer update action from the distance the User saw. A pull below the first threshold cancels; update always wins after its second threshold, including when the current build already matches.

Parameter Type
offset number
refreshThreshold number
updateThreshold number

PullActionOutcome


pullDistance(raw, max, reduced?): number

Rubber-band the raw downward finger travel into an indicator offset. We damp progressively (sub-linear) so the pull feels elastic and resists going far — a constant ratio would feel like the content is just glued to the finger.

raw is the downward travel in px (negative/zero ⇒ no pull, returns 0). The damping uses a square-root-ish curve normalized to max so travel approaches but never blows past max. With reduced (prefers-reduced-motion) we skip the elastic curve and clamp linearly to max — no springy overscroll feel, but the gesture still works and the indicator still tracks the finger.

Parameter Type
raw number
max number
reduced? boolean

number


pullDown(node, opts?): object

Svelte action: pull-down-from-top. Dependency-free, same style as swipe (raw Pointer Events, pure decision helpers). The action is purely a GESTURE DETECTOR — it owns no indicator/aria; it emits onmove/oncommit/oncancel and the consumer renders any affordance.

Why it lives on a wrapper node (not window): attaching to the scroll container keeps it scoped and lets overscroll-behavior: contain on #route-content suppress page chaining so our rubber-band is the only one (#718). We arm the gesture ONLY when the drag begins at scroll-top, within the top band (when bandPx is set), or on an explicit allowAwayFromTop surface, AND the first locked axis is a downward ‘y’ — an upward drag, or any mostly-horizontal drag (e.g. the date strip’s own horizontal scroll), is left entirely to the native scroller (we never preventDefault those).

Parameter Type
node HTMLElement
opts? PullDownOpts

object

Name Type
destroy() () => void
update() (next) => void

pullOutcome(offset, threshold): PullOutcome

Decide whether a release commits a refresh. Commits only when the (already rubber-banded) indicator offset reached the threshold. Anything shorter snaps back. Kept separate from pullDistance so the threshold is checked against what the user actually saw travel, not the raw finger delta.

Parameter Type
offset number
threshold number

PullOutcome


readPanelWidth(id, fallback, min, max): number

Read a panel width from this Installation’s local storage (#901, owner resizable-panel rule). Clamp finite saved values to the caller’s bounds; missing, invalid or unavailable storage returns the supplied fallback.

Parameter Type
id string
fallback number
min number
max number

number


recentreShift(first, visible): number

Days to shift the origin by after a settled scroll, or 0.

Parameter Type
first number
visible number

number


releaseAudioFocus(owner): void

Forget a foreign element that left the page, so it is never paused late.

Parameter Type
owner { pause: void; }
owner.pause

void


renderWindow(first, visible, buffer): object

The columns to render: the visible ones plus buffer on each side. Off-screen buffer columns use content-visibility: auto, so they cost DOM, not paint.

Parameter Type
first number
visible number
buffer number

object

Name Type
end number
start number

representationCounts(attachments): object[]

Count each presentation kind once for a short card’s meta line (#822).

Parameter Type
attachments readonly CalendarAttachment[]

object[]


resizableEdge(node, initialOptions): object

Attach pointer and keyboard resizing to an invisible separator (#901). Coalesce drag writes into one animation frame and persist committed widths. Collapse calls the caller without overwriting the last expanded width; double-click resets it. Destroy removes listeners and cancels a queued frame.

Parameter Type
node HTMLElement
initialOptions ResizableEdgeOptions

object

Name Type
destroy() () => void
update() (next) => void

resolveAxis(dx, dy, tol): Axis | null

Decide the locked axis once movement exceeds the tolerance. Returns null while still within the dead zone. Ties (|dx| === |dy|) resolve to ‘y’ so an ambiguous drag favors page scroll over a swipe (never hijack the scroll).

Parameter Type
dx number
dy number
tol number

Axis | null


resolveDefaultTheme(): ThemeId

ThemeId


resolveTimeSnap(input): object

Resolve one edit edge to item boundaries, Now, then the grid step. The six-pixel magnetic band scales with zoom and caps at five minutes so a short hour does not make a wide part of the day feel sticky (#536). Create endpoints also clamp out of item interiors, and keyboard steps stop at a crossed boundary so a non-grid edge is never skipped (#714, §57). short hour does not make a wide part of the day feel sticky. Item edges are sorted by minute/key/edge when the day changes, so each pointer update finds its narrow candidate range with binary search. The resolver expands minute groups outward from the pointer, so an exact match returns after the first eligible edge instead of scanning a dense equal-time group (#751, #536).

Parameter Type
input CalendarSnapInput

object

Name Type
minute number
target CalendarSnapTarget

resolveWheelAxis(dx, dy, tol?, dominance?): Axis | null

Lock a wheel sequence only when horizontal movement clearly dominates. A trackpad often emits a small vertical component beside a horizontal swipe; requiring a ratio keeps that diagonal input in the page scroller. Ties and mostly-vertical movement resolve to y, matching resolveAxis’s scroll-first rule. tol is applied to the accumulated sequence, not one event.

Parameter Type
dx number
dy number
tol? number
dominance? number

Axis | null


scrollLeftForIndex(index, columnWidth): number

The scroll offset for a settled day index at the current column width.

Parameter Type
index number
columnWidth number

number


seekInlineAudioPlayback(key, source, seconds): void

Seek key to seconds. A key that does not own the player loads it paused at that position, so dragging a timeline never starts sound.

Parameter Type
key string
source string | undefined
seconds number

void


setCalendarTimeZoneOverride(timeZone): void

Apply a time zone the User confirmed after travel detection.

Parameter Type
timeZone string | null

void


setCalendarWindow(window, anchor, span?): void

Update the anchor and span through one operation for each navigation.

Parameter Type
window CalendarWindow
anchor string
span? number

void


setInlineAudioRate(rate): void

Set the shared playback speed; it also applies to the next sound.

Parameter Type
rate number

void


sheetDismiss(distance, velocity, threshold?): boolean

A downward sheet drag commits by travel or a deliberate fling. Velocity is in px/s, the same unit returned by createInteractiveSpring. A reverse fling always returns the sheet, even after it crossed the distance threshold.

Parameter Type
distance number
velocity number
threshold? number

boolean


sheetSnap(offset, width, velocity): "open" | "closed"

The edge-swipe sidebar sheet (owner, 2026-09-25): where a released drag settles. offset is the sheet’s translateX (0 = open, -width = closed), velocity px/ms (positive = toward open). A fling decides first (more than 0.5 px/ms either way); otherwise the sheet goes where more than half of it is.

Parameter Type
offset number
width number
velocity number

"open" | "closed"


shouldFadeHourLabel(nowMinutes, hour, hourHeightPx, scale?): boolean

The pure geometry model of TimeGrid’s CSS mask around the now pill.

Parameter Type
nowMinutes number
hour number
hourHeightPx number
scale? number

boolean


shouldShowTimeZoneChip(timezone, userZone?): timezone is string

Hide a zone that matches this User’s device zone, as Calendar previews do.

Parameter Type
timezone string | null | undefined
userZone? string

timezone is string


solarEventsForDate(year, month, day, coordinates, timeZone): SolarEvents

Calculate the apparent sunrise and sunset for one local calendar date.

Parameter Type
year number
month number
day number
coordinates SolarCoordinates
timeZone string

SolarEvents


splitCalendarTimeRange(startDate, start, endDate, end): CalendarTimePart[]

Split a positive timed range into local-day parts without treating a day as 24 elapsed hours. The Calendar stores local date keys, so date stepping stays correct across daylight-saving changes (#469, DESIGN §30 C12). Callers use this only for bounded Calendar ranges; larger event spans use calendarTimePartForDay to ask for the one visible part they need.

Parameter Type
startDate string
start string
endDate string
end string

CalendarTimePart[]


startOfMonth(date): string

Parameter Type
date string

string


startOfWeek(date, firstDay): string

The first day of the week that contains date. Same rule as the core’s analyticsPeriodRange('week', date, firstDay).start (see the file header for why it is repeated here).

Parameter Type
date string
firstDay WeekDay

string


stepDate(view, date, delta): string

Move one page in a view: a day, a week, a month or a year.

Parameter Type
view CalendarView
date string
delta number

string


swipe(node, opts?): object

Parameter Type
node HTMLElement
opts? SwipeOpts

object

Name Type
destroy() () => void
update() (next) => void

swipeOutcome(axisLocked, dx, leftThreshold, rightThreshold): SwipeOutcome

Resolve what a release means given the locked axis + travel. Left and right can use different commit thresholds (the destructive direction wants a larger one — H1). A non-x axis or a drag that never locked yields ‘none’.

Parameter Type
axisLocked Axis | null
dx number
leftThreshold number
rightThreshold number

SwipeOutcome


systemLocale(): string

A localized name for the browser’s current system locale and time zone.

string


systemTimeZone(): string

string


tagColor(tag, overrides?): TagColor

Resolve a tag’s color. overrides maps tag -> a hex/oklch foreground; when present we derive a soft bg from it via color-mix so user picks stay legible.

Parameter Type
tag string
overrides? Record<string, string>

TagColor


tagHref(tag): string

A tag page. /tags/<tag> still redirects here for older links.

Parameter Type
tag string

string


taskHref(id): string

Parameter Type
id string

string


themeDef(id): ThemeDef

Parameter Type
id ThemeId

ThemeDef


themeFamilyDef(id): ThemeFamilyDef

Parameter Type
id ThemeFamilyId

ThemeFamilyDef


timezoneCity(timeZone): TimezoneCity | null

Resolve a browser IANA zone, including a legacy name, to its reference city.

Parameter Type
timeZone string

TimezoneCity | null


timeZoneDateTimeFormatter(timeZone, locale?): DateTimeFormat

Return shared cached numeric parts for solar math and Calendar Event edits. h23 keeps Calendar wall time in the 00:00–23:59 grammar so editing preserves the Event’s zone and date (#421; DESIGN §34).

Parameter Type
timeZone string
locale? LocalesArgument

DateTimeFormat


tip(label, shortcut?, side?, icon?): TooltipAttributes

Attributes that give a control the warm tooltip. side forces a side; without it the bubble goes below the control, or above it when there is no room (the bottom mode tray). icon names a small decorative icon; the trigger keeps its own accessible name.

Parameter Type
label string
shortcut? any
side? "top" | "bottom"
icon? TooltipIconName

TooltipAttributes


toCells(dates, today?, firstDay?): StripCell[]

Map a range of date strings to fully-decorated strip cells.

Parameter Type
dates string[]
today? string
firstDay? WeekDay

StripCell[]


toggleInlineAudioPlayback(key, source?): Promise<void>

Toggle one sound; a new key pauses the previous file before it starts.

Parameter Type
key string
source? string

Promise<void>


toMinutes(time): number

HH:MM → minutes after midnight (NaN-safe: bad input is 0).

Parameter Type
time string

number


tooltipCombo(shortcut): readonly KbdKey[] | null

Parameter Type
shortcut any

readonly KbdKey[] | null


userLocale(): string | undefined

The locale used by System date and week preferences. A custom date order or hour cycle does not change the language used for names; outside a browser (SSR, unit tests) this is undefined, which means the Intl default locale. Keep one accessor so a future language setting changes one line.

string | undefined


viewDates(view, date, firstDay): string[]

The dates a view needs data for.

Parameter Type
view CalendarView
date string
firstDay WeekDay

string[]


viewStart(view, date, firstDay?): string

The date a view opens on when the user asks for “the week (or day) of date” (Today, a view switch, the app’s entry). The Week view’s path date is its first visible day (DESIGN §39: Week can rest on any 7-day window, and a link restores that exact window), so “the week of” starts on the locale’s first weekday. Other views keep the date.

Parameter Type
view CalendarView
date string
firstDay? WeekDay

string


viewTitle(view, date): object

Label the view from its visible anchor. A Week that crosses a month or year names both endpoints so the title cannot suggest a different date window (#609, DESIGN §§33, 34).

Parameter Type
view CalendarView
date string

object

Name Type
rest string
short string
strong string
sub string

weekDates(date, firstDay): string[]

The seven dates of the week that contains date, first day first.

Parameter Type
date string
firstDay WeekDay

string[]


weekStartDay(locale?): WeekDay

First day of the week for locale (default: userLocale()).

Order: a product override for the region (WEEK_START_OVERRIDES) → the engine’s CLDR week info (getWeekInfo(), or the older weekInfo getter; both report 1 = Monday … 7 = Sunday) → the region table above → Monday. The region uses maximize(), so a bare language such as en resolves to its likely region. An invalid locale string falls back to Monday rather than throwing.

Parameter Type
locale? string

WeekDay


wheelZoomFactor(deltaY, deltaMode?): number

The zoom factor for one wheel event with Ctrl or Cmd held. A trackpad pinch arrives as many small ctrlKey wheel deltas; a mouse wheel notch is about 100 px. The clamp keeps one notch near a 1.3× step, and exp() makes a zoom in and the same zoom out cancel exactly.

Parameter Type
deltaY number
deltaMode? number

number

Renames and re-exports ItemCard


Re-exports Menu