Skip to content

v0.3.1

Choose a tag to compare

@benface benface released this 21 Sep 19:51
· 29 commits to main since this release
b0ce6c1

Listbox and select

  • @monowind/ui. A listbox and a select, each a Zag.js machine wired to the grid. The items are the ones the markup marks — their values, their text and their disabled state make the collection — so a list of static items needs nothing but the mount. selectionMode: "multiple" takes several values at once, each keeping its own indicator.
  • A select is the anchored one. The same items and keyboard under a trigger, its value on that trigger and in a hidden native control a form posts, with a clear button beside it.
  • React, Vue, and Svelte. useListbox and useSelect, createListbox and createSelect, alongside the menu, dialog, popover and tooltip hooks.
  • Focus lands where the reader can see. A list draws no focus ring of its own, so taking focus highlights the selection — or the first item where nothing is selected — and brings that row into view.

Borders and blocks draw cleanly

  • Box drawing and block elements fit the row they are painted in. A border's joints are whole and its lines sit where the font sets them against the text, and rows of blocks no longer show a seam between them.
  • A glyph a font draws past its row is clipped to it, so it no longer overlaps the rows above and below.
  • A glyph the font has not got keeps to its cells. A cluster a font lacks is drawn by a substitute at that font's own advance; it is now measured on its own rather than on its range's behalf, so it can no longer carry its drift to the rest of the row.

A theme can say what its font has not got

  • --mw-missing-glyphs lists the characters a themed font lacks, and a glyph set naming one falls back to a glyph the font draws. The period fonts behind dos, amber and bbs have no rounded corners at all, so borders-rounded on one used to draw a corner borrowed from another font, broken from the line beside it; it now draws the square corner those sets already used. The bundled themes declare their own.

Faster

  • Repeats of one block glyph share a painted box. A page of QR codes or ASCII art feels it most: such a page paints 1819 grid spans where it painted 2969, and a pass over that grid — an accessibility audit, say — runs in 1.5 ms against 2.1.
  • Every box shares one style rule, and its style is built once and cloned. A page of 300 bordered boxes reaches interactive in 308 ms against 406.

Also

  • A dialog opens in the cells the window shows, and a pointer press lands on the cell it looks like it lands on.
  • Truncation keeps its ellipsis reachable: focus can still reveal a link past the cut.
  • The playground's editor keeps its text with its pane at any size.