@ai-matrx/design-system 0.20.14 → 0.20.16

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/dist/index.cjs CHANGED
@@ -601,15 +601,23 @@ var useDrawerDirection = () => React3.useContext(DrawerDirectionContext);
601
601
  var Drawer = ({
602
602
  children,
603
603
  shouldScaleBackground = true,
604
+ onOpenChange,
604
605
  ...props
605
606
  }) => {
606
607
  const direction = props.direction ?? "bottom";
608
+ const handleOpenChange = (open) => {
609
+ if (open && typeof document !== "undefined" && document.activeElement instanceof HTMLElement) {
610
+ document.activeElement.blur();
611
+ }
612
+ onOpenChange?.(open);
613
+ };
607
614
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadixDialogModalProvider, { modal: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DrawerDirectionContext.Provider, { value: direction, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
608
615
  import_vaul.Drawer.Root,
609
616
  {
610
617
  modal: true,
611
618
  shouldScaleBackground,
612
619
  ...props,
620
+ onOpenChange: handleOpenChange,
613
621
  direction,
614
622
  children
615
623
  }