@mastra/playground-ui 22.0.0-alpha.2 → 22.0.0-alpha.3

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,19 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 22.0.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Consolidated Tab button styles into the Tab component, removing duplicated child selectors from TabList. Removed unused alignment prop. Active underline now uses the neutral4 design token. ([#15004](https://github.com/mastra-ai/mastra/pull/15004))
8
+
9
+ - Matched tooltip panel background to dropdown and default button surface in Studio. ([#15009](https://github.com/mastra-ai/mastra/pull/15009))
10
+
11
+ - Fixed Scores Over Time chart to always show a 24-hour view by collapsing multi-day ranges into hourly averages across all days in the selected period ([#14981](https://github.com/mastra-ai/mastra/pull/14981))
12
+
13
+ - Aligned dropdown menu panel background with default button styling in Studio. ([#15009](https://github.com/mastra-ai/mastra/pull/15009))
14
+
15
+ - Refactored chat error messages to use the Alert design system component instead of inline hardcoded styles, fixing text overflow on long error messages ([#15012](https://github.com/mastra-ai/mastra/pull/15012))
16
+
3
17
  ## 22.0.0-alpha.2
4
18
 
5
19
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -3671,13 +3671,13 @@ const TooltipContent = React__namespace.forwardRef(({ className, sideOffset = 4,
3671
3671
  ref,
3672
3672
  sideOffset,
3673
3673
  className: cn(
3674
- "z-50 overflow-hidden rounded-md bg-surface6 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3674
+ "z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3675
3675
  className
3676
3676
  ),
3677
3677
  ...props,
3678
3678
  children: [
3679
3679
  children,
3680
- /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "fill-surface6" })
3680
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { className: "fill-surface3" })
3681
3681
  ]
3682
3682
  }
3683
3683
  ) }));
@@ -3724,8 +3724,8 @@ const DialogContent = React__namespace.forwardRef(({ className, children, ...pro
3724
3724
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
3725
3725
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
3726
3726
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
3727
- "data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
3728
- "data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
3727
+ "data-[state=closed]:slide-out-to-bottom-4",
3728
+ "data-[state=open]:slide-in-from-bottom-4",
3729
3729
  className
3730
3730
  ),
3731
3731
  ...props,
@@ -13222,19 +13222,11 @@ const Tabs = ({ children, defaultTab, value, onValueChange, className }) => {
13222
13222
  return /* @__PURE__ */ jsxRuntime.jsx(RadixTabs__namespace.Root, { value: currentTab, onValueChange: handleTabChange, className: cn("overflow-y-auto", className), children });
13223
13223
  };
13224
13224
 
13225
- const TabList = ({ children, alignment = "left", className }) => {
13225
+ const TabList = ({ children, className }) => {
13226
13226
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx(
13227
13227
  RadixTabs__namespace.List,
13228
13228
  {
13229
- className: cn(
13230
- "flex items-center relative w-max min-w-full",
13231
- "text-ui-lg border-b border-border1",
13232
- "[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:border-b-2 [&>button]:border-transparent",
13233
- alignment === "full-width" && "[&>button]:flex-1",
13234
- `[&>button]:${transitions.colors} [&>button]:hover:text-neutral4`,
13235
- "[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:border-black/50 [&>button[data-state=active]]:dark:border-white/50",
13236
- className
13237
- ),
13229
+ className: cn("flex items-center relative w-max min-w-full", "text-ui-lg border-b border-border1", className),
13238
13230
  children
13239
13231
  }
13240
13232
  ) });
@@ -13246,11 +13238,12 @@ const Tab = ({ children, value, onClick, onClose, className }) => {
13246
13238
  {
13247
13239
  value,
13248
13240
  className: cn(
13249
- "text-sm py-3 px-2 text-neutral3 whitespace-nowrap shrink-0 flex items-center justify-center gap-1.5 outline-none",
13250
- transitions.all,
13241
+ "py-2 px-5 text-ui-md font-normal text-neutral3 border-b-2 border-transparent",
13242
+ "whitespace-nowrap shrink-0 flex items-center justify-center gap-1.5 outline-none",
13243
+ transitions.colors,
13251
13244
  focusRing.visible,
13252
13245
  "hover:text-neutral4",
13253
- "data-[state=active]:text-neutral5 data-[state=active]:border-b-2 data-[state=active]:border-black/50 data-[state=active]:dark:border-white/50",
13246
+ "data-[state=active]:text-neutral5 data-[state=active]:border-neutral3",
13254
13247
  className
13255
13248
  ),
13256
13249
  onClick,
@@ -14504,31 +14497,22 @@ const ErrorAwareText = () => {
14504
14497
  const trimmedText = text.trim();
14505
14498
  if (trimmedText.startsWith("__ERROR__:")) {
14506
14499
  const errorMessage = trimmedText.substring("__ERROR__:".length);
14507
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50", children: [
14508
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 shrink-0" }),
14509
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
14510
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-200 mb-1", children: "Error" }),
14511
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: errorMessage })
14512
- ] })
14500
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant: "destructive", children: [
14501
+ /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { as: "h5", children: "Error" }),
14502
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDescription, { as: "p", children: errorMessage })
14513
14503
  ] });
14514
14504
  } else if (trimmedText.startsWith("Error:")) {
14515
14505
  const errorMessage = trimmedText.substring("Error:".length).trim();
14516
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50", children: [
14517
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 shrink-0" }),
14518
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
14519
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-200 mb-1", children: "Error" }),
14520
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: errorMessage })
14521
- ] })
14506
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant: "destructive", children: [
14507
+ /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { as: "h5", children: "Error" }),
14508
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDescription, { as: "p", children: errorMessage })
14522
14509
  ] });
