@mastra/playground-ui 66.0.0-alpha.6 → 66.0.0-alpha.7
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/AttachmentCard-CciBqu7E.cjs +66 -0
- package/dist/AttachmentCard-CciBqu7E.cjs.map +1 -0
- package/dist/AttachmentCard-DbGp7TYl.js +61 -0
- package/dist/AttachmentCard-DbGp7TYl.js.map +1 -0
- package/dist/components/AttachmentCard.cjs.js +1 -1
- package/dist/components/AttachmentCard.es.js +1 -1
- package/dist/domains/chat/attachments/message-attachment.cjs.js +1 -1
- package/dist/domains/chat/attachments/message-attachment.es.js +1 -1
- package/dist/domains/chat/attachments/message-image-attachment.cjs.js +1 -1
- package/dist/domains/chat/attachments/message-image-attachment.es.js +1 -1
- package/dist/style.css +0 -99
- package/package.json +8 -8
- package/dist/AttachmentCard-B1fhYov_.cjs +0 -81
- package/dist/AttachmentCard-B1fhYov_.cjs.map +0 -1
- package/dist/AttachmentCard-lKP83CZ-.js +0 -76
- package/dist/AttachmentCard-lKP83CZ-.js.map +0 -1
- package/dist/src/ds/components/AttachmentCard/attachment-preview.d.ts +0 -5
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const require_utils = require("./utils-uDc1ofX1.cjs");
|
|
2
|
+
const require_Txt = require("./Txt-BnoSqxKE.cjs");
|
|
3
|
+
const require_primitives_message_surface = require("./primitives/message-surface.cjs.js");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
// src/ds/components/AttachmentCard/attachment-card.tsx
|
|
6
|
+
/** Sent-file presentation. Upload state and removal controls belong to the composer. */
|
|
7
|
+
function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }) {
|
|
8
|
+
const className = require_utils.cn(require_primitives_message_surface.messageSurfaceStyle, "relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left", (onClick || href) && "cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors");
|
|
9
|
+
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10
|
+
className: "block h-44 overflow-hidden border-b border-border bg-fill",
|
|
11
|
+
children: preview
|
|
12
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
13
|
+
className: "flex min-w-0 items-center gap-2.5 px-3 py-2.5",
|
|
14
|
+
children: [!preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
15
|
+
className: "flex size-5 shrink-0 items-center justify-center text-muted-foreground",
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
children: icon
|
|
18
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
19
|
+
className: "min-w-0 flex-1",
|
|
20
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
|
|
21
|
+
as: "span",
|
|
22
|
+
variant: "body-sm",
|
|
23
|
+
className: "block truncate",
|
|
24
|
+
title: name,
|
|
25
|
+
children: name
|
|
26
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
|
|
27
|
+
as: "span",
|
|
28
|
+
variant: "meta",
|
|
29
|
+
tone: "muted",
|
|
30
|
+
className: "block truncate",
|
|
31
|
+
children: typeLabel
|
|
32
|
+
})]
|
|
33
|
+
})]
|
|
34
|
+
})] });
|
|
35
|
+
if (onClick) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
36
|
+
ref: buttonRef,
|
|
37
|
+
type: "button",
|
|
38
|
+
className,
|
|
39
|
+
onClick,
|
|
40
|
+
"aria-label": `Preview ${name}`,
|
|
41
|
+
title: name,
|
|
42
|
+
children: content
|
|
43
|
+
});
|
|
44
|
+
if (href) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
45
|
+
className,
|
|
46
|
+
href,
|
|
47
|
+
target: "_blank",
|
|
48
|
+
rel: "noreferrer noopener",
|
|
49
|
+
"aria-label": `Open ${name}`,
|
|
50
|
+
title: name,
|
|
51
|
+
children: content
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
54
|
+
className,
|
|
55
|
+
title: name,
|
|
56
|
+
children: content
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
Object.defineProperty(exports, "AttachmentCard", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function() {
|
|
62
|
+
return AttachmentCard;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=AttachmentCard-CciBqu7E.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentCard-CciBqu7E.cjs","names":["cn","messageSurfaceStyle","_Fragment","Txt"],"sources":["../src/ds/components/AttachmentCard/attachment-card.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport { Txt } from '../Txt';\nimport { messageSurfaceStyle } from '@/ds/primitives/message-surface';\nimport { cn } from '@/lib/utils';\n\nexport interface AttachmentCardProps {\n name: string;\n buttonRef?: Ref<HTMLButtonElement>;\n typeLabel: string;\n icon: ReactNode;\n preview?: ReactNode;\n onClick?: () => void;\n href?: string;\n}\n\n/** Sent-file presentation. Upload state and removal controls belong to the composer. */\nexport function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }: AttachmentCardProps) {\n const className = cn(\n messageSurfaceStyle,\n 'relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left',\n (onClick || href) &&\n 'cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors',\n );\n const content = (\n <>\n {preview && <span className=\"block h-44 overflow-hidden border-b border-border bg-fill\">{preview}</span>}\n <span className=\"flex min-w-0 items-center gap-2.5 px-3 py-2.5\">\n {!preview && (\n <span className=\"flex size-5 shrink-0 items-center justify-center text-muted-foreground\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <Txt as=\"span\" variant=\"body-sm\" className=\"block truncate\" title={name}>\n {name}\n </Txt>\n <Txt as=\"span\" variant=\"meta\" tone=\"muted\" className=\"block truncate\">\n {typeLabel}\n </Txt>\n </span>\n </span>\n </>\n );\n\n if (onClick) {\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className={className}\n onClick={onClick}\n aria-label={`Preview ${name}`}\n title={name}\n >\n {content}\n </button>\n );\n }\n if (href) {\n return (\n <a\n className={className}\n href={href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n aria-label={`Open ${name}`}\n title={name}\n >\n {content}\n </a>\n );\n }\n return (\n <div className={className} title={name}>\n {content}\n </div>\n );\n}\n"],"mappings":";;;;;;AAgBA,SAAgB,eAAe,EAAE,MAAM,WAAW,MAAM,SAAS,SAAS,MAAM,aAAkC;CAChH,MAAM,YAAYA,cAAAA,GAChBC,mCAAAA,qBACA,6EACC,WAAW,SACV,4JACJ;CACA,MAAM,UACJ,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAU;EAA6D,UAAA;CAAc,CAAA,GACvG,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACG,CAAC,WACA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAU;GAAyE,eAAY;GAClG,UAAA;EACG,CAAA,GAER,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAU,WAAU;IAAiB,OAAO;IAChE,UAAA;GACE,CAAA,GACL,iBAAA,GAAA,kBAAA,IAAA,CAACA,YAAAA,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAO,MAAK;IAAQ,WAAU;IAClD,UAAA;GACE,CAAA,CACD;EACF,CAAA,CAAA;CACN,CAAA,CAAA,EAAA,CAAA;CAGJ,IAAI,SACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,KAAK;EACL,MAAK;EACM;EACF;EACT,cAAY,WAAW;EACvB,OAAO;EAEN,UAAA;CACK,CAAA;CAGZ,IAAI,MACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACa;EACL;EACN,QAAO;EACP,KAAI;EACJ,cAAY,QAAQ;EACpB,OAAO;EAEN,UAAA;CACA,CAAA;CAGP,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAgB;EAAW,OAAO;EAC/B,UAAA;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as cn } from "./utils-DQx8TpNT.js";
|
|
2
|
+
import { t as Txt } from "./Txt-BM6TVV_c.js";
|
|
3
|
+
import { messageSurfaceStyle } from "./primitives/message-surface.es.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/ds/components/AttachmentCard/attachment-card.tsx
|
|
6
|
+
/** Sent-file presentation. Upload state and removal controls belong to the composer. */
|
|
7
|
+
function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }) {
|
|
8
|
+
const className = cn(messageSurfaceStyle, "relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left", (onClick || href) && "cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors");
|
|
9
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [preview && /* @__PURE__ */ jsx("span", {
|
|
10
|
+
className: "block h-44 overflow-hidden border-b border-border bg-fill",
|
|
11
|
+
children: preview
|
|
12
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
13
|
+
className: "flex min-w-0 items-center gap-2.5 px-3 py-2.5",
|
|
14
|
+
children: [!preview && /* @__PURE__ */ jsx("span", {
|
|
15
|
+
className: "flex size-5 shrink-0 items-center justify-center text-muted-foreground",
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
children: icon
|
|
18
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
19
|
+
className: "min-w-0 flex-1",
|
|
20
|
+
children: [/* @__PURE__ */ jsx(Txt, {
|
|
21
|
+
as: "span",
|
|
22
|
+
variant: "body-sm",
|
|
23
|
+
className: "block truncate",
|
|
24
|
+
title: name,
|
|
25
|
+
children: name
|
|
26
|
+
}), /* @__PURE__ */ jsx(Txt, {
|
|
27
|
+
as: "span",
|
|
28
|
+
variant: "meta",
|
|
29
|
+
tone: "muted",
|
|
30
|
+
className: "block truncate",
|
|
31
|
+
children: typeLabel
|
|
32
|
+
})]
|
|
33
|
+
})]
|
|
34
|
+
})] });
|
|
35
|
+
if (onClick) return /* @__PURE__ */ jsx("button", {
|
|
36
|
+
ref: buttonRef,
|
|
37
|
+
type: "button",
|
|
38
|
+
className,
|
|
39
|
+
onClick,
|
|
40
|
+
"aria-label": `Preview ${name}`,
|
|
41
|
+
title: name,
|
|
42
|
+
children: content
|
|
43
|
+
});
|
|
44
|
+
if (href) return /* @__PURE__ */ jsx("a", {
|
|
45
|
+
className,
|
|
46
|
+
href,
|
|
47
|
+
target: "_blank",
|
|
48
|
+
rel: "noreferrer noopener",
|
|
49
|
+
"aria-label": `Open ${name}`,
|
|
50
|
+
title: name,
|
|
51
|
+
children: content
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
className,
|
|
55
|
+
title: name,
|
|
56
|
+
children: content
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export { AttachmentCard as t };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=AttachmentCard-DbGp7TYl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentCard-DbGp7TYl.js","names":["_Fragment"],"sources":["../src/ds/components/AttachmentCard/attachment-card.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport { Txt } from '../Txt';\nimport { messageSurfaceStyle } from '@/ds/primitives/message-surface';\nimport { cn } from '@/lib/utils';\n\nexport interface AttachmentCardProps {\n name: string;\n buttonRef?: Ref<HTMLButtonElement>;\n typeLabel: string;\n icon: ReactNode;\n preview?: ReactNode;\n onClick?: () => void;\n href?: string;\n}\n\n/** Sent-file presentation. Upload state and removal controls belong to the composer. */\nexport function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }: AttachmentCardProps) {\n const className = cn(\n messageSurfaceStyle,\n 'relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left',\n (onClick || href) &&\n 'cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors',\n );\n const content = (\n <>\n {preview && <span className=\"block h-44 overflow-hidden border-b border-border bg-fill\">{preview}</span>}\n <span className=\"flex min-w-0 items-center gap-2.5 px-3 py-2.5\">\n {!preview && (\n <span className=\"flex size-5 shrink-0 items-center justify-center text-muted-foreground\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <Txt as=\"span\" variant=\"body-sm\" className=\"block truncate\" title={name}>\n {name}\n </Txt>\n <Txt as=\"span\" variant=\"meta\" tone=\"muted\" className=\"block truncate\">\n {typeLabel}\n </Txt>\n </span>\n </span>\n </>\n );\n\n if (onClick) {\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className={className}\n onClick={onClick}\n aria-label={`Preview ${name}`}\n title={name}\n >\n {content}\n </button>\n );\n }\n if (href) {\n return (\n <a\n className={className}\n href={href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n aria-label={`Open ${name}`}\n title={name}\n >\n {content}\n </a>\n );\n }\n return (\n <div className={className} title={name}>\n {content}\n </div>\n );\n}\n"],"mappings":";;;;;;AAgBA,SAAgB,eAAe,EAAE,MAAM,WAAW,MAAM,SAAS,SAAS,MAAM,aAAkC;CAChH,MAAM,YAAY,GAChB,qBACA,6EACC,WAAW,SACV,4JACJ;CACA,MAAM,UACJ,qBAAAA,UAAA,EAAA,UAAA,CACG,WAAW,oBAAC,QAAD;EAAM,WAAU;EAA6D,UAAA;CAAc,CAAA,GACvG,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACG,CAAC,WACA,oBAAC,QAAD;GAAM,WAAU;GAAyE,eAAY;GAClG,UAAA;EACG,CAAA,GAER,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,oBAAC,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAU,WAAU;IAAiB,OAAO;IAChE,UAAA;GACE,CAAA,GACL,oBAAC,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAO,MAAK;IAAQ,WAAU;IAClD,UAAA;GACE,CAAA,CACD;EACF,CAAA,CAAA;CACN,CAAA,CAAA,EAAA,CAAA;CAGJ,IAAI,SACF,OACE,oBAAC,UAAD;EACE,KAAK;EACL,MAAK;EACM;EACF;EACT,cAAY,WAAW;EACvB,OAAO;EAEN,UAAA;CACK,CAAA;CAGZ,IAAI,MACF,OACE,oBAAC,KAAD;EACa;EACL;EACN,QAAO;EACP,KAAI;EACJ,cAAY,QAAQ;EACpB,OAAO;EAEN,UAAA;CACA,CAAA;CAGP,OACE,oBAAC,OAAD;EAAgB;EAAW,OAAO;EAC/B,UAAA;CACE,CAAA;AAET"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_AttachmentCard = require("../AttachmentCard-
|
|
2
|
+
const require_AttachmentCard = require("../AttachmentCard-CciBqu7E.cjs");
|
|
3
3
|
exports.AttachmentCard = require_AttachmentCard.AttachmentCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as AttachmentCard } from "../AttachmentCard-
|
|
1
|
+
export { t as AttachmentCard } from "../AttachmentCard-DbGp7TYl.js";
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_schemes = require("../../../schemes-CW9-2h2z.cjs");
|
|
3
3
|
const require_domains_chat_attachments_attachment_preview_dialog = require("./attachment-preview-dialog.cjs.js");
|
|
4
4
|
const require_domains_chat_attachments_message_attachment_info = require("./message-attachment-info.cjs.js");
|
|
5
|
-
const require_AttachmentCard = require("../../../AttachmentCard-
|
|
5
|
+
const require_AttachmentCard = require("../../../AttachmentCard-CciBqu7E.cjs");
|
|
6
6
|
const require_domains_chat_attachments_message_image_attachment = require("./message-image-attachment.cjs.js");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as isBrowserFetchableUrl } from "../../../schemes-DXZtPeV_.js";
|
|
2
2
|
import { PdfPreviewDialog, TxtPreviewDialog } from "./attachment-preview-dialog.es.js";
|
|
3
3
|
import { attachmentInfo, attachmentName, textAttachment } from "./message-attachment-info.es.js";
|
|
4
|
-
import { t as AttachmentCard } from "../../../AttachmentCard-
|
|
4
|
+
import { t as AttachmentCard } from "../../../AttachmentCard-DbGp7TYl.js";
|
|
5
5
|
import { MessageImageAttachment } from "./message-image-attachment.es.js";
|
|
6
6
|
import { useRef, useState } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_domains_chat_attachments_attachment_preview_dialog = require("./attachment-preview-dialog.cjs.js");
|
|
3
|
-
const require_AttachmentCard = require("../../../AttachmentCard-
|
|
3
|
+
const require_AttachmentCard = require("../../../AttachmentCard-CciBqu7E.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let lucide_react = require("lucide-react");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImagePreviewDialog } from "./attachment-preview-dialog.es.js";
|
|
2
|
-
import { t as AttachmentCard } from "../../../AttachmentCard-
|
|
2
|
+
import { t as AttachmentCard } from "../../../AttachmentCard-DbGp7TYl.js";
|
|
3
3
|
import { useRef, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { FileImage } from "lucide-react";
|
package/dist/style.css
CHANGED
|
@@ -180,7 +180,6 @@
|
|
|
180
180
|
--blur-xs: 4px;
|
|
181
181
|
--blur-sm: 8px;
|
|
182
182
|
--blur-md: 12px;
|
|
183
|
-
--blur-lg: 16px;
|
|
184
183
|
--blur-xl: 24px;
|
|
185
184
|
--default-transition-duration: .15s;
|
|
186
185
|
--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
@@ -2276,10 +2275,6 @@
|
|
|
2276
2275
|
height: calc(var(--spacing) * 25);
|
|
2277
2276
|
}
|
|
2278
2277
|
|
|
2279
|
-
.h-28 {
|
|
2280
|
-
height: calc(var(--spacing) * 28);
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
2278
|
.h-32 {
|
|
2284
2279
|
height: calc(var(--spacing) * 32);
|
|
2285
2280
|
}
|
|
@@ -5865,18 +5860,6 @@
|
|
|
5865
5860
|
mask-composite: intersect;
|
|
5866
5861
|
}
|
|
5867
5862
|
|
|
5868
|
-
.mask-b-from-45\% {
|
|
5869
|
-
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5870
|
-
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5871
|
-
mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5872
|
-
--tw-mask-linear: var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top);
|
|
5873
|
-
--tw-mask-bottom: linear-gradient(to bottom, var(--tw-mask-bottom-from-color) var(--tw-mask-bottom-from-position), var(--tw-mask-bottom-to-color) var(--tw-mask-bottom-to-position));
|
|
5874
|
-
--tw-mask-bottom-from-position: 45%;
|
|
5875
|
-
-webkit-mask-composite: source-in;
|
|
5876
|
-
-webkit-mask-composite: source-in;
|
|
5877
|
-
mask-composite: intersect;
|
|
5878
|
-
}
|
|
5879
|
-
|
|
5880
5863
|
.mask-b-from-50\% {
|
|
5881
5864
|
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5882
5865
|
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
@@ -5925,18 +5908,6 @@
|
|
|
5925
5908
|
mask-composite: intersect;
|
|
5926
5909
|
}
|
|
5927
5910
|
|
|
5928
|
-
.mask-b-to-95\% {
|
|
5929
|
-
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5930
|
-
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5931
|
-
mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5932
|
-
--tw-mask-linear: var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top);
|
|
5933
|
-
--tw-mask-bottom: linear-gradient(to bottom, var(--tw-mask-bottom-from-color) var(--tw-mask-bottom-from-position), var(--tw-mask-bottom-to-color) var(--tw-mask-bottom-to-position));
|
|
5934
|
-
--tw-mask-bottom-to-position: 95%;
|
|
5935
|
-
-webkit-mask-composite: source-in;
|
|
5936
|
-
-webkit-mask-composite: source-in;
|
|
5937
|
-
mask-composite: intersect;
|
|
5938
|
-
}
|
|
5939
|
-
|
|
5940
5911
|
.mask-b-to-100 {
|
|
5941
5912
|
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
5942
5913
|
-webkit-mask-image: var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic);
|
|
@@ -5990,31 +5961,6 @@
|
|
|
5990
5961
|
mask-image: linear-gradient(#000, #000), linear-gradient(#000 40%, #0000), linear-gradient(to top, #000 40%, #0000);
|
|
5991
5962
|
}
|
|
5992
5963
|
|
|
5993
|
-
.\[mask-image\:linear-gradient\(to_bottom\,transparent\,black_15\%\,black_30\%\,transparent_45\%\)\] {
|
|
5994
|
-
-webkit-mask-image: linear-gradient(#0000, #000 15% 30%, #0000 45%);
|
|
5995
|
-
mask-image: linear-gradient(#0000, #000 15% 30%, #0000 45%);
|
|
5996
|
-
}
|
|
5997
|
-
|
|
5998
|
-
.\[mask-image\:linear-gradient\(to_bottom\,transparent_15\%\,black_30\%\,black_45\%\,transparent_60\%\)\] {
|
|
5999
|
-
-webkit-mask-image: linear-gradient(#0000 15%, #000 30% 45%, #0000 60%);
|
|
6000
|
-
mask-image: linear-gradient(#0000 15%, #000 30% 45%, #0000 60%);
|
|
6001
|
-
}
|
|
6002
|
-
|
|
6003
|
-
.\[mask-image\:linear-gradient\(to_bottom\,transparent_30\%\,black_45\%\,black_60\%\,transparent_75\%\)\] {
|
|
6004
|
-
-webkit-mask-image: linear-gradient(#0000 30%, #000 45% 60%, #0000 75%);
|
|
6005
|
-
mask-image: linear-gradient(#0000 30%, #000 45% 60%, #0000 75%);
|
|
6006
|
-
}
|
|
6007
|
-
|
|
6008
|
-
.\[mask-image\:linear-gradient\(to_bottom\,transparent_45\%\,black_60\%\,black_75\%\,transparent_90\%\)\] {
|
|
6009
|
-
-webkit-mask-image: linear-gradient(#0000 45%, #000 60% 75%, #0000 90%);
|
|
6010
|
-
mask-image: linear-gradient(#0000 45%, #000 60% 75%, #0000 90%);
|
|
6011
|
-
}
|
|
6012
|
-
|
|
6013
|
-
.\[mask-image\:linear-gradient\(to_bottom\,transparent_60\%\,black_75\%\)\] {
|
|
6014
|
-
-webkit-mask-image: linear-gradient(#0000 60%, #000 75%);
|
|
6015
|
-
mask-image: linear-gradient(#0000 60%, #000 75%);
|
|
6016
|
-
}
|
|
6017
|
-
|
|
6018
5964
|
.box-decoration-clone {
|
|
6019
5965
|
-webkit-box-decoration-break: clone;
|
|
6020
5966
|
box-decoration-break: clone;
|
|
@@ -7563,24 +7509,6 @@
|
|
|
7563
7509
|
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
|
|
7564
7510
|
}
|
|
7565
7511
|
|
|
7566
|
-
.backdrop-blur-\[2px\] {
|
|
7567
|
-
--tw-backdrop-blur: blur(2px);
|
|
7568
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
7569
|
-
backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
7570
|
-
}
|
|
7571
|
-
|
|
7572
|
-
.backdrop-blur-\[32px\] {
|
|
7573
|
-
--tw-backdrop-blur: blur(32px);
|
|
7574
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
7575
|
-
backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
7576
|
-
}
|
|
7577
|
-
|
|
7578
|
-
.backdrop-blur-lg {
|
|
7579
|
-
--tw-backdrop-blur: blur(var(--blur-lg));
|
|
7580
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
7581
|
-
backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
7582
|
-
}
|
|
7583
|
-
|
|
7584
7512
|
.backdrop-blur-md {
|
|
7585
7513
|
--tw-backdrop-blur: blur(var(--blur-md));
|
|
7586
7514
|
-webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
@@ -9355,11 +9283,6 @@
|
|
|
9355
9283
|
z-index: calc(20 * -1);
|
|
9356
9284
|
}
|
|
9357
9285
|
|
|
9358
|
-
.after\:z-10:after {
|
|
9359
|
-
content: var(--tw-content);
|
|
9360
|
-
z-index: 10;
|
|
9361
|
-
}
|
|
9362
|
-
|
|
9363
9286
|
.after\:h-1:after {
|
|
9364
9287
|
content: var(--tw-content);
|
|
9365
9288
|
height: var(--spacing);
|
|
@@ -9381,11 +9304,6 @@
|
|
|
9381
9304
|
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
9382
9305
|
}
|
|
9383
9306
|
|
|
9384
|
-
.after\:rounded-\[inherit\]:after {
|
|
9385
|
-
content: var(--tw-content);
|
|
9386
|
-
border-radius: inherit;
|
|
9387
|
-
}
|
|
9388
|
-
|
|
9389
9307
|
.after\:rounded-full:after {
|
|
9390
9308
|
content: var(--tw-content);
|
|
9391
9309
|
border-radius: 3.40282e38px;
|
|
@@ -9494,28 +9412,11 @@
|
|
|
9494
9412
|
mask-image: linear-gradient(to right, #0000, #000 6px calc(100% - 6px), #0000);
|
|
9495
9413
|
}
|
|
9496
9414
|
|
|
9497
|
-
.after\:inset-ring-1:after {
|
|
9498
|
-
content: var(--tw-content);
|
|
9499
|
-
--tw-inset-ring-shadow: inset 0 0 0 1px var(--tw-inset-ring-color, currentcolor);
|
|
9500
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
9501
|
-
}
|
|
9502
|
-
|
|
9503
9415
|
.after\:shadow-inset:after {
|
|
9504
9416
|
content: var(--tw-content);
|
|
9505
9417
|
box-shadow: inset 0 1px 0 var(--inset-highlight), inset 0 0 0 1px var(--inset-rim);
|
|
9506
9418
|
}
|
|
9507
9419
|
|
|
9508
|
-
.after\:inset-ring-white\/15:after {
|
|
9509
|
-
content: var(--tw-content);
|
|
9510
|
-
--tw-inset-ring-color: #ffffff26;
|
|
9511
|
-
}
|
|
9512
|
-
|
|
9513
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
9514
|
-
.after\:inset-ring-white\/15:after {
|
|
9515
|
-
--tw-inset-ring-color: color-mix(in oklab, var(--color-white) 15%, transparent);
|
|
9516
|
-
}
|
|
9517
|
-
}
|
|
9518
|
-
|
|
9519
9420
|
.after\:transition-\[background-color\]:after {
|
|
9520
9421
|
content: var(--tw-content);
|
|
9521
9422
|
transition-property: background-color;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.0.0-alpha.
|
|
4
|
+
"version": "66.0.0-alpha.7",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css"
|
|
@@ -220,8 +220,8 @@
|
|
|
220
220
|
"react-dom": ">=19.0.0",
|
|
221
221
|
"tailwindcss": "^4.0.0",
|
|
222
222
|
"@mastra/ai-sdk": "^1.11.2",
|
|
223
|
-
"@mastra/react": "1.13.0-alpha.
|
|
224
|
-
"@mastra/client-js": "^1.57.0-alpha.
|
|
223
|
+
"@mastra/react": "1.13.0-alpha.7",
|
|
224
|
+
"@mastra/client-js": "^1.57.0-alpha.7"
|
|
225
225
|
},
|
|
226
226
|
"devDependencies": {
|
|
227
227
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
@@ -262,12 +262,12 @@
|
|
|
262
262
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
263
263
|
"vitest": "4.1.12",
|
|
264
264
|
"@internal/lint": "0.0.145",
|
|
265
|
-
"@mastra/
|
|
265
|
+
"@mastra/client-js": "^1.57.0-alpha.7",
|
|
266
|
+
"@mastra/core": "1.80.0-alpha.7",
|
|
266
267
|
"@mastra/memory": "1.39.1-alpha.3",
|
|
267
|
-
"@mastra/
|
|
268
|
-
"@mastra/
|
|
269
|
-
"@mastra/
|
|
270
|
-
"@mastra/schema-compat": "1.3.17-alpha.0"
|
|
268
|
+
"@mastra/ai-sdk": "1.11.2",
|
|
269
|
+
"@mastra/schema-compat": "1.3.17-alpha.0",
|
|
270
|
+
"@mastra/react": "1.13.0-alpha.7"
|
|
271
271
|
},
|
|
272
272
|
"homepage": "https://mastra.ai",
|
|
273
273
|
"repository": {
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const require_utils = require("./utils-uDc1ofX1.cjs");
|
|
2
|
-
const require_Txt = require("./Txt-BnoSqxKE.cjs");
|
|
3
|
-
const require_primitives_message_surface = require("./primitives/message-surface.cjs.js");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
// src/ds/components/AttachmentCard/attachment-preview.tsx
|
|
6
|
-
/** Crossfade between fully blurred bands, then fade the image into the message surface for its caption. */
|
|
7
|
-
function AttachmentPreview({ children }) {
|
|
8
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
9
|
-
className: "relative block h-44 mask-b-from-45% mask-b-to-95%",
|
|
10
|
-
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11
|
-
"aria-hidden": "true",
|
|
12
|
-
className: "pointer-events-none absolute inset-x-0 bottom-0 h-28",
|
|
13
|
-
children: [
|
|
14
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent,black_15%,black_30%,transparent_45%)] backdrop-blur-[2px]" }),
|
|
15
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_15%,black_30%,black_45%,transparent_60%)] backdrop-blur-xs" }),
|
|
16
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_30%,black_45%,black_60%,transparent_75%)] backdrop-blur-sm" }),
|
|
17
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_45%,black_60%,black_75%,transparent_90%)] backdrop-blur-lg" }),
|
|
18
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_60%,black_75%)] backdrop-blur-[32px]" })
|
|
19
|
-
]
|
|
20
|
-
})]
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
// src/ds/components/AttachmentCard/attachment-card.tsx
|
|
24
|
-
/** Sent-file presentation. Upload state and removal controls belong to the composer. */
|
|
25
|
-
function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }) {
|
|
26
|
-
const className = require_utils.cn(require_primitives_message_surface.messageSurfaceStyle, "relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left", preview && "after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:inset-ring-1 after:inset-ring-white/15", (onClick || href) && "cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors");
|
|
27
|
-
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttachmentPreview, { children: preview }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
28
|
-
className: require_utils.cn("flex min-w-0 items-center gap-2.5 px-3 py-2.5", preview && "absolute inset-x-0 bottom-0"),
|
|
29
|
-
children: [!preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
30
|
-
className: "flex size-5 shrink-0 items-center justify-center text-muted-foreground",
|
|
31
|
-
"aria-hidden": "true",
|
|
32
|
-
children: icon
|
|
33
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
34
|
-
className: "min-w-0 flex-1",
|
|
35
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
|
|
36
|
-
as: "span",
|
|
37
|
-
variant: "body-sm",
|
|
38
|
-
className: "block truncate",
|
|
39
|
-
title: name,
|
|
40
|
-
children: name
|
|
41
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Txt.Txt, {
|
|
42
|
-
as: "span",
|
|
43
|
-
variant: "meta",
|
|
44
|
-
tone: "muted",
|
|
45
|
-
className: "block truncate",
|
|
46
|
-
children: typeLabel
|
|
47
|
-
})]
|
|
48
|
-
})]
|
|
49
|
-
})] });
|
|
50
|
-
if (onClick) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
51
|
-
ref: buttonRef,
|
|
52
|
-
type: "button",
|
|
53
|
-
className,
|
|
54
|
-
onClick,
|
|
55
|
-
"aria-label": `Preview ${name}`,
|
|
56
|
-
title: name,
|
|
57
|
-
children: content
|
|
58
|
-
});
|
|
59
|
-
if (href) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
60
|
-
className,
|
|
61
|
-
href,
|
|
62
|
-
target: "_blank",
|
|
63
|
-
rel: "noreferrer noopener",
|
|
64
|
-
"aria-label": `Open ${name}`,
|
|
65
|
-
title: name,
|
|
66
|
-
children: content
|
|
67
|
-
});
|
|
68
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
69
|
-
className,
|
|
70
|
-
title: name,
|
|
71
|
-
children: content
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
Object.defineProperty(exports, "AttachmentCard", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function() {
|
|
77
|
-
return AttachmentCard;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
//# sourceMappingURL=AttachmentCard-B1fhYov_.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentCard-B1fhYov_.cjs","names":["cn","messageSurfaceStyle","_Fragment","Txt"],"sources":["../src/ds/components/AttachmentCard/attachment-preview.tsx","../src/ds/components/AttachmentCard/attachment-card.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/** Crossfade between fully blurred bands, then fade the image into the message surface for its caption. */\nexport function AttachmentPreview({ children }: { children: ReactNode }) {\n return (\n <span className=\"relative block h-44 mask-b-from-45% mask-b-to-95%\">\n {children}\n {/* Fully opaque, overlapping bands replace sharp pixels as the blur radius increases.\n Fading each layer across its entire height would leave sharp detail visible underneath. */}\n <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-x-0 bottom-0 h-28\">\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent,black_15%,black_30%,transparent_45%)] backdrop-blur-[2px]\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_15%,black_30%,black_45%,transparent_60%)] backdrop-blur-xs\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_30%,black_45%,black_60%,transparent_75%)] backdrop-blur-sm\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_45%,black_60%,black_75%,transparent_90%)] backdrop-blur-lg\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_60%,black_75%)] backdrop-blur-[32px]\" />\n </span>\n </span>\n );\n}\n","import type { ReactNode, Ref } from 'react';\nimport { Txt } from '../Txt';\nimport { AttachmentPreview } from './attachment-preview';\nimport { messageSurfaceStyle } from '@/ds/primitives/message-surface';\nimport { cn } from '@/lib/utils';\n\nexport interface AttachmentCardProps {\n name: string;\n buttonRef?: Ref<HTMLButtonElement>;\n typeLabel: string;\n icon: ReactNode;\n preview?: ReactNode;\n onClick?: () => void;\n href?: string;\n}\n\n/** Sent-file presentation. Upload state and removal controls belong to the composer. */\nexport function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }: AttachmentCardProps) {\n const className = cn(\n messageSurfaceStyle,\n 'relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left',\n preview &&\n 'after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:inset-ring-1 after:inset-ring-white/15',\n (onClick || href) &&\n 'cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors',\n );\n const content = (\n <>\n {preview && <AttachmentPreview>{preview}</AttachmentPreview>}\n <span className={cn('flex min-w-0 items-center gap-2.5 px-3 py-2.5', preview && 'absolute inset-x-0 bottom-0')}>\n {!preview && (\n <span className=\"flex size-5 shrink-0 items-center justify-center text-muted-foreground\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <Txt as=\"span\" variant=\"body-sm\" className=\"block truncate\" title={name}>\n {name}\n </Txt>\n <Txt as=\"span\" variant=\"meta\" tone=\"muted\" className=\"block truncate\">\n {typeLabel}\n </Txt>\n </span>\n </span>\n </>\n );\n\n if (onClick) {\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className={className}\n onClick={onClick}\n aria-label={`Preview ${name}`}\n title={name}\n >\n {content}\n </button>\n );\n }\n if (href) {\n return (\n <a\n className={className}\n href={href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n aria-label={`Open ${name}`}\n title={name}\n >\n {content}\n </a>\n );\n }\n return (\n <div className={className} title={name}>\n {content}\n </div>\n );\n}\n"],"mappings":";;;;;;AAGA,SAAgB,kBAAkB,EAAE,YAAqC;CACvE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACG,UAGD,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;GAAM,eAAY;GAAO,WAAU;GAAnC,UAAA;IACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAU,+HAAgI,CAAA;IAChJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAU,gIAAiI,CAAA;IACjJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAU,gIAAiI,CAAA;IACjJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAU,gIAAiI,CAAA;IACjJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAU,0GAA2G,CAAA;GACvH;EACF,CAAA,CAAA;;AAEV;;;ACDA,SAAgB,eAAe,EAAE,MAAM,WAAW,MAAM,SAAS,SAAS,MAAM,aAAkC;CAChH,MAAM,YAAYA,cAAAA,GAChBC,mCAAAA,qBACA,4EACA,WACE,2IACD,WAAW,SACV,4JACJ;CACA,MAAM,UACJ,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACG,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAD,EAAA,UAAoB,QAA2B,CAAA,GAC3D,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EAAM,WAAWF,cAAAA,GAAG,iDAAiD,WAAW,6BAA6B;EAA7G,UAAA,CACG,CAAC,WACA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAU;GAAyE,eAAY;GAClG,UAAA;EACG,CAAA,GAER,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,YAAAA,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAU,WAAU;IAAiB,OAAO;IAChE,UAAA;GACE,CAAA,GACL,iBAAA,GAAA,kBAAA,IAAA,CAACA,YAAAA,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAO,MAAK;IAAQ,WAAU;IAClD,UAAA;GACE,CAAA,CACD;EACF,CAAA,CAAA;CACN,CAAA,CAAA,EAAA,CAAA;CAGJ,IAAI,SACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,KAAK;EACL,MAAK;EACM;EACF;EACT,cAAY,WAAW;EACvB,OAAO;EAEN,UAAA;CACK,CAAA;CAGZ,IAAI,MACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACa;EACL;EACN,QAAO;EACP,KAAI;EACJ,cAAY,QAAQ;EACpB,OAAO;EAEN,UAAA;CACA,CAAA;CAGP,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAgB;EAAW,OAAO;EAC/B,UAAA;CACE,CAAA;AAET"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { t as cn } from "./utils-DQx8TpNT.js";
|
|
2
|
-
import { t as Txt } from "./Txt-BM6TVV_c.js";
|
|
3
|
-
import { messageSurfaceStyle } from "./primitives/message-surface.es.js";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
// src/ds/components/AttachmentCard/attachment-preview.tsx
|
|
6
|
-
/** Crossfade between fully blurred bands, then fade the image into the message surface for its caption. */
|
|
7
|
-
function AttachmentPreview({ children }) {
|
|
8
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
9
|
-
className: "relative block h-44 mask-b-from-45% mask-b-to-95%",
|
|
10
|
-
children: [children, /* @__PURE__ */ jsxs("span", {
|
|
11
|
-
"aria-hidden": "true",
|
|
12
|
-
className: "pointer-events-none absolute inset-x-0 bottom-0 h-28",
|
|
13
|
-
children: [
|
|
14
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent,black_15%,black_30%,transparent_45%)] backdrop-blur-[2px]" }),
|
|
15
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_15%,black_30%,black_45%,transparent_60%)] backdrop-blur-xs" }),
|
|
16
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_30%,black_45%,black_60%,transparent_75%)] backdrop-blur-sm" }),
|
|
17
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_45%,black_60%,black_75%,transparent_90%)] backdrop-blur-lg" }),
|
|
18
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_60%,black_75%)] backdrop-blur-[32px]" })
|
|
19
|
-
]
|
|
20
|
-
})]
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
// src/ds/components/AttachmentCard/attachment-card.tsx
|
|
24
|
-
/** Sent-file presentation. Upload state and removal controls belong to the composer. */
|
|
25
|
-
function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }) {
|
|
26
|
-
const className = cn(messageSurfaceStyle, "relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left", preview && "after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:inset-ring-1 after:inset-ring-white/15", (onClick || href) && "cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors");
|
|
27
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [preview && /* @__PURE__ */ jsx(AttachmentPreview, { children: preview }), /* @__PURE__ */ jsxs("span", {
|
|
28
|
-
className: cn("flex min-w-0 items-center gap-2.5 px-3 py-2.5", preview && "absolute inset-x-0 bottom-0"),
|
|
29
|
-
children: [!preview && /* @__PURE__ */ jsx("span", {
|
|
30
|
-
className: "flex size-5 shrink-0 items-center justify-center text-muted-foreground",
|
|
31
|
-
"aria-hidden": "true",
|
|
32
|
-
children: icon
|
|
33
|
-
}), /* @__PURE__ */ jsxs("span", {
|
|
34
|
-
className: "min-w-0 flex-1",
|
|
35
|
-
children: [/* @__PURE__ */ jsx(Txt, {
|
|
36
|
-
as: "span",
|
|
37
|
-
variant: "body-sm",
|
|
38
|
-
className: "block truncate",
|
|
39
|
-
title: name,
|
|
40
|
-
children: name
|
|
41
|
-
}), /* @__PURE__ */ jsx(Txt, {
|
|
42
|
-
as: "span",
|
|
43
|
-
variant: "meta",
|
|
44
|
-
tone: "muted",
|
|
45
|
-
className: "block truncate",
|
|
46
|
-
children: typeLabel
|
|
47
|
-
})]
|
|
48
|
-
})]
|
|
49
|
-
})] });
|
|
50
|
-
if (onClick) return /* @__PURE__ */ jsx("button", {
|
|
51
|
-
ref: buttonRef,
|
|
52
|
-
type: "button",
|
|
53
|
-
className,
|
|
54
|
-
onClick,
|
|
55
|
-
"aria-label": `Preview ${name}`,
|
|
56
|
-
title: name,
|
|
57
|
-
children: content
|
|
58
|
-
});
|
|
59
|
-
if (href) return /* @__PURE__ */ jsx("a", {
|
|
60
|
-
className,
|
|
61
|
-
href,
|
|
62
|
-
target: "_blank",
|
|
63
|
-
rel: "noreferrer noopener",
|
|
64
|
-
"aria-label": `Open ${name}`,
|
|
65
|
-
title: name,
|
|
66
|
-
children: content
|
|
67
|
-
});
|
|
68
|
-
return /* @__PURE__ */ jsx("div", {
|
|
69
|
-
className,
|
|
70
|
-
title: name,
|
|
71
|
-
children: content
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
export { AttachmentCard as t };
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=AttachmentCard-lKP83CZ-.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentCard-lKP83CZ-.js","names":["_Fragment"],"sources":["../src/ds/components/AttachmentCard/attachment-preview.tsx","../src/ds/components/AttachmentCard/attachment-card.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/** Crossfade between fully blurred bands, then fade the image into the message surface for its caption. */\nexport function AttachmentPreview({ children }: { children: ReactNode }) {\n return (\n <span className=\"relative block h-44 mask-b-from-45% mask-b-to-95%\">\n {children}\n {/* Fully opaque, overlapping bands replace sharp pixels as the blur radius increases.\n Fading each layer across its entire height would leave sharp detail visible underneath. */}\n <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-x-0 bottom-0 h-28\">\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent,black_15%,black_30%,transparent_45%)] backdrop-blur-[2px]\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_15%,black_30%,black_45%,transparent_60%)] backdrop-blur-xs\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_30%,black_45%,black_60%,transparent_75%)] backdrop-blur-sm\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_45%,black_60%,black_75%,transparent_90%)] backdrop-blur-lg\" />\n <span className=\"absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent_60%,black_75%)] backdrop-blur-[32px]\" />\n </span>\n </span>\n );\n}\n","import type { ReactNode, Ref } from 'react';\nimport { Txt } from '../Txt';\nimport { AttachmentPreview } from './attachment-preview';\nimport { messageSurfaceStyle } from '@/ds/primitives/message-surface';\nimport { cn } from '@/lib/utils';\n\nexport interface AttachmentCardProps {\n name: string;\n buttonRef?: Ref<HTMLButtonElement>;\n typeLabel: string;\n icon: ReactNode;\n preview?: ReactNode;\n onClick?: () => void;\n href?: string;\n}\n\n/** Sent-file presentation. Upload state and removal controls belong to the composer. */\nexport function AttachmentCard({ name, typeLabel, icon, preview, onClick, href, buttonRef }: AttachmentCardProps) {\n const className = cn(\n messageSurfaceStyle,\n 'relative isolate block w-64 max-w-full min-w-0 overflow-hidden text-left',\n preview &&\n 'after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:inset-ring-1 after:inset-ring-white/15',\n (onClick || href) &&\n 'cursor-pointer hover:bg-fill-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus motion-safe:transition-colors',\n );\n const content = (\n <>\n {preview && <AttachmentPreview>{preview}</AttachmentPreview>}\n <span className={cn('flex min-w-0 items-center gap-2.5 px-3 py-2.5', preview && 'absolute inset-x-0 bottom-0')}>\n {!preview && (\n <span className=\"flex size-5 shrink-0 items-center justify-center text-muted-foreground\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <Txt as=\"span\" variant=\"body-sm\" className=\"block truncate\" title={name}>\n {name}\n </Txt>\n <Txt as=\"span\" variant=\"meta\" tone=\"muted\" className=\"block truncate\">\n {typeLabel}\n </Txt>\n </span>\n </span>\n </>\n );\n\n if (onClick) {\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className={className}\n onClick={onClick}\n aria-label={`Preview ${name}`}\n title={name}\n >\n {content}\n </button>\n );\n }\n if (href) {\n return (\n <a\n className={className}\n href={href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n aria-label={`Open ${name}`}\n title={name}\n >\n {content}\n </a>\n );\n }\n return (\n <div className={className} title={name}>\n {content}\n </div>\n );\n}\n"],"mappings":";;;;;;AAGA,SAAgB,kBAAkB,EAAE,YAAqC;CACvE,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACG,UAGD,qBAAC,QAAD;GAAM,eAAY;GAAO,WAAU;GAAnC,UAAA;IACE,oBAAC,QAAD,EAAM,WAAU,+HAAgI,CAAA;IAChJ,oBAAC,QAAD,EAAM,WAAU,gIAAiI,CAAA;IACjJ,oBAAC,QAAD,EAAM,WAAU,gIAAiI,CAAA;IACjJ,oBAAC,QAAD,EAAM,WAAU,gIAAiI,CAAA;IACjJ,oBAAC,QAAD,EAAM,WAAU,0GAA2G,CAAA;GACvH;EACF,CAAA,CAAA;;AAEV;;;ACDA,SAAgB,eAAe,EAAE,MAAM,WAAW,MAAM,SAAS,SAAS,MAAM,aAAkC;CAChH,MAAM,YAAY,GAChB,qBACA,4EACA,WACE,2IACD,WAAW,SACV,4JACJ;CACA,MAAM,UACJ,qBAAAA,UAAA,EAAA,UAAA,CACG,WAAW,oBAAC,mBAAD,EAAA,UAAoB,QAA2B,CAAA,GAC3D,qBAAC,QAAD;EAAM,WAAW,GAAG,iDAAiD,WAAW,6BAA6B;EAA7G,UAAA,CACG,CAAC,WACA,oBAAC,QAAD;GAAM,WAAU;GAAyE,eAAY;GAClG,UAAA;EACG,CAAA,GAER,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,oBAAC,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAU,WAAU;IAAiB,OAAO;IAChE,UAAA;GACE,CAAA,GACL,oBAAC,KAAD;IAAK,IAAG;IAAO,SAAQ;IAAO,MAAK;IAAQ,WAAU;IAClD,UAAA;GACE,CAAA,CACD;EACF,CAAA,CAAA;CACN,CAAA,CAAA,EAAA,CAAA;CAGJ,IAAI,SACF,OACE,oBAAC,UAAD;EACE,KAAK;EACL,MAAK;EACM;EACF;EACT,cAAY,WAAW;EACvB,OAAO;EAEN,UAAA;CACK,CAAA;CAGZ,IAAI,MACF,OACE,oBAAC,KAAD;EACa;EACL;EACN,QAAO;EACP,KAAI;EACJ,cAAY,QAAQ;EACpB,OAAO;EAEN,UAAA;CACA,CAAA;CAGP,OACE,oBAAC,OAAD;EAAgB;EAAW,OAAO;EAC/B,UAAA;CACE,CAAA;AAET"}
|