@kerusiweb/react 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +306 -0
- package/dist/kerusi-legend.d.ts +29 -0
- package/dist/kerusi-legend.d.ts.map +1 -0
- package/dist/kerusi-legend.js +80 -0
- package/dist/kerusi-legend.js.map +1 -0
- package/dist/kerusi-seatmap.d.ts +20 -0
- package/dist/kerusi-seatmap.d.ts.map +1 -0
- package/dist/kerusi-seatmap.js +269 -0
- package/dist/kerusi-seatmap.js.map +1 -0
- package/dist/kerusi-section.d.ts +45 -0
- package/dist/kerusi-section.d.ts.map +1 -0
- package/dist/kerusi-section.js +102 -0
- package/dist/kerusi-section.js.map +1 -0
- package/dist/public-api.d.ts +22 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +18 -0
- package/dist/public-api.js.map +1 -0
- package/dist/types.d.ts +111 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/use-kerusi-state.d.ts +49 -0
- package/dist/use-kerusi-state.d.ts.map +1 -0
- package/dist/use-kerusi-state.js +82 -0
- package/dist/use-kerusi-state.js.map +1 -0
- package/dist/use-roving-focus.d.ts +27 -0
- package/dist/use-roving-focus.d.ts.map +1 -0
- package/dist/use-roving-focus.js +66 -0
- package/dist/use-roving-focus.js.map +1 -0
- package/package.json +52 -0
- package/styles.css +230 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { buildNavigationGraph, buildRenderModel, DEFAULT_SEAT_ARIA_STRINGS, disallowedAnnouncement, computeSectionLayout, errorsOf, expireHolds as expireHoldsIn, formatMoney, isRtlLocale, KerusiValidationError, resolveColors, resolveMapLocale, seatAriaLabel, summarizeSelection, toggleSeatSelection, validateDocumentSet, } from '@kerusiweb/core';
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
4
|
+
import { KerusiLegend } from './kerusi-legend.js';
|
|
5
|
+
import { KerusiSection } from './kerusi-section.js';
|
|
6
|
+
import { useRovingFocus } from './use-roving-focus.js';
|
|
7
|
+
const NO_SELECTION = [];
|
|
8
|
+
const DEFAULT_SELECTABLE_STATUSES = ['available'];
|
|
9
|
+
const NO_OVERRIDES = {};
|
|
10
|
+
/**
|
|
11
|
+
* Renders a Kerusi seat map.
|
|
12
|
+
*
|
|
13
|
+
* Takes a `KerusiMap` and its `KerusiState` directly — no adapter, no
|
|
14
|
+
* intermediate row model. Each `Section` becomes its own `<svg>` with its own
|
|
15
|
+
* layout mode and proportions, seats take their color from the map's legend,
|
|
16
|
+
* every seat is keyboard-reachable and announced with its type, price, status
|
|
17
|
+
* and §4.3.4 accessibility properties, and selection is an immutable list of
|
|
18
|
+
* seat ids.
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <KerusiSeatmap map={map} state={state} selection={picked} onSelectionChange={setPicked} />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Import the stylesheet once, anywhere in the app:
|
|
25
|
+
* `import '@kerusiweb/react/styles.css'`.
|
|
26
|
+
*/
|
|
27
|
+
export const KerusiSeatmap = forwardRef(function KerusiSeatmap(props, ref) {
|
|
28
|
+
const { map, state, session, selection: controlledSelection, defaultSelection = NO_SELECTION, onSelectionChange, locale, rtl = 'auto', ariaStrings = DEFAULT_SEAT_ARIA_STRINGS, colors, typeColors = true, seatSize = 28, seatGap = 6, freeformBasis = 1000, unitScale = 1, showSectionLabels = true, showLegend = false, showLegendPrices = true, sectionIds, sectionOverrides = NO_OVERRIDES, selectableStatuses = DEFAULT_SELECTABLE_STATUSES, companionMode = 'auto', maxSelection, seatSelectable, interactive = true, expireHolds = false, expiryIntervalMs = 1000, validate = 'collect', onSeatSelect, onSeatDeselect, onSeatDisallowed, onSeatFocus, onValidationIssues, className, style, children, } = props;
|
|
29
|
+
// --- selection: controlled or not ---------------------------------------
|
|
30
|
+
const [uncontrolledSelection, setUncontrolledSelection] = useState(defaultSelection);
|
|
31
|
+
const isControlled = controlledSelection !== undefined;
|
|
32
|
+
const selection = isControlled ? controlledSelection : uncontrolledSelection;
|
|
33
|
+
const commitSelection = useCallback((next) => {
|
|
34
|
+
if (!isControlled) {
|
|
35
|
+
setUncontrolledSelection(next);
|
|
36
|
+
}
|
|
37
|
+
onSelectionChange?.(next);
|
|
38
|
+
}, [isControlled, onSelectionChange]);
|
|
39
|
+
// --- validation ---------------------------------------------------------
|
|
40
|
+
const issues = useMemo(() => (validate === 'off' ? [] : validateDocumentSet({ map, state, session })), [validate, map, state, session]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (validate !== 'off') {
|
|
43
|
+
onValidationIssues?.(issues);
|
|
44
|
+
}
|
|
45
|
+
// `onValidationIssues` is deliberately absent: an inline callback would
|
|
46
|
+
// re-announce the same issues on every render.
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [issues, validate]);
|
|
49
|
+
if (validate === 'throw') {
|
|
50
|
+
// Thrown during render, not from an effect, so a React error boundary
|
|
51
|
+
// catches it — the idiomatic equivalent of the Angular binding's throw.
|
|
52
|
+
const [first] = errorsOf(issues);
|
|
53
|
+
if (first) {
|
|
54
|
+
throw new KerusiValidationError(first.message, first.rule, first.id, issues);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// --- derived model ------------------------------------------------------
|
|
58
|
+
/** Bumped by the hold ticker to force the state to be re-derived. */
|
|
59
|
+
const [expiryTick, setExpiryTick] = useState(0);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!expireHolds) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const handle = setInterval(() => setExpiryTick((n) => n + 1), expiryIntervalMs);
|
|
65
|
+
return () => clearInterval(handle);
|
|
66
|
+
}, [expireHolds, expiryIntervalMs]);
|
|
67
|
+
/** The state actually rendered — with lapsed holds reverted when asked. */
|
|
68
|
+
const effectiveState = useMemo(() => {
|
|
69
|
+
if (!state || !expireHolds) {
|
|
70
|
+
return state;
|
|
71
|
+
}
|
|
72
|
+
// `expireHolds` returns the same object when nothing lapsed, so the
|
|
73
|
+
// memos downstream of this one stay stable across a quiet tick.
|
|
74
|
+
void expiryTick;
|
|
75
|
+
return expireHoldsIn(state);
|
|
76
|
+
}, [state, expireHolds, expiryTick]);
|
|
77
|
+
const visibleSectionIds = useMemo(() => {
|
|
78
|
+
const hidden = Object.entries(sectionOverrides)
|
|
79
|
+
.filter(([, o]) => o.hidden)
|
|
80
|
+
.map(([id]) => id);
|
|
81
|
+
if (sectionIds) {
|
|
82
|
+
return sectionIds.filter((id) => !hidden.includes(id));
|
|
83
|
+
}
|
|
84
|
+
if (hidden.length === 0) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
return (map.sections ?? []).map((s) => s.id).filter((id) => !hidden.includes(id));
|
|
88
|
+
}, [map, sectionIds, sectionOverrides]);
|
|
89
|
+
const renderMap = useMemo(() => buildRenderModel(map, effectiveState, {
|
|
90
|
+
locale,
|
|
91
|
+
sectionIds: visibleSectionIds,
|
|
92
|
+
selectableStatuses,
|
|
93
|
+
seatSelectable,
|
|
94
|
+
}), [map, effectiveState, locale, visibleSectionIds, selectableStatuses, seatSelectable]);
|
|
95
|
+
const resolvedLocale = useMemo(() => resolveMapLocale(map, locale), [map, locale]);
|
|
96
|
+
const isRtl = rtl === 'auto' ? isRtlLocale(resolvedLocale) : rtl === true;
|
|
97
|
+
const resolvedColors = useMemo(() => resolveColors(colors), [colors]);
|
|
98
|
+
const selectionSet = useMemo(() => new Set(selection), [selection]);
|
|
99
|
+
/** Placed geometry per section, keyed by section id. */
|
|
100
|
+
const layouts = useMemo(() => new Map(renderMap.sections.map((section) => {
|
|
101
|
+
const override = sectionOverrides[section.id] ?? {};
|
|
102
|
+
return [
|
|
103
|
+
section.id,
|
|
104
|
+
computeSectionLayout(section, {
|
|
105
|
+
seatSize: override.seatSize ?? seatSize,
|
|
106
|
+
seatGap,
|
|
107
|
+
freeformBasis,
|
|
108
|
+
aspectRatio: override.aspectRatio,
|
|
109
|
+
rtl: isRtl,
|
|
110
|
+
}),
|
|
111
|
+
];
|
|
112
|
+
})), [renderMap, sectionOverrides, seatSize, seatGap, freeformBasis, isRtl]);
|
|
113
|
+
/** Navigation graphs per section — arrows move within, Tab moves between. */
|
|
114
|
+
const graphs = useMemo(() => new Map(renderMap.sections.map((section) => [
|
|
115
|
+
section.id,
|
|
116
|
+
buildNavigationGraph(section, { rtl: isRtl }),
|
|
117
|
+
])), [renderMap, isRtl]);
|
|
118
|
+
const ariaLabels = useMemo(() => new Map([...renderMap.seatsById.values()].map((seat) => [
|
|
119
|
+
seat.id,
|
|
120
|
+
seatAriaLabel(seat, resolvedLocale, ariaStrings),
|
|
121
|
+
])), [renderMap, resolvedLocale, ariaStrings]);
|
|
122
|
+
// --- focus and announcements --------------------------------------------
|
|
123
|
+
const { focusedSeatIds, setFocusedSeat, moveFocusTo, focusSeat, registerSeat } = useRovingFocus(renderMap);
|
|
124
|
+
/**
|
|
125
|
+
* The live-region text, plus a counter that makes a repeat of the same
|
|
126
|
+
* message textually distinct.
|
|
127
|
+
*
|
|
128
|
+
* A live region that sees no text change stays silent, so announcing the
|
|
129
|
+
* same thing twice — picking two seats and hearing "1 seat selected" both
|
|
130
|
+
* times — needs the second one to differ somehow. The Angular binding
|
|
131
|
+
* clears the region and refills it a microtask later; two commits, which
|
|
132
|
+
* React would batch back into one unless deliberately escaped. Appending a
|
|
133
|
+
* zero-width space on alternate announcements does the same job in a single
|
|
134
|
+
* commit: the text differs, and no screen reader speaks the character.
|
|
135
|
+
*/
|
|
136
|
+
const [announcement, setAnnouncement] = useState({ message: '', nonce: 0 });
|
|
137
|
+
const announce = useCallback((message) => {
|
|
138
|
+
setAnnouncement((current) => ({ message, nonce: current.nonce + 1 }));
|
|
139
|
+
}, []);
|
|
140
|
+
const liveMessage = announcement.nonce % 2 === 0 ? announcement.message : `${announcement.message}\u200b`;
|
|
141
|
+
const announceSelection = useCallback((next) => {
|
|
142
|
+
if (next.length === 0) {
|
|
143
|
+
announce(ariaStrings.selectionEmpty);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const { total } = summarizeSelection(renderMap, next);
|
|
147
|
+
announce(ariaStrings.selectionSummary(next.length, formatTotal(total, resolvedLocale)));
|
|
148
|
+
}, [announce, ariaStrings, renderMap, resolvedLocale]);
|
|
149
|
+
// --- interaction --------------------------------------------------------
|
|
150
|
+
const onSeatActivate = useCallback((seatId) => {
|
|
151
|
+
const seat = renderMap.seatsById.get(seatId);
|
|
152
|
+
if (!seat) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const outcome = toggleSeatSelection(selection, seatId, {
|
|
156
|
+
seatsById: renderMap.seatsById,
|
|
157
|
+
companionMode,
|
|
158
|
+
maxSelection,
|
|
159
|
+
});
|
|
160
|
+
if (outcome.kind === 'disallowed') {
|
|
161
|
+
announce(disallowedAnnouncement(seat, outcome.reason, ariaStrings));
|
|
162
|
+
onSeatDisallowed?.({ seat, reason: outcome.reason });
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
commitSelection(outcome.selection);
|
|
166
|
+
const event = {
|
|
167
|
+
seat,
|
|
168
|
+
selection: outcome.selection,
|
|
169
|
+
changed: outcome.changed,
|
|
170
|
+
};
|
|
171
|
+
(outcome.kind === 'select' ? onSeatSelect : onSeatDeselect)?.(event);
|
|
172
|
+
announceSelection(outcome.selection);
|
|
173
|
+
}, [
|
|
174
|
+
renderMap,
|
|
175
|
+
selection,
|
|
176
|
+
companionMode,
|
|
177
|
+
maxSelection,
|
|
178
|
+
announce,
|
|
179
|
+
ariaStrings,
|
|
180
|
+
onSeatDisallowed,
|
|
181
|
+
commitSelection,
|
|
182
|
+
onSeatSelect,
|
|
183
|
+
onSeatDeselect,
|
|
184
|
+
announceSelection,
|
|
185
|
+
]);
|
|
186
|
+
const onSeatFocused = useCallback((seatId) => {
|
|
187
|
+
const seat = renderMap.seatsById.get(seatId);
|
|
188
|
+
if (!seat) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
setFocusedSeat(seat.sectionId, seatId);
|
|
192
|
+
onSeatFocus?.(seat);
|
|
193
|
+
}, [renderMap, setFocusedSeat, onSeatFocus]);
|
|
194
|
+
/**
|
|
195
|
+
* Arrow keys walk the navigation graph, which orders seats by `col` in grid
|
|
196
|
+
* and mixed sections — §4.3.1's logical adjacency — so the aisle that is a
|
|
197
|
+
* skipped column is stepped across rather than into.
|
|
198
|
+
*/
|
|
199
|
+
const onKeyDown = useCallback((sectionId, event) => {
|
|
200
|
+
const seatId = event.target?.dataset?.['seatId'];
|
|
201
|
+
if (!seatId) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const graph = graphs.get(sectionId);
|
|
205
|
+
if (!graph) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const neighbours = graph.neighbours.get(seatId);
|
|
209
|
+
let target;
|
|
210
|
+
switch (event.key) {
|
|
211
|
+
case 'ArrowLeft':
|
|
212
|
+
target = neighbours?.left;
|
|
213
|
+
break;
|
|
214
|
+
case 'ArrowRight':
|
|
215
|
+
target = neighbours?.right;
|
|
216
|
+
break;
|
|
217
|
+
case 'ArrowUp':
|
|
218
|
+
target = neighbours?.up;
|
|
219
|
+
break;
|
|
220
|
+
case 'ArrowDown':
|
|
221
|
+
target = neighbours?.down;
|
|
222
|
+
break;
|
|
223
|
+
case 'Home':
|
|
224
|
+
target = event.ctrlKey ? graph.first : neighbours?.rowStart;
|
|
225
|
+
break;
|
|
226
|
+
case 'End':
|
|
227
|
+
target = event.ctrlKey ? graph.last : neighbours?.rowEnd;
|
|
228
|
+
break;
|
|
229
|
+
case 'PageUp':
|
|
230
|
+
target = graph.first;
|
|
231
|
+
break;
|
|
232
|
+
case 'PageDown':
|
|
233
|
+
target = graph.last;
|
|
234
|
+
break;
|
|
235
|
+
case 'Enter':
|
|
236
|
+
case ' ':
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
onSeatActivate(seatId);
|
|
239
|
+
return;
|
|
240
|
+
case 'Escape':
|
|
241
|
+
if (selection.length > 0) {
|
|
242
|
+
event.preventDefault();
|
|
243
|
+
commitSelection([]);
|
|
244
|
+
announceSelection([]);
|
|
245
|
+
}
|
|
246
|
+
return;
|
|
247
|
+
default:
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (target) {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
moveFocusTo(sectionId, target);
|
|
253
|
+
}
|
|
254
|
+
}, [graphs, onSeatActivate, selection, commitSelection, announceSelection, moveFocusTo]);
|
|
255
|
+
// --- public handle ------------------------------------------------------
|
|
256
|
+
const summary = useMemo(() => summarizeSelection(renderMap, selection), [renderMap, selection]);
|
|
257
|
+
useImperativeHandle(ref, () => ({ summary, focusSeat }), [summary, focusSeat]);
|
|
258
|
+
// --- render -------------------------------------------------------------
|
|
259
|
+
const labelFor = (section) => sectionOverrides[section.id]?.label ?? section.label;
|
|
260
|
+
const labelId = (section) => `kerusi-section-${renderMap.id}-${section.id}`;
|
|
261
|
+
return (_jsxs("div", { className: className ? `kerusi-seatmap ${className}` : 'kerusi-seatmap', role: "group", "aria-label": renderMap.name ?? `Seat map ${renderMap.id}`, dir: isRtl ? 'rtl' : undefined, lang: resolvedLocale, style: style, children: [renderMap.sections.map((section) => {
|
|
262
|
+
const label = labelFor(section);
|
|
263
|
+
return (_jsxs("section", { className: `kerusi-seatmap__section kerusi-seatmap__section--${section.layoutMode}`, role: "group", "aria-labelledby": label ? labelId(section) : undefined, "aria-label": label ? undefined : section.id, children: [showSectionLabels && label && (_jsx("h3", { className: "kerusi-section-label", id: labelId(section), children: label })), _jsx(KerusiSection, { section: section, layout: layouts.get(section.id), selection: selectionSet, focusedSeatId: focusedSeatIds[section.id] ?? null, ariaLabels: ariaLabels, colors: resolvedColors, typeColors: typeColors, unitScale: unitScale, interactive: interactive, onSeatActivate: onSeatActivate, onSeatFocused: onSeatFocused, onSeatKeyDown: (event) => onKeyDown(section.id, event), registerSeat: registerSeat })] }, section.id));
|
|
264
|
+
}), showLegend && (_jsx(KerusiLegend, { legend: renderMap.legend, locale: resolvedLocale, colors: resolvedColors, typeColors: typeColors, showPrices: showLegendPrices })), _jsx("p", { className: "kerusi-sr-only", "aria-live": "polite", "aria-atomic": "true", children: liveMessage }), children] }));
|
|
265
|
+
});
|
|
266
|
+
function formatTotal(total, locale) {
|
|
267
|
+
return total ? formatMoney(total, locale) : '';
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=kerusi-seatmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kerusi-seatmap.js","sourceRoot":"","sources":["../src/kerusi-seatmap.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,QAAQ,EACR,WAAW,IAAI,aAAa,EAC5B,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAUzB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,YAAY,GAAsB,EAAE,CAAC;AAC3C,MAAM,2BAA2B,GAAG,CAAC,WAAW,CAAU,CAAC;AAC3D,MAAM,YAAY,GAAmD,EAAE,CAAC;A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E,cAAc,EACtB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,gBAAgB,GAC5B,CACH,EAED,YAAG,SAAS,EAAC,gBAAgB,eAAW,QAAQ,iBAAa,MAAM,YAChE,WAAW,GACV,EAEH,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,WAAW,CAAC,KAAwB,EAAE,MAAc;IAC3D,OAAO,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { KerusiSeatmapColors, RenderSection, SectionLayout } from '@kerusiweb/core';
|
|
2
|
+
import type { KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
3
|
+
export interface KerusiSectionProps {
|
|
4
|
+
section: RenderSection;
|
|
5
|
+
layout: SectionLayout;
|
|
6
|
+
/** Currently selected seat ids. */
|
|
7
|
+
selection?: ReadonlySet<string>;
|
|
8
|
+
/** The seat holding the section's single tab stop, if any. */
|
|
9
|
+
focusedSeatId?: string | null;
|
|
10
|
+
/** Per-seat accessible names, keyed by seat id. */
|
|
11
|
+
ariaLabels?: ReadonlyMap<string, string>;
|
|
12
|
+
colors?: Required<KerusiSeatmapColors>;
|
|
13
|
+
/** Whether an available seat may take its `SeatType.color` (§4.7). */
|
|
14
|
+
typeColors?: boolean;
|
|
15
|
+
/** When false, seats render but do not respond to pointer or keyboard. */
|
|
16
|
+
interactive?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* CSS pixels per viewBox unit, at the section's natural size.
|
|
19
|
+
*
|
|
20
|
+
* Without a cap every section stretches to the full container width, so in a
|
|
21
|
+
* four-tier theatre the narrow box row would draw seats several times the
|
|
22
|
+
* size of the orchestra's. Capping each section at its own intrinsic width
|
|
23
|
+
* keeps a seat the same size everywhere; a section too wide to fit still
|
|
24
|
+
* scales down to the container.
|
|
25
|
+
*/
|
|
26
|
+
unitScale?: number;
|
|
27
|
+
onSeatActivate?: (seatId: string) => void;
|
|
28
|
+
onSeatFocused?: (seatId: string) => void;
|
|
29
|
+
onSeatKeyDown?: (event: ReactKeyboardEvent<SVGGElement>) => void;
|
|
30
|
+
/** Called with each seat's `<g>` as it mounts and unmounts, for focus moves. */
|
|
31
|
+
registerSeat?: (seatId: string, node: SVGGElement | null) => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Draws one Kerusi `Section` as a single `<svg>`.
|
|
35
|
+
*
|
|
36
|
+
* One SVG per section — rather than section groups inside a shared canvas — is
|
|
37
|
+
* what makes per-section `aspectRatio` and mixed grid/freeform modes work: each
|
|
38
|
+
* gets its own `viewBox` and its own intrinsic proportions, and CSS is free to
|
|
39
|
+
* stack, wrap or column them. It also puts the section heading in real DOM,
|
|
40
|
+
* where a screen reader can use it as a landmark.
|
|
41
|
+
*
|
|
42
|
+
* This component holds no state. It takes a placed layout and reports intent.
|
|
43
|
+
*/
|
|
44
|
+
export declare function KerusiSection({ layout, selection, focusedSeatId, ariaLabels, colors, typeColors, interactive, unitScale, onSeatActivate, onSeatFocused, onSeatKeyDown, registerSeat, }: KerusiSectionProps): import("react").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=kerusi-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kerusi-section.d.ts","sourceRoot":"","sources":["../src/kerusi-section.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,mBAAmB,EAGnB,aAAa,EACb,aAAa,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAiB,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mDAAmD;IACnD,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACvC,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACjE,gFAAgF;IAChF,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACnE;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAA2B,EAC3B,aAAoB,EACpB,UAAyB,EACzB,MAA8B,EAC9B,UAAiB,EACjB,WAAkB,EAClB,SAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,GACb,EAAE,kBAAkB,+BAkDpB"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cssVar, DEFAULT_KERUSI_COLORS, elementFill, elementStyle, elementTextFill, occupantFillFor, occupantStrokeFor, screenPath, seatBodyPath, seatCoreFill, seatFill, seatOccupantPath, seatOccupantStroke, seatOccupantVariant, seatSelectedFrame, seatTextFill, seatWashFill, } from '@kerusiweb/core';
|
|
3
|
+
const EMPTY_SELECTION = new Set();
|
|
4
|
+
const EMPTY_LABELS = new Map();
|
|
5
|
+
/**
|
|
6
|
+
* Draws one Kerusi `Section` as a single `<svg>`.
|
|
7
|
+
*
|
|
8
|
+
* One SVG per section — rather than section groups inside a shared canvas — is
|
|
9
|
+
* what makes per-section `aspectRatio` and mixed grid/freeform modes work: each
|
|
10
|
+
* gets its own `viewBox` and its own intrinsic proportions, and CSS is free to
|
|
11
|
+
* stack, wrap or column them. It also puts the section heading in real DOM,
|
|
12
|
+
* where a screen reader can use it as a landmark.
|
|
13
|
+
*
|
|
14
|
+
* This component holds no state. It takes a placed layout and reports intent.
|
|
15
|
+
*/
|
|
16
|
+
export function KerusiSection({ layout, selection = EMPTY_SELECTION, focusedSeatId = null, ariaLabels = EMPTY_LABELS, colors = DEFAULT_KERUSI_COLORS, typeColors = true, interactive = true, unitScale = 1, onSeatActivate, onSeatFocused, onSeatKeyDown, registerSeat, }) {
|
|
17
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "kerusi-section-svg", role: "presentation", focusable: "false", viewBox: `0 0 ${layout.width} ${layout.height}`, preserveAspectRatio: "xMidYMid meet", style: {
|
|
18
|
+
// The focus ring's middle tier: the stylesheet reads this property,
|
|
19
|
+
// so the `colors` prop can reach a rule it cannot otherwise see.
|
|
20
|
+
'--kerusi-focus-ring-input': colors.focusRing,
|
|
21
|
+
// The section's natural width in CSS pixels; it never draws wider.
|
|
22
|
+
maxWidth: layout.width * unitScale,
|
|
23
|
+
}, children: [_jsx("rect", { x: 0, y: 0, width: layout.width, height: layout.height, style: { fill: cssVar('backdrop', colors.backdrop) } }), layout.elements.map((placed) => (_jsx(SectionElement, { placed: placed, colors: colors }, placed.element.id))), layout.seats.map((placed) => (_jsx(SectionSeat, { placed: placed, selected: selection.has(placed.seat.id), tabStop: placed.seat.id === focusedSeatId, ariaLabel: ariaLabels.get(placed.seat.id) ?? placed.seat.label, colors: colors, typeColors: typeColors, interactive: interactive, onSeatActivate: onSeatActivate, onSeatFocused: onSeatFocused, onSeatKeyDown: onSeatKeyDown, registerSeat: registerSeat }, placed.seat.id)))] }));
|
|
24
|
+
}
|
|
25
|
+
function SectionSeat({ placed, selected, tabStop, ariaLabel, colors, typeColors, interactive, onSeatActivate, onSeatFocused, onSeatKeyDown, registerSeat, }) {
|
|
26
|
+
const seat = placed.seat;
|
|
27
|
+
const variant = seatOccupantVariant(seat, selected);
|
|
28
|
+
const box = markBox(placed, selected);
|
|
29
|
+
const body = seatBodyPath(placed.x, placed.y, placed.width, placed.height);
|
|
30
|
+
const textFill = seatTextFill(seat, selected, colors, typeColors);
|
|
31
|
+
return (_jsxs("g", { ref: (node) => {
|
|
32
|
+
registerSeat?.(seat.id, node);
|
|
33
|
+
}, className: seatClasses(placed, selected), role: "button", tabIndex: interactive && tabStop ? 0 : -1, "aria-label": ariaLabel, "aria-pressed": selected, "aria-disabled": !seat.selectable, "data-seat-id": seat.id, transform: transform(placed) ?? undefined, onClick: interactive ? () => onSeatActivate?.(seat.id) : undefined, onFocus: interactive ? () => onSeatFocused?.(seat.id) : undefined, onKeyDown: interactive ? onSeatKeyDown : undefined, children: [_jsx("path", { className: "kerusi-seat__box", d: body, style: { fill: seatFill(seat, selected, colors, typeColors) } }), (variant === 'held' || variant === 'booked') && (_jsx("path", { className: "kerusi-seat__wash", d: body, style: { fill: seatWashFill(variant, colors) } })), variant === 'selected' && (_jsx("path", { className: "kerusi-seat__core", d: seatBodyPath(box.x, box.y, box.width, box.height), style: { fill: seatCoreFill(colors) } })), variant && (_jsx("path", { className: `kerusi-seat__occupant kerusi-seat__occupant--${variant}`, d: seatOccupantPath(box.x, box.y, box.width, box.height), strokeWidth: seatOccupantStroke(box.width, box.height), style: {
|
|
34
|
+
fill: occupantFillFor(variant, colors),
|
|
35
|
+
stroke: occupantStrokeFor(variant, colors),
|
|
36
|
+
} })), _jsx("text", { className: "kerusi-seat__label", textAnchor: "middle", dominantBaseline: "central", x: placed.centerX, y: placed.centerY, fontSize: placed.fontSize,
|
|
37
|
+
/* The halo is a core-coloured outline behind a selected seat's number,
|
|
38
|
+
painted under the glyphs via `paint-order`. The label is centred on
|
|
39
|
+
the occupant's shoulder line, so without it the number is
|
|
40
|
+
`selectedFg` over a `selectedBg` silhouette.
|
|
41
|
+
|
|
42
|
+
Bound here rather than in the stylesheet on purpose: a CSS
|
|
43
|
+
`var(--kerusi-selected-fg, …)` rule would carry the library default
|
|
44
|
+
as its fallback and silently skip the `colors` prop tier, which only
|
|
45
|
+
this side can resolve. */
|
|
46
|
+
style: { fill: textFill, stroke: selected ? seatCoreFill(colors) : 'none' }, strokeWidth: selected ? placed.fontSize * 0.22 : 0, transform: counterRotate(placed) ?? undefined, children: seat.label }), seat.accessibility?.wheelchairAccessible && (_jsx("circle", { className: "kerusi-seat__wheelchair", cx: box.x + box.width * 0.82, cy: box.y + box.height * 0.18, r: box.width * 0.13, style: { fill: textFill } }))] }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The box a seat's decorative marks are drawn to: the seat's own, or — when it
|
|
50
|
+
* is selected — the core plate's, which is inset by the frame width.
|
|
51
|
+
*
|
|
52
|
+
* Everything over a selected seat sits on the core, so it all has to be
|
|
53
|
+
* measured from the core. Drawing to the seat's box instead leaves the
|
|
54
|
+
* occupant's hips crossing the frame, where a figure tinted `selectedBg` lands
|
|
55
|
+
* on a frame filled `selectedBg` and reads as a hard nub. Since the core is an
|
|
56
|
+
* exact scaled copy of the body (see `seatSelectedFrame`), routing through here
|
|
57
|
+
* reproduces every clearance the mark had against the body, scaled — so the
|
|
58
|
+
* frame width stays free to change.
|
|
59
|
+
*/
|
|
60
|
+
function markBox(placed, selected) {
|
|
61
|
+
if (!selected) {
|
|
62
|
+
return placed;
|
|
63
|
+
}
|
|
64
|
+
const frame = seatSelectedFrame(placed.width, placed.height);
|
|
65
|
+
return {
|
|
66
|
+
x: placed.x + frame,
|
|
67
|
+
y: placed.y + frame,
|
|
68
|
+
width: placed.width - frame * 2,
|
|
69
|
+
height: placed.height - frame * 2,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function seatClasses(placed, selected) {
|
|
73
|
+
const seat = placed.seat;
|
|
74
|
+
return [
|
|
75
|
+
'kerusi-seat',
|
|
76
|
+
`kerusi-seat--${seat.status}`,
|
|
77
|
+
selected ? 'kerusi-seat--selected' : '',
|
|
78
|
+
seat.selectable ? '' : 'kerusi-seat--unselectable',
|
|
79
|
+
seat.accessibility?.wheelchairAccessible ? 'kerusi-seat--wheelchair' : '',
|
|
80
|
+
seat.companions.length > 0 ? 'kerusi-seat--companion' : '',
|
|
81
|
+
]
|
|
82
|
+
.filter(Boolean)
|
|
83
|
+
.join(' ');
|
|
84
|
+
}
|
|
85
|
+
// --- elements ---------------------------------------------------------------
|
|
86
|
+
function SectionElement({ placed, colors, }) {
|
|
87
|
+
const style = elementStyle(placed.element.kind);
|
|
88
|
+
const fill = elementFill(style.tone, colors);
|
|
89
|
+
const textFill = elementTextFill(style.tone, colors);
|
|
90
|
+
return (_jsxs("g", { className: `kerusi-element kerusi-element--${placed.element.kind}`, transform: transform(placed) ?? undefined, children: [style.shape === 'screen' ? (_jsx("path", { d: screenPath(placed.x, placed.y, placed.width, placed.height), style: { fill } })) : style.shape === 'void' ? (_jsx("rect", { className: "kerusi-element__void", x: placed.x, y: placed.y, width: placed.width, height: placed.height, style: { stroke: textFill }, fill: "none" })) : (_jsx("rect", { x: placed.x, y: placed.y, width: placed.width, height: placed.height,
|
|
91
|
+
/* A stage reads as squarer than an ordinary element. */
|
|
92
|
+
rx: style.shape === 'stage' ? 2 : Math.min(placed.height * 0.25, 6), style: { fill } })), placed.element.label && style.showLabel && (_jsx("text", { className: "kerusi-element__label", textAnchor: "middle", dominantBaseline: "central", x: placed.centerX, y: placed.centerY, fontSize: placed.fontSize, style: { fill: textFill }, transform: counterRotate(placed) ?? undefined, children: placed.element.label }))] }));
|
|
93
|
+
}
|
|
94
|
+
/** SVG rotate() about the item's center; null when it does not rotate. */
|
|
95
|
+
function transform(item) {
|
|
96
|
+
return item.rotation ? `rotate(${item.rotation} ${item.centerX} ${item.centerY})` : null;
|
|
97
|
+
}
|
|
98
|
+
/** Cancels the parent <g>'s rotation so the label stays upright and stays put. */
|
|
99
|
+
function counterRotate(item) {
|
|
100
|
+
return item.rotation ? `rotate(${-item.rotation} ${item.centerX} ${item.centerY})` : null;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=kerusi-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kerusi-section.js","sourceRoot":"","sources":["../src/kerusi-section.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,iBAAiB,CAAC;AAyCzB,MAAM,eAAe,GAAwB,IAAI,GAAG,EAAE,CAAC;AACvD,MAAM,YAAY,GAAgC,IAAI,GAAG,EAAE,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,SAAS,GAAG,eAAe,EAC3B,aAAa,GAAG,IAAI,EACpB,UAAU,GAAG,YAAY,EACzB,MAAM,GAAG,qBAAqB,EAC9B,UAAU,GAAG,IAAI,EACjB,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,CAAC,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,GACO;IACnB,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAC,cAAc,EACnB,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,OAAO,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,EAC/C,mBAAmB,EAAC,eAAe,EAC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AC1E,SAAS,SAAS,CAAC,IAAgC;IACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3F,CAAC;AAED,kFAAkF;AAClF,SAAS,aAAa,CAAC,IAAgC;IACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The React binding for the Kerusi Seat Map & Availability Format.
|
|
3
|
+
*
|
|
4
|
+
* Everything framework-free lives in `@kerusiweb/core` and is imported from
|
|
5
|
+
* there, not re-exported here: the document types (`KerusiMap`, `KerusiState`,
|
|
6
|
+
* `KerusiSession`), the conformance validator, the render model
|
|
7
|
+
* (`buildRenderModel`, `RenderMap`, `RenderSeat`), the geometry
|
|
8
|
+
* (`computeSectionLayout`), and the view helpers (`summarizeSelection`,
|
|
9
|
+
* `seatAriaLabel`, `DEFAULT_KERUSI_COLORS`). This package supplies only what is
|
|
10
|
+
* React's: components, hooks, and their props.
|
|
11
|
+
*
|
|
12
|
+
* The stylesheet is a separate import: `import '@kerusiweb/react/styles.css'`.
|
|
13
|
+
*/
|
|
14
|
+
export { KerusiSeatmap } from './kerusi-seatmap.js';
|
|
15
|
+
export { KerusiSection } from './kerusi-section.js';
|
|
16
|
+
export type { KerusiSectionProps } from './kerusi-section.js';
|
|
17
|
+
export { KerusiLegend } from './kerusi-legend.js';
|
|
18
|
+
export type { KerusiLegendProps } from './kerusi-legend.js';
|
|
19
|
+
export { useKerusiState } from './use-kerusi-state.js';
|
|
20
|
+
export type { UseKerusiState, UseKerusiStateOptions } from './use-kerusi-state.js';
|
|
21
|
+
export type { KerusiSeatmapHandle, KerusiSeatmapProps, SeatDisallowed, SeatInteraction, SectionRenderOptions, ValidationMode, } from './types.js';
|
|
22
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnF,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The React binding for the Kerusi Seat Map & Availability Format.
|
|
3
|
+
*
|
|
4
|
+
* Everything framework-free lives in `@kerusiweb/core` and is imported from
|
|
5
|
+
* there, not re-exported here: the document types (`KerusiMap`, `KerusiState`,
|
|
6
|
+
* `KerusiSession`), the conformance validator, the render model
|
|
7
|
+
* (`buildRenderModel`, `RenderMap`, `RenderSeat`), the geometry
|
|
8
|
+
* (`computeSectionLayout`), and the view helpers (`summarizeSelection`,
|
|
9
|
+
* `seatAriaLabel`, `DEFAULT_KERUSI_COLORS`). This package supplies only what is
|
|
10
|
+
* React's: components, hooks, and their props.
|
|
11
|
+
*
|
|
12
|
+
* The stylesheet is a separate import: `import '@kerusiweb/react/styles.css'`.
|
|
13
|
+
*/
|
|
14
|
+
export { KerusiSeatmap } from './kerusi-seatmap.js';
|
|
15
|
+
export { KerusiSection } from './kerusi-section.js';
|
|
16
|
+
export { KerusiLegend } from './kerusi-legend.js';
|
|
17
|
+
export { useKerusiState } from './use-kerusi-state.js';
|
|
18
|
+
//# sourceMappingURL=public-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { DisallowedReason, KerusiMap, KerusiSeatmapColors, KerusiSession, KerusiState, KerusiViolation, RenderSeat, SeatAriaStrings, SeatRenderStatus, SelectionSummary } from '@kerusiweb/core';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
/** How a document with validation errors is handled. */
|
|
4
|
+
export type ValidationMode =
|
|
5
|
+
/** Report through `onValidationIssues` and render anyway. The default. */
|
|
6
|
+
'collect'
|
|
7
|
+
/** Throw a `KerusiValidationError` during render, for an error boundary. */
|
|
8
|
+
| 'throw'
|
|
9
|
+
/** Skip validation entirely, for a document validated upstream. */
|
|
10
|
+
| 'off';
|
|
11
|
+
/** Per-section rendering overrides, keyed by `Section.id`. */
|
|
12
|
+
export interface SectionRenderOptions {
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
/** Overrides `Section.aspectRatio`. */
|
|
15
|
+
aspectRatio?: string;
|
|
16
|
+
/** Overrides the seat size for this section only. */
|
|
17
|
+
seatSize?: number;
|
|
18
|
+
/** Overrides the localized `Section.label`. */
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
/** What a seat event carries. Everything the document knows, already resolved. */
|
|
22
|
+
export interface SeatInteraction {
|
|
23
|
+
seat: RenderSeat;
|
|
24
|
+
/** The selection after this event. */
|
|
25
|
+
selection: readonly string[];
|
|
26
|
+
/** Seats whose membership changed, including companions (§4.6). */
|
|
27
|
+
changed: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
export interface SeatDisallowed {
|
|
30
|
+
seat: RenderSeat;
|
|
31
|
+
reason: DisallowedReason;
|
|
32
|
+
}
|
|
33
|
+
/** What a `ref` on `<KerusiSeatmap>` exposes. */
|
|
34
|
+
export interface KerusiSeatmapHandle {
|
|
35
|
+
/** The selection's seats and total, resolved against the current documents. */
|
|
36
|
+
readonly summary: SelectionSummary;
|
|
37
|
+
/** Moves DOM focus to a seat, if it is rendered. */
|
|
38
|
+
focusSeat(seatId: string): void;
|
|
39
|
+
}
|
|
40
|
+
export interface KerusiSeatmapProps {
|
|
41
|
+
map: KerusiMap;
|
|
42
|
+
state?: KerusiState;
|
|
43
|
+
/** The optional map↔event join (§5.3). Validated against the map and state. */
|
|
44
|
+
session?: KerusiSession;
|
|
45
|
+
/**
|
|
46
|
+
* Selected seat ids. Supply this with `onSelectionChange` to control the
|
|
47
|
+
* selection; omit both — or supply only `defaultSelection` — to let the
|
|
48
|
+
* component own it.
|
|
49
|
+
*/
|
|
50
|
+
selection?: readonly string[];
|
|
51
|
+
/** The initial selection when the component owns it. Ignored if `selection` is set. */
|
|
52
|
+
defaultSelection?: readonly string[];
|
|
53
|
+
onSelectionChange?: (selection: readonly string[]) => void;
|
|
54
|
+
/** Overrides `KerusiMap.locale` (BCP-47). */
|
|
55
|
+
locale?: string;
|
|
56
|
+
/** Right-to-left rendering. `auto` derives it from the resolved locale. */
|
|
57
|
+
rtl?: boolean | 'auto';
|
|
58
|
+
/** Overrides the built-in English announcement strings. */
|
|
59
|
+
ariaStrings?: SeatAriaStrings;
|
|
60
|
+
colors?: KerusiSeatmapColors;
|
|
61
|
+
/** Let an available seat take its `SeatType.color` (§4.7). */
|
|
62
|
+
typeColors?: boolean;
|
|
63
|
+
/** Grid cell edge, in viewBox units. */
|
|
64
|
+
seatSize?: number;
|
|
65
|
+
/** Gap between grid cells, in viewBox units. */
|
|
66
|
+
seatGap?: number;
|
|
67
|
+
/** Freeform viewBox width; height follows the section's aspect ratio. */
|
|
68
|
+
freeformBasis?: number;
|
|
69
|
+
/**
|
|
70
|
+
* CSS pixels per viewBox unit. Caps each section at its natural size so a
|
|
71
|
+
* narrow section and a wide one in the same map draw seats the same size.
|
|
72
|
+
*/
|
|
73
|
+
unitScale?: number;
|
|
74
|
+
showSectionLabels?: boolean;
|
|
75
|
+
showLegend?: boolean;
|
|
76
|
+
showLegendPrices?: boolean;
|
|
77
|
+
/** Render only these sections, in this order. Default: all, by `Section.index`. */
|
|
78
|
+
sectionIds?: readonly string[];
|
|
79
|
+
sectionOverrides?: Readonly<Record<string, SectionRenderOptions>>;
|
|
80
|
+
/** Statuses in which a seat may be picked. Default: `['available']`. */
|
|
81
|
+
selectableStatuses?: readonly SeatRenderStatus[];
|
|
82
|
+
/** `auto` selects a seat's companion closure together (§4.6). */
|
|
83
|
+
companionMode?: 'auto' | 'independent';
|
|
84
|
+
maxSelection?: number;
|
|
85
|
+
/**
|
|
86
|
+
* A final say on selectability, applied after the status test.
|
|
87
|
+
*
|
|
88
|
+
* Memoize it — an inline arrow rebuilds the whole render model every render.
|
|
89
|
+
*/
|
|
90
|
+
seatSelectable?: (seat: RenderSeat) => boolean;
|
|
91
|
+
/** When false the map renders read-only: no pointer or keyboard interaction. */
|
|
92
|
+
interactive?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Revert a lapsed `holdExpires` to available on a ticker (§5.1). Off by
|
|
95
|
+
* default — a renderer should stay passive unless asked.
|
|
96
|
+
*/
|
|
97
|
+
expireHolds?: boolean;
|
|
98
|
+
expiryIntervalMs?: number;
|
|
99
|
+
validate?: ValidationMode;
|
|
100
|
+
onSeatSelect?: (event: SeatInteraction) => void;
|
|
101
|
+
onSeatDeselect?: (event: SeatInteraction) => void;
|
|
102
|
+
onSeatDisallowed?: (event: SeatDisallowed) => void;
|
|
103
|
+
onSeatFocus?: (seat: RenderSeat) => void;
|
|
104
|
+
/** Called whenever the documents change, unless `validate` is `off`. */
|
|
105
|
+
onValidationIssues?: (issues: readonly KerusiViolation[]) => void;
|
|
106
|
+
className?: string;
|
|
107
|
+
style?: CSSProperties;
|
|
108
|
+
/** Rendered inside the map's root element, after the sections and legend. */
|
|
109
|
+
children?: ReactNode;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,eAAe,EACf,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,cAAc;AACxB,0EAA0E;AACxE,SAAS;AACX,4EAA4E;GAC1E,OAAO;AACT,mEAAmE;GACjE,KAAK,CAAC;AAEV,8DAA8D;AAC9D,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,sCAAsC;I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