@mastra/playground-ui 32.0.2-alpha.0 → 32.0.2-alpha.1

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,11 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 32.0.2-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed dropdown, combobox, select, and popover popups silently failing to render when opened outside a side panel (most visibly the model and provider pickers in the chat composer). The shared portal-container resolver now always falls back to the document body instead of leaking an unrenderable value. ([#17560](https://github.com/mastra-ai/mastra/pull/17560))
8
+
3
9
  ## 32.0.2-alpha.0
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -6505,15 +6505,16 @@ const comboboxStyles = {
6505
6505
  error: "text-ui-sm text-accent2"
6506
6506
  };
6507
6507
 
6508
- const PortalContainerContext = React__namespace.createContext(null);
6508
+ const PortalContainerContext = React__namespace.createContext(void 0);
6509
6509
  function PortalContainerProvider({
6510
6510
  container,
6511
6511
  children
6512
6512
  }) {
6513
- return /* @__PURE__ */ jsxRuntime.jsx(PortalContainerContext.Provider, { value: container, children });
6513
+ return /* @__PURE__ */ jsxRuntime.jsx(PortalContainerContext.Provider, { value: container ?? void 0, children });
6514
6514
  }
6515
- function usePortalContainer() {
6516
- return React__namespace.useContext(PortalContainerContext);
6515
+ function usePortalContainer(container) {
6516
+ const fromContext = React__namespace.useContext(PortalContainerContext);
6517
+ return container ?? fromContext ?? void 0;
6517
6518
  }
6518
6519
 
6519
6520
  const triggerVariantStyles = {
@@ -6538,8 +6539,7 @@ function Combobox({
6538
6539
  error
6539
6540
  }) {
6540
6541
  const selectedOption = options.find((option) => option.value === value) ?? null;
6541
- const portalContainer = usePortalContainer();
6542
- const resolvedContainer = container ?? portalContainer ?? void 0;
6542
+ const resolvedContainer = usePortalContainer(container);
6543
6543
  const handleSelect = (item) => {
6544
6544
  if (item) {
6545
6545
  onValueChange?.(item.value);
@@ -7116,9 +7116,8 @@ const SelectTrigger = React__namespace.forwardRef(
7116
7116
  SelectTrigger.displayName = "SelectTrigger";
7117
7117
  const SelectContent = React__namespace.forwardRef(
7118
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(
7119
+ const resolvedContainer = usePortalContainer(container);
7120
+ return /* @__PURE__ */ jsxRuntime.jsx(select.Select.Portal, { container: resolvedContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
7122
7121
  select.Select.Positioner,
7123
7122
  {
7124
7123
  className: "z-50 outline-none",
@@ -7566,8 +7565,8 @@ const DropdownMenuSubTrigger = React__namespace.forwardRef(
7566
7565
  DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
7567
7566
  const DropdownMenuSubContent = React__namespace.forwardRef(
7568
7567
  ({ 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(
7568
+ const resolvedContainer = usePortalContainer();
7569
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { container: resolvedContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
7571
7570
  menu.Menu.Positioner,
7572
7571
  {
7573
7572
  align,
@@ -7591,8 +7590,7 @@ const DropdownMenuSubContent = React__namespace.forwardRef(
7591
7590
  DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
7592
7591
  const DropdownMenuContent = React__namespace.forwardRef(
7593
7592
  ({ className, container, align = "start", alignOffset = 0, side = "bottom", sideOffset = 8, ...props }, ref) => {
7594
- const portalContainer = usePortalContainer();
7595
- const resolvedContainer = container ?? portalContainer ?? void 0;
7593
+ const resolvedContainer = usePortalContainer(container);
7596
7594
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { container: resolvedContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
7597
7595
  menu.Menu.Positioner,
7598
7596
  {
@@ -8671,9 +8669,8 @@ PopoverTrigger.displayName = "PopoverTrigger";
8671
8669
  const PopoverContent = React__namespace.forwardRef(
8672
8670
  ({ className, container, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props }, ref) => {
8673
8671
  const classNameString = typeof className === "string" ? className : void 0;
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(
8672
+ const resolvedContainer = usePortalContainer(container);
8673
+ return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { container: resolvedContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
8677
8674
  popover.Popover.Positioner,
8678
8675
  {
8679
8676
  align,