Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/f36-utils

Package Overview
Dependencies
Maintainers
107
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-utils - npm Package Compare versions

Comparing version 4.0.1-next-v4-9473.2426 to 4.0.1-next-v4-9502.2427

2

dist/module.js

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

import e,{useRef as r,useEffect as t,useState as n,useCallback as o}from"react";import{createPortal as a}from"react-dom";import s from"@babel/runtime/helpers/esm/extends";import{cx as c,css as u}from"emotion";function i(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}var l={};function d({children:e,container:n}){const o=r(n),s=r(document.createElement("div"));return t((()=>{o.current||(o.current=document.body);const e=s.current;return e.setAttribute("data-cf-ui-portal",""),o.current.appendChild(e),()=>{o.current&&o.current.removeChild(e)}}),[]),s.current?a(e,s.current):null}function m({className:r,children:t,...n}){return e.createElement("span",s({tabIndex:-1,className:c(u({name:"t8ljbi",styles:"display:inherit;outline:0;"}),r)},n),t)}i(l,"Portal",(()=>d)),i(l,"TabFocusTrap",(()=>m)),i(l,"useArrowKeyNavigation",(()=>f)),i(l,"useKeyboard",(()=>y));const p={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},f=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical"})=>{const[a,s]=n(0),c=o((n=>{const o=e.current;if(!o)return;const c=o.querySelectorAll(r);if(0===c.length)return;const u=c.length-1,i={[p[t].next]:()=>{s(a===u?0:a+1)},[p[t].prev]:()=>{s(0===a?u:a-1)}}[n.key];i&&(n.preventDefault(),i())}),[a,r,e,t]);return{focusedIndex:a,handleArrowsKeyDown:c,setFocusedIndex:s}},y=e=>{const{ref:r,keys:n,event:a="keydown"}=e;let s=document;const c=o((e=>{Object.prototype.hasOwnProperty.call(n,e.key)&&n[e.key](e)}),[n]);t((()=>(r&&r.current&&(s=r.current),s.addEventListener(a,c),()=>{s.removeEventListener(a,c)})),[a,c])};export{d as Portal,m as TabFocusTrap,f as useArrowKeyNavigation,y as useKeyboard};
import e,{useEffect as r,useRef as t,useState as n,useCallback as o}from"react";import{createPortal as a}from"react-dom";import s from"@babel/runtime/helpers/esm/extends";import{css as c,cx as u}from"emotion";function i(e,r,t,n){Object.defineProperty(e,r,{get:t,set:n,enumerable:!0,configurable:!0})}var l={};function d({children:e,container:n}){const o=t(n),s=t(document.createElement("div"));return r((()=>{o.current||(o.current=document.body);const e=s.current;return e.setAttribute("data-cf-ui-portal",""),o.current.appendChild(e),()=>{o.current&&o.current.removeChild(e)}}),[]),s.current?a(e,s.current):null}function m({className:r,children:t,...n}){return e.createElement("span",s({tabIndex:-1,className:u(c({name:"t8ljbi",styles:"display:inherit;outline:0;"}),r)},n),t)}i(l,"Portal",(()=>d)),i(l,"TabFocusTrap",(()=>m)),i(l,"useArrowKeyNavigation",(()=>f)),i(l,"useKeyboard",(()=>y));const p={vertical:{prev:"ArrowUp",next:"ArrowDown"},horizontal:{prev:"ArrowLeft",next:"ArrowRight"}},f=({itemsContainerRef:e,itemsSelector:r,keyType:t="vertical"})=>{const[a,s]=n(0),c=o((n=>{const o=e.current;if(!o)return;const c=o.querySelectorAll(r);if(0===c.length)return;const u=c.length-1,i={[p[t].next]:()=>{s(a===u?0:a+1)},[p[t].prev]:()=>{s(0===a?u:a-1)}}[n.key];i&&(n.preventDefault(),i())}),[a,r,e,t]);return{focusedIndex:a,handleArrowsKeyDown:c,setFocusedIndex:s}},y=e=>{const{ref:t,keys:n,event:a="keydown"}=e;let s=document;const c=o((e=>{Object.prototype.hasOwnProperty.call(n,e.key)&&n[e.key](e)}),[n]);r((()=>(t&&t.current&&(s=t.current),s.addEventListener(a,c),()=>{s.removeEventListener(a,c)})),[a,c])};export{d as Portal,m as TabFocusTrap,f as useArrowKeyNavigation,y as useKeyboard};
//# sourceMappingURL=module.js.map
{
"name": "@contentful/f36-utils",
"version": "4.0.1-next-v4-9473.2426+52a7aa67",
"version": "4.0.1-next-v4-9502.2427+bbb89b56",
"description": "Forma 36: utils React Component",

@@ -34,3 +34,3 @@ "license": "MIT",

},
"gitHead": "52a7aa67ed9211cb4016eb8b3fc16de06adf305c"
"gitHead": "bbb89b565d6a215db77faca4f8f8d99ebda05495"
}
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