Repository navigation
kerusiweb 3.1.0
A minor release (3.1.0) of @kerusiweb/core, @kerusiweb/angular and
@kerusiweb/react: customizable seat hover and click behaviour. All of it is
additive. Planned in #42.
Added
-
Hover and click are independent and optional (D10). Two layers, each
useful without the other, and nothing is on by default: a map using none of
what follows renders the same markup and behaves the same as 3.0.0 (the
parity signature does not move). -
Events.
onSeatHover/seatHoverreports theRenderSeatunder the
pointer when it enters a seat andnullwhen it leaves the seat or the map,
once each. Mouse and pen only, never during a pan or zoom (it is cleared once
when one starts and resumes on the next pointer move), and it fires on a map
withinteractive={false}too.onSeatClick/seatClickreports
{ seat, selected, source }on every activation of any seat, booked,
held and blocked included, before the selection callbacks and withselected
as it was before the click. It is read-only (D13): it cannot cancel or change
what the click does. In AngularseatClickis anEventEmitterrather than an
output(), because only that can say whether it is bound. -
A read-only map can still take clicks (D14).
interactive={false}turns
selection off. WhileonSeatClick(or(seatClick)) or a click card is set,
seats stay clickable and keyboard-reachable (Tab, arrows, Enter and Space, per
WCAG 2.1.1), with no toggle and noaria-pressed. There is no new prop: set
one and it turns on, remove them and the markup is a read-only map's again. -
Seat cards. A floating card anchored to a seat, with one card element and
two triggers:renderHoverCardandrenderClickCardin React,
<ng-template kerusiSeatHoverCard>and<ng-template kerusiSeatClickCard>in
Angular. The consumer supplies the content, and the library handles
positioning, dismissal, zoom, full screen, touch and accessibility. The hover
card follows a mouse or pen (never touch), is hoverable and dismissible with
Escape(WCAG 1.4.13), and is arole="tooltip"wired to the seat with
aria-describedby. The click card opens on a click, a tap or Enter/Space, is a
non-modalrole="dialog"labelled by the seat, moves focus in when opened from
the keyboard and back to the seat on close, and closes onEscape, a press
outside, a second click on the same seat,close()or another seat's card.
Props and inputs:seatCardPlacement,seatCardClassName/seatCardClass,
seatCardAppearance,hoverCardDelayandhoverCardOnFocus. The hover card
shows on keyboard focus only withhoverCardOnFocus(D12).openSeatCard(),
closeSeatCard()andopenSeatCardIdopen and close a click card from code. -
The app owns the styling of a card (D11). Eleven
--kerusi-seat-card-*
tokens, the.kerusi-seat-cardclass hooks,data-placement,data-seat-id,
data-seat-status,data-seat-typeanddata-section-idattributes, your own
classes, andseatCardAppearance="none"to drop the chrome. Every library rule
is wrapped in:where(), so a one-class rule of yours wins without
!important. The card sits inside.kerusi-seatmap, so it inherits the
map's--kerusi-*properties and shows in full screen. -
Core (
@kerusiweb/core).reduceSeatHover()holds the hover rules once
for both bindings, asreduceGesture()does for pan and pinch.
placeSeatCard()is the placement arithmetic: side, position and arrow
offset, with flip and clamp, pure and tested in Node. New types:
SeatClick,KerusiSeatCardContext,SeatCardPlacement,SeatCardTrigger,
SeatCardAppearanceandHoverCardDelay. -
Docs and demos. "Hover and click", "Seat cards" and "Styling seat cards"
in the root, React and Angular READMEs, with the tokens table. Both demos get
a hover card toggle, a click card toggle and a "Restyled cards" toggle that
restyles every card from the demo's stylesheet through the tokens alone. -
Slimmer zoom and full-screen buttons, and
--kerusi-control-*tokens.
The controls are now one grouped bar of 32px buttons with 16px icons, and
hover and pressed states, in place of four loose 44px squares. Touch screens
(pointer: coarse) keep the 44px target. Restyle them from your own
stylesheet with--kerusi-control-size,-icon-size,-icon-stroke,
-radius,-shadow,-bg,-fg,-borderand-hover-bg; see the
READMEs. The buttons no longer carry inline colours, so a rule on
.kerusi-controlno longer needs!importantto win. The default colours are
unchanged (elementBg,elementFg,elementMutedFg). The bar's border is a
40% tint ofelementMutedFg, lighter than before.