Skip to content

Feat/widgets pipeline - #305

Merged
SlDo merged 22 commits into
mainfrom
feat/widgets-pipeline
Nov 15, 2026
Merged

SlDo merged 22 commits into
mainfrom
feat/widgets-pipeline

Conversation

@SlDo

@SlDo SlDo commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Add @vega-ui/core, the framework-free widget pipeline: event → normalize → step(state, input) → { state, actions } → output(state) → DOM. State, inputs, steps, actions and output are plain data and pure functions, so a widget runs and is tested in node with simulate from @vega-ui/core/test.
The core ships the roving, selection, typeahead and grid fragments and the DOM adapter connect, which builds inputs from events, writes the output and executes the actions.

Add @vega-ui/widgets with the logic of the composite components, one entry point per widget (@vega-ui/widgets/select), and run the components of @vega-ui/react on it: Listbox, Select, Grid, the pickers, Calendar, the date, time, number, phone, pin and password fields, Slider, Sheet, Drawer, Dialog, Popover, Tooltip, Collapsible, Accordion, Avatar, Checkbox, PageControl and the snap scrollers. The React adapter (useWidget, useOutput, useItem) lives in the ui internals; react-kit and the hooks and helpers the widgets replace are dropped. Phone numbering moves to @vega-ui/i18n.

Bring core and widgets in line with the architecture requirements:

  • invariants by source: a step that breaks one throws in strict mode, options that break one are repaired silently, repair(state, before)
  • lifecycle.options carries the names of the changed options, so a browser close stays final
  • typed part names from state({ parts }) and typed command payloads from command()(name)
  • every throw of a step, invariant, selector or paint reaches onError
  • fixes in Select, Popover, Tooltip, Grid, SnapScroller, PageControl, NumberField, Sheet, Progress and the selection fragment

Also:

  • document the widget architecture, add a guide to writing widgets, follow the rebuilt components on the docs site
  • target ES2022, lint pure code for browser globals and DOM types
  • run the core tests in CI, update Playwright and its image to 1.65.1
  • make the Tooltip focus tests and the awaitAnimations test deterministic

SlDo added 22 commits November 15, 2026 04:41
State shapes with owned, internal and observed values, steps and actions as
data, output parts with the live and props channels, invariants, the roving,
selection, typeahead and grid fragments, the DOM adapter `connect` and
`simulate` from `@vega-ui/core/test` for node tests. The store moves here
from react-kit.
… numbering

- hooks: remove useControlledState, useDragGesture, useFormReset,
  useScrollSnap, useSelection and the map and observer hooks only the old
  components used
- utils: remove the matrix, grid and bimap structures and the DOM helpers the
  core adapter took over; add createKeyMatcher, waitForAnimations and
  expandTwoDigitYear; template dates and times no longer clamp to min and max
- i18n: PhoneNumbering adapter on libphonenumber-js
One entry point per widget, each exporting what an adapter needs to drive it.
The masks, the drag and the date rules are shared inside the package, and
every widget is tested in node on `simulate`.
Components become thin adapters over their widgets (useWidget, useOutput,
useSnapshot), and react-kit folds into the ui internals. Calendar, the day,
month and year pickers and the date fields are rebuilt on Grid; Dialog, Drawer
and Sheet run on the native dialog, floating content on CSS anchor
positioning; PhoneField keeps an E.164 value. The changesets describe every
change.
…t-kit

Root paths cover @vega-ui/core/test, CI runs the widget tests in node, and the
lockfile follows the new packages.
The core browser projects take the plain browser names, so the --project filter of the browser job selects them, and the unit job runs the core node project.
- Invariants by source: a step that breaks one that held throws in strict mode; options that break one are repaired silently, the Listbox active option moves to its nearest neighbour, Grid ranges leave out disabled cells
- lifecycle.options names the changed options, so Select and modal dialogs re-show only when the parent changes open
- Adapter: keyboard click after a touch drag, prevented pointer moves, symbol keys typed with Shift, errors of invariants, options, selectors and painting reach onError
- Widgets: Tooltip Escape cancels a pending open, Grid click after a drag, SnapScroller clamped target, PageControl tab stop, linear Shift extension that restarts after an outside value change, Listbox and Select activedescendant only for existing options, Sheet follows snapPoints, GridCell asChild leaves the role to a component control
- Typed part names (state({ parts })) and typed command payloads (command<Payload>()(name)), so a mistyped part or payload is a type error
- Readable type parameter names, helper tests under the standard describes, pure-code lint covers globalThis, performance and DOM types
@SlDo
SlDo merged commit da7aaaf into main Nov 15, 2026
12 checks passed
@SlDo
SlDo deleted the feat/widgets-pipeline branch November 15, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant