@sbb-esta/lyne-elements 5.2.0 → 5.4.0

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 (42) hide show
  1. package/_index.scss +1 -0
  2. package/autocomplete.pure.js +1 -1
  3. package/calendar.pure.js +1 -1
  4. package/carousel.pure.js +1 -1
  5. package/chip.pure.js +1 -1
  6. package/core/styles/_theme.scss +5 -0
  7. package/core.js +16 -16
  8. package/custom-elements.json +1527 -154
  9. package/development/chip/chip-group/chip-group.component.d.ts +2 -1
  10. package/development/chip.pure.js +3 -0
  11. package/development/core/i18n/i18n.d.ts +2 -0
  12. package/development/core.js +13 -1
  13. package/development/download/download/download.component.d.ts +51 -0
  14. package/development/download/download-info/download-info.component.d.ts +59 -0
  15. package/development/download.d.ts +1 -0
  16. package/development/download.js +10 -0
  17. package/development/download.pure.d.ts +3 -0
  18. package/development/download.pure.js +436 -0
  19. package/development/flip-card.pure.js +5 -4
  20. package/development/overlay.pure.js +1 -1
  21. package/development/popover.pure.js +1 -1
  22. package/download/_download.global.scss +12 -0
  23. package/download.js +1 -0
  24. package/download.pure.js +21 -0
  25. package/expansion-panel.pure.js +1 -1
  26. package/flip-card.pure.js +1 -1
  27. package/index.d.ts +3 -0
  28. package/index.js +3 -0
  29. package/lean-off-brand-theme.css +6 -4
  30. package/lean-safety-theme.css +6 -4
  31. package/lean-theme.css +6 -4
  32. package/off-brand-theme.css +6 -4
  33. package/overlay/_overlay.global.scss +0 -4
  34. package/overlay.pure.js +1 -1
  35. package/package.json +11 -1
  36. package/popover.pure.js +2 -2
  37. package/safety-theme.css +6 -4
  38. package/selection-expansion-panel.pure.js +1 -1
  39. package/sidebar.pure.js +1 -1
  40. package/standard-theme.css +6 -4
  41. package/toggle.pure.js +1 -1
  42. package/tooltip.pure.js +1 -1
package/_index.scss CHANGED
@@ -15,6 +15,7 @@
15
15
  @forward './container/container.global' as container-*;
16
16
  @forward './dialog/dialog.global' as dialog-*;
17
17
  @forward './divider/divider.global' as divider-*;
18
+ @forward './download/download.global' as download-*;
18
19
  @forward './expansion-panel/expansion-panel.global' as expansion-panel-*;
19
20
  @forward './file-selector/file-selector.global' as file-selector-*;
