@interop-ui/react-alert-dialog
Advanced tools
Comparing version 0.0.1-5 to 0.0.1-6
@@ -1,2 +0,2 @@ | ||
var e,t,r=require("@interop-ui/react-utils"),n=r.createContext,o=r.createStyleObj,i=r.forwardRef,a=r.useComposedRefs,l=r.useId,c=r.useDocumentRef,s=require("@interop-ui/utils"),u=s.cssReset,d=s.makeId,p=(s.warning,require("@interop-ui/react-dialog")),f=p.Dialog,b=p.styles,y=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(){return(h=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 O(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}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,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return A(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 A(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 A(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}var j=D(n("AlertDialogContext","AlertDialog"),2),C=j[0],w=j[1],I=D(n("AlertDialogContext","AlertDialog"),2),E=I[0],P=I[1],S=function(e){var t=e.children,r=e.id,n=O(e,["children","id"]),o=d("alert-dialog",l()),i=r||o,a=d(i,"description"),c=d(i,"title");return y.createElement(f,n,y.createElement(C.Provider,{value:y.useMemo((function(){return{descriptionId:a,titleId:c}}),[a,c])},t))};exports.AlertDialog=S;var T=i((function(e,t){var r=e.as,n=void 0===r?"button":r,o=O(e,["as"]);return y.createElement(f.Trigger,h({},L("trigger"),{as:n,ref:t},o))})),x=i((function(e,t){var r=e.as,n=void 0===r?"div":r,o=O(e,["as"]);return y.createElement(f.Overlay,h({},L("overlay"),{as:n,ref:t},o))})),N=i((function(e,t){var r=e.as,n=void 0===r?"button":r,o=O(e,["as"]),i=P("AlertDialog.Cancel").cancelRef,l=a(t,i);return y.createElement(f.Close,h({},L("cancel"),{as:n,ref:l},o))})),R=i((function(e,t){var r=e.as,n=void 0===r?"button":r,o=O(e,["as"]);return y.createElement(f.Close,h({},L("action"),{as:n,ref:t},o))})),q=i((function(e,t){var r=e.as,n=void 0===r?"div":r,o=e["aria-label"],i=e["aria-labelledby"],l=e["aria-describedby"],s=e.children,u=O(e,["as","aria-label","aria-labelledby","aria-describedby","children"]),d=w("AlertDialogContent"),p=d.descriptionId,b=d.titleId,g=y.useRef(null),v=y.useRef(null),m=c(v),D=a(t,v);return y.createElement(f.Content,h({},L("content"),{as:n,ref:D,role:"alertdialog","aria-describedby":l||p,"aria-labelledby":o?void 0:i||b,"aria-label":o||void 0},u,{refToFocusOnOpen:g}),y.createElement(E.Provider,{value:y.useMemo((function(){return{cancelRef:g,ownerDocumentRef:m}}),[g,m])},!1,s))})),k=i((function(e,t){var r=e.as,n=void 0===r?"h2":r,o=O(e,["as"]),i=w("AlertDialogTitle").titleId;return y.createElement(n,h({},L("title"),{ref:t,id:i},o))})),M=i((function(e,t){var r=e.as,n=void 0===r?"p":r,o=O(e,["as"]),i=w("AlertDialogDescription").descriptionId;return y.createElement(n,h({},L("description"),{ref:t,id:i},o))}));S.Cancel=N,S.Action=R,S.Content=q,S.Description=M,S.Overlay=x,S.Title=k,S.Trigger=T,S.Title.displayName="AlertDialog.Title",S.Cancel.displayName="AlertDialog.Cancel",S.Action.displayName="AlertDialog.Action",S.Content.displayName="AlertDialog.Content",S.Description.displayName="AlertDialog.Description",S.Overlay.displayName="AlertDialog.Overlay",S.Trigger.displayName="AlertDialog.Trigger",S.displayName="AlertDialog";var F=D(o("AlertDialog",{root:b.root,overlay:v(v({},u("div")),b.overlay),trigger:v(v({},u("button")),b.trigger),cancel:v(v({},u("button")),b.close),action:v(v({},u("button")),b.close),content:v(v({},u("div")),b.content),title:v({},u("h2")),description:v({},u("p"))}),2),K=F[0],L=F[1];exports.styles=K;"".concat("AlertDialog.Content"," requires a label for the component to be accessible for screen reader users.\n\nYou can label the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Title"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a title by assigning it an `id` and passing the same value to the `aria-labelledby` prop in ").concat("AlertDialog.Content",". If the label is confusing or duplicative for sighted users, you can also pass a label directly by using the `aria-label` prop.\n\nFor more information, see https://LINK-TO-DOCS.com"),"".concat("AlertDialog.Content"," requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Description"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in ").concat("AlertDialog.Content",". If the description is confusing or duplicative for sighted users, you can use the `interop-ui/react-visually-hidden` component as a wrapper around your description component.\n\nFor more information, see https://LINK-TO-DOCS.com"); | ||
var e,t,r=require("@interop-ui/react-utils"),n=r.createContext,o=r.createStyleObj,a=r.forwardRef,i=r.useComposedRefs,l=r.useId,c=r.useDocumentRef,s=r.composeEventHandlers,u=require("@interop-ui/utils"),d=u.cssReset,p=u.makeId,f=(u.warning,require("@interop-ui/react-dialog")),b=f.Dialog,y=f.styles,g=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(){return(O=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){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function A(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,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(n=(i=l.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return j(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 j(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 j(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}var C=A(n("AlertDialogContext","AlertDialog"),2),w=C[0],E=C[1],I=A(n("AlertDialogContext","AlertDialog"),2),P=I[0],S=I[1],T=function(e){var t=e.children,r=e.id,n=D(e,["children","id"]),o=p("alert-dialog",l()),a=r||o,i=p(a,"description"),c=p(a,"title");return g.createElement(b,n,g.createElement(w.Provider,{value:g.useMemo((function(){return{descriptionId:i,titleId:c}}),[i,c])},t))};exports.AlertDialog=T;var x=a((function(e,t){var r=e.as,n=void 0===r?"button":r,o=D(e,["as"]);return g.createElement(b.Trigger,O({},Y("trigger"),{as:n,ref:t},o))})),N=a((function(e,t){var r=e.as,n=void 0===r?"div":r,o=D(e,["as"]);return g.createElement(b.Overlay,O({},Y("overlay"),{as:n,ref:t},o))})),R=a((function(e,t){var r=e.as,n=void 0===r?"button":r,o=D(e,["as"]),a=S("AlertDialog.Cancel").cancelRef,l=i(t,a);return g.createElement(b.Close,O({},Y("cancel"),{as:n,ref:l},o))})),q=a((function(e,t){var r=e.as,n=void 0===r?"button":r,o=D(e,["as"]);return g.createElement(b.Close,O({},Y("action"),{as:n,ref:t},o))})),k=a((function(e,t){var r=e.as,n=void 0===r?"div":r,o=e["aria-label"],a=e["aria-labelledby"],l=e["aria-describedby"],u=e.children,d=D(e,["as","aria-label","aria-labelledby","aria-describedby","children"]),p=E("AlertDialogContent"),f=p.descriptionId,y=p.titleId,v=g.useRef(null),m=g.useRef(null),h=c(m),A=i(t,m);return g.createElement(b.Content,O({},Y("content"),{as:n,ref:A,role:"alertdialog","aria-describedby":l||f,"aria-labelledby":o?void 0:a||y,"aria-label":o||void 0},d,{onOpenAutoFocus:s(d.onOpenAutoFocus,(function(e){var t;e.preventDefault(),null===(t=v.current)||void 0===t||t.focus({preventScroll:!0})}))}),g.createElement(P.Provider,{value:g.useMemo((function(){return{cancelRef:v,ownerDocumentRef:h}}),[v,h])},!1,u))})),F=a((function(e,t){var r=e.as,n=void 0===r?"h2":r,o=D(e,["as"]),a=E("AlertDialogTitle").titleId;return g.createElement(n,O({},Y("title"),{ref:t,id:a},o))})),M=a((function(e,t){var r=e.as,n=void 0===r?"p":r,o=D(e,["as"]),a=E("AlertDialogDescription").descriptionId;return g.createElement(n,O({},Y("description"),{ref:t,id:a},o))}));T.Cancel=R,T.Action=q,T.Content=k,T.Description=M,T.Overlay=N,T.Title=F,T.Trigger=x,T.Title.displayName="AlertDialog.Title",T.Cancel.displayName="AlertDialog.Cancel",T.Action.displayName="AlertDialog.Action",T.Content.displayName="AlertDialog.Content",T.Description.displayName="AlertDialog.Description",T.Overlay.displayName="AlertDialog.Overlay",T.Trigger.displayName="AlertDialog.Trigger",T.displayName="AlertDialog";var K=A(o("AlertDialog",{root:y.root,overlay:m(m({},d("div")),y.overlay),trigger:m(m({},d("button")),y.trigger),cancel:m(m({},d("button")),y.close),action:m(m({},d("button")),y.close),content:m(m({},d("div")),y.content),title:m({},d("h2")),description:m({},d("p"))}),2),L=K[0],Y=K[1];exports.styles=L;"".concat("AlertDialog.Content"," requires a label for the component to be accessible for screen reader users.\n\nYou can label the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Title"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a title by assigning it an `id` and passing the same value to the `aria-labelledby` prop in ").concat("AlertDialog.Content",". If the label is confusing or duplicative for sighted users, you can also pass a label directly by using the `aria-label` prop.\n\nFor more information, see https://LINK-TO-DOCS.com"),"".concat("AlertDialog.Content"," requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Description"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in ").concat("AlertDialog.Content",". If the description is confusing or duplicative for sighted users, you can use the `interop-ui/react-visually-hidden` component as a wrapper around your description component.\n\nFor more information, see https://LINK-TO-DOCS.com"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{createContext as e,createStyleObj as t,forwardRef as r,useComposedRefs as n,useId as o,useDocumentRef as i}from"@interop-ui/react-utils";import{cssReset as a,makeId as l,warning as c}from"@interop-ui/utils";import{Dialog as s,styles as u}from"@interop-ui/react-dialog";import*as g from"react";function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(){return(f=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 y(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}const[D,m]=e("AlertDialogContext","AlertDialog"),[A,h]=e("AlertDialogContext","AlertDialog");export const AlertDialog=function(e){const{children:t,id:r}=e,n=y(e,["children","id"]),i=l("alert-dialog",o()),a=r||i,c=l(a,"description"),u=l(a,"title");return g.createElement(s,n,g.createElement(D.Provider,{value:g.useMemo((()=>({descriptionId:c,titleId:u})),[c,u])},t))};const O="button",v=r((function(e,t){const{as:r=O}=e,n=y(e,["as"]);return g.createElement(s.Trigger,f({},q("trigger"),{as:r,ref:t},n))})),C="div",j=r((function(e,t){const{as:r=C}=e,n=y(e,["as"]);return g.createElement(s.Overlay,f({},q("overlay"),{as:r,ref:t},n))})),w="button",P=r((function(e,t){const{as:r=w}=e,o=y(e,["as"]),{cancelRef:i}=h("AlertDialog.Cancel"),a=n(t,i);return g.createElement(s.Close,f({},q("cancel"),{as:r,ref:a},o))})),E="button",T=r((function(e,t){const{as:r=E}=e,n=y(e,["as"]);return g.createElement(s.Close,f({},q("action"),{as:r,ref:t},n))})),I="div",N=r((function(e,t){const{as:r=I,"aria-label":o,"aria-labelledby":a,"aria-describedby":l,children:c}=e,u=y(e,["as","aria-label","aria-labelledby","aria-describedby","children"]),{descriptionId:p,titleId:d}=m("AlertDialogContent"),b=g.useRef(null),D=g.useRef(null),h=i(D),O=n(t,D);return g.createElement(s.Content,f({},q("content"),{as:r,ref:O,role:"alertdialog","aria-describedby":l||p,"aria-labelledby":o?void 0:a||d,"aria-label":o||void 0},u,{refToFocusOnOpen:b}),g.createElement(A.Provider,{value:g.useMemo((()=>({cancelRef:b,ownerDocumentRef:h})),[b,h])},!1,c))})),x="h2",S=r((function(e,t){const{as:r=x}=e,n=y(e,["as"]),{titleId:o}=m("AlertDialogTitle");return g.createElement(r,f({},q("title"),{ref:t,id:o},n))})),R="p",F=r((function(e,t){const{as:r=R}=e,n=y(e,["as"]),{descriptionId:o}=m("AlertDialogDescription");return g.createElement(r,f({},q("description"),{ref:t,id:o},n))}));AlertDialog.Cancel=P,AlertDialog.Action=T,AlertDialog.Content=N,AlertDialog.Description=F,AlertDialog.Overlay=j,AlertDialog.Title=S,AlertDialog.Trigger=v,AlertDialog.Title.displayName="AlertDialog.Title",AlertDialog.Cancel.displayName="AlertDialog.Cancel",AlertDialog.Action.displayName="AlertDialog.Action",AlertDialog.Content.displayName="AlertDialog.Content",AlertDialog.Description.displayName="AlertDialog.Description",AlertDialog.Overlay.displayName="AlertDialog.Overlay",AlertDialog.Trigger.displayName="AlertDialog.Trigger",AlertDialog.displayName="AlertDialog";const[k,q]=t("AlertDialog",{root:u.root,overlay:d(d({},a(C)),u.overlay),trigger:d(d({},a(O)),u.trigger),cancel:d(d({},a(w)),u.close),action:d(d({},a(E)),u.close),content:d(d({},a(I)),u.content),title:d({},a(x)),description:d({},a(R))});export{k as styles};"".concat("AlertDialog.Content"," requires a label for the component to be accessible for screen reader users.\n\nYou can label the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Title"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a title by assigning it an `id` and passing the same value to the `aria-labelledby` prop in ").concat("AlertDialog.Content",". If the label is confusing or duplicative for sighted users, you can also pass a label directly by using the `aria-label` prop.\n\nFor more information, see https://LINK-TO-DOCS.com"),"".concat("AlertDialog.Content"," requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Description"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in ").concat("AlertDialog.Content",". If the description is confusing or duplicative for sighted users, you can use the `interop-ui/react-visually-hidden` component as a wrapper around your description component.\n\nFor more information, see https://LINK-TO-DOCS.com"); | ||
import{createContext as e,createStyleObj as t,forwardRef as r,useComposedRefs as n,useId as o,useDocumentRef as i,composeEventHandlers as a}from"@interop-ui/react-utils";import{cssReset as l,makeId as c,warning as s}from"@interop-ui/utils";import{Dialog as u,styles as g}from"@interop-ui/react-dialog";import*as p from"react";function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(){return(y=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){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}const[m,A]=e("AlertDialogContext","AlertDialog"),[h,v]=e("AlertDialogContext","AlertDialog");export const AlertDialog=function(e){const{children:t,id:r}=e,n=D(e,["children","id"]),i=c("alert-dialog",o()),a=r||i,l=c(a,"description"),s=c(a,"title");return p.createElement(u,n,p.createElement(m.Provider,{value:p.useMemo((()=>({descriptionId:l,titleId:s})),[l,s])},t))};const O="button",C=r((function(e,t){const{as:r=O}=e,n=D(e,["as"]);return p.createElement(u.Trigger,y({},K("trigger"),{as:r,ref:t},n))})),j="div",w=r((function(e,t){const{as:r=j}=e,n=D(e,["as"]);return p.createElement(u.Overlay,y({},K("overlay"),{as:r,ref:t},n))})),P="button",E=r((function(e,t){const{as:r=P}=e,o=D(e,["as"]),{cancelRef:i}=v("AlertDialog.Cancel"),a=n(t,i);return p.createElement(u.Close,y({},K("cancel"),{as:r,ref:a},o))})),I="button",T=r((function(e,t){const{as:r=I}=e,n=D(e,["as"]);return p.createElement(u.Close,y({},K("action"),{as:r,ref:t},n))})),N="div",x=r((function(e,t){const{as:r=N,"aria-label":o,"aria-labelledby":l,"aria-describedby":c,children:s}=e,g=D(e,["as","aria-label","aria-labelledby","aria-describedby","children"]),{descriptionId:d,titleId:b}=A("AlertDialogContent"),f=p.useRef(null),m=p.useRef(null),v=i(m),O=n(t,m);return p.createElement(u.Content,y({},K("content"),{as:r,ref:O,role:"alertdialog","aria-describedby":c||d,"aria-labelledby":o?void 0:l||b,"aria-label":o||void 0},g,{onOpenAutoFocus:a(g.onOpenAutoFocus,(e=>{var t;e.preventDefault(),null===(t=f.current)||void 0===t||t.focus({preventScroll:!0})}))}),p.createElement(h.Provider,{value:p.useMemo((()=>({cancelRef:f,ownerDocumentRef:v})),[f,v])},!1,s))})),S="h2",R=r((function(e,t){const{as:r=S}=e,n=D(e,["as"]),{titleId:o}=A("AlertDialogTitle");return p.createElement(r,y({},K("title"),{ref:t,id:o},n))})),F="p",k=r((function(e,t){const{as:r=F}=e,n=D(e,["as"]),{descriptionId:o}=A("AlertDialogDescription");return p.createElement(r,y({},K("description"),{ref:t,id:o},n))}));AlertDialog.Cancel=E,AlertDialog.Action=T,AlertDialog.Content=x,AlertDialog.Description=k,AlertDialog.Overlay=w,AlertDialog.Title=R,AlertDialog.Trigger=C,AlertDialog.Title.displayName="AlertDialog.Title",AlertDialog.Cancel.displayName="AlertDialog.Cancel",AlertDialog.Action.displayName="AlertDialog.Action",AlertDialog.Content.displayName="AlertDialog.Content",AlertDialog.Description.displayName="AlertDialog.Description",AlertDialog.Overlay.displayName="AlertDialog.Overlay",AlertDialog.Trigger.displayName="AlertDialog.Trigger",AlertDialog.displayName="AlertDialog";const[q,K]=t("AlertDialog",{root:g.root,overlay:b(b({},l(j)),g.overlay),trigger:b(b({},l(O)),g.trigger),cancel:b(b({},l(P)),g.close),action:b(b({},l(I)),g.close),content:b(b({},l(N)),g.content),title:b({},l(S)),description:b({},l(F))});export{q as styles};"".concat("AlertDialog.Content"," requires a label for the component to be accessible for screen reader users.\n\nYou can label the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Title"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a title by assigning it an `id` and passing the same value to the `aria-labelledby` prop in ").concat("AlertDialog.Content",". If the label is confusing or duplicative for sighted users, you can also pass a label directly by using the `aria-label` prop.\n\nFor more information, see https://LINK-TO-DOCS.com"),"".concat("AlertDialog.Content"," requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the ").concat("AlertDialog.Content"," by passing a ").concat("AlertDialog.Description"," component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in ").concat("AlertDialog.Content",". If the description is confusing or duplicative for sighted users, you can use the `interop-ui/react-visually-hidden` component as a wrapper around your description component.\n\nFor more information, see https://LINK-TO-DOCS.com"); | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/react-alert-dialog", | ||
"version": "0.0.1-5", | ||
"version": "0.0.1-6", | ||
"license": "MIT", | ||
@@ -21,4 +21,4 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@interop-ui/react-dialog": "0.0.1-7", | ||
"@interop-ui/react-utils": "0.0.1-7", | ||
"@interop-ui/react-dialog": "0.0.1-8", | ||
"@interop-ui/react-utils": "0.0.1-8", | ||
"@interop-ui/utils": "0.0.1-3" | ||
@@ -25,0 +25,0 @@ }, |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
1
1
115399
12
772
+ Added@interop-ui/react-debug-context@0.0.1-8(transitive)
+ Added@interop-ui/react-dialog@0.0.1-8(transitive)
+ Added@interop-ui/react-dismissable-layer@0.0.1-0(transitive)
+ Added@interop-ui/react-focus-scope@0.0.1-0(transitive)
+ Added@interop-ui/react-portal@0.0.1-8(transitive)
+ Added@interop-ui/react-utils@0.0.1-8(transitive)
+ Addedtabbable@5.0.0(transitive)
- Removed@interop-ui/react-debug-context@0.0.1-7(transitive)
- Removed@interop-ui/react-dialog@0.0.1-7(transitive)
- Removed@interop-ui/react-lock@0.0.1-7(transitive)
- Removed@interop-ui/react-portal@0.0.1-7(transitive)
- Removed@interop-ui/react-utils@0.0.1-7(transitive)
- Removed@interop-ui/tabbable@0.0.1-3(transitive)