@fanvue/ui 3.44.0 → 3.45.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/cjs/components/CreatorCard/CreatorCard.cjs +47 -20
- package/dist/cjs/components/CreatorCard/CreatorCard.cjs.map +1 -1
- package/dist/components/CreatorCard/CreatorCard.mjs +47 -20
- package/dist/components/CreatorCard/CreatorCard.mjs.map +1 -1
- package/dist/index.d.ts +37 -22
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const cn = require("../../utils/cn.cjs");
|
|
7
7
|
const Avatar = require("../Avatar/Avatar.cjs");
|
|
8
|
+
const VerifiedIcon = require("../Icons/VerifiedIcon.cjs");
|
|
9
|
+
const Pill = require("../Pill/Pill.cjs");
|
|
8
10
|
function _interopNamespaceDefault(e) {
|
|
9
11
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
12
|
if (e) {
|
|
@@ -23,45 +25,70 @@ function _interopNamespaceDefault(e) {
|
|
|
23
25
|
}
|
|
24
26
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
25
27
|
const CreatorCard = React__namespace.forwardRef(
|
|
26
|
-
({
|
|
28
|
+
({
|
|
29
|
+
className,
|
|
30
|
+
background,
|
|
31
|
+
pill,
|
|
32
|
+
avatar,
|
|
33
|
+
name,
|
|
34
|
+
verified = false,
|
|
35
|
+
verifiedLabel = "Verified",
|
|
36
|
+
tagline,
|
|
37
|
+
content,
|
|
38
|
+
action,
|
|
39
|
+
...props
|
|
40
|
+
}, ref) => {
|
|
27
41
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28
42
|
"div",
|
|
29
43
|
{
|
|
30
44
|
ref,
|
|
31
45
|
className: cn.cn(
|
|
32
|
-
"relative isolate flex
|
|
46
|
+
"relative isolate flex flex-col overflow-hidden bg-surface-primary",
|
|
33
47
|
className
|
|
34
48
|
),
|
|
35
49
|
...props,
|
|
36
50
|
children: [
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative aspect-10/11 w-full shrink-0 overflow-hidden", children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover", children: background }),
|
|
53
|
+
pill ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
|
+
Pill.Pill,
|
|
55
|
+
{
|
|
56
|
+
variant: "contrast",
|
|
57
|
+
...pill,
|
|
58
|
+
className: cn.cn("absolute top-2 left-2 max-w-[calc(100%-1rem)]", pill.className)
|
|
59
|
+
}
|
|
60
|
+
) : null
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-2.5 p-3", children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
49
64
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
50
65
|
Avatar.Avatar,
|
|
51
66
|
{
|
|
52
|
-
size:
|
|
67
|
+
size: 32,
|
|
53
68
|
src: avatar?.src,
|
|
54
|
-
alt: avatar?.alt ?? name,
|
|
69
|
+
alt: avatar?.alt ?? (typeof name === "string" ? name : void 0),
|
|
55
70
|
fallback: avatar?.fallback,
|
|
56
71
|
...avatar
|
|
57
72
|
}
|
|
58
73
|
),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.
|
|
61
|
-
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-body-small-14px-semibold m-0 truncate text-content-primary", children: name }),
|
|
77
|
+
verified ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
78
|
+
"span",
|
|
79
|
+
{
|
|
80
|
+
role: "img",
|
|
81
|
+
"aria-label": verifiedLabel,
|
|
82
|
+
className: "inline-flex shrink-0 text-content-primary",
|
|
83
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(VerifiedIcon.VerifiedIcon, { size: 16, filled: true })
|
|
84
|
+
}
|
|
85
|
+
) : null
|
|
86
|
+
] }),
|
|
87
|
+
tagline ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-body-small-14px-regular m-0 truncate text-content-secondary", children: tagline }) : null
|
|
62
88
|
] })
|
|
63
89
|
] }),
|
|
64
|
-
|
|
90
|
+
content ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-body-small-14px-semibold min-w-0 text-content-primary", children: content }) : null,
|
|
91
|
+
action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full", children: action }) : null
|
|
65
92
|
] })
|
|
66
93
|
]
|
|
67
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatorCard.cjs","sources":["../../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\n\nexport interface CreatorCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Decorative
|
|
1
|
+
{"version":3,"file":"CreatorCard.cjs","sources":["../../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { Pill, type PillProps } from \"../Pill/Pill\";\n\nexport interface CreatorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"content\"> {\n /** Decorative banner media rendered at the top of the card. */\n background: React.ReactNode;\n /**\n * Props forwarded to a {@link Pill} overlaid on the top-left of the banner.\n * Pass the label as `children`. Omit to hide the pill.\n */\n pill?: PillProps;\n /** Avatar props forwarded to the inner {@link Avatar}. */\n avatar?: React.ComponentPropsWithoutRef<typeof Avatar>;\n /** Creator display name shown next to the avatar. */\n name: React.ReactNode;\n /** When `true`, renders a verified badge after the name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Optional secondary line shown under the name (e.g. post count). */\n tagline?: React.ReactNode;\n /**\n * Optional content shown under the creator details (e.g. the subscription\n * price). It wraps by default; pass a `truncate` element to keep it on one line.\n */\n content?: React.ReactNode;\n /**\n * Action element rendered full-width at the bottom of the card (e.g. a\n * `Button` with `fullWidth` for subscribing to the creator).\n */\n action?: React.ReactNode;\n}\n\n/**\n * A card suggesting a creator, with a banner image, an optional {@link Pill},\n * the creator's avatar, name and tagline, free-form content such as a price,\n * and an optional action.\n *\n * The card has no fixed width or corner radius: set both through `className`\n * (e.g. `className=\"w-40 rounded-md\"`). The banner keeps a 10:11 ratio at any\n * width.\n *\n * @example\n * ```tsx\n * <CreatorCard\n * className=\"w-40 rounded-md\"\n * background={<img src=\"/banner.jpg\" alt=\"\" />}\n * pill={{ variant: \"contrast\", children: \"Popular this week\" }}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * name=\"Jane Doe\"\n * verified\n * tagline=\"412 posts\"\n * content={<span className=\"block truncate\">$9.99 / month</span>}\n * action={<Button variant=\"primary\" size=\"32\" fullWidth>Subscribe</Button>}\n * />\n * ```\n */\nexport const CreatorCard = React.forwardRef<HTMLDivElement, CreatorCardProps>(\n (\n {\n className,\n background,\n pill,\n avatar,\n name,\n verified = false,\n verifiedLabel = \"Verified\",\n tagline,\n content,\n action,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative isolate flex flex-col overflow-hidden bg-surface-primary\",\n className,\n )}\n {...props}\n >\n <div className=\"relative aspect-10/11 w-full shrink-0 overflow-hidden\">\n <div className=\"pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover\">\n {background}\n </div>\n {pill ? (\n <Pill\n variant=\"contrast\"\n {...pill}\n className={cn(\"absolute top-2 left-2 max-w-[calc(100%-1rem)]\", pill.className)}\n />\n ) : null}\n </div>\n <div className=\"flex min-w-0 flex-col gap-2.5 p-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Avatar\n size={32}\n src={avatar?.src}\n alt={avatar?.alt ?? (typeof name === \"string\" ? name : undefined)}\n fallback={avatar?.fallback}\n {...avatar}\n />\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex min-w-0 items-center gap-1\">\n <p className=\"typography-body-small-14px-semibold m-0 truncate text-content-primary\">\n {name}\n </p>\n {verified ? (\n <span\n role=\"img\"\n aria-label={verifiedLabel}\n className=\"inline-flex shrink-0 text-content-primary\"\n >\n <VerifiedIcon size={16} filled />\n </span>\n ) : null}\n </div>\n {tagline ? (\n <p className=\"typography-body-small-14px-regular m-0 truncate text-content-secondary\">\n {tagline}\n </p>\n ) : null}\n </div>\n </div>\n {content ? (\n <div className=\"typography-body-small-14px-semibold min-w-0 text-content-primary\">\n {content}\n </div>\n ) : null}\n {action ? <div className=\"flex w-full\">{action}</div> : null}\n </div>\n </div>\n );\n },\n);\n\nCreatorCard.displayName = \"CreatorCard\";\n"],"names":["React","jsxs","cn","jsx","Pill","Avatar","VerifiedIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4DO,MAAM,cAAcA,iBAAM;AAAA,EAC/B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IAC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WAAU;AAAA,sBAEV,UAAAA,2BAAAA,IAACG,2BAAA,EAAa,MAAM,IAAI,QAAM,KAAA,CAAC;AAAA,oBAAA;AAAA,kBAAA,IAE/B;AAAA,gBAAA,GACN;AAAA,gBACC,UACCH,2BAAAA,IAAC,KAAA,EAAE,WAAU,0EACV,mBACH,IACE;AAAA,cAAA,EAAA,CACN;AAAA,YAAA,GACF;AAAA,YACC,UACCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,oEACZ,mBACH,IACE;AAAA,YACH,SAASA,2BAAAA,IAAC,OAAA,EAAI,WAAU,eAAe,kBAAO,IAAS;AAAA,UAAA,EAAA,CAC1D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
|
|
@@ -3,46 +3,73 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../../utils/cn.mjs";
|
|
5
5
|
import { Avatar } from "../Avatar/Avatar.mjs";
|
|
6
|
+
import { VerifiedIcon } from "../Icons/VerifiedIcon.mjs";
|
|
7
|
+
import { Pill } from "../Pill/Pill.mjs";
|
|
6
8
|
const CreatorCard = React.forwardRef(
|
|
7
|
-
({
|
|
9
|
+
({
|
|
10
|
+
className,
|
|
11
|
+
background,
|
|
12
|
+
pill,
|
|
13
|
+
avatar,
|
|
14
|
+
name,
|
|
15
|
+
verified = false,
|
|
16
|
+
verifiedLabel = "Verified",
|
|
17
|
+
tagline,
|
|
18
|
+
content,
|
|
19
|
+
action,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
8
22
|
return /* @__PURE__ */ jsxs(
|
|
9
23
|
"div",
|
|
10
24
|
{
|
|
11
25
|
ref,
|
|
12
26
|
className: cn(
|
|
13
|
-
"relative isolate flex
|
|
27
|
+
"relative isolate flex flex-col overflow-hidden bg-surface-primary",
|
|
14
28
|
className
|
|
15
29
|
),
|
|
16
30
|
...props,
|
|
17
31
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "relative aspect-10/11 w-full shrink-0 overflow-hidden", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover", children: background }),
|
|
34
|
+
pill ? /* @__PURE__ */ jsx(
|
|
35
|
+
Pill,
|
|
36
|
+
{
|
|
37
|
+
variant: "contrast",
|
|
38
|
+
...pill,
|
|
39
|
+
className: cn("absolute top-2 left-2 max-w-[calc(100%-1rem)]", pill.className)
|
|
40
|
+
}
|
|
41
|
+
) : null
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2.5 p-3", children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
30
45
|
/* @__PURE__ */ jsx(
|
|
31
46
|
Avatar,
|
|
32
47
|
{
|
|
33
|
-
size:
|
|
48
|
+
size: 32,
|
|
34
49
|
src: avatar?.src,
|
|
35
|
-
alt: avatar?.alt ?? name,
|
|
50
|
+
alt: avatar?.alt ?? (typeof name === "string" ? name : void 0),
|
|
36
51
|
fallback: avatar?.fallback,
|
|
37
52
|
...avatar
|
|
38
53
|
}
|
|
39
54
|
),
|
|
40
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("p", { className: "typography-body-small-14px-semibold m-0 truncate text-content-primary", children: name }),
|
|
58
|
+
verified ? /* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
role: "img",
|
|
62
|
+
"aria-label": verifiedLabel,
|
|
63
|
+
className: "inline-flex shrink-0 text-content-primary",
|
|
64
|
+
children: /* @__PURE__ */ jsx(VerifiedIcon, { size: 16, filled: true })
|
|
65
|
+
}
|
|
66
|
+
) : null
|
|
67
|
+
] }),
|
|
68
|
+
tagline ? /* @__PURE__ */ jsx("p", { className: "typography-body-small-14px-regular m-0 truncate text-content-secondary", children: tagline }) : null
|
|
43
69
|
] })
|
|
44
70
|
] }),
|
|
45
|
-
|
|
71
|
+
content ? /* @__PURE__ */ jsx("div", { className: "typography-body-small-14px-semibold min-w-0 text-content-primary", children: content }) : null,
|
|
72
|
+
action ? /* @__PURE__ */ jsx("div", { className: "flex w-full", children: action }) : null
|
|
46
73
|
] })
|
|
47
74
|
]
|
|
48
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatorCard.mjs","sources":["../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\n\nexport interface CreatorCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Decorative
|
|
1
|
+
{"version":3,"file":"CreatorCard.mjs","sources":["../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { Pill, type PillProps } from \"../Pill/Pill\";\n\nexport interface CreatorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"content\"> {\n /** Decorative banner media rendered at the top of the card. */\n background: React.ReactNode;\n /**\n * Props forwarded to a {@link Pill} overlaid on the top-left of the banner.\n * Pass the label as `children`. Omit to hide the pill.\n */\n pill?: PillProps;\n /** Avatar props forwarded to the inner {@link Avatar}. */\n avatar?: React.ComponentPropsWithoutRef<typeof Avatar>;\n /** Creator display name shown next to the avatar. */\n name: React.ReactNode;\n /** When `true`, renders a verified badge after the name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Optional secondary line shown under the name (e.g. post count). */\n tagline?: React.ReactNode;\n /**\n * Optional content shown under the creator details (e.g. the subscription\n * price). It wraps by default; pass a `truncate` element to keep it on one line.\n */\n content?: React.ReactNode;\n /**\n * Action element rendered full-width at the bottom of the card (e.g. a\n * `Button` with `fullWidth` for subscribing to the creator).\n */\n action?: React.ReactNode;\n}\n\n/**\n * A card suggesting a creator, with a banner image, an optional {@link Pill},\n * the creator's avatar, name and tagline, free-form content such as a price,\n * and an optional action.\n *\n * The card has no fixed width or corner radius: set both through `className`\n * (e.g. `className=\"w-40 rounded-md\"`). The banner keeps a 10:11 ratio at any\n * width.\n *\n * @example\n * ```tsx\n * <CreatorCard\n * className=\"w-40 rounded-md\"\n * background={<img src=\"/banner.jpg\" alt=\"\" />}\n * pill={{ variant: \"contrast\", children: \"Popular this week\" }}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * name=\"Jane Doe\"\n * verified\n * tagline=\"412 posts\"\n * content={<span className=\"block truncate\">$9.99 / month</span>}\n * action={<Button variant=\"primary\" size=\"32\" fullWidth>Subscribe</Button>}\n * />\n * ```\n */\nexport const CreatorCard = React.forwardRef<HTMLDivElement, CreatorCardProps>(\n (\n {\n className,\n background,\n pill,\n avatar,\n name,\n verified = false,\n verifiedLabel = \"Verified\",\n tagline,\n content,\n action,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative isolate flex flex-col overflow-hidden bg-surface-primary\",\n className,\n )}\n {...props}\n >\n <div className=\"relative aspect-10/11 w-full shrink-0 overflow-hidden\">\n <div className=\"pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover\">\n {background}\n </div>\n {pill ? (\n <Pill\n variant=\"contrast\"\n {...pill}\n className={cn(\"absolute top-2 left-2 max-w-[calc(100%-1rem)]\", pill.className)}\n />\n ) : null}\n </div>\n <div className=\"flex min-w-0 flex-col gap-2.5 p-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Avatar\n size={32}\n src={avatar?.src}\n alt={avatar?.alt ?? (typeof name === \"string\" ? name : undefined)}\n fallback={avatar?.fallback}\n {...avatar}\n />\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex min-w-0 items-center gap-1\">\n <p className=\"typography-body-small-14px-semibold m-0 truncate text-content-primary\">\n {name}\n </p>\n {verified ? (\n <span\n role=\"img\"\n aria-label={verifiedLabel}\n className=\"inline-flex shrink-0 text-content-primary\"\n >\n <VerifiedIcon size={16} filled />\n </span>\n ) : null}\n </div>\n {tagline ? (\n <p className=\"typography-body-small-14px-regular m-0 truncate text-content-secondary\">\n {tagline}\n </p>\n ) : null}\n </div>\n </div>\n {content ? (\n <div className=\"typography-body-small-14px-semibold min-w-0 text-content-primary\">\n {content}\n </div>\n ) : null}\n {action ? <div className=\"flex w-full\">{action}</div> : null}\n </div>\n </div>\n );\n },\n);\n\nCreatorCard.displayName = \"CreatorCard\";\n"],"names":[],"mappings":";;;;;;;AA4DO,MAAM,cAAc,MAAM;AAAA,EAC/B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,yDACb,UAAA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dist/index.d.ts
CHANGED
|
@@ -2203,44 +2203,59 @@ export declare type CountSize = "16" | "24" | "32";
|
|
|
2203
2203
|
export declare type CountVariant = "default" | "contrast" | "brand" | "alert" | "pink" | "info" | "success" | "warning";
|
|
2204
2204
|
|
|
2205
2205
|
/**
|
|
2206
|
-
* A
|
|
2207
|
-
*
|
|
2206
|
+
* A card suggesting a creator, with a banner image, an optional {@link Pill},
|
|
2207
|
+
* the creator's avatar, name and tagline, free-form content such as a price,
|
|
2208
|
+
* and an optional action.
|
|
2208
2209
|
*
|
|
2209
|
-
*
|
|
2210
|
-
*
|
|
2210
|
+
* The card has no fixed width or corner radius: set both through `className`
|
|
2211
|
+
* (e.g. `className="w-40 rounded-md"`). The banner keeps a 10:11 ratio at any
|
|
2212
|
+
* width.
|
|
2211
2213
|
*
|
|
2212
2214
|
* @example
|
|
2213
2215
|
* ```tsx
|
|
2214
2216
|
* <CreatorCard
|
|
2215
|
-
*
|
|
2217
|
+
* className="w-40 rounded-md"
|
|
2218
|
+
* background={<img src="/banner.jpg" alt="" />}
|
|
2219
|
+
* pill={{ variant: "contrast", children: "Popular this week" }}
|
|
2220
|
+
* avatar={{ src: "/avatar.jpg", fallback: "JD" }}
|
|
2216
2221
|
* name="Jane Doe"
|
|
2217
|
-
*
|
|
2218
|
-
*
|
|
2219
|
-
*
|
|
2220
|
-
*
|
|
2221
|
-
* <Button variant="brand" fullWidth>Join for free for 3 days</Button>
|
|
2222
|
-
* <Button variant="primary" fullWidth>Follow for Free</Button>
|
|
2223
|
-
* </>
|
|
2224
|
-
* }
|
|
2222
|
+
* verified
|
|
2223
|
+
* tagline="412 posts"
|
|
2224
|
+
* content={<span className="block truncate">$9.99 / month</span>}
|
|
2225
|
+
* action={<Button variant="primary" size="32" fullWidth>Subscribe</Button>}
|
|
2225
2226
|
* />
|
|
2226
2227
|
* ```
|
|
2227
2228
|
*/
|
|
2228
2229
|
export declare const CreatorCard: React_2.ForwardRefExoticComponent<CreatorCardProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2229
2230
|
|
|
2230
|
-
export declare interface CreatorCardProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
2231
|
-
/** Decorative
|
|
2231
|
+
export declare interface CreatorCardProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, "content"> {
|
|
2232
|
+
/** Decorative banner media rendered at the top of the card. */
|
|
2232
2233
|
background: React_2.ReactNode;
|
|
2233
|
-
/**
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2234
|
+
/**
|
|
2235
|
+
* Props forwarded to a {@link Pill} overlaid on the top-left of the banner.
|
|
2236
|
+
* Pass the label as `children`. Omit to hide the pill.
|
|
2237
|
+
*/
|
|
2238
|
+
pill?: PillProps;
|
|
2237
2239
|
/** Avatar props forwarded to the inner {@link Avatar}. */
|
|
2238
2240
|
avatar?: React_2.ComponentPropsWithoutRef<typeof Avatar>;
|
|
2241
|
+
/** Creator display name shown next to the avatar. */
|
|
2242
|
+
name: React_2.ReactNode;
|
|
2243
|
+
/** When `true`, renders a verified badge after the name. @default false */
|
|
2244
|
+
verified?: boolean;
|
|
2245
|
+
/** Accessible label for the verified badge. @default "Verified" */
|
|
2246
|
+
verifiedLabel?: string;
|
|
2247
|
+
/** Optional secondary line shown under the name (e.g. post count). */
|
|
2248
|
+
tagline?: React_2.ReactNode;
|
|
2239
2249
|
/**
|
|
2240
|
-
*
|
|
2241
|
-
* `
|
|
2250
|
+
* Optional content shown under the creator details (e.g. the subscription
|
|
2251
|
+
* price). It wraps by default; pass a `truncate` element to keep it on one line.
|
|
2242
2252
|
*/
|
|
2243
|
-
|
|
2253
|
+
content?: React_2.ReactNode;
|
|
2254
|
+
/**
|
|
2255
|
+
* Action element rendered full-width at the bottom of the card (e.g. a
|
|
2256
|
+
* `Button` with `fullWidth` for subscribing to the creator).
|
|
2257
|
+
*/
|
|
2258
|
+
action?: React_2.ReactNode;
|
|
2244
2259
|
}
|
|
2245
2260
|
|
|
2246
2261
|
/**
|