@krizaka/ui 3.84.0 → 3.86.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/dist/app-header/search.js +1 -1
- package/dist/app-shell.js +16 -25
- package/dist/app-shell.js.map +1 -1
- package/dist/bird-plate.js +1 -1
- package/dist/card-grid.js +1 -1
- package/dist/{chunk-DJ5ZPPWL.js → chunk-7P7I5OQV.js} +2 -2
- package/dist/{chunk-27AWSJTK.js → chunk-EDQLPCM4.js} +2 -2
- package/dist/chunk-GOGEYAYK.js +66 -0
- package/dist/chunk-GOGEYAYK.js.map +1 -0
- package/dist/chunk-QHVV2JGF.js +144 -0
- package/dist/chunk-QHVV2JGF.js.map +1 -0
- package/dist/chunk-S2O4NSN5.js +72 -0
- package/dist/{chunk-GFRUTPGG.js.map → chunk-S2O4NSN5.js.map} +1 -1
- package/dist/chunk-TN5JJ6JI.js +60 -0
- package/dist/chunk-TN5JJ6JI.js.map +1 -0
- package/dist/{chunk-XVXFMVG3.js → chunk-TVLRE7S3.js} +2 -2
- package/dist/chunk-VYZFQE3P.js +518 -0
- package/dist/chunk-VYZFQE3P.js.map +1 -0
- package/dist/{chunk-7MQNG35Q.js → chunk-ZKKMYIDN.js} +3 -2
- package/dist/chunk-ZKKMYIDN.js.map +1 -0
- package/dist/code-block.js +2 -2
- package/dist/cover-hero.js +3 -3
- package/dist/flock.js +1 -1
- package/dist/grade-stamp.js +2 -2
- package/dist/map.d.ts +6 -6
- package/dist/mascot-quote.js +1 -1
- package/dist/media-carousel.d.ts +120 -0
- package/dist/media-carousel.js +131 -0
- package/dist/media-carousel.js.map +1 -0
- package/dist/media-player.d.ts +191 -0
- package/dist/media-player.js +14 -0
- package/dist/media-player.js.map +1 -0
- package/dist/pausable-loop.d.ts +27 -0
- package/dist/pausable-loop.js +68 -0
- package/dist/pausable-loop.js.map +1 -0
- package/dist/player-lightbox-ASFOSUSD.js +151 -0
- package/dist/player-lightbox-ASFOSUSD.js.map +1 -0
- package/dist/rail-nav.js +3 -3
- package/dist/retro-tv-playlist.d.ts +2 -0
- package/dist/retro-tv.js +1 -1
- package/dist/site-cahier.js +4 -4
- package/dist/taped-photo.js +2 -2
- package/dist/toc.js +1 -1
- package/dist/versus-card.js +1 -1
- package/dist/video-player.d.ts +3 -1
- package/dist/video-player.js +1 -1
- package/dist/wall.js +2 -2
- package/package.json +45 -3
- package/registry/app-frame.json +1 -1
- package/registry/examples/media-gallery/carousel-loop.d.ts +4 -0
- package/registry/examples/media-gallery/carousel-loop.js +26 -0
- package/registry/examples/media-gallery/carousel-loop.tsx +24 -0
- package/registry/examples/media-gallery/carousel-single.d.ts +4 -0
- package/registry/examples/media-gallery/carousel-single.js +12 -0
- package/registry/examples/media-gallery/carousel-single.tsx +12 -0
- package/registry/examples/media-gallery/carousel.d.ts +4 -0
- package/registry/examples/media-gallery/carousel.js +22 -0
- package/registry/examples/media-gallery/carousel.tsx +20 -0
- package/registry/examples/media-gallery/player-trigger.d.ts +4 -0
- package/registry/examples/media-gallery/player-trigger.js +20 -0
- package/registry/examples/media-gallery/player-trigger.tsx +19 -0
- package/registry/examples/media-gallery/player.d.ts +4 -0
- package/registry/examples/media-gallery/player.js +15 -0
- package/registry/examples/media-gallery/player.tsx +13 -0
- package/registry/index.json +16 -11
- package/registry/map.json +1 -1
- package/registry/media-gallery.json +93 -6
- package/registry/nav-bar.json +1 -1
- package/registry/rail-nav.json +1 -1
- package/registry/retro-tv.json +14 -0
- package/registry/shop.json +1 -1
- package/registry/site-footer.json +1 -1
- package/registry/video-player.json +15 -1
- package/dist/chunk-7MQNG35Q.js.map +0 -1
- package/dist/chunk-GFRUTPGG.js +0 -43
- /package/dist/{chunk-DJ5ZPPWL.js.map → chunk-7P7I5OQV.js.map} +0 -0
- /package/dist/{chunk-27AWSJTK.js.map → chunk-EDQLPCM4.js.map} +0 -0
- /package/dist/{chunk-XVXFMVG3.js.map → chunk-TVLRE7S3.js.map} +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
frame?: tailwind_variants.ClassValue;
|
|
117
|
+
image?: tailwind_variants.ClassValue;
|
|
118
|
+
poster?: tailwind_variants.ClassValue;
|
|
119
|
+
play?: tailwind_variants.ClassValue;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
} | {
|
|
123
|
+
[x: string]: {
|
|
124
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
125
|
+
caption?: tailwind_variants.ClassValue;
|
|
126
|
+
frame?: tailwind_variants.ClassValue;
|
|
127
|
+
image?: tailwind_variants.ClassValue;
|
|
128
|
+
poster?: tailwind_variants.ClassValue;
|
|
129
|
+
play?: tailwind_variants.ClassValue;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
} | {}, {
|
|
133
|
+
frame: string;
|
|
134
|
+
poster: string;
|
|
135
|
+
image: string;
|
|
136
|
+
play: string;
|
|
137
|
+
caption: string;
|
|
138
|
+
}, undefined, {
|
|
139
|
+
[key: string]: {
|
|
140
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
141
|
+
caption?: tailwind_variants.ClassValue;
|
|
142
|
+
frame?: tailwind_variants.ClassValue;
|
|
143
|
+
image?: tailwind_variants.ClassValue;
|
|
144
|
+
poster?: tailwind_variants.ClassValue;
|
|
145
|
+
play?: tailwind_variants.ClassValue;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
} | {}, {
|
|
149
|
+
frame: string;
|
|
150
|
+
poster: string;
|
|
151
|
+
image: string;
|
|
152
|
+
play: string;
|
|
153
|
+
caption: string;
|
|
154
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
155
|
+
frame: string;
|
|
156
|
+
poster: string;
|
|
157
|
+
image: string;
|
|
158
|
+
play: string;
|
|
159
|
+
caption: string;
|
|
160
|
+
}>>;
|
|
161
|
+
type MediaPlayerProps = Pick<VideoPlayerProps, "src" | "poster" | "title" | "tracks" | "loadHls" | "labels" | "onPlay" | "onPause" | "onEnded" | "onError"> & {
|
|
162
|
+
/** `inline`: the player itself. `lightbox`: a poster that opens it in a dialog. Default `inline`. */
|
|
163
|
+
mode?: "inline" | "lightbox";
|
|
164
|
+
/** `9 / 16` frame and the narrow dialog for a vertical film; default `16 / 9`. */
|
|
165
|
+
vertical?: boolean;
|
|
166
|
+
/** Any frame ratio (`19 / 16`, `4 / 3`): wins over the frame of `vertical` (give both for a portrait ratio: `vertical ratio="3 / 4"`). Default `16 / 9` (`9 / 16` when `vertical`). */
|
|
167
|
+
ratio?: string;
|
|
168
|
+
/** The poster's words in the lightbox ("Play the film"), passed translated. Required for `lightbox`. */
|
|
169
|
+
playLabel?: string;
|
|
170
|
+
/** The close button's words, passed translated. Default `Close`. */
|
|
171
|
+
closeLabel?: string;
|
|
172
|
+
/** What the poster shows, in words (the `alt` of its image); default is empty (decorative: `playLabel` names the button). */
|
|
173
|
+
posterAlt?: string;
|
|
174
|
+
/** A line over the foot of the poster (« Fig. 1a »). */
|
|
175
|
+
caption?: string;
|
|
176
|
+
/** Lightbox: drawn over the poster, under its press (the frame is `relative`): a `<PausableLoop>` of `@krizaka/ui/pausable-loop` previews the film with a muted loop. */
|
|
177
|
+
preview?: React.ReactNode;
|
|
178
|
+
/** Lightbox: opens or closes it from outside (controlled). With it, `onOpenChange` is how the lightbox asks to close. */
|
|
179
|
+
open?: boolean;
|
|
180
|
+
/** Lightbox: replaces the poster with your own opener (`(open) => <button onClick={open}>…`); `null` draws nothing, for a lightbox driven by `open` alone. */
|
|
181
|
+
trigger?: ((open: () => void) => React.ReactNode) | null;
|
|
182
|
+
/** Called when the lightbox opens or closes. */
|
|
183
|
+
onOpenChange?: (open: boolean) => void;
|
|
184
|
+
/** Classes merged on the player or the poster. */
|
|
185
|
+
className?: string;
|
|
186
|
+
};
|
|
187
|
+
/** A video in one frame: inline, in a lightbox (a press opens it with sound), 16:9 or vertical. */
|
|
188
|
+
declare function MediaPlayer({ mode, vertical, playLabel, closeLabel, posterAlt, caption, preview, open: given, trigger, onOpenChange, ratio: freeRatio, className, ...player }: MediaPlayerProps): React.JSX.Element;
|
|
189
|
+
|
|
190
|
+
export { MediaPlayer, mediaPlayer };
|
|
191
|
+
export type { MediaPlayerProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
MediaPlayer,
|
|
4
|
+
mediaPlayer
|
|
5
|
+
} from "./chunk-GOGEYAYK.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":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type LoopSources = {
|
|
4
|
+
webm?: string;
|
|
5
|
+
mp4?: string;
|
|
6
|
+
};
|
|
7
|
+
type LoopLabels = {
|
|
8
|
+
pause: string;
|
|
9
|
+
play: string;
|
|
10
|
+
};
|
|
11
|
+
type PausableLoopProps = {
|
|
12
|
+
/** The loop's files; `mp4` and / or `webm`. */
|
|
13
|
+
sources: LoopSources;
|
|
14
|
+
/** The still under the loop, shown first and kept under reduced motion or Save-Data. */
|
|
15
|
+
poster: string;
|
|
16
|
+
/** Plays only while `true` (e.g. the slide in view). Default `true`. */
|
|
17
|
+
active?: boolean;
|
|
18
|
+
/** The pause / play words, passed translated. English by default. */
|
|
19
|
+
labels?: LoopLabels;
|
|
20
|
+
/** Classes of the `<video>`; default fills its frame, cropped. */
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
/** A muted, silent loop over a still, with a visible pause / play. Drop it into a frame that is `relative`: `MediaPlayer`'s `preview`, `MediaCarousel`'s `renderLoop`. */
|
|
24
|
+
declare function PausableLoop({ sources, poster, active, labels, className }: Readonly<PausableLoopProps>): React.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { PausableLoop };
|
|
27
|
+
export type { LoopLabels, LoopSources, PausableLoopProps };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
playSafely,
|
|
4
|
+
useInView,
|
|
5
|
+
usePrefersReducedMotion
|
|
6
|
+
} from "./chunk-TN5JJ6JI.js";
|
|
7
|
+
import {
|
|
8
|
+
PauseGlyph,
|
|
9
|
+
PlayGlyph
|
|
10
|
+
} from "./chunk-S2O4NSN5.js";
|
|
11
|
+
import {
|
|
12
|
+
cn
|
|
13
|
+
} from "./chunk-NSLXEDIS.js";
|
|
14
|
+
|
|
15
|
+
// src/media-gallery/pausable-loop.tsx
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var loopLabels = { pause: "Pause the animation", play: "Play the animation" };
|
|
19
|
+
var subscribeLoad = (notify) => {
|
|
20
|
+
window.addEventListener("load", notify);
|
|
21
|
+
return () => window.removeEventListener("load", notify);
|
|
22
|
+
};
|
|
23
|
+
function usePageLoaded() {
|
|
24
|
+
return React.useSyncExternalStore(subscribeLoad, () => document.readyState === "complete", () => false);
|
|
25
|
+
}
|
|
26
|
+
function useCalm() {
|
|
27
|
+
const reduce = usePrefersReducedMotion();
|
|
28
|
+
return reduce || typeof navigator !== "undefined" && Boolean(navigator.connection?.saveData);
|
|
29
|
+
}
|
|
30
|
+
function PausableLoop({ sources, poster, active = true, labels = loopLabels, className = "absolute inset-0 h-full w-full object-cover" }) {
|
|
31
|
+
const calm = useCalm();
|
|
32
|
+
const loaded = usePageLoaded();
|
|
33
|
+
const mounted = !calm && loaded;
|
|
34
|
+
const holder = React.useRef(null);
|
|
35
|
+
const video = React.useRef(null);
|
|
36
|
+
const [onScreen, setOnScreen] = React.useState(() => typeof IntersectionObserver === "undefined");
|
|
37
|
+
const [paused, setPaused] = React.useState(false);
|
|
38
|
+
useInView(holder, setOnScreen, mounted);
|
|
39
|
+
const playing = mounted && onScreen && active && !paused;
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
if (!video.current) return;
|
|
42
|
+
if (playing) playSafely(video.current);
|
|
43
|
+
else video.current.pause?.();
|
|
44
|
+
}, [playing]);
|
|
45
|
+
const Glyph = paused ? PlayGlyph : PauseGlyph;
|
|
46
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx("div", { ref: holder, className: "absolute inset-0", children: mounted && /* @__PURE__ */ jsxs("video", { ref: video, className, poster, muted: true, loop: true, playsInline: true, preload: "metadata", "aria-hidden": true, tabIndex: -1, children: [
|
|
48
|
+
sources.webm && /* @__PURE__ */ jsx("source", { src: sources.webm, type: "video/webm" }),
|
|
49
|
+
sources.mp4 && /* @__PURE__ */ jsx("source", { src: sources.mp4, type: "video/mp4" })
|
|
50
|
+
] }) }),
|
|
51
|
+
!calm && /* @__PURE__ */ jsx(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
"aria-label": paused ? labels.play : labels.pause,
|
|
56
|
+
onClick: () => setPaused((p) => !p),
|
|
57
|
+
className: cn(
|
|
58
|
+
"absolute right-2 top-2 z-10 flex h-9 w-9 items-center justify-center rounded-full bg-scrim-strong text-fg-on-media transition-colors hover:bg-scrim focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring motion-reduce:transition-none"
|
|
59
|
+
),
|
|
60
|
+
children: /* @__PURE__ */ jsx(Glyph, { className: "h-4 w-4" })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
PausableLoop
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=pausable-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/media-gallery/pausable-loop.tsx"],"sourcesContent":["// @krizaka/ui/pausable-loop. Client (the page's load, the viewport, the reader's motion and data preferences). A muted, silent loop that previews a still or a\n// film: poster first, nothing fetched before the page's `load`, playing only while on screen, with a visible pause / play\n// control (WCAG 2.2.2). Under reduced motion or Save-Data the poster stays alone and there is nothing to pause.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { PauseGlyph, PlayGlyph } from \"../glyphs\";\nimport { playSafely, useInView, usePrefersReducedMotion } from \"../media\";\n\nexport type LoopSources = { webm?: string; mp4?: string };\nexport type LoopLabels = { pause: string; play: string };\nexport const loopLabels: LoopLabels = { pause: \"Pause the animation\", play: \"Play the animation\" };\n\nconst subscribeLoad = (notify: () => void) => {\n window.addEventListener(\"load\", notify);\n return () => window.removeEventListener(\"load\", notify);\n};\n/** `true` once the page has finished loading: a loop is not worth bytes before it. */\nfunction usePageLoaded(): boolean {\n return React.useSyncExternalStore(subscribeLoad, () => document.readyState === \"complete\", () => false);\n}\n\ntype SaveDataNavigator = Navigator & { connection?: { saveData?: boolean } };\n/** `true` when the person asked for less motion or less data: a loop stays a poster. */\nfunction useCalm(): boolean {\n const reduce = usePrefersReducedMotion();\n return reduce || (typeof navigator !== \"undefined\" && Boolean((navigator as SaveDataNavigator).connection?.saveData));\n}\n\nexport type PausableLoopProps = {\n /** The loop's files; `mp4` and / or `webm`. */\n sources: LoopSources;\n /** The still under the loop, shown first and kept under reduced motion or Save-Data. */\n poster: string;\n /** Plays only while `true` (e.g. the slide in view). Default `true`. */\n active?: boolean;\n /** The pause / play words, passed translated. English by default. */\n labels?: LoopLabels;\n /** Classes of the `<video>`; default fills its frame, cropped. */\n className?: string;\n};\n\n/** A muted, silent loop over a still, with a visible pause / play. Drop it into a frame that is `relative`: `MediaPlayer`'s `preview`, `MediaCarousel`'s `renderLoop`. */\nexport function PausableLoop({ sources, poster, active = true, labels = loopLabels, className = \"absolute inset-0 h-full w-full object-cover\" }: Readonly<PausableLoopProps>) {\n const calm = useCalm();\n const loaded = usePageLoaded();\n const mounted = !calm && loaded;\n const holder = React.useRef<HTMLDivElement>(null);\n const video = React.useRef<HTMLVideoElement>(null);\n const [onScreen, setOnScreen] = React.useState(() => typeof IntersectionObserver === \"undefined\");\n const [paused, setPaused] = React.useState(false);\n useInView(holder, setOnScreen, mounted);\n const playing = mounted && onScreen && active && !paused;\n React.useEffect(() => {\n if (!video.current) return;\n if (playing) playSafely(video.current);\n else video.current.pause?.();\n }, [playing]);\n const Glyph = paused ? PlayGlyph : PauseGlyph;\n return (\n <>\n <div ref={holder} className=\"absolute inset-0\">\n {mounted && (\n <video ref={video} className={className} poster={poster} muted loop playsInline preload=\"metadata\" aria-hidden tabIndex={-1}>\n {sources.webm && <source src={sources.webm} type=\"video/webm\" />}\n {sources.mp4 && <source src={sources.mp4} type=\"video/mp4\" />}\n </video>\n )}\n </div>\n {!calm && (\n <button\n type=\"button\"\n aria-label={paused ? labels.play : labels.pause}\n onClick={() => setPaused((p) => !p)}\n className={cn(\n \"absolute right-2 top-2 z-10 flex h-9 w-9 items-center justify-center rounded-full bg-scrim-strong text-fg-on-media transition-colors hover:bg-scrim \" +\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring motion-reduce:transition-none\",\n )}\n >\n <Glyph className=\"h-4 w-4\" />\n </button>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AAyDnB,mBAIyB,KADnB,YAHN;AAjDG,IAAM,aAAyB,EAAE,OAAO,uBAAuB,MAAM,qBAAqB;AAEjG,IAAM,gBAAgB,CAAC,WAAuB;AAC5C,SAAO,iBAAiB,QAAQ,MAAM;AACtC,SAAO,MAAM,OAAO,oBAAoB,QAAQ,MAAM;AACxD;AAEA,SAAS,gBAAyB;AAChC,SAAa,2BAAqB,eAAe,MAAM,SAAS,eAAe,YAAY,MAAM,KAAK;AACxG;AAIA,SAAS,UAAmB;AAC1B,QAAM,SAAS,wBAAwB;AACvC,SAAO,UAAW,OAAO,cAAc,eAAe,QAAS,UAAgC,YAAY,QAAQ;AACrH;AAgBO,SAAS,aAAa,EAAE,SAAS,QAAQ,SAAS,MAAM,SAAS,YAA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
|
3
|
+
IconButton
|
|
4
|
+
} from "./chunk-QHVV2JGF.js";
|
|
5
|
+
import {
|
|
6
|
+
VideoPlayer
|
|
7
|
+
} from "./chunk-VYZFQE3P.js";
|
|
8
|
+
import {
|
|
9
|
+
usePrefersReducedMotion
|
|
10
|
+
} from "./chunk-TN5JJ6JI.js";
|
|
11
|
+
import "./chunk-S2O4NSN5.js";
|
|
12
|
+
import "./chunk-NSLXEDIS.js";
|
|
13
|
+
|
|
14
|
+
// src/dialog/dialog.tsx
|
|
15
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
16
|
+
import { tv } from "tailwind-variants";
|
|
17
|
+
|
|
18
|
+
// src/dialog/return-focus.ts
|
|
19
|
+
import * as React from "react";
|
|
20
|
+
function useReturnFocus(onCloseAutoFocus) {
|
|
21
|
+
const [opener] = React.useState(() => typeof document === "undefined" ? null : document.activeElement);
|
|
22
|
+
return React.useCallback(
|
|
23
|
+
(event) => {
|
|
24
|
+
onCloseAutoFocus?.(event);
|
|
25
|
+
if (event.defaultPrevented) return;
|
|
26
|
+
if (opener instanceof HTMLElement && opener !== document.body && opener.isConnected) {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
opener.focus();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
[opener, onCloseAutoFocus]
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/dialog/dialog.tsx
|
|
36
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
var dialog = tv({
|
|
38
|
+
slots: {
|
|
39
|
+
overlay: "kz-overlay fixed inset-0 z-50 bg-overlay",
|
|
40
|
+
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",
|
|
41
|
+
close: "absolute right-3 top-3 h-9 w-9",
|
|
42
|
+
header: "flex flex-col gap-1 px-5 pb-2 pr-14 pt-5",
|
|
43
|
+
title: "text-base font-bold text-fg",
|
|
44
|
+
description: "text-sm text-fg-secondary",
|
|
45
|
+
body: "min-h-0 flex-1 overflow-y-auto px-5 pb-5",
|
|
46
|
+
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))]"
|
|
47
|
+
},
|
|
48
|
+
variants: {
|
|
49
|
+
placement: {
|
|
50
|
+
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" },
|
|
51
|
+
/* A sheet: anchored at the bottom on a phone, centred from `sm` up. */
|
|
52
|
+
bottom: {
|
|
53
|
+
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]"
|
|
54
|
+
},
|
|
55
|
+
right: { content: "inset-y-0 right-0 h-full w-full max-w-md rounded-none border-y-0 border-r-0" },
|
|
56
|
+
/* A navigation drawer: full height, from the left, clear of the notch. */
|
|
57
|
+
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)]" }
|
|
58
|
+
},
|
|
59
|
+
size: { sm: { content: "sm:max-w-sm" }, md: { content: "sm:max-w-md" }, lg: { content: "sm:max-w-2xl" } }
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: { placement: "center", size: "md" }
|
|
62
|
+
});
|
|
63
|
+
var s = dialog();
|
|
64
|
+
function CloseIcon() {
|
|
65
|
+
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" }) });
|
|
66
|
+
}
|
|
67
|
+
var prevent = (event) => event.preventDefault();
|
|
68
|
+
function ReturnFocusContent({ onCloseAutoFocus, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Content, { onCloseAutoFocus: useReturnFocus(onCloseAutoFocus), ...props });
|
|
70
|
+
}
|
|
71
|
+
function DialogContent({
|
|
72
|
+
placement,
|
|
73
|
+
size,
|
|
74
|
+
closeLabel,
|
|
75
|
+
hideClose,
|
|
76
|
+
dismissible = true,
|
|
77
|
+
container,
|
|
78
|
+
className,
|
|
79
|
+
children,
|
|
80
|
+
onEscapeKeyDown,
|
|
81
|
+
onPointerDownOutside,
|
|
82
|
+
onInteractOutside,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
const v = dialog({ placement, size });
|
|
86
|
+
return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { container, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: v.overlay() }),
|
|
88
|
+
/* @__PURE__ */ jsxs(
|
|
89
|
+
ReturnFocusContent,
|
|
90
|
+
{
|
|
91
|
+
"data-placement": placement ?? "center",
|
|
92
|
+
"data-dismissible": dismissible ? void 0 : "false",
|
|
93
|
+
className: v.content({ className }),
|
|
94
|
+
onEscapeKeyDown: dismissible ? onEscapeKeyDown : chain(onEscapeKeyDown, prevent),
|
|
95
|
+
onPointerDownOutside: dismissible ? onPointerDownOutside : chain(onPointerDownOutside, prevent),
|
|
96
|
+
onInteractOutside: dismissible ? onInteractOutside : chain(onInteractOutside, prevent),
|
|
97
|
+
...props,
|
|
98
|
+
children: [
|
|
99
|
+
children,
|
|
100
|
+
!hideClose && /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { label: closeLabel, variant: "ghost", shape: "pill", className: v.close(), children: /* @__PURE__ */ jsx(CloseIcon, {}) }) })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
function chain(handler, then) {
|
|
107
|
+
return (event) => {
|
|
108
|
+
handler?.(event);
|
|
109
|
+
then(event);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function DialogHeader({ className, ...props }) {
|
|
113
|
+
return /* @__PURE__ */ jsx("div", { className: s.header({ className }), ...props });
|
|
114
|
+
}
|
|
115
|
+
function DialogTitle({ className, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, { className: s.title({ className }), ...props });
|
|
117
|
+
}
|
|
118
|
+
function DialogDescription({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Description, { className: s.description({ className }), ...props });
|
|
120
|
+
}
|
|
121
|
+
function DialogBody({ className, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx("div", { className: s.body({ className }), ...props });
|
|
123
|
+
}
|
|
124
|
+
function DialogFooter({ className, ...props }) {
|
|
125
|
+
return /* @__PURE__ */ jsx("div", { className: s.footer({ className }), ...props });
|
|
126
|
+
}
|
|
127
|
+
var Dialog = {
|
|
128
|
+
Root: DialogPrimitive.Root,
|
|
129
|
+
Trigger: DialogPrimitive.Trigger,
|
|
130
|
+
Close: DialogPrimitive.Close,
|
|
131
|
+
Content: DialogContent,
|
|
132
|
+
Header: DialogHeader,
|
|
133
|
+
Title: DialogTitle,
|
|
134
|
+
Description: DialogDescription,
|
|
135
|
+
Body: DialogBody,
|
|
136
|
+
Footer: DialogFooter
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// src/media-gallery/player-lightbox.tsx
|
|
140
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
141
|
+
function PlayerLightbox({ player, ratio, vertical, closeLabel, onClose }) {
|
|
142
|
+
const calm = usePrefersReducedMotion();
|
|
143
|
+
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: [
|
|
144
|
+
/* @__PURE__ */ jsx2(Dialog.Title, { className: "sr-only", children: player.title }),
|
|
145
|
+
/* @__PURE__ */ jsx2(VideoPlayer, { ...player, aspectRatio: ratio, playOnMount: !calm, pauseWhenHidden: false })
|
|
146
|
+
] }) });
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
PlayerLightbox as default
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=player-lightbox-ASFOSUSD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dialog/dialog.tsx","../src/dialog/return-focus.ts","../src/media-gallery/player-lightbox.tsx"],"sourcesContent":["// Client (a portal). Radix does the focus trap, the scroll lock, Escape, the outside click, aria-modal, the\n// aria-labelledby / aria-describedby wiring and the focus return: this file only holds the shape.\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { IconButton } from \"../button/button\";\nimport { useReturnFocus } from \"./return-focus\";\n\nexport const dialog = tv({\n slots: {\n overlay: \"kz-overlay fixed inset-0 z-50 bg-overlay\",\n content:\n \"kz-dialog fixed z-50 flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg shadow-lg focus:outline-hidden\",\n close: \"absolute right-3 top-3 h-9 w-9\",\n header: \"flex flex-col gap-1 px-5 pb-2 pr-14 pt-5\",\n title: \"text-base font-bold text-fg\",\n description: \"text-sm text-fg-secondary\",\n body: \"min-h-0 flex-1 overflow-y-auto px-5 pb-5\",\n footer:\n \"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))]\",\n },\n variants: {\n placement: {\n 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\" },\n /* A sheet: anchored at the bottom on a phone, centred from `sm` up. */\n bottom: {\n content:\n \"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 \" +\n \"sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-[1.75rem]\",\n },\n right: { content: \"inset-y-0 right-0 h-full w-full max-w-md rounded-none border-y-0 border-r-0\" },\n /* A navigation drawer: full height, from the left, clear of the notch. */\n 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)]\" },\n },\n size: { sm: { content: \"sm:max-w-sm\" }, md: { content: \"sm:max-w-md\" }, lg: { content: \"sm:max-w-2xl\" } },\n },\n defaultVariants: { placement: \"center\", size: \"md\" },\n});\nconst s = dialog();\n\nexport type DialogVariants = VariantProps<typeof dialog>;\n\nfunction CloseIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\ntype CloseButtonProps =\n | {\n /** The accessible name of the close button — passed translated. */\n closeLabel: string;\n /** Leaves the close button out (the content brings its own way out, or none: see `dismissible`). */\n hideClose?: false;\n }\n | { closeLabel?: string; hideClose: true };\n\nexport type DialogContentProps = React.ComponentProps<typeof DialogPrimitive.Content> &\n DialogVariants &\n CloseButtonProps & {\n /**\n * center · bottom (a sheet on a phone, centred from `sm` up) · right (a side panel, full height) · left (a\n * navigation drawer, full height).\n * @default \"center\"\n */\n placement?: DialogVariants[\"placement\"];\n /**\n * sm · md · lg: the width of the dialog.\n * @default \"md\"\n */\n size?: DialogVariants[\"size\"];\n /**\n * `false`: Escape and a click outside do not close it (a gate the user must answer: age, terms). It still closes\n * through `open` / `onOpenChange` and any `Dialog.Close` inside. Default `true`.\n */\n dismissible?: boolean;\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n };\n\nconst prevent = (event: Event) => event.preventDefault();\n\n/** Radix's content, mounted only while open: it remembers the opener then and gives focus back on close (WCAG 2.4.3). */\nfunction ReturnFocusContent({ onCloseAutoFocus, ...props }: React.ComponentProps<typeof DialogPrimitive.Content>) {\n return <DialogPrimitive.Content onCloseAutoFocus={useReturnFocus(onCloseAutoFocus)} {...props} />;\n}\n\n/** The dialog itself, portalled over a dimmed overlay, with a close button. Give it a `Dialog.Title`. */\nexport function DialogContent({\n placement,\n size,\n closeLabel,\n hideClose,\n dismissible = true,\n container,\n className,\n children,\n onEscapeKeyDown,\n onPointerDownOutside,\n onInteractOutside,\n ...props\n}: DialogContentProps) {\n const v = dialog({ placement, size });\n return (\n <DialogPrimitive.Portal container={container}>\n <DialogPrimitive.Overlay className={v.overlay()} />\n <ReturnFocusContent\n data-placement={placement ?? \"center\"}\n data-dismissible={dismissible ? undefined : \"false\"}\n className={v.content({ className })}\n onEscapeKeyDown={dismissible ? onEscapeKeyDown : chain(onEscapeKeyDown, prevent)}\n onPointerDownOutside={dismissible ? onPointerDownOutside : chain(onPointerDownOutside, prevent)}\n onInteractOutside={dismissible ? onInteractOutside : chain(onInteractOutside, prevent)}\n {...props}\n >\n {children}\n {!hideClose && (\n <DialogPrimitive.Close asChild>\n <IconButton label={closeLabel as string} variant=\"ghost\" shape=\"pill\" className={v.close()}>\n <CloseIcon />\n </IconButton>\n </DialogPrimitive.Close>\n )}\n </ReturnFocusContent>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction chain<E extends Event>(handler: ((event: E) => void) | undefined, then: (event: E) => void) {\n return (event: E) => {\n handler?.(event);\n then(event);\n };\n}\n\nexport function DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.header({ className })} {...props} />;\n}\n\nexport function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return <DialogPrimitive.Title className={s.title({ className })} {...props} />;\n}\n\nexport function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return <DialogPrimitive.Description className={s.description({ className })} {...props} />;\n}\n\nexport function DialogBody({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.body({ className })} {...props} />;\n}\n\nexport function DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.footer({ className })} {...props} />;\n}\n\n/** `Dialog.Root/Trigger/Content/Header/Title/Description/Body/Footer/Close`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const Dialog = {\n Root: DialogPrimitive.Root,\n Trigger: DialogPrimitive.Trigger,\n Close: DialogPrimitive.Close,\n Content: DialogContent,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n};\n\n/** `Omit` that keeps the close-button union (`closeLabel` required unless `hideClose`). */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport type SheetProps = DistributiveOmit<DialogContentProps, \"placement\">;\n\n/** A sheet is a dialog anchored at the bottom (centred from `sm` up): `Dialog.Content placement=\"bottom\"`. */\nexport function Sheet(props: SheetProps) {\n return <DialogContent placement=\"bottom\" {...props} />;\n}\n","// Client. WCAG 2.4.3: when a dialog closes, focus goes back to what opened it. Radix only does it for `Dialog.Trigger`;\n// most app dialogs are controlled (`open` / `onOpenChange`) and opened by a plain button, so on Escape focus fell to\n// <body>. The content remembers the focused element when it mounts (it is still the opener: Radix moves focus in an\n// effect) and gives it back on close, unless the consumer's `onCloseAutoFocus` prevented the default.\nimport * as React from \"react\";\n\n/** The handler for `onCloseAutoFocus`: yours first, then focus back on the opener if it is still on the page. */\nexport function useReturnFocus(onCloseAutoFocus?: (event: Event) => void) {\n const [opener] = React.useState<Element | null>(() => (typeof document === \"undefined\" ? null : document.activeElement));\n return React.useCallback(\n (event: Event) => {\n onCloseAutoFocus?.(event);\n if (event.defaultPrevented) return;\n if (opener instanceof HTMLElement && opener !== document.body && opener.isConnected) {\n event.preventDefault();\n opener.focus();\n }\n },\n [opener, onCloseAutoFocus],\n );\n}\n","// Client. The lightbox's dialog and its player: loaded by `MediaPlayer` only when the poster is pressed.\nimport * as React from \"react\";\n\nimport { Dialog } from \"../dialog\";\nimport { usePrefersReducedMotion } from \"../media\";\nimport { VideoPlayer, type VideoPlayerProps } from \"../video-player\";\n\nexport type PlayerLightboxProps = {\n player: Omit<VideoPlayerProps, \"aspectRatio\" | \"className\">;\n ratio: string;\n vertical: boolean;\n closeLabel: string;\n onClose: () => void;\n};\n\n/** The open dialog holding the player, started by the press that opened it, except under reduced motion: it waits on the poster. */\nexport default function PlayerLightbox({ player, ratio, vertical, closeLabel, onClose }: Readonly<PlayerLightboxProps>) {\n const calm = usePrefersReducedMotion();\n return (\n <Dialog.Root open onOpenChange={(open) => !open && onClose()}>\n <Dialog.Content size={vertical ? \"sm\" : \"lg\"} closeLabel={closeLabel} className=\"bg-media p-0\">\n <Dialog.Title className=\"sr-only\">{player.title}</Dialog.Title>\n <VideoPlayer {...player} aspectRatio={ratio} playOnMount={!calm} pauseWhenHidden={false} />\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAS,UAAU,uBAAuB;AAE1C,SAAS,UAA6B;;;ACAtC,YAAY,WAAW;AAGhB,SAAS,eAAe,kBAA2C;AACxE,QAAM,CAAC,MAAM,IAAU,eAAyB,MAAO,OAAO,aAAa,cAAc,OAAO,SAAS,aAAc;AACvH,SAAa;AAAA,IACX,CAAC,UAAiB;AAChB,yBAAmB,KAAK;AACxB,UAAI,MAAM,iBAAkB;AAC5B,UAAI,kBAAkB,eAAe,WAAW,SAAS,QAAQ,OAAO,aAAa;AACnF,cAAM,eAAe;AACrB,eAAO,MAAM;AAAA,MACf;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,gBAAgB;AAAA,EAC3B;AACF;;;AD0BM,cA+DA,YA/DA;AArCC,IAAM,SAAS,GAAG;AAAA,EACvB,OAAO;AAAA,IACL,SAAS;AAAA,IACT,SACE;AAAA,IACF,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AA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AAI,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC7D;AAGO,IAAM,SAAS;AAAA,EACpB,MAAM,gBAAgB;AAAA,EACtB,SAAS,gBAAgB;AAAA,EACzB,OAAO,gBAAgB;AAAA,EACvB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AACV;;;AErJM,SACE,OAAAA,MADF,QAAAC,aAAA;AAJS,SAAR,eAAgC,EAAE,QAAQ,OAAO,UAAU,YAAY,QAAQ,GAAkC;AACtH,QAAM,OAAO,wBAAwB;AACrC,SACE,gBAAAD,KAAC,OAAO,MAAP,EAAY,MAAI,MAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,QAAQ,GACzD,0BAAAC,MAAC,OAAO,SAAP,EAAe,MAAM,WAAW,OAAO,MAAM,YAAwB,WAAU,gBAC9E;AAAA,oBAAAD,KAAC,OAAO,OAAP,EAAa,WAAU,WAAW,iBAAO,OAAM;AAAA,IAChD,gBAAAA,KAAC,eAAa,GAAG,QAAQ,aAAa,OAAO,aAAa,CAAC,MAAM,iBAAiB,OAAO;AAAA,KAC3F,GACF;AAEJ;","names":["jsx","jsxs"]}
|
package/dist/rail-nav.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EDQLPCM4.js";
|
|
5
5
|
import {
|
|
6
6
|
ChevronGlyph
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S2O4NSN5.js";
|
|
8
8
|
import {
|
|
9
9
|
cn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NSLXEDIS.js";
|
|
11
11
|
|
|
12
12
|
// src/rail-nav/rail-nav.tsx
|
|
13
13
|
import { Slot } from "radix-ui";
|
|
@@ -74,6 +74,8 @@ type VideoPlayerProps = {
|
|
|
74
74
|
autoPlay?: boolean;
|
|
75
75
|
/** Starts muted. */
|
|
76
76
|
muted?: boolean;
|
|
77
|
+
/** 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. */
|
|
78
|
+
playOnMount?: boolean;
|
|
77
79
|
/** Plays again from the start at the end. */
|
|
78
80
|
loop?: boolean;
|
|
79
81
|
/** How much to fetch before playback: `none` (a list of many videos), `metadata` (default), `auto`. */
|
package/dist/retro-tv.js
CHANGED
package/dist/site-cahier.js
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Page,
|
|
4
4
|
SectionBackdrop
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7P7I5OQV.js";
|
|
6
6
|
import {
|
|
7
7
|
ArrowGlyph
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-S2O4NSN5.js";
|
|
9
9
|
import {
|
|
10
10
|
BlockLink
|
|
11
11
|
} from "./chunk-ENOS6ETI.js";
|
|
12
12
|
import {
|
|
13
13
|
TapedPhoto
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TVLRE7S3.js";
|
|
15
15
|
import {
|
|
16
16
|
Mascot
|
|
17
17
|
} from "./chunk-DRTIE44Z.js";
|
|
18
18
|
import {
|
|
19
19
|
cn
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NSLXEDIS.js";
|
|
21
21
|
|
|
22
22
|
// src/page-hero/page-hero.tsx
|
|
23
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/taped-photo.js
CHANGED
package/dist/toc.js
CHANGED
package/dist/versus-card.js
CHANGED
package/dist/video-player.d.ts
CHANGED
|
@@ -167,6 +167,8 @@ type VideoPlayerProps = {
|
|
|
167
167
|
autoPlay?: boolean;
|
|
168
168
|
/** Starts muted. */
|
|
169
169
|
muted?: boolean;
|
|
170
|
+
/** 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. */
|
|
171
|
+
playOnMount?: boolean;
|
|
170
172
|
/** Plays again from the start at the end. */
|
|
171
173
|
loop?: boolean;
|
|
172
174
|
/** How much to fetch before playback: `none` (a list of many videos), `metadata` (default), `auto`. */
|
|
@@ -199,7 +201,7 @@ type VideoPlayerProps = {
|
|
|
199
201
|
className?: string;
|
|
200
202
|
};
|
|
201
203
|
/** A video player with accessible controls, HLS on demand, signed sources, subtitles, speed, full screen. */
|
|
202
|
-
declare function VideoPlayer({ src, type, loadHls, title, poster, autoPlay, muted: initiallyMuted, loop, preload, tracks, playbackRates, pauseWhenHidden, controls, overlay, aspectRatio, onPlay, onPause, onEnded, onTimeUpdate, onError, labels: given, className, }: VideoPlayerProps): React.JSX.Element;
|
|
204
|
+
declare function VideoPlayer({ src, type, loadHls, title, poster, autoPlay, muted: initiallyMuted, playOnMount, loop, preload, tracks, playbackRates, pauseWhenHidden, controls, overlay, aspectRatio, onPlay, onPause, onEnded, onTimeUpdate, onError, labels: given, className, }: VideoPlayerProps): React.JSX.Element;
|
|
203
205
|
|
|
204
206
|
export { VideoPlayer, videoPlayer, videoPlayerLabels };
|
|
205
207
|
export type { HlsModule, VideoPlayerLabels, VideoPlayerProps, VideoTrack };
|
package/dist/video-player.js
CHANGED
package/dist/wall.js
CHANGED