@mastra/playground-ui 36.0.0 → 36.1.0-alpha.1
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/CHANGELOG.md +24 -0
- package/dist/components/ScatterPlotChart.cjs.js +13 -0
- package/dist/components/ScatterPlotChart.cjs.js.map +1 -0
- package/dist/components/ScatterPlotChart.d.ts +2 -0
- package/dist/components/ScatterPlotChart.es.js +2 -0
- package/dist/components/ScatterPlotChart.es.js.map +1 -0
- package/dist/components/ThreadList.cjs.js +15 -0
- package/dist/components/ThreadList.cjs.js.map +1 -0
- package/dist/components/ThreadList.d.ts +2 -0
- package/dist/components/ThreadList.es.js +2 -0
- package/dist/components/ThreadList.es.js.map +1 -0
- package/dist/index.cjs.js +789 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +80 -1
- package/dist/index.es.js +764 -8
- package/dist/index.es.js.map +1 -1
- package/dist/scatter-plot-chart-BDRQ77OX.js +162 -0
- package/dist/scatter-plot-chart-BDRQ77OX.js.map +1 -0
- package/dist/scatter-plot-chart-MLvMlaxH.cjs +167 -0
- package/dist/scatter-plot-chart-MLvMlaxH.cjs.map +1 -0
- package/dist/src/domains/logs/hooks/use-logs.d.ts +5 -0
- package/dist/src/ds/components/ScatterPlotChart/index.d.ts +2 -0
- package/dist/src/ds/components/ScatterPlotChart/scatter-plot-chart-tooltip.d.ts +16 -0
- package/dist/src/ds/components/ScatterPlotChart/scatter-plot-chart.d.ts +24 -0
- package/dist/src/ds/components/ScatterPlotChart/scatter-plot-chart.stories.d.ts +11 -0
- package/dist/src/ds/components/ThreadList/index.d.ts +1 -0
- package/dist/src/ds/components/ThreadList/thread-list.d.ts +39 -0
- package/dist/src/ee/index.d.ts +2 -0
- package/dist/src/ee/signals/components/index.d.ts +2 -0
- package/dist/src/ee/signals/components/signal-details-page.d.ts +45 -0
- package/dist/src/ee/signals/components/signals-overview-page.d.ts +16 -0
- package/dist/src/ee/signals/index.d.ts +4 -0
- package/dist/src/ee/signals/signals-chart-data.d.ts +10 -0
- package/dist/src/ee/signals/signals-data.d.ts +2 -0
- package/dist/src/ee/signals/types.d.ts +13 -0
- package/dist/src/ee/topics/components/index.d.ts +6 -0
- package/dist/src/ee/topics/components/topic-trace-details-panel.d.ts +7 -0
- package/dist/src/ee/topics/components/topic-trace-summary-list.d.ts +8 -0
- package/dist/src/ee/topics/components/topics-layout.d.ts +7 -0
- package/dist/src/ee/topics/index.d.ts +3 -0
- package/dist/src/ee/topics/types.d.ts +40 -0
- package/dist/src/ee/topics/utils.d.ts +18 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/lib/query-utils.d.ts +10 -0
- package/dist/thread-list-CX4UNk2L.cjs +79 -0
- package/dist/thread-list-CX4UNk2L.cjs.map +1 -0
- package/dist/thread-list-CkgV4nYA.js +72 -0
- package/dist/thread-list-CkgV4nYA.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type TopicTraceSort = 'newest' | 'oldest' | 'duration-desc' | 'duration-asc';
|
|
2
|
+
export interface TopicTraceSummary {
|
|
3
|
+
id: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
startedAt?: string | Date;
|
|
6
|
+
endedAt?: string | Date;
|
|
7
|
+
durationMs?: number;
|
|
8
|
+
status?: 'success' | 'error' | 'running' | string;
|
|
9
|
+
entityName?: string;
|
|
10
|
+
spanCount?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TopicSubtopic {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
traceSummaries: TopicTraceSummary[];
|
|
18
|
+
}
|
|
19
|
+
export interface Topic {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
color?: string;
|
|
24
|
+
subtopics: TopicSubtopic[];
|
|
25
|
+
}
|
|
26
|
+
export interface TopicTraceShare {
|
|
27
|
+
count: number;
|
|
28
|
+
total: number;
|
|
29
|
+
percentage: number;
|
|
30
|
+
}
|
|
31
|
+
export interface TopicWithCounts extends Topic {
|
|
32
|
+
color: string;
|
|
33
|
+
traceCount: number;
|
|
34
|
+
subtopics: TopicSubtopicWithCounts[];
|
|
35
|
+
}
|
|
36
|
+
export interface TopicSubtopicWithCounts extends TopicSubtopic {
|
|
37
|
+
color: string;
|
|
38
|
+
traceCount: number;
|
|
39
|
+
traceShare: TopicTraceShare;
|
|
40
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Topic, TopicSubtopic, TopicTraceShare, TopicTraceSort, TopicTraceSummary, TopicWithCounts } from './types';
|
|
2
|
+
export declare function getTopicColor(id: string): string;
|
|
3
|
+
export declare function getTraceCount(subtopic: Pick<TopicSubtopic, 'traceSummaries'>): number;
|
|
4
|
+
export declare function getTopicTraceCount(topic: Pick<Topic, 'subtopics'>): number;
|
|
5
|
+
export declare function getTraceShare(count: number, total: number): TopicTraceShare;
|
|
6
|
+
export declare function aggregateTopics(topics: Topic[]): TopicWithCounts[];
|
|
7
|
+
export declare function filterTraceSummaries(traces: TopicTraceSummary[], search: string): TopicTraceSummary[];
|
|
8
|
+
export declare function sortTraceSummaries(traces: TopicTraceSummary[], sort: TopicTraceSort): TopicTraceSummary[];
|
|
9
|
+
export declare function getVisibleTraceSummaries(traces: TopicTraceSummary[], options: {
|
|
10
|
+
search: string;
|
|
11
|
+
sort: TopicTraceSort;
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
}): {
|
|
15
|
+
traces: TopicTraceSummary[];
|
|
16
|
+
total: number;
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export * from './ds/components/ThemeProvider';
|
|
|
52
52
|
export * from './ds/components/ThemeToggle';
|
|
53
53
|
export * from './ds/components/Tooltip';
|
|
54
54
|
export * from './ds/components/Truncate';
|
|
55
|
+
export * from './ds/components/ThreadList';
|
|
55
56
|
export * from './ds/components/ButtonsGroup';
|
|
56
57
|
export * from './ds/components/MainContent';
|
|
57
58
|
export * from './ds/components/MainHeader';
|
|
@@ -89,6 +90,7 @@ export * from './ds/components/DateTimeRangePicker';
|
|
|
89
90
|
export * from './ds/components/HorizontalBars';
|
|
90
91
|
export * from './ds/components/MetricsDataTable';
|
|
91
92
|
export * from './ds/components/MetricsLineChart';
|
|
93
|
+
export * from './ds/components/ScatterPlotChart';
|
|
92
94
|
export * from './ds/components/StatusBadge';
|
|
93
95
|
export * from './ds/icons/index';
|
|
94
96
|
export * from './ds/tokens';
|
|
@@ -121,4 +123,5 @@ export { usePlaygroundStore } from './store/playground-store';
|
|
|
121
123
|
export * from './domains/metrics';
|
|
122
124
|
export * from './domains/traces';
|
|
123
125
|
export * from './domains/logs';
|
|
126
|
+
export * from './ee';
|
|
124
127
|
export type { LinkComponent, LinkComponentProps } from './ds/types/link-component';
|
|
@@ -22,6 +22,16 @@ export declare function is404NotFoundError(error: unknown): boolean;
|
|
|
22
22
|
* we match on the message text from `core/.../observability/base.ts` instead.
|
|
23
23
|
*/
|
|
24
24
|
export declare function isBranchesNotSupportedError(error: unknown): boolean;
|
|
25
|
+
export type UnsupportedObservabilityOperation = 'logs' | 'metrics' | 'scores' | 'feedback';
|
|
26
|
+
/**
|
|
27
|
+
* Check if an error came from an observability storage provider that does not
|
|
28
|
+
* implement a list operation. These are capability gaps, not transient failures.
|
|
29
|
+
*
|
|
30
|
+
* The server serializes these as plain HTTP errors, so the original MastraError
|
|
31
|
+
* ID is not available in the browser. Match the stable base-storage message text
|
|
32
|
+
* instead, like the trace branch support check above.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isUnsupportedObservabilityOperationError(error: unknown, operation: UnsupportedObservabilityOperation): boolean;
|
|
25
35
|
/**
|
|
26
36
|
* Check if error has a status code that shouldn't be retried.
|
|
27
37
|
* Used to prevent retrying client errors that won't resolve.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const lucideReact = require('lucide-react');
|
|
5
|
+
const utils = require('./utils-vA5sWo9W.cjs');
|
|
6
|
+
const Button = require('./Button-DpIX8JMz.cjs');
|
|
7
|
+
const Txt = require('./Txt-Cmn4ug68.cjs');
|
|
8
|
+
|
|
9
|
+
const ThreadList = ({ children, "aria-label": ariaLabel = "Threads", embedded = false }) => {
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("h-full w-full", !embedded && "pb-2 pl-2"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
"nav",
|
|
12
|
+
{
|
|
13
|
+
"aria-label": ariaLabel,
|
|
14
|
+
className: utils.cn(
|
|
15
|
+
"h-full overflow-y-auto p-1",
|
|
16
|
+
!embedded && "bg-surface3 rounded-studio-panel border border-border1/50"
|
|
17
|
+
),
|
|
18
|
+
children
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
};
|
|
22
|
+
const ThreadListNewItem = ({ as, href, to, children }) => {
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button.Button, { as, href, to, variant: "ghost", className: "w-full justify-start rounded-xl", children });
|
|
24
|
+
};
|
|
25
|
+
const ThreadListSeparator = () => /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", "aria-orientation": "horizontal", className: "-mx-1 my-1 h-px bg-border1/40" });
|
|
26
|
+
const ThreadListItems = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex flex-col gap-px", "data-testid": "thread-list", children });
|
|
27
|
+
const ThreadListItem = ({
|
|
28
|
+
as,
|
|
29
|
+
href,
|
|
30
|
+
to,
|
|
31
|
+
isActive,
|
|
32
|
+
onClick,
|
|
33
|
+
onDelete,
|
|
34
|
+
deleteLabel = "delete",
|
|
35
|
+
className,
|
|
36
|
+
children
|
|
37
|
+
}) => {
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "group relative", children: [
|
|
39
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
Button.Button,
|
|
41
|
+
{
|
|
42
|
+
as,
|
|
43
|
+
href,
|
|
44
|
+
to,
|
|
45
|
+
onClick,
|
|
46
|
+
variant: "ghost",
|
|
47
|
+
className: utils.cn(
|
|
48
|
+
"min-h-form-md h-auto! w-full min-w-0 justify-start rounded-xl px-3 py-2 text-left",
|
|
49
|
+
onDelete && "pr-9",
|
|
50
|
+
isActive && "bg-surface4 text-neutral6",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children })
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
Button.Button,
|
|
58
|
+
{
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
size: "icon-sm",
|
|
61
|
+
className: "absolute right-1 top-1/2 -translate-y-1/2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",
|
|
62
|
+
onClick: onDelete,
|
|
63
|
+
"aria-label": deleteLabel,
|
|
64
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {})
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
const ThreadListEmpty = ({ children }) => {
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Txt.Txt, { as: "p", variant: "ui-sm", className: "text-neutral3 py-3 px-5", children });
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.ThreadList = ThreadList;
|
|
74
|
+
exports.ThreadListEmpty = ThreadListEmpty;
|
|
75
|
+
exports.ThreadListItem = ThreadListItem;
|
|
76
|
+
exports.ThreadListItems = ThreadListItems;
|
|
77
|
+
exports.ThreadListNewItem = ThreadListNewItem;
|
|
78
|
+
exports.ThreadListSeparator = ThreadListSeparator;
|
|
79
|
+
//# sourceMappingURL=thread-list-CX4UNk2L.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-list-CX4UNk2L.cjs","sources":["../src/ds/components/ThreadList/thread-list.tsx"],"sourcesContent":["import { X } from 'lucide-react';\nimport type { ElementType, MouseEvent, ReactNode } from 'react';\n\nimport { cn } from '../../../lib/utils';\nimport { Button } from '../Button';\nimport { Txt } from '../Txt';\n\nexport interface ThreadListProps {\n children: ReactNode;\n 'aria-label'?: string;\n /**\n * When true, drops the standalone block chrome (background, border, rounded corners, inset)\n * so the list can render flush inside an outer container without nesting a second box.\n */\n embedded?: boolean;\n}\n\nexport const ThreadList = ({ children, 'aria-label': ariaLabel = 'Threads', embedded = false }: ThreadListProps) => {\n return (\n <div className={cn('h-full w-full', !embedded && 'pb-2 pl-2')}>\n <nav\n aria-label={ariaLabel}\n className={cn(\n 'h-full overflow-y-auto p-1',\n !embedded && 'bg-surface3 rounded-studio-panel border border-border1/50',\n )}\n >\n {children}\n </nav>\n </div>\n );\n};\n\nexport interface ThreadListNewItemProps {\n as?: ElementType;\n href?: string;\n to?: string;\n children: ReactNode;\n}\n\nexport const ThreadListNewItem = ({ as, href, to, children }: ThreadListNewItemProps) => {\n return (\n <Button as={as} href={href} to={to} variant=\"ghost\" className=\"w-full justify-start rounded-xl\">\n {children}\n </Button>\n );\n};\n\nexport const ThreadListSeparator = () => (\n <div role=\"separator\" aria-orientation=\"horizontal\" className=\"-mx-1 my-1 h-px bg-border1/40\" />\n);\n\nexport interface ThreadListItemsProps {\n children: ReactNode;\n}\n\nexport const ThreadListItems = ({ children }: ThreadListItemsProps) => (\n <ol className=\"flex flex-col gap-px\" data-testid=\"thread-list\">\n {children}\n </ol>\n);\n\nexport interface ThreadListItemProps {\n as?: ElementType;\n href?: string;\n to?: string;\n isActive?: boolean;\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n onDelete?: () => void;\n deleteLabel?: string;\n className?: string;\n children: ReactNode;\n}\n\nexport const ThreadListItem = ({\n as,\n href,\n to,\n isActive,\n onClick,\n onDelete,\n deleteLabel = 'delete',\n className,\n children,\n}: ThreadListItemProps) => {\n return (\n <li className=\"group relative\">\n <Button\n as={as}\n href={href}\n to={to}\n onClick={onClick}\n variant=\"ghost\"\n className={cn(\n 'min-h-form-md h-auto! w-full min-w-0 justify-start rounded-xl px-3 py-2 text-left',\n onDelete && 'pr-9',\n isActive && 'bg-surface4 text-neutral6',\n className,\n )}\n >\n <span className=\"min-w-0 flex-1\">{children}</span>\n </Button>\n\n {onDelete && (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"absolute right-1 top-1/2 -translate-y-1/2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100\"\n onClick={onDelete}\n aria-label={deleteLabel}\n >\n <X />\n </Button>\n )}\n </li>\n );\n};\n\nexport interface ThreadListEmptyProps {\n children: ReactNode;\n}\n\nexport const ThreadListEmpty = ({ children }: ThreadListEmptyProps) => {\n return (\n <Txt as=\"p\" variant=\"ui-sm\" className=\"text-neutral3 py-3 px-5\">\n {children}\n </Txt>\n );\n};\n"],"names":["jsx","cn","Button","jsxs","X","Txt"],"mappings":";;;;;;;;AAiBO,MAAM,UAAA,GAAa,CAAC,EAAE,QAAA,EAAU,cAAc,SAAA,GAAY,SAAA,EAAW,QAAA,GAAW,KAAA,EAAM,KAAuB;AAClH,EAAA,uBACEA,cAAA,CAAC,SAAI,SAAA,EAAWC,QAAA,CAAG,iBAAiB,CAAC,QAAA,IAAY,WAAW,CAAA,EAC1D,QAAA,kBAAAD,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,SAAA;AAAA,MACZ,SAAA,EAAWC,QAAA;AAAA,QACT,4BAAA;AAAA,QACA,CAAC,QAAA,IAAY;AAAA,OACf;AAAA,MAEC;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;AASO,MAAM,oBAAo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MAAA;AAAA,QACC,OAAA,EAAQ,OAAA;AAAA,QACR,IAAA,EAAK,SAAA;AAAA,QACL,SAAA,EAAU,+HAAA;AAAA,QACV,OAAA,EAAS,QAAA;AAAA,QACT,YAAA,EAAY,WAAA;AAAA,QAEZ,yCAACE,aAAA,EAAA,EAAE;AAAA;AAAA;AACL,GAAA,EAEJ,CAAA;AAEJ;AAMO,MAAM,eAAA,GAAkB,CAAC,EAAE,QAAA,EAAS,KAA4B;AACrE,EAAA,uBACEJ,cAAA,CAACK,WAAI,EAAA,EAAG,GAAA,EAAI,SAAQ,OAAA,EAAQ,SAAA,EAAU,2BACnC,QAAA,EACH,CAAA;AAEJ;;;;;;;;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { X } from 'lucide-react';
|
|
3
|
+
import { c as cn } from './utils-CzYGxqbG.js';
|
|
4
|
+
import { B as Button } from './Button-DoOEJwa_.js';
|
|
5
|
+
import { T as Txt } from './Txt-AhytBlTj.js';
|
|
6
|
+
|
|
7
|
+
const ThreadList = ({ children, "aria-label": ariaLabel = "Threads", embedded = false }) => {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { className: cn("h-full w-full", !embedded && "pb-2 pl-2"), children: /* @__PURE__ */ jsx(
|
|
9
|
+
"nav",
|
|
10
|
+
{
|
|
11
|
+
"aria-label": ariaLabel,
|
|
12
|
+
className: cn(
|
|
13
|
+
"h-full overflow-y-auto p-1",
|
|
14
|
+
!embedded && "bg-surface3 rounded-studio-panel border border-border1/50"
|
|
15
|
+
),
|
|
16
|
+
children
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
};
|
|
20
|
+
const ThreadListNewItem = ({ as, href, to, children }) => {
|
|
21
|
+
return /* @__PURE__ */ jsx(Button, { as, href, to, variant: "ghost", className: "w-full justify-start rounded-xl", children });
|
|
22
|
+
};
|
|
23
|
+
const ThreadListSeparator = () => /* @__PURE__ */ jsx("div", { role: "separator", "aria-orientation": "horizontal", className: "-mx-1 my-1 h-px bg-border1/40" });
|
|
24
|
+
const ThreadListItems = ({ children }) => /* @__PURE__ */ jsx("ol", { className: "flex flex-col gap-px", "data-testid": "thread-list", children });
|
|
25
|
+
const ThreadListItem = ({
|
|
26
|
+
as,
|
|
27
|
+
href,
|
|
28
|
+
to,
|
|
29
|
+
isActive,
|
|
30
|
+
onClick,
|
|
31
|
+
onDelete,
|
|
32
|
+
deleteLabel = "delete",
|
|
33
|
+
className,
|
|
34
|
+
children
|
|
35
|
+
}) => {
|
|
36
|
+
return /* @__PURE__ */ jsxs("li", { className: "group relative", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
as,
|
|
41
|
+
href,
|
|
42
|
+
to,
|
|
43
|
+
onClick,
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
className: cn(
|
|
46
|
+
"min-h-form-md h-auto! w-full min-w-0 justify-start rounded-xl px-3 py-2 text-left",
|
|
47
|
+
onDelete && "pr-9",
|
|
48
|
+
isActive && "bg-surface4 text-neutral6",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
children: /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children })
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
onDelete && /* @__PURE__ */ jsx(
|
|
55
|
+
Button,
|
|
56
|
+
{
|
|
57
|
+
variant: "ghost",
|
|
58
|
+
size: "icon-sm",
|
|
59
|
+
className: "absolute right-1 top-1/2 -translate-y-1/2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",
|
|
60
|
+
onClick: onDelete,
|
|
61
|
+
"aria-label": deleteLabel,
|
|
62
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] });
|
|
66
|
+
};
|
|
67
|
+
const ThreadListEmpty = ({ children }) => {
|
|
68
|
+
return /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-sm", className: "text-neutral3 py-3 px-5", children });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { ThreadList as T, ThreadListEmpty as a, ThreadListItem as b, ThreadListItems as c, ThreadListNewItem as d, ThreadListSeparator as e };
|
|
72
|
+
//# sourceMappingURL=thread-list-CkgV4nYA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-list-CkgV4nYA.js","sources":["../src/ds/components/ThreadList/thread-list.tsx"],"sourcesContent":["import { X } from 'lucide-react';\nimport type { ElementType, MouseEvent, ReactNode } from 'react';\n\nimport { cn } from '../../../lib/utils';\nimport { Button } from '../Button';\nimport { Txt } from '../Txt';\n\nexport interface ThreadListProps {\n children: ReactNode;\n 'aria-label'?: string;\n /**\n * When true, drops the standalone block chrome (background, border, rounded corners, inset)\n * so the list can render flush inside an outer container without nesting a second box.\n */\n embedded?: boolean;\n}\n\nexport const ThreadList = ({ children, 'aria-label': ariaLabel = 'Threads', embedded = false }: ThreadListProps) => {\n return (\n <div className={cn('h-full w-full', !embedded && 'pb-2 pl-2')}>\n <nav\n aria-label={ariaLabel}\n className={cn(\n 'h-full overflow-y-auto p-1',\n !embedded && 'bg-surface3 rounded-studio-panel border border-border1/50',\n )}\n >\n {children}\n </nav>\n </div>\n );\n};\n\nexport interface ThreadListNewItemProps {\n as?: ElementType;\n href?: string;\n to?: string;\n children: ReactNode;\n}\n\nexport const ThreadListNewItem = ({ as, href, to, children }: ThreadListNewItemProps) => {\n return (\n <Button as={as} href={href} to={to} variant=\"ghost\" className=\"w-full justify-start rounded-xl\">\n {children}\n </Button>\n );\n};\n\nexport const ThreadListSeparator = () => (\n <div role=\"separator\" aria-orientation=\"horizontal\" className=\"-mx-1 my-1 h-px bg-border1/40\" />\n);\n\nexport interface ThreadListItemsProps {\n children: ReactNode;\n}\n\nexport const ThreadListItems = ({ children }: ThreadListItemsProps) => (\n <ol className=\"flex flex-col gap-px\" data-testid=\"thread-list\">\n {children}\n </ol>\n);\n\nexport interface ThreadListItemProps {\n as?: ElementType;\n href?: string;\n to?: string;\n isActive?: boolean;\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n onDelete?: () => void;\n deleteLabel?: string;\n className?: string;\n children: ReactNode;\n}\n\nexport const ThreadListItem = ({\n as,\n href,\n to,\n isActive,\n onClick,\n onDelete,\n deleteLabel = 'delete',\n className,\n children,\n}: ThreadListItemProps) => {\n return (\n <li className=\"group relative\">\n <Button\n as={as}\n href={href}\n to={to}\n onClick={onClick}\n variant=\"ghost\"\n className={cn(\n 'min-h-form-md h-auto! w-full min-w-0 justify-start rounded-xl px-3 py-2 text-left',\n onDelete && 'pr-9',\n isActive && 'bg-surface4 text-neutral6',\n className,\n )}\n >\n <span className=\"min-w-0 flex-1\">{children}</span>\n </Button>\n\n {onDelete && (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"absolute right-1 top-1/2 -translate-y-1/2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100\"\n onClick={onDelete}\n aria-label={deleteLabel}\n >\n <X />\n </Button>\n )}\n </li>\n );\n};\n\nexport interface ThreadListEmptyProps {\n children: ReactNode;\n}\n\nexport const ThreadListEmpty = ({ children }: ThreadListEmptyProps) => {\n return (\n <Txt as=\"p\" variant=\"ui-sm\" className=\"text-neutral3 py-3 px-5\">\n {children}\n </Txt>\n );\n};\n"],"names":[],"mappings":";;;;;;AAiBO,MAAM,UAAA,GAAa,CAAC,EAAE,QAAA,EAAU,cAAc,SAAA,GAAY,SAAA,EAAW,QAAA,GAAW,KAAA,EAAM,KAAuB;AAClH,EAAA,uBACE,GAAA,CAAC,SAAI,SAAA,EAAW,EAAA,CAAG,iBAAiB,CAAC,QAAA,IAAY,WAAW,CAAA,EAC1D,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,SAAA;AAAA,MACZ,SAAA,EAAW,EAAA;AAAA,QACT,4B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BAAA,EAAkB,QAAA,EAAS;AAAA;AAAA,KAC7C;AAAA,IAEC,QAAA,oBACC,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,OAAA;AAAA,QACR,IAAA,EAAK,SAAA;AAAA,QACL,SAAA,EAAU,+HAAA;AAAA,QACV,OAAA,EAAS,QAAA;AAAA,QACT,YAAA,EAAY,WAAA;AAAA,QAEZ,8BAAC,CAAA,EAAA,EAAE;AAAA;AAAA;AACL,GAAA,EAEJ,CAAA;AAEJ;AAMO,MAAM,eAAA,GAAkB,CAAC,EAAE,QAAA,EAAS,KAA4B;AACrE,EAAA,uBACE,GAAA,CAAC,OAAI,EAAA,EAAG,GAAA,EAAI,SAAQ,OAAA,EAAQ,SAAA,EAAU,2BACnC,QAAA,EACH,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "36.0.
|
|
4
|
+
"version": "36.1.0-alpha.1",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"react": ">=19.0.0",
|
|
103
103
|
"react-dom": ">=19.0.0",
|
|
104
104
|
"tailwindcss": "^4.0.0",
|
|
105
|
-
"@mastra/client-js": "^1.27.
|
|
106
|
-
"@mastra/react": "1.1.1"
|
|
105
|
+
"@mastra/client-js": "^1.27.1-alpha.1",
|
|
106
|
+
"@mastra/react": "1.1.2-alpha.1"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@storybook/addon-a11y": "^10.4.1",
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
142
142
|
"vitest": "4.1.8",
|
|
143
143
|
"@internal/lint": "0.0.108",
|
|
144
|
-
"@mastra/
|
|
145
|
-
"@mastra/core": "1.46.
|
|
146
|
-
"@mastra/
|
|
144
|
+
"@mastra/client-js": "^1.27.1-alpha.1",
|
|
145
|
+
"@mastra/core": "1.46.1-alpha.1",
|
|
146
|
+
"@mastra/react": "1.1.2-alpha.1"
|
|
147
147
|
},
|
|
148
148
|
"homepage": "https://mastra.ai",
|
|
149
149
|
"repository": {
|