@platned/ui 0.9.2 → 0.9.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/dist/index.js CHANGED
@@ -6830,11 +6830,20 @@ function FullscreenSurface({
6830
6830
  className
6831
6831
  }) {
6832
6832
  const [node, setNode] = useState22(null);
6833
+ const [returnFocusTo] = useState22(
6834
+ () => typeof document === "undefined" ? null : document.activeElement
6835
+ );
6833
6836
  return /* @__PURE__ */ jsx62(DialogPrimitive3.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsx62(DialogPrimitive3.Portal, { children: /* @__PURE__ */ jsxs43(
6834
6837
  DialogPrimitive3.Content,
6835
6838
  {
6836
6839
  ref: setNode,
6837
6840
  "aria-describedby": void 0,
6841
+ onCloseAutoFocus: (event) => {
6842
+ if (returnFocusTo?.isConnected && returnFocusTo !== document.body) {
6843
+ event.preventDefault();
6844
+ returnFocusTo.focus();
6845
+ }
6846
+ },
6838
6847
  onEscapeKeyDown: (event) => void deferEscapeToInnerPopup(event),
6839
6848
  className: cn(
6840
6849
  "fixed inset-0 overflow-auto bg-default-secondary p-4 focus:outline-none lg:p-6",