@vite-mf-monorepo/ui 0.1.1 → 0.3.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-JPJYJLAP.js +38 -0
- package/dist/chunk-JPJYJLAP.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 +36 -449
- package/dist/index.js.map +1 -1
- package/dist/next/index.d.ts +48 -0
- package/dist/next/index.js +120 -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 +24 -2
- package/dist/chunk-GNBS5RLB.js +0 -85
- package/dist/chunk-GNBS5RLB.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import './chunk-Y5GP5OWN.js';
|
|
2
|
+
import { Skeleton_default } from './chunk-JPJYJLAP.js';
|
|
3
|
+
export { Skeleton_default as Skeleton } from './chunk-JPJYJLAP.js';
|
|
4
|
+
export { MovieCard_default as MovieCard } from './chunk-5NW3IDX2.js';
|
|
5
|
+
import { Button_default } from './chunk-WYIIOTWJ.js';
|
|
6
|
+
export { Button_default as Button } from './chunk-WYIIOTWJ.js';
|
|
7
|
+
import { Typography_default } from './chunk-JDBRVX5O.js';
|
|
8
|
+
export { Image_default as Image, Rating_default as Rating, Typography_default as Typography } from './chunk-JDBRVX5O.js';
|
|
9
|
+
import './chunk-FDLKS7BI.js';
|
|
4
10
|
export { Card_default as Card } from './chunk-JI3OVXCK.js';
|
|
5
11
|
import { Icon_default } from './chunk-JHRISQQJ.js';
|
|
6
12
|
export { Icon_default as Icon } from './chunk-JHRISQQJ.js';
|
|
7
|
-
import
|
|
8
|
-
import { createContext, useState, useRef, useEffect, useCallback,
|
|
13
|
+
import clsx8 from 'clsx';
|
|
14
|
+
import { createContext, useState, useRef, useEffect, useCallback, useLayoutEffect, useContext } from 'react';
|
|
9
15
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import {
|
|
11
|
-
import { Link } from 'react-router-dom';
|
|
16
|
+
import { getOptimizedImageUrl } from '@vite-mf-monorepo/shared';
|
|
12
17
|
|
|
13
18
|
var sizeMap = {
|
|
14
19
|
xs: { container: "ui:h-6 ui:w-6", icon: 12, text: "ui:text-xs" },
|
|
@@ -39,7 +44,7 @@ function Avatar({
|
|
|
39
44
|
return /* @__PURE__ */ jsxs(
|
|
40
45
|
"div",
|
|
41
46
|
{
|
|
42
|
-
className:
|
|
47
|
+
className: clsx8(
|
|
43
48
|
"ui:relative ui:inline-flex ui:items-center ui:justify-center ui:overflow-hidden ui:rounded-full",
|
|
44
49
|
"ui:bg-muted ui:text-muted-foreground",
|
|
45
50
|
container,
|
|
@@ -57,7 +62,7 @@ function Avatar({
|
|
|
57
62
|
...rest
|
|
58
63
|
}
|
|
59
64
|
),
|
|
60
|
-
showInitials && /* @__PURE__ */ jsx("span", { className:
|
|
65
|
+
showInitials && /* @__PURE__ */ jsx("span", { className: clsx8("ui:font-medium ui:uppercase", text), children: initials.slice(0, 2) }),
|
|
61
66
|
showFallback && /* @__PURE__ */ jsx(Icon_default, { name: "User", size: icon })
|
|
62
67
|
]
|
|
63
68
|
}
|
|
@@ -81,7 +86,7 @@ function Badge({
|
|
|
81
86
|
return /* @__PURE__ */ jsxs(
|
|
82
87
|
"span",
|
|
83
88
|
{
|
|
84
|
-
className:
|
|
89
|
+
className: clsx8(
|
|
85
90
|
"ui:inline-flex ui:items-center ui:gap-1 ui:rounded-full ui:font-medium",
|
|
86
91
|
padding,
|
|
87
92
|
text,
|
|
@@ -122,7 +127,7 @@ function IconButton({
|
|
|
122
127
|
return /* @__PURE__ */ jsx(
|
|
123
128
|
"button",
|
|
124
129
|
{
|
|
125
|
-
className:
|
|
130
|
+
className: clsx8(
|
|
126
131
|
"ui:inline-flex ui:items-center ui:justify-center ui:cursor-pointer ui:rounded-full ui:transition-colors",
|
|
127
132
|
"ui:focus:outline-none ui:focus:ring-2 ui:focus:ring-ring ui:focus:ring-offset-2",
|
|
128
133
|
"ui:disabled:pointer-events-none ui:disabled:opacity-50",
|
|
@@ -142,152 +147,6 @@ function IconButton({
|
|
|
142
147
|
);
|
|
143
148
|
}
|
|
144
149
|
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
|
-
function Skeleton({
|
|
262
|
-
variant = "rectangle",
|
|
263
|
-
width,
|
|
264
|
-
height,
|
|
265
|
-
aspectRatio,
|
|
266
|
-
rounded = true,
|
|
267
|
-
className,
|
|
268
|
-
...rest
|
|
269
|
-
}) {
|
|
270
|
-
return /* @__PURE__ */ jsx(
|
|
271
|
-
"div",
|
|
272
|
-
{
|
|
273
|
-
className: clsx15(
|
|
274
|
-
"ui:relative ui:overflow-hidden ui:bg-muted",
|
|
275
|
-
"ui-skeleton-shimmer",
|
|
276
|
-
{
|
|
277
|
-
"ui:rounded-lg": variant === "rectangle" && rounded,
|
|
278
|
-
"ui:rounded-full": variant === "circle",
|
|
279
|
-
"ui:rounded": variant === "line" && rounded
|
|
280
|
-
},
|
|
281
|
-
width,
|
|
282
|
-
height,
|
|
283
|
-
className
|
|
284
|
-
),
|
|
285
|
-
style: aspectRatio ? { aspectRatio } : void 0,
|
|
286
|
-
...rest
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
var Skeleton_default = Skeleton;
|
|
291
150
|
function HeroImage({ backdropPath, title }) {
|
|
292
151
|
const [loading, setLoading] = useState(true);
|
|
293
152
|
const backdropPathMobile = backdropPath ? getOptimizedImageUrl(backdropPath, "w300", 60) : void 0;
|
|
@@ -364,7 +223,7 @@ function Modal({
|
|
|
364
223
|
"aria-modal": "true",
|
|
365
224
|
onClick: handleClick,
|
|
366
225
|
onClose: handleClose,
|
|
367
|
-
className:
|
|
226
|
+
className: clsx8(
|
|
368
227
|
"ui:backdrop:bg-black/80",
|
|
369
228
|
"ui:bg-transparent ui:border-0 ui:p-0",
|
|
370
229
|
"ui:max-w-none ui:max-h-none ui:w-full ui:h-full",
|
|
@@ -375,278 +234,6 @@ function Modal({
|
|
|
375
234
|
);
|
|
376
235
|
}
|
|
377
236
|
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
237
|
function TrailerCard({
|
|
651
238
|
videoKey,
|
|
652
239
|
title,
|
|
@@ -659,7 +246,7 @@ function TrailerCard({
|
|
|
659
246
|
/* @__PURE__ */ jsxs(
|
|
660
247
|
"button",
|
|
661
248
|
{
|
|
662
|
-
className:
|
|
249
|
+
className: clsx8(
|
|
663
250
|
"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
251
|
"ui:transition-transform ui:duration-200 hover:ui:scale-[1.02]",
|
|
665
252
|
className
|
|
@@ -732,7 +319,7 @@ function CarouselCounter({
|
|
|
732
319
|
return /* @__PURE__ */ jsxs(
|
|
733
320
|
"div",
|
|
734
321
|
{
|
|
735
|
-
className:
|
|
322
|
+
className: clsx8(
|
|
736
323
|
"ui:bg-black/50 ui:rounded-full ui:px-3 ui:py-1",
|
|
737
324
|
"ui:text-white/90 ui:text-sm ui:font-medium ui:tabular-nums",
|
|
738
325
|
className
|
|
@@ -822,7 +409,7 @@ function CarouselNavigation({
|
|
|
822
409
|
) })
|
|
823
410
|
] });
|
|
824
411
|
}
|
|
825
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
412
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx8("ui:flex ui:gap-2", className), children: [
|
|
826
413
|
/* @__PURE__ */ jsx(
|
|
827
414
|
IconButton_default,
|
|
828
415
|
{
|
|
@@ -855,13 +442,13 @@ function CarouselPagination({
|
|
|
855
442
|
className
|
|
856
443
|
}) {
|
|
857
444
|
if (total === 0) return null;
|
|
858
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
445
|
+
return /* @__PURE__ */ jsx("div", { className: clsx8("ui:flex ui:items-center ui:gap-2", className), children: Array.from({ length: total }).map((_, index) => /* @__PURE__ */ jsx(
|
|
859
446
|
"div",
|
|
860
447
|
{
|
|
861
448
|
"aria-hidden": "true",
|
|
862
|
-
className:
|
|
449
|
+
className: clsx8(
|
|
863
450
|
"ui:rounded-full ui:transition-all ui:duration-300",
|
|
864
|
-
index === current ?
|
|
451
|
+
index === current ? clsx8("ui:h-2 ui:w-6", light ? "ui:bg-white" : "ui:bg-primary") : clsx8(
|
|
865
452
|
"ui:h-2 ui:w-2",
|
|
866
453
|
light ? "ui:bg-white/50 hover:ui:bg-white/70" : "ui:bg-gray-400 hover:ui:bg-gray-500"
|
|
867
454
|
)
|
|
@@ -1028,12 +615,12 @@ function Carousel({
|
|
|
1028
615
|
const canScrollPrev = currentIndex > 0;
|
|
1029
616
|
const canScrollNext = currentIndex < totalPositions - 1;
|
|
1030
617
|
const showControls = totalPositions > 1;
|
|
1031
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
618
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx8("ui:relative", isLightbox && "ui:h-full", className), children: [
|
|
1032
619
|
/* @__PURE__ */ jsx(
|
|
1033
620
|
"div",
|
|
1034
621
|
{
|
|
1035
622
|
ref: scrollRef,
|
|
1036
|
-
className:
|
|
623
|
+
className: clsx8(
|
|
1037
624
|
"ui:flex ui:overflow-x-auto ui:scroll-smooth ui:scrollbar-none",
|
|
1038
625
|
isFullWidth && "ui:snap-x ui:snap-mandatory",
|
|
1039
626
|
isLightbox && "ui:h-full",
|
|
@@ -1057,7 +644,7 @@ function Carousel({
|
|
|
1057
644
|
showControls && isHero && (showPagination || showArrows) && /* @__PURE__ */ jsxs(
|
|
1058
645
|
"div",
|
|
1059
646
|
{
|
|
1060
|
-
className:
|
|
647
|
+
className: clsx8(
|
|
1061
648
|
"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
649
|
heroControlsClassName
|
|
1063
650
|
),
|
|
@@ -1087,7 +674,7 @@ function Carousel({
|
|
|
1087
674
|
showControls && !isHero && !isLightbox && (showArrows && arrowPosition === "bottom-right" || showPagination) ? /* @__PURE__ */ jsxs(
|
|
1088
675
|
"div",
|
|
1089
676
|
{
|
|
1090
|
-
className:
|
|
677
|
+
className: clsx8(
|
|
1091
678
|
"ui:mt-4 ui:flex ui:items-center",
|
|
1092
679
|
arrowPosition === "bottom-right" ? "ui:justify-end ui:gap-4" : "ui:justify-center"
|
|
1093
680
|
),
|
|
@@ -1132,7 +719,7 @@ function CarouselItem({
|
|
|
1132
719
|
return /* @__PURE__ */ jsx(
|
|
1133
720
|
"div",
|
|
1134
721
|
{
|
|
1135
|
-
className:
|
|
722
|
+
className: clsx8(
|
|
1136
723
|
"ui:flex-shrink-0",
|
|
1137
724
|
(isHero || isLightbox) && "ui:w-full ui:snap-center",
|
|
1138
725
|
isLightbox && "ui:flex ui:items-center ui:justify-center ui:h-full",
|
|
@@ -1248,7 +835,7 @@ function TabsList({ className, children, ...rest }) {
|
|
|
1248
835
|
children: /* @__PURE__ */ jsx(
|
|
1249
836
|
"div",
|
|
1250
837
|
{
|
|
1251
|
-
className:
|
|
838
|
+
className: clsx8(
|
|
1252
839
|
"ui:flex ui:gap-1",
|
|
1253
840
|
variant === "underline" && "ui:border-b ui:border-border",
|
|
1254
841
|
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 +863,7 @@ function TabsPanel({ value, children, ...rest }) {
|
|
|
1276
863
|
"aria-labelledby": getTabId(value),
|
|
1277
864
|
hidden: !isActive,
|
|
1278
865
|
...rest,
|
|
1279
|
-
className:
|
|
866
|
+
className: clsx8("ui:mt-4", rest.className),
|
|
1280
867
|
children
|
|
1281
868
|
}
|
|
1282
869
|
);
|
|
@@ -1368,7 +955,7 @@ function TabsTrigger({
|
|
|
1368
955
|
id: getTabId(value),
|
|
1369
956
|
tabIndex: isActive ? 0 : -1,
|
|
1370
957
|
disabled,
|
|
1371
|
-
className:
|
|
958
|
+
className: clsx8(
|
|
1372
959
|
"ui:px-4 ui:py-2 ui:font-roboto ui:text-sm ui:font-medium",
|
|
1373
960
|
"ui:flex ui:items-center ui:gap-2",
|
|
1374
961
|
"ui:transition-colors ui:duration-200",
|
|
@@ -1425,7 +1012,7 @@ function Tabs({
|
|
|
1425
1012
|
variant,
|
|
1426
1013
|
prefix
|
|
1427
1014
|
},
|
|
1428
|
-
children: /* @__PURE__ */ jsx("div", { className:
|
|
1015
|
+
children: /* @__PURE__ */ jsx("div", { className: clsx8("ui:w-full", className), ...rest, children })
|
|
1429
1016
|
}
|
|
1430
1017
|
);
|
|
1431
1018
|
}
|
|
@@ -1445,7 +1032,7 @@ function Talent({
|
|
|
1445
1032
|
return /* @__PURE__ */ jsxs(
|
|
1446
1033
|
"div",
|
|
1447
1034
|
{
|
|
1448
|
-
className:
|
|
1035
|
+
className: clsx8(
|
|
1449
1036
|
"ui:flex ui:items-center",
|
|
1450
1037
|
{
|
|
1451
1038
|
"ui:flex-col ui:text-center ui:gap-3": variant === "vertical",
|
|
@@ -1468,7 +1055,7 @@ function Talent({
|
|
|
1468
1055
|
/* @__PURE__ */ jsxs(
|
|
1469
1056
|
"div",
|
|
1470
1057
|
{
|
|
1471
|
-
className:
|
|
1058
|
+
className: clsx8({ "ui:flex ui:flex-col": variant === "horizontal" }),
|
|
1472
1059
|
children: [
|
|
1473
1060
|
/* @__PURE__ */ jsx(
|
|
1474
1061
|
Typography_default,
|
|
@@ -1500,7 +1087,7 @@ function Spinner({ className }) {
|
|
|
1500
1087
|
{
|
|
1501
1088
|
role: "status",
|
|
1502
1089
|
"aria-label": "Loading",
|
|
1503
|
-
className:
|
|
1090
|
+
className: clsx8(
|
|
1504
1091
|
"ui:size-12 ui:rounded-full ui:border-4 ui:border-white/20 ui:border-t-white ui:animate-spin",
|
|
1505
1092
|
className
|
|
1506
1093
|
)
|
|
@@ -1509,6 +1096,6 @@ function Spinner({ className }) {
|
|
|
1509
1096
|
}
|
|
1510
1097
|
var Spinner_default = Spinner;
|
|
1511
1098
|
|
|
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,
|
|
1099
|
+
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, Spinner_default as Spinner, Tabs_default as Tabs, Talent_default as Talent, TrailerCard_default as TrailerCard };
|
|
1513
1100
|
//# sourceMappingURL=index.js.map
|
|
1514
1101
|
//# sourceMappingURL=index.js.map
|