20
21
  @forward './flip-card/flip-card.global' as flip-card-*;
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{ResizeController as n}from"@lit-labs/observers/resize-controller.js";import{html as ee,isServer as r,nothing as i,unsafeCSS as a}from"lit";import{property as o}from"lit/decorators.js";import{ref as te}from"lit/directives/ref.js";import{SbbEscapableOverlayController as s,SbbNegativeMixin as c,SbbOpenCloseBaseElement as l,SbbPropertyWatcherController as u,forceType as d,getNextElementIndex as f,idReference as p,isEventOnElement as m,isSafari as h,isZeroAnimationDuration as g,popoverResetStyles as _,removeAriaComboBoxAttributes as v,scrollbarStyles as y,setAriaComboBoxAttributes as b,setOverlayPosition as x}from"./core.js";import{optionPanelStyles as S}from"./option.pure.js";var C=`:host{display:none}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){display:block}
2
- `;const w=h;var T=class extends Event{get option(){return this._option}constructor(e){super(`inputAutocomplete`,{bubbles:!0,composed:!0}),this._option=e}};let E=(()=>{let f=c(l),h,b=[],E=[],D,O=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[],z,B=[],V=[],H,U=[],W=[],G,K=[],q=[],J,Y=[],X=[],Z,Q=[],$=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;h=[p(),o()],D=[p(),o()],A=[d(),o({attribute:`preserve-icon-space`,reflect:!0,type:Boolean})],N=[d(),o({attribute:`auto-active-first-option`,type:Boolean})],I=[o({attribute:!1})],z=[o({reflect:!0})],H=[d(),o({attribute:`auto-select-active-option`,type:Boolean})],G=[d(),o({attribute:`auto-select-active-option-on-blur`,type:Boolean})],J=[d(),o({attribute:`require-selection`,type:Boolean})],Z=[o()],e(this,null,h,{kind:`accessor`,name:`origin`,static:!1,private:!1,access:{has:e=>`origin`in e,get:e=>e.origin,set:(e,t)=>{e.origin=t}},metadata:t},b,E),e(this,null,D,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`preserveIconSpace`,static:!1,private:!1,access:{has:e=>`preserveIconSpace`in e,get:e=>e.preserveIconSpace,set:(e,t)=>{e.preserveIconSpace=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`autoActiveFirstOption`,static:!1,private:!1,access:{has:e=>`autoActiveFirstOption`in e,get:e=>e.autoActiveFirstOption,set:(e,t)=>{e.autoActiveFirstOption=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},L,R),e(this,null,z,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},B,V),e(this,null,H,{kind:`accessor`,name:`autoSelectActiveOption`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOption`in e,get:e=>e.autoSelectActiveOption,set:(e,t)=>{e.autoSelectActiveOption=t}},metadata:t},U,W),e(this,null,G,{kind:`accessor`,name:`autoSelectActiveOptionOnBlur`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOptionOnBlur`in e,get:e=>e.autoSelectActiveOptionOnBlur,set:(e,t)=>{e.autoSelectActiveOptionOnBlur=t}},metadata:t},K,q),e(this,null,J,{kind:`accessor`,name:`requireSelection`,static:!1,private:!1,access:{has:e=>`requireSelection`in e,get:e=>e.requireSelection,set:(e,t)=>{e.requireSelection=t}},metadata:t},Y,X),e(this,null,Z,{kind:`accessor`,name:`position`,static:!1,private:!1,access:{has:e=>`position`in e,get:e=>e.position,set:(e,t)=>{e.position=t}},metadata:t},Q,$),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[_,y,S,a(C)]}#e;get origin(){return this.#e}set origin(e){this.#e=e}#t;get trigger(){return this.#t}set trigger(e){this.#t=e}#n;get preserveIconSpace(){return this.#n}set preserveIconSpace(e){this.#n=e}#r;get autoActiveFirstOption(){return this.#r}set autoActiveFirstOption(e){this.#r=e}#i;get displayWith(){return this.#i}set displayWith(e){this.#i=e}#a;get size(){return this.#a}set size(e){this.#a=e}#o;get autoSelectActiveOption(){return this.#o}set autoSelectActiveOption(e){this.#o=e}#s;get autoSelectActiveOptionOnBlur(){return this.#s}set autoSelectActiveOptionOnBlur(e){this.#s=e}#c;get requireSelection(){return this.#c}set requireSelection(e){this.#c=e}#l;get position(){return this.#l}set position(e){this.#l=e}get originElement(){return this.origin??this.closest?.(`sbb-form-field`)?.shadowRoot?.querySelector?.(`#overlay-anchor`)??this.trigger??null}get triggerElement(){return this._triggerElement??null}constructor(){super(),this.#e=t(this,b,null),this.#t=(t(this,E),t(this,O,null)),this.#n=(t(this,k),t(this,j,!1)),this.#r=(t(this,M),t(this,P,!1)),this.#i=(t(this,F),t(this,L,null)),this.#a=(t(this,R),t(this,B,null)),this.#o=(t(this,V),t(this,U,!1)),this.#s=(t(this,W),t(this,K,!1)),this.#c=(t(this,q),t(this,Y,!1)),this.#l=(t(this,X),t(this,Q,`auto`)),this._triggerElement=t(this,$),this.activeOption=null,this.pendingAutoSelectedOption=null,this._resizeObserver=new n(this,{target:null,skipInitial:!0,callback:(()=>{let e;return()=>{clearTimeout(e),e=setTimeout(()=>{this.state!==`closed`&&this._setOverlayPosition()},10)}})()}),this._triggerAttributeObserver=r?null:new MutationObserver(e=>{let t=e[0].target;(t.hasAttribute(`disabled`)||t.hasAttribute(`readonly`))&&this.close()}),this._isPointerDownEventOnMenu=!1,this._escapableOverlayController=new s(this),this._optionsCount=0,this._lastUserInput=null,this._isCustomChangeEvent=!1,this._pointerDownListener=e=>{this._isPointerDownEventOnMenu=m(this._overlay,e)},this._closeOnBackdropClick=e=>{!this._isPointerDownEventOnMenu&&!m(this._overlay,e)&&!m(this.originElement,e)&&this.close()},this.addEventListener?.(`optionselected`,e=>this.onOptionSelected(e)),this.addEventListener?.(`ɵoptgroupslotchange`,()=>this._handleSlotchange(),{capture:!0}),this.addController(new u(this,()=>this.closest(`sbb-form-field`),{negative:e=>{this.negative=e.negative,this.syncNegative()},borderless:e=>this.toggleState(`option-panel-origin-borderless`,e.borderless)}))}open(){if(this.state===`opening`||this.state===`opened`||!this._overlay||this.options.length===0||this._readonly()||!this.dispatchBeforeOpenEvent())return;this.showPopover?.(),this.state=`opening`,this.triggerElement?.toggleAttribute(`data-expanded`,!0);let e=this.originElement;if(!e)throw Error(`Cannot find the origin element. Please specify a valid element or check the usage of the "origin" property from the documentation`);this._setOverlayPosition(e),this._setNextActiveOptionIfAutoActiveFirstOption(),this._attachOpenPanelEvents(),this._escapableOverlayController.connect(),this._isZeroAnimationDuration()&&this._handleOpening()}close(){this.state===`closing`||this.state===`closed`||!this.dispatchBeforeCloseEvent()||(this.pendingAutoSelectedOption&&(this.pendingAutoSelectedOption.selected=!0,this._setValueAndDispatchEvents(this.pendingAutoSelectedOption,!0)),this.state=`closing`,this.triggerElement?.removeAttribute(`data-expanded`),this._openPanelEventsController.abort(),this.originElement&&this._resizeObserver.unobserve(this.originElement),this._isZeroAnimationDuration()&&this._handleClosing())}_isZeroAnimationDuration(){return g(this,`--sbb-options-panel-animation-duration`)}connectedCallback(){this.popover=`manual`,super.connectedCallback(),w&&(this.id||=this.overlayId),this.hasUpdated&&this._componentSetup(),this.syncNegative()}willUpdate(e){super.willUpdate(e),e.has(`negative`)&&this.syncNegative(),e.has(`autoActiveFirstOption`)&&this.isOpen&&this._setNextActiveOptionIfAutoActiveFirstOption()}firstUpdated(e){super.firstUpdated(e),this._componentSetup()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openPanelEventsController?.abort()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!(r||!this.hasUpdated)&&(!e||e===`trigger`?this._configureTrigger():(!e||e===`origin`)&&this.isOpen&&this._setOverlayPosition())}onOptionSelected(e){let t=e.target;this._setValueAndDispatchEvents(t),this.close()}setPendingSelection(e){this.pendingAutoSelectedOption=e,this._setInputValue(e)}_setValueAndDispatchEvents(e,t=!1){this.options.filter(t=>t!==e&&t.selected).forEach(e=>e.selected=!1),this.pendingAutoSelectedOption=null,this.triggerElement&&(this._setInputValue(e),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this._lastUserInput=null,this.triggerElement.dispatchEvent(new T(e)),t||this.triggerElement.focus())}_setInputValue(e){if(!this.triggerElement)return;let t=this.displayWith?.(e.value)??e.value;Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,t)}_handleSlotchange(){this._highlightOptions(this.triggerElement?.value);let e=Array.from(this.querySelectorAll(`*`));this._previousElements?.forEach(e=>this._resizeObserver.unobserve(e)),this._previousElements=e,this._previousElements.forEach(e=>this._resizeObserver.observe(e)),this.isOpen?(this._setOverlayPosition(),this._setNextActiveOptionIfAutoActiveFirstOption(),this._optionsCount>0&&this.options.length===0&&this.close()):document?.activeElement===this.triggerElement&&this._optionsCount===0&&this.options.length>0&&this.open(),this._optionsCount=this.options.length}_setNextActiveOptionIfAutoActiveFirstOption(){this.autoActiveFirstOption&&(this.resetActiveElement(),this.setNextActiveOption())}_readonly(){return this.triggerElement?.hasAttribute(`readonly`)??!1}_componentSetup(){r||this._configureTrigger()}_configureTrigger(){let e=this.trigger??this.closest?.(`sbb-form-field`)?.querySelector(`input`);if(e===this.triggerElement||(this._triggerAbortController?.abort(),v(this.triggerElement),this.triggerElement?.removeAttribute(`data-expanded`),this._triggerElement=e,!this.triggerElement))return;let t=this.originElement;this.triggerElement===t&&this.isOpen&&this._setOverlayPosition(t),this._triggerAttributeObserver?.observe(this.triggerElement,{attributes:!0,attributeFilter:[`disabled`,`readonly`]}),this.setTriggerAttributes(this.triggerElement),this._triggerAbortController=new AbortController,this.triggerElement.addEventListener(`focus`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`click`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`input`,e=>{let t=e.target.value;t&&e.isTrusted&&this.open(),this._highlightOptions(t),this._lastUserInput=t,this.pendingAutoSelectedOption=null},{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`change`,e=>{this.requireSelection&&!this._isCustomChangeEvent&&e.stopImmediatePropagation(),this._isCustomChangeEvent=!1},{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`keydown`,e=>this._closedPanelKeyboardInteraction(e),{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`blur`,e=>{this.contains(e.relatedTarget)||(this.autoSelectActiveOptionOnBlur&&this.activeOption&&this._lastUserInput&&this.triggerElement?.value&&(this.activeOption.selected=!0,this._setValueAndDispatchEvents(this.activeOption,!0)),this.requireSelection&&this.triggerElement&&this._lastUserInput!=null&&!this.pendingAutoSelectedOption&&(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,``),this._highlightOptions(``),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))),this.close())},{signal:this._triggerAbortController.signal,capture:!0})}_setOverlayPosition(e=this.originElement){e&&x(this._overlay,e,this._overlay,this.shadowRoot.querySelector(`.sbb-option-panel__overlay-container`),this,this.position)}_onAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_handleOpening(){this.state=`opened`,this.originElement&&this._resizeObserver.observe(this.originElement),this.triggerElement?.setAttribute(`aria-expanded`,`true`),this.dispatchOpenEvent()}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.triggerElement?.setAttribute(`aria-expanded`,`false`),this.resetActiveElement(),this._overlay.scrollTop=0,this._escapableOverlayController.disconnect(),this.dispatchCloseEvent()}_attachOpenPanelEvents(){this._openPanelEventsController=new AbortController,document.addEventListener(`scroll`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerdown`,e=>this._pointerDownListener(e),{signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerup`,e=>this._closeOnBackdropClick(e),{signal:this._openPanelEventsController.signal}),this.addEventListener(`ɵdisabledchange`,()=>{this.activeOption?.disabled&&this.resetActiveElement(),this._setNextActiveOptionIfAutoActiveFirstOption()},{signal:this._openPanelEventsController.signal}),this.triggerElement?.addEventListener(`keydown`,e=>this.openedPanelKeyboardInteraction(e),{signal:this._openPanelEventsController.signal,capture:!0})}_closedPanelKeyboardInteraction(e){if(!(this.state===`opening`||this.state===`opened`))switch(e.key){case`ArrowDown`:case`ArrowUp`:this.open();break}}_highlightOptions(e){e!=null&&this.options.forEach(t=>t.highlight(e))}render(){return ee`
2
+ `;const w=h;var T=class extends Event{get option(){return this._option}constructor(e){super(`inputAutocomplete`,{bubbles:!0,composed:!0}),this._option=e}};let E=(()=>{let f=c(l),h,b=[],E=[],D,O=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[],z,B=[],V=[],H,U=[],W=[],G,K=[],q=[],J,Y=[],X=[],Z,Q=[],$=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;h=[p(),o()],D=[p(),o()],A=[d(),o({attribute:`preserve-icon-space`,reflect:!0,type:Boolean})],N=[d(),o({attribute:`auto-active-first-option`,type:Boolean})],I=[o({attribute:!1})],z=[o({reflect:!0})],H=[d(),o({attribute:`auto-select-active-option`,type:Boolean})],G=[d(),o({attribute:`auto-select-active-option-on-blur`,type:Boolean})],J=[d(),o({attribute:`require-selection`,type:Boolean})],Z=[o()],e(this,null,h,{kind:`accessor`,name:`origin`,static:!1,private:!1,access:{has:e=>`origin`in e,get:e=>e.origin,set:(e,t)=>{e.origin=t}},metadata:t},b,E),e(this,null,D,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`preserveIconSpace`,static:!1,private:!1,access:{has:e=>`preserveIconSpace`in e,get:e=>e.preserveIconSpace,set:(e,t)=>{e.preserveIconSpace=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`autoActiveFirstOption`,static:!1,private:!1,access:{has:e=>`autoActiveFirstOption`in e,get:e=>e.autoActiveFirstOption,set:(e,t)=>{e.autoActiveFirstOption=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},L,R),e(this,null,z,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},B,V),e(this,null,H,{kind:`accessor`,name:`autoSelectActiveOption`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOption`in e,get:e=>e.autoSelectActiveOption,set:(e,t)=>{e.autoSelectActiveOption=t}},metadata:t},U,W),e(this,null,G,{kind:`accessor`,name:`autoSelectActiveOptionOnBlur`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOptionOnBlur`in e,get:e=>e.autoSelectActiveOptionOnBlur,set:(e,t)=>{e.autoSelectActiveOptionOnBlur=t}},metadata:t},K,q),e(this,null,J,{kind:`accessor`,name:`requireSelection`,static:!1,private:!1,access:{has:e=>`requireSelection`in e,get:e=>e.requireSelection,set:(e,t)=>{e.requireSelection=t}},metadata:t},Y,X),e(this,null,Z,{kind:`accessor`,name:`position`,static:!1,private:!1,access:{has:e=>`position`in e,get:e=>e.position,set:(e,t)=>{e.position=t}},metadata:t},Q,$),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[_,y,S,a(C)]}#e;get origin(){return this.#e}set origin(e){this.#e=e}#t;get trigger(){return this.#t}set trigger(e){this.#t=e}#n;get preserveIconSpace(){return this.#n}set preserveIconSpace(e){this.#n=e}#r;get autoActiveFirstOption(){return this.#r}set autoActiveFirstOption(e){this.#r=e}#i;get displayWith(){return this.#i}set displayWith(e){this.#i=e}#a;get size(){return this.#a}set size(e){this.#a=e}#o;get autoSelectActiveOption(){return this.#o}set autoSelectActiveOption(e){this.#o=e}#s;get autoSelectActiveOptionOnBlur(){return this.#s}set autoSelectActiveOptionOnBlur(e){this.#s=e}#c;get requireSelection(){return this.#c}set requireSelection(e){this.#c=e}#l;get position(){return this.#l}set position(e){this.#l=e}get originElement(){return this.origin??this.closest?.(`sbb-form-field`)?.shadowRoot?.querySelector?.(`#overlay-anchor`)??this.trigger??null}get triggerElement(){return this._triggerElement??null}constructor(){super(),this.#e=t(this,b,null),this.#t=(t(this,E),t(this,O,null)),this.#n=(t(this,k),t(this,j,!1)),this.#r=(t(this,M),t(this,P,!1)),this.#i=(t(this,F),t(this,L,null)),this.#a=(t(this,R),t(this,B,null)),this.#o=(t(this,V),t(this,U,!1)),this.#s=(t(this,W),t(this,K,!1)),this.#c=(t(this,q),t(this,Y,!1)),this.#l=(t(this,X),t(this,Q,`auto`)),this._triggerElement=t(this,$),this.activeOption=null,this.pendingAutoSelectedOption=null,this._resizeObserver=new n(this,{target:null,skipInitial:!0,callback:(()=>{let e;return()=>{clearTimeout(e),e=setTimeout(()=>{this.state!==`closed`&&this._setOverlayPosition()},10)}})()}),this._triggerAttributeObserver=r?null:new MutationObserver(e=>{let t=e[0].target;(t.hasAttribute(`disabled`)||t.hasAttribute(`readonly`))&&this.close()}),this._isPointerDownEventOnMenu=!1,this._escapableOverlayController=new s(this),this._optionsCount=0,this._lastUserInput=null,this._isCustomChangeEvent=!1,this._pointerDownListener=e=>{this._isPointerDownEventOnMenu=m(this._overlay,e)},this._closeOnBackdropClick=e=>{!this._isPointerDownEventOnMenu&&!m(this._overlay,e)&&!m(this.originElement,e)&&this.close()},this.addEventListener?.(`optionselected`,e=>this.onOptionSelected(e)),this.addEventListener?.(`ɵoptgroupslotchange`,()=>this._handleSlotchange(),{capture:!0}),this.addController(new u(this,()=>this.closest(`sbb-form-field`),{negative:e=>{this.negative=e.negative,this.syncNegative()},borderless:e=>this.toggleState(`option-panel-origin-borderless`,e.borderless)}))}open(){if(this.state===`opening`||this.state===`opened`||!this._overlay||this.options.length===0||this._readonly()||!this.dispatchBeforeOpenEvent())return;this.showPopover?.(),this.state=`opening`,this.triggerElement?.toggleAttribute(`data-expanded`,!0);let e=this.originElement;if(!e)throw Error(`Cannot find the origin element. Please specify a valid element or check the usage of the "origin" property from the documentation`);this._setOverlayPosition(e),this._setNextActiveOptionIfAutoActiveFirstOption(),this._attachOpenPanelEvents(),this._escapableOverlayController.connect(),this._isZeroAnimationDuration()&&this._handleOpening()}close(){this.state===`closing`||this.state===`closed`||!this.dispatchBeforeCloseEvent()||(this.pendingAutoSelectedOption&&(this.pendingAutoSelectedOption.selected=!0,this._setValueAndDispatchEvents(this.pendingAutoSelectedOption,!0)),this.state=`closing`,this.triggerElement?.removeAttribute(`data-expanded`),this._openPanelEventsController.abort(),this.originElement&&this._resizeObserver.unobserve(this.originElement),this._isZeroAnimationDuration()&&this._handleClosing())}_isZeroAnimationDuration(){return g(this,`--sbb-options-panel-animation-duration`)}connectedCallback(){this.popover=`manual`,super.connectedCallback(),w&&(this.id||=this.overlayId),this.hasUpdated&&this._componentSetup(),this.syncNegative()}willUpdate(e){super.willUpdate(e),e.has(`negative`)&&this.syncNegative(),e.has(`autoActiveFirstOption`)&&this.isOpen&&this._setNextActiveOptionIfAutoActiveFirstOption()}firstUpdated(e){super.firstUpdated(e),this._componentSetup()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openPanelEventsController?.abort()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!(r||!this.hasUpdated)&&(!e||e===`trigger`?this._configureTrigger():(!e||e===`origin`)&&this.isOpen&&this._setOverlayPosition())}onOptionSelected(e){let t=e.target;this._setValueAndDispatchEvents(t),this.close()}setPendingSelection(e){this.pendingAutoSelectedOption=e,this._setInputValue(e)}_setValueAndDispatchEvents(e,t=!1){this.options.filter(t=>t!==e&&t.selected).forEach(e=>e.selected=!1),this.pendingAutoSelectedOption=null,this.triggerElement&&(this._setInputValue(e),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this._lastUserInput=null,this.triggerElement.dispatchEvent(new T(e)),t||this.triggerElement.focus())}_setInputValue(e){if(!this.triggerElement)return;let t=this.displayWith?.(e.value)??e.value;Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,t)}_handleSlotchange(){this._highlightOptions(this.triggerElement?.value);let e=Array.from(this.querySelectorAll(`*`));this._previousElements?.forEach(e=>this._resizeObserver.unobserve(e)),this._previousElements=e,this._previousElements.forEach(e=>this._resizeObserver.observe(e)),this.isOpen?(this._setOverlayPosition(),this._setNextActiveOptionIfAutoActiveFirstOption(),this._optionsCount>0&&this.options.length===0&&this.close()):document?.activeElement===this.triggerElement&&this._optionsCount===0&&this.options.length>0&&this.open(),this._optionsCount=this.options.length}_setNextActiveOptionIfAutoActiveFirstOption(){this.autoActiveFirstOption&&(this.resetActiveElement(),this.setNextActiveOption())}_readonly(){return this.triggerElement?.hasAttribute(`readonly`)??!1}_componentSetup(){r||this._configureTrigger()}_configureTrigger(){let e=this.trigger??this.closest?.(`sbb-form-field`)?.querySelector(`input`);if(e===this.triggerElement||(this._triggerAbortController?.abort(),v(this.triggerElement),this.triggerElement?.removeAttribute(`data-expanded`),this._triggerElement=e,!this.triggerElement))return;let t=this.originElement;this.triggerElement===t&&this.isOpen&&this._setOverlayPosition(t),this._triggerAttributeObserver?.observe(this.triggerElement,{attributes:!0,attributeFilter:[`disabled`,`readonly`]}),this.setTriggerAttributes(this.triggerElement),this._triggerAbortController=new AbortController,this.triggerElement.addEventListener(`focus`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`click`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`input`,e=>{let t=e.target.value;t&&e.isTrusted&&this.open(),this._highlightOptions(t),this._lastUserInput=t,this.pendingAutoSelectedOption=null},{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`change`,e=>{this.requireSelection&&!this._isCustomChangeEvent&&e.stopImmediatePropagation(),this._isCustomChangeEvent=!1},{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`keydown`,e=>this._closedPanelKeyboardInteraction(e),{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`blur`,e=>{this.contains(e.relatedTarget)||(this.autoSelectActiveOptionOnBlur&&this.activeOption&&this._lastUserInput&&this.triggerElement?.value&&(this.activeOption.selected=!0,this._setValueAndDispatchEvents(this.activeOption,!0)),this.requireSelection&&this.triggerElement&&this._lastUserInput!=null&&!this.pendingAutoSelectedOption&&(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,``),this._highlightOptions(``),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))),this.close())},{signal:this._triggerAbortController.signal,capture:!0})}_setOverlayPosition(e=this.originElement){e&&x(this._overlay,e,this._overlay,this.shadowRoot.querySelector(`.sbb-option-panel__overlay-container`),this,this.position)}_onAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_handleOpening(){this.state=`opened`,this.originElement&&this._resizeObserver.observe(this.originElement),this.triggerElement?.setAttribute(`aria-expanded`,`true`),this.dispatchOpenEvent()}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.triggerElement?.setAttribute(`aria-expanded`,`false`),this.resetActiveElement(),this._overlay.scrollTop=0,this._escapableOverlayController.disconnect(),this.dispatchCloseEvent()}_attachOpenPanelEvents(){this._openPanelEventsController=new AbortController,document.addEventListener(`scroll`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerdown`,e=>this._pointerDownListener(e),{signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerup`,e=>this._closeOnBackdropClick(e),{signal:this._openPanelEventsController.signal}),this.addEventListener(`ɵdisabledchange`,()=>{this.activeOption?.disabled&&this.resetActiveElement(),this._setNextActiveOptionIfAutoActiveFirstOption()},{signal:this._openPanelEventsController.signal}),this.triggerElement?.addEventListener(`keydown`,e=>this.openedPanelKeyboardInteraction(e),{signal:this._openPanelEventsController.signal,capture:!0})}_closedPanelKeyboardInteraction(e){if(this.state!==`opening`&&this.state!==`opened`)switch(e.key){case`ArrowDown`:case`ArrowUp`:this.open();break}}_highlightOptions(e){e!=null&&this.options.forEach(t=>t.highlight(e))}render(){return ee`
3
3
  <div class="sbb-option-panel__overlay-container">
4
4
  <div
5
5
  class="sbb-option-panel__overlay ${this.negative?`sbb-scrollbar-negative`:`sbb-scrollbar`}"
package/calendar.pure.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isServer as r,nothing as i,unsafeCSS as a}from"lit";import{property as o,state as s}from"lit/decorators.js";import{MONDAY as c,SbbButtonLikeBaseElement as l,SbbDisabledMixin as u,SbbElement as ee,SbbFormAssociatedMixin as te,SbbLanguageController as d,SbbPropertyWatcherController as f,THURSDAY as ne,TUESDAY as re,WEDNESDAY as ie,buttonResetStyles as ae,defaultDateAdapter as p,forceType as m,handleDistinctChange as oe,i18nCalendarDateSelection as h,i18nCalendarWeekNumber as g,i18nNextMonth as se,i18nNextYear as ce,i18nNextYearRange as le,i18nPreviousMonth as ue,i18nPreviousYear as de,i18nPreviousYearRange as fe,i18nYearMonthSelection as pe,isArrowKeyOrPageKeysPressed as me,plainDate as _,readConfig as v,screenReaderOnlyStyles as he}from"./core.js";import{SbbSecondaryButtonElement as ge}from"./button.pure.js";import{SbbIconElement as _e}from"./icon.pure.js";var y=`:host{--sbb-focus-outline-offset:.125rem;--sbb-calendar-cell-transition-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x));font-size:var(--sbb-calendar-cell-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);cursor:var(--sbb-calendar-cell-cursor);color:var(--sbb-calendar-cell-color);border-radius:calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));margin:var(--sbb-calendar-cell-margin);padding:var(--sbb-calendar-cell-border-width);transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);background-clip:content-box;transition-property:background-color;display:block}:host(:is(sbb-calendar-weekday,sbb-calendar-weeknumber)){--sbb-calendar-cell-font-size:var(--sbb-text-font-size-xs);--sbb-calendar-day-height:var(--sbb-calendar-day-size);color:var(--sbb-calendar-header-color)}:host(:is(sbb-calendar-day,sbb-calendar-weekday,sbb-calendar-weeknumber)){height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width)}:host(:is(:state(current),[state--current])){font-weight:700}:host(:is(:state(selected),[state--selected])){border:var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);padding:0}:host(:disabled){--sbb-calendar-cell-color:var(--sbb-calendar-cell-disabled-color);--sbb-calendar-cell-cursor:unset}:host(:focus-visible){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width)}@media (any-hover:hover){:host(:not(:disabled,:where(:is(:state(active),[state--active]),:active)):hover){background-color:var(--sbb-calendar-cell-background-color-hover)}}@media (any-hover:hover) and (forced-colors:active){:host(:not(:disabled):hover){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style:initial}}:host(:not(:disabled):where(:is(:state(active),[state--active]),:active)){background-color:var(--sbb-calendar-cell-background-color-active)}.sbb-action-base{flex-direction:column;justify-content:center;width:100%;height:100%;display:flex}.sbb-calendar-year,.sbb-calendar-month{height:var(--sbb-calendar-cell-year-month-height);width:var(--sbb-calendar-cell-year-month-width)}:host(:is(:state(crossed-out),[state--crossed-out])) :is(.sbb-calendar-year,.sbb-calendar-month,.sbb-calendar-day__value):after{content:"";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);background-color:var(--sbb-calendar-cell-disabled-color);position:absolute;top:50%;left:50%;translate:-50% -50%;rotate:-45deg}
2
2
  `,b=class extends u(l){static{this.styles=[a(y)]}constructor(){super(),this.dateAdapter=v().datetime?.dateAdapter??p,this.addController(new f(this,()=>this.getParent(),{dateFilter:e=>this.setDisabledFilteredState(e),min:e=>this.setDisabledFilteredState(e),max:e=>this.setDisabledFilteredState(e),value:e=>this.setSelectedState(e)}))}getParent(){return this.getRootNode?.()?.host?.closest(`sbb-calendar`)}formResetCallback(){}formStateRestoreCallback(e,t){}},x=`.sbb-calendar-day{justify-content:var(--sbb-calendar-day-justify-content)}.sbb-calendar-day__value{height:var(--sbb-calendar-day-value-height);justify-content:center;align-items:center;display:flex;position:relative}.sbb-calendar-day__extra{display:var(--sbb-calendar-day-extra-display);height:var(--sbb-calendar-day-extra-height)}::slotted(*){height:var(--sbb-calendar-day-extra-height)}
3
- `;let S=(()=>{let r=b,i=[],c,l;return class extends r{constructor(){super(...arguments),this._value=(t(this,i),null)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;c=[o()],l=[s()],e(this,null,c,{kind:`setter`,name:`slot`,static:!1,private:!1,access:{has:e=>`slot`in e,set:(e,t)=>{e.slot=t}},metadata:t},null,i),e(this,null,l,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-day`}static{this.styles=[a(x)]}set slot(e){super.slot=e,this.value=this.dateAdapter.deserialize(e)}get slot(){return super.slot}set value(e){let t=this.dateAdapter.getValidDateOrNull(this.dateAdapter.deserialize(e));if(t){this._value=t;let e=this.dateAdapter.sameDate(t,this.dateAdapter.today());this.toggleState(`current`,e),this.internals.ariaCurrent=e?`date`:null,this.internals.ariaLabel=this.dateAdapter.getAccessibilityFormatDate(t);let n=this.getParent();n&&(this.setDisabledFilteredState(n),this.setSelectedState(n))}}get value(){return this._value}connectedCallback(){super.connectedCallback(),this.tabIndex=-1}getParent(){return this.closest?.(`sbb-calendar`)??this.getRootNode?.()?.host?.closest(`sbb-calendar`)}setSelectedState(e){let t=!!this.value&&(e.multiple?e.value.some(e=>this.dateAdapter.sameDate(this.value,e)):!!e.value&&this.dateAdapter.compareDate(this.value,e.value)===0);this.toggleState(`selected`,t),this.internals.ariaPressed=String(t)}setDisabledFilteredState(e){let t=!this._isActiveDate(e.dateFilter),n=!this._isDayInRange(e.min,e.max);this.disabled=t||n,this.internals.ariaDisabled=String(this.disabled),this.toggleState(`crossed-out`,t&&!n)}_isActiveDate(e){return e&&this.value?e(this.value):!0}_isDayInRange(e,t){return!e&&!t?!0:this.dateAdapter.sameDate(this.value,this.dateAdapter.clampDate(this.value,e,t))}_handleSlotchange(e){this.internals.ariaDescribedByElements=e.target.assignedElements()}renderTemplate(){return n` <span class="sbb-calendar-day__value" aria-hidden="true">
3
+ `;let S=(()=>{let r=b,i=[],c,l;return class extends r{constructor(){super(...arguments),this._value=(t(this,i),null)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;c=[o()],l=[s()],e(this,null,c,{kind:`setter`,name:`slot`,static:!1,private:!1,access:{has:e=>`slot`in e,set:(e,t)=>{e.slot=t}},metadata:t},null,i),e(this,null,l,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-day`}static{this.styles=[a(x)]}set slot(e){super.slot=e,this.value=this.dateAdapter.deserialize(e)}get slot(){return super.slot}set value(e){let t=this.dateAdapter.getValidDateOrNull(this.dateAdapter.deserialize(e));if(t){this._value=t;let e=this.dateAdapter.sameDate(t,this.dateAdapter.today());this.toggleState(`current`,e),this.internals.ariaCurrent=e?`date`:null,this.internals.ariaLabel=this.dateAdapter.getAccessibilityFormatDate(t);let n=this.getParent();n&&(this.setDisabledFilteredState(n),this.setSelectedState(n))}}get value(){return this._value}connectedCallback(){super.connectedCallback(),this.tabIndex=-1}getParent(){return this.closest?.(`sbb-calendar`)??this.getRootNode?.()?.host?.closest(`sbb-calendar`)}setSelectedState(e){let t=!!this.value&&(e.multiple?e.value.some(e=>this.dateAdapter.sameDate(this.value,e)):!!e.value&&this.dateAdapter.compareDate(this.value,e.value)===0);this.toggleState(`selected`,t),this.internals.ariaPressed=String(t)}setDisabledFilteredState(e){let t=!this._isActiveDate(e.dateFilter),n=!this._isDayInRange(e.min,e.max);this.disabled=t||n,this.internals.ariaDisabled=String(this.disabled),this.toggleState(`crossed-out`,t&&!n)}_isActiveDate(e){return e&&this.value?e(this.value):!0}_isDayInRange(e,t){return!e&&!t||this.dateAdapter.sameDate(this.value,this.dateAdapter.clampDate(this.value,e,t))}_handleSlotchange(e){this.internals.ariaDescribedByElements=e.target.assignedElements()}renderTemplate(){return n` <span class="sbb-calendar-day__value" aria-hidden="true">
4
4
  ${this.dateAdapter.getDate(this.value)}
5
5
  </span>
6
6
  <span class="sbb-calendar-day__extra">
package/carousel.pure.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import{html as e,unsafeCSS as t}from"lit";import{SbbElement as n,SbbLanguageController as r,forceType as i,i18nCarouselArrowsNavigationHint as a,i18nCarouselItemAriaLabel as o,i18nNextSlide as s,i18nPreviousSlide as c,i18nSlide as l,isArrowKeyPressed as u,screenReaderOnlyStyles as d}from"./core.js";import{IntersectionController as f}from"@lit-labs/observers/intersection-controller.js";import{ResizeController as p}from"@lit-labs/observers/resize-controller.js";import{__esDecorate as m,__runInitializers as h}from"tslib";import{property as g}from"lit/decorators.js";var _=`:host{scroll-snap-align:start;flex-shrink:0;display:flex}
2
2
  `,v=class extends Event{get index(){return this._index}constructor(e,{index:t}){super(e,{bubbles:!0,composed:!0}),this._index=t}},y=class extends n{static{this.elementName=`sbb-carousel-item`}static{this.styles=[t(_)]}static{this.events={beforeshow:`beforeshow`,show:`show`}}connectedCallback(){super.connectedCallback(),this.internals.role=`group`,this.internals.ariaRoleDescription=`slide`}render(){return e`<slot></slot>`}},b=`:host{height:var(--sbb-carousel-list-height);width:var(--sbb-carousel-list-width,0);scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;border-radius:var(--sbb-carousel-inherit-border-radius);outline:none;display:flex;overflow-x:auto}:host(:focus-visible):before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width);content:"";height:inherit;width:inherit;border-start-start-radius:var(--sbb-carousel-list-border-radius);border-start-end-radius:var(--sbb-carousel-list-border-radius);border-end-end-radius:var(--sbb-carousel-inherit-border-radius);border-end-start-radius:var(--sbb-carousel-inherit-border-radius);position:absolute}
3
3
  `,x=class extends n{static{this.elementName=`sbb-carousel-list`}static{this.styles=[t(b)]}constructor(){super(),this._currentIndex=0,this._language=new r(this),this._observedCarouselItems=[],this._beforeShowObserver=new f(this,{target:null,callback:e=>{e.filter(e=>e.isIntersecting&&e.target!==this).forEach(e=>{let t=e.target;t.dispatchEvent(new v(`beforeshow`,{index:this._carouselItems().findIndex(e=>e===t)}))})},config:{threshold:.01,root:this,rootMargin:`100% 0% 100% 0%`}}),this._showObserver=new f(this,{target:null,callback:e=>{for(let t of e){if(t.target===this)continue;let e=t.target;t.isIntersecting?(e.ariaHidden=null,this._currentIndex=this._carouselItems().findIndex(t=>t===e),e.dispatchEvent(new v(`show`,{index:this._currentIndex}))):e.ariaHidden=`true`}},config:{threshold:.99,root:this,rootMargin:`100% 0% 100% 0%`}}),this._resizeObserverController=new p(this,{skipInitial:!0,callback:()=>this._readDimensions()}),this.addEventListener?.(`keydown`,e=>this._onKeyDown(e))}_carouselItems(){return Array.from(this.querySelectorAll?.(`sbb-carousel-item`)??[])}_handleSlotchange(){this._observedCarouselItems.forEach(e=>{this._beforeShowObserver.unobserve(e),this._showObserver.unobserve(e)});let e=this._carouselItems();e.forEach((t,n)=>{t.ariaLabel||=o(n+1,e.length)[this._language.current],t.ariaHidden=n===this._currentIndex?null:`true`}),this._readDimensions()}_readDimensions(){let e=this._carouselItems();if(e.length===0)return;let t=e[0];t.clientHeight>0&&this.style.setProperty(`--sbb-carousel-list-height`,`${t.clientHeight}px`),t.clientWidth>0&&(this.style.setProperty(`--sbb-carousel-list-width`,`${t.clientWidth}px`),e.forEach(e=>{this._beforeShowObserver.observe(e),this._showObserver.observe(e)}),this._observedCarouselItems=e,this._resizeObserverController.unobserve(this))}_onKeyDown(e){if(!u(e))return;e.preventDefault();let t=this._currentIndex,n=e.key===`ArrowUp`||e.key===`ArrowLeft`,r=e.key===`ArrowDown`||e.key===`ArrowRight`;n?t=Math.max(0,this._currentIndex-1):r&&(t=Math.min(this._carouselItems().length-1,this._currentIndex+1)),t!==this._currentIndex&&(this._currentIndex=t,this.scrollTo({left:this._carouselItems()[this._currentIndex].offsetLeft-this.offsetLeft}))}connectedCallback(){super.connectedCallback(),this.internals.ariaLive=`polite`,this.internals.ariaAtomic=`true`}render(){return e`<slot @slotchange=${this._handleSlotchange}></slot>`}},S=`:host{border-radius:var(--sbb-carousel-border-radius) var(--sbb-carousel-border-radius) 0 0;display:inline-block;overflow:hidden}:host([shadow]){box-shadow:var(--sbb-carousel-box-shadow);border-radius:var(--sbb-carousel-border-radius)}:host(:not([shadow])) ::slotted(sbb-carousel-list){--sbb-carousel-inherit-border-radius:var(--sbb-carousel-border-radius)}.sbb-carousel{background-color:var(--sbb-carousel-background-color);flex-direction:column;justify-content:center;align-items:center;display:flex}::slotted(sbb-compact-paginator){padding:var(--sbb-carousel-paginator-padding)}
4
- `;let C=(()=>{let o=n,u,f=[],p=[];return class extends o{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;u=[i(),g({reflect:!0,type:Boolean})],m(this,null,u,{kind:`accessor`,name:`shadow`,static:!1,private:!1,access:{has:e=>`shadow`in e,get:e=>e.shadow,set:(e,t)=>{e.shadow=t}},metadata:e},f,p),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.elementName=`sbb-carousel`}static{this.styles=[d,t(S)]}#e;get shadow(){return this.#e}set shadow(e){this.#e=e}constructor(){super(),this.#e=h(this,f,!1),this._paginator=(h(this,p),null),this._abortController=null,this._language=new r(this),this._requestedPageIndexByPaginator=-1,this.addEventListener?.(`show`,e=>{this._requestedPageIndexByPaginator!==-1&&this._requestedPageIndexByPaginator!==e.index||(this._paginator&&e.index!==this._paginator.pageIndex&&(this._paginator.pageIndex=e.index),this._requestedPageIndexByPaginator=-1)})}connectedCallback(){super.connectedCallback(),this.internals.role=`region`,this.internals.ariaLabel=`carousel`,this._setupPaginator()}firstUpdated(e){super.firstUpdated(e),this.internals.ariaDescribedByElements=[this.shadowRoot.querySelector(`#sbb-carousel-arrows-navigation-hint`)]}disconnectedCallback(){super.disconnectedCallback(),this._abortController?.abort()}_handleSlotchange(){let e=Array.from(this.children).find(e=>e.localName===`sbb-compact-paginator`),t=Array.from(this.children).find(e=>e.localName===`sbb-carousel-list`);if(!e||!t)return;let n=t.querySelectorAll(`sbb-carousel-item`);n&&n.length>0&&(e.length=n.length,e.pageSize=1),e.accessibilityNextPageLabel||=s[this._language.current],e.accessibilityPreviousPageLabel||=c[this._language.current],e.accessibilityPageLabel||=l[this._language.current],e!==this._paginator&&(this._paginator=e,this._setupPaginator())}_setupPaginator(){this._abortController?.abort(),this._paginator&&(this._abortController=new AbortController,this._paginator.addEventListener(`click`,()=>this._scrollAtPaginatorChange(),{signal:this._abortController.signal}))}_scrollAtPaginatorChange(){if(!this._paginator)return;this._requestedPageIndexByPaginator=this._paginator.pageIndex;let e=this.querySelector(`sbb-carousel-list`);if(e){let t=e.querySelectorAll(`sbb-carousel-item`)[this._paginator.pageIndex].offsetLeft-this.offsetLeft;(e.clientWidth<=100||Math.abs(e.scrollLeft-t)>50)&&e.scrollTo({left:t})}}render(){return e`
4
+ `;let C=(()=>{let o=n,u,f=[],p=[];return class extends o{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;u=[i(),g({reflect:!0,type:Boolean})],m(this,null,u,{kind:`accessor`,name:`shadow`,static:!1,private:!1,access:{has:e=>`shadow`in e,get:e=>e.shadow,set:(e,t)=>{e.shadow=t}},metadata:e},f,p),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.elementName=`sbb-carousel`}static{this.styles=[d,t(S)]}#e;get shadow(){return this.#e}set shadow(e){this.#e=e}constructor(){super(),this.#e=h(this,f,!1),this._paginator=(h(this,p),null),this._abortController=null,this._language=new r(this),this._requestedPageIndexByPaginator=-1,this.addEventListener?.(`show`,e=>{(this._requestedPageIndexByPaginator===-1||this._requestedPageIndexByPaginator===e.index)&&(this._paginator&&e.index!==this._paginator.pageIndex&&(this._paginator.pageIndex=e.index),this._requestedPageIndexByPaginator=-1)})}connectedCallback(){super.connectedCallback(),this.internals.role=`region`,this.internals.ariaLabel=`carousel`,this._setupPaginator()}firstUpdated(e){super.firstUpdated(e),this.internals.ariaDescribedByElements=[this.shadowRoot.querySelector(`#sbb-carousel-arrows-navigation-hint`)]}disconnectedCallback(){super.disconnectedCallback(),this._abortController?.abort()}_handleSlotchange(){let e=Array.from(this.children).find(e=>e.localName===`sbb-compact-paginator`),t=Array.from(this.children).find(e=>e.localName===`sbb-carousel-list`);if(!e||!t)return;let n=t.querySelectorAll(`sbb-carousel-item`);n&&n.length>0&&(e.length=n.length,e.pageSize=1),e.accessibilityNextPageLabel||=s[this._language.current],e.accessibilityPreviousPageLabel||=c[this._language.current],e.accessibilityPageLabel||=l[this._language.current],e!==this._paginator&&(this._paginator=e,this._setupPaginator())}_setupPaginator(){this._abortController?.abort(),this._paginator&&(this._abortController=new AbortController,this._paginator.addEventListener(`click`,()=>this._scrollAtPaginatorChange(),{signal:this._abortController.signal}))}_scrollAtPaginatorChange(){if(!this._paginator)return;this._requestedPageIndexByPaginator=this._paginator.pageIndex;let e=this.querySelector(`sbb-carousel-list`);if(e){let t=e.querySelectorAll(`sbb-carousel-item`)[this._paginator.pageIndex].offsetLeft-this.offsetLeft;(e.clientWidth<=100||Math.abs(e.scrollLeft-t)>50)&&e.scrollTo({left:t})}}render(){return e`
5
5
  <div class="sbb-carousel">
6
6
  <span class="sbb-screen-reader-only" id="sbb-carousel-arrows-navigation-hint"
7
7
  >${a[this._language.current]}</span
package/chip.pure.js CHANGED
@@ -14,4 +14,4 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
14
14
  </sbb-mini-button>
15
15
  <span class="sbb-screen-reader-only">, ${g[this._language.current]}</span>
16
16
  `}}})();var w=`:host{gap:var(--sbb-chip-group-gap);width:100%;margin-block:var(--sbb-chip-group-margin-block);line-height:var(--sbb-typo-line-height-text);flex-wrap:wrap;align-items:center;display:flex}:host(:is(:is(:state(size-s),[state--size-s]),:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:0}:host(:is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-s)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-s)}:host(:is(:is(:state(size-l),[state--size-l]),:is(:state(size-m),[state--size-m]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-base-lm)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-m)}:host(:is(:state(without-label),[state--without-label]):not(:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block:var(--sbb-chip-group-margin-block-no-label-not-empty)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-m)}:host(:not(:is(:state(without-label),[state--without-label]),:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block:var(--sbb-chip-group-margin-block-with-label-not-empty)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-l)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-l)}::slotted(input){flex:1 1 var(--sbb-chip-group-input-min-width);max-height:1.5rem}::slotted(sbb-chip){max-width:100%}
17
- `,T=class extends Event{constructor(e){super(`chipinputtokenend`,{cancelable:!0,bubbles:!0,composed:!0}),this.origin=e.origin,this.value=e.value,this.label=e.label}setValue(e){this.value=e}setLabel(e){this.label=e}};let E=(()=>{let f=p(o(u(c(s)))),g=[],b,x,S=[],E=[],D,O=[],k=[],A,j=[],M=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;b=[a({type:Array})],x=[a({attribute:!1})],D=[a({attribute:`separator-keys`,type:Array})],A=[m(),a({attribute:`add-on-blur`,type:Boolean})],e(this,null,b,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,g),e(this,null,x,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},S,E),e(this,null,D,{kind:`accessor`,name:`separatorKeys`,static:!1,private:!1,access:{has:e=>`separatorKeys`in e,get:e=>e.separatorKeys,set:(e,t)=>{e.separatorKeys=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`addOnBlur`,static:!1,private:!1,access:{has:e=>`addOnBlur`in e,get:e=>e.addOnBlur,set:(e,t)=>{e.addOnBlur=t}},metadata:t},j,M),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-chip-group`}static{this.role=`listbox`}static{this.styles=[i(w)]}static{this.events={input:`input`,change:`change`,chipinputtokenend:`chipinputtokenend`}}set value(e){e??=[];let t=this.value,n=[...t];for(let t of e)n.includes(t)&&n.splice(n.indexOf(t),1);n.forEach(e=>this._chipElements().find(t=>t.value===e)?.remove());let r=[...e];for(let e of t)r.includes(e)&&r.splice(r.indexOf(e),1);r.forEach(e=>this._createChipElement(e))}get value(){return this._chipElements().map(e=>e.value)}#e;get displayWith(){return this.#e}set displayWith(e){this.#e=e}#t;get separatorKeys(){return this.#t}set separatorKeys(e){this.#t=e}#n;get addOnBlur(){return this.#n}set addOnBlur(e){this.#n=e}constructor(){super(),this.#e=(t(this,g),t(this,S,null)),this.#t=(t(this,E),t(this,O,[`Enter`])),this.#n=(t(this,k),t(this,j,!1)),this._inputAttributeObserver=(t(this,M),r?null:new MutationObserver(()=>this._reactToInputChanges())),this._language=new l(this),this._previousSize=null,this.addEventListener?.(C.events.requestdelete,e=>this._deleteChip(e.target)),this.addEventListener?.(`keydown`,e=>this._onChipKeyDown(e)),this.addController(new d(this,()=>this.closest(`sbb-form-field`),{size:e=>this._updateSize(e.size),label:e=>this._updateLabelState(e),hiddenLabel:e=>this._updateLabelState(e)}))}_updateLabelState(e){this.toggleState(`without-label`,!e.label||e.hiddenLabel)}connectedCallback(){super.connectedCallback(),this._setupComponent()}willUpdate(e){super.willUpdate(e),(e.has(`disabled`)||e.has(`formDisabled`)||e.has(`negative`))&&this._proxyStateToChips()}formResetCallback(){this.value=null}formStateRestoreCallback(e,t){if(!e){this.value=null;return}this._readFormData(e).then(e=>this.value=e)}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}shouldValidate(e){return super.shouldValidate(e)||e===`required`||e===`value`}validate(){super.validate(),this.required&&this.value.length===0?this.setValidityFlag(`valueMissing`,v[this._language.current]):this.removeValidityFlag(`valueMissing`)}_chipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip`)??[])}_enabledChipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip:not([disabled])`)??[])}_setupComponent(){let e=this.querySelector(`input`);e&&e!==this._inputElement&&(this._inputAbortController?.abort(),this._inputAttributeObserver?.disconnect(),this._inputElement=e,this._inputAbortController=new AbortController,this._inputElement.addEventListener(`keydown`,e=>this._onInputKeyDown(e),{signal:this._inputAbortController.signal}),this._inputElement.addEventListener(`blur`,()=>this._onInputBlur(),{signal:this._inputAbortController.signal,capture:!0}),this._inputElement.addEventListener(`inputAutocomplete`,e=>this._createChipFromInput(`autocomplete`,e.option.value),{signal:this._inputAbortController.signal}),this._inputAttributeObserver?.observe(this._inputElement,{attributes:!0,attributeFilter:[`readonly`,`disabled`]})),this.closest(`sbb-form-field`)||this._updateSize(null),this.toggleState(`empty`,this.value.length===0),this._reactToInputChanges(),this._updateInputDescription(),this.updateFormValue()}_onChipKeyDown(e){let t=e.target;if(t.localName===`sbb-chip`){if(y(e)){let n=this._enabledChipElements();n[h(e,n.indexOf(t),n.length)].focus();return}switch(e.key){case`Backspace`:case`Delete`:!t.readOnly&&!t.disabled&&(e.preventDefault(),this._deleteChip(t));break}}}_onInputKeyDown(e){switch(e.key){case`Backspace`:case`ArrowLeft`:this._inputElement.value||this._focusChip();break;case`Enter`:e.preventDefault();break}this.separatorKeys.includes(e.key)&&(e.preventDefault(),this._createChipFromInput(`input`))}_onInputBlur(){this.addOnBlur&&this._createChipFromInput(`input`)}_createChipFromInput(e=`input`,t){let n=t??this._inputElement.value.trim();if(!n)return;let r=new T({origin:e,value:n,label:(t?this.displayWith?.(t):null)??void 0});this.dispatchEvent(r)&&(this._createChipElement(r.value,r.label),this._inputElement.value=``,this._emitInputEvents())}_deleteChip(e){let t=this._enabledChipElements();e.remove(),this._emitInputEvents(),this._focusChip(t.indexOf(e))}_focusChip(e){let t=this._enabledChipElements();if(e!==void 0&&t[e]){t[e].focus();return}if(t.length>0){t[t.length-1].focus();return}this._inputElement?.focus()}_emitInputEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_createChipElement(e,t){if(r)return;let n=document.createElement(`sbb-chip`);n.value=e,n.innerText=t??(e?this.displayWith?.(e):null)??``,this.insertBefore(n,this._inputElement??this.querySelector(`input`))}_reactToInputChanges(){this.disabled=this._inputElement?.disabled??!1,this._proxyStateToChips()}_proxyStateToChips(){this._chipElements().forEach(e=>{e.disabled=this.disabled||this.formDisabled,e.readOnly=this._inputElement?.hasAttribute(`readonly`)??!1,e.negative=this.negative})}_updateSize(e){this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}_updateInputDescription(){this._inputElement&&this._inputElement.setAttribute(`aria-description`,`${_[this._language.current]} ${this.value.length}`)}render(){return n`<slot @slotchange=${this._setupComponent}></slot>`}}})();export{C as SbbChipElement,E as SbbChipGroupElement,T as SbbChipInputTokenEndEvent};
17
+ `,T=class extends Event{constructor(e){super(`chipinputtokenend`,{cancelable:!0,bubbles:!0,composed:!0}),this.origin=e.origin,this.value=e.value,this.label=e.label}setValue(e){this.value=e}setLabel(e){this.label=e}};let E=(()=>{let f=p(o(u(c(s)))),g=[],b,x,S=[],E=[],D,O=[],k=[],A,j=[],M=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;b=[a({type:Array})],x=[a({attribute:!1})],D=[a({attribute:`separator-keys`,type:Array})],A=[m(),a({attribute:`add-on-blur`,type:Boolean})],e(this,null,b,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,g),e(this,null,x,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},S,E),e(this,null,D,{kind:`accessor`,name:`separatorKeys`,static:!1,private:!1,access:{has:e=>`separatorKeys`in e,get:e=>e.separatorKeys,set:(e,t)=>{e.separatorKeys=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`addOnBlur`,static:!1,private:!1,access:{has:e=>`addOnBlur`in e,get:e=>e.addOnBlur,set:(e,t)=>{e.addOnBlur=t}},metadata:t},j,M),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-chip-group`}static{this.elementDependencies=[C]}static{this.role=`listbox`}static{this.styles=[i(w)]}static{this.events={input:`input`,change:`change`,chipinputtokenend:`chipinputtokenend`}}set value(e){e??=[];let t=this.value,n=[...t];for(let t of e)n.includes(t)&&n.splice(n.indexOf(t),1);n.forEach(e=>this._chipElements().find(t=>t.value===e)?.remove());let r=[...e];for(let e of t)r.includes(e)&&r.splice(r.indexOf(e),1);r.forEach(e=>this._createChipElement(e))}get value(){return this._chipElements().map(e=>e.value)}#e;get displayWith(){return this.#e}set displayWith(e){this.#e=e}#t;get separatorKeys(){return this.#t}set separatorKeys(e){this.#t=e}#n;get addOnBlur(){return this.#n}set addOnBlur(e){this.#n=e}constructor(){super(),this.#e=(t(this,g),t(this,S,null)),this.#t=(t(this,E),t(this,O,[`Enter`])),this.#n=(t(this,k),t(this,j,!1)),this._inputAttributeObserver=(t(this,M),r?null:new MutationObserver(()=>this._reactToInputChanges())),this._language=new l(this),this._previousSize=null,this.addEventListener?.(C.events.requestdelete,e=>this._deleteChip(e.target)),this.addEventListener?.(`keydown`,e=>this._onChipKeyDown(e)),this.addController(new d(this,()=>this.closest(`sbb-form-field`),{size:e=>this._updateSize(e.size),label:e=>this._updateLabelState(e),hiddenLabel:e=>this._updateLabelState(e)}))}_updateLabelState(e){this.toggleState(`without-label`,!e.label||e.hiddenLabel)}connectedCallback(){super.connectedCallback(),this._setupComponent()}willUpdate(e){super.willUpdate(e),(e.has(`disabled`)||e.has(`formDisabled`)||e.has(`negative`))&&this._proxyStateToChips()}formResetCallback(){this.value=null}formStateRestoreCallback(e,t){if(!e){this.value=null;return}this._readFormData(e).then(e=>this.value=e)}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}shouldValidate(e){return super.shouldValidate(e)||e===`required`||e===`value`}validate(){super.validate(),this.required&&this.value.length===0?this.setValidityFlag(`valueMissing`,v[this._language.current]):this.removeValidityFlag(`valueMissing`)}_chipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip`)??[])}_enabledChipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip:not([disabled])`)??[])}_setupComponent(){let e=this.querySelector(`input`);e&&e!==this._inputElement&&(this._inputAbortController?.abort(),this._inputAttributeObserver?.disconnect(),this._inputElement=e,this._inputAbortController=new AbortController,this._inputElement.addEventListener(`keydown`,e=>this._onInputKeyDown(e),{signal:this._inputAbortController.signal}),this._inputElement.addEventListener(`blur`,()=>this._onInputBlur(),{signal:this._inputAbortController.signal,capture:!0}),this._inputElement.addEventListener(`inputAutocomplete`,e=>this._createChipFromInput(`autocomplete`,e.option.value),{signal:this._inputAbortController.signal}),this._inputAttributeObserver?.observe(this._inputElement,{attributes:!0,attributeFilter:[`readonly`,`disabled`]})),this.closest(`sbb-form-field`)||this._updateSize(null),this.toggleState(`empty`,this.value.length===0),this._reactToInputChanges(),this._updateInputDescription(),this.updateFormValue()}_onChipKeyDown(e){let t=e.target;if(t.localName===`sbb-chip`){if(y(e)){let n=this._enabledChipElements();n[h(e,n.indexOf(t),n.length)].focus();return}switch(e.key){case`Backspace`:case`Delete`:!t.readOnly&&!t.disabled&&(e.preventDefault(),this._deleteChip(t));break}}}_onInputKeyDown(e){switch(e.key){case`Backspace`:case`ArrowLeft`:this._inputElement.value||this._focusChip();break;case`Enter`:e.preventDefault();break}this.separatorKeys.includes(e.key)&&(e.preventDefault(),this._createChipFromInput(`input`))}_onInputBlur(){this.addOnBlur&&this._createChipFromInput(`input`)}_createChipFromInput(e=`input`,t){let n=t??this._inputElement.value.trim();if(!n)return;let r=new T({origin:e,value:n,label:(t?this.displayWith?.(t):null)??void 0});this.dispatchEvent(r)&&(this._createChipElement(r.value,r.label),this._inputElement.value=``,this._emitInputEvents())}_deleteChip(e){let t=this._enabledChipElements();e.remove(),this._emitInputEvents(),this._focusChip(t.indexOf(e))}_focusChip(e){let t=this._enabledChipElements();if(e!==void 0&&t[e]){t[e].focus();return}if(t.length>0){t[t.length-1].focus();return}this._inputElement?.focus()}_emitInputEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_createChipElement(e,t){if(r)return;let n=document.createElement(`sbb-chip`);n.value=e,n.innerText=t??(e?this.displayWith?.(e):null)??``,this.insertBefore(n,this._inputElement??this.querySelector(`input`))}_reactToInputChanges(){this.disabled=this._inputElement?.disabled??!1,this._proxyStateToChips()}_proxyStateToChips(){this._chipElements().forEach(e=>{e.disabled=this.disabled||this.formDisabled,e.readOnly=this._inputElement?.hasAttribute(`readonly`)??!1,e.negative=this.negative})}_updateSize(e){this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}_updateInputDescription(){this._inputElement&&this._inputElement.setAttribute(`aria-description`,`${_[this._language.current]} ${this.value.length}`)}render(){return n`<slot @slotchange=${this._setupComponent}></slot>`}}})();export{C as SbbChipElement,E as SbbChipGroupElement,T as SbbChipInputTokenEndEvent};
@@ -52,6 +52,9 @@ $theme: 'standard' !default;
52
52
  @use '../../divider/divider.global' as divider with (
53
53
  $theme: $theme
54
54
  );
55
+ @use '../../download/download.global' as download with (
56
+ $theme: $theme
57
+ );
55
58
  @use '../../expansion-panel/expansion-panel.global' as expansion-panel with (
56
59
  $theme: $theme
57
60
  );
@@ -229,6 +232,7 @@ $theme: 'standard' !default;
229
232
  @include container.base;
230
233
  @include dialog.base;
231
234
  @include divider.base;
235
+ @include download.base;
232
236
  @include expansion-panel.base;
233
237
  @include file-selector.base;
234
238
  @include flip-card.base;
@@ -285,6 +289,7 @@ $theme: 'standard' !default;
285
289
  @include breadcrumb.forced-colors;
286
290
  @include calendar.forced-colors;
287
291
  @include card.forced-colors;
292
+ @include download.forced-colors;
288
293
  @include expansion-panel.forced-colors;
289
294
  @include form-field.forced-colors;
290
295
  @include header.forced-colors;