@proximus/lavender-drawer 2.0.0-alpha.1 → 2.0.0-alpha.2

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.
package/dist/Drawer.d.ts CHANGED
@@ -16,6 +16,8 @@ export declare class Drawer extends HTMLElement {
16
16
  get $closeButton(): Icon;
17
17
  get $dialog(): HTMLDialogElement;
18
18
  get open(): boolean;
19
+ get $buttons(): NodeListOf<Element>;
20
+ get $separator(): HTMLElement;
19
21
  set open(value: boolean);
20
22
  get ariaLabelCloseButton(): string;
21
23
  set ariaLabelCloseButton(value: string);
package/dist/index.es.js CHANGED
@@ -3,7 +3,7 @@ import "@proximus/lavender-layout";
3
3
  import "@proximus/lavender-button-icon";
4
4
  import "@proximus/lavender-icon";
5
5
  import "@proximus/lavender-heading";
6
- const n = '#container{border:0;border-radius:var(--px-radius-main);background-color:var(--px-color-background-surface-default);box-sizing:border-box}:host([showfrom="bottom"]) #container{height:auto;margin-bottom:0;width:100%}px-button-icon{position:absolute;top:var(--px-padding-l-desktop);right:var(--px-padding-l-desktop)}dialog{background:transparent;border-radius:0;box-shadow:none;padding:0;border:0;box-sizing:border-box;width:75%}::backdrop{background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}#content{max-height:80vh;overflow:auto}@media screen and (min-width: 1080px){#container{height:100%;padding:var(--px-padding-l-desktop)}:host([showfrom="right"]) px-button-icon{right:10.625em}:host([showfrom="right"]) #container{padding-right:10.625em;border-radius:var(--px-radius-main) 0 0 var(--px-radius-main)}:host([showfrom="left"]) px-button-icon{right:var(--px-padding-l-desktop)}:host([showfrom="left"]) #container{padding-left:10.625em;border-radius:0 var(--px-radius-main) var(--px-radius-main) 0}:host([showfrom="bottom"]) #container{box-sizing:border-box}:host([showfrom="left"])>dialog{margin-left:0;animation:dialog-fade-in-left .3s;height:100%}:host([showfrom="bottom"])>dialog{margin-bottom:0;margin-inline:0;width:100%;animation:dialog-fade-in-bottom .3s}:host([showfrom="right"])>dialog{margin-right:0;animation:dialog-fade-in-right .3s;height:100%}}@media only screen and (max-width: 67.563em){dialog{width:100%}:host([showfrom="left"])>dialog,:host([showfrom="right"])>dialog,:host([showfrom="bottom"])>dialog{margin-bottom:0;margin-inline:0;height:revert;animation:dialog-fade-in-bottom .3s}#container{width:100%;box-sizing:border-box;padding:var(--px-padding-m-mobile);border-radius:var(--px-radius-main) var(--px-radius-main) 0 0}px-button-icon{top:var(--px-padding-m-mobile);right:var(--px-padding-m-mobile)}#content{max-height:2.813em}}@keyframes dialog-fade-in-right{0%{margin-right:-67.5em}to{margin-right:0}}@keyframes dialog-fade-in-left{0%{margin-left:-67.5em}to{margin-left:0}}@keyframes dialog-fade-in-bottom{0%{margin-bottom:-12.5em}to{margin-bottom:0}}', s = new CSSStyleSheet();
6
+ const n = '#container{border:0;border-radius:var(--px-radius-main);background-color:var(--px-color-background-surface-default);box-sizing:border-box}:host([showfrom="bottom"]) #container{height:auto;margin-bottom:0;width:100%}px-button-icon{position:absolute;top:var(--px-padding-l-desktop);right:var(--px-padding-l-desktop)}dialog{background:transparent;border-radius:0;box-shadow:none;padding:0;border:0;box-sizing:border-box;width:75%}::backdrop{background:#0000004d;-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px)}#content{overflow:auto}@media screen and (min-width: 1080px){#container{height:100%;padding:var(--px-padding-l-desktop)}:host([showfrom="right"]) px-button-icon{right:10.625em}:host([showfrom="right"]) #container{padding-right:10.625em;border-radius:var(--px-radius-main) 0 0 var(--px-radius-main)}:host([showfrom="left"]) px-button-icon{right:var(--px-padding-l-desktop)}:host([showfrom="left"]) #container{padding-left:10.625em;border-radius:0 var(--px-radius-main) var(--px-radius-main) 0}:host([showfrom="bottom"]) #container{box-sizing:border-box}:host([showfrom="left"])>dialog{margin-left:0;animation:dialog-fade-in-left .3s;height:100%}:host([showfrom="bottom"])>dialog{margin-bottom:0;margin-inline:0;width:100%;animation:dialog-fade-in-bottom .3s}:host([showfrom="right"])>dialog{margin-right:0;animation:dialog-fade-in-right .3s;height:100%}#content{max-height:calc(100dvh - 22.625em)}}@media only screen and (max-width: 67.563em){dialog{width:100%}:host([showfrom="left"])>dialog,:host([showfrom="right"])>dialog,:host([showfrom="bottom"])>dialog{margin-bottom:0;margin-inline:0;height:revert;animation:dialog-fade-in-bottom .3s}#container{width:100%;box-sizing:border-box;padding:var(--px-padding-m-mobile);border-radius:var(--px-radius-main) var(--px-radius-main) 0 0}px-button-icon{top:var(--px-padding-m-mobile);right:var(--px-padding-m-mobile)}#content{min-height:2.813em;max-height:50dvh}}@keyframes dialog-fade-in-right{0%{margin-right:-67.5em}to{margin-right:0}}@keyframes dialog-fade-in-left{0%{margin-left:-67.5em}to{margin-left:0}}@keyframes dialog-fade-in-bottom{0%{margin-bottom:-12.5em}to{margin-bottom:0}}', s = new CSSStyleSheet();
7
7
  s.replaceSync(n);
8
8
  const d = "px.lavender.drawer.hide";
9
9
  class l extends HTMLElement {
@@ -59,26 +59,26 @@ class l extends HTMLElement {
59
59
  }
60
60
  this.$closeButton.addEventListener("click", () => {
61
61
  this.hide();
62
- });
62
+ }), this.$buttons.length === 0 && this.$separator.remove();
63
63
  }
