@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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Skeleton/Skeleton.tsx"],"names":[],"mappings":";;;;AAsBA,SAAS,QAAA,CAAS;AAAA,EAChB,OAAA,GAAU,WAAA;AAAA,EACV,KAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA,GAAU,IAAA;AAAA,EACV,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA4B;AAC1B,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,IAAA;AAAA,QACT,4CAAA;AAAA,QACA,qBAAA;AAAA,QACA;AAAA,UACE,eAAA,EAAiB,YAAY,WAAA,IAAe,OAAA;AAAA,UAC5C,mBAAmB,OAAA,KAAY,QAAA;AAAA,UAC/B,YAAA,EAAc,YAAY,MAAA,IAAU;AAAA,SACtC;AAAA,QACA,KAAA;AAAA,QACA,MAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,KAAA,EAAO,WAAA,GAAc,EAAE,WAAA,EAAY,GAAI,MAAA;AAAA,MACtC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,IAAO,gBAAA,GAAQ","file":"chunk-JPJYJLAP.js","sourcesContent":["import clsx from 'clsx'\n\nimport type { ComponentProps } from 'react'\n\nexport interface SkeletonProps extends ComponentProps<'div'> {\n /** Shape variant */\n variant?: 'rectangle' | 'circle' | 'line'\n /** Width (Tailwind class or custom value) */\n width?: string\n /** Height (Tailwind class or custom value) */\n height?: string\n /** Aspect ratio (e.g., \"2/3\", \"16/9\", \"1/1\") */\n aspectRatio?: string\n /** Apply rounded corners (default: true for rectangle/line, always true for circle) */\n rounded?: boolean\n}\n\n/**\n * Skeleton - Atomic loading placeholder component\n *\n * Composable primitive for building loading states with shimmer effect.\n */\nfunction Skeleton({\n variant = 'rectangle',\n width,\n height,\n aspectRatio,\n rounded = true,\n className,\n ...rest\n}: Readonly<SkeletonProps>) {\n return (\n <div\n className={clsx(\n 'ui:relative ui:overflow-hidden ui:bg-muted',\n 'ui-skeleton-shimmer',\n {\n 'ui:rounded-lg': variant === 'rectangle' && rounded,\n 'ui:rounded-full': variant === 'circle',\n 'ui:rounded': variant === 'line' && rounded,\n },\n width,\n height,\n className\n )}\n style={aspectRatio ? { aspectRatio } : undefined}\n {...rest}\n />\n )\n}\n\nexport default Skeleton\n"]}
@@ -0,0 +1,49 @@
1
+ import { getButtonClasses, iconSizeMap, getButtonDisabledClasses } from './chunk-FDLKS7BI.js';
2
+ import { Icon_default } from './chunk-JHRISQQJ.js';
3
+ import { Link } from 'react-router-dom';
4
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
5
+
6
+ function Button(props) {
7
+ const {
8
+ variant = "primary",
9
+ size = "md",
10
+ icon,
11
+ iconPosition = "left",
12
+ className,
13
+ children
14
+ } = props;
15
+ const classes = getButtonClasses({ variant, size, iconPosition, className });
16
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ icon && /* @__PURE__ */ jsx(Icon_default, { name: icon, size: iconSizeMap[size] }),
18
+ children
19
+ ] });
20
+ if (props.as === "link") {
21
+ const {
22
+ as: _2,
23
+ variant: _v2,
24
+ size: _s2,
25
+ icon: _i2,
26
+ iconPosition: _ip2,
27
+ className: _c2,
28
+ children: _ch2,
29
+ ...linkProps
30
+ } = props;
31
+ return /* @__PURE__ */ jsx(Link, { className: classes, ...linkProps, children: content });
32
+ }
33
+ const {
34
+ as: _,
35
+ variant: _v,
36
+ size: _s,
37
+ icon: _i,
38
+ iconPosition: _ip,
39
+ className: _c,
40
+ children: _ch,
41
+ ...buttonProps
42
+ } = props;
43
+ return /* @__PURE__ */ jsx("button", { className: getButtonDisabledClasses(classes), ...buttonProps, children: content });
44
+ }
45
+ var Button_default = Button;
46
+
47
+ export { Button_default };
48
+ //# sourceMappingURL=chunk-WYIIOTWJ.js.map
49
+ //# sourceMappingURL=chunk-WYIIOTWJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react-router/Button/Button.tsx"],"names":["_","_v","_s","_i","_ip","_c","_ch"],"mappings":";;;;;AAWA,SAAS,OAAO,KAAA,EAA8B;AAC5C,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,SAAA;AAAA,IACV,IAAA,GAAO,IAAA;AAAA,IACP,IAAA;AAAA,IACA,YAAA,GAAe,MAAA;AAAA,IACf,SAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,UAAU,gBAAA,CAAiB,EAAE,SAAS,IAAA,EAAM,YAAA,EAAc,WAAW,CAAA;AAE3E,EAAA,MAAM,0BACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,IAAA,wBAAS,YAAA,EAAA,EAAK,IAAA,EAAM,MAAM,IAAA,EAAM,WAAA,CAAY,IAAI,CAAA,EAAG,CAAA;AAAA,IACnD;AAAA,GAAA,EACH,CAAA;AAGF,EAAA,IAAI,KAAA,CAAM,OAAO,MAAA,EAAQ;AACvB,IAAA,MAAM;AAAA,MACJ,EAAA,EAAIA,EAAAA;AAAA,MACJ,OAAA,EAASC,GAAAA;AAAA,MACT,IAAA,EAAMC,GAAAA;AAAA,MACN,IAAA,EAAMC,GAAAA;AAAA,MACN,YAAA,EAAcC,IAAAA;AAAA,MACd,SAAA,EAAWC,GAAAA;AAAA,MACX,QAAA,EAAUC,IAAAA;AAAA,MACV,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,2BACG,IAAA,EAAA,EAAK,SAAA,EAAW,OAAA,EAAU,GAAG,WAC3B,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,MAAM;AAAA,IACJ,EAAA,EAAI,CAAA;AAAA,IACJ,OAAA,EAAS,EAAA;AAAA,IACT,IAAA,EAAM,EAAA;AAAA,IACN,IAAA,EAAM,EAAA;AAAA,IACN,YAAA,EAAc,GAAA;AAAA,IACd,SAAA,EAAW,EAAA;AAAA,IACX,QAAA,EAAU,GAAA;AAAA,IACV,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA,CAAC,YAAO,SAAA,EAAW,wBAAA,CAAyB,OAAO,CAAA,EAAI,GAAG,aACvD,QAAA,EAAA,OAAA,EACH,CAAA;AAEJ;AAEA,IAAO,cAAA,GAAQ","file":"chunk-WYIIOTWJ.js","sourcesContent":["import { Link } from 'react-router-dom'\n\nimport {\n getButtonClasses,\n getButtonDisabledClasses,\n iconSizeMap,\n} from '../../Button/Button.utils'\nimport { Icon } from '../../Icon'\n\nimport type { ButtonProps } from './Button.types'\n\nfunction Button(props: Readonly<ButtonProps>) {\n const {\n variant = 'primary',\n size = 'md',\n icon,\n iconPosition = 'left',\n className,\n children,\n } = props\n\n const classes = getButtonClasses({ variant, size, iconPosition, className })\n\n const content = (\n <>\n {icon && <Icon name={icon} size={iconSizeMap[size]} />}\n {children}\n </>\n )\n\n if (props.as === 'link') {\n const {\n as: _,\n variant: _v,\n size: _s,\n icon: _i,\n iconPosition: _ip,\n className: _c,\n children: _ch,\n ...linkProps\n } = props\n\n return (\n <Link className={classes} {...linkProps}>\n {content}\n </Link>\n )\n }\n\n const {\n as: _,\n variant: _v,\n size: _s,\n icon: _i,\n iconPosition: _ip,\n className: _c,\n children: _ch,\n ...buttonProps\n } = props\n\n return (\n <button className={getButtonDisabledClasses(classes)} {...buttonProps}>\n {content}\n </button>\n )\n}\n\nexport default Button\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-Y5GP5OWN.js.map
3
+ //# sourceMappingURL=chunk-Y5GP5OWN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-Y5GP5OWN.js"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ComponentProps, ReactNode, ButtonHTMLAttributes, ImgHTMLAttributes, HTMLAttributes, ElementType } from 'react';
3
+ import { ComponentProps, ReactNode, ButtonHTMLAttributes, HTMLAttributes, ElementType } from 'react';
4
4
  import { IconName } from './Icon/index.js';
