@mastra/playground-ui 25.0.0 → 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 CHANGED
@@ -1,5 +1,58 @@
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
+
3
56
  ## 25.0.0
4
57
 
5
58
  ### Minor 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
- icon ?? defaultIcon,
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;