14523
14510
  }
14524
14511
  return /* @__PURE__ */ jsxRuntime.jsx(MarkdownText, {});
14525
14512
  } catch {
14526
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50", children: [
14527
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 shrink-0" }),
14528
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
14529
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-red-800 dark:text-red-200 mb-1", children: "Error" }),
14530
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: String(text) })
14531
- ] })
14513
+ return /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant: "destructive", children: [
14514
+ /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { as: "h5", children: "Error" }),
14515
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDescription, { as: "p", children: String(text) })
14532
14516
  ] });
14533
14517
  }
14534
14518
  };
@@ -27571,7 +27555,7 @@ const DropdownMenuSubTrigger = React__namespace.forwardRef(({ className, inset,
27571
27555
  {
27572
27556
  ref,
27573
27557
  className: cn(
27574
- "dark:hover:bg-white/15 dark:focus:bg-white/15 dark:active:bg-white/20 dark:data-[state=open]:bg-white/15 hover:bg-black/10 focus:bg-black/10 active:bg-black/15 data-[state=open]:bg-black/10 flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 focus-visible:outline-hidden focus-visible:ring-0",
27558
+ "hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-[state=open]:bg-surface4 flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 focus-visible:outline-hidden focus-visible:ring-0",
27575
27559
  inset && "pl-8",
27576
27560
  className
27577
27561
  ),
@@ -27588,7 +27572,7 @@ const DropdownMenuSubContent = React__namespace.forwardRef(({ className, ...prop
27588
27572
  {
27589
27573
  ref,
27590
27574
  className: cn(
27591
- "dark:bg-white/10 bg-surface5 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 bz-50 min-w-32 overflow-auto overflow-x-hidden rounded-lg",
27575
+ "bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-32 overflow-auto overflow-x-hidden rounded-lg",
27592
27576
  className
27593
27577
  ),
27594
27578
  ...props
@@ -27602,7 +27586,7 @@ const DropdownMenuContent = React__namespace.forwardRef(({ className, container,
27602
27586
  ref,
27603
27587
  sideOffset,
27604
27588
  className: cn(
27605
- "bg-surface5 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md",
27589
+ "bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md",
27606
27590
  className
27607
27591
  ),
27608
27592
  ...props
@@ -27615,7 +27599,7 @@ const DropdownMenuItem = React__namespace.forwardRef(({ className, ...props }, r
27615
27599
  {
27616
27600
  ref,
27617
27601
  className: cn(
27618
- "relative flex cursor-pointer select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white dark:hover:bg-white/15 dark:focus:bg-white/15 dark:active:bg-white/20 hover:text-neutral6 focus:text-neutral6 hover:bg-black/10 focus:bg-black/10 active:bg-black/15 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0",
27602
+ "relative flex cursor-pointer select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0",
27619
27603
  "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100",
27620
27604
  className
27621
27605
  ),
@@ -27628,7 +27612,7 @@ const DropdownMenuCheckboxItem = React__namespace.forwardRef(({ className, child
27628
27612
  {
27629
27613
  ref,
27630
27614
  className: cn(
27631
- "dark:hover:bg-white/15 dark:focus:bg-white/15 dark:active:bg-white/20 dark:hover:text-white dark:focus:text-white hover:bg-black/10 focus:bg-black/10 active:bg-black/15 hover:text-neutral6 focus:text-neutral6 relative flex w-full cursor-pointer select-none items-center gap-4 rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",
27615
+ "hover:bg-surface4 focus:bg-surface4 active:bg-surface5 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 relative flex w-full cursor-pointer select-none items-center gap-4 rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",
27632
27616
  className
27633
27617
  ),
27634
27618
  checked,
@@ -27645,7 +27629,7 @@ const DropdownMenuRadioItem = React__namespace.forwardRef(({ className, children
27645
27629
  {
27646
27630
  ref,
27647
27631
  className: cn(
27648
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white dark:hover:bg-white/15 dark:focus:bg-white/15 dark:active:bg-white/20 hover:text-neutral6 focus:text-neutral6 hover:bg-black/10 focus:bg-black/10 active:bg-black/15 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",
27632
+ "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",
27649
27633
  className
27650
27634
  ),
27651
27635
  ...props,
@@ -44546,35 +44530,38 @@ function useScoresMetrics() {
44546
44530
  })
44547
44531
  )
44548
44532
  );
44549
- const bucketMap = /* @__PURE__ */ new Map();
44550
- const rangeSpansDays = timestamp.end.toDateString() !== timestamp.start.toDateString();
44533
+ const hourBuckets = /* @__PURE__ */ new Map();
44551
44534
  for (let i = 0; i < scorerNames.length; i++) {
44552
44535
  const scorerId = scorerNames[i];
44553
44536
  const series = timeSeriesResults[i]?.series ?? [];
44554
44537
  for (const s of series) {
44555
44538
  for (const point of s.points) {
44556
44539
  const ts = new Date(point.timestamp);
44557
- const key = ts.toISOString();
44558
- if (!bucketMap.has(key)) {
44559
- bucketMap.set(key, {
44560
- time: rangeSpansDays ? ts.toLocaleString("en-US", {
44561
- month: "short",
44562
- day: "numeric",
44563
- hour: "2-digit",
44564
- minute: "2-digit",
44565
- hour12: false
44566
- }) : ts.toLocaleTimeString("en-US", {
44567
- hour: "2-digit",
44568
- minute: "2-digit",
44569
- hour12: false
44570
- })
44571
- });
44540
+ const hourKey = ts.toLocaleTimeString("en-US", {
44541
+ hour: "2-digit",
44542
+ minute: "2-digit",
44543
+ hour12: false
44544
+ });
44545
+ if (!hourBuckets.has(hourKey)) {
44546
+ hourBuckets.set(hourKey, /* @__PURE__ */ new Map());
44572
44547
  }
44573
- bucketMap.get(key)[scorerId] = +point.value.toFixed(2);
44548
+ const scorerMap = hourBuckets.get(hourKey);
44549
+ if (!scorerMap.has(scorerId)) {
44550
+ scorerMap.set(scorerId, { sum: 0, count: 0 });
44551
+ }
44552
+ const acc = scorerMap.get(scorerId);
44553
+ acc.sum += point.value;
44554
+ acc.count += 1;
44574
44555
  }
44575
44556
  }
44576
44557
  }
44577
- const overTimeData = Array.from(bucketMap.entries()).sort(([a], [b]) => a.localeCompare(b)).map(([, point]) => point);
44558
+ const overTimeData = Array.from(hourBuckets.entries()).sort(([a], [b]) => a.localeCompare(b)).map(([hourKey, scorerMap]) => {
44559
+ const point = { time: hourKey };
44560
+ for (const [scorerId, acc] of scorerMap) {
44561
+ point[scorerId] = +(acc.sum / acc.count).toFixed(2);
44562
+ }
44563
+ return point;
44564
+ });
44578
44565
  return {
44579
44566
  summaryData,
44580
44567
  overTimeData,
@@ -56957,21 +56944,9 @@ function MainSidebarProvider({ children }) {
56957
56944
  return /* @__PURE__ */ jsxRuntime.jsx(MainSidebarContext.Provider, { value: contextValue, children });
56958
56945
  }
56959
56946
 
56960
- function MainSidebarRoot({ children, className, footerSlot }) {
56947
+ function MainSidebarRoot({ children, className }) {
56961
56948
  const { state, toggleSidebar } = useMainSidebar();
56962
56949
  const isCollapsed = state === "collapsed";
56963
- React.useEffect(() => {
56964
- const handleKeyDown = (event) => {
56965
- if (event.ctrlKey && event.key === "b") {
56966
- event.preventDefault();
56967
- toggleSidebar();
56968
- }
56969
- };
56970
- document.addEventListener("keydown", handleKeyDown);
56971
- return () => {
56972
- document.removeEventListener("keydown", handleKeyDown);
56973
- };
56974
- }, [toggleSidebar]);
56975
56950
  return /* @__PURE__ */ jsxRuntime.jsxs(
56976
56951
  "div",
56977
56952
  {
@@ -56986,43 +56961,6 @@ function MainSidebarRoot({ children, className, footerSlot }) {
56986
56961
  ),
56987
56962
  children: [
56988
56963
  children,
56989
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface1 grid sticky bottom-0 pb-3", children: [
56990
- /* @__PURE__ */ jsxRuntime.jsx(MainSidebarNavSeparator, {}),
56991
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-1", children: [
56992
- !isCollapsed && footerSlot,
56993
- /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
56994
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
56995
- "button",
56996
- {
56997
- onClick: toggleSidebar,
56998
- className: cn(
56999
- "inline-flex w-auto items-center text-neutral3 h-8 px-3 rounded-md",
57000
- "hover:bg-surface4 hover:text-neutral5",
57001
- "transition-all duration-normal ease-out-custom",
57002
- "focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring",
57003
- "[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&_svg]:transition-transform [&_svg]:duration-normal"
57004
- ),
57005
- "aria-label": "Toggle sidebar",
57006
- children: /* @__PURE__ */ jsxRuntime.jsx(
57007
- lucideReact.PanelRightIcon,
57008
- {
57009
- className: cn({
57010
- "rotate-180": isCollapsed
57011
- })
57012
- }
57013
- )
57014
- }
57015
- ) }),
57016
- /* @__PURE__ */ jsxRuntime.jsxs(TooltipContent, { children: [
57017
- "Toggle Sidebar",
57018
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]", children: [
57019
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyboardIcon, {}),
57020
- " Ctrl+B"
57021
- ] })
57022
- ] })
57023
- ] })
57024
- ] })
57025
- ] }),
57026
56964
  /* @__PURE__ */ jsxRuntime.jsx(
57027
56965
  "button",
57028
56966
  {
@@ -57039,6 +56977,55 @@ function MainSidebarRoot({ children, className, footerSlot }) {
57039
56977
  );
57040
56978
  }
57041
56979
 
56980
+ function MainSidebarTrigger({ className }) {
56981
+ const { state, toggleSidebar } = useMainSidebar();
56982
+ const isCollapsed = state === "collapsed";
56983
+ React.useEffect(() => {
56984
+ const handleKeyDown = (event) => {
56985
+ if (event.ctrlKey && event.key === "b") {
56986
+ event.preventDefault();
56987
+ toggleSidebar();
56988
+ }
56989
+ };
56990
+ document.addEventListener("keydown", handleKeyDown);
56991
+ return () => {
56992
+ document.removeEventListener("keydown", handleKeyDown);
56993
+ };
56994
+ }, [toggleSidebar]);
56995
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
56996
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
56997
+ "button",
56998
+ {
56999
+ onClick: toggleSidebar,
57000
+ className: cn(
57001
+ "inline-flex w-auto items-center text-neutral3 h-8 px-3 rounded-md",
57002
+ "hover:bg-surface4 hover:text-neutral5",
57003
+ "transition-all duration-normal ease-out-custom",
57004
+ "focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring",
57005
+ "[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&_svg]:transition-transform [&_svg]:duration-normal",
57006
+ className
57007
+ ),
57008
+ "aria-label": "Toggle sidebar",
57009
+ children: /* @__PURE__ */ jsxRuntime.jsx(
57010
+ lucideReact.PanelRightIcon,
57011
+ {
57012
+ className: cn({
57013
+ "rotate-180": isCollapsed
57014
+ })
57015
+ }
57016
+ )
57017
+ }
57018
+ ) }),
57019
+ /* @__PURE__ */ jsxRuntime.jsxs(TooltipContent, { children: [
57020
+ "Toggle Sidebar",
57021
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]", children: [
57022
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyboardIcon, {}),
57023
+ " Ctrl+B"
57024
+ ] })
57025
+ ] })
57026
+ ] });
57027
+ }
57028
+
57042
57029
  const MainSidebar = Object.assign(MainSidebarRoot, {
57043
57030
  Bottom: MainSidebarBottom,
57044
57031
  Nav: MainSidebarNav,
@@ -57046,7 +57033,8 @@ const MainSidebar = Object.assign(MainSidebarRoot, {
57046
57033
  NavLink: MainSidebarNavLink,
57047
57034
  NavHeader: MainSidebarNavHeader,
57048
57035
  NavList: MainSidebarNavList,
57049
- NavSeparator: MainSidebarNavSeparator
57036
+ NavSeparator: MainSidebarNavSeparator,
57037
+ Trigger: MainSidebarTrigger
57050
57038
  });
57051
57039
 
57052
57040
  function PageHeader({ title, description, icon, className }) {
@@ -59983,6 +59971,7 @@ exports.MainContentLayout = MainContentLayout;
59983
59971
  exports.MainHeader = MainHeader;
59984
59972
  exports.MainSidebar = MainSidebar;
59985
59973
  exports.MainSidebarProvider = MainSidebarProvider;
59974
+ exports.MainSidebarTrigger = MainSidebarTrigger;
59986
59975
  exports.MarkdownRenderer = MarkdownRenderer;
59987
59976
  exports.MastraPackagesInfo = MastraPackagesInfo;
59988
59977
  exports.MastraVersionFooter = MastraVersionFooter;