@linktr.ee/messaging-react 3.8.1 → 3.9.0-rc-1783407048
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/Card-D8yiJ8Uw.cjs +2 -0
- package/dist/Card-D8yiJ8Uw.cjs.map +1 -0
- package/dist/Card-DSG-wR8t.js +96 -0
- package/dist/Card-DSG-wR8t.js.map +1 -0
- package/dist/Card-DVfSiq9b.cjs +2 -0
- package/dist/Card-DVfSiq9b.cjs.map +1 -0
- package/dist/Card-DX9nBx1S.js +221 -0
- package/dist/Card-DX9nBx1S.js.map +1 -0
- package/dist/Card-iKTcn1wg.cjs +2 -0
- package/dist/Card-iKTcn1wg.cjs.map +1 -0
- package/dist/Card-qDLtjK6u.js +108 -0
- package/dist/Card-qDLtjK6u.js.map +1 -0
- package/dist/PurchaseStatusBadge-CJH4S-8Z.js +36 -0
- package/dist/PurchaseStatusBadge-CJH4S-8Z.js.map +1 -0
- package/dist/PurchaseStatusBadge-UjDzZhLj.cjs +2 -0
- package/dist/PurchaseStatusBadge-UjDzZhLj.cjs.map +1 -0
- package/dist/TextShell-BiqF2UB0.js +32 -0
- package/dist/TextShell-BiqF2UB0.js.map +1 -0
- package/dist/TextShell-Bnzh0T75.cjs +2 -0
- package/dist/TextShell-Bnzh0T75.cjs.map +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{index-BCgRoF_u.js → index-CZTUyiPe.js} +1154 -1113
- package/dist/index-CZTUyiPe.js.map +1 -0
- package/dist/index-DwUOvMxg.cjs +2 -0
- package/dist/index-DwUOvMxg.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +98 -55
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +1 -0
- package/dist/usePreviewToggle-BG-pfsgP.js +323 -0
- package/dist/usePreviewToggle-BG-pfsgP.js.map +1 -0
- package/dist/usePreviewToggle-DXQT07ws.cjs +2 -0
- package/dist/usePreviewToggle-DXQT07ws.cjs.map +1 -0
- package/package.json +2 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +54 -1
- package/src/components/CustomMessage/MessageTag.tsx +8 -0
- package/src/components/CustomMessage/index.tsx +61 -22
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +410 -333
- package/src/components/LockedAttachment/LockedAttachment.test.tsx +104 -0
- package/src/components/LockedAttachment/components/Composer/Card.tsx +97 -120
- package/src/components/LockedAttachment/components/Media/Card.tsx +237 -0
- package/src/components/LockedAttachment/components/Text/Card.tsx +177 -0
- package/src/components/LockedAttachment/components/_shared/CardBody.tsx +3 -3
- package/src/components/LockedAttachment/components/_shared/CardThumbnail.tsx +92 -0
- package/src/components/LockedAttachment/components/_shared/GalleryThumbnail.tsx +11 -33
- package/src/components/LockedAttachment/components/_shared/LoadingDots.tsx +36 -0
- package/src/components/LockedAttachment/components/_shared/LockBadge.tsx +21 -11
- package/src/components/LockedAttachment/components/_shared/{LockedCardShell.tsx → MediaShell.tsx} +5 -5
- package/src/components/LockedAttachment/components/_shared/PreviewToggle.tsx +58 -0
- package/src/components/LockedAttachment/components/_shared/PriceLockRow.tsx +21 -0
- package/src/components/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx +87 -0
- package/src/components/LockedAttachment/components/_shared/{LockedThumbnail.tsx → SingleThumbnail.tsx} +5 -5
- package/src/components/LockedAttachment/components/_shared/SkeletonTextLines.tsx +39 -0
- package/src/components/LockedAttachment/components/_shared/TextShell.tsx +19 -0
- package/src/components/LockedAttachment/components/_shared/usePreviewToggle.test.ts +67 -0
- package/src/components/LockedAttachment/components/_shared/usePreviewToggle.ts +89 -0
- package/src/components/LockedAttachment/components/_shared/useReceivedSource.ts +83 -0
- package/src/components/LockedAttachment/index.tsx +17 -28
- package/src/components/LockedAttachment/types.ts +28 -4
- package/src/index.ts +2 -5
- package/src/stream-custom-data.ts +1 -0
- package/src/styles.css +5 -0
- package/dist/Card-BRvcFjsq.js +0 -132
- package/dist/Card-BRvcFjsq.js.map +0 -1
- package/dist/Card-BuXkok0A.cjs +0 -2
- package/dist/Card-BuXkok0A.cjs.map +0 -1
- package/dist/Card-CvNHv3me.js +0 -107
- package/dist/Card-CvNHv3me.js.map +0 -1
- package/dist/Card-DOSuQdnk.cjs +0 -2
- package/dist/Card-DOSuQdnk.cjs.map +0 -1
- package/dist/Card-NnQw99XE.cjs +0 -2
- package/dist/Card-NnQw99XE.cjs.map +0 -1
- package/dist/Card-jGOcSN1O.js +0 -163
- package/dist/Card-jGOcSN1O.js.map +0 -1
- package/dist/LockedThumbnail-EsjaAqLR.js +0 -220
- package/dist/LockedThumbnail-EsjaAqLR.js.map +0 -1
- package/dist/LockedThumbnail-uAauUd5c.cjs +0 -2
- package/dist/LockedThumbnail-uAauUd5c.cjs.map +0 -1
- package/dist/index-BCgRoF_u.js.map +0 -1
- package/dist/index-DRurVQ0-.cjs +0 -2
- package/dist/index-DRurVQ0-.cjs.map +0 -1
- package/src/components/LockedAttachment/components/Composer/index.ts +0 -2
- package/src/components/LockedAttachment/components/Received/Card.tsx +0 -191
- package/src/components/LockedAttachment/components/Received/index.ts +0 -2
- package/src/components/LockedAttachment/components/Sent/Card.tsx +0 -177
- package/src/components/LockedAttachment/components/Sent/index.ts +0 -2
- /package/src/components/LockedAttachment/components/{Received → Media}/CardActions.tsx +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card-qDLtjK6u.js","sources":["../src/components/LockedAttachment/components/Composer/Card.tsx"],"sourcesContent":["import { PencilSimpleIcon, XIcon } from '@phosphor-icons/react'\nimport React from 'react'\n\nimport type { FetchSourceHandler, LockedAttachmentBaseProps } from '../../types'\nimport CardBody from '../_shared/CardBody'\nimport CardThumbnail, {\n galleryBodyIcon,\n isGalleryCard,\n} from '../_shared/CardThumbnail'\nimport MediaShell from '../_shared/MediaShell'\nimport PreviewToggle from '../_shared/PreviewToggle'\nimport PriceLockRow from '../_shared/PriceLockRow'\nimport TextShell from '../_shared/TextShell'\nimport { usePreviewToggle } from '../_shared/usePreviewToggle'\n\nexport interface ComposerCardProps extends LockedAttachmentBaseProps {\n /**\n * The message's own text, shown as-is (not redacted yet — the message\n * hasn't been sent). Only used when `contentType` is `\"text\"`.\n */\n text?: string\n /** Placeholder shown in the amount slot before one is configured. */\n placeholderAmountText?: string\n /**\n * Renders a persistent dismiss X on the thumbnail (media) or next to the\n * text (text mode); called to remove the draft attachment. Unrelated to\n * `TextCardProps.onDismiss`, which only appears for `isMine` after a\n * failed payment.\n */\n onDismiss?: () => void\n /** Fired the first time the composer taps the thumbnail to preview. */\n onPreviewClick?: () => void\n /**\n * Lazily loads the underlying source so the composer can preview the\n * attachment they're about to send. Called the first time the thumbnail is\n * tapped; the returned source is cached and reused on subsequent toggles.\n * Ignored when `contentType` is `\"text\"`.\n */\n onFetchSource?: FetchSourceHandler\n /**\n * When provided, renders a pencil button in the body bottom-right that the\n * composer can use to edit the attachment metadata (e.g. open the price /\n * gallery editor). Matches the Composer \"Button\" instance in Figma.\n */\n onEditClick?: () => void\n}\n\n/**\n * Composer card in text mode: a normal outgoing chat bubble showing the real\n * draft text (it hasn't been sent/redacted yet) plus a dismiss X and a price\n * row. Media-only props are ignored here.\n */\nconst ComposerTextCard: React.FC<ComposerCardProps> = ({\n text,\n amountText,\n placeholderAmountText,\n onDismiss,\n}) => (\n <TextShell>\n <div className=\"pr-8\">{text}</div>\n <PriceLockRow>\n <span className={amountText ? 'text-white/55' : 'text-white/30'}>\n {amountText || placeholderAmountText}\n </span>\n </PriceLockRow>\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n className=\"absolute right-3 top-3 flex size-6 shrink-0 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15\"\n aria-label=\"Dismiss attachment\"\n >\n <XIcon className=\"size-3\" weight=\"bold\" />\n </button>\n )}\n </TextShell>\n)\n\n/**\n * Composer card in media mode: the locked thumbnail (single or gallery) the\n * composer taps to preview the attachment they're about to send, plus the\n * title/price body with optional dismiss X and edit pencil.\n */\nconst ComposerMediaCard: React.FC<ComposerCardProps> = ({\n title,\n mimeType = 'application/octet-stream',\n thumbnailUrl,\n detail,\n amountText,\n placeholderTitle = 'Attachment title',\n placeholderAmountText,\n gallery = [],\n onDismiss,\n onPreviewClick,\n onFetchSource,\n onEditClick,\n}) => {\n const isGallery = isGalleryCard(gallery)\n\n // Gallery is always previewable in the composer because each item's source\n // is already provided up-front via `gallery[*].sourceUrl`.\n const { source, isPreviewVisible, isLoadingPreview, togglePreview } =\n usePreviewToggle({ isGallery, onFetchSource, onPreviewClick })\n\n const showLocked = !isPreviewVisible\n const isBusy = isLoadingPreview\n\n const statusBadge = (\n <React.Fragment>\n <span className=\"text-xs font-medium text-white/55\">•</span>\n <span\n className={\n amountText\n ? 'text-xs font-medium text-white/55'\n : 'text-xs font-medium text-white/30'\n }\n >\n {amountText || placeholderAmountText}\n </span>\n </React.Fragment>\n )\n\n const dismissButton = onDismiss ? (\n <button\n type=\"button\"\n onClick={(e) => {\n // Stop the click from bubbling up into the outer preview-toggle\n // wrapper when both are wired up at the same time.\n e.stopPropagation()\n onDismiss()\n }}\n className=\"flex size-6 items-center justify-center rounded-full bg-[#121110] text-white\"\n aria-label=\"Dismiss attachment\"\n >\n <XIcon className=\"size-3\" weight=\"bold\" />\n </button>\n ) : undefined\n\n const editButton = onEditClick ? (\n <button\n type=\"button\"\n onClick={onEditClick}\n aria-label=\"Edit attachment\"\n className=\"flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15\"\n >\n <PencilSimpleIcon className=\"size-5\" weight=\"regular\" />\n </button>\n ) : undefined\n\n return (\n <MediaShell variant=\"dark\">\n <PreviewToggle\n onToggle={togglePreview}\n isBusy={isBusy}\n isPreviewVisible={!showLocked}\n >\n <CardThumbnail\n variant=\"dark\"\n gallery={gallery}\n title={title}\n showLocked={showLocked}\n mimeType={mimeType}\n thumbnailUrl={thumbnailUrl}\n source={source}\n topRight={dismissButton}\n />\n </PreviewToggle>\n\n <CardBody\n variant=\"dark\"\n title={title}\n placeholderTitle={placeholderTitle}\n mimeType={mimeType}\n detail={detail}\n statusBadge={statusBadge}\n icon={isGallery ? galleryBodyIcon('dark') : undefined}\n trailingAction={editButton}\n />\n </MediaShell>\n )\n}\n\n/**\n * The card the composer sees while drafting a paid attachment.\n * Matches the Composer column of the messaging design system in Figma.\n *\n * When `contentType === \"text\"`, renders as a normal outgoing chat bubble\n * showing the real draft text (it hasn't been sent/redacted yet) plus a\n * dismiss X and a price row, instead of a media thumbnail card.\n */\nconst ComposerCard: React.FC<ComposerCardProps> = (props) =>\n props.contentType === 'text' ? (\n <ComposerTextCard {...props} />\n ) : (\n <ComposerMediaCard {...props} />\n )\n\nexport default ComposerCard\n"],"names":["ComposerTextCard","text","amountText","placeholderAmountText","onDismiss","TextShell","jsx","PriceLockRow","XIcon","ComposerMediaCard","title","mimeType","thumbnailUrl","detail","placeholderTitle","gallery","onPreviewClick","onFetchSource","onEditClick","isGallery","isGalleryCard","source","isPreviewVisible","isLoadingPreview","togglePreview","usePreviewToggle","showLocked","isBusy","statusBadge","jsxs","React","dismissButton","e","editButton","PencilSimpleIcon","MediaShell","PreviewToggle","CardThumbnail","CardBody","galleryBodyIcon","ComposerCard","props"],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { CheckCircleIcon as d } from "@phosphor-icons/react";
|
|
3
|
+
import s from "classnames";
|
|
4
|
+
import a from "react";
|
|
5
|
+
const h = ({
|
|
6
|
+
isMine: l,
|
|
7
|
+
paymentStatus: r,
|
|
8
|
+
amountText: i
|
|
9
|
+
}) => {
|
|
10
|
+
const n = l ? "text-white/55" : "text-black/55", c = l ? "text-[#34c759]" : "text-[#008236]";
|
|
11
|
+
return r === "paid" ? /* @__PURE__ */ t(a.Fragment, { children: [
|
|
12
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
|
|
13
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", c), children: l ? "Sold" : "Purchased" }),
|
|
14
|
+
/* @__PURE__ */ e(
|
|
15
|
+
d,
|
|
16
|
+
{
|
|
17
|
+
className: s("shrink-0 size-3.5", c),
|
|
18
|
+
weight: "bold",
|
|
19
|
+
"aria-hidden": !0
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
] }) : i != null ? /* @__PURE__ */ t(a.Fragment, { children: [
|
|
23
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
|
|
24
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: i })
|
|
25
|
+
] }) : r === "pending" ? /* @__PURE__ */ t(a.Fragment, { children: [
|
|
26
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
|
|
27
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "Sent" })
|
|
28
|
+
] }) : r === "failed" || r === "refunded" ? /* @__PURE__ */ t(a.Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
|
|
30
|
+
/* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: r === "failed" ? "Payment failed" : "Refunded" })
|
|
31
|
+
] }) : null;
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
h as P
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=PurchaseStatusBadge-CJH4S-8Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PurchaseStatusBadge-CJH4S-8Z.js","sources":["../src/components/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n \n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'pending') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n Sent\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'failed' || paymentStatus === 'refunded') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {paymentStatus === 'failed' ? 'Payment failed' : 'Refunded'}\n </span>\n </React.Fragment>\n )\n }\n\n return null\n}\n\nexport default PurchaseStatusBadge\n"],"names":["PurchaseStatusBadge","isMine","paymentStatus","amountText","labelColour","successColour","jsxs","React","jsx","classNames","CheckCircleIcon"],"mappings":";;;;AAkBA,MAAMA,IAA0D,CAAC;AAAA,EAC/D,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAAcH,IAAS,kBAAkB,iBACzCI,IAAgBJ,IAAS,mBAAmB;AAElD,SAAIC,MAAkB,SAElB,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,IACA,gBAAAI,EAAC,UAAK,WAAWC,EAAW,uBAAuBJ,CAAa,GAC7D,UAAAJ,IAAS,SAAS,YAAA,CACrB;AAAA,IACA,gBAAAO;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWD,EAAW,qBAAqBJ,CAAa;AAAA,QACxD,QAAO;AAAA,QACP,eAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GACF,IAIAF,KAAc,OAEd,gBAAAG,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,sBACC,QAAA,EAAK,WAAWK,EAAW,uBAAuBL,CAAW,GAC3D,UAAAD,EAAA,CACH;AAAA,EAAA,GACF,IAIAD,MAAkB,YAElB,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,sBACC,QAAA,EAAK,WAAWK,EAAW,uBAAuBL,CAAW,GAAG,UAAA,OAAA,CAEjE;AAAA,EAAA,GACF,IAIAF,MAAkB,YAAYA,MAAkB,aAEhD,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,IACA,gBAAAI,EAAC,QAAA,EAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAC3D,UAAAF,MAAkB,WAAW,mBAAmB,WAAA,CACnD;AAAA,EAAA,GACF,IAIG;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("@phosphor-icons/react"),s=require("classnames"),r=require("react"),d=({isMine:c,paymentStatus:t,amountText:a})=>{const n=c?"text-white/55":"text-black/55",i=c?"text-[#34c759]":"text-[#008236]";return t==="paid"?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",i),children:c?"Sold":"Purchased"}),e.jsx(l.CheckCircleIcon,{className:s("shrink-0 size-3.5",i),weight:"bold","aria-hidden":!0})]}):a!=null?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",n),children:a})]}):t==="pending"?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",n),children:"Sent"})]}):t==="failed"||t==="refunded"?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",n),children:t==="failed"?"Payment failed":"Refunded"})]}):null};exports.PurchaseStatusBadge=d;
|
|
2
|
+
//# sourceMappingURL=PurchaseStatusBadge-UjDzZhLj.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PurchaseStatusBadge-UjDzZhLj.cjs","sources":["../src/components/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n \n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'pending') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n Sent\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'failed' || paymentStatus === 'refunded') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n •\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {paymentStatus === 'failed' ? 'Payment failed' : 'Refunded'}\n </span>\n </React.Fragment>\n )\n }\n\n return null\n}\n\nexport default PurchaseStatusBadge\n"],"names":["PurchaseStatusBadge","isMine","paymentStatus","amountText","labelColour","successColour","jsxs","React","jsx","classNames","CheckCircleIcon"],"mappings":"gIAkBMA,EAA0D,CAAC,CAC/D,OAAAC,EACA,cAAAC,EACA,WAAAC,CACF,IAAM,CACJ,MAAMC,EAAcH,EAAS,gBAAkB,gBACzCI,EAAgBJ,EAAS,iBAAmB,iBAElD,OAAIC,IAAkB,OAElBI,OAACC,EAAM,SAAN,CACC,SAAA,CAAAC,MAAC,QAAK,UAAWC,EAAW,sBAAuBL,CAAW,EAAG,SAAA,IAEjE,EACAI,EAAAA,IAAC,QAAK,UAAWC,EAAW,sBAAuBJ,CAAa,EAC7D,SAAAJ,EAAS,OAAS,WAAA,CACrB,EACAO,EAAAA,IAACE,EAAAA,gBAAA,CACC,UAAWD,EAAW,oBAAqBJ,CAAa,EACxD,OAAO,OACP,cAAW,EAAA,CAAA,CACb,EACF,EAIAF,GAAc,KAEdG,OAACC,EAAM,SAAN,CACC,SAAA,CAAAC,MAAC,QAAK,UAAWC,EAAW,sBAAuBL,CAAW,EAAG,SAAA,IAEjE,QACC,OAAA,CAAK,UAAWK,EAAW,sBAAuBL,CAAW,EAC3D,SAAAD,CAAA,CACH,CAAA,EACF,EAIAD,IAAkB,UAElBI,OAACC,EAAM,SAAN,CACC,SAAA,CAAAC,MAAC,QAAK,UAAWC,EAAW,sBAAuBL,CAAW,EAAG,SAAA,IAEjE,QACC,OAAA,CAAK,UAAWK,EAAW,sBAAuBL,CAAW,EAAG,SAAA,MAAA,CAEjE,CAAA,EACF,EAIAF,IAAkB,UAAYA,IAAkB,WAEhDI,OAACC,EAAM,SAAN,CACC,SAAA,CAAAC,MAAC,QAAK,UAAWC,EAAW,sBAAuBL,CAAW,EAAG,SAAA,IAEjE,EACAI,EAAAA,IAAC,OAAA,CAAK,UAAWC,EAAW,sBAAuBL,CAAW,EAC3D,SAAAF,IAAkB,SAAW,iBAAmB,UAAA,CACnD,CAAA,EACF,EAIG,IACT"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { LockSimpleIcon as c } from "@phosphor-icons/react";
|
|
3
|
+
import i from "classnames";
|
|
4
|
+
const r = ({ children: e }) => /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-xs font-medium", children: [
|
|
5
|
+
/* @__PURE__ */ s(
|
|
6
|
+
c,
|
|
7
|
+
{
|
|
8
|
+
className: "size-3.5 shrink-0 opacity-55",
|
|
9
|
+
weight: "fill",
|
|
10
|
+
"aria-hidden": !0
|
|
11
|
+
}
|
|
12
|
+
),
|
|
13
|
+
e
|
|
14
|
+
] }), x = ({
|
|
15
|
+
children: e,
|
|
16
|
+
className: t
|
|
17
|
+
}) => /* @__PURE__ */ s(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: i(
|
|
21
|
+
"str-chat__message-bubble message-locked-attachment-text",
|
|
22
|
+
"px-4 py-3 flex flex-col gap-1",
|
|
23
|
+
t
|
|
24
|
+
),
|
|
25
|
+
children: e
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
export {
|
|
29
|
+
r as P,
|
|
30
|
+
x as T
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=TextShell-BiqF2UB0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextShell-BiqF2UB0.js","sources":["../src/components/LockedAttachment/components/_shared/PriceLockRow.tsx","../src/components/LockedAttachment/components/_shared/TextShell.tsx"],"sourcesContent":["import { LockSimpleIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\n/**\n * The lock-icon + amount/status row shared by every LockedAttachment text-mode\n * card. Only the wrapper and the leading lock icon are shared — the amount and\n * any trailing status live in `children`, since they genuinely differ per card\n * (placeholder fallback vs. paid badge vs. bare amount).\n */\nconst PriceLockRow: React.FC<React.PropsWithChildren> = ({ children }) => (\n <div className=\"flex items-center gap-1 text-xs font-medium\">\n <LockSimpleIcon\n className=\"size-3.5 shrink-0 opacity-55\"\n weight=\"fill\"\n aria-hidden\n />\n {children}\n </div>\n)\n\nexport default PriceLockRow\n","import classNames from 'classnames'\nimport React from 'react'\n\nconst TextShell: React.FC<React.PropsWithChildren<{ className?: string }>> = ({\n children,\n className,\n}) => (\n <div\n className={classNames(\n 'str-chat__message-bubble message-locked-attachment-text',\n 'px-4 py-3 flex flex-col gap-1',\n className\n )}\n >\n {children}\n </div>\n)\n\nexport default TextShell\n"],"names":["PriceLockRow","children","jsxs","jsx","LockSimpleIcon","TextShell","className","classNames"],"mappings":";;;AASA,MAAMA,IAAkD,CAAC,EAAE,UAAAC,QACzD,gBAAAC,EAAC,OAAA,EAAI,WAAU,+CACb,UAAA;AAAA,EAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,QAAO;AAAA,MACP,eAAW;AAAA,IAAA;AAAA,EAAA;AAAA,EAEZH;AAAA,EAAA,CACH,GCdII,IAAuE,CAAC;AAAA,EAC5E,UAAAJ;AAAA,EACA,WAAAK;AACF,MACE,gBAAAH;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWI;AAAA,MACT;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAAA,IAGD,UAAAL;AAAA,EAAA;AACH;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),c=require("@phosphor-icons/react"),i=require("classnames"),a=({children:e})=>s.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium",children:[s.jsx(c.LockSimpleIcon,{className:"size-3.5 shrink-0 opacity-55",weight:"fill","aria-hidden":!0}),e]}),l=({children:e,className:t})=>s.jsx("div",{className:i("str-chat__message-bubble message-locked-attachment-text","px-4 py-3 flex flex-col gap-1",t),children:e});exports.PriceLockRow=a;exports.TextShell=l;
|
|
2
|
+
//# sourceMappingURL=TextShell-Bnzh0T75.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextShell-Bnzh0T75.cjs","sources":["../src/components/LockedAttachment/components/_shared/PriceLockRow.tsx","../src/components/LockedAttachment/components/_shared/TextShell.tsx"],"sourcesContent":["import { LockSimpleIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\n/**\n * The lock-icon + amount/status row shared by every LockedAttachment text-mode\n * card. Only the wrapper and the leading lock icon are shared — the amount and\n * any trailing status live in `children`, since they genuinely differ per card\n * (placeholder fallback vs. paid badge vs. bare amount).\n */\nconst PriceLockRow: React.FC<React.PropsWithChildren> = ({ children }) => (\n <div className=\"flex items-center gap-1 text-xs font-medium\">\n <LockSimpleIcon\n className=\"size-3.5 shrink-0 opacity-55\"\n weight=\"fill\"\n aria-hidden\n />\n {children}\n </div>\n)\n\nexport default PriceLockRow\n","import classNames from 'classnames'\nimport React from 'react'\n\nconst TextShell: React.FC<React.PropsWithChildren<{ className?: string }>> = ({\n children,\n className,\n}) => (\n <div\n className={classNames(\n 'str-chat__message-bubble message-locked-attachment-text',\n 'px-4 py-3 flex flex-col gap-1',\n className\n )}\n >\n {children}\n </div>\n)\n\nexport default TextShell\n"],"names":["PriceLockRow","children","jsxs","jsx","LockSimpleIcon","TextShell","className","classNames"],"mappings":"6GASMA,EAAkD,CAAC,CAAE,SAAAC,KACzDC,EAAAA,KAAC,MAAA,CAAI,UAAU,8CACb,SAAA,CAAAC,EAAAA,IAACC,EAAAA,eAAA,CACC,UAAU,+BACV,OAAO,OACP,cAAW,EAAA,CAAA,EAEZH,CAAA,CAAA,CACH,ECdII,EAAuE,CAAC,CAC5E,SAAAJ,EACA,UAAAK,CACF,IACEH,EAAAA,IAAC,MAAA,CACC,UAAWI,EACT,0DACA,gCACAD,CAAA,EAGD,SAAAL,CAAA,CACH"}
|