scb-wc 0.1.78 → 0.1.80

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 (180) hide show
  1. package/README.md +41 -22
  2. package/all.js +0 -2
  3. package/index.js +88 -90
  4. package/mvc/components/all.js +0 -2
  5. package/mvc/components/scb-accordion/scb-accordion-item.js +3 -173
  6. package/mvc/components/scb-accordion/scb-accordion.js +4 -33
  7. package/mvc/components/scb-app-bar/scb-app-bar.js +2 -110
  8. package/mvc/components/scb-avatar/scb-avatar.js +2 -94
  9. package/mvc/components/scb-badge/scb-badge.js +2 -72
  10. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -12
  11. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +4 -91
  12. package/mvc/components/scb-button/scb-button.js +47 -309
  13. package/mvc/components/scb-calendar/scb-calendar-event.js +2 -6
  14. package/mvc/components/scb-calendar/scb-calendar.js +6 -120
  15. package/mvc/components/scb-calendar-card/scb-calendar-card.js +21 -350
  16. package/mvc/components/scb-card/scb-card.js +54 -819
  17. package/mvc/components/scb-checkbox/scb-checkbox-group.js +3 -31
  18. package/mvc/components/scb-checkbox/scb-checkbox.js +5 -127
  19. package/mvc/components/scb-chip/scb-chip.js +2 -76
  20. package/mvc/components/scb-collapse/scb-collapse.js +2 -44
  21. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +7 -73
  22. package/mvc/components/scb-dialog/scb-dialog.js +2 -213
  23. package/mvc/components/scb-divider/scb-divider.js +1 -69
  24. package/mvc/components/scb-drawer/scb-drawer.js +6 -102
  25. package/mvc/components/scb-drop-zone/scb-drop-zone.js +2 -410
  26. package/mvc/components/scb-dropdown/scb-dropdown.js +17 -222
  27. package/mvc/components/scb-fab/scb-fab.js +7 -95
  28. package/mvc/components/scb-fact-card/scb-fact-card-content.js +2 -69
  29. package/mvc/components/scb-fact-card/scb-fact-card.js +2 -214
  30. package/mvc/components/scb-footer/scb-footer-section.js +1 -3
  31. package/mvc/components/scb-footer/scb-footer.js +3 -172
  32. package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +2 -112
  33. package/mvc/components/scb-grid/scb-grid-item.js +1 -32
  34. package/mvc/components/scb-grid/scb-grid.js +1 -99
  35. package/mvc/components/scb-grid/scb-stack.js +1 -33
  36. package/mvc/components/scb-header/scb-header-menu-item.js +1 -5
  37. package/mvc/components/scb-header/scb-header-tab.js +1 -5
  38. package/mvc/components/scb-header/scb-header.js +75 -888
  39. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +43 -168
  40. package/mvc/components/scb-icon-button/scb-icon-button.js +59 -171
  41. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +17 -218
  42. package/mvc/components/scb-link/scb-link.js +4 -55
  43. package/mvc/components/scb-list/scb-list-item.js +23 -126
  44. package/mvc/components/scb-list/scb-list.js +5 -26
  45. package/mvc/components/scb-menu/scb-menu-item.js +16 -190
  46. package/mvc/components/scb-menu/scb-menu-section.js +4 -36
  47. package/mvc/components/scb-menu/scb-menu.js +5 -69
  48. package/mvc/components/scb-menu/scb-sub-menu.js +2 -7
  49. package/mvc/components/scb-nav/scb-nav-item.js +1 -28
  50. package/mvc/components/scb-nav/scb-nav.js +5 -98
  51. package/mvc/components/scb-notification-card/scb-notification-card.js +7 -364
  52. package/mvc/components/scb-options-menu/scb-options-menu-item.js +3 -50
  53. package/mvc/components/scb-options-menu/scb-options-menu.js +2 -82
  54. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +2 -31
  55. package/mvc/components/scb-overlay/scb-overlay.js +3 -43
  56. package/mvc/components/scb-pagination/scb-pagination.js +19 -221
  57. package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +2 -67
  58. package/mvc/components/scb-progress-stepper/scb-progress-step.js +4 -121
  59. package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +2 -56
  60. package/mvc/components/scb-radio-button/scb-radio-button.js +5 -116
  61. package/mvc/components/scb-radio-button/scb-radio-group.js +2 -32
  62. package/mvc/components/scb-scrollspy/scb-scrollspy.js +2 -61
  63. package/mvc/components/scb-search/scb-search.js +5 -249
  64. package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -32
  65. package/mvc/components/scb-segmented-button/scb-segmented-item.js +2 -70
  66. package/mvc/components/scb-select/scb-select-option.js +2 -54
  67. package/mvc/components/scb-select/scb-select.js +4 -244
  68. package/mvc/components/scb-skeleton/scb-skeleton.js +2 -35
  69. package/mvc/components/scb-slider/scb-slider.js +5 -9
  70. package/mvc/components/scb-snackbar/scb-snackbar.js +9 -84
  71. package/mvc/components/scb-status-pill/scb-status-pill.js +2 -43
  72. package/mvc/components/scb-stepper/scb-step.js +8 -186
  73. package/mvc/components/scb-stepper/scb-stepper.js +2 -130
  74. package/mvc/components/scb-switch/scb-switch.js +4 -49
  75. package/mvc/components/scb-table/scb-table.js +2 -48
  76. package/mvc/components/scb-table-advanced/scb-table-advanced.js +2 -53
  77. package/mvc/components/scb-tabs/scb-primary-tab.js +2 -7
  78. package/mvc/components/scb-tabs/scb-secondary-tab.js +2 -7
  79. package/mvc/components/scb-tabs/scb-tabs.js +4 -31
  80. package/mvc/components/scb-textfield/scb-textfield.js +142 -388
  81. package/mvc/components/scb-toc/scb-toc-item.js +3 -251
  82. package/mvc/components/scb-toc/scb-toc.js +2 -16
  83. package/mvc/components/scb-tooltip/scb-tooltip.js +8 -155
  84. package/mvc/components/scb-viz/scb-viz.js +4 -619
  85. package/mvc/scb-wc-core.css +1 -1
  86. package/mvc/scb-wc-selfhost.css +1 -1
  87. package/mvc/scb-wc.css +1 -1
  88. package/mvc/vendor/assist-chip.js +3 -3
  89. package/mvc/vendor/chip-set.js +1 -1
  90. package/mvc/vendor/chip.js +2 -2
  91. package/mvc/vendor/elevation.js +2 -2
  92. package/mvc/vendor/filter-chip.js +1 -1
  93. package/mvc/vendor/focusable.js +1 -1
  94. package/mvc/vendor/form-associated.js +1 -1
  95. package/mvc/vendor/icon.js +2 -2
  96. package/mvc/vendor/lazy-focus-ring.js +2 -0
  97. package/mvc/vendor/lazy-ripple.js +2 -0
  98. package/mvc/vendor/md-focus-ring.js +2 -2
  99. package/mvc/vendor/ripple.js +2 -2
  100. package/mvc/vendor/scb-card-variants.internal.js +284 -0
  101. package/mvc/vendor/scb-chevron.js +10 -0
  102. package/mvc/vendor/scb-header-drawer.internal.js +71 -0
  103. package/mvc/vendor/shared-styles.js +1 -1
  104. package/mvc/vendor/tab-styles.js +3 -3
  105. package/mvc/vendor/validator.js +1 -1
  106. package/mvc/vendor/vendor.js +3 -4
  107. package/package.json +2 -2
  108. package/scb-accordion/scb-accordion-item.js +33 -32
  109. package/scb-app-bar/scb-app-bar.js +1 -1
  110. package/scb-button/scb-button.js +287 -259
  111. package/scb-calendar/scb-calendar.js +49 -49
  112. package/scb-calendar-card/scb-calendar-card.js +105 -59
  113. package/scb-card/scb-card-variants.internal.js +230 -0
  114. package/scb-card/scb-card.js +387 -528
  115. package/scb-checkbox/scb-checkbox.js +0 -1
  116. package/scb-chevron/scb-chevron.js +0 -1
  117. package/scb-components/scb-button/scb-button.d.ts +14 -2
  118. package/scb-components/scb-calendar/scb-calendar.d.ts +1 -0
  119. package/scb-components/scb-calendar-card/scb-calendar-card.d.ts +16 -4
  120. package/scb-components/scb-card/scb-card-variants.internal.d.ts +15 -0
  121. package/scb-components/scb-card/scb-card.d.ts +26 -9
  122. package/scb-components/scb-cookies-consent/scb-cookies-consent.d.ts +3 -0
  123. package/scb-components/scb-header/scb-header-drawer.internal.d.ts +31 -0
  124. package/scb-components/scb-header/scb-header.d.ts +1 -2
  125. package/scb-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +6 -1
  126. package/scb-components/scb-icon-button/scb-icon-button.d.ts +28 -29
  127. package/scb-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -4
  128. package/scb-components/scb-list/scb-list-item.d.ts +20 -2
  129. package/scb-components/scb-list/scb-list.d.ts +1 -2
  130. package/scb-components/scb-nav/scb-nav.d.ts +2 -0
  131. package/scb-components/scb-segmented-button/scb-segmented-item.d.ts +1 -0
  132. package/scb-components/scb-select/scb-select-option.d.ts +2 -0
  133. package/scb-components/scb-toc/scb-toc-item.d.ts +1 -0
  134. package/scb-components/scb-tooltip/scb-tooltip.d.ts +2 -0
  135. package/scb-cookies-consent/scb-cookies-consent.js +43 -31
  136. package/scb-datepicker/scb-datepicker.js +27 -25
  137. package/scb-dialog/scb-dialog.js +1 -1
  138. package/scb-dropdown/scb-dropdown.js +29 -28
  139. package/scb-header/scb-header-drawer.internal.js +78 -0
  140. package/scb-header/scb-header.js +41 -89
  141. package/scb-horizontal-scroller/scb-horizontal-scroller.js +181 -88
  142. package/scb-icon-button/scb-icon-button.js +293 -205
  143. package/scb-keyfigure-card/scb-keyfigure-card.js +96 -43
  144. package/scb-list/scb-list-item.js +117 -52
  145. package/scb-list/scb-list.js +9 -9
  146. package/scb-nav/scb-nav.js +26 -23
  147. package/scb-notification-card/scb-notification-card.js +0 -2
  148. package/scb-options-menu/scb-options-menu-item.js +20 -20
  149. package/scb-pagination/scb-pagination.js +0 -1
  150. package/scb-progress-stepper/scb-progress-step.js +19 -17
  151. package/scb-radio-button/scb-radio-button.js +0 -1
  152. package/scb-search/scb-search.js +29 -28
  153. package/scb-segmented-button/scb-segmented-item.js +22 -19
  154. package/scb-select/scb-select-option.js +20 -14
  155. package/scb-select/scb-select.js +26 -26
  156. package/scb-stepper/scb-step.js +34 -31
  157. package/scb-textfield/scb-textfield.js +39 -39
  158. package/scb-toc/scb-toc-item.js +26 -26
  159. package/scb-tooltip/scb-tooltip.js +5 -4
  160. package/scb-viz/scb-viz.js +1 -1
  161. package/scb-wc-core.css +1 -1
  162. package/scb-wc-public-entry/index.d.ts +97 -0
  163. package/scb-wc-selfhost.css +1 -1
  164. package/scb-wc.bundle.js +1873 -1476
  165. package/scb-wc.css +1 -1
  166. package/scb-wc.d.ts +194 -198
  167. package/mvc/components/scb-chevron/scb-chevron.js +0 -41
  168. package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
  169. package/mvc/vendor/element-internals.js +0 -1
  170. package/mvc/vendor/filled-icon-button.js +0 -2
  171. package/mvc/vendor/filled-tonal-icon-button.js +0 -2
  172. package/mvc/vendor/form-label-activation.js +0 -1
  173. package/mvc/vendor/form-submitter.js +0 -1
  174. package/mvc/vendor/icon-button.js +0 -2
  175. package/mvc/vendor/list.js +0 -8
  176. package/mvc/vendor/outlined-icon-button.js +0 -2
  177. package/mvc/vendor/shared-styles2.js +0 -30
  178. package/scb-components/index.d.ts +0 -99
  179. package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
  180. package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-list/scb-list.js","../../vendor/classPrivateFieldGet2.js","../../vendor/assertClassBrand.js","../../vendor/decorate.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-list/scb-list-item.js","../../vendor/md-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/attachable-controller.js","../../vendor/ripple.js"])))=>i.map(i=>d[i]);
