@krizaka/ui 3.83.0 → 3.85.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.
Files changed (76) hide show
  1. package/dist/app-header/search.js +1 -1
  2. package/dist/app-shell.js +16 -25
  3. package/dist/app-shell.js.map +1 -1
  4. package/dist/bird-plate.js +1 -1
  5. package/dist/card-grid.js +1 -1
  6. package/dist/{chunk-DJ5ZPPWL.js → chunk-7P7I5OQV.js} +2 -2
  7. package/dist/{chunk-27AWSJTK.js → chunk-EDQLPCM4.js} +2 -2
  8. package/dist/chunk-FYPYJ6MW.js +60 -0
  9. package/dist/chunk-FYPYJ6MW.js.map +1 -0
  10. package/dist/chunk-QHVV2JGF.js +144 -0
  11. package/dist/chunk-QHVV2JGF.js.map +1 -0
  12. package/dist/chunk-S2O4NSN5.js +72 -0
  13. package/dist/{chunk-GFRUTPGG.js.map → chunk-S2O4NSN5.js.map} +1 -1
  14. package/dist/chunk-TN5JJ6JI.js +60 -0
  15. package/dist/chunk-TN5JJ6JI.js.map +1 -0
  16. package/dist/{chunk-XVXFMVG3.js → chunk-TVLRE7S3.js} +2 -2
  17. package/dist/chunk-VYZFQE3P.js +518 -0
  18. package/dist/chunk-VYZFQE3P.js.map +1 -0
  19. package/dist/{chunk-7MQNG35Q.js → chunk-ZKKMYIDN.js} +3 -2
  20. package/dist/chunk-ZKKMYIDN.js.map +1 -0
  21. package/dist/code-block.js +2 -2
  22. package/dist/cover-hero.js +3 -3
  23. package/dist/filter-bar.d.ts +3 -3
  24. package/dist/flock.js +1 -1
  25. package/dist/grade-stamp.js +2 -2
  26. package/dist/map.d.ts +16 -2
  27. package/dist/map.js +20 -18
  28. package/dist/map.js.map +1 -1
  29. package/dist/mascot-quote.js +1 -1
  30. package/dist/media-carousel.d.ts +113 -0
  31. package/dist/media-carousel.js +122 -0
  32. package/dist/media-carousel.js.map +1 -0
  33. package/dist/media-player.d.ts +177 -0
  34. package/dist/media-player.js +14 -0
  35. package/dist/media-player.js.map +1 -0
  36. package/dist/motion.css +7 -0
  37. package/dist/player-lightbox-ETBQWDOT.js +148 -0
  38. package/dist/player-lightbox-ETBQWDOT.js.map +1 -0
  39. package/dist/rail-nav.js +3 -3
  40. package/dist/retro-tv-playlist.d.ts +2 -0
  41. package/dist/retro-tv.js +1 -1
  42. package/dist/{schema-CL7t7xqb.d.ts → schema-DgjBz7-8.d.ts} +1 -1
  43. package/dist/shop.d.ts +2 -2
  44. package/dist/site-cahier.js +4 -4
  45. package/dist/taped-photo.js +2 -2
  46. package/dist/toc.js +1 -1
  47. package/dist/versus-card.js +1 -1
  48. package/dist/video-player.d.ts +3 -1
  49. package/dist/video-player.js +1 -1
  50. package/dist/virtual.d.ts +3 -3
  51. package/dist/wall.js +2 -2
  52. package/package.json +32 -4
  53. package/registry/app-frame.json +1 -1
  54. package/registry/examples/map/full-screen.d.ts +4 -0
  55. package/registry/examples/map/full-screen.js +26 -0
  56. package/registry/examples/map/full-screen.tsx +27 -0
  57. package/registry/examples/media-gallery/carousel.d.ts +4 -0
  58. package/registry/examples/media-gallery/carousel.js +22 -0
  59. package/registry/examples/media-gallery/carousel.tsx +20 -0
  60. package/registry/examples/media-gallery/player.d.ts +4 -0
  61. package/registry/examples/media-gallery/player.js +15 -0
  62. package/registry/examples/media-gallery/player.tsx +13 -0
  63. package/registry/index.json +16 -12
  64. package/registry/map.json +31 -4
  65. package/registry/media-gallery.json +57 -6
  66. package/registry/nav-bar.json +1 -1
  67. package/registry/rail-nav.json +1 -1
  68. package/registry/retro-tv.json +14 -0
  69. package/registry/shop.json +1 -1
  70. package/registry/site-footer.json +1 -1
  71. package/registry/video-player.json +15 -1
  72. package/dist/chunk-7MQNG35Q.js.map +0 -1
  73. package/dist/chunk-GFRUTPGG.js +0 -43
  74. /package/dist/{chunk-DJ5ZPPWL.js.map → chunk-7P7I5OQV.js.map} +0 -0
  75. /package/dist/{chunk-27AWSJTK.js.map → chunk-EDQLPCM4.js.map} +0 -0
  76. /package/dist/{chunk-XVXFMVG3.js.map → chunk-TVLRE7S3.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-DRTIE44Z.js";
5
5
  import {
6
6
  cn
7
- } from "./chunk-WU4VLSEA.js";
7
+ } from "./chunk-NSLXEDIS.js";
8
8
 
