scb-wc-test 0.1.199 → 0.1.201

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.
@@ -1,13 +1,13 @@
1
- import{a as c,n,i as b,x as h,t as p}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,o,r){try{customElements.get(t)||s(t,o,r)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(e,s,t,o)=>{for(var r=o>1?void 0:o?u(s,t):s,l=e.length-1,d;l>=0;l--)(d=e[l])&&(r=(o?d(s,t,r):d(r))||r);return o&&r&&g(s,t,r),r};let i=class extends b{constructor(){super(...arguments),this._slotClickHandler=e=>{const s=this.shadowRoot?.querySelector("slot"),t=e.target;t&&t!==s&&t.dispatchEvent(new CustomEvent("hide-badge",{bubbles:!0,composed:!0}))},this.autoHide=!1,this.sizing="fit-content",this.position="relative",this.positionTop=0,this.positionRight=12,this.value="",this.label="",this.hidden=!1,this.variant="dot",this._badgeVisible=!0,this._onHideBadge=()=>{this._badgeVisible=!1,this.requestUpdate()}}firstUpdated(){const e=this.shadowRoot?.querySelector("slot");this.autoHide&&e&&e.addEventListener("click",this._slotClickHandler)}updated(){const e=this.shadowRoot?.querySelector("slot");e&&(this.autoHide?e.addEventListener("click",this._slotClickHandler):e.removeEventListener("click",this._slotClickHandler))}connectedCallback(){super.connectedCallback(),this.addEventListener("hide-badge",this._onHideBadge)}disconnectedCallback(){this.removeEventListener("hide-badge",this._onHideBadge),super.disconnectedCallback()}render(){this.style.setProperty("--scb-badge-absolute-top",this.positionTop+"px"),this.style.setProperty("--scb-badge-absolute-right",this.positionRight+"px");let e=this.value;!isNaN(Number(this.value))&&this.value.length>4&&(e=this.value.slice(0,4)+"+");const s=this.variant==="value"&&!this.value?"badge-value-empty":"",t=this._badgeVisible?"":"badge--hide",o=this.label||(this.variant==="dot"?"Indikator":`Märke: ${e}`);return h`
1
+ import{a as c,n as r,i as p,x as h,t as b}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,n,o){try{customElements.get(i)||e(i,n,o)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(t,e,i,n)=>{for(var o=n>1?void 0:n?u(e,i):e,d=t.length-1,l;d>=0;d--)(l=t[d])&&(o=(n?l(e,i,o):l(o))||o);return n&&o&&g(e,i,o),o};let s=class extends p{constructor(){super(...arguments),this._slotClickHandler=t=>{const e=this.shadowRoot?.querySelector("slot"),i=t.target;i&&i!==e&&i.dispatchEvent(new CustomEvent("hide-badge",{bubbles:!0,composed:!0}))},this.autoHide=!1,this.sizing="fit-content",this.position="relative",this.positionTop=0,this.positionRight=void 0,this.positionSide="right",this.positionLeft=void 0,this.value="",this.label="",this.hidden=!1,this.variant="dot",this._badgeVisible=!0,this._onHideBadge=()=>{this._badgeVisible=!1,this.requestUpdate()}}firstUpdated(){const t=this.shadowRoot?.querySelector("slot");this.autoHide&&t&&t.addEventListener("click",this._slotClickHandler)}updated(){const t=this.shadowRoot?.querySelector("slot");t&&(this.autoHide?t.addEventListener("click",this._slotClickHandler):t.removeEventListener("click",this._slotClickHandler))}connectedCallback(){super.connectedCallback(),this.addEventListener("hide-badge",this._onHideBadge)}disconnectedCallback(){this.removeEventListener("hide-badge",this._onHideBadge),super.disconnectedCallback()}mapSpacingToken(t){if(t==null)return;if(typeof t=="number"&&!Number.isNaN(t))return`${t}px`;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}render(){const t=this.mapSpacingToken(this.positionRight)??"var(--spacing-4)",e=this.mapSpacingToken(this.positionLeft)??"var(--spacing-4)",i=this.mapSpacingToken(this.positionTop)??"0px";this.style.setProperty("--scb-badge-absolute-top",i),this.style.setProperty("--scb-badge-absolute-right",t),this.style.setProperty("--scb-badge-absolute-left",e);let n=this.value;!isNaN(Number(this.value))&&this.value.length>4&&(n=this.value.slice(0,4)+"+");const o=this.variant==="value"&&!this.value?"badge-value-empty":"",d=this._badgeVisible?"":"badge--hide",l=this.label||(this.variant==="dot"?"Indikator":`Märke: ${n}`);return h`
2
2
  <div class="badge-content">
3
3
  <slot></slot>
4
4
  <div
5
- class="badge ${s} ${t}"
5
+ class="badge ${o} ${d}"
6
6
  role="status"
7
- aria-label="${this.variant==="dot",o}"
8
- aria-hidden="${this.variant==="dot"&&!this.label?"true":"false"}">${this.variant==="dot"?"":e}</div>
7
+ aria-label="${this.variant==="dot",l}"
8
+ aria-hidden="${this.variant==="dot"&&!this.label?"true":"false"}">${this.variant==="dot"?"":n}</div>
9
9
  </div>
10
- `}};i.styles=c`
10
+ `}};s.styles=c`
11
11
  :host {
12
12
  display: block;
13
13
  position: relative;
@@ -61,6 +61,10 @@ import{a as c,n,i as b,x as h,t as p}from"../../vendor/vendor.js";(function(){tr
61
61
  left: calc(100% - var(--scb-badge-absolute-right));
62
62
  white-space: nowrap;
63
63
  }
64
+ :host([position-side="left"]) .badge {
65
+ left: var(--scb-badge-absolute-left);
66
+ }
67
+
64
68
  :host([position="relative"]) .badge {
65
69
  position: relative;
66
70
  top: unset;
@@ -72,4 +76,4 @@ import{a as c,n,i as b,x as h,t as p}from"../../vendor/vendor.js";(function(){tr
72
76
  justify-content: center;
73
77
  gap: var(--scb-badge-relative-gap);
74
78
  }
75
- `;a([n({type:Boolean,reflect:!0,attribute:"auto-hide"})],i.prototype,"autoHide",2);a([n({type:String,reflect:!0})],i.prototype,"sizing",2);a([n({type:String,reflect:!0})],i.prototype,"position",2);a([n({type:Number,attribute:"position-top"})],i.prototype,"positionTop",2);a([n({type:Number,attribute:"position-right"})],i.prototype,"positionRight",2);a([n({type:String,reflect:!0})],i.prototype,"value",2);a([n({type:String,reflect:!0})],i.prototype,"label",2);a([n({type:Boolean,reflect:!0})],i.prototype,"hidden",2);a([n({type:String,reflect:!0})],i.prototype,"variant",2);i=a([p("scb-badge")],i);
79
+ `;a([r({type:Boolean,reflect:!0,attribute:"auto-hide"})],s.prototype,"autoHide",2);a([r({type:String,reflect:!0})],s.prototype,"sizing",2);a([r({type:String,reflect:!0})],s.prototype,"position",2);a([r({type:String,attribute:"position-top"})],s.prototype,"positionTop",2);a([r({type:String,attribute:"position-right"})],s.prototype,"positionRight",2);a([r({type:String,reflect:!0,attribute:"position-side"})],s.prototype,"positionSide",2);a([r({type:String,attribute:"position-left"})],s.prototype,"positionLeft",2);a([r({type:String,reflect:!0})],s.prototype,"value",2);a([r({type:String,reflect:!0})],s.prototype,"label",2);a([r({type:Boolean,reflect:!0})],s.prototype,"hidden",2);a([r({type:String,reflect:!0})],s.prototype,"variant",2);s=a([b("scb-badge")],s);
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-icon-button/scb-icon-button.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
2
- import{_ as u}from"../../vendor/preload-helper.js";import{a as h,n as l,r as p,i as b,E as m,x as d,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(i,s,o){try{customElements.get(i)||n(i,s,o)}catch(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a=(e,n,i,s)=>{for(var o=s>1?void 0:s?f(n,i):n,r=e.length-1,c;r>=0;r--)(c=e[r])&&(o=(s?c(n,i,o):c(o))||o);return s&&o&&g(n,i,o),o};let t=class extends b{constructor(){super(...arguments),this.label="",this.selected=!1,this.noHighlightSelected=!1,this.leadingIcon="",this.itemHref="",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const n=Array.from(this.parentElement?.querySelectorAll("scb-menu-item")||[]),i=n.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(n[i+1]||n[0]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(n[i-1]||n[n.length-1]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"Home":{e.preventDefault(),n[0].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"End":{e.preventDefault(),n[n.length-1].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){t.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),t.__rippleLoaded=!0),t.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),t.__focusRingLoaded=!0),this.leadingIcon&&!t.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),t.__iconLoaded=!0),this.hasSlotContent&&!t.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,0]),import.meta.url),t.__iconButtonLoaded=!0)}__syncHasSlotContentFromLightDom(){const e=Array.from(this.children);this.hasSlotContent=e.length>0&&e.every(n=>n.tagName==="SCB-SUB-MENU")}connectedCallback(){super.connectedCallback(),this.__syncHasSlotContentFromLightDom()}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(s=>s.tagName==="SCB-SUB-MENU")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-menu-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,n=!!this.itemHref,i=this.hasSlotContent;return d`
2
+ import{_ as u}from"../../vendor/preload-helper.js";import{a as h,n as l,r as p,i as b,E as m,x as d,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(i,s,o){try{customElements.get(i)||n(i,s,o)}catch(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a=(e,n,i,s)=>{for(var o=s>1?void 0:s?f(n,i):n,r=e.length-1,c;r>=0;r--)(c=e[r])&&(o=(s?c(n,i,o):c(o))||o);return s&&o&&g(n,i,o),o};let t=class extends b{constructor(){super(...arguments),this.label="",this.selected=!1,this.noHighlightSelected=!1,this.leadingIcon="",this.itemHref="",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const n=Array.from(this.closest("scb-sub-menu, scb-menu")?.querySelectorAll("scb-menu-item")||[]),i=n.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(n[i+1]||n[0]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(n[i-1]||n[n.length-1]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"Home":{e.preventDefault(),n[0].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"End":{e.preventDefault(),n[n.length-1].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){t.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),t.__rippleLoaded=!0),t.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),t.__focusRingLoaded=!0),this.leadingIcon&&!t.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),t.__iconLoaded=!0),this.hasSlotContent&&!t.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,0]),import.meta.url),t.__iconButtonLoaded=!0)}__syncHasSlotContentFromLightDom(){const e=Array.from(this.children);this.hasSlotContent=e.length>0&&e.every(n=>n.tagName==="SCB-SUB-MENU")}connectedCallback(){super.connectedCallback(),this.__syncHasSlotContentFromLightDom()}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(s=>s.tagName==="SCB-SUB-MENU")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-menu-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,n=!!this.itemHref,i=this.hasSlotContent;return d`
3
3
  <div class="scb-menu-item">
4
4
  <div class="scb-menu-item-label" ?selected=${this.selected} ?no-highlight-selected=${this.noHighlightSelected}>
5
5
  ${n?d`
@@ -13,6 +13,7 @@ import{a as g,n as o,i as u,x as l,t as d}from"../../vendor/vendor.js";import"..
13
13
  align-items: center;
14
14
  gap: var(--spacing-3);
15
15
  width: fit-content;
16
+ font-family: var(--brand-font);
16
17
 
17
18
  margin-block-start: var(--scb-status-pill-spacing-block-start, 0);
18
19
  margin-block-end: var(--scb-status-pill-spacing-block-end, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.199",
3
+ "version": "0.1.201",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -378,5 +378,5 @@
378
378
  },
379
379
  "./mvc/*": "./mvc/*"
380
380
  },
381
- "buildHash": "302E3B547C6F0CD4D8BBF7F2EDA7E16EC37B5D99B109118CBDD69A3C5C0DEF86"
381
+ "buildHash": "00AD4846E4EDC1BD6F1BB8D6A01B704FBB514DFDB7FBA1623B29ED48AEF1637E"
382
382
  }
@@ -8,8 +8,10 @@ export declare class ScbBadge extends LitElement {
8
8
  autoHide: boolean;
9
9
  sizing: 'fit-content' | 'fit-parent';
10
10
  position: 'absolute' | 'relative';
11
- positionTop: number;
12
- positionRight: number;
11
+ positionTop: string | number;
12
+ positionRight: string | undefined;
13
+ positionSide: 'left' | 'right';
14
+ positionLeft: string | undefined;
13
15
  value: string;
14
16
  label: string;
15
17
  hidden: boolean;
@@ -21,5 +23,6 @@ export declare class ScbBadge extends LitElement {
21
23
  connectedCallback(): void;
22
24
  disconnectedCallback(): void;
23
25
  private _onHideBadge;
26
+ private mapSpacingToken;
24
27
  render(): import('lit-html').TemplateResult<1>;
25
28
  }
@@ -1,17 +1,17 @@
1
- import { css as c, LitElement as p, html as b } from "lit";
2
- import { property as r, customElement as h } from "lit/decorators.js";
3
- var g = Object.defineProperty, u = Object.getOwnPropertyDescriptor, a = (t, e, o, s) => {
4
- for (var l = s > 1 ? void 0 : s ? u(e, o) : e, n = t.length - 1, d; n >= 0; n--)
5
- (d = t[n]) && (l = (s ? d(e, o, l) : d(l)) || l);
6
- return s && l && g(e, o, l), l;
1
+ import { css as p, LitElement as c, html as h } from "lit";
2
+ import { property as a, customElement as b } from "lit/decorators.js";
3
+ var g = Object.defineProperty, u = Object.getOwnPropertyDescriptor, s = (t, e, r, o) => {
4
+ for (var n = o > 1 ? void 0 : o ? u(e, r) : e, d = t.length - 1, l; d >= 0; d--)
5
+ (l = t[d]) && (n = (o ? l(e, r, n) : l(n)) || n);
6
+ return o && n && g(e, r, n), n;
7
7
  };
8
- let i = class extends p {
8
+ let i = class extends c {
9
9
  constructor() {
10
10
  super(...arguments), this._slotClickHandler = (t) => {
11
- var s;
12
- const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("slot"), o = t.target;
13
- o && o !== e && o.dispatchEvent(new CustomEvent("hide-badge", { bubbles: !0, composed: !0 }));
14
- }, this.autoHide = !1, this.sizing = "fit-content", this.position = "relative", this.positionTop = 0, this.positionRight = 12, this.value = "", this.label = "", this.hidden = !1, this.variant = "dot", this._badgeVisible = !0, this._onHideBadge = () => {
11
+ var o;
12
+ const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector("slot"), r = t.target;
13
+ r && r !== e && r.dispatchEvent(new CustomEvent("hide-badge", { bubbles: !0, composed: !0 }));
14
+ }, this.autoHide = !1, this.sizing = "fit-content", this.position = "relative", this.positionTop = 0, this.positionRight = void 0, this.positionSide = "right", this.positionLeft = void 0, this.value = "", this.label = "", this.hidden = !1, this.variant = "dot", this._badgeVisible = !0, this._onHideBadge = () => {
15
15
  this._badgeVisible = !1, this.requestUpdate();
16
16
  };
17
17
  }
@@ -31,24 +31,32 @@ let i = class extends p {
31
31
  disconnectedCallback() {
32
32
  this.removeEventListener("hide-badge", this._onHideBadge), super.disconnectedCallback();
33
33
  }
34
+ mapSpacingToken(t) {
35
+ if (t == null) return;
36
+ if (typeof t == "number" && !Number.isNaN(t)) return `${t}px`;
37
+ const e = String(t).trim();
38
+ if (e)
39
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
40
+ }
34
41
  render() {
35
- this.style.setProperty("--scb-badge-absolute-top", this.positionTop + "px"), this.style.setProperty("--scb-badge-absolute-right", this.positionRight + "px");
36
- let t = this.value;
37
- !isNaN(Number(this.value)) && this.value.length > 4 && (t = this.value.slice(0, 4) + "+");
38
- const e = this.variant === "value" && !this.value ? "badge-value-empty" : "", o = this._badgeVisible ? "" : "badge--hide", s = this.label || (this.variant === "dot" ? "Indikator" : `Märke: ${t}`);
39
- return b`
42
+ const t = this.mapSpacingToken(this.positionRight) ?? "var(--spacing-4)", e = this.mapSpacingToken(this.positionLeft) ?? "var(--spacing-4)", r = this.mapSpacingToken(this.positionTop) ?? "0px";
43
+ this.style.setProperty("--scb-badge-absolute-top", r), this.style.setProperty("--scb-badge-absolute-right", t), this.style.setProperty("--scb-badge-absolute-left", e);
44
+ let o = this.value;
45
+ !isNaN(Number(this.value)) && this.value.length > 4 && (o = this.value.slice(0, 4) + "+");
46
+ const n = this.variant === "value" && !this.value ? "badge-value-empty" : "", d = this._badgeVisible ? "" : "badge--hide", l = this.label || (this.variant === "dot" ? "Indikator" : `Märke: ${o}`);
47
+ return h`
40
48
  <div class="badge-content">
41
49
  <slot></slot>
42
50
  <div
43
- class="badge ${e} ${o}"
51
+ class="badge ${n} ${d}"
44
52
  role="status"
45
- aria-label="${this.variant === "dot", s}"
46
- aria-hidden="${this.variant === "dot" && !this.label ? "true" : "false"}">${this.variant === "dot" ? "" : t}</div>
53
+ aria-label="${this.variant === "dot", l}"
54
+ aria-hidden="${this.variant === "dot" && !this.label ? "true" : "false"}">${this.variant === "dot" ? "" : o}</div>
47
55
  </div>
48
56
  `;
49
57
  }
50
58
  };
51
- i.styles = c`
59
+ i.styles = p`
52
60
  :host {
53
61
  display: block;
54
62
  position: relative;
@@ -102,6 +110,10 @@ i.styles = c`
102
110
  left: calc(100% - var(--scb-badge-absolute-right));
103
111
  white-space: nowrap;
104
112
  }
113
+ :host([position-side="left"]) .badge {
114
+ left: var(--scb-badge-absolute-left);
115
+ }
116
+
105
117
  :host([position="relative"]) .badge {
106
118
  position: relative;
107
119
  top: unset;
@@ -114,35 +126,41 @@ i.styles = c`
114
126
  gap: var(--scb-badge-relative-gap);
115
127
  }
116
128
  `;
117
- a([
118
- r({ type: Boolean, reflect: !0, attribute: "auto-hide" })
129
+ s([
130
+ a({ type: Boolean, reflect: !0, attribute: "auto-hide" })
119
131
  ], i.prototype, "autoHide", 2);
120
- a([
121
- r({ type: String, reflect: !0 })
132
+ s([
133
+ a({ type: String, reflect: !0 })
122
134
  ], i.prototype, "sizing", 2);
123
- a([
124
- r({ type: String, reflect: !0 })
135
+ s([
136
+ a({ type: String, reflect: !0 })
125
137
  ], i.prototype, "position", 2);
126
- a([
127
- r({ type: Number, attribute: "position-top" })
138
+ s([
139
+ a({ type: String, attribute: "position-top" })
128
140
  ], i.prototype, "positionTop", 2);
129
- a([
130
- r({ type: Number, attribute: "position-right" })
141
+ s([
142
+ a({ type: String, attribute: "position-right" })
131
143
  ], i.prototype, "positionRight", 2);
132
- a([
133
- r({ type: String, reflect: !0 })
144
+ s([
145
+ a({ type: String, reflect: !0, attribute: "position-side" })
146
+ ], i.prototype, "positionSide", 2);
147
+ s([
148
+ a({ type: String, attribute: "position-left" })
149
+ ], i.prototype, "positionLeft", 2);
150
+ s([
151
+ a({ type: String, reflect: !0 })
134
152
  ], i.prototype, "value", 2);
135
- a([
136
- r({ type: String, reflect: !0 })
153
+ s([
154
+ a({ type: String, reflect: !0 })
137
155
  ], i.prototype, "label", 2);
138
- a([
139
- r({ type: Boolean, reflect: !0 })
156
+ s([
157
+ a({ type: Boolean, reflect: !0 })
140
158
  ], i.prototype, "hidden", 2);
141
- a([
142
- r({ type: String, reflect: !0 })
159
+ s([
160
+ a({ type: String, reflect: !0 })
143
161
  ], i.prototype, "variant", 2);
144
- i = a([
145
- h("scb-badge")
162
+ i = s([
163
+ b("scb-badge")
146
164
  ], i);
147
165
  export {
148
166
  i as ScbBadge
@@ -16,7 +16,7 @@ let t = class extends v {
16
16
  }, this._onKeyDown = (e) => {
17
17
  var s, o, r, c, h, p, b, g, f;
18
18
  const n = Array.from(
19
- ((s = this.parentElement) == null ? void 0 : s.querySelectorAll("scb-menu-item")) || []
19
+ ((s = this.closest("scb-sub-menu, scb-menu")) == null ? void 0 : s.querySelectorAll("scb-menu-item")) || []
20
20
  ), i = n.indexOf(this);
21
21
  switch (e.key) {
22
22
  case "ArrowDown": {
@@ -45,6 +45,7 @@ i.styles = g`
45
45
  align-items: center;
46
46
  gap: var(--spacing-3);
47
47
  width: fit-content;
48
+ font-family: var(--brand-font);
48
49
 
49
50
  margin-block-start: var(--scb-status-pill-spacing-block-start, 0);
50
51
  margin-block-end: var(--scb-status-pill-spacing-block-end, 0);