@interop-ui/react-alert-dialog
Advanced tools
Comparing version 0.0.1-3 to 0.0.1-4
@@ -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}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"); | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/react-alert-dialog", | ||
"version": "0.0.1-3", | ||
"version": "0.0.1-4", | ||
"license": "MIT", | ||
@@ -21,4 +21,4 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@interop-ui/react-dialog": "0.0.1-5", | ||
"@interop-ui/react-utils": "0.0.1-5", | ||
"@interop-ui/react-dialog": "0.0.1-6", | ||
"@interop-ui/react-utils": "0.0.1-6", | ||
"@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
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
114110
768
+ Added@interop-ui/react-debug-context@0.0.1-6(transitive)
+ Added@interop-ui/react-dialog@0.0.1-6(transitive)
+ Added@interop-ui/react-lock@0.0.1-6(transitive)
+ Added@interop-ui/react-portal@0.0.1-6(transitive)
+ Added@interop-ui/react-utils@0.0.1-6(transitive)
- Removed@interop-ui/react-debug-context@0.0.1-5(transitive)
- Removed@interop-ui/react-dialog@0.0.1-5(transitive)
- Removed@interop-ui/react-lock@0.0.1-5(transitive)
- Removed@interop-ui/react-portal@0.0.1-5(transitive)
- Removed@interop-ui/react-utils@0.0.1-5(transitive)