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

@interop-ui/react-announce

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interop-ui/react-announce - npm Package Compare versions

Comparing version 0.0.1-13 to 0.0.1-14

1

dist/index.d.ts

@@ -64,3 +64,4 @@ import * as React from "react";

export const Announce: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", AnnounceOwnProps>;
export const Root: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", AnnounceOwnProps>;
//# sourceMappingURL=index.d.ts.map

2

dist/index.js

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

var e,t,r,n=require("@interop-ui/react-polymorphic").forwardRefWithAs,i=require("@interop-ui/react-utils"),o=i.useComposedRefs,a=i.useLayoutEffect,u=require("@interop-ui/utils"),l=u.getPartDataAttr,c=u.getPartDataAttrObj,f=(e=require("react-dom"))&&e.__esModule?e.default:e,s=(t={},r=require("react"),Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})),t);function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var b={polite:"status",assertive:"alert",off:"none"},m=new Map,h=n((function(e,t){var r=e.as,n=void 0===r?"div":r,i=e["aria-relevant"],u=e.children,l=e.type,p=void 0===l?"polite":l,h=e.role,A=void 0===h?b[p]:h,O=e.regionIdentifier,j=y(e,["as","aria-relevant","children","type","role","regionIdentifier"]),w=["true",!0].includes(j["aria-atomic"]),E=s.useRef(document),S=s.useCallback((function(e){e&&(E.current=e.ownerDocument)}),[]),x=s.useRef(null),P=o(t,x,S),q=d(s.useState(),2),I=q[0],C=q[1],R=i?Array.isArray(i)?i.join(" "):i:void 0,k=s.useCallback((function(){var e=E.current,t={type:p,role:A,relevant:R,id:O,atomic:w},r=function(e){var t=e.type,r=e.relevant,n=e.role,i=e.atomic,o=e.id;return"[".concat(g(o),"]").concat([["aria-live",t],["aria-atomic",i],["aria-relevant",r],["role",n]].filter((function(e){return!!d(e,2)[1]})).map((function(e){var t=d(e,2),r=t[0],n=t[1];return"[".concat(r,"=").concat(n,"]")})).join(""))}(t);return e.querySelector(r)||function(e,t){var r=t.type,n=t.relevant,i=t.role,o=t.atomic,a=t.id,u=e.createElement("div");u.setAttribute(g(a),""),u.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(u),u.setAttribute("aria-live",r),u.setAttribute("aria-atomic",String(o||!1)),u.setAttribute("role",i),n&&u.setAttribute("aria-relevant",n);return u}(e,t)}),[w,R,A,p,O]);return a((function(){C(k())}),[k]),s.useEffect((function(){var e=E.current;function t(){r.setAttribute("role",e.hidden?"none":A),r.setAttribute("aria-live",e.hidden?"off":p)}var r=k();if(m.get(r)){var n=m.get(r);m.set(r,n+1)}else e.addEventListener("visibilitychange",t),m.set(r,1);return function(){var n=m.get(r);m.set(r,n-1),1===n&&e.removeEventListener("visibilitychange",t)}}),[k,A,p]),s.createElement(s.Fragment,null,s.createElement(n,v({},j,c("Announce"),{ref:P}),u),I&&f.createPortal(s.createElement("div",null,u),I))}));function g(e){return l("AnnounceRegion")+(e?"-".concat(e):"")}exports.Announce=h,h.displayName="Announce";
var e,t,r,n=require("@interop-ui/react-polymorphic").forwardRefWithAs,i=require("@interop-ui/react-utils"),o=i.useComposedRefs,a=i.useLayoutEffect,u=require("@interop-ui/utils"),l=u.getPartDataAttr,c=u.getPartDataAttrObj,f=(e=require("react-dom"))&&e.__esModule?e.default:e,s=(t={},r=require("react"),Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})),t);function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var b={polite:"status",assertive:"alert",off:"none"},m=new Map,h=n((function(e,t){var r=e.as,n=void 0===r?"div":r,i=e["aria-relevant"],u=e.children,l=e.type,p=void 0===l?"polite":l,h=e.role,A=void 0===h?b[p]:h,O=e.regionIdentifier,j=y(e,["as","aria-relevant","children","type","role","regionIdentifier"]),w=["true",!0].includes(j["aria-atomic"]),E=s.useRef(document),S=s.useCallback((function(e){e&&(E.current=e.ownerDocument)}),[]),x=s.useRef(null),P=o(t,x,S),q=d(s.useState(),2),I=q[0],R=q[1],C=i?Array.isArray(i)?i.join(" "):i:void 0,k=s.useCallback((function(){var e=E.current,t={type:p,role:A,relevant:C,id:O,atomic:w},r=function(e){var t=e.type,r=e.relevant,n=e.role,i=e.atomic,o=e.id;return"[".concat(g(o),"]").concat([["aria-live",t],["aria-atomic",i],["aria-relevant",r],["role",n]].filter((function(e){return!!d(e,2)[1]})).map((function(e){var t=d(e,2),r=t[0],n=t[1];return"[".concat(r,"=").concat(n,"]")})).join(""))}(t);return e.querySelector(r)||function(e,t){var r=t.type,n=t.relevant,i=t.role,o=t.atomic,a=t.id,u=e.createElement("div");u.setAttribute(g(a),""),u.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(u),u.setAttribute("aria-live",r),u.setAttribute("aria-atomic",String(o||!1)),u.setAttribute("role",i),n&&u.setAttribute("aria-relevant",n);return u}(e,t)}),[w,C,A,p,O]);return a((function(){R(k())}),[k]),s.useEffect((function(){var e=E.current;function t(){r.setAttribute("role",e.hidden?"none":A),r.setAttribute("aria-live",e.hidden?"off":p)}var r=k();if(m.get(r)){var n=m.get(r);m.set(r,n+1)}else e.addEventListener("visibilitychange",t),m.set(r,1);return function(){var n=m.get(r);m.set(r,n-1),1===n&&e.removeEventListener("visibilitychange",t)}}),[k,A,p]),s.createElement(s.Fragment,null,s.createElement(n,v({},j,c("Announce"),{ref:P}),u),I&&f.createPortal(s.createElement("div",null,u),I))}));function g(e){return l("AnnounceRegion")+(e?"-".concat(e):"")}exports.Announce=h,h.displayName="Announce";var A=h;exports.Root=A;
//# sourceMappingURL=index.js.map

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

