@mastra/playground-ui 25.0.0-alpha.6 → 25.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/dist/index.cjs.js +20 -94
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -68
- package/dist/index.es.js +22 -94
- package/dist/index.es.js.map +1 -1
- package/dist/src/ds/components/Notice/notice-root.d.ts +1 -1
- package/dist/src/ds/components/Notice/notice.stories.d.ts +2 -0
- package/dist/src/index.d.ts +0 -2
- package/package.json +14 -12
- package/dist/src/ds/components/CombinedButtons/combined-buttons.d.ts +0 -6
- package/dist/src/ds/components/CombinedButtons/combined-buttons.stories.d.ts +0 -10
- package/dist/src/ds/components/CombinedButtons/index.d.ts +0 -1
- package/dist/src/ds/components/Notification/index.d.ts +0 -1
- package/dist/src/ds/components/Notification/notification.d.ts +0 -10
- package/dist/src/ds/components/Notification/notification.stories.d.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,114 @@
|
|
|
1
1
|
# @mastra/playground-ui
|
|
2
2
|
|
|
3
|
+
## 25.1.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Removed the deprecated `Notification` component. Use `Notice` for inline persistent context (errors, empty states) and `toast` (from `@mastra/playground-ui`'s sonner wrapper) for transient feedback (success messages, confirmations). ([#16033](https://github.com/mastra-ai/mastra/pull/16033))
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
// Before
|
|
11
|
+
<Notification isVisible={true} type="error">Failed to load.</Notification>
|
|
12
|
+
|
|
13
|
+
// After — inline persistent context
|
|
14
|
+
<Notice variant="destructive">Failed to load.</Notice>
|
|
15
|
+
|
|
16
|
+
// Before
|
|
17
|
+
<Notification isVisible={true}>Saved successfully!</Notification>
|
|
18
|
+
|
|
19
|
+
// After — transient feedback
|
|
20
|
+
toast.info('Saved successfully');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- Removed the `CombinedButtons` component. Use `ButtonsGroup` with `spacing="close"` for the same segmented-style cluster of toggle buttons. ([#16035](https://github.com/mastra-ai/mastra/pull/16035))
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
// Before
|
|
27
|
+
<CombinedButtons>
|
|
28
|
+
<Button>Agent</Button>
|
|
29
|
+
<Button>Model</Button>
|
|
30
|
+
</CombinedButtons>
|
|
31
|
+
|
|
32
|
+
// After
|
|
33
|
+
<ButtonsGroup spacing="close">
|
|
34
|
+
<Button>Agent</Button>
|
|
35
|
+
<Button>Model</Button>
|
|
36
|
+
</ButtonsGroup>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Added support for icon-and-description layout in `Notice` by making `title` optional. When omitted, the notice renders as a single row with icon and description, useful for inline contextual messages. ([#16033](https://github.com/mastra-ai/mastra/pull/16033))
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// Before — title required
|
|
45
|
+
<Notice variant="info" title="Heads up">Some message.</Notice>
|
|
46
|
+
|
|
47
|
+
// After — title optional, single-row layout
|
|
48
|
+
<Notice variant="info">Some message.</Notice>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`6dcd65f`](https://github.com/mastra-ai/mastra/commit/6dcd65f2a34069e6dc43ba35f1d11119b9b40bef), [`1c2dda8`](https://github.com/mastra-ai/mastra/commit/1c2dda805fbfccc0abf55d4cb20cc34402dc3f0c)]:
|
|
52
|
+
- @mastra/core@1.31.1-alpha.0
|
|
53
|
+
- @mastra/client-js@1.16.1-alpha.0
|
|
54
|
+
- @mastra/react@0.2.34-alpha.0
|
|
55
|
+
|
|
56
|
+
## 25.0.0
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- Refactored Button component to use a single `cva` (class-variance-authority) variant config instead of nested manual maps. Consolidated `IconButton` into `Button` via `size="icon-sm|icon-md|icon-lg"` and removed the `IconButton` export. Replaced `variant="light"` and `variant="inputLike"` with `variant="default"` (no behavior change for default styling). Added `cta` and `outline` variants and unified active/hover styles between text- and icon-mode buttons. ([#15985](https://github.com/mastra-ai/mastra/pull/15985))
|
|
61
|
+
|
|
62
|
+
**Why:** A single source of truth for variants means consistent visuals, fewer drift bugs, simpler maintenance, and a more predictable surface for AI agents — single-variant cva is the dominant shadcn pattern across DS components in this repo (`Card`, `Input`, `Label`, `Textarea`, `StatusBadge`).
|
|
63
|
+
|
|
64
|
+
**Migration:**
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
// Before
|
|
68
|
+
import { IconButton } from '@mastra/playground-ui';
|
|
69
|
+
<IconButton><Settings /></IconButton>
|
|
70
|
+
<Button variant="light">…</Button>
|
|
71
|
+
<Combobox variant="inputLike" />
|
|
72
|
+
|
|
73
|
+
// After
|
|
74
|
+
import { Button } from '@mastra/playground-ui';
|
|
75
|
+
<Button size="icon-md"><Settings /></Button>
|
|
76
|
+
<Button variant="default">…</Button>
|
|
77
|
+
<Combobox variant="default" />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- Removed `<Alert>` in favor of `<Notice>`. The two components had significant visual and behavioral overlap; `<Notice>` is now the single banner primitive and supports every previous `<Alert>` use case. ([#15791](https://github.com/mastra-ai/mastra/pull/15791))
|
|
81
|
+
|
|
82
|
+
`<Notice>` is also redesigned with a flatter API: `title` and `icon` are now props, each variant ships a default icon, an optional `action` prop renders a button aligned to the title, and a new `note` variant has been added alongside `warning`, `destructive`, `info`, and `success`. Theme tokens (`notice-warning`, `notice-destructive`, `notice-info`, `notice-success`, `notice-note`) replace the previous hardcoded colors.
|
|
83
|
+
|
|
84
|
+
**Migration**
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
// Before
|
|
88
|
+
<Alert variant="warning">
|
|
89
|
+
<AlertTitle>Provider not connected</AlertTitle>
|
|
90
|
+
<AlertDescription as="p">Set the API key environment variable.</AlertDescription>
|
|
91
|
+
</Alert>
|
|
92
|
+
|
|
93
|
+
// After
|
|
94
|
+
<Notice variant="warning" title="Provider not connected">
|
|
95
|
+
<Notice.Message>Set the API key environment variable.</Notice.Message>
|
|
96
|
+
</Notice>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Removed the "Avg Score" KPI card from the Metrics dashboard and the avg-score summary from the Scores card. ([#15967](https://github.com/mastra-ai/mastra/pull/15967))
|
|
102
|
+
|
|
103
|
+
- Fixed row click behavior in the dataset experiments compare view. Clicking a row while selection mode is active now toggles the row's selection instead of navigating to the experiment. Clicking directly on the checkbox no longer also triggers the row click handler. ([#15492](https://github.com/mastra-ai/mastra/pull/15492))
|
|
104
|
+
|
|
105
|
+
- Aligned AlertDialog visual styling with Dialog component for design system consistency. AlertDialog now uses the same surface tokens, border radius, shadow, animation curves, and typography scale as Dialog. The accessibility primitive remains separate (preserves `role="alertdialog"` and explicit Action/Cancel semantics) — only the visual shell was synced. Also added `AlertDialog.Body` for parity with Dialog. ([#15988](https://github.com/mastra-ai/mastra/pull/15988))
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [[`1723e09`](https://github.com/mastra-ai/mastra/commit/1723e099829892419ddbfe49287acfeac2522724), [`629f9e9`](https://github.com/mastra-ai/mastra/commit/629f9e9a7e56aa8f129515a3923c5813298790c7), [`25168fb`](https://github.com/mastra-ai/mastra/commit/25168fb9c1de9db7f8171df4f58ceb842c53aa29), [`ab34b5a`](https://github.com/mastra-ai/mastra/commit/ab34b5a2191b8e4353df1dbf7b9155e7d6628d79), [`5fb6c2a`](https://github.com/mastra-ai/mastra/commit/5fb6c2a95c1843cc231704b91354311fc1f34a71), [`2b0f355`](https://github.com/mastra-ai/mastra/commit/2b0f3553be3e9e5524da539a66e5cf82668440a4), [`394f0cf`](https://github.com/mastra-ai/mastra/commit/394f0cfc31e6b4d801219fdef2e9cc69e5bc8682), [`b2deb29`](https://github.com/mastra-ai/mastra/commit/b2deb29412b300c868655b5840463614fbb7962d), [`66644be`](https://github.com/mastra-ai/mastra/commit/66644beac1aa560f0e417956ff007c89341dc382), [`e109607`](https://github.com/mastra-ai/mastra/commit/e10960749251e34d46b480a20648c490fd30381b), [`310b953`](https://github.com/mastra-ai/mastra/commit/310b95345f302dcd5ba3ed862bdc96f059d44122), [`3d7f709`](https://github.com/mastra-ai/mastra/commit/3d7f709b615e588050bb6283c4ee5cfe2978cbde), [`48a42f1`](https://github.com/mastra-ai/mastra/commit/48a42f114a4006a95e0b7a1b5ad1a24815a175c2), [`8091c7c`](https://github.com/mastra-ai/mastra/commit/8091c7c944d15e13fef6d61b6cfd903f158d4006), [`2c83efc`](https://github.com/mastra-ai/mastra/commit/2c83efc4482b3efe50830e3b8b4ba9a8d219edff), [`43f0e1d`](https://github.com/mastra-ai/mastra/commit/43f0e1d5d5a74ba6fc746f2ad89ebe0c64777a7d), [`57b8756`](https://github.com/mastra-ai/mastra/commit/57b87567523484825ef145a2c927f947d1306253), [`43f0e1d`](https://github.com/mastra-ai/mastra/commit/43f0e1d5d5a74ba6fc746f2ad89ebe0c64777a7d), [`da0b9e2`](https://github.com/mastra-ai/mastra/commit/da0b9e2ba7ecc560213b426d6c097fe63946086e), [`282a10c`](https://github.com/mastra-ai/mastra/commit/282a10c9446e9922afe80e10e3770481c8ac8a28), [`04151c7`](https://github.com/mastra-ai/mastra/commit/04151c7dcea934b4fe9076708a23fac161195414), [`8091c7c`](https://github.com/mastra-ai/mastra/commit/8091c7c944d15e13fef6d61b6cfd903f158d4006)]:
|
|
108
|
+
- @mastra/core@1.31.0
|
|
109
|
+
- @mastra/client-js@1.16.0
|
|
110
|
+
- @mastra/react@0.2.33
|
|
111
|
+
|
|
3
112
|
## 25.0.0-alpha.6
|
|
4
113
|
|
|
5
114
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -8693,21 +8693,6 @@ function Sections({ children, className }) {
|
|
|
8693
8693
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid gap-12", className), children });
|
|
8694
8694
|
}
|
|
8695
8695
|
|
|
8696
|
-
const CombinedButtons = ({ className, children }) => {
|
|
8697
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8698
|
-
"div",
|
|
8699
|
-
{
|
|
8700
|
-
className: cn(
|
|
8701
|
-
"flex items-center text-ui-sm border border-border1 rounded-lg overflow-hidden",
|
|
8702
|
-
"[&>button]:border-0 [&>button:not(:first-child)]:border-l [&>button:not(:first-child)]:border-border1",
|
|
8703
|
-
"[&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg",
|
|
8704
|
-
className
|
|
8705
|
-
),
|
|
8706
|
-
children
|
|
8707
|
-
}
|
|
8708
|
-
);
|
|
8709
|
-
};
|
|
8710
|
-
|
|
8711
8696
|
function DatePicker({ className, classNames, showOutsideDays = true, ...props }) {
|
|
8712
8697
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8713
8698
|
reactDayPicker.DayPicker,
|
|
@@ -10147,82 +10132,6 @@ const MainSidebar = Object.assign(MainSidebarRoot, {
|
|
|
10147
10132
|
Trigger: MainSidebarTrigger
|
|
10148
10133
|
});
|
|
10149
10134
|
|
|
10150
|
-
function Notification({
|
|
10151
|
-
children,
|
|
10152
|
-
className,
|
|
10153
|
-
isVisible,
|
|
10154
|
-
autoDismiss = true,
|
|
10155
|
-
dismissTime = 5e3,
|
|
10156
|
-
dismissible = true,
|
|
10157
|
-
type = "info"
|
|
10158
|
-
}) {
|
|
10159
|
-
const [localIsVisible, setLocalIsVisible] = React.useState(isVisible);
|
|
10160
|
-
const [isAnimatingOut, setIsAnimatingOut] = React.useState(false);
|
|
10161
|
-
React.useEffect(() => {
|
|
10162
|
-
if (dismissible && autoDismiss && isVisible) {
|
|
10163
|
-
const timer = setTimeout(() => {
|
|
10164
|
-
handleDismiss();
|
|
10165
|
-
}, dismissTime);
|
|
10166
|
-
return () => clearTimeout(timer);
|
|
10167
|
-
}
|
|
10168
|
-
}, [autoDismiss, isVisible, dismissTime, dismissible]);
|
|
10169
|
-
React.useEffect(() => {
|
|
10170
|
-
if (isVisible) {
|
|
10171
|
-
setIsAnimatingOut(false);
|
|
10172
|
-
setLocalIsVisible(true);
|
|
10173
|
-
}
|
|
10174
|
-
}, [isVisible]);
|
|
10175
|
-
const handleDismiss = () => {
|
|
10176
|
-
setIsAnimatingOut(true);
|
|
10177
|
-
setTimeout(() => {
|
|
10178
|
-
setLocalIsVisible(false);
|
|
10179
|
-
setIsAnimatingOut(false);
|
|
10180
|
-
}, 200);
|
|
10181
|
-
};
|
|
10182
|
-
if (!localIsVisible) return null;
|
|
10183
|
-
const typeStyles = {
|
|
10184
|
-
info: "bg-surface4 border-border1",
|
|
10185
|
-
error: "bg-accent2Darker border-accent2/20",
|
|
10186
|
-
success: "bg-accent1Darker border-accent1/30",
|
|
10187
|
-
warning: "bg-accent6Darker border-accent6/30"
|
|
10188
|
-
};
|
|
10189
|
-
const iconStyles = {
|
|
10190
|
-
info: "text-accent5",
|
|
10191
|
-
error: "text-accent2",
|
|
10192
|
-
success: "text-accent1",
|
|
10193
|
-
warning: "text-accent6"
|
|
10194
|
-
};
|
|
10195
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10196
|
-
"div",
|
|
10197
|
-
{
|
|
10198
|
-
className: cn(
|
|
10199
|
-
"grid grid-cols-[auto_1fr_auto] gap-3 rounded-xl border py-2.5 px-3.5 text-ui-md text-neutral4 items-start",
|
|
10200
|
-
"shadow-card",
|
|
10201
|
-
transitions.all,
|
|
10202
|
-
isAnimatingOut ? "animate-out fade-out-0 slide-out-to-right-2 duration-200" : "animate-in fade-in-0 slide-in-from-right-2 duration-300",
|
|
10203
|
-
typeStyles[type],
|
|
10204
|
-
className
|
|
10205
|
-
),
|
|
10206
|
-
children: [
|
|
10207
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("shrink-0 mt-0.5", iconStyles[type]), children: type === "error" || type === "warning" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangleIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4" }) }),
|
|
10208
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-2 items-start min-w-0", children }),
|
|
10209
|
-
dismissible && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10210
|
-
Button,
|
|
10211
|
-
{
|
|
10212
|
-
variant: "ghost",
|
|
10213
|
-
className: cn("h-6 w-6 p-0 shrink-0", transitions.colors, "hover:bg-surface5"),
|
|
10214
|
-
onClick: handleDismiss,
|
|
10215
|
-
children: [
|
|
10216
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "h-4 w-4" }),
|
|
10217
|
-
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children: "Dismiss" })
|
|
10218
|
-
]
|
|
10219
|
-
}
|
|
10220
|
-
)
|
|
10221
|
-
]
|
|
10222
|
-
}
|
|
10223
|
-
);
|
|
10224
|
-
}
|
|
10225
|
-
|
|
10226
10135
|
function PageHeaderDescription({ children, isLoading }) {
|
|
10227
10136
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10228
10137
|
"p",
|
|
@@ -11484,6 +11393,25 @@ const variantConfig = {
|
|
|
11484
11393
|
};
|
|
11485
11394
|
function NoticeRoot({ variant, title, icon, action, children, className }) {
|
|
11486
11395
|
const { icon: defaultIcon, classes } = variantConfig[variant];
|
|
11396
|
+
const resolvedIcon = icon ?? defaultIcon;
|
|
11397
|
+
if (!title) {
|
|
11398
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11399
|
+
"div",
|
|
11400
|
+
{
|
|
11401
|
+
className: cn(
|
|
11402
|
+
"relative @container flex items-start gap-2 rounded-2xl border p-3 [&>svg]:size-4",
|
|
11403
|
+
"animate-in fade-in-0 slide-in-from-top-2 duration-200",
|
|
11404
|
+
classes,
|
|
11405
|
+
className
|
|
11406
|
+
),
|
|
11407
|
+
children: [
|
|
11408
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 shrink-0 [&>svg]:size-4", children: resolvedIcon }),
|
|
11409
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 text-ui-md leading-ui-md", children }),
|
|
11410
|
+
action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "self-start ml-auto", children: action })
|
|
11411
|
+
]
|
|
11412
|
+
}
|
|
11413
|
+
);
|
|
11414
|
+
}
|
|
11487
11415
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11488
11416
|
"div",
|
|
11489
11417
|
{
|
|
@@ -11495,7 +11423,7 @@ function NoticeRoot({ variant, title, icon, action, children, className }) {
|
|
|
11495
11423
|
),
|
|
11496
11424
|
children: [
|
|
11497
11425
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-4 items-center gap-2 [&>svg]:size-4", children: [
|
|
11498
|
-
|
|
11426
|
+
resolvedIcon,
|
|
11499
11427
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-sm font-medium uppercase tracking-wide leading-none", children: title })
|
|
11500
11428
|
] }),
|
|
11501
11429
|
action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-2 top-2 hidden @md:block", children: action }),
|
|
@@ -19248,7 +19176,6 @@ exports.CollapsiblePanel = CollapsiblePanel;
|
|
|
19248
19176
|
exports.CollapsibleTrigger = CollapsibleTrigger;
|
|
19249
19177
|
exports.Column = Column;
|
|
19250
19178
|
exports.Columns = Columns;
|
|
19251
|
-
exports.CombinedButtons = CombinedButtons;
|
|
19252
19179
|
exports.Combobox = Combobox;
|
|
19253
19180
|
exports.Command = Command;
|
|
19254
19181
|
exports.CommandDialog = CommandDialog;
|
|
@@ -19403,7 +19330,6 @@ exports.NetlifyIcon = NetlifyIcon;
|
|
|
19403
19330
|
exports.NoDataPageLayout = NoDataPageLayout;
|
|
19404
19331
|
exports.NoLogsInfo = NoLogsInfo;
|
|
19405
19332
|
exports.Notice = Notice;
|
|
19406
|
-
exports.Notification = Notification;
|
|
19407
19333
|
exports.OPERATORS = OPERATORS;
|
|
19408
19334
|
exports.OPERATOR_LABELS = OPERATOR_LABELS;
|
|
19409
19335
|
exports.OpenAIIcon = OpenAIIcon;
|