@proximus/lavender 2.0.0-alpha.37 → 2.0.0-alpha.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12505,19 +12505,19 @@ class MddSectionItem extends HTMLElement {
12505
12505
  if (!customElements.get("px-mdd-section-item")) {
12506
12506
  customElements.define("px-mdd-section-item", MddSectionItem);
12507
12507
  }
12508
- const styles$j = "*{box-sizing:border-box}#container{display:flex;flex-wrap:nowrap;font-family:var(--px-font-family);font-size:var(--px-font-size-base);color:var(--px-color-text-neutral-default);width:1080px;border-radius:var(--px-radius-main);background-color:var(--px-color-background-surface-default);overflow:hidden}#container.info{border-left:5px var(--px-color-icon-brand-default) solid}#container.success{border-left:5px var(--px-color-icon-purpose-success-default) solid}#container.warning{border-left:5px var(--px-color-icon-purpose-warning-default) solid}#container.error{border-left:5px var(--px-color-icon-purpose-error-default) solid}#content-container{padding:var(--px-padding-m-mobile);flex-grow:1}#media-container{display:none}::slotted(px-button-icon){position:absolute;top:var(--px-padding-m-desktop);right:var(--px-padding-m-desktop)}dialog{background:transparent;border-radius:0;box-shadow:none;padding:0;border:0;box-sizing:border-box;transform:scale(.95);animation:modalIn .3s ease-out forwards}::backdrop{background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}#content{max-height:12.5em;overflow:auto}@media screen and (max-width: 1081px){#container{width:inherit}#content-container{padding:var(--px-padding-m-mobile)}::slotted(px-button-icon){top:var(--px-padding-m-mobile);right:var(--px-padding-m-mobile)}}@media only screen and (min-width: 48em){::slotted(px-button-icon){position:absolute;top:var(--px-padding-m-tablet);right:var(--px-padding-m-tablet)}#content{max-height:25em}}@media only screen and (min-width: 64.0625em){:host([media-src]) #media-container{display:block;background-size:cover;background-position:center center;background-repeat:no-repeat;flex-basis:25em;flex-shrink:0}}@keyframes modalIn{0%{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}";
12508
+ const styles$j = '*{box-sizing:border-box}#container{display:flex;flex-wrap:nowrap;font-family:var(--px-font-family);font-size:var(--px-font-size-base);color:var(--px-color-text-neutral-default);width:inherit;border-radius:var(--px-radius-main);background-color:var(--px-color-background-surface-default);overflow:hidden}#container.info{border-left:5px var(--px-color-icon-brand-default) solid}#container.success{border-left:5px var(--px-color-icon-purpose-success-default) solid}#container.warning{border-left:5px var(--px-color-icon-purpose-warning-default) solid}#container.error{border-left:5px var(--px-color-icon-purpose-error-default) solid}#container.has-close-button #icon-container{max-width:calc(100% - (var(--px-size-m) + var(--px-spacing-s-mobile)))}#content-container{padding:var(--px-padding-m-mobile);flex-grow:1}#media-container{display:none}::slotted(px-button-icon[slot="close-button"]){position:absolute;top:var(--px-padding-m-mobile);right:var(--px-padding-m-mobile)}dialog{background:transparent;border-radius:0;box-shadow:none;padding:0;border:0;box-sizing:border-box;transform:scale(.95);animation:modalIn .3s ease-out forwards}::backdrop{background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}#content{max-height:12.5em;overflow:auto}@media only screen and (min-width: 48em){#container.has-close-button #icon-container{max-width:calc(100% - (var(--px-size-m) + var(--px-spacing-s-tablet)))}::slotted(px-button-icon[slot="close-button"]){position:absolute;top:var(--px-padding-m-tablet);right:var(--px-padding-m-tablet)}#content{max-height:25em}}@media only screen and (min-width: 64.0625em){#container.has-close-button #icon-container{max-width:calc(100% - (var(--px-size-m) + var(--px-spacing-s-laptop)))}::slotted(px-button-icon[slot="close-button"]){top:var(--px-padding-m-laptop);right:var(--px-padding-m-laptop)}:host([media-src]) #container.has-close-button #icon-container{max-width:100%}:host([media-src]) #media-container{display:block;background-size:cover;background-position:center center;background-repeat:no-repeat;flex-basis:25em;flex-shrink:0}}@media screen and (min-width: 1118px){#container{width:1080px}}@media only screen and (min-width: 90.0625em){:host(:not([media-src])) #container.has-close-button #icon-container{max-width:calc(100% - (var(--px-size-m) + var(--px-spacing-s-desktop)))}::slotted(px-button-icon[slot="close-button"]){position:absolute;top:var(--px-padding-m-desktop);right:var(--px-padding-m-desktop)}}@keyframes modalIn{0%{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}';
12509
12509
  const styleSheet$j = new CSSStyleSheet();
12510
12510
  styleSheet$j.replaceSync(styles$j);
12511
12511
  const CLOSE_EVENT$1 = "px.lavender.modal.close";
12512
12512
  class Modal extends HTMLElement {
12513
12513
  constructor() {
12514
12514
  super();
12515
- this.template = ` <dialog>
12515
+ this.template = `<dialog>
12516
12516
  <div id="container">
12517
12517
  <div id="content-container">
12518
12518
  <px-vstack gap="default" >
12519
12519
  <px-hstack id="icon-container" gap="s" align-items="flex-start">
12520
- <px-vstack gap="s">
12520
+ <px-vstack gap="xs">
12521
12521
  <px-h1 variant="title-l">
12522
12522
  <slot name="title"></slot>
12523
12523
  </px-h1>
@@ -12552,6 +12552,9 @@ class Modal extends HTMLElement {
12552
12552
  this.shadowRoot.adoptedStyleSheets = [styleSheet$j];
12553
12553
  }
12554
12554
  connectedCallback() {
12555
+ var _a, _b;
12556
+ this.toggleDescriptionVisibility = this.toggleDescriptionVisibility.bind(this);
12557
+ this.toggleCloseButtonSafeArea = this.toggleCloseButtonSafeArea.bind(this);
12555
12558
  if (this.hasAttribute("open")) {
12556
12559
  this.show();
12557
12560
  }
@@ -12569,6 +12572,16 @@ class Modal extends HTMLElement {
12569
12572
  if (this.hasAttribute("media-src")) {
12570
12573
  this.updateMediaSrc(this.getAttribute("media-src"));
12571
12574
  }
12575
+ this.toggleDescriptionVisibility();
12576
+ (_a = this.$slotDescription) == null ? void 0 : _a.addEventListener(
12577
+ "slotchange",
12578
+ this.toggleDescriptionVisibility
12579
+ );
12580
+ this.toggleCloseButtonSafeArea();
12581
+ (_b = this.$slotCloseButton) == null ? void 0 : _b.addEventListener(
12582
+ "slotchange",
12583
+ this.toggleCloseButtonSafeArea
12584
+ );
12572
12585
  }
12573
12586
  static get observedAttributes() {
12574
12587
  return ["open", "status", "media-src", "openedby"];
@@ -12589,6 +12602,13 @@ class Modal extends HTMLElement {
12589
12602
  break;
12590
12603
  }
12591
12604
  }
12605
+ disconnectedCallback() {
12606
+ var _a;
12607
+ (_a = this.$slotDescription) == null ? void 0 : _a.removeEventListener(
12608
+ "slotchange",
12609
+ this.toggleDescriptionVisibility
12610
+ );
12611
+ }
12592
12612
  handleOpenChange() {
12593
12613
  if (this.hasAttribute("open")) {
12594
12614
  this.show();
@@ -12657,6 +12677,44 @@ class Modal extends HTMLElement {
12657
12677
  (_c = this.$opener) == null ? void 0 : _c.addEventListener("click", () => this.show());
12658
12678
  }
12659
12679
  }
12680
+ toggleDescriptionVisibility() {
12681
+ if (!this.$slottedDescription) {
12682
+ this.$descriptionContainer.style.display = "none";
12683
+ } else {
12684
+ this.$descriptionContainer.style.display = "block";
12685
+ }
12686
+ }
12687
+ toggleCloseButtonSafeArea() {
12688
+ var _a, _b, _c;
12689
+ if (this.$slottedCloseButton) {
12690
+ (_a = this.$container) == null ? void 0 : _a.classList.add("has-close-button");
12691
+ } else {
12692
+ if ((_b = this.$container) == null ? void 0 : _b.classList.contains("has-close-button")) {
12693
+ (_c = this.$container) == null ? void 0 : _c.classList.remove("has-close-button");
12694
+ }
12695
+ }
12696
+ }
12697
+ get $slottedCloseButton() {
12698
+ return this.querySelector('[slot="close-button"]');
12699
+ }
12700
+ get $slotCloseButton() {
12701
+ return this.shadowRoot.querySelector(
12702
+ 'slot[name="close-button"]'
12703
+ );
12704
+ }
12705
+ get $slottedDescription() {
12706
+ return this.querySelector('[slot="description"]');
12707
+ }
12708
+ get $slotDescription() {
12709
+ return this.shadowRoot.querySelector(
12710
+ 'slot[name="description"]'
12711
+ );
12712
+ }
12713
+ get $descriptionContainer() {
12714
+ return this.shadowRoot.querySelector(
12715
+ 'px-p[font-weight="title"]'
12716
+ );
12717
+ }
12660
12718
  get $opener() {
12661
12719
  return document.querySelector(
12662
12720
  `px-button#${this.getAttribute("openedby")}`