Socket
Socket
Sign inDemoInstall

@reach/dialog

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reach/dialog - npm Package Compare versions

Comparing version 0.8.6 to 0.9.0

1

dist/dialog.cjs.development.js

@@ -179,2 +179,3 @@ 'use strict';

var onClick = _ref3.onClick,
onKeyDown = _ref3.onKeyDown,
props = _objectWithoutPropertiesLoose(_ref3, ["onClick", "onKeyDown"]);

@@ -181,0 +182,0 @@

2

dist/dialog.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react"),n=e(o),r=e(require("@reach/portal")),t=require("@reach/utils"),i=e(require("react-focus-lock")),a=require("react-remove-scroll");function c(e,o){if(null==e)return{};var n,r,t={},i=Object.keys(e);for(r=0;r<i.length;r++)o.indexOf(n=i[r])>=0||(t[n]=e[n]);return t}require("prop-types");var u=o.forwardRef((function(e,i){var a=e.isOpen,u=void 0===a||a,s=c(e,["isOpen"]);return o.useEffect((function(){return t.checkStyles("dialog")}),[]),u?n.createElement(r,{"data-reach-dialog-wrapper":""},n.createElement(l,Object.assign({ref:i},s))):null})),l=o.forwardRef((function(e,r){var u=e.allowPinchZoom,l=e.initialFocusRef,s=e.onClick,f=e.onDismiss,d=void 0===f?t.noop:f,p=e.onMouseDown,v=e.onKeyDown,m=c(e,["allowPinchZoom","initialFocusRef","onClick","onDismiss","onMouseDown","onKeyDown"]),w=o.useRef(null),h=o.useRef(null),g=t.useForkedRef(h,r),E=o.useCallback((function(){l&&l.current&&l.current.focus()}),[l]);return o.useEffect((function(){return h.current?(o=[],n=[],r=t.getOwnerDocument(e=h.current)||document,e?(Array.prototype.forEach.call(r.querySelectorAll("body > *"),(function(r){var t,i;if(r!==(null===(t=e.parentNode)||void 0===t||null===(i=t.parentNode)||void 0===i?void 0:i.parentNode)){var a=r.getAttribute("aria-hidden");null!==a&&"false"!==a||(o.push(a),n.push(r),r.setAttribute("aria-hidden","true"))}})),function(){n.forEach((function(e,n){var r=o[n];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}))}):t.noop):void 0;var e,o,n,r}),[]),n.createElement(i,{autoFocus:!0,returnFocus:!0,onActivation:E},n.createElement(a.RemoveScroll,{allowPinchZoom:u},n.createElement("div",Object.assign({},m,{ref:g,"data-reach-dialog-overlay":"",onClick:t.wrapEvent(s,(function(e){w.current===e.target&&(e.stopPropagation(),d(e))})),onKeyDown:t.wrapEvent(v,(function(e){"Escape"===e.key&&(e.stopPropagation(),d(e))})),onMouseDown:t.wrapEvent(p,(function(e){w.current=e.target}))}))))})),s=o.forwardRef((function(e,o){var r=e.onClick,i=c(e,["onClick","onKeyDown"]);return n.createElement("div",Object.assign({"aria-modal":"true",role:"dialog",tabIndex:-1},i,{ref:o,"data-reach-dialog-content":"",onClick:t.wrapEvent(r,(function(e){e.stopPropagation()}))}))})),f=o.forwardRef((function(e,o){var r=e.isOpen,i=e.onDismiss,a=void 0===i?t.noop:i,l=e.initialFocusRef,f=e.allowPinchZoom,d=c(e,["isOpen","onDismiss","initialFocusRef","allowPinchZoom"]);return n.createElement(u,{initialFocusRef:l,allowPinchZoom:f,isOpen:r,onDismiss:a},n.createElement(s,Object.assign({ref:o},d)))}));exports.Dialog=f,exports.DialogContent=s,exports.DialogOverlay=u,exports.default=f;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react"),n=e(o),r=e(require("@reach/portal")),t=require("@reach/utils"),i=e(require("react-focus-lock")),a=require("react-remove-scroll");function c(e,o){if(null==e)return{};var n,r,t={},i=Object.keys(e);for(r=0;r<i.length;r++)o.indexOf(n=i[r])>=0||(t[n]=e[n]);return t}e(require("prop-types"));var u=o.forwardRef((function(e,i){var a=e.isOpen,u=void 0===a||a,s=c(e,["isOpen"]);return o.useEffect((function(){return t.checkStyles("dialog")}),[]),u?n.createElement(r,{"data-reach-dialog-wrapper":""},n.createElement(l,Object.assign({ref:i},s))):null})),l=o.forwardRef((function(e,r){var u=e.allowPinchZoom,l=e.initialFocusRef,s=e.onClick,f=e.onDismiss,d=void 0===f?t.noop:f,p=e.onMouseDown,v=e.onKeyDown,m=c(e,["allowPinchZoom","initialFocusRef","onClick","onDismiss","onMouseDown","onKeyDown"]),w=o.useRef(null),h=o.useRef(null),g=t.useForkedRef(h,r),E=o.useCallback((function(){l&&l.current&&l.current.focus()}),[l]);return o.useEffect((function(){return h.current?(o=[],n=[],r=t.getOwnerDocument(e=h.current)||document,e?(Array.prototype.forEach.call(r.querySelectorAll("body > *"),(function(r){var t,i;if(r!==(null===(t=e.parentNode)||void 0===t||null===(i=t.parentNode)||void 0===i?void 0:i.parentNode)){var a=r.getAttribute("aria-hidden");null!==a&&"false"!==a||(o.push(a),n.push(r),r.setAttribute("aria-hidden","true"))}})),function(){n.forEach((function(e,n){var r=o[n];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}))}):t.noop):void 0;var e,o,n,r}),[]),n.createElement(i,{autoFocus:!0,returnFocus:!0,onActivation:E},n.createElement(a.RemoveScroll,{allowPinchZoom:u},n.createElement("div",Object.assign({},m,{ref:g,"data-reach-dialog-overlay":"",onClick:t.wrapEvent(s,(function(e){w.current===e.target&&(e.stopPropagation(),d(e))})),onKeyDown:t.wrapEvent(v,(function(e){"Escape"===e.key&&(e.stopPropagation(),d(e))})),onMouseDown:t.wrapEvent(p,(function(e){w.current=e.target}))}))))})),s=o.forwardRef((function(e,o){var r=e.onClick,i=c(e,["onClick","onKeyDown"]);return n.createElement("div",Object.assign({"aria-modal":"true",role:"dialog",tabIndex:-1},i,{ref:o,"data-reach-dialog-content":"",onClick:t.wrapEvent(r,(function(e){e.stopPropagation()}))}))})),f=o.forwardRef((function(e,o){var r=e.isOpen,i=e.onDismiss,a=void 0===i?t.noop:i,l=e.initialFocusRef,f=e.allowPinchZoom,d=c(e,["isOpen","onDismiss","initialFocusRef","allowPinchZoom"]);return n.createElement(u,{initialFocusRef:l,allowPinchZoom:f,isOpen:r,onDismiss:a},n.createElement(s,Object.assign({ref:o},d)))}));exports.Dialog=f,exports.DialogContent=s,exports.DialogOverlay=u,exports.default=f;
//# sourceMappingURL=dialog.cjs.production.min.js.map