2
- import{_ as x,b as S,g as w,h as o,m as A,v,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as a}from"../../vendor/decorate.js";import{t as k}from"../../vendor/preload-helper.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,r){try{customElements.get(e)||t(e,s,r)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,E=0,n=(d=class extends x{async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??(this._listDepsPromise=k(()=>import("../scb-list/scb-list.js").then(()=>{this._listDepsLoaded=!0}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){const t=(this.value??"").trim().length>0;!this._inputFocused||!t||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText="",this.value="",this.name="",this.disabled=!1,this.required=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="large",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++E}`,this._kbMode=!1,this._valueOnFocus="",this._lastChangeValue="",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._formSubmitHandler=null,this._initialValue="",this._customValidationMessage="",this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),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._lastChangeValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this._inputEl();t&&(t.value=this._initialValue),this._lastChangeValue=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(),this._syncValidity()}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),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!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),this.applySpacing()}updated(t){if(super.updated(t),t.has("size")&&this._syncDensityForSize(),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),(t.has("value")||t.has("disabled"))&&this._syncFormValue(),(t.has("value")||t.has("disabled")||t.has("required"))&&this._syncValidity(),t.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const e=this._inputEl();e&&(e.disabled=this.disabled)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing()}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions&&this._listDepsLoaded;return h`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-list/scb-list.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-list/scb-list-item.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
2
+ import{f as x,g as v,h as S,m as w,p as o,v as h,y as A}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as k}from"../../vendor/preload-helper.js";import{r as E}from"../../vendor/lazy-focus-ring.js";import{t as a}from"../../vendor/decorate.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,r){try{customElements.get(e)||t(e,s,r)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,I=0,n=(d=class extends S{async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??(this._listDepsPromise=k(()=>import("../scb-list/scb-list.js").then(()=>{this._listDepsLoaded=!0}),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){const t=(this.value??"").trim().length>0;!this._inputFocused||!t||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText="",this.value="",this.name="",this.disabled=!1,this.required=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="large",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++I}`,this._kbMode=!1,this._valueOnFocus="",this._lastChangeValue="",this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(E(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._customValidationMessage="",this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),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._lastChangeValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this._inputEl();t&&(t.value=this._initialValue),this._lastChangeValue=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(),this._syncValidity()}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),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!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),this.applySpacing()}updated(t){if(super.updated(t),t.has("size")&&this._syncDensityForSize(),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),(t.has("value")||t.has("disabled"))&&this._syncFormValue(),(t.has("value")||t.has("disabled")||t.has("required"))&&this._syncValidity(),t.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const e=this._inputEl();e&&(e.disabled=this.disabled)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing()}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions&&this._listDepsLoaded;return h`
3
3
  <div class="ripple-wrapper">
4
4
  <md-icon class="leading">${t?"arrow_back":"search"}</md-icon>
5
5
 
@@ -42,252 +42,8 @@ import{_ as x,b as S,g as w,h as o,m as A,v,y as h}from"../../vendor/vendor.js";
42
42
  </scb-list>
43
43
  <md-focus-ring id="optionRing" class="option-ring"></md-focus-ring>
