@mastra/playground-ui 27.0.0-alpha.5 → 27.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 27.0.0-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Refined Combobox and Select trigger interactions with an active state and fixed value truncation when a leading badge is rendered. Refreshed PanelSeparator with a clearer hover/active affordance, an enlarged hit area, and a focus-visible accent. Removed the default `bg-surface2` background from `Threads` so consumers can control the surface color. ([#16269](https://github.com/mastra-ai/mastra/pull/16269))
8
+
9
+ - Updated dependencies [[`6742347`](https://github.com/mastra-ai/mastra/commit/6742347d71955d7639adc9ddf6ff8282de7ee3ba), [`7b0ad1f`](https://github.com/mastra-ai/mastra/commit/7b0ad1f5c53dc118c6da12ae82ae2587037dc2b8), [`62666c3`](https://github.com/mastra-ai/mastra/commit/62666c367eaeac3941ead454b1d38810cc855721), [`4af2160`](https://github.com/mastra-ai/mastra/commit/4af2160322f4718cac421930cce85641e9512389), [`136c959`](https://github.com/mastra-ai/mastra/commit/136c9592fb0eeb0cd212f28629d8a29b7557a2fc), [`4df7cc7`](https://github.com/mastra-ai/mastra/commit/4df7cc79342fd065fe7fdeef93c094db14b12bcd), [`284b0d7`](https://github.com/mastra-ai/mastra/commit/284b0d78d0edb306413447e5268007491006937c), [`aca3121`](https://github.com/mastra-ai/mastra/commit/aca31211233dac25459f140ea4fcfb3a5af64c18), [`9cdf38e`](https://github.com/mastra-ai/mastra/commit/9cdf38e58506e1109c8b38f97cd7770978a4218e), [`990851e`](https://github.com/mastra-ai/mastra/commit/990851edcb0e30be5c2c18b6532f1a876cc2d335), [`6068a6c`](https://github.com/mastra-ai/mastra/commit/6068a6c42950fad3ebfc92346417896ba60803d2), [`00106be`](https://github.com/mastra-ai/mastra/commit/00106bede59b81e5b0e9cd6aad8d3b5dbc336387), [`e2a079c`](https://github.com/mastra-ai/mastra/commit/e2a079cc3755b1895f7bd5dc36e9be81b11c7c22), [`534a456`](https://github.com/mastra-ai/mastra/commit/534a456a25e4df1e5407e7e632f4cb3b1fa14f9d), [`36bae07`](https://github.com/mastra-ai/mastra/commit/36bae07c0e70b1b3006f2fd20830e8883dcbd066)]:
10
+ - @mastra/core@1.33.0-alpha.7
11
+ - @mastra/client-js@1.18.0-alpha.7
12
+ - @mastra/react@0.2.36-alpha.7
13
+
14
+ ## 27.0.0-alpha.6
15
+
16
+ ### Patch Changes
17
+
18
+ - Fixed Studio streaming render behavior for interleaved reasoning and improved chat autoscroll during rapid output. ([#16331](https://github.com/mastra-ai/mastra/pull/16331))
19
+
20
+ - Updated dependencies [[`b560d6f`](https://github.com/mastra-ai/mastra/commit/b560d6f88b9b904b15c10f75c949eb145bc27684), [`f176145`](https://github.com/mastra-ai/mastra/commit/f1761458eaa602f59c5499bd0855ae7a5fd9baf3), [`d416efd`](https://github.com/mastra-ai/mastra/commit/d416efdee26c1755328e21cc62584f8566e21432), [`36b3bbf`](https://github.com/mastra-ai/mastra/commit/36b3bbf5a8d59f7e23d47e29340e76c681b4929c), [`b275631`](https://github.com/mastra-ai/mastra/commit/b275631dc10541a482b2e2d4a3e3cfa843bd5fa1)]:
21
+ - @mastra/core@1.33.0-alpha.6
22
+ - @mastra/react@0.2.36-alpha.6
23
+ - @mastra/client-js@1.18.0-alpha.6
24
+
3
25
  ## 27.0.0-alpha.5
4
26
 
5
27
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -3598,7 +3598,7 @@ const focusRing = {
3598
3598
  };
3599
3599
 
3600
3600
  const Threads = ({ children }) => {
3601
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "bg-surface2 min-h-full overflow-hidden", children });
3601
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "min-h-full overflow-hidden", children });
3602
3602
  };
3603
3603
  const ThreadLink = ({ children, as: Component = "a", href, className, prefetch, to }) => {
3604
3604
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -6078,13 +6078,12 @@ CollapsibleContent.displayName = CollapsiblePrimitive__namespace.CollapsibleCont
6078
6078
  const comboboxStyles = {
6079
6079
  /** Root wrapper */
6080
6080
  root: "flex flex-col gap-1.5",
6081
- /** Trigger — form input look (rounded-lg, single border, subtle hover/open state).
6082
- * Sized to mirror SelectTrigger: bg-transparent, no pill, no accent ring on focus. */
6081
+ /** Trigger — form input look, sized to mirror SelectTrigger. */
6083
6082
  trigger: cn(
6084
6083
  "inline-flex w-full min-w-32 select-none items-center justify-between gap-1.5 whitespace-nowrap",
6085
6084
  "rounded-lg border border-border1 bg-transparent px-2.5 text-ui-smd leading-ui-sm text-neutral4",
6086
6085
  "outline-none transition-colors duration-normal ease-out-custom",
6087
- "hover:bg-surface3 hover:text-neutral6 hover:border-border2",
6086
+ "hover:bg-surface3 hover:text-neutral6 hover:border-border2 active:bg-surface4",
6088
6087
  "focus:outline-none focus-visible:outline-none focus-visible:border-border2",
6089
6088
  "data-[popup-open]:bg-surface3 data-[popup-open]:text-neutral6 data-[popup-open]:border-border2",
6090
6089
  "disabled:cursor-not-allowed disabled:opacity-50"
@@ -6199,9 +6198,9 @@ function Combobox({
6199
6198
  className
6200
6199
  ),
6201
6200
  children: [
6202
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "truncate flex items-center gap-2", children: [
6201
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
6203
6202
  selectedOption?.start,
6204
- /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Value, { placeholder })
6203
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Value, { placeholder }) })
6205
6204
  ] }),
6206
6205
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: comboboxStyles.chevron })
6207
6206
  ]
