saha-ui 1.22.4 → 1.22.5

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.
@@ -1,83 +1,114 @@
1
- import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
- import { useRef as T, useState as i, useEffect as v } from "react";
3
- import { cn as p } from "../../lib/utils.js";
4
- import { videoElementVariants as he, playButtonVariants as be, controlBarVariants as ye, videoPlayerVariants as we } from "./VideoPlayer.styles.js";
5
- import ke from "./Controls.js";
6
- const Te = ({
7
- sources: x,
8
- poster: H,
9
- thumbnail: J,
10
- captions: E,
11
- className: W,
12
- autoplay: X = !1,
13
- loop: Y = !1,
14
- muted: $ = !1,
15
- controls: O = !1,
16
- onPlay: R,
17
- onPause: S,
18
- variant: Z = "default",
19
- size: _ = "md",
20
- title: B = "",
21
- ...ee
1
+ import { jsxs as g, jsx as o } from "react/jsx-runtime";
2
+ import { useRef as w, useState as s, useEffect as m } from "react";
3
+ import { cn as k } from "../../lib/utils.js";
4
+ import { videoElementVariants as Me, playButtonVariants as Ce, controlBarVariants as Ie, videoPlayerVariants as Ne } from "./VideoPlayer.styles.js";
5
+ import De from "./Controls.js";
6
+ const Re = ({
7
+ sources: y,
8
+ poster: ee,
9
+ thumbnail: te,
10
+ captions: M,
11
+ crossOrigin: ne,
12
+ className: re,
13
+ autoplay: oe = !1,
14
+ loop: ce = !1,
15
+ muted: ae = !1,
16
+ controls: ie = !1,
17
+ onPlay: V,
18
+ onPause: q,
19
+ variant: se = "default",
20
+ size: ue = "md",
21
+ title: U = "",
22
+ loadStrategy: F = "native",
23
+ ...le
22
24
  }) => {
23
- const a = T(null), L = T(null), [s, V] = i(!1), [A, F] = i(0), [P, K] = i(0), [te, g] = i(1), [j, h] = i(!!$), [ne, re] = i(1), [M, l] = i(!0), [q, ae] = i(0), [z, oe] = i(!1), [D, ie] = i(null), [ce, se] = i(0), u = T(null), c = T(null), N = H || J || null;
24
- v(() => {
25
- const e = () => {
26
- typeof document > "u" || oe(!!document.fullscreenElement);
27
- };
28
- return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
29
- }, []), v(() => {
25
+ const a = w(null), h = w(null), [l, K] = s(!1), [O, $] = s(0), [C, z] = s(0), [de, E] = s(1), [W, P] = s(!!ae), [me, fe] = s(1), [I, f] = s(!0), [L, ve] = s(0), [pe, T] = s(!1), [H, N] = s(!1), [D, ye] = s(null), [he, Q] = s(!1), R = w(null), [be, ge] = s(0), v = w(null), u = w(null), j = ee || te || null;
26
+ m(() => {
30
27
  const e = a.current;
31
28
  if (!e) return;
29
+ try {
30
+ const x = !!(typeof document < "u" && document.pictureInPictureEnabled && typeof e.requestPictureInPicture == "function");
31
+ Q(x);
32
+ } catch {
33
+ Q(!1);
34
+ }
32
35
  const t = () => {
33
- if (K(e.duration || 0), !N && !D)
36
+ if (!j && !D)
34
37
  try {
35
- const y = e.videoWidth || 1280, Q = e.videoHeight || 720, w = document.createElement("canvas");
36
- w.width = y, w.height = Q;
37
- const G = w.getContext("2d");
38
- if (G) {
39
- G.drawImage(e, 0, 0, y, Q);
40
- const ge = w.toDataURL("image/jpeg", 0.8);
41
- ie(ge);
38
+ const x = e.videoWidth || 1280, _ = e.videoHeight || 720, S = document.createElement("canvas");
39
+ S.width = x, S.height = _;
40
+ const Z = S.getContext("2d");
41
+ if (Z) {
42
+ Z.drawImage(e, 0, 0, x, _);
43
+ const Se = S.toDataURL("image/jpeg", 0.8);
44
+ ye(Se);
42
45
  }
43
46
  } catch {
44
47
  }
45
- }, o = () => F(e.currentTime || 0), r = () => {
46
- V(!0), R?.();
47
- }, m = () => {
48
- V(!1), S?.();
49
- }, b = () => {
50
- g(e.volume ?? 0), h(!!e.muted);
48
+ z(e.duration || 0);
49
+ }, r = () => T(!0), n = () => T(!1), c = () => T(!1), i = () => T(!0), d = () => $(e.currentTime || 0), J = () => {
50
+ K(!0), V?.();
51
+ }, X = () => {
52
+ K(!1), q?.();
53
+ }, Y = () => {
54
+ E(e.volume ?? 0), P(!!e.muted);
51
55
  };
52
- return e.addEventListener("loadedmetadata", t), e.addEventListener("timeupdate", o), e.addEventListener("play", r), e.addEventListener("pause", m), e.addEventListener("volumechange", b), g(e.volume ?? 1), h(!!e.muted), K(e.duration || 0), () => {
53
- e.removeEventListener("loadedmetadata", t), e.removeEventListener("timeupdate", o), e.removeEventListener("play", r), e.removeEventListener("pause", m), e.removeEventListener("volumechange", b);
56
+ return e.addEventListener("loadedmetadata", t), e.addEventListener("timeupdate", d), e.addEventListener("play", J), e.addEventListener("pause", X), e.addEventListener("volumechange", Y), e.addEventListener("waiting", r), e.addEventListener("playing", n), e.addEventListener("canplay", c), e.addEventListener("stalled", i), E(e.volume ?? 1), P(!!e.muted), z(e.duration || 0), () => {
57
+ e.removeEventListener("loadedmetadata", t), e.removeEventListener("timeupdate", d), e.removeEventListener("play", J), e.removeEventListener("pause", X), e.removeEventListener("volumechange", Y), e.removeEventListener("waiting", r), e.removeEventListener("playing", n), e.removeEventListener("canplay", c), e.removeEventListener("stalled", i);
54
58
  };
55
59
  }, [
60
+ L,
61
+ V,
56
62
  q,
57
- R,
58
- S,
59
- N,
63
+ j,
60
64
  D
61
- ]), v(() => () => {
62
- c.current && window.clearTimeout(c.current), u.current && window.clearTimeout(u.current);
63
- }, []), v(() => {
64
- if (!s) {
65
- l(!0), c.current && window.clearTimeout(c.current);
65
+ ]), m(() => {
66
+ if (F !== "fetch") return;
67
+ const e = a.current;
68
+ if (!e) return;
69
+ let t = !1, r = null;
70
+ return (async () => {
71
+ const c = y[L]?.src;
72
+ if (c)
73
+ try {
74
+ const i = await fetch(c, { mode: "cors" });
75
+ if (!i.ok) throw new Error(`Failed to fetch video: ${i.status}`);
76
+ const d = await i.blob();
77
+ if (t) return;
78
+ r = URL.createObjectURL(d), R.current = r, e.src = r, e.load();
79
+ } catch (i) {
80
+ console.error("fetch+attach video failed:", i);
81
+ }
82
+ })(), () => {
83
+ if (t = !0, r) {
84
+ try {
85
+ URL.revokeObjectURL(r);
86
+ } catch {
87
+ return;
88
+ }
89
+ R.current === r && (R.current = null);
90
+ }
91
+ };
92
+ }, [F, L, y]), m(() => () => {
93
+ u.current && window.clearTimeout(u.current), v.current && window.clearTimeout(v.current);
94
+ }, []), m(() => {
95
+ if (!l) {
96
+ f(!0), u.current && window.clearTimeout(u.current);
66
97
  return;
67
98
  }
68
- l(!0), c.current && window.clearTimeout(c.current), c.current = window.setTimeout(
69
- () => l(!1),
99
+ f(!0), u.current && window.clearTimeout(u.current), u.current = window.setTimeout(
100
+ () => f(!1),
70
101
  2500
71
102
  );
72
- }, [s]);
73
- const d = (e) => {
103
+ }, [l]);
104
+ const p = (e) => {
74
105
  const t = a.current;
75
106
  if (t)
76
107
  try {
77
- t.currentTime = Math.max(0, Math.min(e, t.duration || e)), F(t.currentTime || 0);
108
+ t.currentTime = Math.max(0, Math.min(e, t.duration || e)), $(t.currentTime || 0);
78
109
  } catch {
79
110
  }
80
- }, f = async () => {
111
+ }, b = async () => {
81
112
  const e = a.current;
82
113
  if (e)
83
114
  if (e.paused)
@@ -87,68 +118,136 @@ const Te = ({
87
118
  }
88
119
  else
89
120
  e.pause();
90
- }, C = (e) => {
121
+ }, A = (e) => {
91
122
  const t = a.current;
92
- t && (t.volume = Math.max(0, Math.min(1, e)), g(t.volume), t.volume === 0 && (t.muted = !0), h(!!t.muted));
93
- }, U = () => {
123
+ t && (t.volume = Math.max(0, Math.min(1, e)), E(t.volume), t.volume === 0 && (t.muted = !0), P(!!t.muted));
124
+ }, G = () => {
94
125
  const e = a.current;
95
- e && (e.muted = !e.muted, !e.muted && e.volume === 0 && (e.volume = 0.2, g(0.2)), h(!!e.muted));
96
- }, le = (e) => {
126
+ e && (e.muted = !e.muted, !e.muted && e.volume === 0 && (e.volume = 0.2, E(0.2)), P(!!e.muted));
127
+ }, we = (e) => {
97
128
  const t = a.current;
98
- t && (t.playbackRate = e, re(e));
99
- }, I = async () => {
129
+ t && (t.playbackRate = e, fe(e));
130
+ }, B = async () => {
100
131
  try {
101
132
  if (typeof document > "u") return;
102
- document.fullscreenElement ? await document.exitFullscreen() : L.current && await L.current.requestFullscreen();
133
+ document.fullscreenElement ? (await document.exitFullscreen(), N(!1)) : h.current && (await h.current.requestFullscreen(), N(!0));
103
134
  } catch {
104
135
  }
105
- }, ue = async () => {
136
+ };
137
+ m(() => {
138
+ const e = () => {
139
+ N(!!document.fullscreenElement);
140
+ };
141
+ return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
142
+ }, []);
143
+ const ke = async () => {
106
144
  const e = a.current;
107
145
  if (!(!e || typeof document > "u"))
108
146
  try {
109
- document.pictureInPictureElement ? await document.exitPictureInPicture() : await e.requestPictureInPicture();
110
- } catch {
147
+ const t = document;
148
+ if (!!!(e.currentSrc || e.src || e.srcObject)) {
149
+ console.warn("No video source available for Picture-in-Picture", {
150
+ currentSrc: e.currentSrc,
151
+ src: e.src,
152
+ srcObject: e.srcObject
153
+ });
154
+ return;
155
+ }
156
+ if ((e.readyState ?? 0) < 1) {
157
+ console.warn(
158
+ "Video not ready for Picture-in-Picture (readyState < HAVE_METADATA)",
159
+ { readyState: e.readyState }
160
+ );
161
+ return;
162
+ }
163
+ if (t.pictureInPictureEnabled && typeof e.requestPictureInPicture == "function") {
164
+ t.pictureInPictureElement ? await t.exitPictureInPicture() : await e.requestPictureInPicture();
165
+ return;
166
+ }
167
+ const n = e;
168
+ if (typeof n.webkitSupportsPresentationMode == "function" && typeof n.webkitSetPresentationMode == "function")
169
+ try {
170
+ n.webkitPresentationMode === "picture-in-picture" ? n.webkitSetPresentationMode("inline") : n.webkitSetPresentationMode("picture-in-picture");
171
+ return;
172
+ } catch (c) {
173
+ console.error("webkitSetPresentationMode failed:", c);
174
+ return;
175
+ }
176
+ console.warn("Picture-in-Picture is not supported in this environment");
177
+ } catch (t) {
178
+ console.error("requestPictureInPicture failed:", t);
111
179
  }
112
- }, de = () => {
113
- l(!0), s && (c.current && window.clearTimeout(c.current), c.current = window.setTimeout(
114
- () => l(!1),
180
+ }, Ee = () => {
181
+ f(!0), l && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(
182
+ () => f(!1),
115
183
  2500
116
184
  ));
117
185
  };
118
- v(() => {
186
+ m(() => {
187
+ const e = h.current;
188
+ if (!e) return;
189
+ const t = () => {
190
+ try {
191
+ const r = document.body.style.cursor || "", n = document.documentElement.style.cursor || "", c = window.getComputedStyle(document.body).cursor || "", i = window.getComputedStyle(document.documentElement).cursor || "", d = r || n || c || i || "";
192
+ /^grab(?:bing)?$|^grabbing$|^move$/i.test(d) && (document.body.style.cursor = "", document.documentElement.style.cursor = "");
193
+ } catch {
194
+ }
195
+ };
196
+ return e.addEventListener("pointerdown", t), e.addEventListener("mouseenter", t), e.addEventListener("click", t), () => {
197
+ e.removeEventListener("pointerdown", t), e.removeEventListener("mouseenter", t), e.removeEventListener("click", t);
198
+ };
199
+ }, []), m(() => {
200
+ try {
201
+ const r = document.body.style.cursor || "", n = document.documentElement.style.cursor || "", c = window.getComputedStyle(document.body).cursor || "", i = window.getComputedStyle(document.documentElement).cursor || "";
202
+ /^grab(?:bing)?$|^grabbing$|^move$/i.test(
203
+ r || n || c || i || ""
204
+ ) && (document.body.style.cursor = "", document.documentElement.style.cursor = "");
205
+ } catch {
206
+ }
207
+ const e = h.current;
208
+ if (!e) return;
209
+ const t = e.style.cursor;
210
+ return e.style.cursor = "auto", () => {
211
+ try {
212
+ e.style.cursor = t || "";
213
+ } catch {
214
+ return;
215
+ }
216
+ };
217
+ }, []), m(() => {
119
218
  const e = (t) => {
120
219
  if (!a.current) return;
121
- const o = document.activeElement?.tagName || "";
122
- if (o === "INPUT" || o === "TEXTAREA") return;
123
- const r = a.current;
220
+ const r = document.activeElement?.tagName || "";
221
+ if (r === "INPUT" || r === "TEXTAREA") return;
222
+ const n = a.current;
124
223
  switch (t.code) {
125
224
  case "Space":
126
225
  case "KeyK":
127
- t.preventDefault(), f();
226
+ t.preventDefault(), b();
128
227
  break;
129
228
  case "ArrowRight":
130
- d((r.currentTime || 0) + 5);
229
+ p((n.currentTime || 0) + 5);
131
230
  break;
132
231
  case "ArrowLeft":
133
- d((r.currentTime || 0) - 5);
232
+ p((n.currentTime || 0) - 5);
134
233
  break;
135
234
  case "KeyL":
136
- d((r.currentTime || 0) + 10);
235
+ p((n.currentTime || 0) + 10);
137
236
  break;
138
237
  case "KeyJ":
139
- d((r.currentTime || 0) - 10);
238
+ p((n.currentTime || 0) - 10);
140
239
  break;
141
240
  case "ArrowUp":
142
- C(Math.min(1, (r.volume || 0) + 0.05));
241
+ A(Math.min(1, (n.volume || 0) + 0.05));
143
242
  break;
144
243
  case "ArrowDown":
145
- C(Math.max(0, (r.volume || 0) - 0.05));
244
+ A(Math.max(0, (n.volume || 0) - 0.05));
146
245
  break;
147
246
  case "KeyF":
148
- I();
247
+ B();
149
248
  break;
150
249
  case "KeyM":
151
- U();
250
+ G();
152
251
  break;
153
252
  case "Digit0":
154
253
  case "Digit1":
@@ -160,100 +259,101 @@ const Te = ({
160
259
  case "Digit7":
161
260
  case "Digit8":
162
261
  case "Digit9": {
163
- const b = parseInt(t.code.replace("Digit", ""), 10) / 10, y = (r.duration || 0) * b;
164
- d(y);
262
+ const i = parseInt(t.code.replace("Digit", ""), 10) / 10, d = (n.duration || 0) * i;
263
+ p(d);
165
264
  break;
166
265
  }
167
266
  }
168
267
  };
169
268
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
170
269
  }, []);
171
- const me = (e) => {
270
+ const Pe = (e) => {
172
271
  const t = a.current;
173
272
  if (!t) return;
174
- const o = !t.paused, r = t.currentTime || 0;
175
- ae(e), t.pause(), t.src = x[e].src, t.load();
176
- const m = () => {
273
+ const r = !t.paused, n = t.currentTime || 0;
274
+ ve(e), t.pause(), t.src = y[e].src, t.load();
275
+ const c = () => {
177
276
  try {
178
- t.currentTime = Math.min(r, t.duration || r);
277
+ t.currentTime = Math.min(n, t.duration || n);
179
278
  } catch {
180
279
  }
181
- o && t.play().catch(() => {
182
- }), t.removeEventListener("loadedmetadata", m);
280
+ r && t.play().catch(() => {
281
+ }), t.removeEventListener("loadedmetadata", c);
183
282
  };
184
- t.addEventListener("loadedmetadata", m);
185
- }, fe = P ? A / P * 100 : 0, ve = (e) => {
186
- if (se(e), u.current && (window.clearTimeout(u.current), u.current = null), e <= 0) return;
283
+ t.addEventListener("loadedmetadata", c);
284
+ }, Le = C ? O / C * 100 : 0, Te = (e) => {
285
+ if (ge(e), v.current && (window.clearTimeout(v.current), v.current = null), e <= 0) return;
187
286
  const t = a.current;
188
287
  if (!t) return;
189
- const o = (t.duration || 0) - (t.currentTime || 0), r = Math.min(e * 60 * 1e3, o * 1e3);
190
- u.current = window.setTimeout(() => {
288
+ const r = (t.duration || 0) - (t.currentTime || 0), n = Math.min(e * 60 * 1e3, r * 1e3);
289
+ v.current = window.setTimeout(() => {
191
290
  t.pause();
192
- }, r);
193
- }, pe = x.map((e) => e.qualityLabel || "Auto");
194
- return /* @__PURE__ */ k(
291
+ }, n);
292
+ }, xe = y.map((e) => e.qualityLabel || "Auto");
293
+ return /* @__PURE__ */ g(
195
294
  "div",
196
295
  {
197
- ref: L,
198
- className: p(
199
- we({ variant: Z, size: _ }),
296
+ ref: h,
297
+ className: k(
298
+ Ne({ variant: se, size: ue }),
200
299
  "relative bg-black overflow-hidden rounded-2xl",
201
- W
300
+ re
202
301
  ),
203
- onMouseMove: de,
302
+ onMouseMove: Ee,
204
303
  onMouseLeave: () => {
205
- s && l(!1);
304
+ l && f(!1);
206
305
  },
207
- ...ee,
306
+ ...le,
208
307
  children: [
209
- /* @__PURE__ */ n("div", { className: "absolute inset-0 bg-gradient-to-b from-black/40 via-black/0 to-black/70 pointer-events-none" }),
210
- (B || z) && /* @__PURE__ */ k(
308
+ /* @__PURE__ */ o("div", { className: "absolute inset-0 bg-gradient-to-b from-black/40 via-black/0 to-black/70 pointer-events-none" }),
309
+ (U || H) && /* @__PURE__ */ g(
211
310
  "div",
212
311
  {
213
- className: p(
312
+ className: k(
214
313
  "pointer-events-none absolute left-0 right-0 top-0 flex items-center justify-between px-4 py-3 text-sm md:text-base",
215
314
  "bg-gradient-to-b from-black/60 via-black/30 to-transparent text-white",
216
- M || !s ? "opacity-100" : "opacity-0",
315
+ I || !l ? "opacity-100" : "opacity-0",
217
316
  "transition-opacity duration-200"
218
317
  ),
219
318
  children: [
220
- /* @__PURE__ */ n("div", { className: "pointer-events-auto font-semibold truncate max-w-[80%]", children: B }),
221
- /* @__PURE__ */ n(
319
+ /* @__PURE__ */ o("div", { className: "pointer-events-auto font-semibold truncate max-w-[80%]", children: U }),
320
+ /* @__PURE__ */ o(
222
321
  "button",
223
322
  {
224
323
  className: "pointer-events-auto flex h-8 w-8 items-center justify-center rounded-full bg-black/40 border border-white/10",
225
324
  "aria-label": "More info",
226
- children: /* @__PURE__ */ n("span", { className: "text-lg leading-none", children: "i" })
325
+ children: /* @__PURE__ */ o("span", { className: "text-lg leading-none", children: "i" })
227
326
  }
228
327
  )
229
328
  ]
230
329
  }
231
330
  ),
232
- /* @__PURE__ */ n("div", { style: { width: "100%", aspectRatio: "16/9" }, className: "bg-black", children: /* @__PURE__ */ k(
331
+ /* @__PURE__ */ o("div", { style: { width: "100%", aspectRatio: "16/9" }, className: "bg-black", children: /* @__PURE__ */ g(
233
332
  "video",
234
333
  {
235
334
  ref: a,
236
- className: p(
237
- he(),
335
+ className: k(
336
+ Me(),
238
337
  "relative z-0 h-full w-full object-cover cursor-pointer"
239
338
  ),
240
- poster: N || D || void 0,
339
+ crossOrigin: ne || void 0,
340
+ poster: j || D || void 0,
241
341
  preload: "metadata",
242
- loop: Y,
342
+ loop: ce,
243
343
  playsInline: !0,
244
- muted: j,
245
- autoPlay: X,
246
- controls: O || !1,
344
+ muted: W,
345
+ autoPlay: oe,
346
+ controls: ie || !1,
247
347
  controlsList: "nodownload noplaybackrate noremoteplayback",
248
- disablePictureInPicture: !0,
249
348
  onContextMenu: (e) => e.preventDefault(),
250
- onClick: f,
251
- onDoubleClick: I,
349
+ onClick: b,
350
+ onDoubleClick: B,
252
351
  children: [
253
- x.map((e, t) => /* @__PURE__ */ n("source", { src: e.src, type: e.type }, e.src + t)),
254
- E?.map((e, t) => /* @__PURE__ */ n(
352
+ y.map((e, t) => /* @__PURE__ */ o("source", { src: e.src, type: e.type }, e.src + t)),
353
+ M?.map((e, t) => /* @__PURE__ */ o(
255
354
  "track",
256
355
  {
356
+ kind: e.kind || "captions",
257
357
  src: e.src,
258
358
  srcLang: e.srclang,
259
359
  label: e.label,
@@ -265,70 +365,101 @@ const Te = ({
265
365
  ]
266
366
  }
267
367
  ) }),
268
- !s && /* @__PURE__ */ k(
368
+ pe && /* @__PURE__ */ o("div", { className: "absolute inset-0 z-30 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-14 h-14 rounded-full bg-black/60", children: /* @__PURE__ */ g(
369
+ "svg",
370
+ {
371
+ className: "w-8 h-8 animate-spin text-white",
372
+ viewBox: "0 0 24 24",
373
+ fill: "none",
374
+ children: [
375
+ /* @__PURE__ */ o(
376
+ "circle",
377
+ {
378
+ cx: "12",
379
+ cy: "12",
380
+ r: "10",
381
+ stroke: "currentColor",
382
+ strokeWidth: "4",
383
+ strokeOpacity: "0.25"
384
+ }
385
+ ),
386
+ /* @__PURE__ */ o(
387
+ "path",
388
+ {
389
+ d: "M22 12a10 10 0 00-10-10",
390
+ stroke: "currentColor",
391
+ strokeWidth: "4",
392
+ strokeLinecap: "round"
393
+ }
394
+ )
395
+ ]
396
+ }
397
+ ) }) }),
398
+ !l && /* @__PURE__ */ g(
269
399
  "div",
270
400
  {
271
401
  role: "button",
272
402
  tabIndex: 0,
273
- onClick: f,
403
+ onClick: b,
274
404
  onKeyDown: (e) => {
275
- (e.key === "Enter" || e.key === " ") && f();
405
+ (e.key === "Enter" || e.key === " ") && b();
276
406
  },
277
407
  className: "absolute inset-0 z-20 flex items-center justify-center cursor-pointer",
278
408
  children: [
279
- /* @__PURE__ */ n("div", { className: "absolute inset-0 bg-black/35" }),
280
- /* @__PURE__ */ n("div", { className: p(be(), "shadow-xl"), children: /* @__PURE__ */ n("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ n("path", { d: "M8 5v14l11-7z", fill: "currentColor" }) }) })
409
+ /* @__PURE__ */ o("div", { className: "absolute inset-0 bg-black/35" }),
410
+ /* @__PURE__ */ o("div", { className: k(Ce(), "shadow-xl"), children: /* @__PURE__ */ o("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ o("path", { d: "M8 5v14l11-7z", fill: "currentColor" }) }) })
281
411
  ]
282
412
  }
283
413
  ),
284
- s && !M && /* @__PURE__ */ n("div", { className: "pointer-events-none absolute left-0 right-0 bottom-0 h-0.5 bg-white/20", children: /* @__PURE__ */ n(
414
+ l && !I && /* @__PURE__ */ o("div", { className: "pointer-events-none absolute left-0 right-0 bottom-0 h-0.5 bg-white/20", children: /* @__PURE__ */ o(
285
415
  "div",
286
416
  {
287
417
  className: "h-full bg-red-600",
288
- style: { width: `${fe}%` }
418
+ style: { width: `${Le}%` }
289
419
  }
290
420
  ) }),
291
- /* @__PURE__ */ n(
421
+ /* @__PURE__ */ o(
292
422
  "div",
293
423
  {
294
- className: p(
295
- ye(),
424
+ className: k(
425
+ Ie(),
296
426
  "pointer-events-none absolute inset-x-0 bottom-0 pb-2 pt-8",
297
427
  "bg-gradient-to-t from-black/80 via-black/40 to-transparent",
298
428
  "transition-opacity duration-200",
299
- M || !s ? "opacity-100" : "opacity-0"
429
+ I || !l ? "opacity-100" : "opacity-0"
300
430
  ),
301
- children: /* @__PURE__ */ n("div", { className: "pointer-events-auto px-3 md:px-4", children: /* @__PURE__ */ n(
302
- ke,
431
+ children: /* @__PURE__ */ o("div", { className: "pointer-events-auto px-3 md:px-4", children: /* @__PURE__ */ o(
432
+ De,
303
433
  {
304
- playing: s,
305
- onTogglePlay: f,
306
- currentTime: A,
307
- duration: P,
308
- onSeek: d,
309
- muted: j,
310
- volume: te,
311
- onChangeVolume: C,
312
- onToggleMute: U,
313
- captions: !!(E && E.length),
434
+ playing: l,
435
+ onTogglePlay: b,
436
+ currentTime: O,
437
+ duration: C,
438
+ onSeek: p,
439
+ muted: W,
440
+ volume: de,
441
+ onChangeVolume: A,
442
+ onToggleMute: G,
443
+ captions: !!(M && M.length),
314
444
  onToggleCaptions: () => {
315
445
  const e = a.current;
316
446
  if (e)
317
447
  for (let t = 0; t < e.textTracks.length; t++) {
318
- const o = e.textTracks[t];
319
- o.mode = o.mode === "showing" ? "disabled" : "showing";
448
+ const r = e.textTracks[t];
449
+ r.mode = r.mode === "showing" ? "disabled" : "showing";
320
450
  }
321
451
  },
322
- fullscreen: z,
323
- onToggleFullscreen: I,
324
- onTogglePip: ue,
325
- playbackRate: ne,
326
- onPlaybackRateChange: le,
327
- qualities: pe,
328
- qualityIndex: q,
329
- onQualityChange: me,
330
- sleepTimerMinutes: ce,
331
- onChangeSleepTimer: ve
452
+ fullscreen: H,
453
+ onToggleFullscreen: B,
454
+ onTogglePip: ke,
455
+ pipSupported: he,
456
+ playbackRate: me,
457
+ onPlaybackRateChange: we,
458
+ qualities: xe,
459
+ qualityIndex: L,
460
+ onQualityChange: Pe,
461
+ sleepTimerMinutes: be,
462
+ onChangeSleepTimer: Te
332
463
  }
333
464
  ) })
334
465
  }
@@ -337,8 +468,8 @@ const Te = ({
337
468
  }
338
469
  );
339
470
  };
340
- Te.displayName = "VideoPlayer";
471
+ Re.displayName = "VideoPlayer";
341
472
  export {
342
- Te as VideoPlayer,
343
- Te as default
473
+ Re as VideoPlayer,
474
+ Re as default
344
475
  };
package/dist/index.d.ts CHANGED
@@ -213,7 +213,7 @@ export type { RadioProps, RadioGroupProps, RadioOption, } from './components/Rad
213
213
  export type { SwitchProps } from './components/Switch/Switch.types';
214
214
  export type { CheckboxProps, CheckboxGroupProps, CheckboxOption, } from './components/Checkbox/Checkbox.types';
215
215
  export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps, CollapsibleCompactProps, CollapsibleVariant, CollapsibleAnimation, } from './components/Collapsible/Collapsible.types';
216
- export type { DragDropContextProps, EnhancedDragDropContextProps, DroppableContainerProps, DraggableItemProps, DragHandleProps, DragOverlayProps, DropEvent, DragStartEvent, SelectionState, } from './components/DragDrop';
216
+ export type { DragDropContextProps, EnhancedDragDropContextProps, DroppableContainerProps, DraggableItemProps, DragHandleProps, DragOverlayProps, DraggableItem as DraggableItemType, DragPosition, DragAxis, DragSensor, DropEffect, DragStartEvent, DragMoveEvent, DragOverEvent, DropEvent, DragCancelEvent, SelectionState, HistoryState, UndoRedoConfig, MultiDragConfig, VirtualizationConfig, VirtualItem, DragLock, CollaborationConfig, AutoScrollConfig, NestedDragConstraints, SnapToGridConfig, BoundingConstraints, CollisionDetectionConfig, DragAnalytics, DebugConfig, DragDropPlugin, TreeItem as DragDropTreeItem, } from './components/DragDrop';
217
217
  export type { DataTableProps, DataTableCompactProps, DataTableVariant, DataTableSize, DataTableStriped, ColumnDef, SortingState, ColumnFilter, ColumnFiltersState, VisibilityState, RowSelectionState, PaginationState, TableInstance, Row, Column, Cell, SortDirection as DataTableSortDirection, } from './components/DataTable/DataTable.types';
218
218
  export type { FormProps, FormCompactProps, FormFieldProps, FormItemProps, FormLabelProps, FormControlProps, FormDescriptionProps, FormMessageProps, FormSectionProps, FormActionsProps, FormVariant, FormSize, FormLayout, FormFieldConfig, } from './components/Form/Form.types';
219
219
  export type { SelectProps, SelectOption, } from './components/Select/Select.types';