@scania/tegel
Version:
Tegel Design System
1 lines • 3.77 kB
JavaScript
import{r as t,h as o,H as e,a as i}from"./p-9xxNGlso.js";import{h as s}from"./p-DDX6uFcm.js";const l=class{constructor(o){t(this,o),this.open=!1,this.isMobile=!1,this.slotPosition=null,this.topPartGroup=!1}updateIsMobile(){this.isMobile=window.innerWidth<=992}connectedCallback(){var t,o;this.updateIsMobile(),this.topPartGroup="top"===(null===(t=this.host.parentElement)||void 0===t?void 0:t.slot),this.topPartGroup||(this.slotPosition="end"===(null===(o=this.host.parentElement)||void 0===o?void 0:o.slot)?"end":"start"),this.tdsListAriaLabel||console.warn("Tegel Footer Group component: missing tdsListAriaLabel prop"),this.titleText&&console.warn("Tegel Footer Group component: to ensure accessibility, please use the title slot instead of the titleText prop. titleText will be deprecated in the future."),s("title",this.host)&&this.titleText&&console.warn("Tegel Footer Group component: titleText prop is set but title slot is used. The titleText prop will be ignored.")}handleResize(){this.updateIsMobile()}render(){const t=s("title",this.host);return o(e,{key:"7901705ee2dc040052e2f99813f8b0e8faf37530","aria-expanded":this.open?"true":"false"},o("div",{key:"ca98dcf8fbdf2556a9fd61b233a9a84bc3f6f9cc",class:this.isMobile?"mobile-view":""},this.topPartGroup&&(this.isMobile?o("button",{onClick:()=>{this.open=!this.open},class:"footer-top-title-button "+(this.open?"expanded":"closed")},t?o("slot",{name:"title"}):this.titleText,o("tds-icon",{name:"chevron_down",size:"20px","aria-hidden":"true"})):o("div",{class:"footer-top-title"},t?o("slot",{name:"title"}):this.titleText)),o("nav",{key:"dfa738d7e93518c7aa29e322b575a4c418010e6a","aria-label":this.tdsListAriaLabel},o("div",{key:"6a3a9bfa388a342609187ca5437ea1e572a0b62f",role:"list",class:`${this.slotPosition?this.slotPosition:""}\n ${this.topPartGroup?"top-part-child":""}\n ${this.open?"expanded":"closed"}`},o("slot",{key:"3dbf13f27f3bd37ba5fc589045b329ee034a37d3"})))))}get host(){return i(this)}};l.style=":host{display:block}:host .footer-top-title{font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-footer-top-links-header);padding-bottom:8px}:host .footer-top-title *,:host .footer-top-title ::slotted(*){margin:0}:host button.footer-top-title-button{border:none;width:100%;font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-footer-top-links);background-color:transparent;text-align:left;padding:19px 24px;justify-content:space-between;border-bottom:1px solid var(--tds-footer-top-divider)}:host button.footer-top-title-button *,:host button.footer-top-title-button ::slotted(*){margin:0}:host button.footer-top-title-button.expanded tds-icon{transform:rotateZ(180deg)}:host button.footer-top-title-button:hover{cursor:pointer}:host button.footer-top-title-button:active{background-color:var(--tds-footer-top-button-active)}:host button.footer-top-title-button:focus-visible{outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host button.footer-top-title-button tds-icon{transition:transform 0.2s ease-in-out}:host [role=list]{list-style:none;padding:0;margin:0;display:flex;gap:12px}:host [role=list].start,:host [role=list].end{gap:24px}:host [role=list].top-part-child{flex-direction:column}:host .mobile-view [role=list].start:not(.top-part-child){flex-direction:column}:host .mobile-view [role=list].start:not(.top-part-child).start,:host .mobile-view [role=list].start:not(.top-part-child).end{gap:8px}:host .mobile-view [role=list].top-part-child.closed{display:none}:host .mobile-view [role=list].top-part-child{gap:0}:host .mobile-view button.footer-top-title-button{display:flex;align-items:center}";export{l as tds_footer_group}