@fanvue/ui 2.12.1 → 2.14.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.
Files changed (46) hide show
  1. package/dist/cjs/components/ChatInput/ChatInput.cjs +75 -27
  2. package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
  3. package/dist/cjs/components/CreatorCard/CreatorCard.cjs +81 -0
  4. package/dist/cjs/components/CreatorCard/CreatorCard.cjs.map +1 -0
  5. package/dist/cjs/components/CreatorCover/CreatorCover.cjs +83 -0
  6. package/dist/cjs/components/CreatorCover/CreatorCover.cjs.map +1 -0
  7. package/dist/cjs/components/CreatorTile/CreatorTile.cjs +64 -0
  8. package/dist/cjs/components/CreatorTile/CreatorTile.cjs.map +1 -0
  9. package/dist/cjs/components/CyclingText/CyclingText.cjs +137 -0
  10. package/dist/cjs/components/CyclingText/CyclingText.cjs.map +1 -0
  11. package/dist/cjs/components/CyclingText/useCyclingCycle.cjs +212 -0
  12. package/dist/cjs/components/CyclingText/useCyclingCycle.cjs.map +1 -0
  13. package/dist/cjs/components/CyclingText/useCyclingTextTrackWidth.cjs +55 -0
  14. package/dist/cjs/components/CyclingText/useCyclingTextTrackWidth.cjs.map +1 -0
  15. package/dist/cjs/components/CyclingText/usePageVisibility.cjs +38 -0
  16. package/dist/cjs/components/CyclingText/usePageVisibility.cjs.map +1 -0
  17. package/dist/cjs/components/CyclingText/usePrefersReducedMotion.cjs +39 -0
  18. package/dist/cjs/components/CyclingText/usePrefersReducedMotion.cjs.map +1 -0
  19. package/dist/cjs/components/EmptyState/EmptyState.cjs +19 -3
  20. package/dist/cjs/components/EmptyState/EmptyState.cjs.map +1 -1
  21. package/dist/cjs/index.cjs +8 -0
  22. package/dist/cjs/index.cjs.map +1 -1
  23. package/dist/components/ChatInput/ChatInput.mjs +75 -27
  24. package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
  25. package/dist/components/CreatorCard/CreatorCard.mjs +64 -0
  26. package/dist/components/CreatorCard/CreatorCard.mjs.map +1 -0
  27. package/dist/components/CreatorCover/CreatorCover.mjs +66 -0
  28. package/dist/components/CreatorCover/CreatorCover.mjs.map +1 -0
  29. package/dist/components/CreatorTile/CreatorTile.mjs +47 -0
  30. package/dist/components/CreatorTile/CreatorTile.mjs.map +1 -0
  31. package/dist/components/CyclingText/CyclingText.mjs +120 -0
  32. package/dist/components/CyclingText/CyclingText.mjs.map +1 -0
  33. package/dist/components/CyclingText/useCyclingCycle.mjs +195 -0
  34. package/dist/components/CyclingText/useCyclingCycle.mjs.map +1 -0
  35. package/dist/components/CyclingText/useCyclingTextTrackWidth.mjs +38 -0
  36. package/dist/components/CyclingText/useCyclingTextTrackWidth.mjs.map +1 -0
  37. package/dist/components/CyclingText/usePageVisibility.mjs +21 -0
  38. package/dist/components/CyclingText/usePageVisibility.mjs.map +1 -0
  39. package/dist/components/CyclingText/usePrefersReducedMotion.mjs +22 -0
  40. package/dist/components/CyclingText/usePrefersReducedMotion.mjs.map +1 -0
  41. package/dist/components/EmptyState/EmptyState.mjs +19 -3
  42. package/dist/components/EmptyState/EmptyState.mjs.map +1 -1
  43. package/dist/index.d.ts +237 -0
  44. package/dist/index.mjs +8 -0
  45. package/dist/index.mjs.map +1 -1
  46. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -917,9 +917,38 @@ export declare type ChartIconProps = BaseIconProps;
917
917
  * onSubmit={(text) => send(text)}
918
918
  * />