5
5
  export { Icon, IconProps, IconSize } from './Icon/index.js';
6
6
  export { Button, ButtonProps } from './Button/index.js';
7
7
  export { Card, CardProps, CardVariant } from './Card/index.js';
8
+ export { A as AspectRatio, I as Image, c as ImageProps, d as ImageState } from './MovieCard.utils-CpNUUs8O.js';
9
+ export { MovieCard, MovieCardProps } from './react-router/index.js';
8
10
  import 'react-router-dom';
9
11
 
10
12
  type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
@@ -52,35 +54,6 @@ interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
52
54
  }
53
55
  declare function IconButton({ className, icon, variant, size, disabled, ...rest }: Readonly<IconButtonProps>): react_jsx_runtime.JSX.Element;
54
56
 
55
- type ImageState = 'loading' | 'loaded' | 'error';
56
- type AspectRatio = '2/3' | '16/9' | '1/1' | '4/3' | '3/2';
57
- type ImageLoading = 'lazy' | 'eager';
58
- interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {
59
- /** Image source URL */
60
- src: string;
61
- /** Alt text for accessibility */
62
- alt: string;
63
- /** Pre-generated blur data URL (base64) */
64
- blurDataUrl?: string;
65
- /** Auto-generate blur placeholder from src using Canvas API */
66
- autoBlur?: boolean;
67
- /** Size of blur canvas (smaller = more blur). Default: 16 */
68
- blurSize?: number;
69
- /** JPEG quality for blur (0-1). Default: 0.3 */
70
- blurQuality?: number;
71
- /** Aspect ratio of the image container */
72
- aspectRatio?: AspectRatio | (string & {});
73
- /** Fallback content when image fails to load */
74
- fallback?: ReactNode;
75
- /** Callback when image loads successfully */
76
- onLoad?: () => void;
77
- /** Callback when image fails to load */
78
- onError?: () => void;
79
- /** Load strategy: 'lazy' waits for viewport visibility, 'eager' loads immediately. Default: 'eager' */
80
- loading?: ImageLoading;
81
- }
82
- declare function Image({ src, alt, blurDataUrl, autoBlur, blurSize, blurQuality, aspectRatio, fallback, className, onLoad, onError, loading, ...rest }: Readonly<ImageProps>): react_jsx_runtime.JSX.Element;
83
-
84
57
  interface HeroImageProps {
85
58
  /** Backdrop path from TMDB API */
86
59
  backdropPath?: string | null;
@@ -129,81 +102,6 @@ interface RatingProps {
129
102
  }
130
103
  declare function Rating({ value, max, variant, size, showValue, trackClassName, className, }: Readonly<RatingProps>): react_jsx_runtime.JSX.Element;
131
104
 
132
- /**
133
- * MovieCard component types with discriminated union for type-safe variants
134
- */
135
-
136
- /**
137
- * Base props shared across all MovieCard variants
138
- */
139
- interface MovieCardBaseProps {
140
- /** Media ID */
141
- id: number;
142
- /** Media title */
143
- title: string;
144
- /** Poster URL (full URL or TMDB path) */
145
- posterUrl: string;
146
- /** Vote average (0-10) */
147
- voteAverage: number;
148
- /** Release year */
149
- year?: number | null;
150
- /** Additional class name */
151
- className?: string;
152
- /** Image loading strategy ('lazy' | 'eager'). Default: 'lazy' */
153
- imageLoading?: ImageLoading;
154
- }
155
- /**
156
- * MovieCard as a simple card (default, non-interactive)
157
- */
158
- interface MovieCardAsCard extends MovieCardBaseProps {
159
- /** Render as simple card (default) */
160
- as?: 'card' | undefined;
161
- /** Not allowed when as="card" */
162
- to?: never;
163
- /** Not allowed when as="card" */
164
- onClick?: never;
165
- }
166
- /**
167
- * MovieCard as a navigable link (React Router Link)
168
- */
169
- interface MovieCardAsLink extends MovieCardBaseProps {
170
- /** Render as React Router Link */
171
- as: 'link';
172
- /** Navigation path (required when as="link") */
173
- to: string;
174
- /** Not allowed when as="link" */
175
- onClick?: never;
176
- }
177
- /**
178
- * MovieCard as a clickable button with custom action
179
- */
180
- interface MovieCardAsButton extends MovieCardBaseProps {
181
- /** Render as button with onClick */
182
- as: 'button';
183
- /** Click handler (required when as="button") */
184
- onClick: () => void;
185
- /** Not allowed when as="button" */
186
- to?: never;
187
- }
188
- /**
189
- * MovieCard props - discriminated union by 'as' prop
190
- *
191
- * @example
192
- * // Simple card (default)
193
- * <MovieCard id={1} title="..." posterUrl="..." voteAverage={8} />
194
- *
195
- * @example
196
- * // Navigable link
197
- * <MovieCard as="link" to="/movie/1" id={1} title="..." posterUrl="..." voteAverage={8} />
198
- *
199
- * @example
200
- * // Button with custom action
201
- * <MovieCard as="button" onClick={() => console.log('clicked')} id={1} title="..." posterUrl="..." voteAverage={8} />
202
- */
203
- type MovieCardProps = MovieCardAsCard | MovieCardAsLink | MovieCardAsButton;
204
-
205
- declare function MovieCard({ id, title, posterUrl, voteAverage, year, className, imageLoading, as, ...rest }: Readonly<MovieCardProps>): react_jsx_runtime.JSX.Element;
206
-
207
105
  interface TrailerCardProps {
208
106
  /** YouTube video ID */
209
107
  videoKey: string;
@@ -472,4 +370,4 @@ interface SpinnerProps {
472
370
  }
473
371
  declare function Spinner({ className }: Readonly<SpinnerProps>): react_jsx_runtime.JSX.Element;
474
372
 
475
- export { type AspectRatio, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Carousel, type CarouselArrowPosition, CarouselCounter, type CarouselCounterProps, CarouselItem, type CarouselItemProps, CarouselLoading, type CarouselLoadingProps, CarouselNavigation, type CarouselNavigationPosition, type CarouselNavigationProps, CarouselPagination, type CarouselPaginationProps, type CarouselProps, type CarouselVariant, HeroImage, type HeroImageProps, IconButton, type IconButtonProps, IconName, Image, type ImageProps, type ImageState, Modal, type ModalProps, MovieCard, type MovieCardProps, Rating, type RatingProps, type RatingSize, type RatingVariant, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Tabs, type TabsProps, type TabsVariant, Talent, type TalentProps, TrailerCard, type TrailerCardProps, Typography, type TypographyProps, type TypographyVariant };
373
+ export { Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Carousel, type CarouselArrowPosition, CarouselCounter, type CarouselCounterProps, CarouselItem, type CarouselItemProps, CarouselLoading, type CarouselLoadingProps, CarouselNavigation, type CarouselNavigationPosition, type CarouselNavigationProps, CarouselPagination, type CarouselPaginationProps, type CarouselProps, type CarouselVariant, HeroImage, type HeroImageProps, IconButton, type IconButtonProps, IconName, Modal, type ModalProps, Rating, type RatingProps, type RatingSize, type RatingVariant, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Tabs, type TabsProps, type TabsVariant, Talent, type TalentProps, TrailerCard, type TrailerCardProps, Typography, type TypographyProps, type TypographyVariant };