@proximus/lavender-cell 1.4.1 → 1.4.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.
@@ -3,6 +3,7 @@ import '@proximus/lavender-layout';
3
3
  import { Cell } from '@proximus/lavender-cell';
4
4
  export declare class CellButton extends PxElement<HTMLButtonElement> {
5
5
  static nativeName: string;
6
+ static accessorExclusions: string[];
6
7
  private template;
7
8
  constructor();
8
9
  connectedCallback(): void;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { checkName as u, PxElement as v, WithExtraAttributes as g } from "@proximus/lavender-common";
1
+ import { checkName as b, PxElement as k, WithExtraAttributes as m } from "@proximus/lavender-common";
2
2
  import "@proximus/lavender-layout";
3
3
  import { checkboxStateValues as q } from "@proximus/lavender-checkbox";
4
4
  import { stateValues as M } from "@proximus/lavender-radio-group";
@@ -14,13 +14,13 @@ function c(r) {
14
14
  r.getAttribute("variant") === "contained" && !r.getAttribute("background-color") && r.setAttribute("background-color", "container-light");
15
15
  }
16
16
  function P(r, t, e) {
17
- if (!u(R, e)) {
17
+ if (!b(R, e)) {
18
18
  console.error(`${e} is not an allowed variant value.`);
19
19
  return;
20
20
  }
21
21
  t !== null && t !== "" && t !== "default" && r.classList.toggle(t), e !== null && e !== "" && e !== "default" && r.classList.toggle(e);
22
22
  }
23
- function d(r, t, e, s = []) {
23
+ function h(r, t, e, s = []) {
24
24
  e ? (r.setAttribute("inverted", ""), s.forEach((i) => i.setAttribute("inverted", "")), t.forEach((i) => {
25
25
  i.hasAttribute("inverted") || i.setAttribute("inverted", "");
26
26
  })) : (r.removeAttribute("inverted"), s.forEach((i) => i.removeAttribute("inverted")), t.forEach((i) => {
@@ -28,7 +28,7 @@ function d(r, t, e, s = []) {
28
28
  }));
29
29
  }
30
30
  function B(r, t, e, s, i) {
31
- if (!u(i, s)) {
31
+ if (!b(i, s)) {
32
32
  console.error(`${s} is not an allowed ${t} value`);
33
33
  return;
34
34
  }
@@ -53,7 +53,7 @@ function $(r, t, e, s = [], i = {}) {
53
53
  const n = ":host{display:block;outline:none}:host .cell,:host .cell-link,:host .cell-button,:host .cell-checkbox,:host .cell-radio,:host .cell-switch{display:block;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition)}:host .cell,:host .cell *,:host .cell-link,:host .cell-link *,:host .cell-button,:host .cell-button *,:host .cell-checkbox,:host .cell-checkbox *,:host .cell-radio,:host .cell-radio *,:host .cell-switch,:host .cell-switch *{box-sizing:border-box}:host .cell-link,:host .cell-button,:host .cell-checkbox,:host .cell-radio,:host .cell-switch{width:100%;outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile)}:host .cell-link,:host .cell-button{cursor:pointer}:host .cell-checkbox,:host .cell-radio,:host .cell-switch{cursor:default}:host:host(:not([disabled])):host(:focus-visible) .cell-checkbox,:host:host(:not([disabled])):host(:focus-visible) .cell-radio,:host:host(:not([disabled])):host(:focus-visible) .cell-switch{outline-offset:var(--px-focus-offset-mobile);outline-style:solid;position:relative}:host:host(:not([disabled])) .cell-link:focus-visible,:host:host(:not([disabled])) .cell-button:focus-visible{outline-offset:var(--px-focus-offset-mobile);outline-style:solid;position:relative}:host:host([disabled]) .cell-link,:host:host([disabled]) .cell-button,:host:host([disabled]) .cell-checkbox,:host:host([disabled]) .cell-radio,:host:host([disabled]) .cell-switch{cursor:default;pointer-events:none}@media only screen and (min-width: 768px){:scope:host .cell-link,:scope:host .cell-button,:scope:host .cell-checkbox,:scope:host .cell-radio,:scope:host .cell-switch{outline-width:var(--px-focus-outline-tablet)}:scope:host:host(:not([disabled])):host(:focus-visible) .cell-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .cell-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .cell-switch{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}:scope:host:host(:not([disabled])) .cell-link:focus-visible,:scope:host:host(:not([disabled])) .cell-button:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 1025px){:scope:host .cell-link,:scope:host .cell-button,:scope:host .cell-checkbox,:scope:host .cell-radio,:scope:host .cell-switch{outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])):host(:focus-visible) .cell-checkbox,:scope:host:host(:not([disabled])):host(:focus-visible) .cell-radio,:scope:host:host(:not([disabled])):host(:focus-visible) .cell-switch{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}:scope:host:host(:not([disabled])) .cell-link:focus-visible,:scope:host:host(:not([disabled])) .cell-button:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .cell-link,:host([inverted]) .cell-button,:host([inverted]) .cell-checkbox,:host([inverted]) .cell-radio,:host([inverted]) .cell-switch{outline-color:var(--px-color-border-focus-outline-inverted)}", H = ':host([separator]):after{position:relative;content:"";display:block;width:100%;border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}.cell{color:var(--px-color-text-neutral-default);padding:var(--px-spacing-s-mobile);font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l)}.cell ::slotted([slot="label"]){font-size:var(--px-text-size-label-l-mobile);font-weight:var(--px-font-weight-title)}.cell ::slotted([slot="description"]){font-weight:var(--px-font-weight-body);font-size:var(--px-text-size-label-m-mobile)}.cell ::slotted([slot="suffix"]){text-align:right;font-weight:var(--px-font-weight-title)}.cell[compact]{padding-block:var(--px-spacing-xs-mobile)}:host([hoverable]:not([disabled])) .cell{cursor:pointer;text-decoration:none}:host([hoverable]:hover:not([disabled])) .cell{background-color:var(--px-color-background-state-hover-default)}:host([hoverable][disabled]) .cell{cursor:default;pointer-events:none;color:var(--px-color-text-state-disabled-default)}.contained{background-color:var( --cell-contained-background-color-default, var(--px-color-background-container-light-default) )}:host([hoverable]) .contained{border:var(--px-size-border-m) solid transparent}:host([hoverable]:hover:not([disabled])) .contained{background-color:var(--px-color-background-state-hover-bordered-default);border-color:var(--px-color-border-state-hover-default)}:host([hoverable][disabled]) .contained{background-color:var(--px-color-background-state-disabled-default)}@media only screen and (max-width: 47.9375em){:host([separator--mobile]):after{position:relative;content:"";display:block;width:100%;border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}.contained{border-radius:var( --cell-contained-border-radius-top-left--mobile, var(--px-radius-main) ) var( --cell-contained-border-radius-top-right--mobile, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-right--mobile, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-left--mobile, var(--px-radius-main) )}}@media only screen and (min-width: 48em){:host{display:block}.cell{padding:var(--px-padding-s-tablet)}.cell ::slotted([slot="label"]){font-size:var(--px-text-size-label-l-tablet)}.cell ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-tablet)}.cell[compact]{padding-block:var(--px-spacing-xs-tablet)}}@media only screen and (min-width: 48em) and (max-width: 64em){:host([separator--tablet]):after{position:relative;content:"";display:block;width:100%;border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}.contained{border-radius:var( --cell-contained-border-radius-top-left--tablet, var(--px-radius-main) ) var( --cell-contained-border-radius-top-right--tablet, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-right--tablet, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-left--tablet, var(--px-radius-main) )}}@media only screen and (min-width: 64.0625em){:host{display:block}.cell{padding:var(--px-spacing-s-laptop)}.cell ::slotted([slot="label"]){font-size:var(--px-text-size-label-l-laptop)}.cell ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-laptop)}.cell[compact]{padding-block:var(--px-spacing-xs-laptop)}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){:host([separator--laptop]):after{position:relative;content:"";display:block;width:100%;border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}.contained{border-radius:var( --cell-contained-border-radius-top-left--laptop, var(--px-radius-main) ) var( --cell-contained-border-radius-top-right--laptop, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-right--laptop, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-left--laptop, var(--px-radius-main) )}}@media only screen and (min-width: 90.0625em){:host{display:block}:host([separator--desktop]):after{position:relative;content:"";display:block;width:100%;border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}.cell{padding:var(--px-spacing-s-desktop)}.cell ::slotted([slot="label"]){font-size:var(--px-text-size-label-l-desktop)}.cell ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-desktop)}.cell[compact]{padding-block:var(--px-spacing-xs-desktop)}.contained{border-radius:var( --cell-contained-border-radius-top-left--desktop, var(--px-radius-main) ) var( --cell-contained-border-radius-top-right--desktop, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-right--desktop, var(--px-radius-main) ) var( --cell-contained-border-radius-bottom-left--desktop, var(--px-radius-main) )}}:host([inverted]):after{border-bottom-color:var(--px-color-border-main-inverted)}:host([inverted]) .cell{color:var(--px-color-text-neutral-inverted)}:host([inverted]):host([hoverable]:hover:not([disabled])) .cell{background-color:var(--px-color-background-state-hover-inverted)}:host([inverted]):host([hoverable][disabled]) .cell{color:var(--px-color-text-state-disabled-inverted)}:host([inverted]):host([hoverable][disabled]) .contained{background-color:var(--px-color-background-state-disabled-inverted)}:host([inverted]) .contained{background-color:var( --cell-contained-background-color-inverted, var(--px-color-background-container-light-inverted) )}:host([inverted]):host([hoverable]:hover:not([disabled])) .contained{background-color:var( --px-color-background-state-hover-bordered-inverted );border-color:var(--px-color-border-state-hover-inverted)}', S = new CSSStyleSheet(), C = new CSSStyleSheet();
54
54
  S.replaceSync(n);
55
55
  C.replaceSync(H);
56
- const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], k = class k extends v {
56
+ const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], A = class A extends k {
57
57
  template() {
58
58
  return `
59
59
  <px-hstack gap="s" justify-content="space-between" align-items="center">
@@ -76,11 +76,11 @@ const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], k = class
76
76
  }
77
77
  constructor() {
78
78
  super(C, S);
79
- const t = document.createElement(this.nativeName);
79
+ const t = document.createElement("div");
80
80
  t.classList.add("cell"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
81
81
  }
82
82
  connectedCallback() {
83
- if (super.connectedCallback(), this.$slotVisual) {
83
+ if (this.$slotVisual) {
84
84
  const t = this.querySelector('px-img[slot="visual"]');
85
85
  t && l(t);
86
86
  }
@@ -146,7 +146,7 @@ const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], k = class
146
146
  }
147
147
  }
148
148
  configureSlotSuffixButtonIcon(t) {
149
- t.hasAttribute("variant") ? u(
149
+ t.hasAttribute("variant") ? b(
150
150
  x,
151
151
  t.getAttribute("variant")
152
152
  ) || (console.error(
@@ -156,7 +156,7 @@ const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], k = class
156
156
  ), t.setAttribute("variant", "secondary")) : t.setAttribute("variant", "secondary");
157
157
  }
158
158
  updateRadius(t, e, s, i) {
159
- if (!u(i, s)) {
159
+ if (!b(i, s)) {
160
160
  console.error(`${s} is not a valid ${t} value`);
161
161
  return;
162
162
  }
@@ -164,11 +164,11 @@ const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], k = class
164
164
  if (!a)
165
165
  this.separatorMobile || o.push("mobile"), this.separatorTablet || o.push("tablet"), this.separatorLaptop || o.push("laptop"), this.separatorDesktop || o.push("desktop");
166
166
  else {
167
- const h = t.split("--")[1];
168
- o.push(h);
167
+ const u = t.split("--")[1];
168
+ o.push(u);
169
169
  }
170
- o.forEach((h) => {
171
- e !== null && e !== "" && e !== "default" && this.updateStyle(h, e), s !== null && s !== "" && s !== "default" && this.updateStyle(h, s);
170
+ o.forEach((u) => {
171
+ e !== null && e !== "" && e !== "default" && this.updateStyle(u, e), s !== null && s !== "" && s !== "default" && this.updateStyle(u, s);
172
172
  });
173
173
  }
174
174
  updateStyle(t, e) {
@@ -283,14 +283,14 @@ const x = ["secondary"], F = ["", "default", "top", "bottom", "none"], k = class
283
283
  t ? this.setAttribute("compact", "") : this.removeAttribute("compact");
284
284
  }
285
285
  };
286
- k.nativeName = "div";
287
- let b = k;
288
- customElements.get("px-cell") || customElements.define("px-cell", b);
286
+ A.nativeName = "div";
287
+ let f = A;
288
+ customElements.get("px-cell") || customElements.define("px-cell", f);
289
289
  const _ = '.cell-link{text-decoration:none}.cell-link[noicon=""] px-icon{display:none}.cell-link px-icon{color:var(--px-color-icon-brand-default)}.cell-link[aria-disabled=true] px-icon{color:var(--px-color-icon-state-disabled-default)}[compact] .cell-link{padding-block:var(--px-spacing-xs-mobile)}:host([inverted]) .cell-link px-icon{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .cell-link[aria-disabled=true] px-icon{color:var(--px-color-icon-state-disabled-inverted)}', y = new CSSStyleSheet();
290
290
  y.replaceSync(n);
291
291
  const w = new CSSStyleSheet();
292
292
  w.replaceSync(_);
293
- const m = class m extends v {
293
+ const p = class p extends k {
294
294
  template() {
295
295
  return `
296
296
  <px-cell hoverable>
@@ -310,11 +310,11 @@ const m = class m extends v {
310
310
  }
311
311
  constructor() {
312
312
  super(w, y);
313
- const t = document.createElement(this.nativeName);
313
+ const t = document.createElement(p.nativeName);
314
314
  t.classList.add("cell-link"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
315
315
  }
316
316
  connectedCallback() {
317
- if (super.connectedCallback(), this.$slotVisual) {
317
+ if (this.$slotVisual) {
318
318
  const e = this.querySelector('px-img[slot="visual"]');
319
319
  e && l(e);
320
320
  }
@@ -352,7 +352,7 @@ const m = class m extends v {
352
352
  this.$cell.variant = this.variant;
353
353
  break;
354
354
  case "inverted":
355
- d(this.$cell, this.$children, this.inverted, [
355
+ h(this.$cell, this.$children, this.inverted, [
356
356
  this.$pxIcon
357
357
  ]);
358
358
  break;
@@ -497,14 +497,14 @@ const m = class m extends v {
497
497
  t ? this.setAttribute("compact", "") : this.removeAttribute("compact");
498
498
  }
499
499
  };
500
- m.nativeName = "a";
501
- let p = m;
502
- customElements.get("px-cell-link") || customElements.define("px-cell-link", p);
500
+ p.nativeName = "a";
501
+ let v = p;
502
+ customElements.get("px-cell-link") || customElements.define("px-cell-link", v);
503
503
  const j = ".cell-button{padding:0;background:none;border:none;text-align:left;font-size:inherit}", E = new CSSStyleSheet();
504
504
  E.replaceSync(n);
505
505
  const D = new CSSStyleSheet();
506
506
  D.replaceSync(j);
507
- const A = class A extends v {
507
+ const d = class d extends k {
508
508
  template() {
509
509
  return `
510
510
  <px-cell hoverable>
@@ -517,11 +517,11 @@ const A = class A extends v {
517
517
  }
518
518
  constructor() {
519
519
  super(D, E);
520
- const t = document.createElement(this.nativeName);
520
+ const t = document.createElement(d.nativeName);
521
521
  t.classList.add("cell-button"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
522
522
  }
523
523
  connectedCallback() {
524
- if (super.connectedCallback(), this.$slotVisual) {
524
+ if (this.$slotVisual) {
525
525
  const t = this.querySelector('px-img[slot="visual"]');
526
526
  t && l(t);
527
527
  }
@@ -554,7 +554,7 @@ const A = class A extends v {
554
554
  this.$cell.variant = this.variant;
555
555
  break;
556
556
  case "inverted":
557
- d(this.$cell, this.$children, this.inverted);
557
+ h(this.$cell, this.$children, this.inverted);
558
558
  break;
559
559
  case "disabled":
560
560
  $(this.$cell, this.$children, this.disabled, [], {
@@ -682,13 +682,13 @@ const A = class A extends v {
682
682
  t ? this.setAttribute("compact", "") : this.removeAttribute("compact");
683
683
  }
684
684
  };
685
- A.nativeName = "button";
686
- let f = A;
687
- customElements.get("px-cell-button") || customElements.define("px-cell-button", f);
685
+ d.nativeName = "button", d.accessorExclusions = ["disabled"];
686
+ let g = d;
687
+ customElements.get("px-cell-button") || customElements.define("px-cell-button", g);
688
688
  const L = new CSSStyleSheet();
689
689
  L.replaceSync(n);
690
690
  const O = ["", "left", "right"];
691
- class W extends g {
691
+ class W extends m {
692
692
  template() {
693
693
  return `
694
694
  <div class="cell-checkbox">
@@ -755,7 +755,7 @@ class W extends g {
755
755
  this.$cell.variant = this.variant;
756
756
  break;
757
757
  case "inverted":
758
- d(this.$cell, this.$children, this.inverted, [
758
+ h(this.$cell, this.$children, this.inverted, [
759
759
  this.$checkbox
760
760
  ]);
761
761
  break;
@@ -977,7 +977,7 @@ class W extends g {
977
977
  customElements.get("px-cell-checkbox") || customElements.define("px-cell-checkbox", W);
978
978
  const I = new CSSStyleSheet();
979
979
  I.replaceSync(n);
980
- class G extends g {
980
+ class G extends m {
981
981
  template() {
982
982
  return `
983
983
  <div class="cell-switch">
@@ -1042,7 +1042,7 @@ class G extends g {
1042
1042
  this.$cell.variant = this.variant;
1043
1043
  break;
1044
1044
  case "inverted":
1045
- d(this.$cell, this.$children, this.inverted, [
1045
+ h(this.$cell, this.$children, this.inverted, [
1046
1046
  this.$switch
1047
1047
  ]);
1048
1048
  break;
@@ -1240,7 +1240,7 @@ customElements.get("px-cell-switch") || customElements.define("px-cell-switch",
1240
1240
  const T = new CSSStyleSheet();
1241
1241
  T.replaceSync(n);
1242
1242
  const J = ["", "left", "right"];
1243
- class K extends g {
1243
+ class K extends m {
1244
1244
  template() {
1245
1245
  return `
1246
1246
  <div class="cell-radio">
@@ -1308,7 +1308,7 @@ class K extends g {
1308
1308
  this.$cell.variant = this.variant;
1309
1309
  break;
1310
1310
  case "inverted":
1311
- d(this.$cell, this.$children, this.inverted, [
1311
+ h(this.$cell, this.$children, this.inverted, [
1312
1312
  this.$radio
1313
1313
  ]);
1314
1314
  break;
@@ -1529,10 +1529,10 @@ class K extends g {
1529
1529
  }
1530
1530
  customElements.get("px-cell-radio") || customElements.define("px-cell-radio", K);
1531
1531
  export {
1532
- b as Cell,
1533
- f as CellButton,
1532
+ f as Cell,
1533
+ g as CellButton,
1534
1534
  W as CellCheckbox,
1535
- p as CellLink,
1535
+ v as CellLink,
1536
1536
  K as CellRadio,
1537
1537
  G as CellSwitch,
1538
1538
  O as cellCheckboxPosition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-cell",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",