@vite-mf-monorepo/ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/index.js +3 -1
- package/dist/MovieCard.utils-CpNUUs8O.d.ts +58 -0
- package/dist/chunk-5NW3IDX2.js +42 -0
- package/dist/chunk-5NW3IDX2.js.map +1 -0
- package/dist/chunk-FDLKS7BI.js +44 -0
- package/dist/chunk-FDLKS7BI.js.map +1 -0
- package/dist/chunk-JDBRVX5O.js +397 -0
- package/dist/chunk-JDBRVX5O.js.map +1 -0
- package/dist/chunk-WYIIOTWJ.js +49 -0
- package/dist/chunk-WYIIOTWJ.js.map +1 -0
- package/dist/chunk-Y5GP5OWN.js +3 -0
- package/dist/chunk-Y5GP5OWN.js.map +1 -0
- package/dist/index.d.ts +4 -106
- package/dist/index.js +35 -420
- package/dist/index.js.map +1 -1
- package/dist/next/index.d.ts +40 -0
- package/dist/next/index.js +85 -0
- package/dist/next/index.js.map +1 -0
- package/dist/react-router/index.d.ts +19 -0
- package/dist/react-router/index.js +8 -0
- package/dist/react-router/index.js.map +1 -0
- package/package.json +28 -6
- package/dist/chunk-GNBS5RLB.js +0 -85
- package/dist/chunk-GNBS5RLB.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
1
|
+
import './chunk-Y5GP5OWN.js';
|
|
2
|
+
export { MovieCard_default as MovieCard } from './chunk-5NW3IDX2.js';
|
|
3
|
+
import { Button_default } from './chunk-WYIIOTWJ.js';
|
|
4
|
+
export { Button_default as Button } from './chunk-WYIIOTWJ.js';
|
|
5
|
+
import { Typography_default } from './chunk-JDBRVX5O.js';
|
|
6
|
+
export { Image_default as Image, Rating_default as Rating, Typography_default as Typography } from './chunk-JDBRVX5O.js';
|
|
7
|
+
import './chunk-FDLKS7BI.js';
|
|
4
8
|
export { Card_default as Card } from './chunk-JI3OVXCK.js';
|
|
5
9
|
import { Icon_default } from './chunk-JHRISQQJ.js';
|
|
6
10
|
export { Icon_default as Icon } from './chunk-JHRISQQJ.js';
|
|
7
|
-
import
|
|
8
|
-
import { createContext, useState, useRef, useEffect, useCallback,
|
|
11
|
+
import clsx9 from 'clsx';
|
|
12
|
+
import { createContext, useState, useRef, useEffect, useCallback, useLayoutEffect, useContext } from 'react';
|
|
9
13
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import {
|
|
11
|
-
import { Link } from 'react-router-dom';
|
|
14
|
+
import { getOptimizedImageUrl } from '@vite-mf-monorepo/shared';
|
|
12
15
|
|
|
13
16
|
var sizeMap = {
|
|
14
17
|
xs: { container: "ui:h-6 ui:w-6", icon: 12, text: "ui:text-xs" },
|
|
@@ -39,7 +42,7 @@ function Avatar({
|
|
|
39
42
|
return /* @__PURE__ */ jsxs(
|
|
40
43
|
"div",
|
|
41
44
|
{
|
|
42
|
-
className:
|
|
45
|
+
className: clsx9(
|
|
43
46
|
"ui:relative ui:inline-flex ui:items-center ui:justify-center ui:overflow-hidden ui:rounded-full",
|
|
44
47
|
"ui:bg-muted ui:text-muted-foreground",
|
|
45
48
|
container,
|
|
@@ -57,7 +60,7 @@ function Avatar({
|
|
|
57
60
|
...rest
|
|
58
61
|
}
|
|
59
62
|
),
|
|
60
|
-
showInitials && /* @__PURE__ */ jsx("span", { className:
|
|
63
|
+
showInitials && /* @__PURE__ */ jsx("span", { className: clsx9("ui:font-medium ui:uppercase", text), children: initials.slice(0, 2) }),
|
|
61
64
|
showFallback && /* @__PURE__ */ jsx(Icon_default, { name: "User", size: icon })
|
|
62
65
|
]
|
|
63
66
|
}
|
|
@@ -81,7 +84,7 @@ function Badge({
|
|
|
81
84
|
return /* @__PURE__ */ jsxs(
|
|
82
85
|
"span",
|
|
83
86
|
{
|
|
84
|
-
className:
|
|
87
|
+
className: clsx9(
|
|
85
88
|
"ui:inline-flex ui:items-center ui:gap-1 ui:rounded-full ui:font-medium",
|
|
86
89
|
padding,
|
|
87
90
|
text,
|
|
@@ -122,7 +125,7 @@ function IconButton({
|
|
|
122
125
|
return /* @__PURE__ */ jsx(
|
|
123
126
|
"button",
|
|
124
127
|
{
|
|
125
|
-
className:
|
|
128
|
+
className: clsx9(
|
|
126
129
|
"ui:inline-flex ui:items-center ui:justify-center ui:cursor-pointer ui:rounded-full ui:transition-colors",
|
|
127
130
|
"ui:focus:outline-none ui:focus:ring-2 ui:focus:ring-ring ui:focus:ring-offset-2",
|
|
128
131
|
"ui:disabled:pointer-events-none ui:disabled:opacity-50",
|
|
@@ -142,122 +145,6 @@ function IconButton({
|
|
|
142
145
|
);
|
|
143
146
|
}
|
|
144
147
|
var IconButton_default = IconButton;
|
|
145
|
-
function Image({
|
|
146
|
-
src,
|
|
147
|
-
alt,
|
|
148
|
-
blurDataUrl,
|
|
149
|
-
autoBlur = false,
|
|
150
|
-
blurSize = 16,
|
|
151
|
-
blurQuality = 0.3,
|
|
152
|
-
aspectRatio = "2/3",
|
|
153
|
-
fallback,
|
|
154
|
-
className,
|
|
155
|
-
onLoad,
|
|
156
|
-
onError,
|
|
157
|
-
loading = "eager",
|
|
158
|
-
...rest
|
|
159
|
-
}) {
|
|
160
|
-
const imgRef = useRef(null);
|
|
161
|
-
const containerRef = useRef(null);
|
|
162
|
-
const [state, setState] = useState("loading");
|
|
163
|
-
const [generatedBlur, setGeneratedBlur] = useState(
|
|
164
|
-
void 0
|
|
165
|
-
);
|
|
166
|
-
const [blurReady, setBlurReady] = useState(!autoBlur || !!blurDataUrl);
|
|
167
|
-
const [isVisible, setIsVisible] = useState(loading === "eager");
|
|
168
|
-
const effectiveBlur = blurDataUrl ?? generatedBlur;
|
|
169
|
-
useEffect(() => {
|
|
170
|
-
if (loading === "eager" || !containerRef.current) {
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
const observer = new IntersectionObserver(
|
|
174
|
-
([entry]) => {
|
|
175
|
-
if (entry.isIntersecting) {
|
|
176
|
-
setIsVisible(true);
|
|
177
|
-
observer.unobserve(entry.target);
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{ rootMargin: "50px" }
|
|
181
|
-
);
|
|
182
|
-
observer.observe(containerRef.current);
|
|
183
|
-
return () => {
|
|
184
|
-
observer.disconnect();
|
|
185
|
-
};
|
|
186
|
-
}, [loading]);
|
|
187
|
-
useEffect(() => {
|
|
188
|
-
if (!autoBlur || blurDataUrl) {
|
|
189
|
-
setBlurReady(true);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
setBlurReady(false);
|
|
193
|
-
getBlurDataUrl(src, blurSize, blurQuality).then((base64) => {
|
|
194
|
-
setGeneratedBlur(base64);
|
|
195
|
-
setBlurReady(true);
|
|
196
|
-
}).catch(() => {
|
|
197
|
-
setBlurReady(true);
|
|
198
|
-
});
|
|
199
|
-
}, [autoBlur, src, blurDataUrl, blurSize, blurQuality]);
|
|
200
|
-
useEffect(() => {
|
|
201
|
-
setState("loading");
|
|
202
|
-
setGeneratedBlur(void 0);
|
|
203
|
-
if (imgRef.current?.complete && imgRef.current.naturalHeight !== 0) {
|
|
204
|
-
setState("loaded");
|
|
205
|
-
}
|
|
206
|
-
}, [src]);
|
|
207
|
-
const handleLoad = useCallback(() => {
|
|
208
|
-
setState("loaded");
|
|
209
|
-
onLoad?.();
|
|
210
|
-
}, [onLoad]);
|
|
211
|
-
const handleError = useCallback(() => {
|
|
212
|
-
setState("error");
|
|
213
|
-
onError?.();
|
|
214
|
-
}, [onError]);
|
|
215
|
-
const defaultFallback = /* @__PURE__ */ jsx("div", { className: "ui:flex ui:h-full ui:w-full ui:items-center ui:justify-center ui:bg-muted", children: /* @__PURE__ */ jsx(
|
|
216
|
-
Icon_default,
|
|
217
|
-
{
|
|
218
|
-
name: "Photo",
|
|
219
|
-
size: 48,
|
|
220
|
-
className: "ui:text-muted-foreground",
|
|
221
|
-
"aria-hidden": "true"
|
|
222
|
-
}
|
|
223
|
-
) });
|
|
224
|
-
return /* @__PURE__ */ jsx(
|
|
225
|
-
"div",
|
|
226
|
-
{
|
|
227
|
-
ref: containerRef,
|
|
228
|
-
className: clsx15("ui:relative ui:overflow-hidden ui:bg-muted", className),
|
|
229
|
-
style: aspectRatio ? { aspectRatio } : void 0,
|
|
230
|
-
"data-state": state,
|
|
231
|
-
children: state === "error" ? fallback ?? defaultFallback : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
232
|
-
effectiveBlur && state === "loading" && /* @__PURE__ */ jsx(
|
|
233
|
-
"img",
|
|
234
|
-
{
|
|
235
|
-
src: effectiveBlur,
|
|
236
|
-
alt: "",
|
|
237
|
-
"aria-hidden": "true",
|
|
238
|
-
className: "ui:absolute ui:inset-0 ui:h-full ui:w-full ui:scale-105 ui:object-cover"
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
blurReady && isVisible && /* @__PURE__ */ jsx(
|
|
242
|
-
"img",
|
|
243
|
-
{
|
|
244
|
-
ref: imgRef,
|
|
245
|
-
src,
|
|
246
|
-
alt,
|
|
247
|
-
onLoad: handleLoad,
|
|
248
|
-
onError: handleError,
|
|
249
|
-
className: clsx15(
|
|
250
|
-
"ui:absolute ui:inset-0 ui:h-full ui:w-full ui:object-cover ui:transition-opacity ui:duration-300",
|
|
251
|
-
state === "loaded" ? "ui:opacity-100" : "ui:opacity-0"
|
|
252
|
-
),
|
|
253
|
-
...rest
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
] })
|
|
257
|
-
}
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
var Image_default = Image;
|
|
261
148
|
function Skeleton({
|
|
262
149
|
variant = "rectangle",
|
|
263
150
|
width,
|
|
@@ -270,7 +157,7 @@ function Skeleton({
|
|
|
270
157
|
return /* @__PURE__ */ jsx(
|
|
271
158
|
"div",
|
|
272
159
|
{
|
|
273
|
-
className:
|
|
160
|
+
className: clsx9(
|
|
274
161
|
"ui:relative ui:overflow-hidden ui:bg-muted",
|
|
275
162
|
"ui-skeleton-shimmer",
|
|
276
163
|
{
|
|
@@ -364,7 +251,7 @@ function Modal({
|
|
|
364
251
|
"aria-modal": "true",
|
|
365
252
|
onClick: handleClick,
|
|
366
253
|
onClose: handleClose,
|
|
367
|
-
className:
|
|
254
|
+
className: clsx9(
|
|
368
255
|
"ui:backdrop:bg-black/80",
|
|
369
256
|
"ui:bg-transparent ui:border-0 ui:p-0",
|
|
370
257
|
"ui:max-w-none ui:max-h-none ui:w-full ui:h-full",
|
|
@@ -375,278 +262,6 @@ function Modal({
|
|
|
375
262
|
);
|
|
376
263
|
}
|
|
377
264
|
var Modal_default = Modal;
|
|
378
|
-
var circleSizeMap = {
|
|
379
|
-
sm: { size: 32, stroke: 3, fontSize: "ui:text-xs" },
|
|
380
|
-
md: { size: 48, stroke: 4, fontSize: "ui:text-sm" },
|
|
381
|
-
lg: { size: 64, stroke: 5, fontSize: "ui:text-base" }
|
|
382
|
-
};
|
|
383
|
-
var getColorClass = (percent) => {
|
|
384
|
-
if (percent >= 70) return "ui:text-green-600";
|
|
385
|
-
if (percent >= 40) return "ui:text-amber-600";
|
|
386
|
-
return "ui:text-red-500";
|
|
387
|
-
};
|
|
388
|
-
function CircleRating({
|
|
389
|
-
percent,
|
|
390
|
-
size,
|
|
391
|
-
showValue,
|
|
392
|
-
value,
|
|
393
|
-
max,
|
|
394
|
-
trackClassName
|
|
395
|
-
}) {
|
|
396
|
-
const { size: svgSize, stroke, fontSize } = circleSizeMap[size];
|
|
397
|
-
const radius = (svgSize - stroke) / 2;
|
|
398
|
-
const circumference = 2 * Math.PI * radius;
|
|
399
|
-
const offset = circumference - percent / 100 * circumference;
|
|
400
|
-
return /* @__PURE__ */ jsxs("div", { className: "ui:relative ui:inline-flex ui:items-center ui:justify-center", children: [
|
|
401
|
-
/* @__PURE__ */ jsxs("svg", { width: svgSize, height: svgSize, className: "ui:-rotate-90", children: [
|
|
402
|
-
/* @__PURE__ */ jsx(
|
|
403
|
-
"circle",
|
|
404
|
-
{
|
|
405
|
-
cx: svgSize / 2,
|
|
406
|
-
cy: svgSize / 2,
|
|
407
|
-
r: radius,
|
|
408
|
-
fill: "none",
|
|
409
|
-
stroke: "currentColor",
|
|
410
|
-
strokeWidth: stroke,
|
|
411
|
-
className: trackClassName ?? "ui:text-gray-200"
|
|
412
|
-
}
|
|
413
|
-
),
|
|
414
|
-
/* @__PURE__ */ jsx(
|
|
415
|
-
"circle",
|
|
416
|
-
{
|
|
417
|
-
cx: svgSize / 2,
|
|
418
|
-
cy: svgSize / 2,
|
|
419
|
-
r: radius,
|
|
420
|
-
fill: "none",
|
|
421
|
-
stroke: "currentColor",
|
|
422
|
-
strokeWidth: stroke,
|
|
423
|
-
strokeLinecap: "round",
|
|
424
|
-
strokeDasharray: circumference,
|
|
425
|
-
strokeDashoffset: offset,
|
|
426
|
-
className: clsx15(
|
|
427
|
-
"ui:transition-all ui:duration-500",
|
|
428
|
-
getColorClass(percent)
|
|
429
|
-
)
|
|
430
|
-
}
|
|
431
|
-
)
|
|
432
|
-
] }),
|
|
433
|
-
showValue && /* @__PURE__ */ jsx(
|
|
434
|
-
"span",
|
|
435
|
-
{
|
|
436
|
-
className: clsx15(
|
|
437
|
-
"ui:absolute ui:font-bold",
|
|
438
|
-
fontSize,
|
|
439
|
-
getColorClass(percent)
|
|
440
|
-
),
|
|
441
|
-
children: max === 100 ? Math.round(percent) : value.toFixed(1)
|
|
442
|
-
}
|
|
443
|
-
)
|
|
444
|
-
] });
|
|
445
|
-
}
|
|
446
|
-
var CircleRating_default = CircleRating;
|
|
447
|
-
var starsSizeMap = {
|
|
448
|
-
sm: 16,
|
|
449
|
-
md: 20,
|
|
450
|
-
lg: 24
|
|
451
|
-
};
|
|
452
|
-
function StarsRating({
|
|
453
|
-
percent,
|
|
454
|
-
size,
|
|
455
|
-
showValue,
|
|
456
|
-
value,
|
|
457
|
-
max
|
|
458
|
-
}) {
|
|
459
|
-
const iconSize = starsSizeMap[size];
|
|
460
|
-
return /* @__PURE__ */ jsxs("div", { className: "ui:inline-flex ui:items-center ui:gap-1", children: [
|
|
461
|
-
/* @__PURE__ */ jsxs("div", { className: "ui:relative", children: [
|
|
462
|
-
/* @__PURE__ */ jsx("div", { className: "ui:flex ui:text-gray-300", children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx(Icon_default, { name: "Star", size: iconSize }, i)) }),
|
|
463
|
-
/* @__PURE__ */ jsx(
|
|
464
|
-
"div",
|
|
465
|
-
{
|
|
466
|
-
className: "ui:absolute ui:inset-0 ui:flex ui:text-yellow-400",
|
|
467
|
-
style: { clipPath: `inset(0 ${String(100 - percent)}% 0 0)` },
|
|
468
|
-
children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx(Icon_default, { name: "Star", size: iconSize }, i))
|
|
469
|
-
}
|
|
470
|
-
)
|
|
471
|
-
] }),
|
|
472
|
-
showValue && /* @__PURE__ */ jsx(
|
|
473
|
-
"span",
|
|
474
|
-
{
|
|
475
|
-
className: clsx15(
|
|
476
|
-
"ui:font-medium ui:text-muted-foreground",
|
|
477
|
-
size === "sm" && "ui:text-xs",
|
|
478
|
-
size === "md" && "ui:text-sm",
|
|
479
|
-
size === "lg" && "ui:text-base"
|
|
480
|
-
),
|
|
481
|
-
children: max === 100 ? (value / 10).toFixed(1) : value.toFixed(1)
|
|
482
|
-
}
|
|
483
|
-
)
|
|
484
|
-
] });
|
|
485
|
-
}
|
|
486
|
-
var StarsRating_default = StarsRating;
|
|
487
|
-
function Rating({
|
|
488
|
-
value,
|
|
489
|
-
max = 10,
|
|
490
|
-
variant = "circle",
|
|
491
|
-
size = "md",
|
|
492
|
-
showValue = true,
|
|
493
|
-
trackClassName,
|
|
494
|
-
className
|
|
495
|
-
}) {
|
|
496
|
-
const clampedValue = Math.max(0, Math.min(value, max));
|
|
497
|
-
const percent = clampedValue / max * 100;
|
|
498
|
-
return /* @__PURE__ */ jsx("div", { className: clsx15("ui:inline-flex", className), children: variant === "circle" ? /* @__PURE__ */ jsx(
|
|
499
|
-
CircleRating_default,
|
|
500
|
-
{
|
|
501
|
-
percent,
|
|
502
|
-
size,
|
|
503
|
-
showValue,
|
|
504
|
-
value: clampedValue,
|
|
505
|
-
max,
|
|
506
|
-
trackClassName
|
|
507
|
-
}
|
|
508
|
-
) : /* @__PURE__ */ jsx(
|
|
509
|
-
StarsRating_default,
|
|
510
|
-
{
|
|
511
|
-
percent,
|
|
512
|
-
size,
|
|
513
|
-
showValue,
|
|
514
|
-
value: clampedValue,
|
|
515
|
-
max
|
|
516
|
-
}
|
|
517
|
-
) });
|
|
518
|
-
}
|
|
519
|
-
var Rating_default = Rating;
|
|
520
|
-
var variantStyles = {
|
|
521
|
-
h1: "ui:font-roboto ui:text-xl ui:sm:text-2xl ui:md:text-3xl ui:lg:text-4xl ui:font-bold ui:leading-tight ui:text-foreground",
|
|
522
|
-
h2: "ui:font-roboto ui:text-lg ui:sm:text-xl ui:md:text-2xl ui:lg:text-3xl ui:font-bold ui:leading-tight ui:text-foreground",
|
|
523
|
-
h3: "ui:font-roboto ui:text-base ui:sm:text-lg ui:md:text-xl ui:lg:text-2xl ui:font-semibold ui:leading-snug ui:text-foreground",
|
|
524
|
-
h4: "ui:font-roboto ui:text-sm ui:sm:text-base ui:md:text-lg ui:lg:text-xl ui:font-semibold ui:leading-snug ui:text-foreground",
|
|
525
|
-
h5: "ui:font-roboto ui:text-sm ui:sm:text-base ui:md:text-lg ui:font-medium ui:leading-normal ui:text-foreground",
|
|
526
|
-
h6: "ui:font-roboto ui:text-xs ui:sm:text-sm ui:md:text-base ui:font-medium ui:leading-normal ui:text-foreground",
|
|
527
|
-
body: "ui:font-inter ui:text-xs ui:sm:text-sm ui:md:text-base ui:leading-relaxed ui:text-foreground",
|
|
528
|
-
"body-sm": "ui:font-inter ui:text-xs ui:sm:text-sm ui:leading-relaxed ui:text-foreground",
|
|
529
|
-
"body-lg": "ui:font-inter ui:text-sm ui:sm:text-base ui:md:text-lg ui:leading-relaxed ui:text-foreground",
|
|
530
|
-
lead: "ui:font-inter ui:text-sm ui:sm:text-base ui:md:text-lg ui:lg:text-xl ui:leading-relaxed ui:text-muted-foreground",
|
|
531
|
-
caption: "ui:font-inter ui:text-xs ui:sm:text-sm ui:text-muted-foreground",
|
|
532
|
-
"caption-xs": "ui:font-inter ui:text-xs ui:text-muted-foreground",
|
|
533
|
-
label: "ui:font-inter ui:text-xs ui:sm:text-sm ui:font-medium ui:text-foreground",
|
|
534
|
-
muted: "ui:font-inter ui:text-xs ui:sm:text-sm ui:text-muted-foreground",
|
|
535
|
-
blockquote: "ui:font-inter ui:text-xs ui:sm:text-sm ui:md:text-base ui:border-l-4 ui:border-border ui:pl-4 ui:italic ui:text-muted-foreground"
|
|
536
|
-
};
|
|
537
|
-
var variantToTag = {
|
|
538
|
-
h1: "h1",
|
|
539
|
-
h2: "h2",
|
|
540
|
-
h3: "h3",
|
|
541
|
-
h4: "h4",
|
|
542
|
-
h5: "h5",
|
|
543
|
-
h6: "h6",
|
|
544
|
-
body: "p",
|
|
545
|
-
"body-sm": "p",
|
|
546
|
-
"body-lg": "p",
|
|
547
|
-
lead: "p",
|
|
548
|
-
caption: "span",
|
|
549
|
-
"caption-xs": "span",
|
|
550
|
-
label: "label",
|
|
551
|
-
muted: "p",
|
|
552
|
-
blockquote: "blockquote"
|
|
553
|
-
};
|
|
554
|
-
function Typography({
|
|
555
|
-
variant,
|
|
556
|
-
as,
|
|
557
|
-
className,
|
|
558
|
-
children,
|
|
559
|
-
...rest
|
|
560
|
-
}) {
|
|
561
|
-
const Component = as ?? variantToTag[variant];
|
|
562
|
-
return createElement(
|
|
563
|
-
Component,
|
|
564
|
-
{ className: clsx15(variantStyles[variant], className), ...rest },
|
|
565
|
-
children
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
var Typography_default = Typography;
|
|
569
|
-
function MovieCard({
|
|
570
|
-
id,
|
|
571
|
-
title,
|
|
572
|
-
posterUrl,
|
|
573
|
-
voteAverage,
|
|
574
|
-
year,
|
|
575
|
-
className,
|
|
576
|
-
imageLoading = "lazy",
|
|
577
|
-
as = "card",
|
|
578
|
-
...rest
|
|
579
|
-
}) {
|
|
580
|
-
const to = "to" in rest ? rest.to : void 0;
|
|
581
|
-
const onClick = "onClick" in rest ? rest.onClick : void 0;
|
|
582
|
-
const isInteractive = as === "link" || as === "button";
|
|
583
|
-
const cardContent = /* @__PURE__ */ jsxs(
|
|
584
|
-
Card_default,
|
|
585
|
-
{
|
|
586
|
-
variant: "ghost",
|
|
587
|
-
className: clsx15(
|
|
588
|
-
"ui:group ui:relative ui:flex ui:flex-col ui:overflow-hidden",
|
|
589
|
-
isInteractive && [
|
|
590
|
-
"ui:cursor-pointer",
|
|
591
|
-
"ui:transition-transform ui:duration-200",
|
|
592
|
-
"hover:ui:scale-[1.02]"
|
|
593
|
-
],
|
|
594
|
-
className
|
|
595
|
-
),
|
|
596
|
-
onClick: as === "button" ? onClick : void 0,
|
|
597
|
-
"data-testid": `movie-card-${String(id)}`,
|
|
598
|
-
children: [
|
|
599
|
-
/* @__PURE__ */ jsxs("div", { className: "ui:relative ui:aspect-[2/3] ui:w-full ui:overflow-hidden ui:rounded-md ui:bg-gray-200", children: [
|
|
600
|
-
/* @__PURE__ */ jsx(
|
|
601
|
-
Image_default,
|
|
602
|
-
{
|
|
603
|
-
src: posterUrl,
|
|
604
|
-
alt: title,
|
|
605
|
-
loading: imageLoading,
|
|
606
|
-
aspectRatio: void 0,
|
|
607
|
-
className: "ui:h-full ui:w-full ui:object-cover"
|
|
608
|
-
}
|
|
609
|
-
),
|
|
610
|
-
/* @__PURE__ */ jsx("div", { className: "ui:absolute ui:bottom-2 ui:right-2 ui:flex ui:items-center ui:justify-center ui:rounded-full ui:bg-white/80 ui:p-1", children: /* @__PURE__ */ jsx(
|
|
611
|
-
Rating_default,
|
|
612
|
-
{
|
|
613
|
-
value: voteAverage,
|
|
614
|
-
size: "sm",
|
|
615
|
-
variant: "circle",
|
|
616
|
-
trackClassName: "ui:text-gray-200",
|
|
617
|
-
className: "ui:drop-shadow"
|
|
618
|
-
}
|
|
619
|
-
) })
|
|
620
|
-
] }),
|
|
621
|
-
/* @__PURE__ */ jsxs("div", { className: "ui:mt-2 ui:flex ui:flex-col ui:gap-0.5 ui:px-1", children: [
|
|
622
|
-
/* @__PURE__ */ jsx(
|
|
623
|
-
Typography_default,
|
|
624
|
-
{
|
|
625
|
-
variant: "label",
|
|
626
|
-
as: "h3",
|
|
627
|
-
className: "ui:line-clamp-2",
|
|
628
|
-
title,
|
|
629
|
-
children: title
|
|
630
|
-
}
|
|
631
|
-
),
|
|
632
|
-
year && /* @__PURE__ */ jsx(
|
|
633
|
-
Typography_default,
|
|
634
|
-
{
|
|
635
|
-
variant: "caption-xs",
|
|
636
|
-
className: "ui:[.media-section:nth-of-type(odd)_&]:text-badge-foreground",
|
|
637
|
-
children: year
|
|
638
|
-
}
|
|
639
|
-
)
|
|
640
|
-
] })
|
|
641
|
-
]
|
|
642
|
-
}
|
|
643
|
-
);
|
|
644
|
-
if (as === "link" && to) {
|
|
645
|
-
return /* @__PURE__ */ jsx(Link, { to, className: "ui:block ui:no-underline ui:text-inherit", children: cardContent });
|
|
646
|
-
}
|
|
647
|
-
return cardContent;
|
|
648
|
-
}
|
|
649
|
-
var MovieCard_default = MovieCard;
|
|
650
265
|
function TrailerCard({
|
|
651
266
|
videoKey,
|
|
652
267
|
title,
|
|
@@ -659,7 +274,7 @@ function TrailerCard({
|
|
|
659
274
|
/* @__PURE__ */ jsxs(
|
|
660
275
|
"button",
|
|
661
276
|
{
|
|
662
|
-
className:
|
|
277
|
+
className: clsx9(
|
|
663
278
|
"ui:group ui:relative ui:flex ui:aspect-video ui:w-full ui:cursor-pointer ui:overflow-hidden ui:rounded-lg ui:bg-gray-200",
|
|
664
279
|
"ui:transition-transform ui:duration-200 hover:ui:scale-[1.02]",
|
|
665
280
|
className
|
|
@@ -732,7 +347,7 @@ function CarouselCounter({
|
|
|
732
347
|
return /* @__PURE__ */ jsxs(
|
|
733
348
|
"div",
|
|
734
349
|
{
|
|
735
|
-
className:
|
|
350
|
+
className: clsx9(
|
|
736
351
|
"ui:bg-black/50 ui:rounded-full ui:px-3 ui:py-1",
|
|
737
352
|
"ui:text-white/90 ui:text-sm ui:font-medium ui:tabular-nums",
|
|
738
353
|
className
|
|
@@ -822,7 +437,7 @@ function CarouselNavigation({
|
|
|
822
437
|
) })
|
|
823
438
|
] });
|
|
824
439
|
}
|
|
825
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
440
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx9("ui:flex ui:gap-2", className), children: [
|
|
826
441
|
/* @__PURE__ */ jsx(
|
|
827
442
|
IconButton_default,
|
|
828
443
|
{
|
|
@@ -855,13 +470,13 @@ function CarouselPagination({
|
|
|
855
470
|
className
|
|
856
471
|
}) {
|
|
857
472
|
if (total === 0) return null;
|
|
858
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
473
|
+
return /* @__PURE__ */ jsx("div", { className: clsx9("ui:flex ui:items-center ui:gap-2", className), children: Array.from({ length: total }).map((_, index) => /* @__PURE__ */ jsx(
|
|
859
474
|
"div",
|
|
860
475
|
{
|
|
861
476
|
"aria-hidden": "true",
|
|
862
|
-
className:
|
|
477
|
+
className: clsx9(
|
|
863
478
|
"ui:rounded-full ui:transition-all ui:duration-300",
|
|
864
|
-
index === current ?
|
|
479
|
+
index === current ? clsx9("ui:h-2 ui:w-6", light ? "ui:bg-white" : "ui:bg-primary") : clsx9(
|
|
865
480
|
"ui:h-2 ui:w-2",
|
|
866
481
|
light ? "ui:bg-white/50 hover:ui:bg-white/70" : "ui:bg-gray-400 hover:ui:bg-gray-500"
|
|
867
482
|
)
|
|
@@ -1028,12 +643,12 @@ function Carousel({
|
|
|
1028
643
|
const canScrollPrev = currentIndex > 0;
|
|
1029
644
|
const canScrollNext = currentIndex < totalPositions - 1;
|
|
1030
645
|
const showControls = totalPositions > 1;
|
|
1031
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
646
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx9("ui:relative", isLightbox && "ui:h-full", className), children: [
|
|
1032
647
|
/* @__PURE__ */ jsx(
|
|
1033
648
|
"div",
|
|
1034
649
|
{
|
|
1035
650
|
ref: scrollRef,
|
|
1036
|
-
className:
|
|
651
|
+
className: clsx9(
|
|
1037
652
|
"ui:flex ui:overflow-x-auto ui:scroll-smooth ui:scrollbar-none",
|
|
1038
653
|
isFullWidth && "ui:snap-x ui:snap-mandatory",
|
|
1039
654
|
isLightbox && "ui:h-full",
|
|
@@ -1057,7 +672,7 @@ function Carousel({
|
|
|
1057
672
|
showControls && isHero && (showPagination || showArrows) && /* @__PURE__ */ jsxs(
|
|
1058
673
|
"div",
|
|
1059
674
|
{
|
|
1060
|
-
className:
|
|
675
|
+
className: clsx9(
|
|
1061
676
|
"ui:absolute ui:bottom-4 ui:left-1/2 ui:-translate-x-1/2 ui:w-full ui:z-10 ui:flex ui:items-end",
|
|
1062
677
|
heroControlsClassName
|
|
1063
678
|
),
|
|
@@ -1087,7 +702,7 @@ function Carousel({
|
|
|
1087
702
|
showControls && !isHero && !isLightbox && (showArrows && arrowPosition === "bottom-right" || showPagination) ? /* @__PURE__ */ jsxs(
|
|
1088
703
|
"div",
|
|
1089
704
|
{
|
|
1090
|
-
className:
|
|
705
|
+
className: clsx9(
|
|
1091
706
|
"ui:mt-4 ui:flex ui:items-center",
|
|
1092
707
|
arrowPosition === "bottom-right" ? "ui:justify-end ui:gap-4" : "ui:justify-center"
|
|
1093
708
|
),
|
|
@@ -1132,7 +747,7 @@ function CarouselItem({
|
|
|
1132
747
|
return /* @__PURE__ */ jsx(
|
|
1133
748
|
"div",
|
|
1134
749
|
{
|
|
1135
|
-
className:
|
|
750
|
+
className: clsx9(
|
|
1136
751
|
"ui:flex-shrink-0",
|
|
1137
752
|
(isHero || isLightbox) && "ui:w-full ui:snap-center",
|
|
1138
753
|
isLightbox && "ui:flex ui:items-center ui:justify-center ui:h-full",
|
|
@@ -1248,7 +863,7 @@ function TabsList({ className, children, ...rest }) {
|
|
|
1248
863
|
children: /* @__PURE__ */ jsx(
|
|
1249
864
|
"div",
|
|
1250
865
|
{
|
|
1251
|
-
className:
|
|
866
|
+
className: clsx9(
|
|
1252
867
|
"ui:flex ui:gap-1",
|
|
1253
868
|
variant === "underline" && "ui:border-b ui:border-border",
|
|
1254
869
|
variant === "pills" && "ui:[.media-section:nth-of-type(odd)_&]:bg-white ui:bg-muted ui:p-1 ui:rounded-lg ui:w-fit",
|
|
@@ -1276,7 +891,7 @@ function TabsPanel({ value, children, ...rest }) {
|
|
|
1276
891
|
"aria-labelledby": getTabId(value),
|
|
1277
892
|
hidden: !isActive,
|
|
1278
893
|
...rest,
|
|
1279
|
-
className:
|
|
894
|
+
className: clsx9("ui:mt-4", rest.className),
|
|
1280
895
|
children
|
|
1281
896
|
}
|
|
1282
897
|
);
|
|
@@ -1368,7 +983,7 @@ function TabsTrigger({
|
|
|
1368
983
|
id: getTabId(value),
|
|
1369
984
|
tabIndex: isActive ? 0 : -1,
|
|
1370
985
|
disabled,
|
|
1371
|
-
className:
|
|
986
|
+
className: clsx9(
|
|
1372
987
|
"ui:px-4 ui:py-2 ui:font-roboto ui:text-sm ui:font-medium",
|
|
1373
988
|
"ui:flex ui:items-center ui:gap-2",
|
|
1374
989
|
"ui:transition-colors ui:duration-200",
|
|
@@ -1425,7 +1040,7 @@ function Tabs({
|
|
|
1425
1040
|
variant,
|
|
1426
1041
|
prefix
|
|
1427
1042
|
},
|
|
1428
|
-
children: /* @__PURE__ */ jsx("div", { className:
|
|
1043
|
+
children: /* @__PURE__ */ jsx("div", { className: clsx9("ui:w-full", className), ...rest, children })
|
|
1429
1044
|
}
|
|
1430
1045
|
);
|
|
1431
1046
|
}
|
|
@@ -1445,7 +1060,7 @@ function Talent({
|
|
|
1445
1060
|
return /* @__PURE__ */ jsxs(
|
|
1446
1061
|
"div",
|
|
1447
1062
|
{
|
|
1448
|
-
className:
|
|
1063
|
+
className: clsx9(
|
|
1449
1064
|
"ui:flex ui:items-center",
|
|
1450
1065
|
{
|
|
1451
1066
|
"ui:flex-col ui:text-center ui:gap-3": variant === "vertical",
|
|
@@ -1468,7 +1083,7 @@ function Talent({
|
|
|
1468
1083
|
/* @__PURE__ */ jsxs(
|
|
1469
1084
|
"div",
|
|
1470
1085
|
{
|
|
1471
|
-
className:
|
|
1086
|
+
className: clsx9({ "ui:flex ui:flex-col": variant === "horizontal" }),
|
|
1472
1087
|
children: [
|
|
1473
1088
|
/* @__PURE__ */ jsx(
|
|
1474
1089
|
Typography_default,
|
|
@@ -1500,7 +1115,7 @@ function Spinner({ className }) {
|
|
|
1500
1115
|
{
|
|
1501
1116
|
role: "status",
|
|
1502
1117
|
"aria-label": "Loading",
|
|
1503
|
-
className:
|
|
1118
|
+
className: clsx9(
|
|
1504
1119
|
"ui:size-12 ui:rounded-full ui:border-4 ui:border-white/20 ui:border-t-white ui:animate-spin",
|
|
1505
1120
|
className
|
|
1506
1121
|
)
|
|
@@ -1509,6 +1124,6 @@ function Spinner({ className }) {
|
|
|
1509
1124
|
}
|
|
1510
1125
|
var Spinner_default = Spinner;
|
|
1511
1126
|
|
|
1512
|
-
export { Avatar_default as Avatar, Badge_default as Badge, Carousel_default as Carousel, CarouselCounter_default as CarouselCounter, CarouselItem_default as CarouselItem, CarouselLoading_default as CarouselLoading, CarouselNavigation_default as CarouselNavigation, CarouselPagination_default as CarouselPagination, HeroImage_default as HeroImage, IconButton_default as IconButton,
|
|
1127
|
+
export { Avatar_default as Avatar, Badge_default as Badge, Carousel_default as Carousel, CarouselCounter_default as CarouselCounter, CarouselItem_default as CarouselItem, CarouselLoading_default as CarouselLoading, CarouselNavigation_default as CarouselNavigation, CarouselPagination_default as CarouselPagination, HeroImage_default as HeroImage, IconButton_default as IconButton, Modal_default as Modal, Skeleton_default as Skeleton, Spinner_default as Spinner, Tabs_default as Tabs, Talent_default as Talent, TrailerCard_default as TrailerCard };
|
|
1513
1128
|
//# sourceMappingURL=index.js.map
|
|
1514
1129
|
//# sourceMappingURL=index.js.map
|