919
919
  * ```
920
+ *
921
+ * @example
922
+ * ```tsx
923
+ * <ChatInput
924
+ * showFileButton
925
+ * onFileClick={() => openPicker()}
926
+ * attachments={files}
927
+ * onAttachmentRemove={(id) => setFiles((prev) => prev.filter((f) => f.id !== id))}
928
+ * />
929
+ * ```
930
+ *
931
+ * @example
932
+ * ```tsx
933
+ * <ChatInput
934
+ * showFileButton
935
+ * onFileClick={() => openPicker()}
936
+ * attachmentPreviews={<CustomVideoStrip items={items} />}
937
+ * />
938
+ * ```
920
939
  */
921
940
  export declare const ChatInput: React_2.ForwardRefExoticComponent<ChatInputProps & React_2.RefAttributes<HTMLTextAreaElement>>;
922
941
 
942
+ /** A single image thumbnail in the built-in attachment strip. */
943
+ export declare interface ChatInputAttachmentItem {
944
+ /** Stable id passed to {@link ChatInputProps.onAttachmentRemove} and used as React `key`. */
945
+ id: string;
946
+ /** Image URL for the thumbnail. */
947
+ src: string;
948
+ /** Optional value passed to the remove control `aria-label`. */
949
+ ariaLabel?: string;
950
+ }
951
+
923
952
  /**
924
953
  * Props for {@link ChatInput}. Standard textarea HTML attributes are forwarded to the inner
925
954
  * `<textarea>` except `className` (applied to the outer container), `rows` (use `minRows`), and
@@ -964,6 +993,21 @@ export declare interface ChatInputProps extends Omit<React_2.TextareaHTMLAttribu
964
993
  selectValue?: string;
965
994
  /** Callback fired when the user picks a different dropdown option. */
966
995
  onSelectChange?: (value: string) => void;
996
+ /**
997
+ * Image attachments shown in the built-in thumbnail strip. Ignored when {@link ChatInputProps.attachmentPreviews}
998
+ * is provided (including `null`).
999
+ */
1000
+ attachments?: ChatInputAttachmentItem[];
1001
+ /**
1002
+ * Called when the user removes a built-in thumbnail. The remove button is disabled when this is
1003
+ * omitted or the input is {@link ChatInputProps.disabled}.
1004
+ */
1005
+ onAttachmentRemove?: (id: string) => void;
1006
+ /**
1007
+ * Replaces the built-in attachment strip entirely. When set to any value other than `undefined`
1008
+ * (including `null` or `[]`), {@link ChatInputProps.attachments} is ignored.
1009
+ */
1010
+ attachmentPreviews?: React_2.ReactNode;
967
1011
  /** Additional className applied to the outermost container. */
968
1012
  className?: string;
969
1013
  }
@@ -1251,6 +1295,136 @@ export declare type CountSize = "16" | "24" | "32";
1251
1295
  /** Colour variant for the count badge. */
1252
1296
  export declare type CountVariant = "default" | "alert" | "brand" | "pink" | "info" | "success" | "warning";
1253
1297
 
1298
+ /**
1299
+ * A portrait media card highlighting a creator with avatar, name, optional
1300
+ * tagline, and up to two stacked action buttons over a background image.
1301
+ *
1302
+ * Pass zero, one, or two {@link Button} elements via `actions` to render the
1303
+ * no-button, single-button, or two-button variants.
1304
+ *
1305
+ * @example
1306
+ * ```tsx
1307
+ * <CreatorCard
1308
+ * imageSrc="/creator.jpg"
1309
+ * name="Jane Doe"
1310
+ * description="MODEL & PODCASTER"
1311
+ * avatar={{ src: "/avatar.jpg", alt: "Jane Doe", fallback: "JD" }}
1312
+ * actions={
1313
+ * <>
1314
+ * <Button variant="brand" fullWidth>Join for free for 3 days</Button>
1315
+ * <Button variant="primary" fullWidth>Follow for Free</Button>
1316
+ * </>
1317
+ * }
1318
+ * />
1319
+ * ```
1320
+ */
1321
+ export declare const CreatorCard: React_2.ForwardRefExoticComponent<CreatorCardProps & React_2.RefAttributes<HTMLDivElement>>;
1322
+
1323
+ export declare interface CreatorCardProps extends React_2.HTMLAttributes<HTMLDivElement> {
1324
+ /** URL of the background media (image or video poster). */
1325
+ imageSrc: string;
1326
+ /** Alt text for the background image. @default "" */
1327
+ imageAlt?: string;
1328
+ /** Creator display name shown as the heading. */
1329
+ name: string;
1330
+ /** Optional secondary line shown below the name (e.g. role or tagline). */
1331
+ description?: string;
1332
+ /** Avatar props forwarded to the inner {@link Avatar}. */
1333
+ avatar?: React_2.ComponentPropsWithoutRef<typeof Avatar>;
1334
+ /**
1335
+ * Action buttons rendered at the bottom of the card. Pass zero, one, or two
1336
+ * `Button` elements to render variants with no, one, or two CTAs.
1337
+ */
1338
+ actions?: React_2.ReactNode;
1339
+ }
1340
+
1341
+ /**
1342
+ * A creator profile hero with a stylised blurred backdrop, central cover image,
1343
+ * status pill, name, tagline, and primary call to action.
1344
+ *
1345
+ * @example
1346
+ * ```tsx
1347
+ * <CreatorCover
1348
+ * imageSrc="/creator.jpg"
1349
+ * imageAlt="Jane Doe"
1350
+ * name="JANE DOE"
1351
+ * tagline="GLOBAL POPSTAR"
1352
+ * tag="New Joiner"
1353
+ * action={<Button variant="primary" size="48" fullWidth>Join for free for 7 days</Button>}
1354
+ * />
1355
+ * ```
1356
+ */
1357
+ export declare const CreatorCover: React_2.ForwardRefExoticComponent<CreatorCoverProps & React_2.RefAttributes<HTMLElement>>;
1358
+
1359
+ export declare interface CreatorCoverProps extends Omit<React_2.HTMLAttributes<HTMLElement>, "title"> {
1360
+ /** URL of the creator image displayed in the centre card. Also used as the blurred backdrop unless `backgroundSrc` is provided. */
1361
+ imageSrc: string;
1362
+ /** Alt text for the centre cover image. @default "" */
1363
+ imageAlt?: string;
1364
+ /** Override URL used for the blurred background image. @default `imageSrc` */
1365
+ backgroundSrc?: string;
1366
+ /** Creator's name, rendered as the heading. */
1367
+ name: string;
1368
+ /** Smaller subtitle below the name (e.g. "GLOBAL POPSTAR"). Rendered uppercase in the brand colour. */
1369
+ tagline?: string;
1370
+ /**
1371
+ * Status label rendered as a pill overlapping the bottom of the cover image (e.g. "New Joiner").
1372
+ * Strings render with default green pill styling; pass a node for custom markup.
1373
+ */
1374
+ tag?: CreatorCoverSlot;
1375
+ /**
1376
+ * Primary call to action displayed below the title.
1377
+ */
1378
+ action?: React_2.ReactNode;
1379
+ /** When `true`, fades the bottom of the component to transparent and increases bottom padding to 64px. @default false */
1380
+ fadeBottom?: boolean;
1381
+ }
1382
+
1383
+ /** Slot that accepts a string (rendered as default styling) or a node for full control. */
1384
+ export declare type CreatorCoverSlot = string | React_2.ReactNode;
1385
+
1386
+ /**
1387
+ * A visual highlight tile showcasing a creator with an overlaid name and tagline.
1388
+ *
1389
+ * The tile renders a full-bleed image with a bottom gradient that ensures the
1390
+ * overlaid text remains legible regardless of the underlying photography.
1391
+ *
1392
+ * @example
1393
+ * ```tsx
1394
+ * <CreatorTile
1395
+ * imageSrc="https://example.com/creator.jpg"
1396
+ * imageAlt="Portrait of Jane Doe"
1397
+ * name="JANE DOE"
1398
+ * tagline="GLOBAL MUSIC ICON"
1399
+ * />
1400
+ * ```
1401
+ */
1402
+ export declare const CreatorTile: React_2.ForwardRefExoticComponent<CreatorTileProps & React_2.RefAttributes<HTMLDivElement>>;
1403
+
1404
+ /** Width-to-height ratio preset for the tile. */
1405
+ export declare type CreatorTileAspectRatio = "tall" | "medium" | "short";
1406
+
1407
+ export declare interface CreatorTileProps extends React_2.HTMLAttributes<HTMLDivElement> {
1408
+ /** Source URL of the creator's image. Rendered as the tile background. */
1409
+ imageSrc: string;
1410
+ /** Alt text for the creator image. Use an empty string for purely decorative imagery. */
1411
+ imageAlt?: string;
1412
+ /** Creator name shown as the prominent overlay heading. */
1413
+ name: React_2.ReactNode;
1414
+ /** Short tagline shown under the name in the brand accent color. */
1415
+ tagline?: React_2.ReactNode;
1416
+ /**
1417
+ * Width-to-height ratio preset.
1418
+ *
1419
+ * - `tall` – 1:2 narrow portrait
1420
+ * - `medium` – 2:3 classic poster (default)
1421
+ * - `short` – 4:5 closer to square
1422
+ *
1423
+ * @default "medium"
1424
+ */
1425
+ aspectRatio?: CreatorTileAspectRatio;
1426
+ }
1427
+
1254
1428
  /** A compact "×" cross icon (20 × 20). */
1255
1429
  export declare const CrossIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
1256
1430
  className?: string;
@@ -1269,6 +1443,55 @@ export declare const CrownIcon: React_2.ForwardRefExoticComponent<BaseIconProps
1269
1443
  /** Props for {@link CrownIcon}. See {@link BaseIconProps} for the shared shape. */
1270
1444
  export declare type CrownIconProps = BaseIconProps;
1271
1445
 
1446
+ /**
1447
+ * Cycles through a list of strings with a slide-in/slide-out animation. Lives
1448
+ * inline so it can sit inside divs, spans, buttons, or as a fake placeholder
1449
+ * overlay.
1450
+ *
1451
+ * @example
1452
+ * ```tsx
1453
+ * <CyclingText items={["Thinking", "Reading messages", "Drafting reply"]} />
1454
+ * ```
1455
+ */
1456
+ export declare const CyclingText: React_2.ForwardRefExoticComponent<CyclingTextProps & React_2.RefAttributes<HTMLSpanElement>>;
1457
+
1458
+ export declare interface CyclingTextProps extends Omit<React_2.HTMLAttributes<HTMLSpanElement>, "children"> {
1459
+ /** Strings to cycle through, in order. Cycles back to the first after the last. */
1460
+ items: readonly string[];
1461
+ /**
1462
+ * Milliseconds to wait after the previous transition finishes before starting the next one.
1463
+ * @default 2100
1464
+ */
1465
+ intervalMs?: number;
1466
+ /** Slide and cross-fade duration in milliseconds. @default 200 */
1467
+ transitionMs?: number;
1468
+ /** Direction the outgoing item slides. @default "up" */
1469
+ direction?: "up" | "down";
1470
+ /** When true, freezes on the current item — no further cycling until cleared. @default false */
1471
+ paused?: boolean;
1472
+ /**
1473
+ * How the wrapper sizes itself horizontally.
1474
+ * - `longest` reserves space for the longest item — no width jitter as items cycle.
1475
+ * - `current` shrinks/grows with each item, animating width between cycles.
1476
+ * @default "longest"
1477
+ */
1478
+ sizing?: CyclingTextSizing;
1479
+ /**
1480
+ * When `true`, updates are exposed to assistive technologies via `aria-live="polite"`.
1481
+ * Leave `false` for decorative or frequently changing copy so screen readers are not interrupted on every cycle.
1482
+ * @default false
1483
+ */
1484
+ announceChanges?: boolean;
1485
+ /**
1486
+ * Class applied to each visible label span (current + incoming). Use this for
1487
+ * effects that have to sit on the text element itself, e.g. `background-clip: text`.
1488
+ */
1489
+ labelClassName?: string;
1490
+ }
1491
+
1492
+ /** How the wrapper should be sized to accommodate variable-length items. */
1493
+ export declare type CyclingTextSizing = "longest" | "current";
1494
+
1272
1495
  /** Root component that manages open/close state for a dialog. */
1273
1496
  export declare const Dialog: React_2.FC<DialogPrimitive.DialogProps>;
1274
1497
 
@@ -1757,6 +1980,8 @@ export declare const EmojiIcon: React_2.ForwardRefExoticComponent<React_2.SVGAtt
1757
1980
 
1758
1981
  export declare const EmptyState: React_2.ForwardRefExoticComponent<EmptyStateProps & React_2.RefAttributes<HTMLElement>>;
1759
1982
 
1983
+ declare type EmptyStateMediaSize = "xs" | "sm" | "md" | "lg" | "xl";
1984
+
1760
1985
  export declare interface EmptyStateProps extends Omit<React_2.HTMLAttributes<HTMLElement>, "title"> {
1761
1986
  /**
1762
1987
  * Matches Figma property `Property 1` (`Default` / `centered`).
@@ -1765,6 +1990,11 @@ export declare interface EmptyStateProps extends Omit<React_2.HTMLAttributes<HTM
1765
1990
  variant?: EmptyStateVariant;
1766
1991
  /** Main heading. Strings use library heading styles; pass a node for full control. */
1767
1992
  title?: EmptyStateSlot;
1993
+ /**
1994
+ * Size of the title heading — mapped internally to bold heading typography tokens.
1995
+ * @default "lg"
1996
+ */
1997
+ titleSize?: EmptyStateTitleSize;
1768
1998
  /** Supporting body copy. Strings use library body styles; pass a node for rich text. */
1769
1999
  description?: EmptyStateSlot;
1770
2000
  /**
@@ -1772,6 +2002,11 @@ export declare interface EmptyStateProps extends Omit<React_2.HTMLAttributes<HTM
1772
2002
  * A string is treated as an image URL (`<img src={…}>`); pass a node for custom layout.
1773
2003
  */
1774
2004
  media?: EmptyStateSlot;
2005
+ /**
2006
+ * Height of the media container.
2007
+ * @default "lg"
2008
+ */
2009
+ mediaSize?: EmptyStateMediaSize;
1775
2010
  /**
1776
2011
  * Primary call to action.
1777
2012
  * A string renders a brand `Button` with that label; pass a node for links, loading, etc.
@@ -1787,6 +2022,8 @@ export declare interface EmptyStateProps extends Omit<React_2.HTMLAttributes<HTM
1787
2022
  /** Slot that can be plain copy (styled by `EmptyState`) or custom markup. */
1788
2023
  export declare type EmptyStateSlot = string | React_2.ReactNode;
1789
2024
 
2025
+ declare type EmptyStateTitleSize = "xs" | "sm" | "md" | "lg" | "xl";
2026
+
1790
2027
  export declare type EmptyStateVariant = "default" | "centered";
1791
2028
 
1792
2029
  /** An "×" inside a filled circle icon for error states (20 × 20). */
package/dist/index.mjs CHANGED
@@ -20,6 +20,10 @@ import { ChatInput } from "./components/ChatInput/ChatInput.mjs";
20
20
  import { Checkbox } from "./components/Checkbox/Checkbox.mjs";
21
21
  import { Chip } from "./components/Chip/Chip.mjs";
22
22
  import { Count } from "./components/Count/Count.mjs";
23
+ import { CreatorCard } from "./components/CreatorCard/CreatorCard.mjs";
24
+ import { CreatorCover } from "./components/CreatorCover/CreatorCover.mjs";
25
+ import { CreatorTile } from "./components/CreatorTile/CreatorTile.mjs";
26
+ import { CyclingText } from "./components/CyclingText/CyclingText.mjs";
23
27
  import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger } from "./components/Dialog/Dialog.mjs";
24
28
  import { Divider } from "./components/Divider/Divider.mjs";
25
29
  import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger } from "./components/Drawer/Drawer.mjs";
@@ -281,8 +285,12 @@ export {
281
285
  CompassIcon,
282
286
  CopyIcon,
283
287
  Count,
288
+ CreatorCard,
289
+ CreatorCover,
290
+ CreatorTile,
284
291
  CrossIcon,
285
292
  CrownIcon,
293
+ CyclingText,
286
294
  Dialog,
287
295
  DialogBody,
288
296
  DialogClose,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanvue/ui",
3
- "version": "2.12.1",
3
+ "version": "2.14.0",
4
4
  "description": "React component library built with Tailwind CSS for Fanvue ecosystem",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",