scb-wc-test 0.1.105 → 0.1.107

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.
Files changed (85) hide show
  1. package/mvc/components/scb-accordion/scb-accordion.js +8 -2
  2. package/mvc/components/scb-avatar/scb-avatar.js +19 -10
  3. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
  4. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
  5. package/mvc/components/scb-button/scb-button.js +34 -32
  6. package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
  7. package/mvc/components/scb-card/scb-card.js +44 -41
  8. package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
  9. package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
  10. package/mvc/components/scb-chip/scb-chip.js +27 -7
  11. package/mvc/components/scb-divider/scb-divider.js +41 -15
  12. package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
  13. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
  14. package/mvc/components/scb-icon-button/scb-icon-button.js +16 -10
  15. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
  16. package/mvc/components/scb-list/scb-list.js +3 -3
  17. package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
  18. package/mvc/components/scb-pagination/scb-pagination.js +165 -107
  19. package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
  20. package/mvc/components/scb-search/scb-search.js +84 -32
  21. package/mvc/components/scb-segmented-button/scb-segmented-button.js +15 -13
  22. package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
  23. package/mvc/components/scb-stepper/scb-stepper.js +32 -29
  24. package/mvc/components/scb-switch/scb-switch.js +11 -8
  25. package/mvc/components/scb-tabs/scb-tabs.js +22 -19
  26. package/mvc/components/scb-textfield/scb-textfield.js +14 -10
  27. package/mvc/components/scb-toc/scb-toc.js +6 -3
  28. package/mvc/components/scb-viz/scb-viz.js +188 -178
  29. package/package.json +2 -2
  30. package/scb-accordion/scb-accordion.d.ts +13 -0
  31. package/scb-accordion/scb-accordion.js +53 -21
  32. package/scb-avatar/scb-avatar.d.ts +6 -0
  33. package/scb-avatar/scb-avatar.js +96 -61
  34. package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
  35. package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
  36. package/scb-breadcrumb/scb-breadcrumb.js +61 -30
  37. package/scb-button/scb-button.d.ts +10 -0
  38. package/scb-button/scb-button.js +89 -65
  39. package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
  40. package/scb-calendar-card/scb-calendar-card.js +79 -55
  41. package/scb-card/scb-card.d.ts +5 -0
  42. package/scb-card/scb-card.js +165 -140
  43. package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
  44. package/scb-checkbox/scb-checkbox-group.js +59 -40
  45. package/scb-checkbox/scb-checkbox.d.ts +11 -0
  46. package/scb-checkbox/scb-checkbox.js +78 -56
  47. package/scb-chip/scb-chip.d.ts +24 -0
  48. package/scb-chip/scb-chip.js +137 -65
  49. package/scb-divider/scb-divider.d.ts +14 -0
  50. package/scb-divider/scb-divider.js +91 -43
  51. package/scb-fact-card/scb-fact-card.d.ts +10 -0
  52. package/scb-fact-card/scb-fact-card.js +135 -94
  53. package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
  54. package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
  55. package/scb-icon-button/scb-icon-button.d.ts +10 -1
  56. package/scb-icon-button/scb-icon-button.js +88 -59
  57. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
  58. package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
  59. package/scb-list/scb-list.d.ts +7 -1
  60. package/scb-list/scb-list.js +62 -40
  61. package/scb-notification-card/scb-notification-card.d.ts +5 -0
  62. package/scb-notification-card/scb-notification-card.js +56 -39
  63. package/scb-pagination/scb-pagination.d.ts +12 -1
  64. package/scb-pagination/scb-pagination.js +235 -147
  65. package/scb-radio-button/scb-radio-group.d.ts +14 -3
  66. package/scb-radio-button/scb-radio-group.js +120 -67
  67. package/scb-search/scb-search.d.ts +15 -2
  68. package/scb-search/scb-search.js +152 -69
  69. package/scb-segmented-button/scb-segmented-button.d.ts +45 -4
  70. package/scb-segmented-button/scb-segmented-button.js +163 -72
  71. package/scb-status-pill/scb-status-pill.d.ts +12 -1
  72. package/scb-status-pill/scb-status-pill.js +51 -27
  73. package/scb-stepper/scb-stepper.d.ts +11 -3
  74. package/scb-stepper/scb-stepper.js +134 -101
  75. package/scb-switch/scb-switch.d.ts +21 -2
  76. package/scb-switch/scb-switch.js +97 -45
  77. package/scb-tabs/scb-tabs.d.ts +8 -0
  78. package/scb-tabs/scb-tabs.js +74 -44
  79. package/scb-textfield/scb-textfield.d.ts +7 -0
  80. package/scb-textfield/scb-textfield.js +43 -16
  81. package/scb-toc/scb-toc.d.ts +10 -1
  82. package/scb-toc/scb-toc.js +49 -18
  83. package/scb-viz/scb-viz.d.ts +10 -3
  84. package/scb-viz/scb-viz.js +278 -236
  85. package/scb-wc-test.bundle.js +1184 -901
