Mixins / foldkit-mixins-ui

Bundles

namespace · packages/mixins-ui/src/bundles/index.ts:6

export * as Bundles from './bundles/index.js'

Each stateful widget's init and update packaged for foldkit-bundle, one file apiece and re-exported by name, so a page reading Bundles.TagsInput keeps that file and no other.

In the guides

Members

Bundles.Accordion

const · packages/mixins-ui/src/bundles/accordion.ts:11

const Accordion: Bundle.Bundle<
  'Accordion',
  {
    readonly open?: readonly string[]
    readonly multiple?: boolean
    readonly collapsible?: boolean
  },
  { readonly open: readonly string[] },
  { readonly _tag: 'Toggled'; readonly id: string },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

An Accordion's open sections for foldkit-bundle, with multiple and collapsible as the args, stated once and kept for every press. A parent reads the open ids from the placed Model (model.faq.open). It holds no view: draw the placed Model with Accordion.view, spreading Accordion.controls.

Bundles.AngleSlider

const · packages/mixins-ui/src/bundles/angleSlider.ts:36

const AngleSlider: Bundle.Bundle<
  'AngleSlider',
  {
    readonly id: string
    readonly value?: number
    readonly step?: number
    readonly largeStep?: number
    readonly marks?: readonly {
      readonly value: number
      readonly label?: string
    }[]
    readonly restrictToMarks?: boolean
  },
  { readonly id: string; readonly value: number; readonly dragging: boolean },
  | { readonly _tag: 'Set'; readonly value: number }
  | { readonly _tag: 'Released' }
  | { readonly _tag: 'Pointed'; readonly angle: number }
  | {
      readonly _tag: 'PressedKey'
      readonly key: string
      readonly shift: boolean
    },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

An AngleSlider's state for foldkit-bundle: the angle and whether a pointer is turning the dial, with the steps and marks of its layout as the args beside id and the starting value. The angle is the dial's own, so a parent reads it from the placed Model (model.heading.value). Keep the layout in one value and give it to AngleSlider.view too, which draws the same steps and marks. It holds no view.

Bundles.Calendar

const · packages/mixins-ui/src/bundles/calendar.ts:15

const Calendar: Bundle.Bundle<"Calendar", { readonly id: string; readonly today: { readonly year: number; readonly month: number; readonly day: number; }; readonly selection?: { readonly _tag: "Multiple"; readonly dates: readonly { readonly year: number; readonly month: number; readonly day: number; }[]; } | { readonly _tag: "Single"; readonly date: Option<{ readonly year: number; readonly month: number; readonly day: number; }>; } | { readonly _tag: "Range"; readonly start: Option<{ readonly year: number; readonly month: number; readonly day: number; }>; readonly end: Option<{ readonly year: number; readonly month: number; readonly day: number; }>; }; readonly months?: 1 | 2; readonly minDate?: { readonly year: number; readonly month: number; readonly day: number; }; readonly maxDate?: { readonly year: number; readonly month: number; readonly day: number; }; readonly disabledDaysOfWeek?: readonly ("Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday")[]; readonly disabledDates?: readonly { readonly year: number; readonly month: number; readonly day: number; }[]; readonly locale?: { readonly firstDayOfWeek: "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday"; readonly monthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string]; readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string]; readonly dayNames …;

A Calendar's state for foldkit-bundle: the month shown, a second month where months is 2, the selection and a range's preview, with Calendar.init's options as the args. The selection is the Calendar's own value, so the Bundle holds it and reports Changed when it holds other days; a parent that only reads model.<field>.selection answers with Bundle.ignore. The mode is the selection arg's tag (Calendar.empty('Range')). It holds no view: draw the placed Model with Calendar.view.

const · packages/mixins-ui/src/bundles/carousel.ts:11

const Carousel: Bundle.Bundle<
  'Carousel',
  {
    readonly id: string
    readonly count: number
    readonly index?: number
    readonly delay?: number
    readonly perView?: number
    readonly loop?: boolean
    readonly autoplay?: boolean
    readonly reducedMotion?: boolean
  },
  {
    readonly id: string
    readonly index: number
    readonly rotation: 'None' | 'Stopped' | 'Rotating'
    readonly hovered: boolean
    readonly delay: number
    readonly turn: number
    readonly counting: boolean
    readonly count: number
    readonly perView: number
    readonly loop: boolean
  },
  | { readonly _tag: 'CompletedShowSlide' }
  | { readonly _tag: 'Chose'; readonly index: number }
  | { readonly _tag: 'Settled'; readonly index: number }
  | { readonly _tag: 'StartedRotation' }
  | { readonly _tag: 'StoppedRotation' }
  | { readonly _tag: 'PointerEntered' }
  | { readonly _tag: 'PointerLeft' }
  | { readonly _tag: 'FocusEntered' }
  | { readonly _tag: 'Elapsed'; readonly turn: number },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A Carousel's slide and rotation for foldkit-bundle, with the layout (count, perView, loop) as args. The layout is kept in the Model, so update and Carousel.view both read it and neither is told again. It holds no view: draw the placed Model with Carousel.view.

Bundles.CascadeSelect

const · packages/mixins-ui/src/bundles/cascadeSelect.ts:49

const CascadeSelect: Bundle.Bundle<
  'CascadeSelect',
  {
    readonly id: string
    readonly config: Config
    readonly value?: readonly string[]
  },
  {
    readonly id: string
    readonly open: boolean
    readonly value: Option.Option<readonly string[]>
    readonly highlighted: readonly string[]
    readonly cramped: boolean
    readonly typeahead: { readonly query: string; readonly generation: number }
  },
  | { readonly _tag: 'Opened' }
  | { readonly _tag: 'Closed' }
  | { readonly _tag: 'Cleared' }
  | { readonly _tag: 'Pressed'; readonly key: string }
  | { readonly _tag: 'CompletedFocusTrigger' }
  | { readonly _tag: 'Entered'; readonly path: readonly string[] }
  | { readonly _tag: 'QueryExpired'; readonly generation: number }
  | { readonly _tag: 'Picked'; readonly path: readonly string[] }
  | { readonly _tag: 'Placed'; readonly cramped: boolean }
  | { readonly _tag: 'Set'; readonly path: readonly string[] }
  | { readonly _tag: 'Highlighted'; readonly path: readonly string[] }
  | { readonly _tag: 'Left' }
  | { readonly _tag: 'CompletedRevealItem' },
  {
    readonly _tag: 'Changed'
    readonly value: Option.Option<readonly string[]>
  },
  never,
  never,
  NoView,
  {},
  {
    set: (
      model: Model,
      path: ReadonlyArray<string>,
    ) => {
      model: {
        readonly id: string
        readonly open: boolean
        readonly value: Option.Option<readonly string[]>
        readonly highlighted: readonly string[]
        readonly cramped: boolean
        readonly typeahead: {
          readonly query: string
          readonly generation: number
        }
      }
    }
  }
>

A CascadeSelect's state for foldkit-bundle: whether it is open, the path the keys are on and the chosen path, with CascadeSelect.init's options and the config the view takes as the args (nodes and the rest, the same object given to CascadeSelect.view). The chosen path is the widget's own value, so the Bundle holds it and reports Changed when it moves; a parent that only reads model.<field>.value answers with Bundle.ignore. helpers.set(path) sets the path from the parent and reports nothing. It holds no view: draw the placed Model with CascadeSelect.view.

Bundles.ColorPicker

const · packages/mixins-ui/src/bundles/colorPicker.ts:20

