@mastra/playground-ui 53.0.0-alpha.6 → 53.0.0-alpha.8
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/Comment.css +37 -0
- package/dist/arrival-DRX5Mxhd.cjs +22 -0
- package/dist/arrival-DRX5Mxhd.cjs.map +1 -0
- package/dist/arrival-Dp1nnVVK.js +19 -0
- package/dist/arrival-Dp1nnVVK.js.map +1 -0
- package/dist/components/Arrival.cjs.js +4 -16
- package/dist/components/Arrival.cjs.js.map +1 -1
- package/dist/components/Arrival.es.js +2 -19
- package/dist/components/Arrival.es.js.map +1 -1
- package/dist/components/Comment.cjs.js +210 -42
- package/dist/components/Comment.cjs.js.map +1 -1
- package/dist/components/Comment.es.js +208 -45
- package/dist/components/Comment.es.js.map +1 -1
- package/dist/components/ai/tool-call.cjs.js +2 -0
- package/dist/components/ai/tool-call.cjs.js.map +1 -1
- package/dist/components/ai/tool-call.es.js +2 -0
- package/dist/components/ai/tool-call.es.js.map +1 -1
- package/dist/domains/memory/components/observation-detail-view.cjs.js +1 -1
- package/dist/domains/memory/components/observation-detail-view.cjs.js.map +1 -1
- package/dist/domains/memory/components/observation-detail-view.es.js +2 -2
- package/dist/domains/memory/components/observation-detail-view.es.js.map +1 -1
- package/dist/domains/traces/components/no-traces-info.cjs.js +1 -1
- package/dist/domains/traces/components/no-traces-info.cjs.js.map +1 -1
- package/dist/domains/traces/components/no-traces-info.es.js +1 -1
- package/dist/domains/traces/components/no-traces-info.es.js.map +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-index.cjs.js +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-index.cjs.js.map +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-index.es.js +2 -2
- package/dist/ee/signals/components/trace-intelligence-entity-index.es.js.map +1 -1
- package/dist/src/ds/components/Comment/comment-arrival.d.ts +5 -0
- package/dist/src/ds/components/Comment/comment-context.d.ts +1 -1
- package/dist/src/ds/components/Comment/comment-editor.d.ts +14 -0
- package/dist/src/ds/components/Comment/comment-quote.d.ts +9 -0
- package/dist/src/ds/components/Comment/comment.d.ts +19 -8
- package/dist/src/ds/components/Comment/comment.stories.d.ts +7 -0
- package/dist/src/ds/components/Comment/index.d.ts +7 -2
- package/dist/src/ds/components/ai/tool-call/tool-call.d.ts +4 -2
- package/dist/style.css +68 -0
- package/package.json +7 -7
package/dist/Comment.css
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* A comment lands rising from the composer instead of fading in place, on the
|
|
2
|
+
* same two clocks as the chat composer: the ink settles early while the travel
|
|
3
|
+
* keeps a decelerating tail.
|
|
4
|
+
*
|
|
5
|
+
* `backwards`, not `both`: a settled transform would leave the row a containing
|
|
6
|
+
* block for the actions it hangs over its own top edge. */
|
|
7
|
+
.mastra-comment-arriving {
|
|
8
|
+
animation:
|
|
9
|
+
mastra-comment-rise 420ms cubic-bezier(0.16, 1, 0.3, 1) backwards,
|
|
10
|
+
mastra-comment-fade 200ms linear backwards;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes mastra-comment-rise {
|
|
14
|
+
from {
|
|
15
|
+
transform: translateY(0.75rem);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
to {
|
|
19
|
+
transform: translateY(0);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes mastra-comment-fade {
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
to {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (prefers-reduced-motion: reduce) {
|
|
34
|
+
.mastra-comment-arriving {
|
|
35
|
+
animation: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const useWatched = require('./use-watched-BixmYWp0.cjs');
|
|
6
|
+
const utils_cn = require('./cn-DCPcv4xv.cjs');
|
|
7
|
+
|
|
8
|
+
function ArrivalScope({ children }) {
|
|
9
|
+
const settled = React.useRef(false);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
settled.current = true;
|
|
12
|
+
}, []);
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useWatched.SettledContext, { value: settled, children });
|
|
14
|
+
}
|
|
15
|
+
function Arriving({ children, className }) {
|
|
16
|
+
const arriving = useWatched.useArriving();
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils_cn.cn(arriving, className), children: /* @__PURE__ */ jsxRuntime.jsx(ArrivalScope, { children }) });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.ArrivalScope = ArrivalScope;
|
|
21
|
+
exports.Arriving = Arriving;
|
|
22
|
+
//# sourceMappingURL=arrival-DRX5Mxhd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrival-DRX5Mxhd.cjs","sources":["../src/ds/components/Arrival/arrival.tsx"],"sourcesContent":["import { useEffect, useRef, type ReactNode } from 'react';\n\nimport { SettledContext, useArriving } from './use-watched';\nimport { cn } from '@/lib/utils';\n\n/**\n * Marks what the reader was handed. Whatever mounts with a scope is already there and\n * never animates; whatever mounts after it painted is the run happening in front of\n * them, and fades in.\n *\n * Scopes nest, and that is the whole rule: a transcript opens one for its history,\n * and every element that fades in opens one for its own subtree, so a row's contents\n * ride its entrance rather than playing a second one on top of it — while a detail\n * that fills in a beat later still gets its own.\n *\n * A ref, not state: this says when a child mounted, which is only ever read by a child\n * mounting. Holding it as state would re-render every scope and its subtree once each\n * after paint — a whole restored transcript rendered twice to tell it to sit still.\n */\nexport function ArrivalScope({ children }: { children: ReactNode }) {\n const settled = useRef(false);\n useEffect(() => {\n settled.current = true;\n }, []);\n\n return <SettledContext value={settled}>{children}</SettledContext>;\n}\n\n/** An element that fades in when it lands, and hosts a scope for whatever lands inside it later. */\nexport function Arriving({ children, className }: { children: ReactNode; className?: string }) {\n const arriving = useArriving();\n\n return (\n <div className={cn(arriving, className)}>\n <ArrivalScope>{children}</ArrivalScope>\n </div>\n );\n}\n"],"names":["useRef","useEffect","jsx","SettledContext","useArriving","cn"],"mappings":";;;;;;;AAmBO,SAAS,YAAA,CAAa,EAAE,QAAA,EAAS,EAA4B;AAClE,EAAA,MAAM,OAAA,GAAUA,aAAO,KAAK,CAAA;AAC5B,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAAA,EACpB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,uBAAOC,cAAA,CAACC,yBAAA,EAAA,EAAe,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS,CAAA;AACnD;AAGO,SAAS,QAAA,CAAS,EAAE,QAAA,EAAU,SAAA,EAAU,EAAgD;AAC7F,EAAA,MAAM,WAAWC,sBAAA,EAAY;AAE7B,EAAA,uBACEF,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAWG,WAAA,CAAG,QAAA,EAAU,SAAS,CAAA,EACpC,QAAA,kBAAAH,cAAA,CAAC,YAAA,EAAA,EAAc,QAAA,EAAS,CAAA,EAC1B,CAAA;AAEJ;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
import { S as SettledContext, u as useArriving } from './use-watched-CG9KoWl3.js';
|
|
4
|
+
import { c as cn } from './cn-B4oPhFx9.js';
|
|
5
|
+
|
|
6
|
+
function ArrivalScope({ children }) {
|
|
7
|
+
const settled = useRef(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
settled.current = true;
|
|
10
|
+
}, []);
|
|
11
|
+
return /* @__PURE__ */ jsx(SettledContext, { value: settled, children });
|
|
12
|
+
}
|
|
13
|
+
function Arriving({ children, className }) {
|
|
14
|
+
const arriving = useArriving();
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { className: cn(arriving, className), children: /* @__PURE__ */ jsx(ArrivalScope, { children }) });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { ArrivalScope as A, Arriving as a };
|
|
19
|
+
//# sourceMappingURL=arrival-Dp1nnVVK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrival-Dp1nnVVK.js","sources":["../src/ds/components/Arrival/arrival.tsx"],"sourcesContent":["import { useEffect, useRef, type ReactNode } from 'react';\n\nimport { SettledContext, useArriving } from './use-watched';\nimport { cn } from '@/lib/utils';\n\n/**\n * Marks what the reader was handed. Whatever mounts with a scope is already there and\n * never animates; whatever mounts after it painted is the run happening in front of\n * them, and fades in.\n *\n * Scopes nest, and that is the whole rule: a transcript opens one for its history,\n * and every element that fades in opens one for its own subtree, so a row's contents\n * ride its entrance rather than playing a second one on top of it — while a detail\n * that fills in a beat later still gets its own.\n *\n * A ref, not state: this says when a child mounted, which is only ever read by a child\n * mounting. Holding it as state would re-render every scope and its subtree once each\n * after paint — a whole restored transcript rendered twice to tell it to sit still.\n */\nexport function ArrivalScope({ children }: { children: ReactNode }) {\n const settled = useRef(false);\n useEffect(() => {\n settled.current = true;\n }, []);\n\n return <SettledContext value={settled}>{children}</SettledContext>;\n}\n\n/** An element that fades in when it lands, and hosts a scope for whatever lands inside it later. */\nexport function Arriving({ children, className }: { children: ReactNode; className?: string }) {\n const arriving = useArriving();\n\n return (\n <div className={cn(arriving, className)}>\n <ArrivalScope>{children}</ArrivalScope>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;AAmBO,SAAS,YAAA,CAAa,EAAE,QAAA,EAAS,EAA4B;AAClE,EAAA,MAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AAC5B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAAA,EACpB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,uBAAO,GAAA,CAAC,cAAA,EAAA,EAAe,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS,CAAA;AACnD;AAGO,SAAS,QAAA,CAAS,EAAE,QAAA,EAAU,SAAA,EAAU,EAAgD;AAC7F,EAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,QAAA,EAAU,SAAS,CAAA,EACpC,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAc,QAAA,EAAS,CAAA,EAC1B,CAAA;AAEJ;;;;"}
|
|
@@ -2,25 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const React = require('react');
|
|
5
|
+
const arrival = require('../arrival-DRX5Mxhd.cjs');
|
|
7
6
|
const useWatched = require('../use-watched-BixmYWp0.cjs');
|
|
8
|
-
const utils_cn = require('../cn-DCPcv4xv.cjs');
|
|
9
7
|
|
|
10
|
-
function ArrivalScope({ children }) {
|
|
11
|
-
const settled = React.useRef(false);
|
|
12
|
-
React.useEffect(() => {
|
|
13
|
-
settled.current = true;
|
|
14
|
-
}, []);
|
|
15
|
-
return /* @__PURE__ */ jsxRuntime.jsx(useWatched.SettledContext, { value: settled, children });
|
|
16
|
-
}
|
|
17
|
-
function Arriving({ children, className }) {
|
|
18
|
-
const arriving = useWatched.useArriving();
|
|
19
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils_cn.cn(arriving, className), children: /* @__PURE__ */ jsxRuntime.jsx(ArrivalScope, { children }) });
|
|
20
|
-
}
|
|
21
8
|
|
|
9
|
+
|
|
10
|
+
exports.ArrivalScope = arrival.ArrivalScope;
|
|
11
|
+
exports.Arriving = arrival.Arriving;
|
|
22
12
|
exports.useArriving = useWatched.useArriving;
|
|
23
13
|
exports.useWatched = useWatched.useWatched;
|
|
24
|
-
exports.ArrivalScope = ArrivalScope;
|
|
25
|
-
exports.Arriving = Arriving;
|
|
26
14
|
//# sourceMappingURL=Arrival.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrival.cjs.js","sources":[
|
|
1
|
+
{"version":3,"file":"Arrival.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { S as SettledContext, u as useArriving } from '../use-watched-CG9KoWl3.js';
|
|
4
|
-
export { a as useWatched } from '../use-watched-CG9KoWl3.js';
|
|
5
|
-
import { c as cn } from '../cn-B4oPhFx9.js';
|
|
6
|
-
|
|
7
|
-
function ArrivalScope({ children }) {
|
|
8
|
-
const settled = useRef(false);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
settled.current = true;
|
|
11
|
-
}, []);
|
|
12
|
-
return /* @__PURE__ */ jsx(SettledContext, { value: settled, children });
|
|
13
|
-
}
|
|
14
|
-
function Arriving({ children, className }) {
|
|
15
|
-
const arriving = useArriving();
|
|
16
|
-
return /* @__PURE__ */ jsx("div", { className: cn(arriving, className), children: /* @__PURE__ */ jsx(ArrivalScope, { children }) });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { ArrivalScope, Arriving, useArriving };
|
|
1
|
+
export { A as ArrivalScope, a as Arriving } from '../arrival-Dp1nnVVK.js';
|
|
2
|
+
export { u as useArriving, a as useWatched } from '../use-watched-CG9KoWl3.js';
|
|
20
3
|
//# sourceMappingURL=Arrival.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrival.es.js","sources":[
|
|
1
|
+
{"version":3,"file":"Arrival.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
require('../Comment.css');const jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
const index = require('../index-BRtrE4oe.cjs');
|
|
7
7
|
const React = require('react');
|
|
8
8
|
const Txt = require('../Txt-D5Y_H2a0.cjs');
|
|
9
9
|
const utils_cn = require('../cn-DCPcv4xv.cjs');
|
|
10
|
+
const arrival = require('../arrival-DRX5Mxhd.cjs');
|
|
11
|
+
const useWatched = require('../use-watched-BixmYWp0.cjs');
|
|
10
12
|
const lucideReact = require('lucide-react');
|
|
11
13
|
const inputGroup = require('../input-group-WDZR_aql.cjs');
|
|
14
|
+
const Button = require('../Button-D10WB4vc.cjs');
|
|
12
15
|
|
|
13
16
|
const CommentContext = React.createContext(null);
|
|
14
17
|
function useCommentVariant() {
|
|
@@ -21,7 +24,8 @@ const commentVariants = index.cva("flex flex-col", {
|
|
|
21
24
|
variants: {
|
|
22
25
|
variant: {
|
|
23
26
|
default: "gap-2",
|
|
24
|
-
embed: "gap-1 rounded-xl border border-border1 bg-surface3 p-3"
|
|
27
|
+
embed: "gap-1 rounded-xl border border-border1 bg-surface3 p-3",
|
|
28
|
+
thread: ""
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
defaultVariants: {
|
|
@@ -41,7 +45,8 @@ const Comment = React.forwardRef(({ className, variant = "default", ...props },
|
|
|
41
45
|
Comment.displayName = "Comment";
|
|
42
46
|
const commentListGap = {
|
|
43
47
|
default: "gap-3",
|
|
44
|
-
embed: "gap-2"
|
|
48
|
+
embed: "gap-2",
|
|
49
|
+
thread: ""
|
|
45
50
|
};
|
|
46
51
|
const CommentList = React.forwardRef(({ className, ...props }, ref) => {
|
|
47
52
|
const variant = useCommentVariant();
|
|
@@ -56,45 +61,111 @@ const CommentList = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
56
61
|
);
|
|
57
62
|
});
|
|
58
63
|
CommentList.displayName = "CommentList";
|
|
59
|
-
const
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const commentItemLayout = {
|
|
65
|
+
default: "flex flex-col gap-1",
|
|
66
|
+
embed: "flex flex-col gap-1",
|
|
67
|
+
thread: "relative flex gap-2 rounded-lg px-2 hover:bg-surface3/60"
|
|
68
|
+
};
|
|
69
|
+
const CommentItem = React.forwardRef(
|
|
70
|
+
({ className, continued = false, highlighted = false, ...props }, ref) => {
|
|
71
|
+
const variant = useCommentVariant();
|
|
72
|
+
const Root = variant === "thread" ? "div" : "li";
|
|
73
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
Root,
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
"data-slot": "comment-item",
|
|
78
|
+
className: utils_cn.cn(
|
|
79
|
+
"group/comment-item",
|
|
80
|
+
commentItemLayout[variant],
|
|
81
|
+
variant === "thread" && (continued ? "py-0.5" : "py-1.5"),
|
|
82
|
+
highlighted && "bg-accent1/10",
|
|
83
|
+
className
|
|
84
|
+
),
|
|
85
|
+
...props
|
|
86
|
+
}
|
|
87
|
+
);
|
|
66
88
|
}
|
|
67
|
-
)
|
|
89
|
+
);
|
|
68
90
|
CommentItem.displayName = "CommentItem";
|
|
69
|
-
const
|
|
91
|
+
const CommentItemAvatar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "comment-item-avatar", className: utils_cn.cn("w-6 shrink-0 pt-0.5", className), ...props }));
|
|
92
|
+
CommentItemAvatar.displayName = "CommentItemAvatar";
|
|
93
|
+
const CommentItemContent = React.forwardRef(
|
|
94
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-slot": "comment-item-content", className: utils_cn.cn("min-w-0 flex-1", className), ...props })
|
|
95
|
+
);
|
|
96
|
+
CommentItemContent.displayName = "CommentItemContent";
|
|
97
|
+
const commentItemHeaderLayout = {
|
|
98
|
+
default: "flex items-center gap-2",
|
|
99
|
+
embed: "flex items-center gap-2",
|
|
100
|
+
thread: "flex items-baseline gap-1.5"
|
|
101
|
+
};
|
|
102
|
+
const CommentItemHeader = React.forwardRef(({ className, ...props }, ref) => {
|
|
103
|
+
const variant = useCommentVariant();
|
|
104
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
ref,
|
|
108
|
+
"data-slot": "comment-item-header",
|
|
109
|
+
className: utils_cn.cn(commentItemHeaderLayout[variant], className),
|
|
110
|
+
...props
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
});
|
|
70
114
|
CommentItemHeader.displayName = "CommentItemHeader";
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"time",
|
|
115
|
+
const commentItemAuthorSize = {
|
|
116
|
+
default: "ui-md",
|
|
117
|
+
embed: "ui-md",
|
|
118
|
+
thread: "ui-sm"
|
|
119
|
+
};
|
|
120
|
+
const commentItemAuthorTone = {
|
|
121
|
+
default: "font-medium text-neutral6",
|
|
122
|
+
embed: "font-medium text-neutral6",
|
|
123
|
+
thread: "truncate font-medium text-neutral6"
|
|
124
|
+
};
|
|
125
|
+
const CommentItemAuthor = React.forwardRef(({ className, ...props }, ref) => {
|
|
126
|
+
const variant = useCommentVariant();
|
|
127
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
128
|
+
Txt.Txt,
|
|
86
129
|
{
|
|
87
130
|
ref,
|
|
88
|
-
|
|
89
|
-
|
|
131
|
+
as: "span",
|
|
132
|
+
variant: commentItemAuthorSize[variant],
|
|
133
|
+
"data-slot": "comment-item-author",
|
|
134
|
+
className: utils_cn.cn(commentItemAuthorTone[variant], className),
|
|
90
135
|
...props
|
|
91
136
|
}
|
|
92
|
-
)
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
CommentItemAuthor.displayName = "CommentItemAuthor";
|
|
140
|
+
const commentItemTimestampTone = {
|
|
141
|
+
default: "text-ui-sm leading-ui-sm text-neutral3",
|
|
142
|
+
embed: "text-ui-sm leading-ui-sm text-neutral3",
|
|
143
|
+
thread: "text-ui-xs leading-ui-xs text-neutral2 shrink-0"
|
|
144
|
+
};
|
|
145
|
+
const CommentItemTimestamp = React.forwardRef(
|
|
146
|
+
({ className, ...props }, ref) => {
|
|
147
|
+
const variant = useCommentVariant();
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
149
|
+
"time",
|
|
150
|
+
{
|
|
151
|
+
ref,
|
|
152
|
+
"data-slot": "comment-item-timestamp",
|
|
153
|
+
className: utils_cn.cn(commentItemTimestampTone[variant], className),
|
|
154
|
+
...props
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
93
158
|
);
|
|
94
159
|
CommentItemTimestamp.displayName = "CommentItemTimestamp";
|
|
95
|
-
const
|
|
96
|
-
default: "
|
|
97
|
-
embed: ""
|
|
160
|
+
const commentItemBodySize = {
|
|
161
|
+
default: "ui-md",
|
|
162
|
+
embed: "ui-md",
|
|
163
|
+
thread: "ui-sm"
|
|
164
|
+
};
|
|
165
|
+
const commentItemBodyTone = {
|
|
166
|
+
default: "whitespace-pre-wrap text-neutral6 border-l border-border1 pl-3",
|
|
167
|
+
embed: "whitespace-pre-wrap text-neutral6",
|
|
168
|
+
thread: ""
|
|
98
169
|
};
|
|
99
170
|
const CommentItemBody = React.forwardRef(({ className, ...props }, ref) => {
|
|
100
171
|
const variant = useCommentVariant();
|
|
@@ -102,14 +173,22 @@ const CommentItemBody = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
102
173
|
Txt.Txt,
|
|
103
174
|
{
|
|
104
175
|
ref,
|
|
105
|
-
variant: "
|
|
176
|
+
as: variant === "thread" ? "div" : "p",
|
|
177
|
+
variant: commentItemBodySize[variant],
|
|
106
178
|
"data-slot": "comment-item-body",
|
|
107
|
-
className: utils_cn.cn(
|
|
179
|
+
className: utils_cn.cn(commentItemBodyTone[variant], className),
|
|
108
180
|
...props
|
|
109
181
|
}
|
|
110
182
|
);
|
|
111
183
|
});
|
|
112
184
|
CommentItemBody.displayName = "CommentItemBody";
|
|
185
|
+
const commentItemActionsLayout = {
|
|
186
|
+
default: "flex items-center gap-1 opacity-0 group-focus-within/comment-item:opacity-100 group-hover/comment-item:opacity-100 motion-safe:transition-opacity",
|
|
187
|
+
embed: "",
|
|
188
|
+
// Hung over the row's own top edge, so it never reflows the body it floats above.
|
|
189
|
+
// `pointer-fine` only: a touch screen has no hover to reveal it with.
|
|
190
|
+
thread: "bg-surface2 border-border1 absolute -top-2 right-2 flex items-center gap-0.5 rounded-lg border px-0.5 transition-opacity duration-200 ease-out motion-reduce:transition-none pointer-fine:opacity-0 pointer-fine:group-focus-within/comment-item:opacity-100 pointer-fine:group-hover/comment-item:opacity-100"
|
|
191
|
+
};
|
|
113
192
|
const CommentItemActions = React.forwardRef(
|
|
114
193
|
({ className, ...props }, ref) => {
|
|
115
194
|
const variant = useCommentVariant();
|
|
@@ -119,11 +198,7 @@ const CommentItemActions = React.forwardRef(
|
|
|
119
198
|
{
|
|
120
199
|
ref,
|
|
121
200
|
"data-slot": "comment-item-actions",
|
|
122
|
-
className: utils_cn.cn(
|
|
123
|
-
"flex items-center gap-1 opacity-0 group-focus-within/comment-item:opacity-100 group-hover/comment-item:opacity-100",
|
|
124
|
-
"motion-safe:transition-opacity",
|
|
125
|
-
className
|
|
126
|
-
),
|
|
201
|
+
className: utils_cn.cn(commentItemActionsLayout[variant], className),
|
|
127
202
|
...props
|
|
128
203
|
}
|
|
129
204
|
);
|
|
@@ -131,15 +206,22 @@ const CommentItemActions = React.forwardRef(
|
|
|
131
206
|
);
|
|
132
207
|
CommentItemActions.displayName = "CommentItemActions";
|
|
133
208
|
|
|
209
|
+
function CommentArrival({ children }) {
|
|
210
|
+
const watched = useWatched.useWatched();
|
|
211
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "comment-arrival", className: watched ? "mastra-comment-arriving" : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(arrival.ArrivalScope, { children }) });
|
|
212
|
+
}
|
|
213
|
+
|
|
134
214
|
const CommentComposer = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("form", { ref, "data-slot": "comment-composer", className: utils_cn.cn("flex w-full items-center gap-2", className), ...props }));
|
|
135
215
|
CommentComposer.displayName = "CommentComposer";
|
|
136
216
|
const composerSize = {
|
|
137
217
|
default: "md",
|
|
138
|
-
embed: "sm"
|
|
218
|
+
embed: "sm",
|
|
219
|
+
thread: "md"
|
|
139
220
|
};
|
|
140
221
|
const composerInputVariant = {
|
|
141
222
|
default: "outline",
|
|
142
|
-
embed: "default"
|
|
223
|
+
embed: "default",
|
|
224
|
+
thread: "outline"
|
|
143
225
|
};
|
|
144
226
|
const CommentComposerInput = React.forwardRef(
|
|
145
227
|
({ groupClassName, children, ...props }, ref) => {
|
|
@@ -156,15 +238,101 @@ const CommentComposerSend = React.forwardRef(
|
|
|
156
238
|
);
|
|
157
239
|
CommentComposerSend.displayName = "CommentComposerSend";
|
|
158
240
|
|
|
241
|
+
function CommentEditor({
|
|
242
|
+
initialBody,
|
|
243
|
+
onSave,
|
|
244
|
+
onClose,
|
|
245
|
+
isPending = false,
|
|
246
|
+
error,
|
|
247
|
+
"aria-label": ariaLabel = "Edit comment",
|
|
248
|
+
className
|
|
249
|
+
}) {
|
|
250
|
+
const [draft, setDraft] = React.useState(initialBody);
|
|
251
|
+
const body = draft.trim();
|
|
252
|
+
const canSave = body.length > 0 && !isPending;
|
|
253
|
+
const save = () => {
|
|
254
|
+
if (!canSave) return;
|
|
255
|
+
if (body === initialBody) {
|
|
256
|
+
onClose();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
onSave(body);
|
|
260
|
+
};
|
|
261
|
+
const onKeyDown = (event) => {
|
|
262
|
+
if (event.nativeEvent.isComposing) return;
|
|
263
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
save();
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "comment-editor", className: utils_cn.cn("mt-1 flex flex-col gap-1.5", className), children: [
|
|
269
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
270
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
271
|
+
"textarea",
|
|
272
|
+
{
|
|
273
|
+
value: draft,
|
|
274
|
+
onChange: (event) => setDraft(event.target.value),
|
|
275
|
+
onKeyDown,
|
|
276
|
+
readOnly: isPending,
|
|
277
|
+
"aria-label": ariaLabel,
|
|
278
|
+
rows: 2,
|
|
279
|
+
className: "text-neutral6 border-border1 bg-surface2 text-ui-sm focus:border-border2 block field-sizing-content max-h-40 w-full resize-none overflow-y-auto rounded-lg border px-2 pt-1.5 pb-9 outline-none"
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface2 absolute inset-x-px bottom-px flex items-center justify-end gap-1 rounded-b-lg px-1.5 pt-1 pb-1.5", children: [
|
|
283
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button.Button, { type: "button", variant: "ghost", size: "xs", disabled: isPending, onClick: onClose, children: "Cancel" }),
|
|
284
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button.Button, { type: "button", variant: "outline", size: "xs", disabled: !canSave, onClick: save, children: isPending ? "Saving…" : "Save" })
|
|
285
|
+
] })
|
|
286
|
+
] }),
|
|
287
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-ui-xs text-error m-0", children: error }) : null
|
|
288
|
+
] });
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function CommentQuote({ authorName, quote, onDismiss, className }) {
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
293
|
+
"blockquote",
|
|
294
|
+
{
|
|
295
|
+
"data-slot": "comment-quote",
|
|
296
|
+
className: utils_cn.cn("text-neutral3 m-0 flex min-w-0 gap-2 border-l-2 border-border2 pl-2 text-ui-xs", className),
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
299
|
+
authorName ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-neutral4 font-medium", children: [
|
|
300
|
+
authorName,
|
|
301
|
+
" "
|
|
302
|
+
] }) : null,
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "line-clamp-2 wrap-anywhere whitespace-pre-line", children: quote })
|
|
304
|
+
] }),
|
|
305
|
+
onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
306
|
+
Button.Button,
|
|
307
|
+
{
|
|
308
|
+
type: "button",
|
|
309
|
+
variant: "ghost",
|
|
310
|
+
size: "icon-xs",
|
|
311
|
+
"aria-label": "Remove quote",
|
|
312
|
+
onClick: onDismiss,
|
|
313
|
+
className: "shrink-0",
|
|
314
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 12, "aria-hidden": true })
|
|
315
|
+
}
|
|
316
|
+
) : null
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
159
322
|
exports.Comment = Comment;
|
|
323
|
+
exports.CommentArrival = CommentArrival;
|
|
160
324
|
exports.CommentComposer = CommentComposer;
|
|
161
325
|
exports.CommentComposerInput = CommentComposerInput;
|
|
162
326
|
exports.CommentComposerSend = CommentComposerSend;
|
|
327
|
+
exports.CommentEditor = CommentEditor;
|
|
163
328
|
exports.CommentItem = CommentItem;
|
|
164
329
|
exports.CommentItemActions = CommentItemActions;
|
|
165
330
|
exports.CommentItemAuthor = CommentItemAuthor;
|
|
331
|
+
exports.CommentItemAvatar = CommentItemAvatar;
|
|
166
332
|
exports.CommentItemBody = CommentItemBody;
|
|
333
|
+
exports.CommentItemContent = CommentItemContent;
|
|
167
334
|
exports.CommentItemHeader = CommentItemHeader;
|
|
168
335
|
exports.CommentItemTimestamp = CommentItemTimestamp;
|
|
169
336
|
exports.CommentList = CommentList;
|
|
337
|
+
exports.CommentQuote = CommentQuote;
|
|
170
338
|
//# sourceMappingURL=Comment.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comment.cjs.js","sources":["../../src/ds/components/Comment/comment-context.ts","../../src/ds/components/Comment/comment.tsx","../../src/ds/components/Comment/comment-composer.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type CommentVariant = 'default' | 'embed';\n\nexport const CommentContext = createContext<CommentVariant | null>(null);\n\nexport function useCommentVariant(): CommentVariant {\n const variant = useContext(CommentContext);\n if (!variant) throw new Error('Comment compounds must be rendered within Comment');\n return variant;\n}\n","import { cva } from 'class-variance-authority';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport { forwardRef } from 'react';\n\nimport { CommentContext, useCommentVariant } from './comment-context';\nimport type { CommentVariant } from './comment-context';\nimport { Txt } from '@/ds/components/Txt';\nimport { cn } from '@/lib/utils';\n\nconst commentVariants = cva('flex flex-col', {\n variants: {\n variant: {\n default: 'gap-2',\n embed: 'gap-1 rounded-xl border border-border1 bg-surface3 p-3',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport interface CommentProps extends ComponentPropsWithoutRef<'div'> {\n variant?: CommentVariant;\n}\n\nexport const Comment = forwardRef<HTMLDivElement, CommentProps>(({ className, variant = 'default', ...props }, ref) => (\n <CommentContext.Provider value={variant}>\n <div\n ref={ref}\n data-slot=\"comment\"\n data-variant={variant}\n className={cn(commentVariants({ variant }), className)}\n {...props}\n />\n </CommentContext.Provider>\n));\nComment.displayName = 'Comment';\n\nconst commentListGap: Record<CommentVariant, string> = {\n default: 'gap-3',\n embed: 'gap-2',\n};\n\nexport type CommentListProps = ComponentPropsWithoutRef<'ul'>;\n\nexport const CommentList = forwardRef<HTMLUListElement, CommentListProps>(({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <ul\n ref={ref}\n data-slot=\"comment-list\"\n className={cn('flex flex-col', commentListGap[variant], className)}\n {...props}\n />\n );\n});\nCommentList.displayName = 'CommentList';\n\nexport type CommentItemProps = ComponentPropsWithoutRef<'li'>;\n\nexport const CommentItem = forwardRef<HTMLLIElement, CommentItemProps>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n data-slot=\"comment-item\"\n className={cn('group/comment-item flex flex-col gap-1', className)}\n {...props}\n />\n));\nCommentItem.displayName = 'CommentItem';\n\nexport type CommentItemHeaderProps = ComponentPropsWithoutRef<'div'>;\n\nexport const CommentItemHeader = forwardRef<HTMLDivElement, CommentItemHeaderProps>(({ className, ...props }, ref) => (\n <div ref={ref} data-slot=\"comment-item-header\" className={cn('flex items-center gap-2', className)} {...props} />\n));\nCommentItemHeader.displayName = 'CommentItemHeader';\n\nexport type CommentItemAuthorProps = ComponentPropsWithoutRef<'span'>;\n\nexport const CommentItemAuthor = forwardRef<HTMLElement, CommentItemAuthorProps>(({ className, ...props }, ref) => (\n <Txt\n ref={ref}\n as=\"span\"\n variant=\"ui-md\"\n data-slot=\"comment-item-author\"\n className={cn('font-medium text-neutral6', className)}\n {...props}\n />\n));\nCommentItemAuthor.displayName = 'CommentItemAuthor';\n\nexport type CommentItemTimestampProps = ComponentPropsWithoutRef<'time'>;\n\nexport const CommentItemTimestamp = forwardRef<HTMLTimeElement, CommentItemTimestampProps>(\n ({ className, ...props }, ref) => (\n <time\n ref={ref}\n data-slot=\"comment-item-timestamp\"\n className={cn('text-ui-sm leading-ui-sm text-neutral3', className)}\n {...props}\n />\n ),\n);\nCommentItemTimestamp.displayName = 'CommentItemTimestamp';\n\nconst commentItemBodyRule: Record<CommentVariant, string> = {\n default: 'border-l border-border1 pl-3',\n embed: '',\n};\n\nexport type CommentItemBodyProps = ComponentPropsWithoutRef<'p'>;\n\nexport const CommentItemBody = forwardRef<HTMLElement, CommentItemBodyProps>(({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <Txt\n ref={ref}\n variant=\"ui-md\"\n data-slot=\"comment-item-body\"\n className={cn('whitespace-pre-wrap text-neutral6', commentItemBodyRule[variant], className)}\n {...props}\n />\n );\n});\nCommentItemBody.displayName = 'CommentItemBody';\n\nexport type CommentItemActionsProps = ComponentPropsWithoutRef<'div'>;\n\n/** Hidden in the `embed` variant, which drops per-item actions. */\nexport const CommentItemActions = forwardRef<HTMLDivElement, CommentItemActionsProps>(\n ({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n if (variant === 'embed') return null;\n\n return (\n <div\n ref={ref}\n data-slot=\"comment-item-actions\"\n className={cn(\n 'flex items-center gap-1 opacity-0 group-focus-within/comment-item:opacity-100 group-hover/comment-item:opacity-100',\n 'motion-safe:transition-opacity',\n className,\n )}\n {...props}\n />\n );\n },\n);\nCommentItemActions.displayName = 'CommentItemActions';\n","import { ArrowUp } from 'lucide-react';\nimport type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport { forwardRef } from 'react';\n\nimport { useCommentVariant } from './comment-context';\nimport type { CommentVariant } from './comment-context';\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '@/ds/components/InputGroup';\nimport type { InputGroupButtonProps, InputGroupInputProps } from '@/ds/components/InputGroup';\nimport type { ControlSize } from '@/ds/primitives/control-size';\nimport { cn } from '@/lib/utils';\n\nexport type CommentComposerProps = ComponentPropsWithoutRef<'form'>;\n\nexport const CommentComposer = forwardRef<HTMLFormElement, CommentComposerProps>(({ className, ...props }, ref) => (\n <form ref={ref} data-slot=\"comment-composer\" className={cn('flex w-full items-center gap-2', className)} {...props} />\n));\nCommentComposer.displayName = 'CommentComposer';\n\nconst composerSize: Record<CommentVariant, ControlSize> = {\n default: 'md',\n embed: 'sm',\n};\n\nconst composerInputVariant: Record<CommentVariant, 'default' | 'outline'> = {\n default: 'outline',\n embed: 'default',\n};\n\nexport interface CommentComposerInputProps extends InputGroupInputProps {\n /** Layout classes for the surrounding InputGroup. */\n groupClassName?: string;\n children?: ReactNode;\n}\n\nexport const CommentComposerInput = forwardRef<HTMLInputElement, CommentComposerInputProps>(\n ({ groupClassName, children, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <InputGroup size={composerSize[variant]} variant={composerInputVariant[variant]} className={groupClassName}>\n <InputGroupInput ref={ref} data-slot=\"comment-composer-input\" {...props} />\n {children}\n </InputGroup>\n );\n },\n);\nCommentComposerInput.displayName = 'CommentComposerInput';\n\nexport type CommentComposerSendProps = Omit<InputGroupButtonProps, 'children'>;\n\nexport const CommentComposerSend = forwardRef<HTMLButtonElement, CommentComposerSendProps>(\n ({ 'aria-label': ariaLabel = 'Send comment', type = 'submit', ...props }, ref) => (\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton ref={ref} data-slot=\"comment-composer-send\" type={type} aria-label={ariaLabel} {...props}>\n <ArrowUp />\n </InputGroupButton>\n </InputGroupAddon>\n ),\n);\nCommentComposerSend.displayName = 'CommentComposerSend';\n"],"names":["createContext","useContext","cva","forwardRef","jsx","cn","Txt","jsxs","InputGroup","InputGroupInput","InputGroupAddon","InputGroupButton","ArrowUp"],"mappings":";;;;;;;;;;;;AAIO,MAAM,cAAA,GAAiBA,oBAAqC,IAAI,CAAA;AAEhE,SAAS,iBAAA,GAAoC;AAClD,EAAA,MAAM,OAAA,GAAUC,iBAAW,cAAc,CAAA;AACzC,EAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,mDAAmD,CAAA;AACjF,EAAA,OAAO,OAAA;AACT;;ACDA,MAAM,eAAA,GAAkBC,UAAI,eAAA,EAAiB;AAAA,EAC3C,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AA,GAAsE;AAAA,EAC1E,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAA;AAQO,MAAM,oBAAA,GAAuBF,gBAAA;AAAA,EAClC,CAAC,EAAE,cAAA,EAAgB,UAAU,GAAG,KAAA,IAAS,GAAA,KAAQ;AAC/C,IAAA,MAAM,UAAU,iBAAA,EAAkB;AAElC,IAAA,uBACEI,eAAA,CAACC,qBAAA,EAAA,EAAW,IAAA,EAAM,YAAA,CAAa,OAAO,CAAA,EAAG,OAAA,EAAS,oBAAA,CAAqB,OAAO,CAAA,EAAG,SAAA,EAAW,cAAA,EAC1F,QAAA,EAAA;AAAA,sBAAAJ,cAAA,CAACK,0BAAA,EAAA,EAAgB,GAAA,EAAU,WAAA,EAAU,wBAAA,EAA0B,GAAG,KAAA,EAAO,CAAA;AAAA,MACxE;AAAA,KAAA,EACH,CAAA;AAAA,EAEJ;AACF;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA;AAI5B,MAAM,mBAAA,GAAsBN,gBAAA;AAAA,EACjC,CAAC,EAAE,YAAA,EAAc,SAAA,GAAY,cAAA,EAAgB,IAAA,GAAO,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,qBACxEC,cAAA,CAACM,0BAAA,EAAA,EAAgB,KAAA,EAAM,YAAA,EACrB,QAAA,kBAAAN,cAAA,CAACO,2BAAA,EAAA,EAAiB,GAAA,EAAU,WAAA,EAAU,uBAAA,EAAwB,IAAA,EAAY,YAAA,EAAY,SAAA,EAAY,GAAG,KAAA,EACnG,QAAA,kBAAAP,cAAA,CAACQ,mBAAA,EAAA,EAAQ,CAAA,EACX,CAAA,EACF;AAEJ;AACA,mBAAA,CAAoB,WAAA,GAAc,qBAAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Comment.cjs.js","sources":["../../src/ds/components/Comment/comment-context.ts","../../src/ds/components/Comment/comment.tsx","../../src/ds/components/Comment/comment-arrival.tsx","../../src/ds/components/Comment/comment-composer.tsx","../../src/ds/components/Comment/comment-editor.tsx","../../src/ds/components/Comment/comment-quote.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type CommentVariant = 'default' | 'embed' | 'thread';\n\nexport const CommentContext = createContext<CommentVariant | null>(null);\n\nexport function useCommentVariant(): CommentVariant {\n const variant = useContext(CommentContext);\n if (!variant) throw new Error('Comment compounds must be rendered within Comment');\n return variant;\n}\n","import { cva } from 'class-variance-authority';\nimport type { ComponentPropsWithoutRef, HTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\n\nimport { CommentContext, useCommentVariant } from './comment-context';\nimport type { CommentVariant } from './comment-context';\nimport { Txt } from '@/ds/components/Txt';\nimport type { TxtProps } from '@/ds/components/Txt';\nimport { cn } from '@/lib/utils';\n\nconst commentVariants = cva('flex flex-col', {\n variants: {\n variant: {\n default: 'gap-2',\n embed: 'gap-1 rounded-xl border border-border1 bg-surface3 p-3',\n thread: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport interface CommentProps extends ComponentPropsWithoutRef<'div'> {\n variant?: CommentVariant;\n}\n\nexport const Comment = forwardRef<HTMLDivElement, CommentProps>(({ className, variant = 'default', ...props }, ref) => (\n <CommentContext.Provider value={variant}>\n <div\n ref={ref}\n data-slot=\"comment\"\n data-variant={variant}\n className={cn(commentVariants({ variant }), className)}\n {...props}\n />\n </CommentContext.Provider>\n));\nComment.displayName = 'Comment';\n\nconst commentListGap: Record<CommentVariant, string> = {\n default: 'gap-3',\n embed: 'gap-2',\n thread: '',\n};\n\nexport type CommentListProps = ComponentPropsWithoutRef<'ul'>;\n\nexport const CommentList = forwardRef<HTMLUListElement, CommentListProps>(({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <ul\n ref={ref}\n data-slot=\"comment-list\"\n className={cn('flex flex-col', commentListGap[variant], className)}\n {...props}\n />\n );\n});\nCommentList.displayName = 'CommentList';\n\nconst commentItemLayout: Record<CommentVariant, string> = {\n default: 'flex flex-col gap-1',\n embed: 'flex flex-col gap-1',\n thread: 'relative flex gap-2 rounded-lg px-2 hover:bg-surface3/60',\n};\n\nexport interface CommentItemProps extends HTMLAttributes<HTMLElement> {\n /** Same author moments after the row above: the header is dropped and the row tightens. */\n continued?: boolean;\n /** The comment a link pointed at. */\n highlighted?: boolean;\n}\n\nexport const CommentItem = forwardRef<HTMLElement, CommentItemProps>(\n ({ className, continued = false, highlighted = false, ...props }, ref) => {\n const variant = useCommentVariant();\n // A thread row is a stream entry among runs and moves, not a list item.\n const Root = variant === 'thread' ? 'div' : 'li';\n\n return (\n <Root\n // Cast needed: `Root` is polymorphic, so TS narrows the expected ref to a single element type.\n ref={ref as never}\n data-slot=\"comment-item\"\n className={cn(\n 'group/comment-item',\n commentItemLayout[variant],\n variant === 'thread' && (continued ? 'py-0.5' : 'py-1.5'),\n highlighted && 'bg-accent1/10',\n className,\n )}\n {...props}\n />\n );\n },\n);\nCommentItem.displayName = 'CommentItem';\n\nexport type CommentItemAvatarProps = ComponentPropsWithoutRef<'div'>;\n\n/** Fixed gutter: left empty on a continuation row, it keeps the body aligned under the avatar above. */\nexport const CommentItemAvatar = forwardRef<HTMLDivElement, CommentItemAvatarProps>(({ className, ...props }, ref) => (\n <div ref={ref} data-slot=\"comment-item-avatar\" className={cn('w-6 shrink-0 pt-0.5', className)} {...props} />\n));\nCommentItemAvatar.displayName = 'CommentItemAvatar';\n\nexport type CommentItemContentProps = ComponentPropsWithoutRef<'div'>;\n\n/** Everything beside the gutter, stacked and free to shrink so long words wrap instead of widening the row. */\nexport const CommentItemContent = forwardRef<HTMLDivElement, CommentItemContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} data-slot=\"comment-item-content\" className={cn('min-w-0 flex-1', className)} {...props} />\n ),\n);\nCommentItemContent.displayName = 'CommentItemContent';\n\nconst commentItemHeaderLayout: Record<CommentVariant, string> = {\n default: 'flex items-center gap-2',\n embed: 'flex items-center gap-2',\n thread: 'flex items-baseline gap-1.5',\n};\n\nexport type CommentItemHeaderProps = ComponentPropsWithoutRef<'div'>;\n\nexport const CommentItemHeader = forwardRef<HTMLDivElement, CommentItemHeaderProps>(({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <div\n ref={ref}\n data-slot=\"comment-item-header\"\n className={cn(commentItemHeaderLayout[variant], className)}\n {...props}\n />\n );\n});\nCommentItemHeader.displayName = 'CommentItemHeader';\n\nconst commentItemAuthorSize: Record<CommentVariant, TxtProps['variant']> = {\n default: 'ui-md',\n embed: 'ui-md',\n thread: 'ui-sm',\n};\n\nconst commentItemAuthorTone: Record<CommentVariant, string> = {\n default: 'font-medium text-neutral6',\n embed: 'font-medium text-neutral6',\n thread: 'truncate font-medium text-neutral6',\n};\n\nexport type CommentItemAuthorProps = ComponentPropsWithoutRef<'span'>;\n\nexport const CommentItemAuthor = forwardRef<HTMLElement, CommentItemAuthorProps>(({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <Txt\n ref={ref}\n as=\"span\"\n variant={commentItemAuthorSize[variant]}\n data-slot=\"comment-item-author\"\n className={cn(commentItemAuthorTone[variant], className)}\n {...props}\n />\n );\n});\nCommentItemAuthor.displayName = 'CommentItemAuthor';\n\nconst commentItemTimestampTone: Record<CommentVariant, string> = {\n default: 'text-ui-sm leading-ui-sm text-neutral3',\n embed: 'text-ui-sm leading-ui-sm text-neutral3',\n thread: 'text-ui-xs leading-ui-xs text-neutral2 shrink-0',\n};\n\nexport type CommentItemTimestampProps = ComponentPropsWithoutRef<'time'>;\n\nexport const CommentItemTimestamp = forwardRef<HTMLTimeElement, CommentItemTimestampProps>(\n ({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <time\n ref={ref}\n data-slot=\"comment-item-timestamp\"\n className={cn(commentItemTimestampTone[variant], className)}\n {...props}\n />\n );\n },\n);\nCommentItemTimestamp.displayName = 'CommentItemTimestamp';\n\nconst commentItemBodySize: Record<CommentVariant, TxtProps['variant']> = {\n default: 'ui-md',\n embed: 'ui-md',\n thread: 'ui-sm',\n};\n\nconst commentItemBodyTone: Record<CommentVariant, string> = {\n default: 'whitespace-pre-wrap text-neutral6 border-l border-border1 pl-3',\n embed: 'whitespace-pre-wrap text-neutral6',\n thread: '',\n};\n\nexport type CommentItemBodyProps = ComponentPropsWithoutRef<'p'>;\n\nexport const CommentItemBody = forwardRef<HTMLElement, CommentItemBodyProps>(({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <Txt\n ref={ref}\n // Rendered markdown brings its own blocks, which a paragraph cannot hold.\n as={variant === 'thread' ? 'div' : 'p'}\n variant={commentItemBodySize[variant]}\n data-slot=\"comment-item-body\"\n className={cn(commentItemBodyTone[variant], className)}\n {...props}\n />\n );\n});\nCommentItemBody.displayName = 'CommentItemBody';\n\nconst commentItemActionsLayout: Record<CommentVariant, string> = {\n default:\n 'flex items-center gap-1 opacity-0 group-focus-within/comment-item:opacity-100 group-hover/comment-item:opacity-100 motion-safe:transition-opacity',\n embed: '',\n // Hung over the row's own top edge, so it never reflows the body it floats above.\n // `pointer-fine` only: a touch screen has no hover to reveal it with.\n thread:\n 'bg-surface2 border-border1 absolute -top-2 right-2 flex items-center gap-0.5 rounded-lg border px-0.5 transition-opacity duration-200 ease-out motion-reduce:transition-none pointer-fine:opacity-0 pointer-fine:group-focus-within/comment-item:opacity-100 pointer-fine:group-hover/comment-item:opacity-100',\n};\n\nexport type CommentItemActionsProps = ComponentPropsWithoutRef<'div'>;\n\n/** Hidden in the `embed` variant, which drops per-item actions. */\nexport const CommentItemActions = forwardRef<HTMLDivElement, CommentItemActionsProps>(\n ({ className, ...props }, ref) => {\n const variant = useCommentVariant();\n if (variant === 'embed') return null;\n\n return (\n <div\n ref={ref}\n data-slot=\"comment-item-actions\"\n className={cn(commentItemActionsLayout[variant], className)}\n {...props}\n />\n );\n },\n);\nCommentItemActions.displayName = 'CommentItemActions';\n","import type { ReactNode } from 'react';\n\nimport { ArrivalScope, useWatched } from '@/ds/components/Arrival';\n\nimport './comment-arrival.css';\n\n/** A comment the reader watched land rises into place; one that was already there just appears. */\nexport function CommentArrival({ children }: { children: ReactNode }) {\n const watched = useWatched();\n\n return (\n <div data-slot=\"comment-arrival\" className={watched ? 'mastra-comment-arriving' : undefined}>\n <ArrivalScope>{children}</ArrivalScope>\n </div>\n );\n}\n","import { ArrowUp } from 'lucide-react';\nimport type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport { forwardRef } from 'react';\n\nimport { useCommentVariant } from './comment-context';\nimport type { CommentVariant } from './comment-context';\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '@/ds/components/InputGroup';\nimport type { InputGroupButtonProps, InputGroupInputProps } from '@/ds/components/InputGroup';\nimport type { ControlSize } from '@/ds/primitives/control-size';\nimport { cn } from '@/lib/utils';\n\nexport type CommentComposerProps = ComponentPropsWithoutRef<'form'>;\n\nexport const CommentComposer = forwardRef<HTMLFormElement, CommentComposerProps>(({ className, ...props }, ref) => (\n <form ref={ref} data-slot=\"comment-composer\" className={cn('flex w-full items-center gap-2', className)} {...props} />\n));\nCommentComposer.displayName = 'CommentComposer';\n\nconst composerSize: Record<CommentVariant, ControlSize> = {\n default: 'md',\n embed: 'sm',\n thread: 'md',\n};\n\nconst composerInputVariant: Record<CommentVariant, 'default' | 'outline'> = {\n default: 'outline',\n embed: 'default',\n thread: 'outline',\n};\n\nexport interface CommentComposerInputProps extends InputGroupInputProps {\n /** Layout classes for the surrounding InputGroup. */\n groupClassName?: string;\n children?: ReactNode;\n}\n\nexport const CommentComposerInput = forwardRef<HTMLInputElement, CommentComposerInputProps>(\n ({ groupClassName, children, ...props }, ref) => {\n const variant = useCommentVariant();\n\n return (\n <InputGroup size={composerSize[variant]} variant={composerInputVariant[variant]} className={groupClassName}>\n <InputGroupInput ref={ref} data-slot=\"comment-composer-input\" {...props} />\n {children}\n </InputGroup>\n );\n },\n);\nCommentComposerInput.displayName = 'CommentComposerInput';\n\nexport type CommentComposerSendProps = Omit<InputGroupButtonProps, 'children'>;\n\nexport const CommentComposerSend = forwardRef<HTMLButtonElement, CommentComposerSendProps>(\n ({ 'aria-label': ariaLabel = 'Send comment', type = 'submit', ...props }, ref) => (\n <InputGroupAddon align=\"inline-end\">\n <InputGroupButton ref={ref} data-slot=\"comment-composer-send\" type={type} aria-label={ariaLabel} {...props}>\n <ArrowUp />\n </InputGroupButton>\n </InputGroupAddon>\n ),\n);\nCommentComposerSend.displayName = 'CommentComposerSend';\n","import { useState } from 'react';\nimport type { KeyboardEvent } from 'react';\n\nimport { Button } from '@/ds/components/Button';\nimport { cn } from '@/lib/utils';\n\nexport interface CommentEditorProps {\n initialBody: string;\n /** Handed the trimmed draft. Closing is the caller's call, so a save that failed keeps what was typed. */\n onSave: (body: string) => void;\n onClose: () => void;\n /** The caller's save in flight: the box locks until it settles. */\n isPending?: boolean;\n /** Why the caller's last save failed. */\n error?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\n/** Owns the draft only; whether a save landed is the caller's mutation to report. */\nexport function CommentEditor({\n initialBody,\n onSave,\n onClose,\n isPending = false,\n error,\n 'aria-label': ariaLabel = 'Edit comment',\n className,\n}: CommentEditorProps) {\n const [draft, setDraft] = useState(initialBody);\n const body = draft.trim();\n const canSave = body.length > 0 && !isPending;\n\n const save = () => {\n if (!canSave) return;\n if (body === initialBody) {\n onClose();\n return;\n }\n onSave(body);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n // An IME commit fires Enter mid-composition; acting on it would save half a word.\n if (event.nativeEvent.isComposing) return;\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n save();\n }\n };\n\n return (\n <div data-slot=\"comment-editor\" className={cn('mt-1 flex flex-col gap-1.5', className)}>\n <div className=\"relative\">\n <textarea\n value={draft}\n onChange={event => setDraft(event.target.value)}\n onKeyDown={onKeyDown}\n readOnly={isPending}\n aria-label={ariaLabel}\n rows={2}\n className=\"text-neutral6 border-border1 bg-surface2 text-ui-sm focus:border-border2 block field-sizing-content max-h-40 w-full resize-none overflow-y-auto rounded-lg border px-2 pt-1.5 pb-9 outline-none\"\n />\n {/* Opaque, so a scrolled line passes behind the actions instead of under them. */}\n <div className=\"bg-surface2 absolute inset-x-px bottom-px flex items-center justify-end gap-1 rounded-b-lg px-1.5 pt-1 pb-1.5\">\n <Button type=\"button\" variant=\"ghost\" size=\"xs\" disabled={isPending} onClick={onClose}>\n Cancel\n </Button>\n <Button type=\"button\" variant=\"outline\" size=\"xs\" disabled={!canSave} onClick={save}>\n {isPending ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n {error ? (\n <p role=\"alert\" className=\"text-ui-xs text-error m-0\">\n {error}\n </p>\n ) : null}\n </div>\n );\n}\n","import { X } from 'lucide-react';\n\nimport { Button } from '@/ds/components/Button';\nimport { cn } from '@/lib/utils';\n\nexport interface CommentQuoteProps {\n authorName?: string;\n quote: string;\n /** Given only while the quote is a draft the writer can still drop. */\n onDismiss?: () => void;\n className?: string;\n}\n\n/** The passage a reply answers, above the reply itself or inside the composer writing it. */\nexport function CommentQuote({ authorName, quote, onDismiss, className }: CommentQuoteProps) {\n return (\n <blockquote\n data-slot=\"comment-quote\"\n className={cn('text-neutral3 m-0 flex min-w-0 gap-2 border-l-2 border-border2 pl-2 text-ui-xs', className)}\n >\n <span className=\"min-w-0 flex-1\">\n {authorName ? <span className=\"text-neutral4 font-medium\">{authorName} </span> : null}\n <span className=\"line-clamp-2 wrap-anywhere whitespace-pre-line\">{quote}</span>\n </span>\n {onDismiss ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label=\"Remove quote\"\n onClick={onDismiss}\n className=\"shrink-0\"\n >\n <X size={12} aria-hidden />\n </Button>\n ) : null}\n </blockquote>\n );\n}\n"],"names":["createContext","useContext","cva","forwardRef","jsx","cn","Txt","useWatched","ArrivalScope","jsxs","InputGroup","InputGroupInput","InputGroupAddon","InputGroupButton","ArrowUp","useState","Button","X"],"mappings":";;;;;;;;;;;;;;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