vael-ui@0.1.6
Patch Changes
-
6f27012Thanks @Mini-Sylar! - Breaking: replaceconfirmDialog()anduseConfirmAction()(added in the previous release) with a singleconfirmAction(). The old pair required either hand-rolling your own overlay wiring (useConfirmAction) or being locked into a centeredDialog(confirmDialog);confirmAction()picks its presentation with a discriminated union onsurface,'dialog'(default, centered) or'popover'(anchored to atriggerEl, required in that branch). Both branches pass every other prop straight through to the underlyingDialog/Popover(position,size,side,align,closeOnOutside,ui, etc.), so per-call customization (a taller dialog, a wider popover) needs no new API surface.onConfirmis awaited before closing: the confirm button stays in its loading state until it settles, closing only on success; a rejection leaves the surface open and firesonErrorinstead of closing out from under a failed action.useConfirmActionandconfirmDialogare removed with no compatibility shim, since the API was flagged unstable in the release that introduced it.Add
usePopoverService(openPopover,usePopoverRef,usePopoverQueue) andPopoverHost, the anchored-surface counterpart to the existinguseDialogService/DialogHost.openPopover(Component, options)mounts any component inside aPopoveranchored tooptions.triggerEl, returning{ result, close, panelEl }the same shapeopenDialogreturns —resultsettles with whatever the opened component'susePopoverRef().close(result)passes.confirmAction({ surface: 'popover' })is built on this primitive; reach foropenPopoverdirectly for anything beyond a plain confirm (a custom form in a popover, for example). Requires mounting<PopoverHost/>once at the app root, alongside<DialogHost/>.Fix confirm-flow popovers being permanently stuck invisible (
visibility: hidden, positioning never computed). The shareduseFloatingPositioncomposable only recomputes on a false-to-true transition of itsactiveflag, not on an initial truthy value; an imperatively-opened popover'sopenstate startstruebefore the surface even mounts, so the transition never happened and positioning silently never ran.