const ColorPicker: Bundle.Bundle<
  'ColorPicker',
  {
    readonly id: string
    readonly color?: {
      readonly h: number
      readonly s: number
      readonly v: number
      readonly alpha: number
    }
    readonly format?: 'hex' | 'rgb' | 'hsl' | 'oklch'
  },
  {
    readonly id: string
    readonly color: {
      readonly h: number
      readonly s: number
      readonly v: number
      readonly alpha: number
    }
    readonly format: 'hex' | 'rgb' | 'hsl' | 'oklch'
    readonly draft: Option<string>
  },
  | { readonly _tag: 'GotEyedropperColor'; readonly hex: string }
  | { readonly _tag: 'CancelledEyedropper' }
  | {
      readonly _tag: 'PickedPreset'
      readonly color: {
        readonly h: number
        readonly s: number
        readonly v: number
        readonly alpha: number
      }
    }
  | { readonly _tag: 'PointedArea'; readonly x: number; readonly y: number }
  | {
      readonly _tag: 'PressedAreaKey'
      readonly key: string
      readonly shift: boolean
    }
  | { readonly _tag: 'ChangedHue'; readonly hue: number }
  | { readonly _tag: 'ChangedAlpha'; readonly alpha: number }
  | {
      readonly _tag: 'ChangedFormat'
      readonly format: 'hex' | 'rgb' | 'hsl' | 'oklch'
    }
  | { readonly _tag: 'TypedText'; readonly text: string }
  | { readonly _tag: 'CommittedText' }
  | { readonly _tag: 'RevertedText' }
  | { readonly _tag: 'PressedEyedropper' },
  {
    readonly _tag: 'Changed'
    readonly color: {
      readonly h: number
      readonly s: number
      readonly v: number
      readonly alpha: number
    }
  },
  never,
  never,
  NoView,
  {},
  {}
>

A ColorPicker's state for foldkit-bundle: the color, the format it is written in and the text being typed, with ColorPicker.init's options as the args. The color is the picker's own value, so the Bundle holds it and reports Changed when it holds another; a parent that only reads model.<field>.color answers with Bundle.ignore. It holds no view: draw the placed Model with ColorPicker.view, or ColorPicker.popover beside Bundles.Popover.

Bundles.Combobox

const · packages/mixins-ui/src/bundles/combobox.ts:27