import{forwardRefWithAs as e}from"@interop-ui/react-polymorphic";import{useComposedRefs as t,useLayoutEffect as r}from"@interop-ui/react-utils";import{getPartDataAttr as n,getPartDataAttrObj as i}from"@interop-ui/utils";import o from"react-dom";import*as a from"react";function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function l(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const u={polite:"status",assertive:"alert",off:"none"},s=new Map,p="div";export const Announce=e(((e,n)=>{const{as:m=p,"aria-relevant":d,children:v,type:y="polite",role:b=u[y],regionIdentifier:g}=e,h=l(e,["as","aria-relevant","children","type","role","regionIdentifier"]),A=["true",!0].includes(h["aria-atomic"]),O=a.useRef(document),j=a.useCallback((e=>{e&&(O.current=e.ownerDocument)}),[]),E=a.useRef(null),w=t(n,E,j),[x,S]=a.useState(),P=d?Array.isArray(d)?d.join(" "):d:void 0,k=a.useCallback((()=>{const e=O.current,t={type:y,role:b,relevant:P,id:g,atomic:A},r=function({type:e,relevant:t,role:r,atomic:n,id:i}){return"[".concat(f(i),"]").concat([["aria-live",e],["aria-atomic",n],["aria-relevant",t],["role",r]].filter((([,e])=>!!e)).map((([e,t])=>"[".concat(e,"=").concat(t,"]"))).join(""))}(t);return e.querySelector(r)||function(e,{type:t,relevant:r,role:n,atomic:i,id:o}){const a=e.createElement("div");a.setAttribute(f(o),""),a.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(a),a.setAttribute("aria-live",t),a.setAttribute("aria-atomic",String(i||!1)),a.setAttribute("role",n),r&&a.setAttribute("aria-relevant",r);return a}(e,t)}),[A,P,b,y,g]);return r((()=>{S(k())}),[k]),a.useEffect((()=>{const e=O.current;function t(){r.setAttribute("role",e.hidden?"none":b),r.setAttribute("aria-live",e.hidden?"off":y)}const r=k();if(s.get(r)){const e=s.get(r);s.set(r,e+1)}else e.addEventListener("visibilitychange",t),s.set(r,1);return function(){const n=s.get(r);s.set(r,n-1),1===n&&e.removeEventListener("visibilitychange",t)}}),[k,b,y]),a.createElement(a.Fragment,null,a.createElement(m,c({},h,i("Announce"),{ref:w}),v),x&&o.createPortal(a.createElement("div",null,v),x))}));function f(e){return n("AnnounceRegion")+(e?"-".concat(e):"")}Announce.displayName="Announce";
import{forwardRefWithAs as e}from"@interop-ui/react-polymorphic";import{useComposedRefs as t,useLayoutEffect as r}from"@interop-ui/react-utils";import{getPartDataAttr as n,getPartDataAttrObj as i}from"@interop-ui/utils";import o from"react-dom";import*as a from"react";function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function l(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const u={polite:"status",assertive:"alert",off:"none"},s=new Map,p="div";export const Announce=e(((e,n)=>{const{as:m=p,"aria-relevant":d,children:v,type:y="polite",role:b=u[y],regionIdentifier:g}=e,h=l(e,["as","aria-relevant","children","type","role","regionIdentifier"]),A=["true",!0].includes(h["aria-atomic"]),O=a.useRef(document),j=a.useCallback((e=>{e&&(O.current=e.ownerDocument)}),[]),E=a.useRef(null),w=t(n,E,j),[x,S]=a.useState(),P=d?Array.isArray(d)?d.join(" "):d:void 0,R=a.useCallback((()=>{const e=O.current,t={type:y,role:b,relevant:P,id:g,atomic:A},r=function({type:e,relevant:t,role:r,atomic:n,id:i}){return"[".concat(f(i),"]").concat([["aria-live",e],["aria-atomic",n],["aria-relevant",t],["role",r]].filter((([,e])=>!!e)).map((([e,t])=>"[".concat(e,"=").concat(t,"]"))).join(""))}(t);return e.querySelector(r)||function(e,{type:t,relevant:r,role:n,atomic:i,id:o}){const a=e.createElement("div");a.setAttribute(f(o),""),a.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(a),a.setAttribute("aria-live",t),a.setAttribute("aria-atomic",String(i||!1)),a.setAttribute("role",n),r&&a.setAttribute("aria-relevant",r);return a}(e,t)}),[A,P,b,y,g]);return r((()=>{S(R())}),[R]),a.useEffect((()=>{const e=O.current;function t(){r.setAttribute("role",e.hidden?"none":b),r.setAttribute("aria-live",e.hidden?"off":y)}const r=R();if(s.get(r)){const e=s.get(r);s.set(r,e+1)}else e.addEventListener("visibilitychange",t),s.set(r,1);return function(){const n=s.get(r);s.set(r,n-1),1===n&&e.removeEventListener("visibilitychange",t)}}),[R,b,y]),a.createElement(a.Fragment,null,a.createElement(m,c({},h,i("Announce"),{ref:w}),v),x&&o.createPortal(a.createElement("div",null,v),x))}));function f(e){return n("AnnounceRegion")+(e?"-".concat(e):"")}Announce.displayName="Announce";export const Root=Announce;
//# sourceMappingURL=index.module.js.map
{
"name": "@interop-ui/react-announce",
"version": "0.0.1-13",
"version": "0.0.1-14",
"license": "MIT",

@@ -20,5 +20,5 @@ "source": "src/index.ts",

"dependencies": {
"@interop-ui/react-polymorphic": "0.0.1-0",
"@interop-ui/react-utils": "0.0.1-13",
"@interop-ui/utils": "0.0.1-5"
"@interop-ui/react-polymorphic": "0.0.1-1",
"@interop-ui/react-utils": "0.0.1-14",
"@interop-ui/utils": "0.0.1-6"
},

@@ -25,0 +25,0 @@ "devDependencies": {

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