@reach/dialog
Advanced tools
Comparing version 0.18.0-pre.3 to 0.18.0-pre.4
# @reach/dialog | ||
## 0.18.0-pre.4 | ||
### Minor Changes | ||
- We no longer check that our internal styles are included by looking for a defined CSS custom property. You can still include our base styles as before, but this removes the need to define `--reach-<pkg>` in your own stylesheets to silence dev warnings. ([`69df3a03`](https://github.com/reach/reach-ui/commit/69df3a038d12c0e731778c9ac6e18ba6f81fbb49)) | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@reach/utils@0.18.0-pre.4` | ||
- `@reach/polymorphic@0.18.0-pre.4` | ||
- `@reach/portal@0.18.0-pre.4` | ||
## 0.18.0-pre.3 | ||
@@ -4,0 +17,0 @@ |
"use strict"; | ||
/** | ||
* @reach/dialog v0.18.0-pre.3 | ||
* @reach/dialog v0.18.0-pre.4 | ||
* | ||
@@ -89,3 +89,2 @@ * Copyright (c) 2018-2022, React Training LLC | ||
]); | ||
(0, import_utils.useCheckStyles)("dialog"); | ||
React.useEffect(() => { | ||
@@ -92,0 +91,0 @@ if (isOpen) { |
@@ -1,1 +0,1 @@ | ||
"use strict";var B=Object.create;var D=Object.defineProperty,j=Object.defineProperties,z=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,Q=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var A=(e,o,a)=>o in e?D(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,f=(e,o)=>{for(var a in o||(o={}))R.call(o,a)&&A(e,a,o[a]);if(y)for(var a of y(o))I.call(o,a)&&A(e,a,o[a]);return e},v=(e,o)=>j(e,G(o));var g=(e,o)=>{var a={};for(var n in e)R.call(e,n)&&o.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&y)for(var n of y(e))o.indexOf(n)<0&&I.call(e,n)&&(a[n]=e[n]);return a};var U=(e,o)=>{for(var a in o)D(e,a,{get:o[a],enumerable:!0})},x=(e,o,a,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of J(o))!R.call(e,t)&&t!==a&&D(e,t,{get:()=>o[t],enumerable:!(n=z(o,t))||n.enumerable});return e};var k=(e,o,a)=>(a=e!=null?B(Q(e)):{},x(o||!e||!e.__esModule?D(a,"default",{value:e,enumerable:!0}):a,e)),X=e=>x(D({},"__esModule",{value:!0}),e);var ee={};U(ee,{Dialog:()=>S,DialogContent:()=>b,DialogInner:()=>C,DialogOverlay:()=>O,unstable_DialogWrapper:()=>w});module.exports=X(ee);var r=k(require("react")),N=require("@reach/portal"),l=require("@reach/utils"),F=k(require("react-focus-lock")),H=require("react-remove-scroll");var[Y,L]=(0,l.createContext)("DialogContext",{isOpen:!1});function w(n){var t=n,{isOpen:e=!0,children:o}=t,a=g(t,["isOpen","children"]);return(0,l.useCheckStyles)("dialog"),r.useEffect(()=>{e?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame(()=>{window.__REACH_DISABLE_TOOLTIPS=!1})},[e]),r.createElement(N.Portal,f({"data-reach-dialog-wrapper":"","data-state":e?"open":"closed"},a),r.createElement(Y,{isOpen:e},o))}w.displayName="unstable_DialogWrapper";var C=r.forwardRef(function(oe,W){var E=oe,{allowPinchZoom:o,as:a="div",dangerouslyBypassFocusLock:n,dangerouslyBypassScrollLock:t,initialFocusRef:s,onClick:i,onDismiss:d=l.noop,onKeyDown:c,onMouseDown:u,unstable_lockFocusAcrossFrames:m}=E,T=g(E,["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"]);let{isOpen:P}=L("DialogInner"),ae=m!==void 0,_=r.useRef(null),h=r.useRef(null),M=(0,l.useComposedRefs)(h,W),V=r.useCallback(()=>{s&&s.current&&s.current.focus()},[s]);function K(p){_.current===p.target&&(p.stopPropagation(),d(p))}function Z(p){p.key==="Escape"&&(p.stopPropagation(),d(p))}function q(p){_.current=p.target}return r.useEffect(()=>h.current?$(h.current):void 0,[]),r.createElement(F.default,{autoFocus:!0,returnFocus:!0,onActivation:V,disabled:n!=null?n:!P,crossFrame:m!=null?m:!0},r.createElement(H.RemoveScroll,{allowPinchZoom:o,enabled:t!=null?!t:P},r.createElement(a,v(f({},T),{ref:M,"data-reach-dialog-inner":"","data-state":P?"open":"closed",onClick:(0,l.composeEventHandlers)(i,K),onKeyDown:(0,l.composeEventHandlers)(c,Z),onMouseDown:(0,l.composeEventHandlers)(u,q)}))))});C.displayName="DialogInner";var O=r.forwardRef(function(s,t){var i=s,{as:o="div",isOpen:a=!0}=i,n=g(i,["as","isOpen"]);return a?r.createElement(w,{isOpen:a},r.createElement(C,f({"data-reach-dialog-overlay":"",ref:t,as:o},n))):null});O.displayName="DialogOverlay";var b=r.forwardRef(function(i,s){var d=i,{as:o="div",onClick:a,onKeyDown:n}=d,t=g(d,["as","onClick","onKeyDown"]);let{isOpen:c}=L("DialogContent");return r.createElement(o,v(f({"aria-modal":"true",role:"dialog",tabIndex:-1},t),{ref:s,"data-reach-dialog-content":"","data-state":c?"open":"closed",onClick:(0,l.composeEventHandlers)(a,u=>{u.stopPropagation()})}))});b.displayName="DialogContent";var S=r.forwardRef(function(d,i){var c=d,{allowPinchZoom:o=!1,initialFocusRef:a,isOpen:n,onDismiss:t=l.noop}=c,s=g(c,["allowPinchZoom","initialFocusRef","isOpen","onDismiss"]);return r.createElement(O,{allowPinchZoom:o,initialFocusRef:a,isOpen:n,onDismiss:t},r.createElement(b,f({ref:i},s)))});S.displayName="Dialog";function $(e){let o=[],a=[],n=(0,l.getOwnerDocument)(e);return e?(Array.prototype.forEach.call(n.querySelectorAll("body > *"),t=>{var c,u;let s=(u=(c=e.parentNode)==null?void 0:c.parentNode)==null?void 0:u.parentNode;if(t===s)return;let i=t.getAttribute("aria-hidden");i!==null&&i!=="false"||(o.push(i),a.push(t),t.setAttribute("aria-hidden","true"))}),()=>{a.forEach((t,s)=>{let i=o[s];i===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",i)})}):l.noop}0&&(module.exports={Dialog,DialogContent,DialogInner,DialogOverlay,unstable_DialogWrapper}); | ||
"use strict";var B=Object.create;var D=Object.defineProperty,j=Object.defineProperties,z=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,Q=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var A=(e,o,a)=>o in e?D(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,f=(e,o)=>{for(var a in o||(o={}))R.call(o,a)&&A(e,a,o[a]);if(y)for(var a of y(o))I.call(o,a)&&A(e,a,o[a]);return e},v=(e,o)=>j(e,G(o));var g=(e,o)=>{var a={};for(var n in e)R.call(e,n)&&o.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&y)for(var n of y(e))o.indexOf(n)<0&&I.call(e,n)&&(a[n]=e[n]);return a};var U=(e,o)=>{for(var a in o)D(e,a,{get:o[a],enumerable:!0})},x=(e,o,a,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of J(o))!R.call(e,t)&&t!==a&&D(e,t,{get:()=>o[t],enumerable:!(n=z(o,t))||n.enumerable});return e};var N=(e,o,a)=>(a=e!=null?B(Q(e)):{},x(o||!e||!e.__esModule?D(a,"default",{value:e,enumerable:!0}):a,e)),X=e=>x(D({},"__esModule",{value:!0}),e);var ee={};U(ee,{Dialog:()=>T,DialogContent:()=>b,DialogInner:()=>C,DialogOverlay:()=>O,unstable_DialogWrapper:()=>w});module.exports=X(ee);var r=N(require("react")),k=require("@reach/portal"),l=require("@reach/utils"),F=N(require("react-focus-lock")),H=require("react-remove-scroll");var[Y,L]=(0,l.createContext)("DialogContext",{isOpen:!1});function w(n){var t=n,{isOpen:e=!0,children:o}=t,a=g(t,["isOpen","children"]);return r.useEffect(()=>{e?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame(()=>{window.__REACH_DISABLE_TOOLTIPS=!1})},[e]),r.createElement(k.Portal,f({"data-reach-dialog-wrapper":"","data-state":e?"open":"closed"},a),r.createElement(Y,{isOpen:e},o))}w.displayName="unstable_DialogWrapper";var C=r.forwardRef(function(oe,W){var E=oe,{allowPinchZoom:o,as:a="div",dangerouslyBypassFocusLock:n,dangerouslyBypassScrollLock:t,initialFocusRef:s,onClick:i,onDismiss:d=l.noop,onKeyDown:c,onMouseDown:u,unstable_lockFocusAcrossFrames:m}=E,S=g(E,["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"]);let{isOpen:P}=L("DialogInner"),ae=m!==void 0,_=r.useRef(null),h=r.useRef(null),M=(0,l.useComposedRefs)(h,W),V=r.useCallback(()=>{s&&s.current&&s.current.focus()},[s]);function K(p){_.current===p.target&&(p.stopPropagation(),d(p))}function Z(p){p.key==="Escape"&&(p.stopPropagation(),d(p))}function q(p){_.current=p.target}return r.useEffect(()=>h.current?$(h.current):void 0,[]),r.createElement(F.default,{autoFocus:!0,returnFocus:!0,onActivation:V,disabled:n!=null?n:!P,crossFrame:m!=null?m:!0},r.createElement(H.RemoveScroll,{allowPinchZoom:o,enabled:t!=null?!t:P},r.createElement(a,v(f({},S),{ref:M,"data-reach-dialog-inner":"","data-state":P?"open":"closed",onClick:(0,l.composeEventHandlers)(i,K),onKeyDown:(0,l.composeEventHandlers)(c,Z),onMouseDown:(0,l.composeEventHandlers)(u,q)}))))});C.displayName="DialogInner";var O=r.forwardRef(function(s,t){var i=s,{as:o="div",isOpen:a=!0}=i,n=g(i,["as","isOpen"]);return a?r.createElement(w,{isOpen:a},r.createElement(C,f({"data-reach-dialog-overlay":"",ref:t,as:o},n))):null});O.displayName="DialogOverlay";var b=r.forwardRef(function(i,s){var d=i,{as:o="div",onClick:a,onKeyDown:n}=d,t=g(d,["as","onClick","onKeyDown"]);let{isOpen:c}=L("DialogContent");return r.createElement(o,v(f({"aria-modal":"true",role:"dialog",tabIndex:-1},t),{ref:s,"data-reach-dialog-content":"","data-state":c?"open":"closed",onClick:(0,l.composeEventHandlers)(a,u=>{u.stopPropagation()})}))});b.displayName="DialogContent";var T=r.forwardRef(function(d,i){var c=d,{allowPinchZoom:o=!1,initialFocusRef:a,isOpen:n,onDismiss:t=l.noop}=c,s=g(c,["allowPinchZoom","initialFocusRef","isOpen","onDismiss"]);return r.createElement(O,{allowPinchZoom:o,initialFocusRef:a,isOpen:n,onDismiss:t},r.createElement(b,f({ref:i},s)))});T.displayName="Dialog";function $(e){let o=[],a=[],n=(0,l.getOwnerDocument)(e);return e?(Array.prototype.forEach.call(n.querySelectorAll("body > *"),t=>{var c,u;let s=(u=(c=e.parentNode)==null?void 0:c.parentNode)==null?void 0:u.parentNode;if(t===s)return;let i=t.getAttribute("aria-hidden");i!==null&&i!=="false"||(o.push(i),a.push(t),t.setAttribute("aria-hidden","true"))}),()=>{a.forEach((t,s)=>{let i=o[s];i===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",i)})}):l.noop}0&&(module.exports={Dialog,DialogContent,DialogInner,DialogOverlay,unstable_DialogWrapper}); |
/** | ||
* @reach/dialog v0.18.0-pre.3 | ||
* @reach/dialog v0.18.0-pre.4 | ||
* | ||
@@ -14,3 +14,3 @@ * Copyright (c) 2018-2022, React Training LLC | ||
import { PortalProps } from '@reach/portal'; | ||
import { Polymorphic } from '@reach/utils'; | ||
import * as Polymorphic from '@reach/polymorphic'; | ||
@@ -17,0 +17,0 @@ /** |
{ | ||
"name": "@reach/dialog", | ||
"version": "0.18.0-pre.3", | ||
"version": "0.18.0-pre.4", | ||
"description": "Accessible React Modal Dialog.", | ||
@@ -16,4 +16,5 @@ "author": "React Training <hello@reacttraining.com>", | ||
"dependencies": { | ||
"@reach/portal": "0.18.0-pre.3", | ||
"@reach/utils": "0.18.0-pre.3", | ||
"@reach/polymorphic": "0.18.0-pre.4", | ||
"@reach/portal": "0.18.0-pre.4", | ||
"@reach/utils": "0.18.0-pre.4", | ||
"react-focus-lock": "2.5.2", | ||
@@ -20,0 +21,0 @@ "react-remove-scroll": "2.4.3" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54293
7
725
+ Added@reach/polymorphic@0.18.0-pre.4(transitive)
+ Added@reach/portal@0.18.0-pre.4(transitive)
+ Added@reach/utils@0.18.0-pre.4(transitive)
- Removed@reach/portal@0.18.0-pre.3(transitive)
- Removed@reach/utils@0.18.0-pre.3(transitive)
Updated@reach/portal@0.18.0-pre.4
Updated@reach/utils@0.18.0-pre.4