@kerusiweb/react 2.1.0 → 2.3.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/styles.css CHANGED
@@ -148,6 +148,22 @@
148
148
  paint-order: stroke;
149
149
  }
150
150
 
151
+ /* With a custom seat template the library cannot assume a `.kerusi-seat__box`
152
+ exists, so it draws this outline of the seat's body over the custom content
153
+ instead (the stock seat never renders it). Same colour chain as the ring
154
+ above; the stroke is centred on the outline because there is no fill of its
155
+ own to sit behind. */
156
+ .kerusi-seat__focus {
157
+ fill: none;
158
+ stroke: none;
159
+ pointer-events: none;
160
+ }
161
+
162
+ .kerusi-seat:focus-visible .kerusi-seat__focus {
163
+ stroke: var(--kerusi-focus-ring, var(--kerusi-focus-ring-input, currentColor));
164
+ stroke-width: 2.5;
165
+ }
166
+
151
167
  .kerusi-element__void {
152
168
  stroke-width: 1;
153
169
  stroke-dasharray: 4 3;
@@ -228,3 +244,122 @@
228
244
  opacity: 0.7;
229
245
  font-variant-numeric: tabular-nums;
230
246
  }
247
+
248
+ /* --- zoom, pan and maximize -------------------------------------------------
249
+ Everything below applies only when `zoomable` or `maximizable` is on; a plain
250
+ map renders none of these elements. Colours are bound inline from the
251
+ `--kerusi-*` tokens, so this file owns layout, motion and the focus ring.
252
+ The same rules as the Angular component's stylesheet. */
253
+
254
+ /* Same column the sections sit in without the wrapper, so turning a feature on
255
+ does not move anything. */
256
+ .kerusi-seatmap__stage {
257
+ display: flex;
258
+ flex-direction: column;
259
+ gap: 1.25rem;
260
+ }
261
+
262
+ .kerusi-toolbar {
263
+ display: flex;
264
+ gap: 0.35rem;
265
+ align-self: flex-end;
266
+ /* Stays put under a maximized map's scrolling stage. */
267
+ flex: none;
268
+ }
269
+
270
+ .kerusi-control {
271
+ display: inline-flex;
272
+ align-items: center;
273
+ justify-content: center;
274
+ box-sizing: border-box;
275
+ /* 44px: a comfortable touch target on the phones this exists for. */
276
+ width: 2.75rem;
277
+ height: 2.75rem;
278
+ padding: 0;
279
+ border: 1px solid;
280
+ border-radius: 0.4rem;
281
+ font: inherit;
282
+ cursor: pointer;
283
+ }
284
+
285
+ /* `aria-disabled`, not `disabled`: a disabled button drops out of the tab order,
286
+ and pressing "zoom in" until the ceiling would throw focus away mid-press. */
287
+ .kerusi-control[aria-disabled='true'] {
288
+ opacity: 0.45;
289
+ cursor: default;
290
+ }
291
+
292
+ .kerusi-control svg {
293
+ width: 1.4rem;
294
+ height: 1.4rem;
295
+ fill: none;
296
+ stroke: currentColor;
297
+ stroke-width: 2;
298
+ stroke-linecap: round;
299
+ stroke-linejoin: round;
300
+ pointer-events: none;
301
+ }
302
+
303
+ .kerusi-control:focus-visible,
304
+ .kerusi-viewport:focus-visible {
305
+ outline: 2px solid var(--kerusi-focus-ring, var(--kerusi-focus-ring-input, currentColor));
306
+ outline-offset: 2px;
307
+ }
308
+
309
+ /* A window onto the map. `clip` rather than `hidden`: a hidden box can still be
310
+ scrolled by the browser when a seat inside takes focus, which would fight the
311
+ transform; a clipped one cannot be scrolled at all. */
312
+ .kerusi-viewport {
313
+ position: relative;
314
+ overflow: hidden;
315
+ overflow: clip;
316
+ user-select: none;
317
+ -webkit-user-select: none;
318
+ }
319
+
320
+ /* The same column the sections sit in outside a viewport. */
321
+ .kerusi-viewport__content {
322
+ display: flex;
323
+ flex-direction: column;
324
+ gap: 1.25rem;
325
+ transform-origin: 0 0;
326
+ }
327
+
328
+ /* Only for a button, key or reveal. A finger or wheel moves the map directly, and
329
+ easing behind it would feel like lag. */
330
+ .kerusi-viewport__content--animated {
331
+ transition: transform 160ms ease-out;
332
+ }
333
+
334
+ @media (prefers-reduced-motion: reduce) {
335
+ .kerusi-viewport__content--animated {
336
+ transition: none;
337
+ }
338
+ }
339
+
340
+ /* Maximized: the map fills the screen. This is the whole feature on iPhone,
341
+ which has no element full screen; elsewhere native full screen is requested
342
+ on top. `Canvas` / `CanvasText` and the backdrop come from inline styles. */
343
+ .kerusi-seatmap--maximized {
344
+ position: fixed;
345
+ inset: 0;
346
+ z-index: var(--kerusi-maximized-z-index, 1000);
347
+ box-sizing: border-box;
348
+ padding: 0.75rem;
349
+ gap: 0.5rem;
350
+ overflow: hidden;
351
+ overscroll-behavior: contain;
352
+ }
353
+
354
+ .kerusi-seatmap--maximized .kerusi-seatmap__stage {
355
+ flex: 1 1 auto;
356
+ min-height: 0;
357
+ gap: 0.5rem;
358
+ /* A map that is not zoomable has no viewport to pan, so it scrolls instead. */
359
+ overflow: auto;
360
+ }
361
+
362
+ .kerusi-seatmap--maximized .kerusi-viewport {
363
+ flex: 1 1 auto;
364
+ min-height: 0;
365
+ }