@@ -172,2 +172,3 @@ import React, { forwardRef, useEffect, useRef, useCallback } from 'react';

var onClick = _ref3.onClick,
onKeyDown = _ref3.onKeyDown,
props = _objectWithoutPropertiesLoose(_ref3, ["onClick", "onKeyDown"]);

@@ -174,0 +175,0 @@

@@ -0,8 +1,7 @@

'use strict';
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dialog.cjs.production.min.js')
module.exports = require('./dialog.cjs.production.min.js');
} else {
module.exports = require('./dialog.cjs.development.js')
}
module.exports = require('./dialog.cjs.development.js');
}
{
"name": "@reach/dialog",
"version": "0.8.6",
"version": "0.9.0",
"description": "Accessible React Modal Dialog.",

@@ -13,9 +13,7 @@ "author": "React Training <hello@reacttraining.com>",

"scripts": {
"build": "yarn clean && yarn compile",
"clean": "rm -rf ./dist",
"compile": "cross-env NODE_ENV=production tsdx build --format=cjs,esm --tsconfig tsconfig.build.json"
"build": "ts-node ../../scripts/build"
},
"dependencies": {
"@reach/portal": "^0.8.6",
"@reach/utils": "^0.8.6",
"@reach/portal": "^0.9.0",
"@reach/utils": "^0.9.0",
"prop-types": "^15.7.2",

@@ -38,3 +36,3 @@ "react-focus-lock": "^2.2.1",

],
"gitHead": "0c71a018a11055b17815f0fb127cdcd981cd760e"
"gitHead": "0c789bb48554bf13c62dd09210ebdf2f9af33d30"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc