0.9.1-alpha.54
Alpha@xaui/native@0.9.1-alpha.54
Patch Changes
-
2f05199: feat(close-button): the dismiss affordance, on its own
Chip,Alert,Dialog,PopoverandBottomSheetall have a close. Each is five lines over a shared base that owns the behaviour — its own press state, the grown touch target, the missing-label warning, the cross drawn from two rotated bars — and each hands that base the styles its own recipe resolved. What was missing is the standalone one: a dismiss on something the library does not own, a card header, a banner, a sheet of your own.The base is renamed, and that is the whole of the breaking change.
system/close-buttonnow exportsCloseButtonBaseandcloseButtonGeometry; the public component takes the nameCloseButtonin@xaui/native/close-button. Two things calledCloseButtonin one root barrel is not a naming preference, it is an ambiguous re-export — and the split is worth saying out loud anyway: a close inside a component takes that component's colours and that component's scale, soChip.Closereaches for the base, and dropping a dismiss into a layout reaches for the component. The five existing call sites move with it.The recipe is what the component adds. Four emphasis levels and no intent — dismissing is neither a success nor a danger, and the close that carries an intent is the one inside a component that has one.
secondaryis the neutral disc and the default, for the reason theDialoggives at its own close: a cross floating on a panel with nothing under it reads as decoration, and the disc is what makes it a target.ghostis the bare cross for a component already providing one.Four sizes on a 24 / 28 / 32 / 40 box,
mdbeing the reference implementation's measured and theDialog's. The bar is a ratio of the box rather than a table — a bar rotated a quarter turn spanslength / √2per axis, so it is twice as long as the cross looks — which makes it one cross at four sizes instead of four drawings of one. The stroke does not scale: it is the thickness theChip, theAlertand theDialogalready draw at, and crosses that thickened with their box would read as four different marks.No pressed colour, unlike every other control here. The base owns the press state, because a cross has to be a different target from the panel around it, so the root cannot resolve a colour for a state it does not know it is in. The press is the shared
PressableFeedbacktreatment — which is how every close in the library already reads.