@zag-js/focus-trap
Advanced tools
Comparing version 0.70.0 to 0.71.0
@@ -1,34 +0,13 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
'use strict'; | ||
var domQuery = require('@zag-js/dom-query'); | ||
var focusTrap = require('focus-trap'); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
trapFocus: () => trapFocus | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_dom_query = require("@zag-js/dom-query"); | ||
var import_focus_trap = require("focus-trap"); | ||
function trapFocus(el, options = {}) { | ||
let trap; | ||
(0, import_dom_query.nextTick)(() => { | ||
domQuery.nextTick(() => { | ||
const contentEl = typeof el === "function" ? el() : el; | ||
if (!contentEl) return; | ||
trap = (0, import_focus_trap.createFocusTrap)(contentEl, { | ||
trap = focusTrap.createFocusTrap(contentEl, { | ||
escapeDeactivates: false, | ||
@@ -38,3 +17,3 @@ allowOutsideClick: true, | ||
returnFocusOnDeactivate: true, | ||
document: (0, import_dom_query.getDocument)(contentEl), | ||
document: domQuery.getDocument(contentEl), | ||
fallbackFocus: contentEl, | ||
@@ -52,6 +31,3 @@ ...options | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
trapFocus | ||
}); | ||
//# sourceMappingURL=index.js.map | ||
exports.trapFocus = trapFocus; |
{ | ||
"name": "@zag-js/focus-trap", | ||
"version": "0.70.0", | ||
"version": "0.71.0", | ||
"description": "Focus trap utility", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"focus-trap": "7.6.0", | ||
"@zag-js/dom-query": "0.70.0" | ||
"@zag-js/dom-query": "0.71.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
4611
7
61
+ Added@zag-js/dom-query@0.71.0(transitive)
- Removed@zag-js/dom-query@0.70.0(transitive)
Updated@zag-js/dom-query@0.71.0