9
9
  // src/mascot-quote/mascot-quote.tsx
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,113 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as React from 'react';
3
+ import { MediaPlayerProps } from './media-player.js';
4
+
5
+ declare const mediaCarousel: tailwind_variants.TVReturnType<{
6
+ [key: string]: {
7
+ [key: string]: tailwind_variants.ClassValue | {
8
+ root?: tailwind_variants.ClassValue;
9
+ media?: tailwind_variants.ClassValue;
10
+ caption?: tailwind_variants.ClassValue;
11
+ track?: tailwind_variants.ClassValue;
12
+ slide?: tailwind_variants.ClassValue;
13
+ bar?: tailwind_variants.ClassValue;
14
+ count?: tailwind_variants.ClassValue;
15
+ buttons?: tailwind_variants.ClassValue;
16
+ };
17
+ };
18
+ } | {
19
+ [x: string]: {
20
+ [x: string]: tailwind_variants.ClassValue | {
21
+ root?: tailwind_variants.ClassValue;
22
+ media?: tailwind_variants.ClassValue;
23
+ caption?: tailwind_variants.ClassValue;
24
+ track?: tailwind_variants.ClassValue;
25
+ slide?: tailwind_variants.ClassValue;
26
+ bar?: tailwind_variants.ClassValue;
27
+ count?: tailwind_variants.ClassValue;
28
+ buttons?: tailwind_variants.ClassValue;
29
+ };
30
+ };
31
+ } | {}, {
32
+ root: string;
33
+ track: string;
34
+ slide: string;
35
+ media: string;
36
+ caption: string;
37
+ bar: string;
38
+ count: string;
39
+ buttons: string;
40
+ }, undefined, {
41
+ [key: string]: {
42
+ [key: string]: tailwind_variants.ClassValue | {
43
+ root?: tailwind_variants.ClassValue;
44
+ media?: tailwind_variants.ClassValue;
45
+ caption?: tailwind_variants.ClassValue;
46
+ track?: tailwind_variants.ClassValue;
47
+ slide?: tailwind_variants.ClassValue;
48
+ bar?: tailwind_variants.ClassValue;
49
+ count?: tailwind_variants.ClassValue;
50
+ buttons?: tailwind_variants.ClassValue;
51
+ };
52
+ };
53
+ } | {}, {
54
+ root: string;
55
+ track: string;
56
+ slide: string;
57
+ media: string;
58
+ caption: string;
59
+ bar: string;
60
+ count: string;
61
+ buttons: string;
62
+ }, tailwind_variants.TVReturnTypeLike<unknown, {
63
+ root: string;
64
+ track: string;
65
+ slide: string;
66
+ media: string;
67
+ caption: string;
68
+ bar: string;
69
+ count: string;
70
+ buttons: string;
71
+ }>>;
72
+ type CarouselSlide = {
73
+ /** A stable id. */
74
+ id: string;
75
+ /** The still, or the poster of a loop or a film. */
76
+ src: string;
77
+ /** What it shows, in words. */
78
+ alt: string;
79
+ /** « Fig. 1a »: one line over the foot of the slide. */
80
+ caption?: string;
81
+ /** A muted loop playing while the slide is the one in view. */
82
+ video?: {
83
+ webm?: string;
84
+ mp4?: string;
85
+ };
86
+ /** A film opened by a press, with sound, in the lightbox of the MediaPlayer. */
87
+ film?: Pick<MediaPlayerProps, "src" | "title" | "tracks" | "loadHls"> & {
88
+ playLabel: string;
89
+ vertical?: boolean;
90
+ };
91
+ };
92
+ type MediaCarouselLabels = {
93
+ previous: string;
94
+ next: string;
95
+ close: string;
96
+ slide: string;
97
+ };
98
+ declare const mediaCarouselLabels: MediaCarouselLabels;
99
+ type MediaCarouselProps = Omit<React.ComponentProps<"section">, "children"> & {
100
+ /** The slides, in order: 3 to 4 realisations. */
101
+ slides: readonly CarouselSlide[];
102
+ /** The carousel's accessible name, passed translated. */
103
+ label: string;
104
+ /** The frame ratio of every slide (width / height). Default `16 / 10`. */
105
+ ratio?: string;
106
+ /** The words, passed translated; English by default. `slide` takes `{n}` and `{total}`. */
107
+ labels?: Partial<MediaCarouselLabels>;
108
+ };
109
+ /** A few realisations in one frame, one at a time: swipe, buttons or arrow keys on them; nothing advances by itself. */
110
+ declare function MediaCarousel({ slides, label, ratio, labels: given, className, ...props }: Readonly<MediaCarouselProps>): React.JSX.Element;
111
+
112
+ export { MediaCarousel, mediaCarousel, mediaCarouselLabels };
113
+ export type { CarouselSlide, MediaCarouselLabels, MediaCarouselProps };
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import {
3
+ MediaPlayer
4
+ } from "./chunk-FYPYJ6MW.js";
5
+ import {
6
+ IconButton
7
+ } from "./chunk-QHVV2JGF.js";
8
+ import "./chunk-VYZFQE3P.js";
9
+ import {
10
+ usePrefersReducedMotion
11
+ } from "./chunk-TN5JJ6JI.js";
12
+ import {
13
+ ChevronGlyph
14
+ } from "./chunk-S2O4NSN5.js";
15
+ import "./chunk-NSLXEDIS.js";
16
+
17
+ // src/media-gallery/media-carousel.tsx
18
+ import * as React from "react";
19
+ import { tv } from "tailwind-variants";
20
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
+ var mediaCarousel = tv({
22
+ slots: {
23
+ root: "relative isolate w-full",
24
+ track: "m-0 flex list-none snap-x snap-mandatory gap-3 overflow-hidden p-0 touch-pan-y",
25
+ slide: "relative m-0 w-full shrink-0 snap-center overflow-hidden rounded-xl border border-border-default bg-media",
26
+ media: "absolute inset-0 h-full w-full object-cover",
27
+ caption: "absolute inset-x-0 bottom-0 bg-linear-to-t from-scrim-strong to-transparent p-3 pt-8 text-xs font-semibold text-fg-on-media",
28
+ bar: "mt-3 flex items-center justify-between gap-3",
29
+ count: "text-xs tabular-nums text-fg-secondary",
30
+ buttons: "flex gap-2"
31
+ }
32
+ });
33
+ var s = mediaCarousel();
34
+ var mediaCarouselLabels = { previous: "Previous", next: "Next", close: "Close", slide: "{n} of {total}" };
35
+ var SWIPE_DISTANCE = 40;
36
+ function useActiveSlide(track, count) {
37
+ const [active, setActive] = React.useState(0);
38
+ const reduce = usePrefersReducedMotion();
39
+ const go = (to) => {
40
+ const el = track.current;
41
+ if (!el) return active;
42
+ const next = Math.min(count - 1, Math.max(0, to));
43
+ el.scrollTo({ left: next * (el.scrollWidth / count), behavior: reduce ? "auto" : "smooth" });
44
+ setActive(next);
45
+ return next;
46
+ };
47
+ return { active, go, reduce };
48
+ }
49
+ function useSwipe(turn) {
50
+ const from = React.useRef(null);
51
+ return {
52
+ onPointerDown: (event) => {
53
+ from.current = event.clientX;
54
+ },
55
+ onPointerUp: (event) => {
56
+ const start = from.current;
57
+ from.current = null;
58
+ if (start === null) return;
59
+ const distance = event.clientX - start;
60
+ if (Math.abs(distance) >= SWIPE_DISTANCE) turn(distance < 0 ? 1 : -1);
61
+ },
62
+ onPointerCancel: () => {
63
+ from.current = null;
64
+ }
65
+ };
66
+ }
67
+ function keepFocus(toolbar, at, count) {
68
+ if (!toolbar?.contains(document.activeElement) || count < 2) return;
69
+ const [previous, next] = toolbar.querySelectorAll("button");
70
+ if (at === 0) next?.focus();
71
+ if (at === count - 1) previous?.focus();
72
+ }
73
+ var ARROWS = { ArrowRight: 1, ArrowLeft: -1 };
74
+ function SlideMedia({ slide, playing, ratio, closeLabel }) {
75
+ if (slide.film) {
76
+ const { playLabel, vertical, ...film } = slide.film;
77
+ return /* @__PURE__ */ jsx(MediaPlayer, { ...film, mode: "lightbox", poster: slide.src, posterAlt: slide.alt, playLabel, vertical, caption: slide.caption, closeLabel, className: "h-full rounded-none border-0" });
78
+ }
79
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ /* @__PURE__ */ jsx("img", { src: slide.src, alt: slide.alt, loading: "lazy", decoding: "async", draggable: false, className: s.media(), style: { aspectRatio: ratio } }),
81
+ playing && slide.video && /* @__PURE__ */ jsxs("video", { className: s.media(), poster: slide.src, autoPlay: true, muted: true, loop: true, playsInline: true, "aria-hidden": true, tabIndex: -1, children: [
82
+ slide.video.webm && /* @__PURE__ */ jsx("source", { src: slide.video.webm, type: "video/webm" }),
83
+ slide.video.mp4 && /* @__PURE__ */ jsx("source", { src: slide.video.mp4, type: "video/mp4" })
84
+ ] }),
85
+ slide.caption && /* @__PURE__ */ jsx("figcaption", { className: s.caption(), children: slide.caption })
86
+ ] });
87
+ }
88
+ function MediaCarousel({ slides, label, ratio = "16 / 10", labels: given, className, ...props }) {
89
+ const labels = { ...mediaCarouselLabels, ...given };
90
+ const track = React.useRef(null);
91
+ const toolbar = React.useRef(null);
92
+ const { active, go, reduce } = useActiveSlide(track, slides.length);
93
+ const turn = (delta) => keepFocus(toolbar.current, go(active + delta), slides.length);
94
+ const swipe = useSwipe(turn);
95
+ const keys = (event) => {
96
+ const delta = ARROWS[event.key];
97
+ if (!delta) return;
98
+ event.preventDefault();
99
+ turn(delta);
100
+ };
101
+ const name = (i) => labels.slide.replace("{n}", String(i + 1)).replace("{total}", String(slides.length));
102
+ return /* @__PURE__ */ jsxs("section", { "aria-roledescription": "carousel", "aria-label": label, className: s.root({ className }), ...props, children: [
103
+ /* @__PURE__ */ jsx("ul", { ref: track, className: s.track(), ...swipe, children: slides.map((slide, i) => /* @__PURE__ */ jsx("li", { "aria-roledescription": "slide", "aria-label": name(i), className: s.slide(), style: { aspectRatio: ratio }, "aria-hidden": i === active ? void 0 : true, inert: i === active ? void 0 : true, children: /* @__PURE__ */ jsx("figure", { className: "m-0 h-full w-full", children: /* @__PURE__ */ jsx(SlideMedia, { slide, playing: i === active && !reduce, ratio, closeLabel: labels.close }) }) }, slide.id)) }),
104
+ /* @__PURE__ */ jsxs("div", { className: s.bar(), children: [
105
+ /* @__PURE__ */ jsxs("span", { className: s.count(), "aria-live": "polite", children: [
106
+ active + 1,
107
+ " / ",
108
+ slides.length
109
+ ] }),
110
+ /* @__PURE__ */ jsxs("div", { ref: toolbar, role: "toolbar", "aria-orientation": "horizontal", className: s.buttons(), onKeyDown: keys, children: [
111
+ /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: labels.previous, disabled: active === 0, onClick: () => turn(-1), children: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "left", className: "h-5 w-5" }) }),
112
+ /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: labels.next, disabled: active === slides.length - 1, onClick: () => turn(1), children: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "right", className: "h-5 w-5" }) })
113
+ ] })
114
+ ] })
115
+ ] });
116
+ }
117
+ export {
118
+ MediaCarousel,
119
+ mediaCarousel,
120
+ mediaCarouselLabels
121
+ };
122
+ //# sourceMappingURL=media-carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/media-gallery/media-carousel.tsx"],"sourcesContent":["// Client (the slide in view, the reader's motion preference). A few realisations in one frame: a scroll-snap track moved by\n// a swipe, previous / next buttons in a toolbar that also takes the arrow keys, a « n / N » count. Nothing advances by itself and nothing moves under the pointer; a loop plays only on the\n// slide in view (a still under reduced motion); a slide with a film opens it in the MediaPlayer lightbox.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { IconButton } from \"../button/button\";\nimport { ChevronGlyph } from \"../glyphs\";\nimport { usePrefersReducedMotion } from \"../media\";\nimport { MediaPlayer, type MediaPlayerProps } from \"./media-player\";\n\nexport const mediaCarousel = tv({\n slots: {\n root: \"relative isolate w-full\",\n track: \"m-0 flex list-none snap-x snap-mandatory gap-3 overflow-hidden p-0 touch-pan-y\",\n slide: \"relative m-0 w-full shrink-0 snap-center overflow-hidden rounded-xl border border-border-default bg-media\",\n media: \"absolute inset-0 h-full w-full object-cover\",\n caption: \"absolute inset-x-0 bottom-0 bg-linear-to-t from-scrim-strong to-transparent p-3 pt-8 text-xs font-semibold text-fg-on-media\",\n bar: \"mt-3 flex items-center justify-between gap-3\",\n count: \"text-xs tabular-nums text-fg-secondary\",\n buttons: \"flex gap-2\",\n },\n});\nconst s = mediaCarousel();\n\nexport type CarouselSlide = {\n /** A stable id. */\n id: string;\n /** The still, or the poster of a loop or a film. */\n src: string;\n /** What it shows, in words. */\n alt: string;\n /** « Fig. 1a »: one line over the foot of the slide. */\n caption?: string;\n /** A muted loop playing while the slide is the one in view. */\n video?: { webm?: string; mp4?: string };\n /** A film opened by a press, with sound, in the lightbox of the MediaPlayer. */\n film?: Pick<MediaPlayerProps, \"src\" | \"title\" | \"tracks\" | \"loadHls\"> & { playLabel: string; vertical?: boolean };\n};\n\nexport type MediaCarouselLabels = { previous: string; next: string; close: string; slide: string };\nexport const mediaCarouselLabels: MediaCarouselLabels = { previous: \"Previous\", next: \"Next\", close: \"Close\", slide: \"{n} of {total}\" };\n\nexport type MediaCarouselProps = Omit<React.ComponentProps<\"section\">, \"children\"> & {\n /** The slides, in order: 3 to 4 realisations. */\n slides: readonly CarouselSlide[];\n /** The carousel's accessible name, passed translated. */\n label: string;\n /** The frame ratio of every slide (width / height). Default `16 / 10`. */\n ratio?: string;\n /** The words, passed translated; English by default. `slide` takes `{n}` and `{total}`. */\n labels?: Partial<MediaCarouselLabels>;\n};\n\n/** How far a swipe travels, in CSS pixels, before it turns the slide. */\nconst SWIPE_DISTANCE = 40;\n\n/** The slide in view and the one way to change it: the track scrolls only from here, so it holds no scroll of its own to reach. */\nfunction useActiveSlide(track: React.RefObject<HTMLUListElement | null>, count: number) {\n const [active, setActive] = React.useState(0);\n const reduce = usePrefersReducedMotion();\n const go = (to: number) => {\n const el = track.current;\n if (!el) return active;\n const next = Math.min(count - 1, Math.max(0, to));\n el.scrollTo({ left: next * (el.scrollWidth / count), behavior: reduce ? \"auto\" : \"smooth\" });\n setActive(next);\n return next;\n };\n return { active, go, reduce };\n}\n\n/** A horizontal swipe on the track turns one slide; a vertical one stays the page's scroll (`touch-action: pan-y`). */\nfunction useSwipe(turn: (delta: 1 | -1) => void) {\n const from = React.useRef<number | null>(null);\n return {\n onPointerDown: (event: React.PointerEvent) => {\n from.current = event.clientX;\n },\n onPointerUp: (event: React.PointerEvent) => {\n const start = from.current;\n from.current = null;\n if (start === null) return;\n const distance = event.clientX - start;\n if (Math.abs(distance) >= SWIPE_DISTANCE) turn(distance < 0 ? 1 : -1);\n },\n onPointerCancel: () => {\n from.current = null;\n },\n };\n}\n\n/** At an end the button just used is disabled: the focus moves to the other one, never to the page. */\nfunction keepFocus(toolbar: HTMLElement | null, at: number, count: number) {\n if (!toolbar?.contains(document.activeElement) || count < 2) return;\n const [previous, next] = toolbar.querySelectorAll(\"button\");\n if (at === 0) next?.focus();\n if (at === count - 1) previous?.focus();\n}\n\n/** The arrow keys of the toolbar: right turns forward, left back. */\nconst ARROWS: Partial<Record<string, 1 | -1>> = { ArrowRight: 1, ArrowLeft: -1 };\n\nfunction SlideMedia({ slide, playing, ratio, closeLabel }: Readonly<{ slide: CarouselSlide; playing: boolean; ratio: string; closeLabel: string }>) {\n if (slide.film) {\n const { playLabel, vertical, ...film } = slide.film;\n return <MediaPlayer {...film} mode=\"lightbox\" poster={slide.src} posterAlt={slide.alt} playLabel={playLabel} vertical={vertical} caption={slide.caption} closeLabel={closeLabel} className=\"h-full rounded-none border-0\" />;\n }\n return (\n <>\n <img src={slide.src} alt={slide.alt} loading=\"lazy\" decoding=\"async\" draggable={false} className={s.media()} style={{ aspectRatio: ratio }} />\n {playing && slide.video && (\n <video className={s.media()} poster={slide.src} autoPlay muted loop playsInline aria-hidden tabIndex={-1}>\n {slide.video.webm && <source src={slide.video.webm} type=\"video/webm\" />}\n {slide.video.mp4 && <source src={slide.video.mp4} type=\"video/mp4\" />}\n </video>\n )}\n {slide.caption && <figcaption className={s.caption()}>{slide.caption}</figcaption>}\n </>\n );\n}\n\n/** A few realisations in one frame, one at a time: swipe, buttons or arrow keys on them; nothing advances by itself. */\nexport function MediaCarousel({ slides, label, ratio = \"16 / 10\", labels: given, className, ...props }: Readonly<MediaCarouselProps>) {\n const labels = { ...mediaCarouselLabels, ...given };\n const track = React.useRef<HTMLUListElement>(null);\n const toolbar = React.useRef<HTMLDivElement>(null);\n const { active, go, reduce } = useActiveSlide(track, slides.length);\n const turn = (delta: 1 | -1) => keepFocus(toolbar.current, go(active + delta), slides.length);\n const swipe = useSwipe(turn);\n const keys = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const delta = ARROWS[event.key];\n if (!delta) return;\n event.preventDefault();\n turn(delta);\n };\n const name = (i: number) => labels.slide.replace(\"{n}\", String(i + 1)).replace(\"{total}\", String(slides.length));\n return (\n <section aria-roledescription=\"carousel\" aria-label={label} className={s.root({ className })} {...props}>\n <ul ref={track} className={s.track()} {...swipe}>\n {slides.map((slide, i) => (\n <li key={slide.id} aria-roledescription=\"slide\" aria-label={name(i)} className={s.slide()} style={{ aspectRatio: ratio }} aria-hidden={i === active ? undefined : true} inert={i === active ? undefined : true}>\n <figure className=\"m-0 h-full w-full\">\n <SlideMedia slide={slide} playing={i === active && !reduce} ratio={ratio} closeLabel={labels.close} />\n </figure>\n </li>\n ))}\n </ul>\n <div className={s.bar()}>\n <span className={s.count()} aria-live=\"polite\">{active + 1} / {slides.length}</span>\n <div ref={toolbar} role=\"toolbar\" aria-orientation=\"horizontal\" className={s.buttons()} onKeyDown={keys}>\n <IconButton variant=\"secondary\" label={labels.previous} disabled={active === 0} onClick={() => turn(-1)}>\n <ChevronGlyph direction=\"left\" className=\"h-5 w-5\" />\n </IconButton>\n <IconButton variant=\"secondary\" label={labels.next} disabled={active === slides.length - 1} onClick={() => turn(1)}>\n <ChevronGlyph direction=\"right\" className=\"h-5 w-5\" />\n </IconButton>\n </div>\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsGR,SAGP,UAHO,KAMH,YANG;AA/FJ,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AACF,CAAC;AACD,IAAM,IAAI,cAAc;AAkBjB,IAAM,sBAA2C,EAAE,UAAU,YAAY,MAAM,QAAQ,OAAO,SAAS,OAAO,iBAAiB;AActI,IAAM,iBAAiB;AAGvB,SAAS,eAAe,OAAiD,OAAe;AACtF,QAAM,CAAC,QA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AAU,WAAU,GACtD;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,177 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as React from 'react';
3
+
4
+ /** What `loadHls` resolves to: the module of hls.js (only the members the player uses are typed). */
5
+ type HlsModule = {
6
+ default: {
7
+ new (config?: Record<string, unknown>): {
8
+ loadSource(url: string): void;
9
+ attachMedia(media: HTMLMediaElement): void;
10
+ destroy(): void;
11
+ startLoad(): void;
12
+ recoverMediaError(): void;
13
+ on(event: string, listener: (event: string, data: {
14
+ fatal?: boolean;
15
+ type?: string;
16
+ }) => void): void;
17
+ };
18
+ isSupported(): boolean;
19
+ Events: {
20
+ ERROR: string;
21
+ };
22
+ ErrorTypes: {
23
+ NETWORK_ERROR: string;
24
+ MEDIA_ERROR: string;
25
+ };
26
+ };
27
+ };
28
+ type VideoTrack = {
29
+ /** The WebVTT file. */
30
+ src: string;
31
+ /** Its language, BCP 47 (`"fr"`). */
32
+ srcLang: string;
33
+ /** Its name in the menu ("Français"), passed translated. */
34
+ label: string;
35
+ /** `subtitles` (default) or `captions` (with the sounds, for deaf viewers). */
36
+ kind?: "subtitles" | "captions";
37
+ /** Shown from the start. */
38
+ default?: boolean;
39
+ };
40
+ type VideoPlayerLabels = {
41
+ play: string;
42
+ pause: string;
43
+ mute: string;
44
+ unmute: string;
45
+ volume: string;
46
+ seek: string;
47
+ /** The speed button: `(rate) => "Speed " + rate + "×"`. */
48
+ speed: (rate: number) => string;
49
+ /** The captions button: `(track) => "Subtitles: " + (track ?? "off")`, the track's label or `null` when off. */
50
+ captions: (track: string | null) => string;
51
+ fullscreen: string;
52
+ exitFullscreen: string;
53
+ pictureInPicture: string;
54
+ /** Read while the video waits for data. */
55
+ loading: string;
56
+ /** The video cannot play. */
57
+ error: string;
58
+ /** Tries again (resolves a signed `src` again). */
59
+ retry: string;
60
+ /** The seek slider's value: `(time, duration) => "1:05 of 3:20"`. */
61
+ time: (time: string, duration: string) => string;
62
+ };
63
+ type VideoPlayerProps = {
64
+ /** The address of the video (MP4, WebM, or an HLS `.m3u8`), or a function that resolves a signed one when needed. */
65
+ src: string | (() => Promise<string>);
66
+ /** `auto` (default): HLS when the address ends in `.m3u8`. */
67
+ type?: "auto" | "hls" | "file";
68
+ /** Loads hls.js when the browser cannot play HLS itself: `() => import("hls.js")`. Without it, HLS needs Safari. */
69
+ loadHls?: () => Promise<HlsModule>;
70
+ /** The accessible name of the player ("Video: Sunset over Montréal"), passed translated. */
71
+ title: string;
72
+ /** The picture shown before playback. */
73
+ poster?: string;
74
+ /** Starts playing, muted (browsers refuse sound without a gesture), once on screen and again each time it comes back — not under reduced motion. */
75
+ autoPlay?: boolean;
76
+ /** Starts muted. */
77
+ muted?: boolean;
78
+ /** Starts playing as soon as it mounts, with sound: for a player opened by a press (a lightbox), never for one that was already on the page. */
79
+ playOnMount?: boolean;
80
+ /** Plays again from the start at the end. */
81
+ loop?: boolean;
82
+ /** How much to fetch before playback: `none` (a list of many videos), `metadata` (default), `auto`. */
83
+ preload?: "none" | "metadata" | "auto";
84
+ /** Subtitles or captions (WebVTT): the C key and a button cycle through them. */
85
+ tracks?: readonly VideoTrack[];
86
+ /** The speeds offered by the speed button. Default `[0.5, 1, 1.25, 1.5, 2]`. */
87
+ playbackRates?: readonly number[];
88
+ /** Pauses when less than a quarter of the player is on screen. Default `true`. */
89
+ pauseWhenHidden?: boolean;
90
+ /** Shows the controls (default). `false`: a bare video (a background loop) — give it no sound. */
91
+ controls?: boolean;
92
+ /** Covers the video and hides the controls: a gate (sign in, unlock, age check) drawn by the app. */
93
+ overlay?: React.ReactNode;
94
+ /** The width / height ratio of the frame. Default `"16 / 9"`; `"9 / 16"` for a vertical video. */
95
+ aspectRatio?: string;
96
+ /** Called when playback starts. */
97
+ onPlay?: () => void;
98
+ /** Called when playback pauses. */
99
+ onPause?: () => void;
100
+ /** Called at the end. */
101
+ onEnded?: () => void;
102
+ /** Called as the time moves, in seconds (a few times a second). */
103
+ onTimeUpdate?: (time: number) => void;
104
+ /** Called when the video cannot play (a network failure, an expired address). */
105
+ onError?: (error: unknown) => void;
106
+ /** The words, passed translated; English by default. */
107
+ labels?: Partial<VideoPlayerLabels>;
108
+ /** Classes merged on the root. */
109
+ className?: string;
110
+ };
111
+
112
+ declare const mediaPlayer: tailwind_variants.TVReturnType<{
113
+ [key: string]: {
114
+ [key: string]: tailwind_variants.ClassValue | {
115
+ caption?: tailwind_variants.ClassValue;
116
+ image?: tailwind_variants.ClassValue;
117
+ poster?: tailwind_variants.ClassValue;
118
+ play?: tailwind_variants.ClassValue;
119
+ };
120
+ };
121
+ } | {
122
+ [x: string]: {
123
+ [x: string]: tailwind_variants.ClassValue | {
124
+ caption?: tailwind_variants.ClassValue;
125
+ image?: tailwind_variants.ClassValue;
126
+ poster?: tailwind_variants.ClassValue;
127
+ play?: tailwind_variants.ClassValue;
128
+ };
129
+ };
130
+ } | {}, {
131
+ poster: string;
132
+ image: string;
133
+ play: string;
134
+ caption: string;
135
+ }, undefined, {
136
+ [key: string]: {
137
+ [key: string]: tailwind_variants.ClassValue | {
138
+ caption?: tailwind_variants.ClassValue;
139
+ image?: tailwind_variants.ClassValue;
140
+ poster?: tailwind_variants.ClassValue;
141
+ play?: tailwind_variants.ClassValue;
142
+ };
143
+ };
144
+ } | {}, {
145
+ poster: string;
146
+ image: string;
147
+ play: string;
148
+ caption: string;
149
+ }, tailwind_variants.TVReturnTypeLike<unknown, {
150
+ poster: string;
151
+ image: string;
152
+ play: string;
153
+ caption: string;
154
+ }>>;
155
+ type MediaPlayerProps = Pick<VideoPlayerProps, "src" | "poster" | "title" | "tracks" | "loadHls" | "labels" | "onPlay" | "onPause" | "onEnded" | "onError"> & {
156
+ /** `inline`: the player itself. `lightbox`: a poster that opens it in a dialog. Default `inline`. */
157
+ mode?: "inline" | "lightbox";
158
+ /** `9 / 16` frame for a vertical film; default `16 / 9`. */
159
+ vertical?: boolean;
160
+ /** The poster's words in the lightbox ("Play the film"), passed translated. Required for `lightbox`. */
161
+ playLabel?: string;
162
+ /** The close button's words, passed translated. Default `Close`. */
163
+ closeLabel?: string;
164
+ /** What the poster shows, in words (the `alt` of its image); default is empty (decorative: `playLabel` names the button). */
165
+ posterAlt?: string;
166
+ /** A line over the foot of the poster (« Fig. 1a »). */
167
+ caption?: string;
168
+ /** Called when the lightbox opens or closes. */
169
+ onOpenChange?: (open: boolean) => void;
170
+ /** Classes merged on the player or the poster. */
171
+ className?: string;
172
+ };
173
+ /** A video in one frame: inline, in a lightbox (a press opens it with sound), 16:9 or vertical. */
174
+ declare function MediaPlayer({ mode, vertical, playLabel, closeLabel, posterAlt, caption, onOpenChange, className, ...player }: MediaPlayerProps): React.JSX.Element;
175
+
176
+ export { MediaPlayer, mediaPlayer };
177
+ export type { MediaPlayerProps };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import {
3
+ MediaPlayer,
4
+ mediaPlayer
5
+ } from "./chunk-FYPYJ6MW.js";
6
+ import "./chunk-VYZFQE3P.js";
7
+ import "./chunk-TN5JJ6JI.js";
8
+ import "./chunk-S2O4NSN5.js";
9
+ import "./chunk-NSLXEDIS.js";
10
+ export {
11
+ MediaPlayer,
12
+ mediaPlayer
13
+ };
14
+ //# sourceMappingURL=media-player.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/motion.css CHANGED
@@ -151,6 +151,13 @@
151
151
  .maplibregl-canvas { position: absolute; left: 0; top: 0; }