64
64
  static get observedAttributes() {
65
65
  return ["open", "aria-label-close-button"];
66
66
  }
67
- attributeChangedCallback(t, o, i) {
68
- var a, e, r;
69
- t === "open" ? i !== null ? this.show() : this.hide() : t === "aria-label-close-button" && (i ? (r = (e = this.$closeButton) == null ? void 0 : e.setAttribute) == null || r.call(
70
- e,
67
+ attributeChangedCallback(t, e, i) {
68
+ var r, o, a;
69
+ t === "open" ? i !== null ? this.show() : this.hide() : t === "aria-label-close-button" && (i ? (a = (o = this.$closeButton) == null ? void 0 : o.setAttribute) == null || a.call(
70
+ o,
71
71
  "aria-label",
72
72
  i || "Close drawer"
73
- ) : (a = this.$closeButton) == null || a.removeAttribute("aria-label"));
73
+ ) : (r = this.$closeButton) == null || r.removeAttribute("aria-label"));
74
74
  }
75
75
  show() {
76
- var t, o;
77
- (o = (t = this.$dialog).showPopover) == null || o.call(t);
76
+ var t, e;
77
+ (e = (t = this.$dialog).showPopover) == null || e.call(t);
78
78
  }
79
79
  hide() {
80
- var t, o;
81
- (o = (t = this.$dialog).hidePopover) == null || o.call(t), this.dispatchEvent(
80
+ var t, e;
81
+ (e = (t = this.$dialog).hidePopover) == null || e.call(t), this.dispatchEvent(
82
82
  new Event(d, {
83
83
  bubbles: !0,
84
84
  composed: !0
@@ -94,6 +94,12 @@ class l extends HTMLElement {
94
94
  get open() {
95
95
  return this.hasAttribute("open");
96
96
  }
97
+ get $buttons() {
98
+ return this.querySelectorAll('[slot="footer"]');
99
+ }
100
+ get $separator() {
101
+ return this.shadowRoot.querySelector("px-separator");
102
+ }
97
103
  set open(t) {
98
104
  t ? this.setAttribute("open", "") : this.removeAttribute("open");
99
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-drawer",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",