@govtechsg/sgds-web-component 3.2.0-rc.2 → 3.2.0-rc.3

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.
@@ -7753,7 +7753,7 @@
7753
7753
  property()
7754
7754
  ], SgdsAlertLink.prototype, "target", void 0);
7755
7755
 
7756
- var css_248z$17 = css`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-default)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-default)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-default)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-default)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-24,24px);justify-content:center;max-width:100%;min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-2-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-default);color:var(--sgds-color-fixed-dark)}.badge-label{line-height:var(--sgds-line-height-min);padding:var(--sgds-padding-none) var(--sgds-padding-2-xs)}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}.badge.truncated .badge-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}slot::slotted(*){font-size:14px;font-weight:400}`;
7756
+ var css_248z$17 = css`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-default)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-default)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-default)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-default)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-24,24px);justify-content:center;max-width:192px;min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-2-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-default);color:var(--sgds-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{line-height:var(--sgds-line-height-min);padding:var(--sgds-padding-none) var(--sgds-padding-2-xs)}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}.badge.truncated .badge-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}slot::slotted(*){font-size:14px;font-weight:400}`;
7757
7757
 
7758
7758
  var top = 'top';
7759
7759
  var bottom = 'bottom';
@@ -12059,6 +12059,8 @@
12059
12059
  this.outlined = false;
12060
12060
  /** Manually set the dismissible state of the button to `false` */
12061
12061
  this.dismissible = false;
12062
+ /** Manually enable full width */
12063
+ this.fullWidth = false;
12062
12064
  this.truncated = false;
12063
12065
  this.text = "";
12064
12066
  }
@@ -12102,14 +12104,15 @@
12102
12104
  this.text = getTextContent(e.target);
12103
12105
  return;
12104
12106
  }
12105
- _renderContent() {
12107
+ _renderBadge() {
12106
12108
  return html$1 `<div
12107
12109
  class="
12108
12110
  ${classMap({
12109
12111
  [`badge-dismissible`]: this.dismissible,
12110
12112
  badge: true,
12111
12113
  outlined: this.outlined,
12112
- truncated: this.truncated
12114
+ truncated: this.truncated,
12115
+ "full-width": this.fullWidth
12113
12116
  })}"
12114
12117
  aria-hidden=${this.show ? "false" : "true"}
12115
12118
  >
@@ -12132,8 +12135,8 @@
12132
12135
  render() {
12133
12136
  return (this.dismissible && this.show) || !this.dismissible
12134
12137
  ? this.truncated
12135
- ? html$1 `<sgds-tooltip content=${this.text}>${this._renderContent()}</sgds-tooltip>`
12136
- : this._renderContent()
12138
+ ? html$1 `<sgds-tooltip content=${this.text}>${this._renderBadge()}</sgds-tooltip>`
12139
+ : this._renderBadge()
12137
12140
  : nothing;
12138
12141
  }
12139
12142
  }
@@ -12155,6 +12158,9 @@
12155
12158
  __decorate([
12156
12159
  property({ type: Boolean, reflect: true })
12157
12160
  ], SgdsBadge.prototype, "dismissible", void 0);
12161
+ __decorate([
12162
+ property({ type: Boolean, reflect: true })
12163
+ ], SgdsBadge.prototype, "fullWidth", void 0);
12158
12164
  __decorate([
12159
12165
  state()
12160
12166
  ], SgdsBadge.prototype, "truncated", void 0);