152
152
  .maplibregl-canvas-container.maplibregl-interactive { cursor: grab; }
153
153
  .maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }
154
+ /* The engine's cooperative-gestures overlay ("Ctrl + scroll to zoom the map"), in the map's words (`labels.hint*`) and the tokens: shown on a plain wheel, gone by itself — a fade, nothing moves. */
155
+ .maplibregl-cooperative-gesture-screen { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 1rem; background: color-mix(in srgb, var(--kz-surface-1) 82%, transparent); color: var(--kz-text-primary); font-size: 0.875rem; line-height: 1.3; text-align: center; opacity: 0; pointer-events: none; transition: opacity 1s 1s; }
156
+ .maplibregl-cooperative-gesture-screen.maplibregl-show { opacity: 1; transition: opacity 0.05s; }
157
+ .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message { display: none; }
158
+ @media (hover: none) { .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message { display: none; } .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message { display: block; } }
159
+ @media (prefers-reduced-motion: reduce) { .maplibregl-cooperative-gesture-screen, .maplibregl-cooperative-gesture-screen.maplibregl-show { transition: none; } }
160
+ .maplibregl-cooperative-gestures .maplibregl-canvas { touch-action: pan-x pan-y; }
154
161
  .maplibregl-marker { position: absolute; top: 0; left: 0; will-change: transform; }