@@ -6498,7 +6497,7 @@ const SelectTrigger = React__namespace.forwardRef(
6498
6497
  formElementSizes[size],
6499
6498
  "rounded-lg border border-border1 bg-transparent px-2.5 text-ui-smd leading-ui-sm text-neutral4",
6500
6499
  "outline-none transition-colors duration-normal ease-out-custom",
6501
- "hover:bg-surface3 hover:text-neutral6 hover:border-border2",
6500
+ "hover:bg-surface3 hover:text-neutral6 hover:border-border2 active:bg-surface4",
6502
6501
  "focus:outline-none focus-visible:outline-none focus-visible:border-border2",
6503
6502
  "data-[state=open]:bg-surface3 data-[state=open]:text-neutral6 data-[state=open]:border-border2",
6504
6503
  "data-[placeholder]:text-neutral3",
@@ -8230,18 +8229,30 @@ function PickMultiMenuItem({ field, tokens, onChange, open, onToggle, onClose })
8230
8229
  );
8231
8230
  }
8232
8231
 
8232
+ const SCROLL_END_THRESHOLD = 8;
8233
8233
  const useAutoscroll = (ref, { enabled = true }) => {
8234
8234
  const shouldScrollRef = React.useRef(enabled);
8235
+ const scrollFrameRef = React.useRef(null);
8236
+ const userScrollIntentRef = React.useRef(false);
8237
+ const userScrollIntentTimeoutRef = React.useRef(null);
8235
8238
  React.useEffect(() => {
8236
8239
  if (!enabled) return;
8237
8240
  if (!ref?.current) return;
8238
8241
  const area = ref.current;
8239
- const observer = new MutationObserver(() => {
8240
- if (shouldScrollRef.current) {
8241
- area.scrollTo({ top: area.scrollHeight, behavior: "smooth" });
8242
+ const scrollToEnd = () => {
8243
+ if (!shouldScrollRef.current) return;
8244
+ if (scrollFrameRef.current !== null) {
8245
+ cancelAnimationFrame(scrollFrameRef.current);
8242
8246
  }
8243
- });
8244
- observer.observe(area, {
8247
+ scrollFrameRef.current = requestAnimationFrame(() => {
8248
+ if (shouldScrollRef.current) {
8249
+ area.scrollTop = area.scrollHeight;
8250
+ }
8251
+ scrollFrameRef.current = null;
8252
+ });
8253
+ };
8254
+ const mutationObserver = new MutationObserver(scrollToEnd);
8255
+ mutationObserver.observe(area, {
8245
8256
  childList: true,
8246
8257
  // observe direct children changes
8247
8258
  subtree: true,
@@ -8249,21 +8260,73 @@ const useAutoscroll = (ref, { enabled = true }) => {
8249
8260
  characterData: true
8250
8261
  // observe text content changes
8251
8262
  });
8263
+ const resizeObserver = new ResizeObserver(scrollToEnd);
8264
+ resizeObserver.observe(area);
8265
+ const cancelPendingScroll = () => {
8266
+ if (scrollFrameRef.current !== null) {
8267
+ cancelAnimationFrame(scrollFrameRef.current);
8268
+ scrollFrameRef.current = null;
8269
+ }
8270
+ };
8271
+ const stopFollowing = () => {
8272
+ shouldScrollRef.current = false;
8273
+ cancelPendingScroll();
8274
+ };
8275
+ const registerUserScrollIntent = () => {
8276
+ userScrollIntentRef.current = true;
8277
+ if (userScrollIntentTimeoutRef.current !== null) {
8278
+ window.clearTimeout(userScrollIntentTimeoutRef.current);
8279
+ }
8280
+ userScrollIntentTimeoutRef.current = window.setTimeout(() => {
8281
+ userScrollIntentRef.current = false;
8282
+ userScrollIntentTimeoutRef.current = null;
8283
+ }, 250);
8284
+ };
8285
+ const handleWheel = (event) => {
8286
+ registerUserScrollIntent();
8287
+ if (event.deltaY < 0) {
8288
+ stopFollowing();
8289
+ }
8290
+ };
8291
+ const handleKeyDown = (event) => {
8292
+ registerUserScrollIntent();
8293
+ if (["ArrowUp", "PageUp", "Home"].includes(event.key)) {
8294
+ stopFollowing();
8295
+ }
8296
+ };
8252
8297
  const handleScroll = (e) => {
8253
8298
  const scrollElement = e.target;
8254
8299
  const currentPosition = scrollElement.scrollTop + scrollElement.clientHeight;
8255
8300
  const totalHeight = scrollElement.scrollHeight;
8256
- const isAtEnd = currentPosition >= totalHeight - 1;
8301
+ const isAtEnd = currentPosition >= totalHeight - SCROLL_END_THRESHOLD;
8257
8302
  if (isAtEnd) {
8258
8303
  shouldScrollRef.current = true;
8259
- } else {
8304
+ return;
8305
+ }
8306
+ if (userScrollIntentRef.current) {
8260
8307
  shouldScrollRef.current = false;
8308
+ cancelPendingScroll();
8261
8309
  }
8262
8310
  };
8311
+ area.addEventListener("wheel", handleWheel, { passive: true });
8312
+ area.addEventListener("touchmove", registerUserScrollIntent, { passive: true });
8313
+ area.addEventListener("pointerdown", registerUserScrollIntent);
8314
+ area.addEventListener("keydown", handleKeyDown);
8263
8315
  area.addEventListener("scroll", handleScroll);
8316
+ scrollToEnd();
8264
8317
  return () => {
8318
+ area.removeEventListener("wheel", handleWheel);
8319
+ area.removeEventListener("touchmove", registerUserScrollIntent);
8320
+ area.removeEventListener("pointerdown", registerUserScrollIntent);
8321
+ area.removeEventListener("keydown", handleKeyDown);
8265
8322
  area.removeEventListener("scroll", handleScroll);
8266
- observer.disconnect();
8323
+ mutationObserver.disconnect();
8324
+ resizeObserver.disconnect();
8325
+ cancelPendingScroll();
8326
+ if (userScrollIntentTimeoutRef.current !== null) {
8327
+ window.clearTimeout(userScrollIntentTimeoutRef.current);
8328
+ userScrollIntentTimeoutRef.current = null;
8329
+ }
8267
8330
  };
8268
8331
  }, [enabled, ref]);
8269
8332
  };
@@ -15590,10 +15653,31 @@ const PanelSeparator = () => {
15590
15653
  reactResizablePanels.Separator,
15591
15654
  {
15592
15655
  className: cn(
15593
- "w-1.5 bg-surface3",
15594
- "data-[separator='hover']:bg-surface4!",
15595
- "data-[separator='active']:bg-surface5!",
15596
- "focus:outline-hidden"
15656
+ "group/separator relative w-0 bg-transparent z-10",
15657
+ "focus:outline-hidden focus-visible:outline-hidden"
15658
+ ),
15659
+ children: /* @__PURE__ */ jsxRuntime.jsx(
15660
+ "span",
15661
+ {
15662
+ "aria-hidden": true,
15663
+ className: cn(
15664
+ "absolute inset-y-0 -left-1 -right-1 flex items-center justify-center",
15665
+ "cursor-col-resize touch-none"
15666
+ ),
15667
+ children: /* @__PURE__ */ jsxRuntime.jsx(
15668
+ "span",
15669
+ {
15670
+ className: cn(
15671
+ "block h-full w-px bg-border1 pointer-events-none",
15672
+ "transition-[width,background-color] duration-150 ease-out motion-reduce:transition-none",
15673
+ "group-hover/separator:w-0.5 group-hover/separator:bg-surface5",
15674
+ "group-data-[separator='hover']/separator:w-0.5 group-data-[separator='hover']/separator:bg-surface5",
15675
+ "group-data-[separator='active']/separator:w-0.5 group-data-[separator='active']/separator:bg-accent1",
15676
+ "group-focus-visible/separator:w-0.5 group-focus-visible/separator:bg-accent1"
15677
+ )
15678
+ }
15679
+ )
15680
+ }
15597
15681
  )
15598
15682
  }
15599
15683
  );