UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

3 lines (2 loc) 905 B
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as o}from"../../../external/preact/hooks/dist/hooks.js";import s from"../../../_virtual/index.js";import{useModal as a}from"./useModal.js";const r=({children:r,classNameModifiers:l=[],isOpen:i,onClose:d,isDismissible:t=!0,labelledBy:c,describedBy:n,focusFirst:m,focusAfterClose:p,...u})=>{const f=o(),{closeModal:h,handleClickOutside:_}=a({modalElement:f.current,isOpen:i,isDismissible:t,focusFirst:m,focusAfterClose:p,onClose:d});return e("div",{className:s("adyen-checkout__modal-wrapper",l.map((e=>`adyen-checkout__modal-wrapper--${e}`)),{"adyen-checkout__modal-wrapper--open":i}),role:"dialog","aria-labelledby":c,"aria-describedby":n,"aria-modal":"true","aria-hidden":!i,onClick:_,...u},e("div",{className:"adyen-checkout__modal",ref:f},r({onCloseModal:h})))};export{r as Modal}; //# sourceMappingURL=Modal.js.map