@@ -1,24 +1,32 @@
1
- import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-list/scb-list-item.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(s,n,i){try{customElements.get(s)||e(s,n,i)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var A=Object.defineProperty,I=Object.getOwnPropertyDescriptor,l=(t,e,s,n)=>{for(var i=n>1?void 0:n?I(e,s):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&A(e,s,i),i};let S=0,a=class extends x{constructor(){super(...arguments),this.supportingText="Hinted search text",this.value="",this.size="default",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++S}`,this._kbMode=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}}connectedCallback(){super.connectedCallback(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0}),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0)}disconnectedCallback(){const t=this._inputEl();t&&this._boundNativeKeydown&&t.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const t=this._inputEl();t&&(this._boundNativeKeydown=e=>this._handleKey(e),t.addEventListener("keydown",this._boundNativeKeydown,!0))}updated(){this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener()}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions;return u`
1
+ import{a as y,n as c,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-list/scb-list-item.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(s,n,i){try{customElements.get(s)||e(s,n,i)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var A=Object.defineProperty,I=Object.getOwnPropertyDescriptor,l=(t,e,s,n)=>{for(var i=n>1?void 0:n?I(e,s):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&A(e,s,i),i};let S=0,a=class extends x{constructor(){super(),this._internals=null,this.supportingText="Hinted search text",this.value="",this.name="",this.disabled=!1,this.size="default",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++S}`,this._kbMode=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._initialValue="",this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)},"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0}),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0),this._initialValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue;const t=this._inputEl();t&&(t.value=this._initialValue),this._syncFormValue(),this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y()},this._form.addEventListener("reset",this._formResetHandler,!0)),this._syncFormValue()}disconnectedCallback(){const t=this._inputEl();t&&this._boundNativeKeydown&&t.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const t=this._inputEl();t&&(this._boundNativeKeydown=e=>this._handleKey(e),t.addEventListener("keydown",this._boundNativeKeydown,!0),t.disabled=this.disabled)}updated(t){if(super.updated(t),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),(t.has("value")||t.has("disabled"))&&this._syncFormValue(),t.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const e=this._inputEl();e&&(e.disabled=this.disabled)}}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions;return u`
2
2
  <div class="ripple-wrapper">
3
3
  <md-icon class="leading">${t?"arrow_back":"search"}</md-icon>
4
4
 
5
5
  <input
6
6
  id="searchInput"
7
7
  type="search"
8
- name="textfield"
8
+ name=${this.name||"textfield"}
9
9
  class=${e?"with-list":""}
10
10
  .value=${this.value}
11
11
  placeholder=${this.supportingText}
12
12
  autocomplete="off"
13
+ ?disabled=${this.disabled}
13
14
  @input=${this._onInput}
14
15
  @focus=${this._onFocus}
15
16
  @blur=${this._onBlur}
16
17
  aria-label=${this.supportingText||"Sök"}
17
18
  />
18
19
 
19
- ${t?u`<button class="clear-btn" @click=${this._clearInput} tabindex="-1" aria-label="Rensa sökfält">
20
- <md-icon>close</md-icon>
21
- </button>`:this.trailingIcon?u`<span class="trailing"><md-icon>${this.trailingIcon}</md-icon></span>`:b}
20
+ ${t?u`<button
21
+ class="clear-btn"
22
+ type="button"
23
+ ?disabled=${this.disabled}
24
+ @click=${this._clearInput}
25
+ tabindex="-1"
26
+ aria-label="Rensa sökfält"
27
+ >
28
+ <md-icon>close</md-icon>
29
+ </button>`:this.trailingIcon?u`<span class="trailing"><md-icon>${this.trailingIcon}</md-icon></span>`:b}
22
30
 
23
31
  <md-ripple></md-ripple>
24
32
  <md-focus-ring class="input-ring"></md-focus-ring>
@@ -32,7 +40,7 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
32
40
  </scb-list>
33
41
  <md-focus-ring id="optionRing" class="option-ring"></md-focus-ring>
34
42
  `:b}
35
- `}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:e,bubbles:!0,composed:!0}))}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value)}_onInput(t){const e=t.target;this.value=e.value,this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y(),this.dispatchEvent(new CustomEvent("scb-search-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onFocus(){this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._updateComboboxA11y(),this.requestUpdate()}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this.requestUpdate()},100)}_updateInputRingVisibility(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))}_handleKey(t){if(!this._inputEl())return;const s=this._getVisibleItems(),n=(this.value??"").trim().length>0,i=this._inputFocused&&n&&s.length>0,r=t.key,o=t.keyCode,c=r==="ArrowDown"||r==="Down"||o===40,h=r==="ArrowUp"||r==="Up"||o===38,g=r==="Home"||o===36,v=r==="End"||o===35,_=r==="Enter"||o===13,f=r==="Escape"||r==="Esc"||o===27;if(c){if(!i)return;t.preventDefault(),this._kbMode=!0,this._moveActive(s,1);return}if(h){if(!i)return;t.preventDefault(),this._kbMode=!0,this._moveActive(s,-1);return}if(g){if(!i)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(v){if(!i)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?s.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(_){if(!i){this.submit();return}t.preventDefault();const p=this._getActiveItem();if(p){const m=p.getAttribute("label")||"";this.value=m,this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:{value:this.value,active:this._itemPayload(p)},bubbles:!0,composed:!0})),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(f){t.preventDefault(),this._clearInput();return}}_clearInput(){this.value="",this._activeIndex=-1,this._kbMode=!1;const t=this._inputEl();t?.focus(),t&&(t.value=""),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0}))}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let n=0;for(const i of s){const r=(i.getAttribute("label")||"").toLowerCase(),o=(i.getAttribute("supporting-text")||"").toLowerCase(),c=`${r} ${o}`.trim();e!==""&&c.includes(e)?(i.removeAttribute("hidden"),n++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=n,this._activeIndex>=n&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_getActiveItem(){const t=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=t.length?null:t[this._activeIndex]??null}_moveActive(t,e){if(!t.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let s=this._activeIndex+e;this._activeIndex===-1?s=e>0?0:t.length-1:(s<0&&(s=0),s>=t.length&&(s=t.length-1)),this._activeIndex=s,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const t=this._getActiveItem();t&&t.scrollIntoView({block:"nearest"})}_itemPayload(t){return{label:t.getAttribute("label")||"",supportingText:t.getAttribute("supporting-text")||"",href:t.getAttribute("href")||"",type:t.getAttribute("type")||"",id:t.id||""}}_ensureListboxA11y(){const t=this._listEl();t&&(t.id||(t.id=this._listboxId),t.setAttribute("role","listbox"),t.setAttribute("aria-label","Sökförslag")),Array.from(this.querySelectorAll("scb-list-item")).forEach(s=>this._ensureOptionA11y(s))}_ensureOptionA11y(t){t.id||(t.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),t.setAttribute("role","option"),t.setAttribute("tabindex","-1")}_updateComboboxA11y(){const t=this._inputEl();if(!t)return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,n=this._inputFocused&&s&&e.length>0;t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",this._listboxId),t.setAttribute("aria-expanded",String(n));const i=n?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&n?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const n=this.getBoundingClientRect(),i=t.getBoundingClientRect(),r=i.top-n.top,o=i.left-n.left,c=i.width,h=i.height;e.style.top=`${r}px`,e.style.left=`${o}px`,e.style.width=`${c}px`,e.style.height=`${h}px`,e.setAttribute("data-show","true")}_hideOptionRing(){const t=this._ringEl();t&&t.removeAttribute("data-show")}_onWindowResize(){const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}_attachListScrollListener(){const t=this._listEl();!t||this._listWithHandler===t||(this._detachListScrollListener(),t.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=t)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}};a.styles=y`
43
+ `}formDisabledCallback(t){this.disabled=t}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:e,bubbles:!0,composed:!0}))}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value)}_onInput(t){const e=t.target;this.value=e.value,this._syncFormValue(),this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y(),this.dispatchEvent(new CustomEvent("scb-search-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onFocus(){this.disabled||(this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this.requestUpdate()},100)}_updateInputRingVisibility(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))}_handleKey(t){if(this.disabled||!this._inputEl())return;const s=this._getVisibleItems(),n=(this.value??"").trim().length>0,i=this._inputFocused&&n&&s.length>0,r=t.key,o=t.keyCode,d=r==="ArrowDown"||r==="Down"||o===40,h=r==="ArrowUp"||r==="Up"||o===38,g=r==="Home"||o===36,v=r==="End"||o===35,_=r==="Enter"||o===13,f=r==="Escape"||r==="Esc"||o===27;if(d){if(!i)return;t.preventDefault(),this._kbMode=!0,this._moveActive(s,1);return}if(h){if(!i)return;t.preventDefault(),this._kbMode=!0,this._moveActive(s,-1);return}if(g){if(!i)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(v){if(!i)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?s.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(_){if(!i){this.submit();return}t.preventDefault();const p=this._getActiveItem();if(p){const m=p.getAttribute("label")||"";this.value=m,this._syncFormValue(),this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:{value:this.value,active:this._itemPayload(p)},bubbles:!0,composed:!0})),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(f){t.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value="",this._activeIndex=-1,this._kbMode=!1;const t=this._inputEl();t&&(t.value="",t.focus()),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0}))}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let n=0;for(const i of s){const r=(i.getAttribute("label")||"").toLowerCase(),o=(i.getAttribute("supporting-text")||"").toLowerCase(),d=`${r} ${o}`.trim();e!==""&&d.includes(e)?(i.removeAttribute("hidden"),n++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=n,this._activeIndex>=n&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_getActiveItem(){const t=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=t.length?null:t[this._activeIndex]??null}_moveActive(t,e){if(!t.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let s=this._activeIndex+e;this._activeIndex===-1?s=e>0?0:t.length-1:(s<0&&(s=0),s>=t.length&&(s=t.length-1)),this._activeIndex=s,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const t=this._getActiveItem();t&&t.scrollIntoView({block:"nearest"})}_itemPayload(t){return{label:t.getAttribute("label")||"",supportingText:t.getAttribute("supporting-text")||"",href:t.getAttribute("href")||"",type:t.getAttribute("type")||"",id:t.id||""}}_ensureListboxA11y(){const t=this._listEl();t&&(t.id||(t.id=this._listboxId),t.setAttribute("role","listbox"),t.setAttribute("aria-label","Sökförslag")),Array.from(this.querySelectorAll("scb-list-item")).forEach(s=>this._ensureOptionA11y(s))}_ensureOptionA11y(t){t.id||(t.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),t.setAttribute("role","option"),t.setAttribute("tabindex","-1")}_updateComboboxA11y(){const t=this._inputEl();if(!t)return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,n=this._inputFocused&&s&&e.length>0;t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",this._listboxId),t.setAttribute("aria-expanded",String(n));const i=n?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&n?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const n=this.getBoundingClientRect(),i=t.getBoundingClientRect(),r=i.top-n.top,o=i.left-n.left,d=i.width,h=i.height;e.style.top=`${r}px`,e.style.left=`${o}px`,e.style.width=`${d}px`,e.style.height=`${h}px`,e.setAttribute("data-show","true")}_hideOptionRing(){const t=this._ringEl();t&&t.removeAttribute("data-show")}_onWindowResize(){const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}_attachListScrollListener(){const t=this._listEl();!t||this._listWithHandler===t||(this._detachListScrollListener(),t.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=t)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}_syncFormValue(){if(!this._internals)return;const t=this.disabled?null:this.value;this._internals.setFormValue(t)}};a.formAssociated=!0;a.styles=y`
36
44
  :host {
37
45
  display: flex;
38
46
  flex-direction: column;
@@ -65,7 +73,7 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
65
73
  --scb-search-icon-size: var(--icon-size-small, 24px);
66
74
  }
67
75
 
68
- :host([size="compact"]) {
76
+ :host([size='compact']) {
69
77
  --scb-search-height: var(--scale-11, 40px);
70
78
  --scb-search-padding-x: var(--spacing-4, 12px);
71
79
  --scb-search-padding-y: var(--spacing-3, 8px);
@@ -74,6 +82,11 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
74
82
  --scb-search-line-height: var(--md-sys-typescale-body-medium-line-height, 20px);
75
83
  }
76
84
 
85
+ :host([disabled]) {
86
+ opacity: 0.38;
87
+ cursor: default;
88
+ }
89
+
77
90
  .ripple-wrapper {
78
91
  position: relative;
79
92
  display: flex;
@@ -89,7 +102,9 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
89
102
  border-radius: var(--scb-search-radius);
90
103
  z-index: 4;
91
104
  }
92
- .ripple-wrapper[data-kb-focus="true"] md-focus-ring.input-ring { display: block; }
105
+ .ripple-wrapper[data-kb-focus='true'] md-focus-ring.input-ring {
106
+ display: block;
107
+ }
93
108
  input.with-list ~ md-focus-ring.input-ring {
94
109
  border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
95
110
  }
@@ -104,7 +119,9 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
104
119
  z-index: 11;
105
120
  border-radius: var(--md-sys-shape-corner-small, 8px);
106
121
  }
107
- md-focus-ring.option-ring[data-show="true"] { display: block; }
122
+ md-focus-ring.option-ring[data-show='true'] {
123
+ display: block;
124
+ }
108
125
 
109
126
  .leading {
110
127
  position: absolute;
@@ -120,9 +137,13 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
120
137
  color: var(--md-sys-color-on-surface-variant);
121
138
  z-index: 2;
122
139
  }
123
- .leading md-icon { font-size: var(--scb-search-icon-size); line-height: 1; }
140
+ .leading md-icon {
141
+ font-size: var(--scb-search-icon-size);
142
+ line-height: 1;
143
+ }
124
144
 
125
- .trailing, .clear-btn {
145
+ .trailing,
146
+ .clear-btn {
126
147
  position: absolute;
127
148
  right: var(--scb-search-padding-x);
128
149
  top: 50%;
@@ -135,17 +156,27 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
135
156
  color: var(--md-sys-color-on-surface-variant);
136
157
  z-index: 3;
137
158
  }
138
- .trailing md-icon { pointer-events: none; font-size: var(--scb-search-icon-size); }
159
+ .trailing md-icon {
160
+ pointer-events: none;
161
+ font-size: var(--scb-search-icon-size);
162
+ }
139
163
 
140
- .clear-btn { background: none; border: 0; padding: 0; cursor: pointer; }
141
- .clear-btn[hidden] { display: none; }
164
+ .clear-btn {
165
+ background: none;
166
+ border: 0;
167
+ padding: 0;
168
+ cursor: pointer;
169
+ }
170
+ .clear-btn[hidden] {
171
+ display: none;
172
+ }
173
+ .clear-btn:disabled {
174
+ cursor: default;
175
+ }
142
176
 
143
- input[type="search"] {
144
- padding:
145
- var(--scb-search-padding-y)
146
- var(--scb-search-trailing-gap)
147
- var(--scb-search-padding-y)
148
- var(--scb-search-leading-gap);
177
+ input[type='search'] {
178
+ padding: var(--scb-search-padding-y) var(--scb-search-trailing-gap)
179
+ var(--scb-search-padding-y) var(--scb-search-leading-gap);
149
180
  min-height: var(--scb-search-height);
150
181
  width: 100%;
151
182
  box-sizing: border-box;
@@ -163,13 +194,17 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
163
194
  position: relative;
164
195
  z-index: 1;
165
196
  }
166
- input[type="search"]::placeholder {
197
+ input[type='search']::placeholder {
167
198
  color: var(--md-sys-color-on-surface-variant);
168
199
  font-size: var(--scb-search-font-size);
169
200
  line-height: var(--scb-search-line-height);
170
201
  }
171
- input[type="search"]:hover { outline: var(--md-sys-color-outline) auto var(--stroke-border, 1px); }
172
- input[type="search"]:focus { outline: none; }
202
+ input[type='search']:hover {
203
+ outline: var(--md-sys-color-outline) auto var(--stroke-border, 1px);
204
+ }
205
+ input[type='search']:focus {
206
+ outline: none;
207
+ }
173
208
 
174
209
  md-ripple {
175
210
  border-radius: var(--scb-search-radius);
@@ -181,10 +216,18 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
181
216
  --md-ripple-hover-opacity: 0;
182
217
  }
183
218
 
184
- input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
219
+ input[type='search']::-webkit-search-cancel-button {
220
+ -webkit-appearance: none;
221
+ appearance: none;
222
+ display: none;
223
+ }
185
224
 
186
- input.with-list { border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0; }
187
- input.with-list ~ md-ripple { border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0; }
225
+ input.with-list {
226
+ border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
227
+ }
228
+ input.with-list ~ md-ripple {
229
+ border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
230
+ }
188
231
 
189
232
  scb-list.suggestion-list {
190
233
  position: absolute;
@@ -201,11 +244,16 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
201
244
  max-height: var(--scb-search-suggestions-max-h, 60vh);
202
245
  }
203
246
 
204
- :host([full-screen]) input[type="search"],
247
+ :host([full-screen]) input[type='search'],
205
248
  :host([full-screen]) input.with-list,
206
- :host([full-screen]) input.with-list ~ md-ripple { border-radius: var(--radius-none, 0px) !important; }
249
+ :host([full-screen]) input.with-list ~ md-ripple {
250
+ border-radius: var(--radius-none, 0px) !important;
251
+ }
207
252
  :host([full-screen]) scb-list.suggestion-list {
208
- position: static; border: 0; border-radius: 0; background: transparent;
253
+ position: static;
254
+ border: 0;
255
+ border-radius: 0;
256
+ background: transparent;
209
257
  }
210
258
 
211
259
  .list-divider {
@@ -214,9 +262,13 @@ import{a as y,n as d,i as x,E as b,x as u,t as w}from"../../vendor/vendor.js";im
214
262
  background: var(--md-sys-color-outline);
215
263
  width: 100%;
216
264
  }
217
- :host([full-screen]) .list-divider[aria-hidden="false"] { display: block; }
265
+ :host([full-screen]) .list-divider[aria-hidden='false'] {
266
+ display: block;
267
+ }
218
268
 
219
269
  @media (prefers-color-scheme: dark) {
220
- :host { color: var(--md-sys-color-on-surface); }
270
+ :host {
271
+ color: var(--md-sys-color-on-surface);
272
+ }
221
273
  }
222
- `;l([d({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",2);l([d({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);l([d({type:String})],a.prototype,"value",2);l([d({type:String,reflect:!0})],a.prototype,"size",2);l([d({type:Boolean,attribute:"full-screen",reflect:!0})],a.prototype,"fullScreen",2);a=l([w("scb-search")],a);
274
+ `;l([c({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",2);l([c({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);l([c({type:String})],a.prototype,"value",2);l([c({type:String,reflect:!0})],a.prototype,"name",2);l([c({type:Boolean,reflect:!0})],a.prototype,"disabled",2);l([c({type:String,reflect:!0})],a.prototype,"size",2);l([c({type:Boolean,attribute:"full-screen",reflect:!0})],a.prototype,"fullScreen",2);a=l([w("scb-search")],a);
@@ -1,28 +1,30 @@
1
- import{a as u,n as a,i as c,x as h,t as m}from"../../vendor/vendor.js";import"./scb-segmented-item.js";import"../../vendor/vendor-material.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(e,t,r){try{customElements.get(e)||s(e,t,r)}catch(l){var o=String(l||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,n=(i,s,e,t)=>{for(var r=t>1?void 0:t?f(s,e):s,o=i.length-1,l;o>=0;o--)(l=i[o])&&(r=(t?l(s,e,r):l(r))||r);return t&&r&&b(s,e,r),r};let d=class extends c{constructor(){super(...arguments),this.variant="single-select",this.value="",this.values=[],this.disabled=!1}onSlotClick(i){let s=i.target;if(!s||!s.closest)return;const e=s.closest("scb-segmented-item");if(!e||this.disabled||e.hasAttribute("disabled"))return;const t=e.getAttribute("value")||"";t&&(this.variant==="multi-select"?(this.values.indexOf(t)===-1?this.values=[...this.values,t]:this.values=this.values.filter(o=>o!==t),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0})),this.updateSegments()):t!==this.value&&(this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t},bubbles:!0,composed:!0})),this.updateSegments()))}updateSegments(){const i=this.shadowRoot?.querySelector("slot");if(!i)return;i.assignedElements().forEach(e=>{if(e.tagName==="SCB-SEGMENTED-ITEM"){const t=e.getAttribute("value")||"";if(t){let r=!1;this.variant==="multi-select"?r=!!this.values&&this.values.includes(t):r=t===this.value,e.setAttribute("aria-pressed",r?"true":"false"),r?e.setAttribute("selected","true"):e.removeAttribute("selected")}this.disabled&&e.setAttribute("disabled","true")}})}firstUpdated(){this.updateSegments();const i=this.shadowRoot?.querySelector("slot");i&&(i.addEventListener("click",s=>this.onSlotClick(s)),i.addEventListener("focus",()=>{this.dispatchEvent(new CustomEvent("focus",{detail:{},bubbles:!0,composed:!0}))},!0),i.addEventListener("blur",()=>{this.dispatchEvent(new CustomEvent("blur",{detail:{},bubbles:!0,composed:!0}))},!0),i.addEventListener("keydown",s=>{if(s.code==="Space"||s.code==="Enter"||s.code==="NumpadEnter"){const e=s.target;if(e&&e.closest){const t=e.closest("scb-segmented-item");t&&!t.hasAttribute("disabled")&&!this.disabled&&(this.onSlotClick(s),s.preventDefault())}}}))}updated(){this.updateSegments()}render(){return h`<slot></slot>`}};d.styles=u`
1
+ import{a as p,n as l,i as f,x as b,t as v}from"../../vendor/vendor.js";import"./scb-segmented-item.js";import"../../vendor/vendor-material.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(s,i,r){try{customElements.get(s)||e(s,i,r)}catch(u){var o=String(u||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var g=Object.defineProperty,_=Object.getOwnPropertyDescriptor,m=t=>{throw TypeError(t)},n=(t,e,s,i)=>{for(var r=i>1?void 0:i?_(e,s):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(r=(i?u(e,s,r):u(r))||r);return i&&r&&g(e,s,r),r},y=(t,e,s)=>e.has(t)||m("Cannot "+s),S=(t,e,s)=>e.has(t)?m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),h=(t,e,s)=>(y(t,e,"access private method"),s),d,c;let a=class extends f{constructor(){super(),S(this,d),this._internals=null,this.variant="single-select",this.value="",this.values=[],this.disabled=!1,this.name="",this.spacing="",this.spacingTop="",this.spacingBottom="",this._form=null,this._formResetHandler=null,this._initialValue="",this._initialValues=[],"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.values=Array.isArray(this._initialValues)?[...this._initialValues]:[],this.updateSegments(),this._syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0))}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){this._initialValue=this.value,this._initialValues=Array.isArray(this.values)?[...this.values]:[],this.updateSegments();const t=this.shadowRoot?.querySelector("slot");t&&(t.addEventListener("click",e=>this.onSlotClick(e)),t.addEventListener("focus",()=>{this.dispatchEvent(new CustomEvent("focus",{detail:{},bubbles:!0,composed:!0}))},!0),t.addEventListener("blur",()=>{this.dispatchEvent(new CustomEvent("blur",{detail:{},bubbles:!0,composed:!0}))},!0),t.addEventListener("keydown",e=>{if(e.code==="Space"||e.code==="Enter"||e.code==="NumpadEnter"){const s=e.target;if(s&&s.closest){const i=s.closest("scb-segmented-item");i&&!i.hasAttribute("disabled")&&!this.disabled&&(this.onSlotClick(e),e.preventDefault())}}})),this._syncFormValue(),h(this,d,c).call(this)}updated(t){super.updated(t),this.updateSegments(),(t.has("value")||t.has("values")||t.has("disabled")||t.has("variant")||t.has("name"))&&this._syncFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&h(this,d,c).call(this)}onSlotClick(t){let e=t.target;if(!e||!e.closest)return;const s=e.closest("scb-segmented-item");if(!s||this.disabled||s.hasAttribute("disabled"))return;const i=s.getAttribute("value")||"";i&&(this.variant==="multi-select"?(this.values.indexOf(i)===-1?this.values=[...this.values,i]:this.values=this.values.filter(o=>o!==i),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0})),this.updateSegments()):i!==this.value&&(this.value=i,this.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0,composed:!0})),this.updateSegments()))}updateSegments(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;t.assignedElements().forEach(s=>{if(s.tagName==="SCB-SEGMENTED-ITEM"){const i=s.getAttribute("value")||"";if(i){let r=!1;this.variant==="multi-select"?r=!!this.values&&this.values.includes(i):r=i===this.value,s.setAttribute("aria-pressed",r?"true":"false"),r?s.setAttribute("selected","true"):s.removeAttribute("selected")}this.disabled&&s.setAttribute("disabled","true")}})}formDisabledCallback(t){this.disabled=t}_syncFormValue(){if(this._internals){if(this.disabled||!this.name){this._internals.setFormValue(null);return}if(this.variant==="multi-select"){if(!this.values||this.values.length===0){this._internals.setFormValue(null);return}const t=new FormData;for(const e of this.values)t.append(this.name,e);this._internals.setFormValue(t)}else{if(!this.value){this._internals.setFormValue(null);return}this._internals.setFormValue(this.value)}}}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}render(){return b`<slot></slot>`}};d=new WeakSet;c=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t;e?this.style.setProperty("--scb-segmented-button-spacing-block-start",e):this.style.removeProperty("--scb-segmented-button-spacing-block-start"),s?this.style.setProperty("--scb-segmented-button-spacing-block-end",s):this.style.removeProperty("--scb-segmented-button-spacing-block-end")};a.formAssociated=!0;a.styles=p`
2
2
  :host {
3
- --scb-segmented-button-width: 100%;
4
- --scb-segmented-button-height: 48px;
5
- max-width: var(--scb-segmented-button-width);
6
- height: var(--scb-segmented-button-height);
7
- display: grid;
8
- grid-auto-flow: column;
9
- grid-auto-columns: 1fr;
10
- font-family: var(--brand, Inter);
3
+ --scb-segmented-button-width: 100%;
4
+ --scb-segmented-button-height: 48px;
5
+ max-width: var(--scb-segmented-button-width);
6
+ height: var(--scb-segmented-button-height);
7
+ display: grid;
8
+ grid-auto-flow: column;
9
+ grid-auto-columns: 1fr;
10
+ font-family: var(--brand, Inter);
11
+ margin-block-start: var(--scb-segmented-button-spacing-block-start, 0);
12
+ margin-block-end: var(--scb-segmented-button-spacing-block-end, 0);
11
13
  }
12
14
  /* Border radius only on first and last button */
13
15
  ::slotted(scb-segmented-item:first-child .segmented-item),
14
- ::slotted([role="button"]:first-child .segmented-item) {
16
+ ::slotted([role='button']:first-child .segmented-item) {
15
17
  border-top-left-radius: var(--md-sys-shape-corner-full);
16
18
  border-bottom-left-radius: var(--md-sys-shape-corner-full);
17
19
  }
18
20
  ::slotted(scb-segmented-item:last-child .segmented-item),
19
- ::slotted([role="button"]:last-child .segmented-item) {
21
+ ::slotted([role='button']:last-child .segmented-item) {
20
22
  border-top-right-radius: var(--md-sys-shape-corner-full);
21
23
  border-bottom-right-radius: var(--md-sys-shape-corner-full);
22
24
  }
23
25
  /* First button gets left border */
24
26
  ::slotted(scb-segmented-item:first-child .segmented-item),
25
- ::slotted([role="button"]:first-child .segmented-item) {
27
+ ::slotted([role='button']:first-child .segmented-item) {
26
28
  border-left: 1px solid var(--md-sys-color-outline);
27
29
  }
28
- `;n([a({type:String,reflect:!0})],d.prototype,"variant",2);n([a({type:String,reflect:!0})],d.prototype,"value",2);n([a({type:Array})],d.prototype,"values",2);n([a({type:Boolean,reflect:!0})],d.prototype,"disabled",2);d=n([m("scb-segmented-button")],d);
30
+ `;n([l({type:String,reflect:!0})],a.prototype,"variant",2);n([l({type:String,reflect:!0})],a.prototype,"value",2);n([l({type:Array})],a.prototype,"values",2);n([l({type:Boolean,reflect:!0})],a.prototype,"disabled",2);n([l({type:String,reflect:!0})],a.prototype,"name",2);n([l({type:String,reflect:!0})],a.prototype,"spacing",2);n([l({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);n([l({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);a=n([v("scb-segmented-button")],a);
@@ -1,7 +1,7 @@
1
- import{a as u,n as d,i as m,x as c,t as p}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,r,s){try{customElements.get(e)||t(e,r,s)}catch(n){var o=String(n||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var h=Object.defineProperty,b=Object.getOwnPropertyDescriptor,l=(i,t,e,r)=>{for(var s=r>1?void 0:r?b(t,e):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(r?n(t,e,s):n(s))||s);return r&&s&&h(t,e,s),s};let a=class extends m{constructor(){super(...arguments),this.status="",this.label="",this.showIcon=!1}render(){return c`
2
- ${this.showIcon?this.status==="success"?c`<md-icon>check_circle</md-icon>`:this.status==="warning"?c`<md-icon>warning</md-icon>`:this.status==="error"?c`<md-icon>error</md-icon>`:"":""}
3
- <span class="label">${this.label}</span>
4
- `}};a.styles=u`
1
+ import{a as g,n as l,i as u,x as p,t as d}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(o,n,e){try{customElements.get(o)||s(o,n,e)}catch(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,i=(t,s,o,n)=>{for(var e=n>1?void 0:n?h(s,o):s,a=t.length-1,c;a>=0;a--)(c=t[a])&&(e=(n?c(s,o,e):c(e))||e);return n&&e&&m(s,o,e),e};let r=class extends u{constructor(){super(...arguments),this.status="",this.label="",this.showIcon=!1,this.spacing="",this.spacingTop="",this.spacingBottom=""}__resolveSpacingToken(t){const s=(t??"").trim();return s?/^(?:[0-9]|1[0-4])$/.test(s)?`var(--spacing-${s})`:s:""}__applySpacing(){const t=this.__resolveSpacingToken(this.spacingTop||this.spacing),s=this.__resolveSpacingToken(this.spacingBottom||this.spacing);t?this.style.marginBlockStart=t:this.style.removeProperty("margin-block-start"),s?this.style.marginBlockEnd=s:this.style.removeProperty("margin-block-end")}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&this.__applySpacing()}render(){return p`
2
+ ${this.showIcon?this.status==="success"?p`<md-icon>check_circle</md-icon>`:this.status==="warning"?p`<md-icon>warning</md-icon>`:this.status==="error"?p`<md-icon>error</md-icon>`:"":""}
3
+ <span class="label">${this.label}</span>
4
+ `}};r.styles=g`
5
5
  :host {
6
6
  display: inline-block;
7
7
  border-radius: var(--md-sys-shape-corner-full);
@@ -14,22 +14,26 @@ import{a as u,n as d,i as m,x as c,t as p}from"../../vendor/vendor.js";import"..
14
14
  gap: var(--spacing-3);
15
15
  width: fit-content;
16
16
  }
17
- .label{
17
+
18
+ .label {
18
19
  font-size: var(--md-sys-typescale-label-medium-size);
19
20
  line-height: var(--md-sys-typescale-label-medium-line-height);
20
21
  font-weight: var(--md-sys-typescale-label-medium-weight);
21
22
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
22
23
  }
23
- :host([status="success"]) {
24
- background: var(--md-sys-color-success-container);
25
- color: var(--md-sys-color-on-success-container);
24
+
25
+ :host([status='success']) {
26
+ background: var(--md-sys-color-success-container);
27
+ color: var(--md-sys-color-on-success-container);
26
28
  }
27
- :host([status="warning"]) {
29
+
30
+ :host([status='warning']) {
28
31
  background: var(--md-sys-color-warning-container);
29
32
  color: var(--md-sys-color-on-warning-container);
30
33
  }
31
- :host([status="error"]) {
32
- background: var(--md-sys-color-error-container);
33
- color: var(--md-sys-color-on-error-container);
34
+
35
+ :host([status='error']) {
36
+ background: var(--md-sys-color-error-container);
37
+ color: var(--md-sys-color-on-error-container);
34
38
  }
35
- `;l([d({type:String})],a.prototype,"status",2);l([d({type:String})],a.prototype,"label",2);l([d({type:Boolean,attribute:"show-icon"})],a.prototype,"showIcon",2);a=l([p("scb-status-pill")],a);
39
+ `;i([l({type:String})],r.prototype,"status",2);i([l({type:String})],r.prototype,"label",2);i([l({type:Boolean,attribute:"show-icon"})],r.prototype,"showIcon",2);i([l({type:String})],r.prototype,"spacing",2);i([l({type:String,attribute:"spacing-top"})],r.prototype,"spacingTop",2);i([l({type:String,attribute:"spacing-bottom"})],r.prototype,"spacingBottom",2);r=i([d("scb-status-pill")],r);
@@ -1,4 +1,4 @@
1
- import{a as l,n as p,r as h,i as d,x as f,t as v}from"../../vendor/vendor.js";import"./scb-step.js";import"../../vendor/vendor-material.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(s,i,n){try{customElements.get(s)||e(s,i,n)}catch(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var u=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(t,e,s,i)=>{for(var n=i>1?void 0:i?b(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(n=(i?c(e,s,n):c(n))||n);return i&&n&&u(e,s,n),n};let o=class extends d{constructor(){super(...arguments),this.type="",this.label="",this.changeOnCompleted=!1,this.variant="horizontal",this.symbolVariant="number",this.activeIndex=0,this._onKeyNav=t=>{const e=this._getSteps(),s=this.activeIndex;let i=s;t.detail.key==="ArrowRight"?s<e.length-1?i=s+1:i=0:t.detail.key==="ArrowLeft"&&(s>0?i=s-1:i=e.length-1),i!==s&&(this._onStepClick(i),setTimeout(()=>{const n=e[i].shadowRoot?.querySelector(".scb-step-content");n&&"focus"in n&&typeof n.focus=="function"&&n.focus()},0))},this._onStepContainerClick=t=>{const e=this._getSteps(),s=t.composedPath(),i=e.findIndex(n=>s.includes(n));i!==-1&&this._onStepClick(i)}}_onStepClick(t){const e=this.activeIndex;this.activeIndex=t,this._updateSteps(),this.dispatchEvent(new CustomEvent("scb-step-change",{detail:{index:this.activeIndex,step:this._getSteps()[this.activeIndex]},bubbles:!0,composed:!0})),t>e?this.dispatchEvent(new CustomEvent("scb-step-next",{detail:{from:e,to:t,step:this._getSteps()[t]},bubbles:!0,composed:!0})):t<e&&this.dispatchEvent(new CustomEvent("scb-step-prev",{detail:{from:e,to:t,step:this._getSteps()[t]},bubbles:!0,composed:!0}))}nextStep(){const t=this._getSteps();this.activeIndex<t.length-1&&this._onStepClick(this.activeIndex+1)}prevStep(){this.activeIndex>0&&this._onStepClick(this.activeIndex-1)}getActiveIndex(){return this.activeIndex}_updateSteps(){const t=this._getSteps();t.forEach((e,s)=>{e.active=s===this.activeIndex,e.completed=s<this.activeIndex,e.islast=!1,e.changeOnCompleted=this.changeOnCompleted,e.number=s+1,e.variant=this.variant,e.symbolVariant=this.symbolVariant}),t.length>0&&(t[t.length-1].islast=!0)}_getSteps(){return Array.from(this.querySelectorAll("scb-step"))}firstUpdated(){this._updateSteps()}updated(){this._updateSteps()}render(){return f`
1
+ import{a as b,n as o,r as g,i as u,x as m,t as y}from"../../vendor/vendor.js";import"./scb-step.js";import"../../vendor/vendor-material.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(s,i,n){try{customElements.get(s)||e(s,i,n)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var _=Object.defineProperty,S=Object.getOwnPropertyDescriptor,v=t=>{throw TypeError(t)},a=(t,e,s,i)=>{for(var n=i>1?void 0:i?S(e,s):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(n=(i?l(e,s,n):l(n))||n);return i&&n&&_(e,s,n),n},x=(t,e,s)=>e.has(t)||v("Cannot "+s),k=(t,e,s)=>e.has(t)?v("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),h=(t,e,s)=>(x(t,e,"access private method"),s),p,f,d;let r=class extends u{constructor(){super(...arguments),k(this,p),this.type="",this.label="",this.changeOnCompleted=!1,this.variant="horizontal",this.symbolVariant="number",this.spacing="",this.spacingTop="",this.spacingBottom="",this.activeIndex=0,this._onKeyNav=t=>{const e=this._getSteps(),s=this.activeIndex;let i=s;t.detail.key==="ArrowRight"?s<e.length-1?i=s+1:i=0:t.detail.key==="ArrowLeft"&&(s>0?i=s-1:i=e.length-1),i!==s&&(this._onStepClick(i),setTimeout(()=>{const n=e[i].shadowRoot?.querySelector(".scb-step-content");n&&"focus"in n&&typeof n.focus=="function"&&n.focus()},0))},this._onStepContainerClick=t=>{const e=this._getSteps(),s=t.composedPath(),i=e.findIndex(n=>s.includes(n));i!==-1&&this._onStepClick(i)}}_onStepClick(t){const e=this.activeIndex;this.activeIndex=t,this._updateSteps(),this.dispatchEvent(new CustomEvent("scb-step-change",{detail:{index:this.activeIndex,step:this._getSteps()[this.activeIndex]},bubbles:!0,composed:!0})),t>e?this.dispatchEvent(new CustomEvent("scb-step-next",{detail:{from:e,to:t,step:this._getSteps()[t]},bubbles:!0,composed:!0})):t<e&&this.dispatchEvent(new CustomEvent("scb-step-prev",{detail:{from:e,to:t,step:this._getSteps()[t]},bubbles:!0,composed:!0}))}nextStep(){const t=this._getSteps();this.activeIndex<t.length-1&&this._onStepClick(this.activeIndex+1)}prevStep(){this.activeIndex>0&&this._onStepClick(this.activeIndex-1)}getActiveIndex(){return this.activeIndex}_updateSteps(){const t=this._getSteps();t.forEach((e,s)=>{e.active=s===this.activeIndex,e.completed=s<this.activeIndex,e.islast=!1,e.changeOnCompleted=this.changeOnCompleted,e.number=s+1,e.variant=this.variant,e.symbolVariant=this.symbolVariant}),t.length>0&&(t[t.length-1].islast=!0)}_getSteps(){return Array.from(this.querySelectorAll("scb-step"))}firstUpdated(t){this._updateSteps(),h(this,p,f).call(this)}updated(t){this._updateSteps(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&h(this,p,f).call(this)}render(){return m`
2
2
  <div
3
3
  class="steps"
4
4
  role="list"
@@ -8,10 +8,10 @@ import{a as l,n as p,r as h,i as d,x as f,t as v}from"../../vendor/vendor.js";im
8
8
  >
9
9
  <slot></slot>
10
10
  </div>
11
- `}};o.styles=l`
11
+ `}};p=new WeakSet;f=function(){const t=h(this,p,d).call(this,this.spacing),e=h(this,p,d).call(this,this.spacingTop)??t,s=h(this,p,d).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-stepper-spacing-block-start",e):this.style.removeProperty("--scb-stepper-spacing-block-start"),s?this.style.setProperty("--scb-stepper-spacing-block-end",s):this.style.removeProperty("--scb-stepper-spacing-block-end")};d=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};r.styles=b`
12
12
  :host {
13
- --scb-stepper-width: 100%;
14
- --scb-stepper-height: 100%;
13
+ --scb-stepper-width: 100%;
14
+ --scb-stepper-height: 100%;
15
15
  display: block;
16
16
  padding: var(--spacing-5) 0;
17
17
  width: 100%;
@@ -19,6 +19,9 @@ import{a as l,n as p,r as h,i as d,x as f,t as v}from"../../vendor/vendor.js";im
19
19
  font-family: var(--brand-font);
20
20
  max-width: var(--scb-stepper-width);
21
21
  height: var(--scb-stepper-height);
22
+
23
+ margin-block-start: var(--scb-stepper-spacing-block-start, 0);
24
+ margin-block-end: var(--scb-stepper-spacing-block-end, 0);
22
25
  }
23
26
  .steps {
24
27
  display: flex;
@@ -52,32 +55,32 @@ import{a as l,n as p,r as h,i as d,x as f,t as v}from"../../vendor/vendor.js";im
52
55
  z-index: 0;
53
56
  }
54
57
  /* Vertikal connector */
55
- ::slotted(scb-step[variant="vertical"]:not(:first-child))::before {
56
- display: none;
58
+ ::slotted(scb-step[variant='vertical']:not(:first-child))::before {
59
+ display: none;
57
60
  }
58
- ::slotted(scb-step[variant="vertical"]:not(:last-child))::after {
59
- content: '';
60
- position: absolute;
61
- left: 28px;
62
- top: 52px;
63
- width: 1px;
64
- height: calc(100% - 16px);
65
- background: var(--n-70);
66
- z-index: 0;
67
- transform: translateX(-50%);
61
+ ::slotted(scb-step[variant='vertical']:not(:last-child))::after {
62
+ content: '';
63
+ position: absolute;
64
+ left: 28px;
65
+ top: 52px;
66
+ width: 1px;
67
+ height: calc(100% - 16px);
68
+ background: var(--n-70);
69
+ z-index: 0;
70
+ transform: translateX(-50%);
68
71
  }
69
- ::slotted(scb-step[variant="vertical"][symbol-variant="marker"]:not(:last-child))::after {
70
- content: "";
71
- position: absolute;
72
- left: 20px;
73
- top: 38px;
74
- width: 1px;
75
- height: calc(100% - 2px);
76
- background: var(--n-70);
77
- z-index: 0;
78
- transform: translateX(-50%);
72
+ ::slotted(scb-step[variant='vertical'][symbol-variant='marker']:not(:last-child))::after {
73
+ content: '';
74
+ position: absolute;
75
+ left: 20px;
76
+ top: 38px;
77
+ width: 1px;
78
+ height: calc(100% - 2px);
79
+ background: var(--n-70);
80
+ z-index: 0;
81
+ transform: translateX(-50%);
79
82
  }
80
- ::slotted(scb-step[symbol-variant="marker"]:not(:first-child))::before {
81
- top: 20px;
83
+ ::slotted(scb-step[symbol-variant='marker']:not(:first-child))::before {
84
+ top: 20px;
82
85
  }
83
- `;r([p({type:String,reflect:!0})],o.prototype,"type",2);r([p({type:String,reflect:!0})],o.prototype,"label",2);r([p({type:Boolean,reflect:!0,attribute:"change-on-completed"})],o.prototype,"changeOnCompleted",2);r([p({type:String})],o.prototype,"variant",2);r([p({type:String,reflect:!0,attribute:"symbol-variant"})],o.prototype,"symbolVariant",2);r([h()],o.prototype,"activeIndex",2);o=r([v("scb-stepper")],o);
86
+ `;a([o({type:String,reflect:!0})],r.prototype,"type",2);a([o({type:String,reflect:!0})],r.prototype,"label",2);a([o({type:Boolean,reflect:!0,attribute:"change-on-completed"})],r.prototype,"changeOnCompleted",2);a([o({type:String})],r.prototype,"variant",2);a([o({type:String,reflect:!0,attribute:"symbol-variant"})],r.prototype,"symbolVariant",2);a([o({type:String,reflect:!0})],r.prototype,"spacing",2);a([o({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);a([o({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);a([g()],r.prototype,"activeIndex",2);r=a([y("scb-stepper")],r);
@@ -1,18 +1,21 @@
1
- import{a as p,n as o,i as f,E as d,x as h,t as b}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,r,i){try{customElements.get(t)||e(t,r,i)}catch(c){var n=String(c||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,l=(s,e,t,r)=>{for(var i=r>1?void 0:r?y(e,t):e,n=s.length-1,c;n>=0;n--)(c=s[n])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&u(e,t,i),i};let a=class extends f{constructor(){super(...arguments),this.label="",this.ariaLabel="",this.icons=!1,this.selected=!1,this.disabled=!1,this.fullWidth=!1}updated(){this.toggleAttribute("aria-disabled",this.disabled)}firstUpdated(){this.shadowRoot?.querySelector("md-switch")?.addEventListener("change",e=>{this.selected=e.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))})}render(){const s=this.label.trim().length>0,e=s?d:this.ariaLabel||d,t=h`
1
+ import{a as y,n as r,i as _,E as u,x as b,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.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(s,c,l){try{customElements.get(s)||e(s,c,l)}catch(h){var o=String(h||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,m=t=>{throw TypeError(t)},a=(t,e,s,c)=>{for(var l=c>1?void 0:c?w(e,s):e,o=t.length-1,h;o>=0;o--)(h=t[o])&&(l=(c?h(e,s,l):h(l))||l);return c&&l&&v(e,s,l),l},S=(t,e,s)=>e.has(t)||m("Cannot "+s),k=(t,e,s)=>e.has(t)?m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),p=(t,e,s)=>(S(t,e,"access private method"),s),n,f,d;let i=class extends _{constructor(){super(),k(this,n),this._internals=null,this.label="",this.ariaLabel="",this.icons=!1,this.selected=!1,this.disabled=!1,this.fullWidth=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.name="",this.value="on",this._form=null,this._formResetHandler=null,this._initialSelected=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._initialSelected=this.selected,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.selected=this._initialSelected,this.__syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue()}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){this.shadowRoot?.querySelector("md-switch")?.addEventListener("change",e=>{this.selected=e.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}),p(this,n,f).call(this)}updated(t){super.updated(t),t.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(t.has("selected")||t.has("disabled")||t.has("value"))&&this.__syncFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&p(this,n,f).call(this)}formDisabledCallback(t){this.disabled=t}__syncFormValue(){if(!this._internals)return;const t=this.disabled||!this.selected?null:this.value;this._internals.setFormValue(t)}render(){const t=this.label.trim().length>0,e=t?u:this.ariaLabel||u,s=b`
2
2
  <md-switch
3
3
  ?icons=${this.icons}
4
4
  ?selected=${this.selected}
5
5
  ?disabled=${this.disabled}
6
6
  aria-label=${e}
7
7
  ></md-switch>
8
- `;return s?h`
9
- <label class="switch-container" ?disabled=${this.disabled}>
10
- <span class="switch-label">${this.label}</span>
11
- ${t}
12
- </label>
13
- `:t}};a.styles=p`
8
+ `;return t?b`
9
+ <label class="switch-container" ?disabled=${this.disabled}>
10
+ <span class="switch-label">${this.label}</span>
11
+ ${s}
12
+ </label>
13
+ `:s}};n=new WeakSet;f=function(){const t=p(this,n,d).call(this,this.spacing),e=p(this,n,d).call(this,this.spacingTop)??t,s=p(this,n,d).call(this,this.spacingBottom)??t;e?this.style.setProperty("--scb-switch-spacing-block-start",e):this.style.removeProperty("--scb-switch-spacing-block-start"),s?this.style.setProperty("--scb-switch-spacing-block-end",s):this.style.removeProperty("--scb-switch-spacing-block-end")};d=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};i.formAssociated=!0;i.styles=y`
14
14
  :host {
15
15
  display: block;
16
+ /* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
17
+ margin-block-start: var(--scb-switch-spacing-block-start, 0);
18
+ margin-block-end: var(--scb-switch-spacing-block-end, 0);
16
19
  }
17
20
 
18
21
  .switch-container {
@@ -50,4 +53,4 @@ import{a as p,n as o,i as f,E as d,x as h,t as b}from"../../vendor/vendor.js";im
50
53
  /* Ärver färg från container */
51
54
  color: var(--scb-switch-label-color, inherit);
52
55
  }
53
- `;l([o({type:String})],a.prototype,"label",2);l([o({type:String,reflect:!0,attribute:"aria-label"})],a.prototype,"ariaLabel",2);l([o({type:Boolean,reflect:!0})],a.prototype,"icons",2);l([o({type:Boolean,reflect:!0})],a.prototype,"selected",2);l([o({type:Boolean,reflect:!0})],a.prototype,"disabled",2);l([o({type:Boolean,reflect:!0,attribute:"full-width"})],a.prototype,"fullWidth",2);a=l([b("scb-switch")],a);export{a as ScbSwitch};
56
+ `;a([r({type:String})],i.prototype,"label",2);a([r({type:String,reflect:!0,attribute:"aria-label"})],i.prototype,"ariaLabel",2);a([r({type:Boolean,reflect:!0})],i.prototype,"icons",2);a([r({type:Boolean,reflect:!0})],i.prototype,"selected",2);a([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2);a([r({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",2);a([r({type:String,reflect:!0})],i.prototype,"spacing",2);a([r({type:String,attribute:"spacing-top",reflect:!0})],i.prototype,"spacingTop",2);a([r({type:String,attribute:"spacing-bottom",reflect:!0})],i.prototype,"spacingBottom",2);a([r({type:String})],i.prototype,"name",2);a([r({type:String})],i.prototype,"value",2);i=a([g("scb-switch")],i);export{i as ScbSwitch};
@@ -1,23 +1,26 @@
1
- import{b as n}from"../../vendor/vendor-material.js";import{a as d,n as m,t as b}from"../../vendor/vendor.js";import"./scb-primary-tab.js";import"./scb-secondary-tab.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(a,o,t){try{customElements.get(a)||e(a,o,t)}catch(i){var s=String(i||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l=(r,e,a,o)=>{for(var t=o>1?void 0:o?u(e,a):e,s=r.length-1,i;s>=0;s--)(i=r[s])&&(t=(o?i(e,a,t):i(t))||t);return o&&t&&p(e,a,t),t};let c=class extends n{constructor(){super(...arguments),this.ariaLabel="",this._isDispatching=!1,this._onChange=r=>{if(!r.composed&&!this._isDispatching){r.stopPropagation(),this._isDispatching=!0;const e=r.target.activeTabIndex;this.dispatchEvent(new CustomEvent("change",{detail:{activeTabIndex:e},bubbles:!0,composed:!0})),this._isDispatching=!1}}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tablist")}firstUpdated(r){super.firstUpdated(r),this.addEventListener("change",this._onChange)}};c.styles=[...n.styles,d`
2
- :host {
3
- /*Containerfärg */
4
- --md-primary-tab-container-color: var(--md-sys-color-surface);
5
- --md-secondary-tab-container-color: var(--md-sys-color-surface);
1
+ import{b as m}from"../../vendor/vendor-material.js";import{a as u,n as b,t as y}from"../../vendor/vendor.js";import"./scb-primary-tab.js";import"./scb-secondary-tab.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var a=customElements.define.bind(customElements);customElements.define=function(s,o,r){try{customElements.get(s)||a(s,o,r)}catch(n){var c=String(n||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,v=t=>{throw TypeError(t)},p=(t,a,s,o)=>{for(var r=o>1?void 0:o?g(a,s):a,c=t.length-1,n;c>=0;c--)(n=t[c])&&(r=(o?n(a,s,r):n(r))||r);return o&&r&&f(a,s,r),r},_=(t,a,s)=>a.has(t)||v("Cannot "+s),S=(t,a,s)=>a.has(t)?v("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,s),l=(t,a,s)=>(_(t,a,"access private method"),s),e,h,d;let i=class extends m{constructor(){super(...arguments),S(this,e),this.ariaLabel="",this.spacing="",this.spacingTop="",this.spacingBottom="",this._isDispatching=!1,this._onChange=t=>{if(!t.composed&&!this._isDispatching){t.stopPropagation(),this._isDispatching=!0;const a=t.target.activeTabIndex;this.dispatchEvent(new CustomEvent("change",{detail:{activeTabIndex:a},bubbles:!0,composed:!0})),this._isDispatching=!1}}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tablist")}firstUpdated(t){super.firstUpdated(t),this.addEventListener("change",this._onChange),l(this,e,h).call(this)}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&l(this,e,h).call(this)}};e=new WeakSet;h=function(){const t=l(this,e,d).call(this,this.spacing),a=l(this,e,d).call(this,this.spacingTop)??t,s=l(this,e,d).call(this,this.spacingBottom)??t;a?this.style.setProperty("--scb-tabs-spacing-block-start",a):this.style.removeProperty("--scb-tabs-spacing-block-start"),s?this.style.setProperty("--scb-tabs-spacing-block-end",s):this.style.removeProperty("--scb-tabs-spacing-block-end")};d=function(t){if(!t)return;const a=String(t).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a};i.styles=[...m.styles,u`
2
+ :host {
3
+ /*Containerfärg */
4
+ --md-primary-tab-container-color: var(--md-sys-color-surface);
5
+ --md-secondary-tab-container-color: var(--md-sys-color-surface);
6
6
 
7
- /* Text- och ikonfärger */
8
- --md-primary-tab-label-text-color: var(--md-sys-color-on-surface-variant);
9
- --md-secondary-tab-label-text-color: var(--md-sys-color-on-surface-variant);
10
- --md-primary-tab-active-label-text-color: var(--md-sys-color-on-surface);
11
- --md-secondary-tab-active-label-text-color: var(--md-sys-color-on-surface);
7
+ /* Text- och ikonfärger */
8
+ --md-primary-tab-label-text-color: var(--md-sys-color-on-surface-variant);
9
+ --md-secondary-tab-label-text-color: var(--md-sys-color-on-surface-variant);
10
+ --md-primary-tab-active-label-text-color: var(--md-sys-color-on-surface);
11
+ --md-secondary-tab-active-label-text-color: var(--md-sys-color-on-surface);
12
12
 
13
- /* Indikator och divider */
14
- --md-primary-tab-active-indicator-color: var(--md-sys-color-primary);
15
- --md-primary-tab-divider-color: var(--md-sys-color-outline-variant);
16
- --md-secondary-tab-divider-color: var(--md-sys-color-outline-variant);
13
+ /* Indikator och divider */
14
+ --md-primary-tab-active-indicator-color: var(--md-sys-color-primary);
15
+ --md-primary-tab-divider-color: var(--md-sys-color-outline-variant);
16
+ --md-secondary-tab-divider-color: var(--md-sys-color-outline-variant);
17
17
 
18
- /* State layers (hover/press) */
19
- --md-primary-tab-hover-state-layer-color: var(--md-sys-color-on-surface);
20
- --md-secondary-tab-hover-state-layer-color: var(--md-sys-color-on-surface);
21
- }
18
+ /* State layers (hover/press) */
19
+ --md-primary-tab-hover-state-layer-color: var(--md-sys-color-on-surface);
20
+ --md-secondary-tab-hover-state-layer-color: var(--md-sys-color-on-surface);
22
21
 
23
- `];l([m({type:String,reflect:!0,attribute:"aria-label"})],c.prototype,"ariaLabel",2);c=l([b("scb-tabs")],c);
22
+ /* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
23
+ margin-block-start: var(--scb-tabs-spacing-block-start, 0);
24
+ margin-block-end: var(--scb-tabs-spacing-block-end, 0);
25
+ }
26
+ `];p([b({type:String,reflect:!0,attribute:"aria-label"})],i.prototype,"ariaLabel",2);p([b({type:String,reflect:!0})],i.prototype,"spacing",2);p([b({type:String,attribute:"spacing-top",reflect:!0})],i.prototype,"spacingTop",2);p([b({type:String,attribute:"spacing-bottom",reflect:!0})],i.prototype,"spacingBottom",2);i=p([y("scb-tabs")],i);