@proximus/lavender-content-header 1.4.20-alpha.6 → 1.4.20-alpha.7

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.
@@ -30,6 +30,8 @@ export declare class ContentHeader extends PxElement<HTMLDivElement> {
30
30
  get $children(): NodeListOf<Element>;
31
31
  get backgroundColor(): string | null;
32
32
  set backgroundColor(value: string | null);
33
+ get backgroundGradient(): string | null;
34
+ set backgroundGradient(value: string | null);
33
35
  get gradient(): string | null;
34
36
  set gradient(value: string | null);
35
37
  get backgroundImage(): string | null;
@@ -106,6 +106,10 @@
106
106
  "kind": "field",
107
107
  "name": "backgroundColor"
108
108
  },
109
+ {
110
+ "kind": "field",
111
+ "name": "backgroundGradient"
112
+ },
109
113
  {
110
114
  "kind": "field",
111
115
  "name": "gradient"
package/dist/index.es.js CHANGED
@@ -169,12 +169,12 @@ var w = [
169
169
  this.$el.style.setProperty(`--${e}`, `url("${t}")`);
170
170
  }
171
171
  updateGradient(e, t) {
172
- if (this.checkName(m, t)) {
173
- let n = this.splitAttrNameFromBreakpoint(e);
174
- e = n.attrName;
175
- let r = n.breakpoint;
176
- this.$el.style.setProperty(`--${e}${r}`, `linear-gradient(var(--px-color-background-gradient-${t}))`);
177
- } else h(`"${t}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${m.join("\", \"")}".`);
172
+ let { attrName: n, breakpoint: r } = this.splitAttrNameFromBreakpoint(e), i = `--${n}${r}`;
173
+ if (t === null) {
174
+ this.$el.style.removeProperty(i);
175
+ return;
176
+ }
177
+ this.checkName(m, t) ? this.$el.style.setProperty(i, `linear-gradient(var(--px-color-background-gradient-${t}))`) : h(`"${t}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${m.join("\", \"")}".`);
178
178
  }
179
179
  updateBackgroundColor(e, t) {
180
180
  let n = t.startsWith("surface-");
@@ -1939,7 +1939,7 @@ var Q = new CSSStyleSheet();
1939
1939
  Q.replaceSync(b);
1940
1940
  var $ = class e extends t {
1941
1941
  static {
1942
- this.template = d("<div class=\"content-header\"><div class=\"contrast-helper\"></div><px-section padding-block=\"l\"><px-grid gap=\"none\"><px-container padding=\"none\" border-radius=\"none\" background-color=\"none\" ><div class=\"content-header-content\"><px-vstack gap=\"heading-to-subtitle\"><px-h1><slot></slot></px-h1><slot name=\"subtitle\"></slot></px-vstack><px-stack gap=\"s\" direction=\"row\" direction--mobile=\"column\"><slot name=\"patch\" shrink></slot><slot name=\"patch-description\"></slot></px-stack></div></px-container></px-grid><slot name=\"overlap\" slot=\"overlap\"></slot></px-section></div>");
1942
+ this.template = d("<div class=\"content-header\"><div class=\"contrast-helper\"></div><px-section padding-block=\"l\"><px-grid gap=\"none\"><px-container padding=\"none\" border-radius=\"none\" background-color=\"none\"><div class=\"content-header-content\"><px-vstack gap=\"heading-to-subtitle\"><px-h1><slot></slot></px-h1><slot name=\"subtitle\"></slot></px-vstack><px-stack gap=\"s\" direction=\"row\" direction--mobile=\"column\"><slot name=\"patch\" shrink></slot><slot name=\"patch-description\"></slot></px-stack></div></px-container></px-grid><slot name=\"overlap\" slot=\"overlap\"></slot></px-section></div>");
1943
1943
  }
1944
1944
  static {
1945
1945
  this.nativeName = "div";
@@ -1986,7 +1986,7 @@ var $ = class e extends t {
1986
1986
  this.$section.backgroundColor = r.indexOf(n) > 0 ? n : "none";
1987
1987
  break;
1988
1988
  case "background-gradient":
1989
- this.$section.gradient = m.indexOf(n) > 0 ? n : "none";
1989
+ this.$section.gradient = n === null ? null : m.indexOf(n) > 0 ? n : "none";
1990
1990
  break;
1991
1991
  case "background-image":
1992
1992
  this.$section.backgroundImage = n;
@@ -2096,12 +2096,18 @@ var $ = class e extends t {
2096
2096
  set backgroundColor(e) {
2097
2097
  this._updateAttribute("background-color", e);
2098
2098
  }
2099
- get gradient() {
2099
+ get backgroundGradient() {
2100
2100
  return this.getAttribute("background-gradient");
2101
2101
  }
2102
- set gradient(e) {
2102
+ set backgroundGradient(e) {
2103
2103
  this._updateAttribute("background-gradient", e);
2104
2104
  }
2105
+ get gradient() {
2106
+ return this.backgroundGradient;
2107
+ }
2108
+ set gradient(e) {
2109
+ this.backgroundGradient = e;
2110
+ }
2105
2111
  get backgroundImage() {
2106
2112
  return this.getAttribute("background-image");
2107
2113
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@proximus/lavender-content-header",
4
- "version": "1.4.20-alpha.6",
4
+ "version": "1.4.20-alpha.7",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -57,6 +57,7 @@
57
57
  { "name": "$overlapSlot" },
58
58
  { "name": "$children" },
59
59
  { "name": "backgroundColor" },
60
+ { "name": "backgroundGradient" },
60
61
  { "name": "gradient" },
61
62
  { "name": "backgroundImage" },
62
63
  { "name": "backgroundImageMobile" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-content-header",
3
- "version": "1.4.20-alpha.6",
3
+ "version": "1.4.20-alpha.7",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",