155
162
  .kz-map-user { position: relative; width: 16px; height: 16px; border-radius: 9999px; background: var(--kz-accent); border: 3px solid var(--kz-surface-1); box-shadow: var(--kz-shadow-md); }
156
163
  .kz-map-user::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; background: var(--kz-accent); opacity: 0.35; animation: kz-map-pulse 2s var(--kz-ease) infinite; }
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ import {
3
+ IconButton
4
+ } from "./chunk-QHVV2JGF.js";
5
+ import {
6
+ VideoPlayer
7
+ } from "./chunk-VYZFQE3P.js";
8
+ import "./chunk-TN5JJ6JI.js";
9
+ import "./chunk-S2O4NSN5.js";
10
+ import "./chunk-NSLXEDIS.js";
11
+
12
+ // src/dialog/dialog.tsx
13
+ import { Dialog as DialogPrimitive } from "radix-ui";
14
+ import { tv } from "tailwind-variants";
15
+
16
+ // src/dialog/return-focus.ts
17
+ import * as React from "react";
18
+ function useReturnFocus(onCloseAutoFocus) {
19
+ const [opener] = React.useState(() => typeof document === "undefined" ? null : document.activeElement);
20
+ return React.useCallback(
21
+ (event) => {
22
+ onCloseAutoFocus?.(event);
23
+ if (event.defaultPrevented) return;
24
+ if (opener instanceof HTMLElement && opener !== document.body && opener.isConnected) {
25
+ event.preventDefault();
26
+ opener.focus();
27
+ }
28
+ },
29
+ [opener, onCloseAutoFocus]
30
+ );
31
+ }
32
+
33
+ // src/dialog/dialog.tsx
34
+ import { jsx, jsxs } from "react/jsx-runtime";
35
+ var dialog = tv({
36
+ slots: {
37
+ overlay: "kz-overlay fixed inset-0 z-50 bg-overlay",
38
+ content: "kz-dialog fixed z-50 flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg shadow-lg focus:outline-hidden",
39
+ close: "absolute right-3 top-3 h-9 w-9",
40
+ header: "flex flex-col gap-1 px-5 pb-2 pr-14 pt-5",
41
+ title: "text-base font-bold text-fg",
42
+ description: "text-sm text-fg-secondary",
43
+ body: "min-h-0 flex-1 overflow-y-auto px-5 pb-5",
44
+ footer: "flex flex-wrap items-center justify-end gap-2 border-t border-border-subtle px-5 py-4 pb-[max(1rem,env(safe-area-inset-bottom))]"
45
+ },
46
+ variants: {
47
+ placement: {
48
+ center: { content: "left-1/2 top-1/2 max-h-[85dvh] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl" },
49
+ /* A sheet: anchored at the bottom on a phone, centred from `sm` up. */
50
+ bottom: {
51
+ content: "inset-x-0 bottom-0 max-h-[92dvh] rounded-t-[1.75rem] sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:w-full sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-[1.75rem]"
52
+ },
53
+ right: { content: "inset-y-0 right-0 h-full w-full max-w-md rounded-none border-y-0 border-r-0" },
54
+ /* A navigation drawer: full height, from the left, clear of the notch. */
55
+ left: { content: "inset-y-0 left-0 h-full w-full max-w-md rounded-none border-y-0 border-l-0 pl-[env(safe-area-inset-left)]" }
56
+ },
57
+ size: { sm: { content: "sm:max-w-sm" }, md: { content: "sm:max-w-md" }, lg: { content: "sm:max-w-2xl" } }
58
+ },
59
+ defaultVariants: { placement: "center", size: "md" }
60
+ });
61
+ var s = dialog();
62
+ function CloseIcon() {
63
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" }) });
64
+ }
65
+ var prevent = (event) => event.preventDefault();
66
+ function ReturnFocusContent({ onCloseAutoFocus, ...props }) {
67
+ return /* @__PURE__ */ jsx(DialogPrimitive.Content, { onCloseAutoFocus: useReturnFocus(onCloseAutoFocus), ...props });
68
+ }
69
+ function DialogContent({
70
+ placement,
71
+ size,
72
+ closeLabel,
73
+ hideClose,
74
+ dismissible = true,
75
+ container,
76
+ className,
77
+ children,
78
+ onEscapeKeyDown,
79
+ onPointerDownOutside,
80
+ onInteractOutside,
81
+ ...props
82
+ }) {
83
+ const v = dialog({ placement, size });
84
+ return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { container, children: [
85
+ /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: v.overlay() }),
86
+ /* @__PURE__ */ jsxs(
87
+ ReturnFocusContent,
88
+ {
89
+ "data-placement": placement ?? "center",
90
+ "data-dismissible": dismissible ? void 0 : "false",
91
+ className: v.content({ className }),
92
+ onEscapeKeyDown: dismissible ? onEscapeKeyDown : chain(onEscapeKeyDown, prevent),
93
+ onPointerDownOutside: dismissible ? onPointerDownOutside : chain(onPointerDownOutside, prevent),
94
+ onInteractOutside: dismissible ? onInteractOutside : chain(onInteractOutside, prevent),
95
+ ...props,
96
+ children: [
97
+ children,
98
+ !hideClose && /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { label: closeLabel, variant: "ghost", shape: "pill", className: v.close(), children: /* @__PURE__ */ jsx(CloseIcon, {}) }) })
99
+ ]
100
+ }
101
+ )
102
+ ] });
103
+ }
104
+ function chain(handler, then) {
105
+ return (event) => {
106
+ handler?.(event);
107
+ then(event);
108
+ };
109
+ }
110
+ function DialogHeader({ className, ...props }) {
111
+ return /* @__PURE__ */ jsx("div", { className: s.header({ className }), ...props });
112
+ }
113
+ function DialogTitle({ className, ...props }) {
114
+ return /* @__PURE__ */ jsx(DialogPrimitive.Title, { className: s.title({ className }), ...props });
115
+ }
116
+ function DialogDescription({ className, ...props }) {
117
+ return /* @__PURE__ */ jsx(DialogPrimitive.Description, { className: s.description({ className }), ...props });
118
+ }
119
+ function DialogBody({ className, ...props }) {
120
+ return /* @__PURE__ */ jsx("div", { className: s.body({ className }), ...props });
121
+ }
122
+ function DialogFooter({ className, ...props }) {
123
+ return /* @__PURE__ */ jsx("div", { className: s.footer({ className }), ...props });
124
+ }
125
+ var Dialog = {
126
+ Root: DialogPrimitive.Root,
127
+ Trigger: DialogPrimitive.Trigger,
128
+ Close: DialogPrimitive.Close,
129
+ Content: DialogContent,
130
+ Header: DialogHeader,
131
+ Title: DialogTitle,
132
+ Description: DialogDescription,
133
+ Body: DialogBody,
134
+ Footer: DialogFooter
135
+ };
136
+
137
+ // src/media-gallery/player-lightbox.tsx
138
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
139
+ function PlayerLightbox({ player, ratio, vertical, closeLabel, onClose }) {
140
+ return /* @__PURE__ */ jsx2(Dialog.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs2(Dialog.Content, { size: vertical ? "sm" : "lg", closeLabel, className: "bg-media p-0", children: [
141
+ /* @__PURE__ */ jsx2(Dialog.Title, { className: "sr-only", children: player.title }),
142
+ /* @__PURE__ */ jsx2(VideoPlayer, { ...player, aspectRatio: ratio, playOnMount: true, pauseWhenHidden: false })
143
+ ] }) });
144
+ }
145
+ export {
146
+ PlayerLightbox as default
147
+ };
148
+ //# sourceMappingURL=player-lightbox-ETBQWDOT.js.map