@proximus/lavender 2.0.0-alpha.160 → 2.0.0-alpha.162

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.
@@ -15519,12 +15519,17 @@ const statusCardStateValues = [
15519
15519
  "error",
15520
15520
  "ongoing"
15521
15521
  ];
15522
+ const statusCardBackgroundColorValues = [
15523
+ "",
15524
+ "container-light",
15525
+ "container-default"
15526
+ ];
15522
15527
  const CLOSE_EVENT = "px.lavender.modal.close";
15523
15528
  const _StatusCard = class _StatusCard extends PxElement {
15524
15529
  constructor() {
15525
15530
  super(statusCardStyles);
15526
15531
  this.template = () => `<div class="status-card">
15527
- <px-container background-color="container-default" padding="s">
15532
+ <px-container padding="s" background-color="container-default">
15528
15533
  <px-hstack gap="s" align-items="flex-start">
15529
15534
  <px-icon name="information_fill" from="lavender" size="l" color="brand"></px-icon>
15530
15535
  <px-vstack gap="s" grow="1">
@@ -15545,7 +15550,8 @@ const _StatusCard = class _StatusCard extends PxElement {
15545
15550
  ...super.observedAttributes,
15546
15551
  "state",
15547
15552
  "inverted",
15548
- "status-icon-aria-label"
15553
+ "status-icon-aria-label",
15554
+ "background-color"
15549
15555
  ];
15550
15556
  }
15551
15557
  connectedCallback() {
@@ -15580,12 +15586,34 @@ const _StatusCard = class _StatusCard extends PxElement {
15580
15586
  this.$statusIcon.removeAttribute("aria-label");
15581
15587
  }
15582
15588
  break;
15589
+ case "background-color":
15590
+ if (this.backgroundColor) {
15591
+ this.updateBackgroundColor(
15592
+ newValue,
15593
+ statusCardBackgroundColorValues
15594
+ );
15595
+ }
15596
+ break;
15583
15597
  default:
15584
15598
  super.attributeChangedCallback(attrName, oldValue, newValue);
15585
15599
  break;
15586
15600
  }
15587
15601
  }
15588
15602
  }
15603
+ updateBackgroundColor(newValue, allowedValues) {
15604
+ if (!this.checkName(allowedValues, newValue)) {
15605
+ log(
15606
+ `"${newValue}" is not a valid background-color value for ${this.tagName.toLowerCase()}.
15607
+ Allowed values are: "${allowedValues.join('", "')}".`
15608
+ );
15609
+ return;
15610
+ }
15611
+ if (newValue === null || newValue === "") {
15612
+ this.$container.setAttribute("background-color", "container-default");
15613
+ } else {
15614
+ this.$container.setAttribute("background-color", newValue);
15615
+ }
15616
+ }
15589
15617
  updateState(state) {
15590
15618
  if (!this.checkName(statusCardStateValues, state)) {
15591
15619
  log(
@@ -15653,6 +15681,16 @@ const _StatusCard = class _StatusCard extends PxElement {
15653
15681
  this.removeAttribute("status-icon-aria-label");
15654
15682
  }
15655
15683
  }
15684
+ get backgroundColor() {
15685
+ return this.getAttribute("background-color");
15686
+ }
15687
+ set backgroundColor(value) {
15688
+ if (value) {
15689
+ this.setAttribute("background-color", value);
15690
+ } else {
15691
+ this.removeAttribute("background-color");
15692
+ }
15693
+ }
15656
15694
  };
15657
15695
  _StatusCard.nativeName = "div";
15658
15696
  let StatusCard = _StatusCard;
@@ -18769,6 +18807,7 @@ export {
18769
18807
  skeletonsVariantValues,
18770
18808
  sortingValues,
18771
18809
  stateValues,
18810
+ statusCardBackgroundColorValues,
18772
18811
  statusCardStateValues,
18773
18812
  statusStateValues,
18774
18813
  statusValues,