@kerusiweb/react 2.0.0 → 2.2.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/README.md +104 -16
- package/dist/kerusi-seatmap.d.ts +5 -0
- package/dist/kerusi-seatmap.d.ts.map +1 -1
- package/dist/kerusi-seatmap.js +91 -11
- package/dist/kerusi-seatmap.js.map +1 -1
- package/dist/kerusi-section.js +8 -0
- package/dist/kerusi-section.js.map +1 -1
- package/dist/types.d.ts +36 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/use-maximized.d.ts +23 -0
- package/dist/use-maximized.d.ts.map +1 -0
- package/dist/use-maximized.js +74 -0
- package/dist/use-maximized.js.map +1 -0
- package/dist/use-roving-focus.d.ts +8 -1
- package/dist/use-roving-focus.d.ts.map +1 -1
- package/dist/use-roving-focus.js +20 -6
- package/dist/use-roving-focus.js.map +1 -1
- package/dist/use-viewport.d.ts +46 -0
- package/dist/use-viewport.d.ts.map +1 -0
- package/dist/use-viewport.js +269 -0
- package/dist/use-viewport.js.map +1 -0
- package/package.json +52 -52
- package/styles.css +119 -0
package/styles.css
CHANGED
|
@@ -228,3 +228,122 @@
|
|
|
228
228
|
opacity: 0.7;
|
|
229
229
|
font-variant-numeric: tabular-nums;
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
/* --- zoom, pan and maximize -------------------------------------------------
|
|
233
|
+
Everything below applies only when `zoomable` or `maximizable` is on; a plain
|
|
234
|
+
map renders none of these elements. Colours are bound inline from the
|
|
235
|
+
`--kerusi-*` tokens, so this file owns layout, motion and the focus ring.
|
|
236
|
+
The same rules as the Angular component's stylesheet. */
|
|
237
|
+
|
|
238
|
+
/* Same column the sections sit in without the wrapper, so turning a feature on
|
|
239
|
+
does not move anything. */
|
|
240
|
+
.kerusi-seatmap__stage {
|
|
241
|
+
display: flex;
|
|
242
|
+
flex-direction: column;
|
|
243
|
+
gap: 1.25rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.kerusi-toolbar {
|
|
247
|
+
display: flex;
|
|
248
|
+
gap: 0.35rem;
|
|
249
|
+
align-self: flex-end;
|
|
250
|
+
/* Stays put under a maximized map's scrolling stage. */
|
|
251
|
+
flex: none;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.kerusi-control {
|
|
255
|
+
display: inline-flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
justify-content: center;
|
|
258
|
+
box-sizing: border-box;
|
|
259
|
+
/* 44px: a comfortable touch target on the phones this exists for. */
|
|
260
|
+
width: 2.75rem;
|
|
261
|
+
height: 2.75rem;
|
|
262
|
+
padding: 0;
|
|
263
|
+
border: 1px solid;
|
|
264
|
+
border-radius: 0.4rem;
|
|
265
|
+
font: inherit;
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* `aria-disabled`, not `disabled`: a disabled button drops out of the tab order,
|
|
270
|
+
and pressing "zoom in" until the ceiling would throw focus away mid-press. */
|
|
271
|
+
.kerusi-control[aria-disabled='true'] {
|
|
272
|
+
opacity: 0.45;
|
|
273
|
+
cursor: default;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.kerusi-control svg {
|
|
277
|
+
width: 1.4rem;
|
|
278
|
+
height: 1.4rem;
|
|
279
|
+
fill: none;
|
|
280
|
+
stroke: currentColor;
|
|
281
|
+
stroke-width: 2;
|
|
282
|
+
stroke-linecap: round;
|
|
283
|
+
stroke-linejoin: round;
|
|
284
|
+
pointer-events: none;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.kerusi-control:focus-visible,
|
|
288
|
+
.kerusi-viewport:focus-visible {
|
|
289
|
+
outline: 2px solid var(--kerusi-focus-ring, var(--kerusi-focus-ring-input, currentColor));
|
|
290
|
+
outline-offset: 2px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* A window onto the map. `clip` rather than `hidden`: a hidden box can still be
|
|
294
|
+
scrolled by the browser when a seat inside takes focus, which would fight the
|
|
295
|
+
transform; a clipped one cannot be scrolled at all. */
|
|
296
|
+
.kerusi-viewport {
|
|
297
|
+
position: relative;
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
overflow: clip;
|
|
300
|
+
user-select: none;
|
|
301
|
+
-webkit-user-select: none;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* The same column the sections sit in outside a viewport. */
|
|
305
|
+
.kerusi-viewport__content {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
gap: 1.25rem;
|
|
309
|
+
transform-origin: 0 0;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Only for a button, key or reveal. A finger or wheel moves the map directly, and
|
|
313
|
+
easing behind it would feel like lag. */
|
|
314
|
+
.kerusi-viewport__content--animated {
|
|
315
|
+
transition: transform 160ms ease-out;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
@media (prefers-reduced-motion: reduce) {
|
|
319
|
+
.kerusi-viewport__content--animated {
|
|
320
|
+
transition: none;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Maximized: the map fills the screen. This is the whole feature on iPhone,
|
|
325
|
+
which has no element full screen; elsewhere native full screen is requested
|
|
326
|
+
on top. `Canvas` / `CanvasText` and the backdrop come from inline styles. */
|
|
327
|
+
.kerusi-seatmap--maximized {
|
|
328
|
+
position: fixed;
|
|
329
|
+
inset: 0;
|
|
330
|
+
z-index: var(--kerusi-maximized-z-index, 1000);
|
|
331
|
+
box-sizing: border-box;
|
|
332
|
+
padding: 0.75rem;
|
|
333
|
+
gap: 0.5rem;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
overscroll-behavior: contain;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.kerusi-seatmap--maximized .kerusi-seatmap__stage {
|
|
339
|
+
flex: 1 1 auto;
|
|
340
|
+
min-height: 0;
|
|
341
|
+
gap: 0.5rem;
|
|
342
|
+
/* A map that is not zoomable has no viewport to pan, so it scrolls instead. */
|
|
343
|
+
overflow: auto;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.kerusi-seatmap--maximized .kerusi-viewport {
|
|
347
|
+
flex: 1 1 auto;
|
|
348
|
+
min-height: 0;
|
|
349
|
+
}
|