@mastra/playground-ui 31.0.0-alpha.8 → 31.0.0-alpha.9

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,16 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 31.0.0-alpha.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed dropdowns, menus, comboboxes, and popovers being unclickable when opened inside a SideDialog (for example the dataset selector in the "Save as Dataset Item" panel on the Traces tab). These popups now render inside the dialog so they stay interactive within the modal drawer. ([#17479](https://github.com/mastra-ai/mastra/pull/17479))
8
+
9
+ - Updated dependencies [[`850af77`](https://github.com/mastra-ai/mastra/commit/850af7779cb87c350804488734544a5b1843de25), [`7b0d34c`](https://github.com/mastra-ai/mastra/commit/7b0d34cfe4a2fce22ac86ae17404685ff67a2ddb)]:
10
+ - @mastra/core@1.38.0-alpha.9
11
+ - @mastra/client-js@1.22.0-alpha.9
12
+ - @mastra/react@0.4.3-alpha.9
13
+
3
14
  ## 31.0.0-alpha.8
4
15
 
5
16
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -6505,6 +6505,17 @@ const comboboxStyles = {
6505
6505
  error: "text-ui-sm text-accent2"
6506
6506
  };
6507
6507
 
6508
+ const PortalContainerContext = React__namespace.createContext(null);
6509
+ function PortalContainerProvider({
6510
+ container,
6511
+ children
6512
+ }) {
6513
+ return /* @__PURE__ */ jsxRuntime.jsx(PortalContainerContext.Provider, { value: container, children });
6514
+ }
6515
+ function usePortalContainer() {
6516
+ return React__namespace.useContext(PortalContainerContext);
6517
+ }
6518
+
6508
6519
  const triggerVariantStyles = {
6509
6520
  default: comboboxStyles.triggerDefault,
6510
6521
  ghost: comboboxStyles.triggerGhost,
@@ -6527,6 +6538,8 @@ function Combobox({
6527
6538
  error
6528
6539
  }) {
6529
6540
  const selectedOption = options.find((option) => option.value === value) ?? null;
6541
+ const portalContainer = usePortalContainer();
6542
+ const resolvedContainer = container ?? portalContainer;
6530
6543
  const handleSelect = (item) => {
6531
6544
  if (item) {
6532
6545
  onValueChange?.(item.value);
@@ -6562,7 +6575,7 @@ function Combobox({
6562
6575
  ]
6563
6576
  }
6564
6577
  ),
6565
- /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Positioner, { align: "start", sideOffset: 4, className: comboboxStyles.positioner, children: /* @__PURE__ */ jsxRuntime.jsxs(combobox.Combobox.Popup, { className: comboboxStyles.popup, children: [
6578
+ /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { container: resolvedContainer, children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Positioner, { align: "start", sideOffset: 4, className: comboboxStyles.positioner, children: /* @__PURE__ */ jsxRuntime.jsxs(combobox.Combobox.Popup, { className: comboboxStyles.popup, children: [
6566
6579
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: comboboxStyles.searchContainer, children: [
6567
6580
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: comboboxStyles.searchIcon }),
6568
6581
  /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Input, { className: comboboxStyles.searchInput, placeholder: searchPlaceholder })
@@ -7102,30 +7115,34 @@ const SelectTrigger = React__namespace.forwardRef(
7102
7115
  );
7103
7116
  SelectTrigger.displayName = "SelectTrigger";
7104
7117
  const SelectContent = React__namespace.forwardRef(
7105
- ({ className, children, position: _position, container, side = "bottom", align = "start", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(select.Select.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
7106
- select.Select.Positioner,
7107
- {
7108
- className: "z-50 outline-none",
7109
- side,
7110
- align,
7111
- sideOffset,
7112
- alignItemWithTrigger: false,
7113
- children: /* @__PURE__ */ jsxRuntime.jsx(
7114
- select.Select.Popup,
7115
- {
7116
- ref,
7117
- className: cn(
7118
- "relative z-50 min-w-32 min-w-[var(--anchor-width)] max-h-dropdown-max-height max-h-[var(--available-height)] overflow-y-auto overflow-x-hidden rounded-xl border border-border1 bg-surface3 p-1 text-neutral4 shadow-dialog origin-[var(--transform-origin)]",
7119
- "data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95",
7120
- "data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
7121
- className
7122
- ),
7123
- ...props,
7124
- children: /* @__PURE__ */ jsxRuntime.jsx(select.Select.List, { children })
7125
- }
7126
- )
7127
- }
7128
- ) })
7118
+ ({ className, children, position: _position, container, side = "bottom", align = "start", sideOffset = 4, ...props }, ref) => {
7119
+ const portalContainer = usePortalContainer();
7120
+ const resolvedContainer = container ?? portalContainer;
7121
+ return /* @__PURE__ */ jsxRuntime.jsx(select.Select.Portal, { container: resolvedContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
7122
+ select.Select.Positioner,
7123
+ {
7124
+ className: "z-50 outline-none",
7125
+ side,
7126
+ align,
7127
+ sideOffset,
7128
+ alignItemWithTrigger: false,
7129
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7130
+ select.Select.Popup,
7131
+ {
7132
+ ref,
7133
+ className: cn(
7134
+ "relative z-50 min-w-32 min-w-[var(--anchor-width)] max-h-dropdown-max-height max-h-[var(--available-height)] overflow-y-auto overflow-x-hidden rounded-xl border border-border1 bg-surface3 p-1 text-neutral4 shadow-dialog origin-[var(--transform-origin)]",
7135
+ "data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95",
7136
+ "data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
7137
+ className
7138
+ ),
7139
+ ...props,
7140
+ children: /* @__PURE__ */ jsxRuntime.jsx(select.Select.List, { children })
7141
+ }
7142
+ )
7143
+ }
7144
+ ) });
7145
+ }
7129
7146
  );
7130
7147
  SelectContent.displayName = "SelectContent";
7131
7148
  const SelectItem = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -7548,47 +7565,54 @@ const DropdownMenuSubTrigger = React__namespace.forwardRef(
7548
7565
  );
7549
7566
  DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
7550
7567
  const DropdownMenuSubContent = React__namespace.forwardRef(
7551
- ({ className, align = "start", alignOffset = -4, side = "right", sideOffset = 0, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
7552
- menu.Menu.Positioner,
7553
- {
7554
- align,
7555
- alignOffset,
7556
- side,
7557
- sideOffset,
7558
- className: "z-50 outline-none",
7559
- children: /* @__PURE__ */ jsxRuntime.jsx(
7560
- menu.Menu.Popup,
7561
- {
7562
- ref,
7563
- "data-slot": "dropdown-menu-sub-content",
7564
- className: cn(popupClass, className),
7565
- ...props
7566
- }
7567
- )
7568
- }
7569
- ) })
7568
+ ({ className, align = "start", alignOffset = -4, side = "right", sideOffset = 0, ...props }, ref) => {
7569
+ const portalContainer = usePortalContainer();
7570
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { container: portalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
7571
+ menu.Menu.Positioner,
7572
+ {
7573
+ align,
7574
+ alignOffset,
7575
+ side,
7576
+ sideOffset,
7577
+ className: "z-50 outline-none",
7578
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7579
+ menu.Menu.Popup,
7580
+ {
7581
+ ref,
7582
+ "data-slot": "dropdown-menu-sub-content",
7583
+ className: cn(popupClass, className),
7584
+ ...props
7585
+ }
7586
+ )
7587
+ }
7588
+ ) });
7589
+ }
7570
7590
  );
7571
7591
  DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
7572
7592
  const DropdownMenuContent = React__namespace.forwardRef(
7573
- ({ className, container, align = "start", alignOffset = 0, side = "bottom", sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(
7574
- menu.Menu.Positioner,
7575
- {
7576
- align,
7577
- alignOffset,
7578
- side,
7579
- sideOffset,
7580
- className: "z-50 outline-none",
7581
- children: /* @__PURE__ */ jsxRuntime.jsx(
7582
- menu.Menu.Popup,
7583
- {
7584
- ref,
7585
- "data-slot": "dropdown-menu-content",
7586
- className: cn(popupClass, className),
7587
- ...props
7588
- }
7589
- )
7590
- }
7591
- ) })
7593
+ ({ className, container, align = "start", alignOffset = 0, side = "bottom", sideOffset = 8, ...props }, ref) => {
7594
+ const portalContainer = usePortalContainer();
7595
+ const resolvedContainer = container ?? portalContainer ?? void 0;
7596
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { container: resolvedContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
7597
+ menu.Menu.Positioner,
7598
+ {
7599
+ align,
7600
+ alignOffset,
7601
+ side,
7602
+ sideOffset,
7603
+ className: "z-50 outline-none",
7604
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7605
+ menu.Menu.Popup,
7606
+ {
7607
+ ref,
7608
+ "data-slot": "dropdown-menu-content",
7609
+ className: cn(popupClass, className),
7610
+ ...props
7611
+ }
7612
+ )
7613
+ }
7614
+ ) });
7615
+ }
7592
7616
  );
7593
7617
  DropdownMenuContent.displayName = "DropdownMenuContent";
7594
7618
  const DropdownMenuItem = React__namespace.forwardRef(
@@ -8645,9 +8669,11 @@ const PopoverTrigger = React__namespace.forwardRef(
8645
8669
  );
8646
8670
  PopoverTrigger.displayName = "PopoverTrigger";
8647
8671
  const PopoverContent = React__namespace.forwardRef(
8648
- ({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props }, ref) => {
8672
+ ({ className, container, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props }, ref) => {
8649
8673
  const classNameString = typeof className === "string" ? className : void 0;
8650
- return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
8674
+ const portalContainer = usePortalContainer();
8675
+ const resolvedContainer = container ?? portalContainer;
8676
+ return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { container: resolvedContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
8651
8677
  popover.Popover.Positioner,
8652
8678
  {
8653
8679
  align,
@@ -12279,6 +12305,7 @@ function SideDialogRoot({
12279
12305
  className
12280
12306
  }) {
12281
12307
  const isConfirmation = variant === "confirmation";
12308
+ const [portalHost, setPortalHost] = React__namespace.useState(null);
12282
12309
  return /* @__PURE__ */ jsxRuntime.jsx(
12283
12310
  Drawer,
12284
12311
  {
@@ -12323,7 +12350,8 @@ function SideDialogRoot({
12323
12350
  )
12324
12351
  }
12325
12352
  ),
12326
- /* @__PURE__ */ jsxRuntime.jsx(
12353
+ /* @__PURE__ */ jsxRuntime.jsx(DrawerInteractive, { render: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: setPortalHost, className: "absolute" }) }),
12354
+ /* @__PURE__ */ jsxRuntime.jsx(PortalContainerProvider, { container: portalHost, children: /* @__PURE__ */ jsxRuntime.jsx(
12327
12355
  "div",
12328
12356
  {
12329
12357
  className: cn("grid h-full", {
@@ -12331,7 +12359,7 @@ function SideDialogRoot({
12331
12359
  }),
12332
12360
  children
12333
12361
  }
12334
- )
12362
+ ) })
12335
12363
  ]
12336
12364
  }
12337
12365
  ) })