UNPKG

@duetds/components

Version:

This package includes Duet Core Components and related tools.

1 lines 3.02 kB
import{r as t,d as s,h as e}from"./p-6403d5dc.js";import{a as o}from"./p-da8c2c96.js";const a=class{constructor(e){t(this,e),this.modalId=o("DuetModal"),this.size="large",this.theme="",this.heading="",this.icon="",this.active=!1,this.duetOpen=s(this,"duetOpen",7),this.duetClose=s(this,"duetClose",7)}componentWillLoad(){"default"!==this.theme&&document.documentElement.classList.contains("duet-theme-turva")&&(this.theme="turva")}render(){return console.error("[DUET COMPONENTS]: Modal is a prototype and should not be used in production!"),e("div",{class:{"duet-modal-overlay":!0,"duet-theme-turva":"turva"===this.theme}},e("div",{class:"duet-modal",role:"dialog","aria-labelledby":!!this.heading&&this.modalId,tabindex:"-1"},e("div",{class:"duet-modal-close"},e("duet-button",{variation:"plain","accessible-label":"Sulje ikkuna",color:"color-secondary","icon-size":"large",icon:"navigation-close","icon-only":!0,margin:"none",fixed:!0})),e("div",{class:"duet-modal-scroll"},this.heading?e("div",{class:"duet-modal-top"},e("h2",{class:"duet-modal-heading",id:this.modalId},this.heading)):"",e("slot",null))))}static get style(){return":host{background:transparent}.duet-modal-overlay,:host{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;padding:0;margin:0}.duet-modal-overlay{background:transparent;position:absolute;position:fixed;top:0;left:0;bottom:0;right:0;opacity:.85;background:#00294d}.duet-modal-overlay.duet-theme-turva{background:#111}.duet-modal{background:transparent;border:0;padding:0;position:absolute;position:fixed;background:#fff;border-radius:4px;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:90%;max-width:676px;max-height:90vh;top:50%;left:50%}.duet-modal,.duet-modal-scroll{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;height:100%;overflow:hidden}.duet-modal-scroll{background:transparent;border:0;padding:0;padding:36px;overflow-y:auto;position:absolute;top:0;left:0;width:100%}.duet-modal-close{position:absolute;top:20px;right:20px}.duet-modal-heading{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent;border:0;padding:0;margin:0;margin-bottom:16px!important;font-family:localtapiola-sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:800;line-height:1.25;letter-spacing:-.01rem;color:#00294d;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-font-feature-settings:\"ss01\";-webkit-font-feature-settings:\"ss01\";text-decoration:none;font-feature-settings:\"ss01\";font-variant-numeric:tabular-nums;font-style:normal;width:100%;margin-top:-20px;text-align:center}.duet-modal-heading.duet-p-0{padding:0!important}.duet-modal-heading.duet-m-0{margin:0!important}"}};export{a as duet_modal};