44
44
  `:v}
45
- `}formDisabledCallback(t){this.disabled=t}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??"").trim()?"Fyll i det här fältet.":""}_syncValidity(){const t=this._inputEl(),e=this.disabled?"":this._getValidationMessage();t&&(t.setCustomValidity(e),t.setAttribute("aria-invalid",e?"true":"false")),this._internals&&(e?this._internals.setValidity({valueMissing:!0},e,t??void 0):this._internals.setValidity({})),this.toggleAttribute("aria-invalid",!!e)}checkValidity(){return!this._getValidationMessage()}reportValidity(){this._syncValidity();const t=this._inputEl();return t?t.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(t){this._customValidationMessage=t,this._syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this._dispatchSubmit(e)}focus(t){const e=this._inputEl();if(e){e.focus(t);return}this.updateComplete.then(()=>this._inputEl()?.focus(t))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(t=>!t.hasAttribute("hidden")&&t.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(t){t.stopPropagation();const e=t.target;this.value=e.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();const s={value:this.value};this.dispatchEvent(new CustomEvent("scb-search-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchinput",{detail:s,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(t){t.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??"",this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??"")&&this._dispatchStandardChangeIfNeeded(),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 e=this._getVisibleItems(),s=(this.value??"").trim().length>0,r=this._inputFocused&&s&&e.length>0,i=t.key,l=t.keyCode,p=i==="ArrowDown"||i==="Down"||l===40,b=i==="ArrowUp"||i==="Up"||l===38,g=i==="Home"||l===36,m=i==="End"||l===35,f=i==="Enter"||l===13,y=i==="Escape"||i==="Esc"||l===27;if(p){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,1);return}if(b){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,-1);return}if(g){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(m){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?e.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(f){if(!r){const c=this._internals?.form??this._form??this.closest("form");c?(t.preventDefault(),this.reportValidity()&&c.requestSubmit()):this.submit();return}t.preventDefault();const _=this._getActiveItem();if(_){const c=_.getAttribute("label")||"";this.value=c,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(_)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(y){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._dispatchStandardInput(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchclear",{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let r=0;for(const i of s){const l=`${(i.getAttribute("label")||"").toLowerCase()} ${(i.getAttribute("supporting-text")||"").toLowerCase()}`.trim();e!==""&&l.includes(e)?(i.removeAttribute("hidden"),r++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=r,this._activeIndex>=r&&(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(t=>!t.hasAttribute("hidden")&&t.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(e=>this._ensureOptionA11y(e))}_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,r=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(r));const i=r?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const r=this.getBoundingClientRect(),i=t.getBoundingClientRect(),l=i.top-r.top,p=i.left-r.left,b=i.width,g=i.height;e.style.top=`${l}px`,e.style.left=`${p}px`,e.style.width=`${b}px`,e.style.height=`${g}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)}_dispatchStandardInput(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){const t=this.value??"";t!==this._lastChangeValue&&(this._lastChangeValue=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_dispatchSubmit(t){this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchsubmit",{detail:t,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}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}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-search-spacing-block-start",e):this.style.removeProperty("--scb-search-spacing-block-start"),s?this.style.setProperty("--scb-search-spacing-block-end",s):this.style.removeProperty("--scb-search-spacing-block-end"),r?this.style.setProperty("--scb-search-spacing-inline-start",r):this.style.removeProperty("--scb-search-spacing-inline-start"),i?this.style.setProperty("--scb-search-spacing-inline-end",i):this.style.removeProperty("--scb-search-spacing-inline-end")}_syncFormValue(){if(!this._internals)return;const t=this.disabled?null:this.value;this._internals.setFormValue(t)}},d.formAssociated=!0,d.styles=S`
46
- :host {
47
- display: flex;
48
- flex-direction: column;
49
- position: relative;
50
- color: var(--md-sys-color-on-surface);
51
- -webkit-tap-highlight-color: transparent;
52
-
53
- margin-block-start: var(--scb-search-spacing-block-start, 0);
54
- margin-block-end: var(--scb-search-spacing-block-end, 0);
55
- margin-inline-start: var(--scb-search-spacing-inline-start, 0);
56
- margin-inline-end: var(--scb-search-spacing-inline-end, 0);
57
-
58
- --scb-search-radius: var(--radius-full, 1000px);
59
- --scb-search-open-radius: var(--radius-xl, 24px);
60
-
61
- --scb-search-height: calc(var(--scb-search-line-height) + var(--scb-search-padding-y) + var(--scb-search-padding-y));
62
- --scb-search-padding-x: var(--spacing-4, 12px);
63
- --scb-search-padding-y: var(--spacing-4, 12px);
64
- --scb-search-leading-size: var(--scale-10, 40px);
65
- --scb-search-trailing-size: var(--scale-10, 40px);
66
- --scb-search-gap: var(--spacing-2, 4px);
67
-
68
- letter-spacing: var(--md-sys-typescale-body-large-tracking, -0.3px);
69
-
70
- --scb-search-leading-gap: calc(
45
+ `}formDisabledCallback(t){this.disabled=t}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??"").trim()?"Fyll i det här fältet.":""}_syncValidity(){const t=this._inputEl(),e=this.disabled?"":this._getValidationMessage();t&&(t.setCustomValidity(e),t.setAttribute("aria-invalid",e?"true":"false")),this._internals&&(e?this._internals.setValidity({valueMissing:!0},e,t??void 0):this._internals.setValidity({})),this.toggleAttribute("aria-invalid",!!e)}checkValidity(){return!this._getValidationMessage()}reportValidity(){this._syncValidity();const t=this._inputEl();return t?t.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(t){this._customValidationMessage=t,this._syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this._dispatchSubmit(e)}focus(t){const e=this._inputEl();if(e){e.focus(t);return}this.updateComplete.then(()=>this._inputEl()?.focus(t))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(t=>!t.hasAttribute("hidden")&&t.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(t){t.stopPropagation();const e=t.target;this.value=e.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();const s={value:this.value};this.dispatchEvent(new CustomEvent("scb-search-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchinput",{detail:s,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(t){t.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??"",this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??"")&&this._dispatchStandardChangeIfNeeded(),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 e=this._getVisibleItems(),s=(this.value??"").trim().length>0,r=this._inputFocused&&s&&e.length>0,i=t.key,l=t.keyCode,p=i==="ArrowDown"||i==="Down"||l===40,b=i==="ArrowUp"||i==="Up"||l===38,g=i==="Home"||l===36,m=i==="End"||l===35,f=i==="Enter"||l===13,y=i==="Escape"||i==="Esc"||l===27;if(p){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,1);return}if(b){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,-1);return}if(g){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(m){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?e.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(f){if(!r){const c=this._internals?.form??this._form??this.closest("form");c?(t.preventDefault(),this.reportValidity()&&c.requestSubmit()):this.submit();return}t.preventDefault();const _=this._getActiveItem();if(_){const c=_.getAttribute("label")||"";this.value=c,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(_)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(y){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._dispatchStandardInput(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchclear",{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let r=0;for(const i of s){const l=`${(i.getAttribute("label")||"").toLowerCase()} ${(i.getAttribute("supporting-text")||"").toLowerCase()}`.trim();e!==""&&l.includes(e)?(i.removeAttribute("hidden"),r++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=r,this._activeIndex>=r&&(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(t=>!t.hasAttribute("hidden")&&t.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(e=>this._ensureOptionA11y(e))}_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,r=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(r));const i=r?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const r=this.getBoundingClientRect(),i=t.getBoundingClientRect(),l=i.top-r.top,p=i.left-r.left,b=i.width,g=i.height;e.style.top=`${l}px`,e.style.left=`${p}px`,e.style.width=`${b}px`,e.style.height=`${g}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)}_dispatchStandardInput(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){const t=this.value??"";t!==this._lastChangeValue&&(this._lastChangeValue=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_dispatchSubmit(t){this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchsubmit",{detail:t,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}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}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-search-spacing-block-start",e):this.style.removeProperty("--scb-search-spacing-block-start"),s?this.style.setProperty("--scb-search-spacing-block-end",s):this.style.removeProperty("--scb-search-spacing-block-end"),r?this.style.setProperty("--scb-search-spacing-inline-start",r):this.style.removeProperty("--scb-search-spacing-inline-start"),i?this.style.setProperty("--scb-search-spacing-inline-end",i):this.style.removeProperty("--scb-search-spacing-inline-end")}_syncFormValue(){if(!this._internals)return;const t=this.disabled?null:this.value;this._internals.setFormValue(t)}},d.formAssociated=!0,d.styles=A`:host{display:flex;flex-direction:column;position:relative;color:var(--md-sys-color-on-surface);-webkit-tap-highlight-color:transparent;margin-block-start:var(--scb-search-spacing-block-start, 0);margin-block-end:var(--scb-search-spacing-block-end, 0);margin-inline-start:var(--scb-search-spacing-inline-start, 0);margin-inline-end:var(--scb-search-spacing-inline-end, 0);--scb-search-radius:var(--radius-full, 1000px);--scb-search-open-radius:var(--radius-xl, 24px);--scb-search-height:calc(var(--scb-search-line-height) + var(--scb-search-padding-y) + var(--scb-search-padding-y));--scb-search-padding-x:var(--spacing-4, 12px);--scb-search-padding-y:var(--spacing-4, 12px);--scb-search-leading-size:var(--scale-10, 40px);--scb-search-trailing-size:var(--scale-10, 40px);--scb-search-gap:var(--spacing-2, 4px);letter-spacing:var(--md-sys-typescale-body-large-tracking, -0.3px);--scb-search-leading-gap:calc(
71
46
  var(--scb-search-padding-x) + var(--scb-search-leading-size) + var(--scb-search-gap)
72
- );
73
- --scb-search-trailing-gap: calc(
47
+ );--scb-search-trailing-gap:calc(
74
48
  var(--scb-search-padding-x) + var(--scb-search-trailing-size) + var(--scb-search-gap)
75
- );
76
-
77
- --scb-search-font-size: var(--md-sys-typescale-body-medium-size, 16px);
78
- --scb-search-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
79
-
80
- --scb-search-icon-size: var(--icon-size-small, 20px);
81
- }
82
-
83
- :host([size='large']) {
84
- --scb-search-padding-x: var(--spacing-5, 16px);
85
- --scb-search-padding-y: var(--spacing-5, 16px);
86
- --scb-search-leading-size: var(--scale-11, 48px);
87
- --scb-search-trailing-size: var(--scale-11, 48px);
88
- --scb-search-icon-size: var(--icon-size-medium, 24px);
89
- --scb-search-font-size: var(--md-sys-typescale-body-large-size, 18px);
90
- --scb-search-line-height: var(--md-sys-typescale-body-large-line-height, 26px);
91
- }
92
-
93
- :host([size='small']) {
94
- --scb-search-padding-x: var(--spacing-3, 8px);
95
- --scb-search-padding-y: var(--spacing-3, 8px);
96
- --scb-search-leading-size: var(--scale-09, 36px);
97
- --scb-search-trailing-size: var(--scale-09, 36px);
98
- --scb-search-icon-size: var(--icon-size-small, 20px);
99
- --scb-search-font-size: var(--md-sys-typescale-body-small-size, 14px);
100
- --scb-search-line-height: var(--md-sys-typescale-body-small-line-height, 20px);
101
- }
102
- :host([disabled]) {
103
- opacity: 0.38;
104
- cursor: default;
105
- }
106
-
107
- .ripple-wrapper {
108
- position: relative;
109
- display: flex;
110
- align-items: center;
111
- width: 100%;
112
- }
113
-
114
- md-focus-ring.input-ring {
115
- position: absolute;
116
- inset: 0;
117
- pointer-events: none;
118
- display: none;
119
- border-radius: var(--scb-search-radius);
120
- z-index: 4;
121
- }
122
- .ripple-wrapper[data-kb-focus='true'] md-focus-ring.input-ring {
123
- display: block;
124
- }
125
- input.with-list ~ md-focus-ring.input-ring {
126
- border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
127
- }
128
- :host([full-screen]) md-focus-ring.input-ring {
129
- border-radius: var(--radius-none, 0px) !important;
130
- }
131
-
132
- md-focus-ring.option-ring {
133
- position: absolute;
134
- display: none;
135
- pointer-events: none;
136
- z-index: 11;
137
- border-radius: var(--md-sys-shape-corner-small, 8px);
138
- }
139
- md-focus-ring.option-ring[data-show='true'] {
140
- display: block;
141
- }
142
-
143
- .leading {
144
- position: absolute;
145
- left: var(--scb-search-padding-x);
146
- top: 50%;
147
- transform: translateY(-50%);
148
- width: var(--scb-search-leading-size);
149
- height: var(--scb-search-leading-size);
150
- display: flex;
151
- align-items: center;
152
- justify-content: center;
153
- pointer-events: none;
154
- color: var(--md-sys-color-on-surface-variant);
155
- z-index: 2;
156
- }
157
- .leading md-icon,
158
- .trailing md-icon,
159
- .clear-btn md-icon {
160
- --md-icon-size: var(--scb-search-icon-size);
161
- font-size: var(--scb-search-icon-size);
162
- line-height: 1;
163
- }
164
-
165
- .trailing,
166
- .clear-btn {
167
- position: absolute;
168
- right: var(--scb-search-padding-x);
169
- top: 50%;
170
- transform: translateY(-50%);
171
- width: var(--scb-search-trailing-size);
172
- height: var(--scb-search-trailing-size);
173
- display: inline-flex;
174
- align-items: center;
175
- justify-content: center;
176
- color: var(--md-sys-color-on-surface-variant);
177
- z-index: 3;
178
- }
179
- .trailing md-icon {
180
- pointer-events: none;
181
- }
182
-
183
- .clear-btn {
184
- background: none;
185
- border: 0;
186
- padding: 0;
187
- cursor: pointer;
188
- }
189
- .clear-btn[hidden] {
190
- display: none;
191
- }
192
- .clear-btn:disabled {
193
- cursor: default;
194
- }
195
-
196
- input[type='search'] {
197
- padding: var(--scb-search-padding-y) var(--scb-search-trailing-gap)
198
- var(--scb-search-padding-y) var(--scb-search-leading-gap);
199
- min-height: var(--scb-search-height);
200
- width: 100%;
201
- box-sizing: border-box;
202
-
203
- border: var(--stroke-border, 1px) solid var(--md-sys-color-outline);
204
- border-radius: var(--scb-search-radius);
205
-
206
- font-family: var(--md-sys-typescale-body-large-font, var(--brand-font, Inter), sans-serif);
207
- font-size: var(--scb-search-font-size);
208
- line-height: var(--scb-search-line-height);
209
-
210
- color: var(--md-sys-color-on-surface);
211
- background: transparent;
212
-
213
- position: relative;
214
- z-index: 1;
215
- }
216
- input[type='search']::placeholder {
217
- color: var(--md-sys-color-on-surface-variant);
218
- font-size: var(--scb-search-font-size);
219
- line-height: var(--scb-search-line-height);
220
- }
221
- input[type='search']:hover {
222
- outline: var(--md-sys-color-outline) auto var(--stroke-border, 1px);
223
- }
224
- input[type='search']:focus {
225
- outline: none;
226
- }
227
-
228
- md-ripple {
229
- border-radius: var(--scb-search-radius);
230
- position: absolute;
231
- inset: 0;
232
- z-index: 2;
233
- pointer-events: none;
234
- --md-ripple-hover-color: transparent;
235
- --md-ripple-hover-opacity: 0;
236
- }
237
-
238
- input[type='search']::-webkit-search-cancel-button {
239
- -webkit-appearance: none;
240
- appearance: none;
241
- display: none;
242
- }
243
-
244
- input.with-list {
245
- border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
246
- }
247
- input.with-list ~ md-ripple {
248
- border-radius: var(--scb-search-open-radius) var(--scb-search-open-radius) 0 0;
249
- }
250
-
251
- scb-list.suggestion-list {
252
- position: absolute;
253
- top: 100%;
254
- left: 0;
255
- width: 100%;
256
- z-index: 10;
257
- background: var(--md-sys-color-surface-container-lowest);
258
- border: var(--stroke-border, 1px) solid var(--md-sys-color-outline);
259
- border-top: 0;
260
- border-radius: 0 0 var(--scb-search-open-radius) var(--scb-search-open-radius);
261
- overflow: auto;
262
- box-sizing: border-box;
263
- max-height: var(--scb-search-suggestions-max-h, 60vh);
264
- }
265
-
266
- :host([full-screen]) input[type='search'],
267
- :host([full-screen]) input.with-list,
268
- :host([full-screen]) input.with-list ~ md-ripple {
269
- border-radius: var(--radius-none, 0px) !important;
270
- }
271
- :host([full-screen]) scb-list.suggestion-list {
272
- position: static;
273
- border: 0;
274
- border-radius: 0;
275
- background: transparent;
276
- }
277
-
278
- .list-divider {
279
- display: none;
280
- height: var(--stroke-border, 1px);
281
- background: var(--md-sys-color-outline);
282
- width: 100%;
283
- }
284
- :host([full-screen]) .list-divider[aria-hidden='false'] {
285
- display: block;
286
- }
287
-
288
- @media (prefers-color-scheme: dark) {
289
- :host {
290
- color: var(--md-sys-color-on-surface);
291
- }
292
- }
293
- `,d);a([o({type:String,attribute:"trailing-icon"})],n.prototype,"trailingIcon",void 0);a([o({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",void 0);a([o({type:String})],n.prototype,"value",void 0);a([o({type:String,reflect:!0})],n.prototype,"name",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"required",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"autocomplete",void 0);a([o({type:String,reflect:!0})],n.prototype,"spacing",void 0);a([o({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);a([o({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);a([o({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);a([o({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);a([o({type:String,reflect:!0})],n.prototype,"size",void 0);a([o({type:Boolean,attribute:"full-screen",reflect:!0})],n.prototype,"fullScreen",void 0);a([A()],n.prototype,"_listDepsLoaded",void 0);n=a([w("scb-search")],n);export{n as ScbSearch};
49
+ );--scb-search-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-search-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-search-icon-size:var(--icon-size-small, 20px)}:host([size='large']){--scb-search-padding-x:var(--spacing-5, 16px);--scb-search-padding-y:var(--spacing-5, 16px);--scb-search-leading-size:var(--scale-11, 48px);--scb-search-trailing-size:var(--scale-11, 48px);--scb-search-icon-size:var(--icon-size-medium, 24px);--scb-search-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-search-line-height:var(--md-sys-typescale-body-large-line-height, 26px)}:host([size='small']){--scb-search-padding-x:var(--spacing-3, 8px);--scb-search-padding-y:var(--spacing-3, 8px);--scb-search-leading-size:var(--scale-09, 36px);--scb-search-trailing-size:var(--scale-09, 36px);--scb-search-icon-size:var(--icon-size-small, 20px);--scb-search-font-size:var(--md-sys-typescale-body-small-size, 14px);--scb-search-line-height:var(--md-sys-typescale-body-small-line-height, 20px)}:host([disabled]){opacity:.38;cursor:default}.ripple-wrapper{position:relative;display:flex;align-items:center;width:100%}md-focus-ring.input-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-search-radius);z-index:4}.ripple-wrapper[data-kb-focus=true] md-focus-ring.input-ring{display:block}input.with-list~md-focus-ring.input-ring{border-radius:var(--scb-search-open-radius) var(--scb-search-open-radius)0 0}:host([full-screen]) md-focus-ring.input-ring{border-radius:var(--radius-none, 0px)!important}md-focus-ring.option-ring{position:absolute;display:none;pointer-events:none;z-index:11;border-radius:var(--md-sys-shape-corner-small, 8px)}md-focus-ring.option-ring[data-show=true]{display:block}.clear-btn,.leading,.trailing{position:absolute;top:50%;transform:translateY(-50%);align-items:center;justify-content:center;color:var(--md-sys-color-on-surface-variant)}.leading{left:var(--scb-search-padding-x);width:var(--scb-search-leading-size);height:var(--scb-search-leading-size);display:flex;pointer-events:none;z-index:2}.clear-btn md-icon,.leading md-icon,.trailing md-icon{--md-icon-size:var(--scb-search-icon-size);font-size:var(--scb-search-icon-size);line-height:1}.clear-btn,.trailing{right:var(--scb-search-padding-x);width:var(--scb-search-trailing-size);height:var(--scb-search-trailing-size);display:inline-flex;z-index:3}.trailing md-icon{pointer-events:none}.clear-btn{background:0 0;border:0;padding:0;cursor:pointer}.clear-btn[hidden]{display:none}.clear-btn:disabled{cursor:default}input[type=search]{padding:var(--scb-search-padding-y) var(--scb-search-trailing-gap) var(--scb-search-padding-y) var(--scb-search-leading-gap);min-height:var(--scb-search-height);width:100%;box-sizing:border-box;border:var(--stroke-border, 1px) solid var(--md-sys-color-outline);border-radius:var(--scb-search-radius);font-family:var(--md-sys-typescale-body-large-font, var(--brand-font, Inter), sans-serif);font-size:var(--scb-search-font-size);line-height:var(--scb-search-line-height);color:var(--md-sys-color-on-surface);background:0 0;position:relative;z-index:1}input[type=search]::placeholder{color:var(--md-sys-color-on-surface-variant);font-size:var(--scb-search-font-size);line-height:var(--scb-search-line-height)}input[type=search]:hover{outline:var(--md-sys-color-outline) auto var(--stroke-border, 1px)}input[type=search]:focus{outline:0}md-ripple{border-radius:var(--scb-search-radius);position:absolute;inset:0;z-index:2;pointer-events:none;--md-ripple-hover-color:transparent;--md-ripple-hover-opacity:0}input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}input.with-list,input.with-list~md-ripple{border-radius:var(--scb-search-open-radius) var(--scb-search-open-radius)0 0}scb-list.suggestion-list{--scb-list-container-padding-block:0px;position:absolute;top:100%;left:0;width:100%;z-index:10;background:var(--md-sys-color-surface-container-lowest);border:var(--stroke-border, 1px) solid var(--md-sys-color-outline);border-top:0;border-radius:0 0 var(--scb-search-open-radius) var(--scb-search-open-radius);overflow:auto;box-sizing:border-box;max-height:var(--scb-search-suggestions-max-h, 60vh)}:host([full-screen]) input.with-list,:host([full-screen]) input.with-list~md-ripple,:host([full-screen]) input[type=search]{border-radius:var(--radius-none, 0px)!important}:host([full-screen]) scb-list.suggestion-list{position:static;border:0;border-radius:0;background:0 0}.list-divider{display:none;height:var(--stroke-border, 1px);background:var(--md-sys-color-outline);width:100%}:host([full-screen]) .list-divider[aria-hidden=false]{display:block}@media (prefers-color-scheme:dark){:host{color:var(--md-sys-color-on-surface)}}`,d);a([o({type:String,attribute:"trailing-icon"})],n.prototype,"trailingIcon",void 0);a([o({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",void 0);a([o({type:String})],n.prototype,"value",void 0);a([o({type:String,reflect:!0})],n.prototype,"name",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"required",void 0);a([o({type:Boolean,reflect:!0})],n.prototype,"autocomplete",void 0);a([o({type:String,reflect:!0})],n.prototype,"spacing",void 0);a([o({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);a([o({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);a([o({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);a([o({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);a([o({type:String,reflect:!0})],n.prototype,"size",void 0);a([o({type:Boolean,attribute:"full-screen",reflect:!0})],n.prototype,"fullScreen",void 0);a([x()],n.prototype,"_listDepsLoaded",void 0);n=a([w("scb-search")],n);export{n as ScbSearch};
@@ -1,32 +1 @@
1
- import{_ as p,b as g,g as b,h as r,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import{n as v,t as c}from"../../vendor/assertClassBrand.js";import"./scb-segmented-item.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(h){var d=String(h||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var o,u,a=(o=new WeakSet,u=class extends p{constructor(){super(),v(this,o),this._internals=null,this.variant="single-select",this.value="",this.values=[],this.disabled=!1,this.required=!1,this.name="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formResetHandler=null,this._initialValue="",this._initialValues=[],this._customValidationMessage="","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("slotchange",()=>{this.updateSegments()}),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 i=e.target;if(i&&i.closest){const s=i.closest("scb-segmented-item");s&&!s.hasAttribute("disabled")&&!this.disabled&&(this.onSlotClick(e),e.preventDefault())}}})),this._syncFormValue(),this._syncValidity(),c(o,this,m).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(),this._syncValidity()),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&c(o,this,m).call(this)}onSlotClick(t){let e=t.target;if(!e||!e.closest)return;const i=e.closest("scb-segmented-item");if(!i||this.disabled||i.hasAttribute("disabled"))return;const s=i.getAttribute("value")||"";s&&(this.variant==="multi-select"?(this.values.indexOf(s)===-1?this.values=[...this.values,s]:this.values=this.values.filter(d=>d!==s),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0})),this.updateSegments()):s!==this.value&&(this.value=s,this.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0,composed:!0})),this.updateSegments()),c(o,this,y).call(this,t,i))}updateSegments(){const t=this.shadowRoot?.querySelector("slot");t&&t.assignedElements().forEach(e=>{if(e.tagName==="SCB-SEGMENTED-ITEM"){const i=e.getAttribute("value")||"";if(i){let s=!1;this.variant==="multi-select"?s=!!this.values&&this.values.includes(i):s=i===this.value,e.setAttribute("aria-pressed",s?"true":"false"),s?e.setAttribute("selected","true"):e.removeAttribute("selected")}this.disabled&&e.setAttribute("disabled","true")}})}formDisabledCallback(t){this.disabled=t}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required?this.variant==="multi-select"?this.values.length===0?"Välj minst ett alternativ.":"":this.value?"":"Välj ett alternativ.":""}_syncValidity(){if(!this._internals)return;const t=this.disabled?"":this._getValidationMessage();t?(this._internals.setValidity({valueMissing:!0},t),this.setAttribute("aria-invalid","true")):(this._internals.setValidity({}),this.removeAttribute("aria-invalid"))}checkValidity(){return!this._getValidationMessage()}reportValidity(){return this._syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(t){this._customValidationMessage=t,this._syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}_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 f`<slot></slot>`}},u.formAssociated=!0,u.styles=g`
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-font, var(--brand, "Inter"), sans-serif);
11
- margin-block-start: var(--scb-segmented-button-spacing-block-start, 0);
12
- margin-block-end: var(--scb-segmented-button-spacing-block-end, 0);
13
- margin-inline-start: var(--scb-segmented-button-spacing-inline-start, 0);
14
- margin-inline-end: var(--scb-segmented-button-spacing-inline-end, 0);
15
- }
16
- /* Border radius only on first and last button */
17
- ::slotted(scb-segmented-item:first-child .segmented-item),
18
- ::slotted([role='button']:first-child .segmented-item) {
19
- border-top-left-radius: var(--md-sys-shape-corner-full);
20
- border-bottom-left-radius: var(--md-sys-shape-corner-full);
21
- }
22
- ::slotted(scb-segmented-item:last-child .segmented-item),
23
- ::slotted([role='button']:last-child .segmented-item) {
24
- border-top-right-radius: var(--md-sys-shape-corner-full);
25
- border-bottom-right-radius: var(--md-sys-shape-corner-full);
26
- }
27
- /* First button gets left border */
28
- ::slotted(scb-segmented-item:first-child .segmented-item),
29
- ::slotted([role='button']:first-child .segmented-item) {
30
- border-left: 1px solid var(--md-sys-color-outline);
31
- }
32
- `,u);function y(l,t){!(l instanceof MouseEvent)||l.detail===0||queueMicrotask(()=>{document.activeElement===t&&t.blur()})}function m(){const l=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??l,e=this.mapSpacingToken(this.spacingBottom)??l,i=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-segmented-button-spacing-block-start",t):this.style.removeProperty("--scb-segmented-button-spacing-block-start"),e?this.style.setProperty("--scb-segmented-button-spacing-block-end",e):this.style.removeProperty("--scb-segmented-button-spacing-block-end"),i?this.style.setProperty("--scb-segmented-button-spacing-inline-start",i):this.style.removeProperty("--scb-segmented-button-spacing-inline-start"),s?this.style.setProperty("--scb-segmented-button-spacing-inline-end",s):this.style.removeProperty("--scb-segmented-button-spacing-inline-end")}n([r({type:String,reflect:!0})],a.prototype,"variant",void 0);n([r({type:String,reflect:!0})],a.prototype,"value",void 0);n([r({type:Array})],a.prototype,"values",void 0);n([r({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);n([r({type:Boolean,reflect:!0})],a.prototype,"required",void 0);n([r({type:String,reflect:!0})],a.prototype,"name",void 0);n([r({type:String,reflect:!0})],a.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=n([b("scb-segmented-button")],a);
1
+ import{h as p,m as g,p as r,v as b,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import{n as v,t as c}from"../../vendor/assertClassBrand.js";import"./scb-segmented-item.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(h){var d=String(h||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var o,u,a=(o=new WeakSet,u=class extends p{constructor(){super(),v(this,o),this._internals=null,this.variant="single-select",this.value="",this.values=[],this.disabled=!1,this.required=!1,this.name="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formResetHandler=null,this._initialValue="",this._initialValues=[],this._customValidationMessage="","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("slotchange",()=>{this.updateSegments()}),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 i=e.target;if(i&&i.closest){const s=i.closest("scb-segmented-item");s&&!s.hasAttribute("disabled")&&!this.disabled&&(this.onSlotClick(e),e.preventDefault())}}})),this._syncFormValue(),this._syncValidity(),c(o,this,m).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(),this._syncValidity()),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&c(o,this,m).call(this)}onSlotClick(t){let e=t.target;if(!e||!e.closest)return;const i=e.closest("scb-segmented-item");if(!i||this.disabled||i.hasAttribute("disabled"))return;const s=i.getAttribute("value")||"";s&&(this.variant==="multi-select"?(this.values.indexOf(s)===-1?this.values=[...this.values,s]:this.values=this.values.filter(d=>d!==s),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0})),this.updateSegments()):s!==this.value&&(this.value=s,this.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0,composed:!0})),this.updateSegments()),c(o,this,y).call(this,t,i))}updateSegments(){const t=this.shadowRoot?.querySelector("slot");t&&t.assignedElements().forEach(e=>{if(e.tagName==="SCB-SEGMENTED-ITEM"){const i=e.getAttribute("value")||"";if(i){let s=!1;this.variant==="multi-select"?s=!!this.values&&this.values.includes(i):s=i===this.value,e.setAttribute("aria-pressed",s?"true":"false"),s?e.setAttribute("selected","true"):e.removeAttribute("selected")}this.disabled&&e.setAttribute("disabled","true")}})}formDisabledCallback(t){this.disabled=t}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required?this.variant==="multi-select"?this.values.length===0?"Välj minst ett alternativ.":"":this.value?"":"Välj ett alternativ.":""}_syncValidity(){if(!this._internals)return;const t=this.disabled?"":this._getValidationMessage();t?(this._internals.setValidity({valueMissing:!0},t),this.setAttribute("aria-invalid","true")):(this._internals.setValidity({}),this.removeAttribute("aria-invalid"))}checkValidity(){return!this._getValidationMessage()}reportValidity(){return this._syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(t){this._customValidationMessage=t,this._syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}_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>`}},u.formAssociated=!0,u.styles=f`:host{--scb-segmented-button-width:100%;--scb-segmented-button-height:48px;max-width:var(--scb-segmented-button-width);height:var(--scb-segmented-button-height);display:grid;grid-auto-flow:column;grid-auto-columns:1fr;font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);margin-block-start:var(--scb-segmented-button-spacing-block-start, 0);margin-block-end:var(--scb-segmented-button-spacing-block-end, 0);margin-inline-start:var(--scb-segmented-button-spacing-inline-start, 0);margin-inline-end:var(--scb-segmented-button-spacing-inline-end, 0)}::slotted([role=button]:first-child .segmented-item),::slotted(scb-segmented-item:first-child .segmented-item){border-top-left-radius:var(--md-sys-shape-corner-full);border-bottom-left-radius:var(--md-sys-shape-corner-full)}::slotted([role=button]:last-child .segmented-item),::slotted(scb-segmented-item:last-child .segmented-item){border-top-right-radius:var(--md-sys-shape-corner-full);border-bottom-right-radius:var(--md-sys-shape-corner-full)}::slotted([role=button]:first-child .segmented-item),::slotted(scb-segmented-item:first-child .segmented-item){border-left:1px solid var(--md-sys-color-outline)}`,u);function y(l,t){!(l instanceof MouseEvent)||l.detail===0||queueMicrotask(()=>{document.activeElement===t&&t.blur()})}function m(){const l=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??l,e=this.mapSpacingToken(this.spacingBottom)??l,i=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-segmented-button-spacing-block-start",t):this.style.removeProperty("--scb-segmented-button-spacing-block-start"),e?this.style.setProperty("--scb-segmented-button-spacing-block-end",e):this.style.removeProperty("--scb-segmented-button-spacing-block-end"),i?this.style.setProperty("--scb-segmented-button-spacing-inline-start",i):this.style.removeProperty("--scb-segmented-button-spacing-inline-start"),s?this.style.setProperty("--scb-segmented-button-spacing-inline-end",s):this.style.removeProperty("--scb-segmented-button-spacing-inline-end")}n([r({type:String,reflect:!0})],a.prototype,"variant",void 0);n([r({type:String,reflect:!0})],a.prototype,"value",void 0);n([r({type:Array})],a.prototype,"values",void 0);n([r({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);n([r({type:Boolean,reflect:!0})],a.prototype,"required",void 0);n([r({type:String,reflect:!0})],a.prototype,"name",void 0);n([r({type:String,reflect:!0})],a.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=n([g("scb-segmented-button")],a);
@@ -1,74 +1,6 @@
1
- import{_ as u,b as m,g as p,h as n,y as s}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as o}from"../../vendor/decorate.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,c){try{customElements.get(t)||e(t,i,c)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var h,r=(h=class extends u{constructor(...e){super(...e),this.label="",this.value="",this.selected=!1,this.icon="",this.href="",this.disabled=!1,this.onHostKeydown=t=>{if(!this.href||this.isEffectivelyDisabled||t.code!=="Space"&&t.code!=="Enter"&&t.code!=="NumpadEnter")return;const i=this.shadowRoot?.querySelector("a[href]");i&&(t.preventDefault(),t.stopPropagation(),i.click())}}get isEffectivelyDisabled(){const e=this.parentElement?.hasAttribute?.("disabled");return this.disabled||!!e}get hasDefaultSlotContent(){return Array.from(this.childNodes).some(e=>e.nodeType===1?!0:e.nodeType===3?(e.textContent??"").trim()!=="":!1)}render(){const e=this.isEffectivelyDisabled,t=!!this.icon,i=!!this.label||this.hasDefaultSlotContent,c=this.label?s`${this.label}`:s`<slot></slot>`,a=`segmented-item${t||this.selected?" has-icon":""}${i?"":" no-label"}`,d=s`
1
+ import{h as m,m as p,p as n,v as s,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as h}from"../../vendor/lazy-focus-ring.js";import{t as o}from"../../vendor/decorate.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,c){try{customElements.get(t)||e(t,i,c)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var u,r=(u=class extends m{constructor(...e){super(...e),this.label="",this.value="",this.selected=!1,this.icon="",this.href="",this.disabled=!1,this.onHostKeydown=t=>{if(!this.href||this.isEffectivelyDisabled||t.code!=="Space"&&t.code!=="Enter"&&t.code!=="NumpadEnter")return;const i=this.shadowRoot?.querySelector("a[href]");i&&(t.preventDefault(),t.stopPropagation(),i.click())}}get isEffectivelyDisabled(){const e=this.parentElement?.hasAttribute?.("disabled");return this.disabled||!!e}get hasDefaultSlotContent(){return Array.from(this.childNodes).some(e=>e.nodeType===1?!0:e.nodeType===3?(e.textContent??"").trim()!=="":!1)}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",h)}render(){const e=this.isEffectivelyDisabled,t=!!this.icon,i=!!this.label||this.hasDefaultSlotContent,c=this.label?s`${this.label}`:s`<slot></slot>`,a=`segmented-item${t||this.selected?" has-icon":""}${i?"":" no-label"}`,d=s`
2
2
  <md-ripple ?disabled="${e}"></md-ripple>
3
3
  ${this.selected?t&&i?s`<md-icon>check</md-icon>`:t?s`<md-icon>check</md-icon><md-icon>${this.icon}</md-icon>`:s`<md-icon>check</md-icon>`:t?s`<md-icon>${this.icon}</md-icon>`:""}
4
4
  ${i?s`<span>${c}</span>`:""}
5
5
  <md-focus-ring inward></md-focus-ring>
6
- `;return this.href?s`<a class="${a}" href="${this.href}" aria-disabled="${e?"true":"false"}" tabindex="-1">${d}</a>`:s`<div class="${a}" aria-disabled="${e?"true":"false"}">${d}</div>`}updateInteractiveAttributes(){this.setAttribute("tabindex",this.disabled?"-1":"0"),this.setAttribute("role",this.href?"link":"button")}firstUpdated(){this.addEventListener("keydown",this.onHostKeydown),this.updateInteractiveAttributes()}disconnectedCallback(){this.removeEventListener("keydown",this.onHostKeydown),super.disconnectedCallback()}updated(e){super.updated(e),(e.has("disabled")||e.has("href"))&&this.updateInteractiveAttributes()}},h.styles=m`
7
- .segmented-item {
8
- display: flex;
9
- gap: var(--spacing-3);
10
- align-items: center;
11
- text-decoration: none;
12
- border: 1px solid var(--md-sys-color-outline);
13
- border-left: none;
14
- background-color: var(--md-sys-color-surface);
15
- padding: var(--spacing-3) var(--spacing-4);
16
- font: inherit;
17
- cursor: pointer;
18
- position: relative;
19
- font-size: var(--md-sys-typescale-label-medium-size);
20
- line-height: var(--md-sys-typescale-label-medium-line-height);
21
- font-weight: var(--md-sys-typescale-label-medium-weight);
22
- letter-spacing: var(--md-sys-typescale-label-medium-tracking);
23
- color: var(--md-sys-color-on-surface);
24
- justify-content: center;
25
- height: 100%;
26
- box-sizing: border-box;
27
- }
28
- .segmented-item span {
29
- white-space: nowrap;
30
- }
31
- md-icon {
32
- font-size: 20px;
33
- width: 20px;
34
- height: 20px;
35
- }
36
- :host([disabled]) .segmented-item,
37
- .segmented-item[aria-disabled="true"] {
38
- opacity: 0.5;
39
- cursor: not-allowed;
40
- pointer-events: none;
41
- filter: grayscale(0.5);
42
- }
43
- :host([aria-pressed="true"]) .segmented-item {
44
- background-color: var(--md-sys-color-secondary-container);
45
- color: var(--md-sys-color-primary);
46
- }
47
- :host(:focus){
48
- outline: none;
49
- }
50
- md-focus-ring {
51
- position: absolute;
52
- inset: 0;
53
- pointer-events: none;
54
- display: none;
55
- border-radius: inherit;
56
- }
57
- :host(:focus-visible) md-focus-ring,
58
- md-focus-ring[data-show="true"] {
59
- display: block;
60
- }
61
- :host([disabled]):host(:focus-visible) md-focus-ring,
62
- :host([disabled]) md-focus-ring[data-show="true"] {
63
- display: none;
64
- }
65
- :host(:first-child) .segmented-item{
66
- border: 1px solid var(--md-sys-color-outline);
67
- border-top-left-radius: var(--md-sys-shape-corner-full);
68
- border-bottom-left-radius: var(--md-sys-shape-corner-full);
69
- }
70
- :host(:last-child) .segmented-item {
71
- border-top-right-radius: var(--md-sys-shape-corner-full);
72
- border-bottom-right-radius: var(--md-sys-shape-corner-full);
73
- }
74
- `,h);o([n({type:String,reflect:!0})],r.prototype,"label",void 0);o([n({type:String,reflect:!0})],r.prototype,"value",void 0);o([n({type:Boolean,reflect:!0})],r.prototype,"selected",void 0);o([n({type:String,reflect:!0})],r.prototype,"icon",void 0);o([n({type:String,reflect:!0})],r.prototype,"href",void 0);o([n({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);r=o([p("scb-segmented-item")],r);
6
+ `;return this.href?s`<a class="${a}" href="${this.href}" aria-disabled="${e?"true":"false"}" tabindex="-1">${d}</a>`:s`<div class="${a}" aria-disabled="${e?"true":"false"}">${d}</div>`}updateInteractiveAttributes(){this.setAttribute("tabindex",this.disabled?"-1":"0"),this.setAttribute("role",this.href?"link":"button")}firstUpdated(){this.addEventListener("keydown",this.onHostKeydown),this.updateInteractiveAttributes()}disconnectedCallback(){this.removeEventListener("focusin",h),this.removeEventListener("keydown",this.onHostKeydown),super.disconnectedCallback()}updated(e){super.updated(e),(e.has("disabled")||e.has("href"))&&this.updateInteractiveAttributes()}},u.styles=f`.segmented-item{display:flex;gap:var(--spacing-3);align-items:center;text-decoration:none;border:1px solid var(--md-sys-color-outline);border-left:none;background-color:var(--md-sys-color-surface);padding:var(--spacing-3) var(--spacing-4);font:inherit;cursor:pointer;position:relative;font-size:var(--md-sys-typescale-label-medium-size);line-height:var(--md-sys-typescale-label-medium-line-height);font-weight:var(--md-sys-typescale-label-medium-weight);letter-spacing:var(--md-sys-typescale-label-medium-tracking);color:var(--md-sys-color-on-surface);justify-content:center;height:100%;box-sizing:border-box}.segmented-item span{white-space:nowrap}md-icon{font-size:20px;width:20px;height:20px}.segmented-item[aria-disabled=true],:host([disabled]) .segmented-item{opacity:.5;cursor:not-allowed;pointer-events:none;filter:grayscale(.5)}:host([aria-pressed="true"]) .segmented-item{background-color:var(--md-sys-color-secondary-container);color:var(--md-sys-color-primary)}:host(:focus){outline:0}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:inherit}:host(:focus-visible) md-focus-ring,md-focus-ring[data-show=true]{display:block}:host([disabled]) md-focus-ring[data-show=true],:host([disabled]):host(:focus-visible) md-focus-ring{display:none}:host(:first-child) .segmented-item{border:1px solid var(--md-sys-color-outline);border-top-left-radius:var(--md-sys-shape-corner-full);border-bottom-left-radius:var(--md-sys-shape-corner-full)}:host(:last-child) .segmented-item{border-top-right-radius:var(--md-sys-shape-corner-full);border-bottom-right-radius:var(--md-sys-shape-corner-full)}`,u);o([n({type:String,reflect:!0})],r.prototype,"label",void 0);o([n({type:String,reflect:!0})],r.prototype,"value",void 0);o([n({type:Boolean,reflect:!0})],r.prototype,"selected",void 0);o([n({type:String,reflect:!0})],r.prototype,"icon",void 0);o([n({type:String,reflect:!0})],r.prototype,"href",void 0);o([n({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);r=o([p("scb-segmented-item")],r);
@@ -1,4 +1,4 @@
1
- import{_ as p,b,g as m,h as o,y as i}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t}from"../../vendor/decorate.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var c=customElements.define.bind(customElements);customElements.define=function(a,n,h){try{customElements.get(a)||c(a,n,h)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var r,e=(r=class extends p{constructor(...c){super(...c),this.value="",this.disabled=!1,this.showCheckbox=!1,this.checked=!1,this.showRadio=!1,this.label="",this.noHighlightSelected=!1}render(){return i`
1
+ import{h as b,m,p as o,v as i,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as d}from"../../vendor/lazy-focus-ring.js";import{t}from"../../vendor/decorate.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var c=customElements.define.bind(customElements);customElements.define=function(a,h,p){try{customElements.get(a)||c(a,h,p)}catch(r){var l=String(r||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var n,e=(n=class extends b{constructor(...c){super(...c),this.value="",this.disabled=!1,this.showCheckbox=!1,this.checked=!1,this.showRadio=!1,this.label="",this.noHighlightSelected=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",d)}disconnectedCallback(){this.removeEventListener("focusin",d),super.disconnectedCallback()}render(){return i`
2
2
  <div class="item ${this.checked?"checked":""}" ?aria-disabled=${this.disabled}>
3
3
  <md-ripple></md-ripple>
4
4
  ${this.showCheckbox?i`<md-icon class="${this.checked?"checkbox-checked":""}" aria-hidden="true">${this.checked?"check_box":"check_box_outline_blank"}</md-icon>`:null}
@@ -6,56 +6,4 @@ import{_ as p,b,g as m,h as o,y as i}from"../../vendor/vendor.js";import"../../v
6
6
  <div class="label">${this.label?this.label:i`<slot></slot>`}</div>
7
7
  <md-focus-ring inward></md-focus-ring>
8
8
  </div>
9
- `}},r.styles=b`
10
- :host {
11
- display: block;
12
- outline: none;
13
- }
14
- :host([hidden]) {
15
- display: none;
16
- }
17
- :host([disabled]) {
18
- pointer-events: none;
19
- opacity: 0.38;
20
- }
21
- :host(:focus-visible) .item {
22
- outline: 2px solid var(--md-sys-color-primary);
23
- outline-offset: -2px;
24
- }
25
- :host([data-focused]) .item {
26
- background-color: var(--md-sys-color-surface-container);
27
- }
28
- .item {
29
- display: flex;
30
- align-items: center;
31
- padding: var(--scb-select-option-padding-y, var(--spacing-3))
32
- var(--scb-select-option-padding-x, var(--spacing-5));
33
- gap: var(--scb-select-option-gap, var(--spacing-4));
34
- min-height: var(--scb-select-option-min-height, 40px);
35
- position: relative;
36
- font-size: var(--scb-select-option-font-size, var(--md-sys-typescale-body-large-size));
37
- line-height: var(--scb-select-option-line-height, var(--md-sys-typescale-body-large-line-height));
38
- letter-spacing: var(--scb-select-option-letter-spacing, var(--md-sys-typescale-body-large-tracking));
39
- }
40
- .label {
41
- min-width: 0;
42
- flex: 1 1 auto;
43
- }
44
- md-icon {
45
- font-size: var(--scb-select-option-icon-size, var(--icon-size-medium, 24px));
46
- line-height: 1;
47
- flex: 0 0 auto;
48
- }
49
- md-focus-ring {
50
- border-radius: var(--md-sys-shape-corner-small);
51
- }
52
- .item.checked {
53
- background-color: var(--md-sys-color-secondary-container);
54
- }
55
- :host([no-highlight-selected]) .item.checked {
56
- background-color: transparent;
57
- }
58
- md-icon.radio-checked {
59
- color: var(--md-sys-color-primary);
60
- }
61
- `,r);t([o({type:String})],e.prototype,"value",void 0);t([o({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);t([o({type:Boolean})],e.prototype,"showCheckbox",void 0);t([o({type:Boolean})],e.prototype,"checked",void 0);t([o({type:Boolean})],e.prototype,"showRadio",void 0);t([o({type:String})],e.prototype,"label",void 0);t([o({type:Boolean,attribute:"no-highlight-selected",reflect:!0})],e.prototype,"noHighlightSelected",void 0);e=t([m("scb-select-option")],e);
9
+ `}},n.styles=u`:host{display:block;outline:0}:host([hidden]){display:none}:host([disabled]){pointer-events:none;opacity:.38}:host(:focus-visible) .item{outline:2px solid var(--md-sys-color-primary);outline-offset:-2px}:host([data-focused]) .item{background-color:var(--md-sys-color-surface-container)}.item{display:flex;align-items:center;padding:var(--scb-select-option-padding-y, var(--spacing-3)) var(--scb-select-option-padding-x, var(--spacing-5));gap:var(--scb-select-option-gap, var(--spacing-4));min-height:var(--scb-select-option-min-height, 40px);position:relative;font-size:var(--scb-select-option-font-size, var(--md-sys-typescale-body-large-size));line-height:var(--scb-select-option-line-height, var(--md-sys-typescale-body-large-line-height));letter-spacing:var(--scb-select-option-letter-spacing, var(--md-sys-typescale-body-large-tracking))}.label{min-width:0;flex:1 1 auto}md-icon{font-size:var(--scb-select-option-icon-size, var(--icon-size-medium, 24px));line-height:1;flex:0 0 auto}md-focus-ring{border-radius:var(--md-sys-shape-corner-small)}.item.checked{background-color:var(--md-sys-color-secondary-container)}:host([no-highlight-selected]) .item.checked{background-color:transparent}md-icon.radio-checked{color:var(--md-sys-color-primary)}`,n);t([o({type:String})],e.prototype,"value",void 0);t([o({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);t([o({type:Boolean})],e.prototype,"showCheckbox",void 0);t([o({type:Boolean})],e.prototype,"checked",void 0);t([o({type:Boolean})],e.prototype,"showRadio",void 0);t([o({type:String})],e.prototype,"label",void 0);t([o({type:Boolean,attribute:"no-highlight-selected",reflect:!0})],e.prototype,"noHighlightSelected",void 0);e=t([m("scb-select-option")],e);