const Combobox: Bundle.Bundle<"Combobox", { readonly id: string; readonly text?: string; readonly multiple?: boolean; readonly animated?: boolean; readonly nullable?: boolean; readonly immediate?: boolean; readonly modal?: boolean; readonly selectInputOnFocus?: boolean; }, { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly nullable: boolean; readonly immediate: boolean; readonly selectInputOnFocus: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeActiveItemIndex: Option.Option<number>; readonly activationTrigger: "Pointer" | "Keyboard"; readonly inputValue: string; readonly maybeLastPointerPosition: Option.Option<{ readonly screenX: number; readonly screenY: number; }>; }, { readonly _tag: "CompletedLockScroll"; } | { readonly _tag: "CompletedUnlockScroll"; } | { readonly _tag: "CompletedInertOthers"; } | { readonly _tag: "CompletedRestoreInert"; } | { readonly _tag: "Opened"; readonly maybeActiveItemIndex: Option.Option<number>; } | { readonly _tag: "Closed"; readonly restingInputValue: string; readonly isClearable: boolean; } | { readonly _tag: "ActivatedItem"; readonly index: number; readonly activationTrigger: "Pointer" | "Keyboard"; readonly maybeImmediateSelection: Option.Option<{ readonly item: string; }>; } | { readonly _tag: "Deactiv …;

A Combobox's interaction state for foldkit-bundle: whether it is open, the row the keys are on, the text typed. It never holds the value, which is the application's: answer its ChoiceChange in onOut through the Choice the view is given (City.picked(model.city, out)). It holds no view.

multiple is read by update (choosing leaves a multiple combobox open and flips the item), so it is an arg and must agree with the choice: true for Combobox.many, absent for Combobox.one and Combobox.text.

Bundles.DatePicker

const · packages/mixins-ui/src/bundles/datePicker.ts:14

const DatePicker: Bundle.Bundle<"DatePicker", { readonly id: string; readonly today: { readonly year: number; readonly month: number; readonly day: number; }; readonly selection?: { readonly _tag: "Multiple"; readonly dates: readonly { readonly year: number; readonly month: number; readonly day: number; }[]; } | { readonly _tag: "Single"; readonly date: Option<{ readonly year: number; readonly month: number; readonly day: number; }>; } | { readonly _tag: "Range"; readonly start: Option<{ readonly year: number; readonly month: number; readonly day: number; }>; readonly end: Option<{ readonly year: number; readonly month: number; readonly day: number; }>; }; readonly minDate?: { readonly year: number; readonly month: number; readonly day: number; }; readonly maxDate?: { readonly year: number; readonly month: number; readonly day: number; }; readonly disabledDaysOfWeek?: readonly ("Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday")[]; readonly disabledDates?: readonly { readonly year: number; readonly month: number; readonly day: number; }[]; readonly locale?: { readonly firstDayOfWeek: "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday"; readonly monthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string]; readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string]; readonly dayNames: readonly [string, str …;

A DatePicker's state for foldkit-bundle: upstream's picker (its popover and its calendar), the selection and a range's preview, with DatePicker.init's options as the args. As the Calendar's Bundle does, it holds the selection and reports Changed when it holds other days. The closes arg says whether the pick that makes the selection whole closes the popover (complete, the default) or none does (manual). It holds no view: draw the placed Model with DatePicker.view.

Bundles.Dialog

const · packages/mixins-ui/src/bundles/dialog.ts:27

const Dialog: Bundle.Bundle<
  'Dialog',
  {
    readonly id: string
    readonly focusSelector?: string
    readonly dismissible?: boolean
    readonly isAnimated?: boolean
  },
  {
    readonly id: string
    readonly isOpen: boolean
    readonly isAnimated: boolean
    readonly animation: {
      readonly id: string
      readonly isShowing: boolean
      readonly transitionState:
        | 'Idle'
        | 'EnterStart'
        | 'EnterAnimating'
        | 'LeaveStart'
        | 'LeaveAnimating'
      readonly transitionGeneration: number
    }
    readonly maybeFocusSelector: Option<string>
  },
  | { readonly _tag: 'RequestedOpen' }
  | { readonly _tag: 'RequestedClose' }
  | { readonly _tag: 'CompletedReleaseDialogResources' }
  | {
      readonly _tag: 'GotAnimationMessage'
      readonly message:
        | { readonly _tag: 'Showed' }
        | { readonly _tag: 'Hid' }
        | {
            readonly _tag: 'CompletedWaitForPaint'
            readonly generation: number
          }
        | { readonly _tag: 'EndedAnimation'; readonly generation: number }
    }
  | { readonly _tag: 'SucceededShowDialog' }
  | { readonly _tag: 'FailedShowDialog' }
  | { readonly _tag: 'SucceededAcquireResources' }
  | { readonly _tag: 'FailedAcquireResources' }
  | { readonly _tag: 'CompletedCloseDialog' }
  | { readonly _tag: 'Unmounted' },
  { readonly _tag: 'Opened' } | { readonly _tag: 'Closed' },
  never,
  never,
  NoView,
  {},
  {
    open: (model: UiDialog.Model) => ReturnType<typeof UiDialog.update>
    close: (model: UiDialog.Model) => ReturnType<typeof UiDialog.update>
  }
>

A Dialog's state for foldkit-bundle: upstream's open flag, its animation and its focus target, with id, isAnimated and focusSelector as the args, plus dismissible. It reports Opened and Closed in onOut; the application's own state follows from those.

With dismissible: false (an alert dialog's) Escape, a press on the backdrop and the close button send RequestedClose and the Bundle drops it: only the answers close it, through the placement's helpers.close. It holds no view: draw the placed Model with Dialog.toView.

Bundles.Disclosure

const · packages/mixins-ui/src/bundles/disclosure.ts:11

const Disclosure: Bundle.Bundle<
  'Disclosure',
  { readonly isOpen?: boolean },
  { readonly isOpen: boolean },
  { readonly _tag: 'Toggled'; readonly isOpen: boolean },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A Disclosure's open flag for foldkit-bundle, with isOpen as the arg for how it starts. @foldkit/ui's disclosure is stateless, so the flag is this Bundle's own. A parent reads it from the placed Model (model.details.isOpen). It holds no view: draw the placed Model with Disclosure.view, spreading Disclosure.controls.

Bundles.Drawer

const · packages/mixins-ui/src/bundles/drawer.ts:13

const Drawer: Bundle.Bundle<
  'Drawer',
  {
    readonly id: string
    readonly open?: boolean
    readonly swipe?: {
      readonly from?: 'panel' | 'handle'
      readonly flickSpeed?: number
      readonly closeShare?: number
    }
  },
  {
    readonly id: string
    readonly open: boolean
    readonly drag: Option<{
      readonly size: number
      readonly delta: number
      readonly from: 'grip' | 'handle'
    }>
    readonly dragged: boolean
    readonly swipeFrom: 'panel' | 'handle'
    readonly flickSpeed: number
    readonly closeShare: number
  },
  | { readonly _tag: 'Pressed' }
  | { readonly _tag: 'Dragged'; readonly delta: number }
  | {
      readonly _tag: 'Grabbed'
      readonly size: number
      readonly from: 'grip' | 'handle'
    }
  | {
      readonly _tag: 'Released'
      readonly delta: number
      readonly velocity: number
      readonly completed: boolean
    },
  never,
  never,
  never,
  NoView,
  {},
  {
    open: (model: Model) => {
      model: {
        readonly id: string
        readonly open: boolean
        readonly drag: Option<{
          readonly size: number
          readonly delta: number
          readonly from: 'grip' | 'handle'
        }>
        readonly dragged: boolean
        readonly swipeFrom: 'panel' | 'handle'
        readonly flickSpeed: number
        readonly closeShare: number
      }
    }
    close: (model: Model) => {
      model: {
        readonly id: string
        readonly open: boolean
        readonly drag: Option<{
          readonly size: number
          readonly delta: number
          readonly from: 'grip' | 'handle'
        }>
        readonly dragged: boolean
        readonly swipeFrom: 'panel' | 'handle'
        readonly flickSpeed: number
        readonly closeShare: number
      }
    }
  }
>

A Drawer's state for foldkit-bundle: whether the docked panel is open or peeking, and the drag running, with Drawer.init's options as the args. Nothing is reported: the panel is beside the page, not over it. helpers.open and helpers.close are for a control of the application's. It holds no view: draw the placed Model with Drawer.view.

Bundles.FileDrop

const · packages/mixins-ui/src/bundles/fileDrop.ts:13

const FileDrop: Bundle.Bundle<
  'FileDrop',
  { readonly id: string },
  { readonly id: string; readonly isDragOver: boolean },
  | { readonly _tag: 'EnteredDragZone' }
  | { readonly _tag: 'LeftDragZone' }
  | {
      readonly _tag: 'DroppedFiles'
      readonly files: readonly [File, ...File[]]
    }
  | { readonly _tag: 'DroppedNonFiles' },
  TaggedUnionCaseReturns<{
    readonly ReceivedFiles: ({
      files,
    }: {
      readonly _tag: 'ReceivedFiles'
      readonly files: readonly [File, ...File[]]
    }) => {
      readonly _tag: 'ReceivedFiles'
      readonly files: readonly [File, ...File[]]
    }
    readonly RejectedNonFiles: () => { readonly _tag: 'RejectedNonFiles' }
  }>,
  never,
  never,
  NoView,
  {},
  {}
>

@foldkit/ui's FileDrop for foldkit-bundle: whether a drag hovers the zone, with { id } as the args. A drop is reported as FileDrop.OutMessage.ReceivedFiles (or RejectedNonFiles); the files are the application's to keep. It holds no view: draw the placed Model through h.submodel with upstream's view and FileDrop.toView.

Bundles.FileUpload

const · packages/mixins-ui/src/bundles/fileUpload.ts:14

const FileUpload: Bundle.Bundle<"FileUpload", { readonly id: string; readonly multiple?: boolean; readonly accept?: readonly string[]; readonly maxSize?: number; readonly maxFiles?: number; readonly previews?: boolean; readonly lanes?: number; readonly initial?: readonly { readonly id: string; readonly name: string; readonly size: number; readonly type: string; readonly url: string; }[]; }, { readonly id: string; readonly multiple: boolean; readonly accept: readonly string[]; readonly maxSize: Option<number>; readonly maxFiles: Option<number>; readonly previews: boolean; readonly lanes: number; readonly entries: readonly { readonly id: string; readonly name: string; readonly size: number; readonly type: string; readonly source: { readonly _tag: "Local"; readonly file: File; } | { readonly _tag: "Stored"; readonly url: string; }; readonly preview: Option<string>; readonly attempts: number; readonly status: { readonly _tag: "Failed"; readonly reason: string; readonly retryable: boolean; } | { readonly _tag: "Held"; } | { readonly _tag: "Queued"; } | { readonly _tag: "Uploading"; readonly attempt: number; readonly lane: number; readonly loaded: number; readonly total: number; } | { readonly _tag: "Done"; readonly url: Option<string>; }; }[]; readonly minted: number; readonly dragging: boolean; readonly refusals: readonly ({ readonly _tag: "Kind"; readonly name: string; } | { readonly _tag: "TooLarge"; readonly name: string; readonly size: number; readonly max: number; } | { readonly _tag: "TooMan …;

A FileUpload's state for foldkit-bundle: the files the field holds, each with its status, with FileUpload.init's options as the args. The entries are the widget's own value, so the Bundle holds them and reports Picked and Removed; a parent that only reads model.<field>.entries answers with Bundle.ignore. It holds no view and sends nothing: with lanes above zero the application adds FileUpload.lanes to its Subscriptions, with its own transport.

Bundles.FloatingPanel

const · packages/mixins-ui/src/bundles/floatingPanel.ts:29

const FloatingPanel: Bundle.Bundle<"FloatingPanel", { readonly id: string; readonly rect: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; readonly grid?: number; readonly overflow?: boolean; readonly min?: { readonly width: number; readonly height: number; }; readonly max?: { readonly width: number; readonly height: number; }; readonly open?: boolean; }, { readonly id: string; readonly open: boolean; readonly stage: "default" | "minimized" | "maximized"; readonly rect: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; readonly boundary: { readonly width: number; readonly height: number; }; readonly gesture: Option<{ readonly handle: "s" | "move" | "w" | "n" | "e" | "ne" | "nw" | "se" | "sw"; readonly from: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; }>; readonly limits: { readonly grid?: number; readonly overflow?: boolean; readonly min?: { readonly width: number; readonly height: number; }; readonly max?: { readonly width: number; readonly height: number; }; }; }, { readonly _tag: "CompletedFocus"; } | { readonly _tag: "Closed"; } | { readonly _tag: "Placed"; readonly rect: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; } | { readonly _tag: "Measured"; readonly width: number; readonly height: number; } | { readonly _tag: "GestureStarted"; readonly handle: "s" | "move" | "w" | "n" | "e" | "ne" | "nw" | "se" | "sw …;

A FloatingPanel's window for foldkit-bundle: where it is, its size, its stage and a drag, with FloatingPanel.init's options as the args. The limits are kept in the Model, so update reads them and none is passed again. It reports Raised in onOut when a press or focus lands inside: fold it into the stack's order with FloatingPanel.raise. helpers.open shows and focuses it, helpers.openBeside(openerId, options?) does so beside an opener, helpers.dock(edge, thickness) docks it to an edge of the viewport, and helpers.close shuts it. It holds no view: draw the placed Model with FloatingPanel.view.

Bundles.HoverIntent

const · packages/mixins-ui/src/bundles/hoverIntent.ts:22

const HoverIntent: Bundle.Bundle<"HoverIntent", { readonly openDelay?: number; readonly closeDelay?: number; }, { readonly isOpen: boolean; readonly isTriggerHovered: boolean; readonly isPanelHovered: boolean; readonly maybeFocusLocation: Option<"Trigger" | "Panel">; readonly isDismissed: boolean; readonly openDelay: Duration; readonly closeDelay: Duration; readonly pendingOpenVersion: number; readonly pendingCloseVersion: number; }, { readonly _tag: "BlurredPanel"; } | { readonly _tag: "EnteredTrigger"; } | { readonly _tag: "LeftTrigger"; } | { readonly _tag: "FocusedTrigger"; } | { readonly _tag: "BlurredTrigger"; } | { readonly _tag: "PressedEscape"; readonly source: "Trigger" | "Panel"; } | { readonly _tag: "EnteredPanel"; } | { readonly _tag: "LeftPanel"; } | { readonly _tag: "FocusedPanel"; } | { readonly _tag: "CompletedWaitBeforeOpening"; readonly version: number; } | { readonly _tag: "CompletedWaitBeforeClosing"; readonly version: number; }, { readonly _tag: "Opened"; } | { readonly _tag: "Closed"; }, never, never, NoView, {}, { close: (model: UiHoverIntent.Model) => Readonly<{ model: { readonly isOpen: boolean; readonly isTriggerHovered: boolean; readonly isPanelHovered: boolean; readonly maybeFocusLocation: Option<"Trigger" | "Panel">; readonly isDismissed: boolean; readonly openDelay: Duration; readonly closeDelay: Duration; readonly pendingOpenVersion: number; readonly pendingCloseVersion: number; }; commands?: Commands<{ readonly _tag: "BlurredPanel"; } | { readonly _tag: "Entered …;

A HoverCard's state for foldkit-bundle: upstream's HoverIntent, which opens and closes after delays so the card does not flicker, with openDelay and closeDelay (milliseconds) as the args. It reports Opened and Closed in onOut; helpers.close shuts it at once. It holds no view: draw the placed Model with HoverIntent.toView.

Bundles.ImageCropper

const · packages/mixins-ui/src/bundles/imageCropper.ts:32

const ImageCropper: Bundle.Bundle<"ImageCropper", { readonly id: string; readonly min?: { readonly width: number; readonly height: number; }; readonly shape?: "round" | "rectangle"; readonly aspect?: number; readonly crop?: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; readonly maxZoom?: number; }, { readonly id: string; readonly shape: "round" | "rectangle"; readonly aspect: Option<number>; readonly min: { readonly width: number; readonly height: number; }; readonly zoom: number; readonly maxZoom: number; readonly rotation: 0 | 90 | 180 | 270; readonly initial: Option<{ readonly x: number; readonly y: number; readonly width: number; readonly height: number; }>; readonly viewport: Option<{ readonly width: number; readonly height: number; }>; readonly image: Option<{ readonly natural: { readonly width: number; readonly height: number; }; readonly crop: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; readonly focus: { readonly x: number; readonly y: number; }; }>; readonly drag: Option<{ readonly part: "s" | "image" | "selection" | "w" | "n" | "e" | "ne" | "nw" | "se" | "sw"; readonly crop: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; readonly focus: { readonly x: number; readonly y: number; }; }>; }, { readonly _tag: "Dragged"; readonly part: "s" | "image" | "selection" | "w" | "n" | "e" | "ne" | "nw" | "se" | "sw"; readonly deltaX: number; readonly deltaY …;

An ImageCropper's state for foldkit-bundle: the crop, zoom, turn and drag, with ImageCropper.init's options as the args. An export the application asks for (Message.RequestedExport, sent to the placed child) comes back as ImageCropper.OutMessage: Exported or FailedExport. The crop itself is read from the placed Model with ImageCropper.crop. It holds no view: draw the placed Model with ImageCropper.view.

Bundles.InputCopy

const · packages/mixins-ui/src/bundles/inputCopy.ts:12

const InputCopy: Bundle.Bundle<
  'InputCopy',
  { readonly resetAfter?: number },
  {
    readonly copied: boolean
    readonly failed: boolean
    readonly copies: number
    readonly resetAfter: number
  },
  | { readonly _tag: 'Copied' }
  | { readonly _tag: 'ElapsedReset'; readonly copy: number }
  | { readonly _tag: 'Failed' },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

An InputCopy's state for foldkit-bundle: whether the value shows as copied and for how long, InputCopy.init and update packaged. Answer the button's onCopy with InputCopy.Copy, and fold the ClipboardMessage it yields into this Bundle's Copied and Failed. It holds no view: draw the placed Model with InputCopy.view.

Bundles.Listbox

const · packages/mixins-ui/src/bundles/listbox.ts:20

const Listbox: Bundle.Bundle<"Listbox", { readonly id: string; readonly multiple?: boolean; readonly animated?: boolean; readonly orientation?: "Vertical" | "Horizontal"; readonly modal?: boolean; }, { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly orientation: "Vertical" | "Horizontal"; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeActiveItemIndex: Option.Option<number>; readonly activationTrigger: "Pointer" | "Keyboard"; readonly searchQuery: string; readonly searchVersion: number; readonly maybeLastPointerPosition: Option.Option<{ readonly screenX: number; readonly screenY: number; }>; readonly maybeLastButtonPointerType: Option.Option<string>; }, { readonly _tag: "Closed"; } | { readonly _tag: "CompletedFocusButton"; } | { readonly _tag: "CompletedLockScroll"; } | { readonly _tag: "CompletedUnlockScroll"; } | { readonly _tag: "CompletedInertOthers"; } | { readonly _tag: "CompletedRestoreInert"; } | { readonly _tag: "ClickedButton"; } | { readonly _tag: "IgnoredMouseClick"; } | { readonly _tag: "SuppressedSpaceScroll"; } | { readonly _tag: "DeactivatedItem"; } | { readonly _tag: "CompletedScrollIntoView"; } | { readonly _tag: "CompletedClickItem"; } | { readonly _tag: "SuppressedItemCommit"; } | { readonly _tag: "Opened"; readonly maybeActive …;

A Listbox's interaction state for foldkit-bundle: whether it is open, the row the keys are on, the typeahead. It never holds the value, which is the application's: answer its ChoiceChange in onOut through the Choice the view is given (Fruit.picked(model.fruit, out)). It holds no view.

multiple is read by update (choosing leaves a multiple listbox open and flips the item), so it is an arg and must agree with the choice: true for Listbox.many, absent for Listbox.one.

Bundles.Marquee

const · packages/mixins-ui/src/bundles/marquee.ts:11

const Marquee: Bundle.Bundle<
  'Marquee',
  { readonly id: string; readonly paused?: boolean },
  {
    readonly id: string
    readonly paused: boolean
    readonly content: number
    readonly viewport: number
  },
  | { readonly _tag: 'Paused' }
  | { readonly _tag: 'MeasuredViewport'; readonly size: number }
  | { readonly _tag: 'MeasuredContent'; readonly size: number }
  | { readonly _tag: 'Resumed' },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A Marquee's state for foldkit-bundle: whether it is held, and the two lengths its Mount measures, with Marquee.init's options as the args. Nothing is reported. It holds no view: draw the placed Model with Marquee.view.

const · packages/mixins-ui/src/bundles/menu.ts:18

const Menu: Bundle.Bundle<"Menu", { readonly id: string; readonly rows: readonly { readonly value: string; readonly items?: readonly { readonly value: string; }[] | undefined; }[]; readonly isAnimated?: boolean; readonly isModal?: boolean; }, { readonly menu: { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeActiveItemIndex: Option<number>; readonly activationTrigger: "Pointer" | "Keyboard"; readonly searchQuery: string; readonly searchVersion: number; readonly maybeLastPointerPosition: Option<{ readonly screenX: number; readonly screenY: number; }>; readonly maybeLastButtonPointerType: Option<string>; readonly maybePointerOrigin: Option<{ readonly screenX: number; readonly screenY: number; readonly timeStamp: number; }>; }; readonly submenus: readonly { readonly row: number; readonly value: string; readonly menu: { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeActiveItemIndex: Option<number>; readonly activationTrigger: "Po …;

A Menu's state for foldkit-bundle: whether it is open, the row the keys are on, each submenu, and where it opened at a point. rows are the rows Menu.view is given, of which the Bundle reads only the structure (each row's value, and the items of one that opens a submenu). It answers a chosen row with Selected, in onOut; the checks' state is the application's. It holds no view: draw the placed Model with Menu.view.

const · packages/mixins-ui/src/bundles/menubar.ts:12

const Menubar: Bundle.Bundle<"Menubar", { readonly ids: readonly string[]; readonly isAnimated?: boolean; readonly isModal?: boolean; }, { readonly menus: readonly { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeActiveItemIndex: Option<number>; readonly activationTrigger: "Pointer" | "Keyboard"; readonly searchQuery: string; readonly searchVersion: number; readonly maybeLastPointerPosition: Option<{ readonly screenX: number; readonly screenY: number; }>; readonly maybeLastButtonPointerType: Option<string>; readonly maybePointerOrigin: Option<{ readonly screenX: number; readonly screenY: number; readonly timeStamp: number; }>; }[]; readonly stop: number; }, { readonly _tag: "CompletedFocusTrigger"; } | { readonly _tag: "GotMenu"; readonly index: number; readonly message: { readonly _tag: "Closed"; } | { readonly _tag: "CompletedFocusButton"; } | { readonly _tag: "CompletedLockScroll"; } | { readonly _tag: "CompletedUnlockScroll"; } | { readonly _tag: "CompletedInertOthers"; } | { readonly _tag: "CompletedRestoreInert"; } | { readonly _tag: "ClickedButton"; } | { readonly _tag: "IgnoredMouseClick"; } | { readonly _tag: "SuppressedSpaceScroll"; } | { readonly _tag: "DeactivatedItem"; } | { readonly _tag: "Compl …;

A Menubar's state for foldkit-bundle: one shut menu for each of ids, the first trigger the bar's tab stop, and the keys and hover that move between the menus. It answers a chosen row with Selected (the menu's index and the row's value), in onOut; the checks' state is the application's. It holds no view: draw the placed Model with Menubar.view.

Bundles.MessageScroller

const · packages/mixins-ui/src/bundles/messageScroller.ts:12

const MessageScroller: Bundle.Bundle<
  'MessageScroller',
  { readonly id: string; readonly opens?: 'start' | 'end' },
  {
    readonly id: string
    readonly following: boolean
    readonly unseen: number
    readonly opens: 'start' | 'end'
  },
  | { readonly _tag: 'LeftEnd' }
  | { readonly _tag: 'ReachedEnd' }
  | { readonly _tag: 'Appended'; readonly count: number }
  | { readonly _tag: 'Jumped' }
  | { readonly _tag: 'CompletedScrollToEnd' },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A conversation's scroll state for foldkit-bundle: whether it follows the end, and how many messages came in while it did not. The args are its id and where it opens. The application sends Appended through the placement when a message lands at the end; draw the placed Model with MessageScroller.view, whose Mount reports what the reader does.

const · packages/mixins-ui/src/bundles/nav.ts:11

const Nav: Bundle.Bundle<
  'Nav',
  { readonly id: string },
  { readonly id: string; readonly open: Option<string> },
  | { readonly _tag: 'CompletedFocus' }
  | { readonly _tag: 'Toggled'; readonly panel: string }
  | { readonly _tag: 'Dismissed' }
  | { readonly _tag: 'Escaped'; readonly index: number }
  | {
      readonly _tag: 'MovedTop'
      readonly from: number
      readonly count: number
      readonly move: 'first' | 'next' | 'last' | 'previous'
    }
  | { readonly _tag: 'Entered'; readonly index: number; readonly panel: string }
  | {
      readonly _tag: 'MovedInPanel'
      readonly entry: number
      readonly from: number
      readonly count: number
      readonly move: 'first' | 'next' | 'last' | 'previous'
    },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A navigation menu's state for foldkit-bundle: which panel is open (by its id), with the keys, the focus and the dismissal that go with it. It reports nothing: the current page is the application's, set on each entry's current. It holds no view: draw the placed Model with Nav.view.

Bundles.PasswordInput

const · packages/mixins-ui/src/bundles/passwordInput.ts:11

const PasswordInput: Bundle.Bundle<
  'PasswordInput',
  { readonly visible?: boolean },
  { readonly visible: boolean; readonly capsLock: boolean },
  | { readonly _tag: 'Toggled' }
  | { readonly _tag: 'ReadCapsLock'; readonly reading: Option<boolean> },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A PasswordInput's state for foldkit-bundle: whether the password shows and whether Caps Lock is on, PasswordInput.init and update packaged. The text is the application's own field. It holds no view: draw the placed Model with PasswordInput.view, spreading PasswordInput.controls.

Bundles.Picker

const · packages/mixins-ui/src/bundles/picker.ts:15

const Picker: Bundle.Bundle<"Picker", { readonly id: string; readonly points?: readonly number[]; readonly opensAt?: number; readonly dismissible?: boolean; readonly animated?: boolean; }, { readonly id: string; readonly listbox: { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly orientation: "Vertical" | "Horizontal"; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeActiveItemIndex: Option<number>; readonly activationTrigger: "Pointer" | "Keyboard"; readonly searchQuery: string; readonly searchVersion: number; readonly maybeLastPointerPosition: Option<{ readonly screenX: number; readonly screenY: number; }>; readonly maybeLastButtonPointerType: Option<string>; }; readonly sheet: { readonly dialog: { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeFocusSelector: Option<string>; }; readonly side: "bottom" | "left" | "right" | "top"; readonly points: readonly number[]; readonly at: number; readonly opensAt: number; readonly dismissible: boolean; readonly swipeFrom: "panel" | "handle"; readonly fli …;

A Picker's interaction state for foldkit-bundle: the dropdown's open list and highlight, and the phone's Sheet, one Model and one set of Messages whatever the width. It never holds the value, which is the application's: answer its ChoiceChange in onOut through the Choice the view is given (Sort.picked(model.sort, out)), a choice made in either half arriving the same. The Sheet's swipe is not an arg; Picker.init takes it. It holds no view.

Bundles.Popover

const · packages/mixins-ui/src/bundles/popover.ts:17

const Popover: Bundle.Bundle<"Popover", { readonly id: string; readonly isAnimated?: boolean; readonly isModal?: boolean; readonly contentFocus?: boolean; }, { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly isModal: boolean; readonly contentFocus: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeLastButtonPointerType: Option<string>; }, { readonly _tag: "CompletedFocusButton"; } | { readonly _tag: "CompletedLockScroll"; } | { readonly _tag: "CompletedUnlockScroll"; } | { readonly _tag: "CompletedInertOthers"; } | { readonly _tag: "CompletedRestoreInert"; } | { readonly _tag: "ClickedButton"; } | { readonly _tag: "IgnoredMouseClick"; } | { readonly _tag: "SuppressedSpaceScroll"; } | { readonly _tag: "RequestedOpen"; } | { readonly _tag: "RequestedClose"; } | { readonly _tag: "BlurredPanel"; } | { readonly _tag: "CompletedFocusPanel"; } | { readonly _tag: "CompletedAnchorPopover"; } | { readonly _tag: "CompletedPortalPopoverBackdrop"; } | { readonly _tag: "GotAnimationMessage"; readonly message: { readonly _tag: "Showed"; } | { readonly _tag: "Hid"; } | { readonly _tag: "CompletedWaitForPaint"; readonly generation: number; } | { readonly _tag: "EndedAnimation"; readonly generation: number; }; } | { readonly _tag: "PressedPointerOnButton"; readonly pointerType: string; …;

A Popover's state for foldkit-bundle: upstream's open flag, animation and focus, with UiPopover.init's options as the args. It reports Opened and Closed in onOut; helpers.close shuts it from a control inside the panel. It holds no view: draw the placed Model with Popover.toView.

Bundles.RadioGroup

const · packages/mixins-ui/src/bundles/radioGroup.ts:12

const RadioGroup: Bundle.Bundle<
  'RadioGroup',
  Readonly<{ id: string }>,
  { readonly id: string; readonly maybeFocusedIndex: Option<number> },
  | {
      readonly _tag: 'SelectedOption'
      readonly index: number
      readonly value: string
    }
  | { readonly _tag: 'FocusedOption'; readonly index: number }
  | { readonly _tag: 'CompletedFocusOption' },
  Readonly<{
    readonly _tag: 'Selected'
    readonly value: string
    readonly index: number
  }>,
  never,
  never,
  NoView,
  {},
  {}
>

A RadioGroup's interaction state for foldkit-bundle: the focus cursor, with id as the arg. The chosen value is the application's: answer the Selected OutMessage in onOut and give it back as RadioGroup.view's value. It holds no view.

Bundles.Resizable

const · packages/mixins-ui/src/bundles/resizable.ts:12

const Resizable: Bundle.Bundle<
  'Resizable',
  {
    readonly min?: number
    readonly max?: number
    readonly step?: number
    readonly collapsible?: 'first' | 'second'
    readonly collapsedTo?: number
    readonly share?: number
  },
  {
    readonly bounds: {
      readonly min?: number
      readonly max?: number
      readonly step?: number
      readonly collapsible?: 'first' | 'second'
      readonly collapsedTo?: number
    }
    readonly share: number
    readonly from: Option<number>
    readonly size: number
    readonly restore: Option<number>
  },
  | { readonly _tag: 'Toggled' }
  | { readonly _tag: 'Measured'; readonly size: number }
  | { readonly _tag: 'DragStarted' }
  | { readonly _tag: 'Dragged'; readonly delta: number }
  | { readonly _tag: 'DragEnded' }
  | { readonly _tag: 'Set'; readonly share: number },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A Resizable's split for foldkit-bundle: the first panel's share, a drag and a collapse, with the bounds as args beside the starting share. The bounds are kept in the Model, so update and Resizable.view both read them and neither is told again. It holds no view: draw the placed Model with Resizable.view.

Bundles.Sheet

const · packages/mixins-ui/src/bundles/sheet.ts:13

const Sheet: Bundle.Bundle<"Sheet", { readonly id: string; readonly side?: "bottom" | "left" | "right" | "top"; readonly points?: readonly number[]; readonly opensAt?: number; readonly dismissible?: boolean; readonly isAnimated?: boolean; readonly swipe?: { readonly from?: "panel" | "handle"; readonly flickSpeed?: number; readonly closeShare?: number; }; }, { readonly dialog: { readonly id: string; readonly isOpen: boolean; readonly isAnimated: boolean; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeFocusSelector: Option<string>; }; readonly side: "bottom" | "left" | "right" | "top"; readonly points: readonly number[]; readonly at: number; readonly opensAt: number; readonly dismissible: boolean; readonly swipeFrom: "panel" | "handle"; readonly flickSpeed: number; readonly closeShare: number; readonly drag: Option<{ readonly size: number; readonly delta: number; }>; }, { readonly _tag: "Dragged"; readonly delta: number; } | { readonly _tag: "GotDialog"; readonly message: { readonly _tag: "RequestedOpen"; } | { readonly _tag: "RequestedClose"; } | { readonly _tag: "CompletedReleaseDialogResources"; } | { readonly _tag: "GotAnimationMessage"; readonly message: { readonly _tag: "Showed"; } | { readonly _tag: "Hid"; } | { readonly _tag: "CompletedWaitForPaint"; readonly generation: number; } | { readonly _tag: "En …;

A Sheet's state for foldkit-bundle: an upstream Dialog with the edge it comes from, the points it rests at and the drag running, with Sheet.init's options as the args. It reports the Dialog's Opened and Closed in onOut; helpers.open and helpers.close are the buttons of the application's. It holds no view: draw the placed Model with Sheet.view.

Bundles.SignaturePad

const · packages/mixins-ui/src/bundles/signaturePad.ts:33

const SignaturePad: Bundle.Bundle<"SignaturePad", { readonly id: string; readonly pointers?: readonly ("mouse" | "pen" | "touch")[]; readonly pen?: { readonly size?: number; readonly thinning?: number; readonly smoothing?: number; }; }, { readonly id: string; readonly pen: { readonly size: number; readonly thinning: number; readonly smoothing: number; }; readonly space: Option<{ readonly width: number; readonly height: number; }>; readonly strokes: readonly { readonly points: readonly { readonly x: number; readonly y: number; readonly pressure: number; }[]; readonly pressure: boolean; }[]; readonly undone: readonly { readonly points: readonly { readonly x: number; readonly y: number; readonly pressure: number; }[]; readonly pressure: boolean; }[]; readonly pointers: readonly ("mouse" | "pen" | "touch")[]; readonly drawing: Option<{ readonly points: readonly { readonly x: number; readonly y: number; readonly pressure: number; }[]; readonly pressure: boolean; }>; readonly typed: string; }, { readonly _tag: "Cleared"; } | { readonly _tag: "Typed"; readonly text: string; } | { readonly _tag: "Measured"; readonly width: number; readonly height: number; } | { readonly _tag: "FailedExport"; readonly reason: string; } | { readonly _tag: "Began"; readonly point: { readonly x: number; readonly y: number; readonly pressure: number; }; readonly pointerType: string; readonly width: number; readonly height: number; } | { readonly _tag: "Extended"; readonly points: readonly { readonly x: number; readonly y: nu …;

A SignaturePad's state for foldkit-bundle: the strokes, the stroke under way and a typed name, with SignaturePad.init's options as the args. A PNG the application asks for (Message.RequestedPng, sent to the placed child) comes back as SignaturePad.OutMessage: ExportedPng or FailedExport. Whether it is signed is SignaturePad.isEmpty of the placed Model, and its SVG toSvg. It holds no view: draw the placed Model with SignaturePad.view.

Bundles.Tabs

const · packages/mixins-ui/src/bundles/tabs.ts:13

const Tabs: Bundle.Bundle<
  'Tabs',
  Readonly<{ id: string; activationMode?: UiTabs.ActivationMode }>,
  {
    readonly id: string
    readonly maybeFocusedIndex: Option<number>
    readonly activationMode: 'Automatic' | 'Manual'
  },
  | {
      readonly _tag: 'SelectedTab'
      readonly index: number
      readonly value: string
    }
  | { readonly _tag: 'FocusedTab'; readonly index: number }
  | { readonly _tag: 'CompletedFocusTab' },
  Readonly<{
    readonly _tag: 'Selected'
    readonly value: string
    readonly index: number
  }>,
  never,
  never,
  NoView,
  {},
  {}
>

Tabs' interaction state for foldkit-bundle: the focus cursor, and whether a focused tab is chosen as it is reached (Automatic) or on Enter (Manual), with id and activationMode as the args. The chosen value is the application's: answer the Selected OutMessage in onOut and give it back as Tabs.view's value. It holds no view.

Bundles.TagsInput

const · packages/mixins-ui/src/bundles/tagsInput.ts:12

const TagsInput: Bundle.Bundle<
  'TagsInput',
  {
    readonly id: string
    readonly tags?: readonly string[]
    readonly max?: number
    readonly delimiter?: string
  },
  {
    readonly id: string
    readonly tags: readonly string[]
    readonly draft: string
    readonly delimiter: string
    readonly max: Option<number>
    readonly refusal: Option<
      | { readonly _tag: 'Repeat'; readonly tag: string }
      | { readonly _tag: 'Empty' }
      | { readonly _tag: 'Full'; readonly max: number }
    >
    readonly refusals: number
    readonly commits: number
    readonly chip: Option<string>
    readonly added: readonly string[]
  },
  | { readonly _tag: 'CompletedFocus' }
  | { readonly _tag: 'Typed'; readonly text: string; readonly drawn: number }
  | { readonly _tag: 'Committed' }
  | { readonly _tag: 'BackspacedEmpty' }
  | { readonly _tag: 'Removed'; readonly tag: string }
  | { readonly _tag: 'FocusMoved'; readonly chip: Option<string> },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A TagsInput's state for foldkit-bundle: TagsInput.init and update packaged, with init's options as the args. The tags are the widget's own value, so a parent reads them from the placed Model (model.labels.tags) and there is nothing to answer. It holds no view: draw the placed Model with TagsInput.view.

Bundles.ThinkingSteps

const · packages/mixins-ui/src/bundles/thinkingSteps.ts:10

const ThinkingSteps: Bundle.Bundle<
  'ThinkingSteps',
  { readonly multiple?: boolean; readonly openSteps?: readonly string[] },
  { readonly open: Option<boolean>; readonly openSteps: readonly string[] },
  | { readonly _tag: 'Toggled'; readonly open: boolean }
  | { readonly _tag: 'ToggledStep'; readonly id: string },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A trace's openness for foldkit-bundle: whether the reader opened or shut it (none follows the work) and which steps' details are open, with multiple as the arg, stated once. Draw the placed Model with ThinkingSteps.view, spreading ThinkingSteps.controls.

Bundles.Timer

const · packages/mixins-ui/src/bundles/timer.ts:12

const Timer: Bundle.Bundle<
  'Timer',
  {
    readonly id: string
    readonly duration?: number
    readonly countdown?: boolean
    readonly interval?: number
  },
  {
    readonly id: string
    readonly countdown: boolean
    readonly duration: Option<number>
    readonly interval: number
    readonly elapsed: number
    readonly since: Option<number>
    readonly turn: number
  },
  | {
      readonly _tag: 'Pressed'
      readonly action: 'reset' | 'start' | 'pause' | 'resume' | 'restart'
    }
  | {
      readonly _tag: 'Acted'
      readonly action: 'reset' | 'start' | 'pause' | 'resume' | 'restart'
      readonly at: number
    }
  | { readonly _tag: 'Ticked'; readonly turn: number; readonly at: number },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A Timer's state for foldkit-bundle: the count, its clock reading and the turn, with Timer.init's options as the args. A countdown needs its duration; a stopwatch may stop at one. Its Commands read Effect's Clock and nothing is reported: the application reads Timer.phase of the placed Model for done. It holds no view: draw the placed Model with Timer.view.

Bundles.Toast

const · packages/mixins-ui/src/bundles/toast.ts:15

const Toast: Bundle.Bundle<"Toast", { readonly id: string; readonly direction?: "ltr" | "rtl"; readonly position?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top-center" | "bottom-center"; readonly max?: number; readonly duration?: number; readonly threshold?: number; }, { readonly id: string; readonly position: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top-center" | "bottom-center"; readonly direction: "ltr" | "rtl"; readonly duration: number; readonly max: number; readonly threshold: number; readonly entries: readonly { readonly id: string; readonly type: "default" | "success" | "warning" | "error" | "info" | "loading"; readonly title: string; readonly description: Option<string>; readonly actions: readonly { readonly label: string; readonly value: string; }[]; readonly cancel: Option<string>; readonly duration: Option<number>; readonly remaining: number; readonly countdown: { readonly _tag: "Stopped"; } | { readonly _tag: "Starting"; } | { readonly _tag: "Running"; readonly since: number; }; readonly version: number; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly swipe: Option<{ readonly axis: "x" | "y" | "none"; readonly x: number; readonly y: number; }>; readonly swiped: boolean; }[]; readonly next: number; readonly pointer: boolean; readonly touch: boolean; readonly focus: bo …;

A Toast stack's state for foldkit-bundle: the toasts, newest first, and what holds the stack, with Toast.init's options as the args. A toast's action says Acted (its id and the action's value) in onOut. The application raises, settles and dismisses toasts with the placement's helpers: they take the stack's Model and what Toast.show, Toast.settle and Toast.dismiss take, and return the Model with the Commands wrapped as the placement wraps the stack's own. It holds no view: draw the placed Model with Toast.view.

Bundles.Toolbar

const · packages/mixins-ui/src/bundles/toolbar.ts:10

const Toolbar: Bundle.Bundle<
  'Toolbar',
  { readonly current?: string },
  { readonly current: string | null },
  { readonly _tag: 'Focused'; readonly id: string },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A Toolbar's tab stop for foldkit-bundle: the control focused last, which Tab comes back to. Pass the placed Model as roving and Toolbar.focused as onFocus. It holds no view, and the controls are the application's own.

Bundles.Tooltip

const · packages/mixins-ui/src/bundles/tooltip.ts:11

const Tooltip: Bundle.Bundle<
  'Tooltip',
  { readonly id: string; readonly showDelay?: number },
  {
    readonly id: string
    readonly isOpen: boolean
    readonly isHovered: boolean
    readonly isFocused: boolean
    readonly isDismissed: boolean
    readonly showDelay: Duration
    readonly pendingShowVersion: number
    readonly maybeLastPointerType: Option<string>
  },
  | { readonly _tag: 'EnteredTrigger' }
  | { readonly _tag: 'LeftTrigger' }
  | { readonly _tag: 'FocusedTrigger' }
  | { readonly _tag: 'BlurredTrigger' }
  | { readonly _tag: 'PressedEscape' }
  | { readonly _tag: 'PressedPointerOnTrigger'; readonly pointerType: string }
  | { readonly _tag: 'CompletedWaitBeforeShowing'; readonly version: number }
  | { readonly _tag: 'CompletedAnchorTooltip' },
  { readonly _tag: 'Hidden' } | { readonly _tag: 'Shown' },
  never,
  never,
  NoView,
  {},
  {}
>

A Tooltip's state for foldkit-bundle: upstream's hover and focus intent, with id and showDelay (milliseconds) as the args. It reports Shown and Hidden in onOut. It holds no view: draw the placed Model with Tooltip.toView.

Bundles.Tour

const · packages/mixins-ui/src/bundles/tour.ts:12

const Tour: Bundle.Bundle<"Tour", { readonly id: string; readonly steps?: readonly { readonly title: string; readonly description: string; readonly placement?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"; readonly target?: string; }[]; }, { readonly id: string; readonly open: boolean; readonly steps: readonly { readonly title: string; readonly description: string; readonly placement?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"; readonly target?: string; }[]; readonly step: number; readonly missing: Option<number>; }, { readonly _tag: "Next"; } | { readonly _tag: "Pressed"; readonly key: string; } | { readonly _tag: "Placed"; } | { readonly _tag: "Back"; } | { readonly _tag: "Skipped"; } | { readonly _tag: "Spotlit"; readonly target: string; readonly found: boolean; } | { readonly _tag: "CompletedShowStep"; }, { readonly _tag: "Ended"; readonly completed: boolean; }, never, never, NoView, {}, { start: (model: Model) => Readonly<{ model: { readonly id: string; readonly open: boolean; readonly steps: readonly { readonly title: string; readonly description: string; readonly placement?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"; readonly target?: string; }[]; readonly ste …;

A Tour's walk for foldkit-bundle: the steps and the current one, with Tour.init's options as the args. The steps are kept in the Model, so update and Tour.view both read them and neither is told again. It reports Ended { completed } in onOut; helpers.start starts it (over again if it runs). It holds no view: draw the placed Model with Tour.view.

Bundles.TreeView

const · packages/mixins-ui/src/bundles/treeView.ts:55

const TreeView: Bundle.Bundle<
  'TreeView',
  {
    readonly id: string
    readonly nodes: readonly TreeStructureNode[]
    readonly open?: readonly string[]
    readonly checked?: readonly string[]
    readonly checkable?: boolean
  },
  {
    readonly id: string
    readonly current: Option<string>
    readonly open: readonly string[]
    readonly selected: Option<string>
    readonly checked: readonly string[]
    readonly checkable: boolean
    readonly typeahead: { readonly query: string; readonly generation: number }
  },
  | { readonly _tag: 'Checked'; readonly id: string }
  | { readonly _tag: 'Pressed'; readonly key: string }
  | { readonly _tag: 'Focused'; readonly id: string }
  | { readonly _tag: 'Clicked'; readonly id: string }
  | { readonly _tag: 'QueryExpired'; readonly generation: number }
  | { readonly _tag: 'CompletedFocusItem' },
  never,
  never,
  never,
  NoView,
  {},
  {}
>

A TreeView's state for foldkit-bundle: the current, open, chosen and checked rows, with the tree's structure and checkable as the args, so neither is given to update and the view again. The open and checked ids are the tree's own, so a parent reads them from the placed Model. It holds no view: draw the placed Model with TreeView.view, giving it the same tree (with its icons, content and actions).

Bundles.VirtualList

const · packages/mixins-ui/src/bundles/virtualList.ts:50

const VirtualList: Bundle.Bundle<"VirtualList", { readonly id: string; readonly rowHeightPx: number; readonly initialScrollTop?: number; readonly followEnd?: { readonly thresholdPx?: number; }; readonly nearEndPx?: number; }, { readonly id: string; readonly rowHeightPx: number; readonly scrollTop: number; readonly measurement: { readonly _tag: "Measured"; readonly containerWidth: number; readonly containerHeight: number; } | { readonly _tag: "Unmeasured"; }; readonly viewportAnchor: { readonly _tag: "Offset"; readonly scrollTop: number; } | { readonly _tag: "End"; } | { readonly _tag: "Row"; readonly key: string; readonly index: number; readonly viewportOffset: number; }; readonly measuredRowHeights: { readonly [x: string]: number; }; readonly layoutVersion: number; readonly initialScroll: { readonly _tag: "Applied"; } | { readonly _tag: "Pending"; readonly target: { readonly _tag: "End"; } | { readonly _tag: "Key"; readonly key: string; } | { readonly _tag: "Offset"; readonly offset: number; } | { readonly _tag: "Index"; readonly index: number; }; readonly alignment: "Start" | "End" | "Center" | "Nearest"; }; readonly endBehavior: { readonly _tag: "PreserveAnchor"; } | { readonly _tag: "Follow"; readonly thresholdPx: number; }; readonly pendingScroll: { readonly _tag: "Idle"; } | { readonly _tag: "Pending"; readonly request: { readonly _tag: "Target"; readonly target: { readonly _tag: "End"; } | { readonly _tag: "Key"; readonly key: string; } | { readonly _tag: "Offset"; readonly offset: numbe …;

A VirtualList's scroll state for foldkit-bundle: upstream's Model, with init's options as the args. With nearEndPx, it reports NearEnd in onOut when a scroll brings the end of the list that close to the view, where an infinite list loads its next page. helpers.scrollToIndex, scrollToKey, scrollToEnd and informItemsChanged are upstream's. It holds no view: draw the placed Model with VirtualList.view.

Bundles.WindowList

const · packages/mixins-ui/src/bundles/windowList.ts:11

const WindowList: Bundle.Bundle<"WindowList", { readonly id: string; readonly estimatedHeight: number; readonly from?: number; readonly unmeasured?: "estimate" | "mean"; readonly overscan?: number; readonly viewportHeight?: number; }, { readonly id: string; readonly estimatedHeight: number; readonly unmeasured: "estimate" | "mean"; readonly overscan: number; readonly heights: { readonly [x: string]: number; }; readonly viewport: { readonly top: number; readonly height: number; }; readonly from: number; readonly held: Option<string>; readonly placed: boolean; }, { readonly _tag: "CompletedReveal"; } | { readonly _tag: "Placed"; readonly top: number; readonly height: number; } | { readonly _tag: "Measured"; readonly rows: readonly { readonly key: string; readonly height: number; }[]; } | { readonly _tag: "Focused"; readonly key: Option<string>; } | { readonly _tag: "Found"; readonly index: number; }, never, never, never, NoView, {}, { reveal: (model: Model, index: number, align?: Align) => { model: { readonly id: string; readonly estimatedHeight: number; readonly unmeasured: "estimate" | "mean"; readonly overscan: number; readonly heights: { readonly [x: string]: number; }; readonly viewport: { readonly top: number; readonly height: number; }; readonly from: number; readonly held: Option<string>; readonly placed: boolean; }; commands: Readonly<{ name: "WindowList.Reveal"; args: { readonly id: string; readonly index: number; readonly align: "start" | "center" | "end" | "nearest"; }; effect: Effec …;

A WindowList's state for foldkit-bundle: the measured heights, where the viewport lies and the row holding focus, with WindowList.init's options as the args. helpers.reveal(index, align?) scrolls a row into view. It holds no view: draw the placed Model with WindowList.view.