@sky.ui/core 0.0.36 → 0.0.39

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 (35) hide show
  1. package/dist/custom-elements.json +2206 -2140
  2. package/dist/helper/index.js +1 -1
  3. package/dist/helper/utils/color-resolver.d.ts +9 -1
  4. package/dist/helper/utils/color-resolver.js +1 -1
  5. package/dist/helper/utils/color-resolver.js.map +1 -1
  6. package/dist/helper/utils/contrast-color.d.ts +128 -0
  7. package/dist/helper/utils/contrast-color.js +2 -0
  8. package/dist/helper/utils/contrast-color.js.map +1 -0
  9. package/dist/helper/utils/index.d.ts +1 -0
  10. package/dist/helper/utils/index.js +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/sky-alert/sky-alert.js +13 -11
  13. package/dist/sky-alert/sky-alert.js.map +1 -1
  14. package/dist/sky-appbar/sky-appbar.js +6 -5
  15. package/dist/sky-appbar/sky-appbar.js.map +1 -1
  16. package/dist/sky-badge/sky-badge.js +13 -9
  17. package/dist/sky-badge/sky-badge.js.map +1 -1
  18. package/dist/sky-button/sky-button.js +14 -11
  19. package/dist/sky-button/sky-button.js.map +1 -1
  20. package/dist/sky-checkbox/sky-checkbox.js +13 -11
  21. package/dist/sky-checkbox/sky-checkbox.js.map +1 -1
  22. package/dist/sky-chip/sky-chip.js +14 -11
  23. package/dist/sky-chip/sky-chip.js.map +1 -1
  24. package/dist/sky-combobox/sky-combobox.d.ts +13 -3
  25. package/dist/sky-combobox/sky-combobox.js +680 -255
  26. package/dist/sky-combobox/sky-combobox.js.map +1 -1
  27. package/dist/sky-input/sky-input.d.ts +3 -2
  28. package/dist/sky-input/sky-input.js +452 -180
  29. package/dist/sky-input/sky-input.js.map +1 -1
  30. package/dist/sky-radio/sky-radio.d.ts +2 -0
  31. package/dist/sky-radio/sky-radio.js +28 -13
  32. package/dist/sky-radio/sky-radio.js.map +1 -1
  33. package/dist/sky-theme-provider/sky-theme-provider.js +1 -1
  34. package/dist/sky-theme-provider/sky-theme-provider.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{css as t,LitElement as e,html as i}from"lit";import{property as s,state as o,query as r,queryAll as a,queryAssignedElements as n,customElement as l}from"lit/decorators.js";import{unsafeHTML as h}from"lit/directives/unsafe-html.js";import{when as c}from"lit/directives/when.js";import{repeat as d}from"lit/directives/repeat.js";import{classMap as p}from"lit/directives/class-map.js";import{resolveColor as y}from"../helper/utils/color-resolver.js";import{PopoverController as u}from"../helper/controllers/popover-controller.js";import{FormControlBase as v}from"../helper/internals/form-control-base.js";import{SkyIcon as m}from"../sky-icon/sky-icon.js";import{SkyCheckbox as g}from"../sky-checkbox/sky-checkbox.js";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,k=(t,e,i,s)=>{for(var o,r=s>1?void 0:s?b(e,i):e,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&f(e,i,r),r};let x=class extends v{constructor(){super(),this.value="",this.placeholder="Select An Option",this.searchPlaceholder="Search...",this.label="",this._options=[],this.chipSize=20,this.color="primary",this.clearable=!1,this.loading=!1,this.compact=!1,this.disabled=!1,this.searchable=!1,this.multiSelect=!1,this.visibleChips=2,this.selectAll=!1,this._validations=[],this.showErrors=!1,this.errorDisplayMode="single",this.required=!1,this.emitFullObject=!1,this.emittedKey="value",this.displayKey="",this.addOption=!1,this.validationArrayFormat=!1,this.prefix="",this.suffix="",this.prefixColor="",this.suffixColor="",this.justify="flex-start",this.zIndex=11,this.height="200px",this.requiredMessage="Selection is required.",this.readonly=!1,this.enforceMinOneSelection=!1,this.openAbove=!1,this.validationActive=!1,this.invalid=!1,this.variant="default",this.searchQuery="",this.filteredOptions=[],this.focused=!1,this.open=!1,this.selectedItems=[],this.hiddenChipsOpen=!1,this.activeIndex=-1,this.validationErrors=[],this.validationStatus=[],this.hasLeftIcon=!1,this.hasRightIcon=!1,this.optionSlotSet=new Set,this._searchDebounceId=null,this._closeResetId=null,this.dropdownPopover=new u(this,{getAnchor:()=>this.inputWrapperEl,getPopover:()=>this.dropdownEl,cssVarLeft:"--sky-dd-left",cssVarTop:"--sky-dd-top",cssVarWidth:"--sky-dd-width",getPlacement:()=>"bottom",getAlign:()=>"start",getGap:()=>6,getPadding:()=>8,getMatchAnchorWidth:()=>!0,getMaxWidthToViewport:()=>!0,getMaxWidthMode:()=>"cap",getFlip:()=>!0,getFlipOrder:()=>[],getAnimateReposition:()=>!0,getRepositionMs:()=>160,getCloseOnEscape:()=>!0,getCloseOnOutside:()=>!0,getRestoreFocusOnClose:()=>!0,onOpenChange:(t,e)=>{this.open=t,t?(null!=this._closeResetId&&(clearTimeout(this._closeResetId),this._closeResetId=null),this.validationActive=!0,this.filterOptions(),requestAnimationFrame(()=>this.focusOnOpen())):(this.activeIndex=-1,null!=this._closeResetId&&clearTimeout(this._closeResetId),this._closeResetId=setTimeout(()=>{this._closeResetId=null,this.open||(this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions())},x._CLOSE_RESET_MS),this.hiddenChipsOpen=!1,this.hiddenPopover.closePopover("api"))}}),this.hiddenPopover=new u(this,{getAnchor:()=>this.overflowChipEl,getPopover:()=>this.hiddenDropdownEl,cssVarLeft:"--sky-hc-left",cssVarTop:"--sky-hc-top",cssVarWidth:"--sky-hc-width",getPlacement:()=>"bottom",getAlign:()=>"center",getGap:()=>4,getPadding:()=>8,getMatchAnchorWidth:()=>!1,getMaxWidthToViewport:()=>!0,getMaxWidthMode:()=>"cap",getFlip:()=>!0,getFlipOrder:()=>[],getAnimateReposition:()=>!0,getRepositionMs:()=>120,getCloseOnEscape:()=>!0,getCloseOnOutside:()=>!0,getRestoreFocusOnClose:()=>!1,onOpenChange:t=>{this.hiddenChipsOpen=t,t&&this.open&&this.dropdownPopover.closePopover("api")}}),this.refreshOptionSlots=()=>{const t=new Set;this.querySelectorAll('[slot^="option-"]').forEach(e=>{const i=e.slot;i&&t.add(i)}),this.optionSlotSet=t},this.onSearchKeydown=t=>{const{key:e,shiftKey:i}=t;if("Enter"===e)return t.preventDefault(),t.stopPropagation(),void this.commitDropdownEnter();if("ArrowDown"===e||"ArrowUp"===e||"Tab"===e){t.preventDefault(),t.stopPropagation();const i=this.searchable||this.addOption,s=this.multiSelect&&this.selectAll?i?1:0:this.headerRows,o=this.headerRows+Math.max(0,this.filteredOptions.length)-1,r="ArrowUp"===e||"Tab"===e&&t.shiftKey?-1:1;this.activeIndex<s?this.activeIndex=s:this.activeIndex=this.activeIndex+r<s?o:this.activeIndex+r>o?s:this.activeIndex+r,this.scrollActiveItemIntoView()}return"Escape"===e?(t.preventDefault(),t.stopPropagation(),void this.dropdownPopover.closePopover("escape")):void 0},this.handleAddaddOption=t=>{if(t.stopPropagation(),this.disabled||this.readonly)return;if(!this.canAddaddOption())return;const e=this.searchQuery.trim();this.dispatchEvent(new CustomEvent("add-new-option",{detail:{value:e},bubbles:!0,composed:!0})),this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions()},this.onIconSlotChange=()=>{this.hasLeftIcon=(this.iconLeftEls?.length??0)>0,this.hasRightIcon=(this.iconRightEls?.length??0)>0},this.captureDefaultValue("")}get options(){return this._options}set options(t){const e=this._options;this._options=Array.isArray(t)?t:[],this.requestUpdate("options",e)}get validations(){return this._validations}set validations(t){const e=this._validations;this._validations=Array.isArray(t)?t:[],this.requestUpdate("validations",e)}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||(this.tabIndex=this.disabled?-1:0),this.refreshOptionSlots()}firstUpdated(){this.dropdownPopover.refreshTargets(),this.hiddenPopover.refreshTargets()}getFormValue(){if(this.disabled||!this.name)return null;if(this.multiSelect){const t=new FormData;return this.selectedItems.forEach(e=>{const i=this.emitFullObject?JSON.stringify(e):String(this.getOptionValue(e));t.append(this.name,i)}),0===this.selectedItems.length&&this.required&&t.append(this.name,""),t}{if(0===this.selectedItems.length)return"";const t=this.selectedItems[0];return this.emitFullObject?JSON.stringify(t):String(this.getOptionValue(t))}}setValueFromFormState(t){if(null===t||""===t)return this.value=this.multiSelect?[]:"",void(this.selectedItems=[]);if(this.multiSelect){let e=[];if(t instanceof FormData)e=t.getAll(this.name);else if(Array.isArray(t))e=t;else if("string"==typeof t)try{const i=JSON.parse(t);e=Array.isArray(i)?i:[t]}catch{e=[t]}this.setValueFromArray(e)}else{let e="";"string"==typeof t?e=t:t instanceof FormData?e=t.get(this.name)?.toString()||"":Array.isArray(t)&&t.length>0&&(e=t[0].toString()),this.value=e,this.syncSelectedItemsWithValue()}}syncFormValue(){if(!this.name||this.disabled)return void this.internals.setFormValue(null);const t=this.getFormValue();if(null!==t)if(this.multiSelect&&Array.isArray(t)){const e=new FormData;t.forEach(t=>{null!=t&&""!==t&&e.append(this.name,String(t))}),this.internals.setFormValue(e)}else this.internals.setFormValue(t);else this.internals.setFormValue(null)}setValueFromArray(t){const e=Array.isArray(this.options)?this.options:[];this.selectedItems=e.filter(e=>{const i=this.getOptionValue(e),s=this.emitFullObject?JSON.stringify(e):String(i);return t.some(t=>{const e=String(t);if(!this.emitFullObject)return e===s;try{const t=JSON.parse(e);return JSON.stringify(t)===s}catch{return e===s}})}),this.value=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t))}getValidityAnchor(){return this}isEmpty(){return this.multiSelect?0===this.selectedItems.length:0===this.selectedItems.length||!this.value}getNativeControl(){return this.inputWrapperEl||null}getCustomErrorMessage(){return this.validationErrors?.[0]||""}onFormReset(){super.onFormReset(),this.searchQuery="",this.emitSearchQueryChanged(),this.open=!1,this.invalid=!1,this.validationErrors=[],this.validationActive=!1}onFormDisabled(t){this.disabled=t}onFormStateRestore(t){this.setValueFromFormState(t)}toggleSelectAll(){if(this.disabled||this.readonly)return;const t=t=>String(this.getOptionValue(t));if(this.isAllFilteredSelected()){const e=new Set(this.filteredOptions.map(t=>String(this.getOptionValue(t.original)))),i=this.selectedItems.filter(i=>!e.has(t(i)));if(this.enforceMinOneSelection&&0===i.length)return;this.selectedItems=i}else{const e=new Set(this.selectedItems.map(e=>t(e))),i=this.filteredOptions.map(t=>t.original).filter(i=>!e.has(t(i)));this.selectedItems=[...this.selectedItems,...i]}const e=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t));this.value=e,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:e,selectedItems:[...this.selectedItems],emittedValues:e,isFilteredSelection:!!this.searchQuery.trim()},bubbles:!0,composed:!0})),this.syncFormValue(),this.syncValidity(),this.requestUpdate()}isAllFilteredSelected(){if(0===this.filteredOptions.length)return!1;return this.filteredOptions.map(t=>this.getOptionValue(t.original)).every(t=>this.selectedItems.some(e=>this.getOptionValue(e)===t))}truncateText(t,e){return t.length>e?t.slice(0,e)+"...":t}validateInput(){if(!this.validationActive)return;this.validationErrors=[];const t=this.validationArrayFormat?this.selectedItems:this.value;if(this.required&&this.isEmpty())this.validationErrors.push(this.requiredMessage||"Selection is required.");else if(Array.isArray(this.validations)&&this.validations.length)for(const e of this.validations){const i=e(t);!0!==i&&this.validationErrors.push(String(i||"Invalid value."))}this.invalid=this.validationErrors.length>0,this.dispatchEvent(new CustomEvent(this.invalid?"validation-error":"validation-success",{detail:this.invalid?{errors:this.validationErrors}:{value:this.selectedItems},bubbles:!0,composed:!0})),this.syncValidity(),this.requestUpdate()}validateForForm(){if(this.disabled)return"";const t=this.validationArrayFormat?this.selectedItems:this.value;if(Array.isArray(this.validations)&&this.validations.length)for(const e of this.validations){const i=e(t);if(!0!==i)return String(i||"Invalid value.")}return this.enforceMinOneSelection&&this.isEmpty()?this.requiredMessage||"At least one selection is required.":this.required&&this.isEmpty()?this.requiredMessage||"Selection is required.":""}focus(t){super.focus(t),this.searchInputEl?this.searchInputEl.focus(t):this.inputWrapperEl&&this.inputWrapperEl.focus(t)}blur(){this.open&&this.dropdownPopover.closePopover("light-dismiss"),super.blur()}handleFocus(){this.focused=!0,this.validationActive||(this.validationActive=!0)}reset(){this.value=this.multiSelect?[]:"",this.selectedItems=[],this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions(),this.validationErrors=[],this.validationActive=!1,this.open=!1,this.invalid=!1,this.syncFormValue(),this.syncValidity(),this.requestUpdate()}openDropdown(){this.disabled||this.readonly||this.dropdownPopover.openPopover()}closeDropdown(){this.dropdownPopover.closePopover("api")}clearSelection(){this.handleClear()}handleBlur(){this.focused=!1,this.validationActive&&this.validateInput()}updated(t){t.has("color")&&this.style.setProperty("--sky-dropdown-color",y(this.color)),t.has("height")&&this.style.setProperty("--sky-scroll-height",this.height)}willUpdate(t){t.has("value")&&(this.syncSelectedItemsWithValue(),this.syncFormValue(),this.syncValidity()),t.has("options")&&(Array.isArray(this.options)||(this.options=[]),this.syncSelectedItemsWithValue(),this.filterOptions(),this.syncFormValue(),this.syncValidity()),t.has("searchable")&&this.filterOptions(),t.has("searchQuery")&&this.filterOptions(),t.has("validationErrors")&&this.requestUpdate()}syncSelectedItemsWithValue(){const t=Array.isArray(this.options)?this.options:[],e=this.multiSelect&&Array.isArray(this.value)&&0===this.value.length;if(null==this.value||""===this.value||e)return this.selectedItems=[],void(this.value=this.multiSelect?[]:"");if(this.multiSelect&&"string"==typeof this.value)try{const t=JSON.parse(this.value);Array.isArray(t)&&(this.value=t)}catch(t){}const i=t=>{const e=this.getOptionValue(t);return"object"==typeof e?JSON.stringify(e):String(e)};if(this.multiSelect){const e=Array.isArray(this.value)?this.value:[this.value],s=new Set(e.map(t=>this.emitFullObject&&"object"==typeof t?JSON.stringify(t):String(t)));this.selectedItems=t.filter(t=>{const e=this.emitFullObject?JSON.stringify(t):i(t);return s.has(e)}),this.value=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t))}else{const e=this.emitFullObject&&"object"==typeof this.value?JSON.stringify(this.value):String(this.value),s=t.find(t=>(this.emitFullObject?JSON.stringify(t):i(t))===e);this.selectedItems=s?[s]:[],this.value=s?this.emitFullObject?s:this.getOptionValue(s):""}}filterOptions(){const t=Array.isArray(this.options)?this.options:[],e=(t,e)=>{const i=this.getOptionLabel(t);return{original:t,_idx:e,label:i,highlighted:i}};if(!this.searchable||!this.searchQuery.trim())return void(this.filteredOptions=t.map(e));const i=this.searchQuery.toLowerCase();this.filteredOptions=t.map(e).filter(t=>String(t.label).toLowerCase().includes(i)).map(t=>{const e=new RegExp(`(${i})`,"gi");return{...t,highlighted:String(t.label).replace(e,t=>`<span class="highlight">${t}</span>`)}})}emitSearchQueryChanged(){this.dispatchEvent(new CustomEvent("search-query-changed",{detail:{searchQuery:this.searchQuery},bubbles:!0,composed:!0}))}handleInput(t){if(this.disabled||this.readonly)return;this.searchQuery=t.target.value;const e=Array.isArray(this.options)?this.options.length:0,i=this.searchable&&e>x._SEARCH_DEBOUNCE_OPTIONS_THRESHOLD,s=()=>{this.filterOptions(),this.emitSearchQueryChanged()};i?(null!=this._searchDebounceId&&clearTimeout(this._searchDebounceId),this._searchDebounceId=setTimeout(()=>{this._searchDebounceId=null,s()},x._SEARCH_DEBOUNCE_MS)):s()}disconnectedCallback(){super.disconnectedCallback(),null!=this._searchDebounceId&&(clearTimeout(this._searchDebounceId),this._searchDebounceId=null),null!=this._closeResetId&&(clearTimeout(this._closeResetId),this._closeResetId=null)}handleClear(){if(this.disabled||this.readonly)return;const t=this.multiSelect?this.selectedItems.length>0:!!this.value;this.enforceMinOneSelection&&t||(this.value=this.multiSelect?[]:"",this.selectedItems=[],this.searchQuery="",this.emitSearchQueryChanged(),this.open=!1,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:[],isFilteredSelection:!1},bubbles:!0,composed:!0})),this.syncFormValue(),this.syncValidity())}selectOption(t){if(this.disabled||this.readonly)return;const e=t=>this.emitFullObject?t:this.getOptionValue(t),i=t=>{const e=this.getOptionValue(t);return"object"==typeof e?JSON.stringify(e):String(e)},s=""!==this.searchQuery.trim();if(!this.multiSelect){const o=this.selectedItems.length&&i(this.selectedItems[0])===i(t);return o&&this.enforceMinOneSelection?void(this.open=!1):(o?(this.selectedItems=[],this.value=""):(this.selectedItems=[t],this.value=e(t)),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:this.selectedItems,emittedValues:this.selectedItems.map(e),isFilteredSelection:s},bubbles:!0,composed:!0})),this.dropdownPopover.closePopover("api"),this.syncFormValue(),this.syncValidity(),void this.requestUpdate())}const o=this.selectedItems.findIndex(e=>i(e)===i(t));let r;r=o>-1?[...this.selectedItems.slice(0,o),...this.selectedItems.slice(o+1)]:[...this.selectedItems,t],this.enforceMinOneSelection&&0===r.length||(this.selectedItems=r,this.value=r.map(e),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:this.selectedItems,emittedValues:this.value,isFilteredSelection:s},bubbles:!0,composed:!0})),this.syncFormValue(),this.syncValidity(),this.open=!0,this.requestUpdate())}toggleHiddenChips(t){t.stopPropagation(),t.preventDefault(),this.disabled||this.readonly||(this.open&&this.dropdownPopover.closePopover("api"),this.hiddenPopover.toggle())}renderHiddenChipsDropdown(){return i`
1
+ import{unsafeCSS as t,css as e,LitElement as i,html as s,nothing as o}from"lit";import{property as r,state as n,query as a,queryAll as l,queryAssignedElements as h,customElement as d}from"lit/decorators.js";import{unsafeHTML as p}from"lit/directives/unsafe-html.js";import{when as c}from"lit/directives/when.js";import{repeat as u}from"lit/directives/repeat.js";import{classMap as y}from"lit/directives/class-map.js";import{resolveColor as v}from"../helper/utils/color-resolver.js";import{cssOnFillEnhance as m}from"../helper/utils/contrast-color.js";import{PopoverController as g}from"../helper/controllers/popover-controller.js";import{FormControlBase as f}from"../helper/internals/form-control-base.js";import{SkyIcon as b}from"../sky-icon/sky-icon.js";import{SkyCheckbox as k}from"../sky-checkbox/sky-checkbox.js";var w=Object.defineProperty,x=Object.getOwnPropertyDescriptor,I=(t,e,i,s)=>{for(var o,r=s>1?void 0:s?x(e,i):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&w(e,i,r),r};let S=class extends f{constructor(){super(),this.value="",this.placeholder="Select An Option",this.searchPlaceholder="Search...",this.label="",this._options=[],this.chipSize=20,this.color="primary",this.clearable=!1,this.loading=!1,this.compact=!1,this.disabled=!1,this.searchable=!1,this.multiSelect=!1,this.visibleChips=2,this.selectAll=!1,this._validations=[],this.showErrors=!1,this.errorDisplayMode="single",this.required=!1,this.emitFullObject=!1,this.emittedKey="value",this.displayKey="",this.addOption=!1,this.validationArrayFormat=!1,this.prefix="",this.suffix="",this.prefixColor="",this.suffixColor="",this.justify="flex-start",this.zIndex=11,this.height="200px",this.requiredMessage="Selection is required.",this.readonly=!1,this.enforceMinOneSelection=!1,this.openAbove=!1,this.validationActive=!1,this.invalid=!1,this.variant="default",this.multiDisplay="chips",this.searchQuery="",this.filteredOptions=[],this.focused=!1,this.open=!1,this.selectedItems=[],this.hiddenChipsOpen=!1,this.activeIndex=-1,this.validationErrors=[],this.validationStatus=[],this.hasLeftIcon=!1,this.hasRightIcon=!1,this.optionSlotSet=new Set,this._searchDebounceId=null,this._closeResetId=null,this.dropdownPopover=new g(this,{getAnchor:()=>this.inputWrapperEl,getPopover:()=>this.dropdownEl,cssVarLeft:"--sky-dd-left",cssVarTop:"--sky-dd-top",cssVarWidth:"--sky-dd-width",getPlacement:()=>"bottom",getAlign:()=>"start",getGap:()=>6,getPadding:()=>8,getMatchAnchorWidth:()=>!0,getMaxWidthToViewport:()=>!0,getMaxWidthMode:()=>"cap",getFlip:()=>!0,getFlipOrder:()=>[],getAnimateReposition:()=>!0,getRepositionMs:()=>160,getCloseOnEscape:()=>!0,getCloseOnOutside:()=>!0,getRestoreFocusOnClose:()=>!0,onOpenChange:(t,e)=>{this.open=t,t?(this.focused=!0,null!=this._closeResetId&&(clearTimeout(this._closeResetId),this._closeResetId=null),this.validationActive=!0,this.filterOptions(),requestAnimationFrame(()=>this.focusOnOpen())):(this.activeIndex=-1,null!=this._closeResetId&&clearTimeout(this._closeResetId),this._closeResetId=setTimeout(()=>{this._closeResetId=null,this.open||(this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions())},S._CLOSE_RESET_MS),this.hiddenChipsOpen=!1,this.hiddenPopover.closePopover("api"))}}),this.hiddenPopover=new g(this,{getAnchor:()=>this.overflowChipEl,getPopover:()=>this.hiddenDropdownEl,cssVarLeft:"--sky-hc-left",cssVarTop:"--sky-hc-top",cssVarWidth:"--sky-hc-width",getPlacement:()=>"bottom",getAlign:()=>"center",getGap:()=>4,getPadding:()=>8,getMatchAnchorWidth:()=>!1,getMaxWidthToViewport:()=>!0,getMaxWidthMode:()=>"cap",getFlip:()=>!0,getFlipOrder:()=>[],getAnimateReposition:()=>!0,getRepositionMs:()=>120,getCloseOnEscape:()=>!0,getCloseOnOutside:()=>!0,getRestoreFocusOnClose:()=>!1,onOpenChange:t=>{this.hiddenChipsOpen=t,t&&this.open&&this.dropdownPopover.closePopover("api")}}),this.refreshOptionSlots=()=>{const t=new Set;this.querySelectorAll('[slot^="option-"]').forEach(e=>{const i=e.slot;i&&t.add(i)}),this.optionSlotSet=t},this.onSearchKeydown=t=>{const{key:e,shiftKey:i}=t;if("Enter"===e)return t.preventDefault(),t.stopPropagation(),void this.commitDropdownEnter();if("ArrowDown"===e||"ArrowUp"===e||"Tab"===e){t.preventDefault(),t.stopPropagation();const i=this.searchable||this.addOption,s=this.multiSelect&&this.selectAll?i?1:0:this.headerRows,o=this.headerRows+Math.max(0,this.filteredOptions.length)-1,r="ArrowUp"===e||"Tab"===e&&t.shiftKey?-1:1;this.activeIndex<s?this.activeIndex=s:this.activeIndex=this.activeIndex+r<s?o:this.activeIndex+r>o?s:this.activeIndex+r,this.scrollActiveItemIntoView()}return"Escape"===e?(t.preventDefault(),t.stopPropagation(),void this.dropdownPopover.closePopover("escape")):void 0},this.handleAddaddOption=t=>{if(t.stopPropagation(),this.disabled||this.readonly)return;if(!this.canAddaddOption())return;const e=this.searchQuery.trim();this.dispatchEvent(new CustomEvent("add-new-option",{detail:{value:e},bubbles:!0,composed:!0})),this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions()},this.onIconSlotChange=()=>{this.hasLeftIcon=(this.iconLeftEls?.length??0)>0,this.hasRightIcon=(this.iconRightEls?.length??0)>0},this.captureDefaultValue("")}get options(){return this._options}set options(t){const e=this._options;this._options=Array.isArray(t)?t:[],this.requestUpdate("options",e)}get validations(){return this._validations}set validations(t){const e=this._validations;this._validations=Array.isArray(t)?t:[],this.requestUpdate("validations",e)}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||(this.tabIndex=this.disabled?-1:0),this.refreshOptionSlots()}firstUpdated(){this.dropdownPopover.refreshTargets(),this.hiddenPopover.refreshTargets()}getFormValue(){if(this.disabled||!this.name)return null;if(this.multiSelect){const t=new FormData;return this.selectedItems.forEach(e=>{const i=this.emitFullObject?JSON.stringify(e):String(this.getOptionValue(e));t.append(this.name,i)}),0===this.selectedItems.length&&this.required&&t.append(this.name,""),t}{if(0===this.selectedItems.length)return"";const t=this.selectedItems[0];return this.emitFullObject?JSON.stringify(t):String(this.getOptionValue(t))}}setValueFromFormState(t){if(null===t||""===t)return this.value=this.multiSelect?[]:"",void(this.selectedItems=[]);if(this.multiSelect){let e=[];if(t instanceof FormData)e=t.getAll(this.name);else if(Array.isArray(t))e=t;else if("string"==typeof t)try{const i=JSON.parse(t);e=Array.isArray(i)?i:[t]}catch{e=[t]}this.setValueFromArray(e)}else{let e="";"string"==typeof t?e=t:t instanceof FormData?e=t.get(this.name)?.toString()||"":Array.isArray(t)&&t.length>0&&(e=t[0].toString()),this.value=e,this.syncSelectedItemsWithValue()}}syncFormValue(){if(!this.name||this.disabled)return void this.internals.setFormValue(null);const t=this.getFormValue();if(null!==t)if(this.multiSelect&&Array.isArray(t)){const e=new FormData;t.forEach(t=>{null!=t&&""!==t&&e.append(this.name,String(t))}),this.internals.setFormValue(e)}else this.internals.setFormValue(t);else this.internals.setFormValue(null)}setValueFromArray(t){const e=Array.isArray(this.options)?this.options:[];this.selectedItems=e.filter(e=>{const i=this.getOptionValue(e),s=this.emitFullObject?JSON.stringify(e):String(i);return t.some(t=>{const e=String(t);if(!this.emitFullObject)return e===s;try{const t=JSON.parse(e);return JSON.stringify(t)===s}catch{return e===s}})}),this.value=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t))}getValidityAnchor(){return this}isEmpty(){return this.multiSelect?0===this.selectedItems.length:0===this.selectedItems.length||!this.value}getNativeControl(){return this.inputWrapperEl||null}getCustomErrorMessage(){return this.validationErrors?.[0]||""}onFormReset(){super.onFormReset(),this.searchQuery="",this.emitSearchQueryChanged(),this.open=!1,this.invalid=!1,this.validationErrors=[],this.validationActive=!1}onFormDisabled(t){this.disabled=t}onFormStateRestore(t){this.setValueFromFormState(t)}toggleSelectAll(){if(this.disabled||this.readonly)return;const t=t=>String(this.getOptionValue(t));if(this.isAllFilteredSelected()){const e=new Set(this.filteredOptions.map(t=>String(this.getOptionValue(t.original)))),i=this.selectedItems.filter(i=>!e.has(t(i)));if(this.enforceMinOneSelection&&0===i.length)return;this.selectedItems=i}else{const e=new Set(this.selectedItems.map(e=>t(e))),i=this.filteredOptions.map(t=>t.original).filter(i=>!e.has(t(i)));this.selectedItems=[...this.selectedItems,...i]}const e=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t));this.value=e,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:e,selectedItems:[...this.selectedItems],emittedValues:e,isFilteredSelection:!!this.searchQuery.trim()},bubbles:!0,composed:!0})),this.syncFormValue(),this.syncValidity(),this.requestUpdate()}isAllFilteredSelected(){if(0===this.filteredOptions.length)return!1;return this.filteredOptions.map(t=>this.getOptionValue(t.original)).every(t=>this.selectedItems.some(e=>this.getOptionValue(e)===t))}truncateText(t,e){return t.length>e?t.slice(0,e)+"...":t}validateInput(){if(!this.validationActive)return;this.validationErrors=[];const t=this.validationArrayFormat?this.selectedItems:this.value;if(this.required&&this.isEmpty())this.validationErrors.push(this.requiredMessage||"Selection is required.");else if(Array.isArray(this.validations)&&this.validations.length)for(const e of this.validations){const i=e(t);!0!==i&&this.validationErrors.push(String(i||"Invalid value."))}this.invalid=this.validationErrors.length>0,this.dispatchEvent(new CustomEvent(this.invalid?"validation-error":"validation-success",{detail:this.invalid?{errors:this.validationErrors}:{value:this.selectedItems},bubbles:!0,composed:!0})),this.syncValidity(),this.requestUpdate()}validateForForm(){if(this.disabled)return"";const t=this.validationArrayFormat?this.selectedItems:this.value;if(Array.isArray(this.validations)&&this.validations.length)for(const e of this.validations){const i=e(t);if(!0!==i)return String(i||"Invalid value.")}return this.enforceMinOneSelection&&this.isEmpty()?this.requiredMessage||"At least one selection is required.":this.required&&this.isEmpty()?this.requiredMessage||"Selection is required.":""}focus(t){super.focus(t),this.searchInputEl?this.searchInputEl.focus(t):this.inputWrapperEl&&this.inputWrapperEl.focus(t)}blur(){this.open&&this.dropdownPopover.closePopover("light-dismiss"),super.blur()}handleFocus(){this.focused=!0,this.validationActive||(this.validationActive=!0)}reset(){this.value=this.multiSelect?[]:"",this.selectedItems=[],this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions(),this.validationErrors=[],this.validationActive=!1,this.open=!1,this.invalid=!1,this.syncFormValue(),this.syncValidity(),this.requestUpdate()}openDropdown(){this.disabled||this.readonly||this.dropdownPopover.openPopover()}closeDropdown(){this.dropdownPopover.closePopover("api")}clearSelection(){this.handleClear()}handleBlur(){this.open||(this.focused=!1,this.validationActive&&this.validateInput())}updated(t){t.has("color")&&this.style.setProperty("--sky-dropdown-color",v(this.color)),t.has("height")&&this.style.setProperty("--sky-scroll-height",this.height)}willUpdate(t){t.has("value")&&(this.syncSelectedItemsWithValue(),this.syncFormValue(),this.syncValidity()),t.has("options")&&(Array.isArray(this.options)||(this.options=[]),this.syncSelectedItemsWithValue(),this.filterOptions(),this.syncFormValue(),this.syncValidity()),t.has("searchable")&&this.filterOptions(),t.has("searchQuery")&&this.filterOptions(),t.has("validationErrors")&&this.requestUpdate()}syncSelectedItemsWithValue(){const t=Array.isArray(this.options)?this.options:[],e=this.multiSelect&&Array.isArray(this.value)&&0===this.value.length;if(null==this.value||""===this.value||e)return this.selectedItems=[],void(this.value=this.multiSelect?[]:"");if(this.multiSelect&&"string"==typeof this.value)try{const t=JSON.parse(this.value);Array.isArray(t)&&(this.value=t)}catch(t){}const i=t=>{const e=this.getOptionValue(t);return"object"==typeof e?JSON.stringify(e):String(e)};if(this.multiSelect){const e=Array.isArray(this.value)?this.value:[this.value],s=new Set(e.map(t=>this.emitFullObject&&"object"==typeof t?JSON.stringify(t):String(t)));this.selectedItems=t.filter(t=>{const e=this.emitFullObject?JSON.stringify(t):i(t);return s.has(e)}),this.value=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t))}else{const e=this.emitFullObject&&"object"==typeof this.value?JSON.stringify(this.value):String(this.value),s=t.find(t=>(this.emitFullObject?JSON.stringify(t):i(t))===e);this.selectedItems=s?[s]:[],this.value=s?this.emitFullObject?s:this.getOptionValue(s):""}}filterOptions(){const t=Array.isArray(this.options)?this.options:[],e=(t,e)=>{const i=this.getOptionLabel(t);return{original:t,_idx:e,label:i,highlighted:i}};if(!this.searchable||!this.searchQuery.trim())return void(this.filteredOptions=t.map(e));const i=this.searchQuery.toLowerCase();this.filteredOptions=t.map(e).filter(t=>String(t.label).toLowerCase().includes(i)).map(t=>{const e=new RegExp(`(${i})`,"gi");return{...t,highlighted:String(t.label).replace(e,t=>`<span class="highlight">${t}</span>`)}})}emitSearchQueryChanged(){this.dispatchEvent(new CustomEvent("search-query-changed",{detail:{searchQuery:this.searchQuery},bubbles:!0,composed:!0}))}handleInput(t){if(this.disabled||this.readonly)return;this.searchQuery=t.target.value;const e=Array.isArray(this.options)?this.options.length:0,i=this.searchable&&e>S._SEARCH_DEBOUNCE_OPTIONS_THRESHOLD,s=()=>{this.filterOptions(),this.emitSearchQueryChanged()};i?(null!=this._searchDebounceId&&clearTimeout(this._searchDebounceId),this._searchDebounceId=setTimeout(()=>{this._searchDebounceId=null,s()},S._SEARCH_DEBOUNCE_MS)):s()}disconnectedCallback(){super.disconnectedCallback(),null!=this._searchDebounceId&&(clearTimeout(this._searchDebounceId),this._searchDebounceId=null),null!=this._closeResetId&&(clearTimeout(this._closeResetId),this._closeResetId=null)}handleClear(){if(this.disabled||this.readonly)return;const t=this.multiSelect?this.selectedItems.length>0:!!this.value;this.enforceMinOneSelection&&t||(this.value=this.multiSelect?[]:"",this.selectedItems=[],this.searchQuery="",this.emitSearchQueryChanged(),this.open=!1,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:[],isFilteredSelection:!1},bubbles:!0,composed:!0})),this.syncFormValue(),this.syncValidity())}selectOption(t){if(this.disabled||this.readonly)return;const e=t=>this.emitFullObject?t:this.getOptionValue(t),i=t=>{const e=this.getOptionValue(t);return"object"==typeof e?JSON.stringify(e):String(e)},s=""!==this.searchQuery.trim();if(!this.multiSelect){const o=this.selectedItems.length&&i(this.selectedItems[0])===i(t);return o&&this.enforceMinOneSelection?void(this.open=!1):(o?(this.selectedItems=[],this.value=""):(this.selectedItems=[t],this.value=e(t)),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:this.selectedItems,emittedValues:this.selectedItems.map(e),isFilteredSelection:s},bubbles:!0,composed:!0})),this.dropdownPopover.closePopover("api"),this.syncFormValue(),this.syncValidity(),void this.requestUpdate())}const o=this.selectedItems.findIndex(e=>i(e)===i(t));let r;r=o>-1?[...this.selectedItems.slice(0,o),...this.selectedItems.slice(o+1)]:[...this.selectedItems,t],this.enforceMinOneSelection&&0===r.length||(this.selectedItems=r,this.value=r.map(e),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:this.selectedItems,emittedValues:this.value,isFilteredSelection:s},bubbles:!0,composed:!0})),this.syncFormValue(),this.syncValidity(),this.open=!0,this.requestUpdate())}toggleHiddenChips(t){t.stopPropagation(),t.preventDefault(),this.disabled||this.readonly||(this.open&&this.dropdownPopover.closePopover("api"),this.hiddenPopover.toggle())}renderHiddenChipsDropdown(){return s`
2
2
  <div
3
3
  class="hidden-chips-dropdown"
4
4
  part="hidden-chips-dropdown"
@@ -12,7 +12,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
12
12
  z-index: ${this.zIndex};
13
13
  "
14
14
  >
15
- ${d(this.selectedItems.slice(this.visibleChips),t=>String(this.getOptionValue(t)),t=>i`
15
+ ${u(this.selectedItems.slice(this.visibleChips),t=>String(this.getOptionValue(t)),t=>s`
16
16
  <div class="hidden-chip-inner" part="hidden-chip-inner">
17
17
  <span part="hidden-chip-label">
18
18
  ${this.truncateText(String(this.getOptionLabel(t)),this.chipSize)}
@@ -26,19 +26,13 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
26
26
  </div>
27
27
  `)}
28
28
  </div>
29
- `}removeChip(t){if(this.disabled||this.readonly)return;const e=t=>String(this.getOptionValue(t)),i=this.selectedItems.filter(i=>e(i)!==e(t));if(!this.enforceMinOneSelection||0!==i.length){if(this.selectedItems=i,this.selectedItems.length<=this.visibleChips&&this.hiddenPopover.closePopover("api"),this.multiSelect){const t=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t));this.value=t,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:t,selectedItems:[...this.selectedItems],emittedValues:t,isFilteredSelection:!1},bubbles:!0,composed:!0}))}else this.value="",this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:[],isFilteredSelection:!1},bubbles:!0,composed:!0}));this.syncFormValue(),this.syncValidity(),this.validateInput(),this.requestUpdate()}}renderChips(){if(!this.multiSelect&&this.selectedItems.length)return i`
30
- <span class="chip" single-select part="single-select-chip">
31
- <span class="chip-label" part="chip-label"
32
- >${this.getOptionLabel(this.selectedItems[0])}</span
33
- >
34
- </span>
35
- `;const t=Array.isArray(this.selectedItems)?this.selectedItems.slice(0,this.visibleChips):[],e=this.selectedItems.length-this.visibleChips;return i`
36
- ${d(t,t=>String(this.getOptionValue(t)),t=>i`
29
+ `}removeChip(t){if(this.disabled||this.readonly)return;const e=t=>String(this.getOptionValue(t)),i=this.selectedItems.filter(i=>e(i)!==e(t));if(!this.enforceMinOneSelection||0!==i.length){if(this.selectedItems=i,this.selectedItems.length<=this.visibleChips&&this.hiddenPopover.closePopover("api"),this.multiSelect){const t=this.selectedItems.map(t=>this.emitFullObject?t:this.getOptionValue(t));this.value=t,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:t,selectedItems:[...this.selectedItems],emittedValues:t,isFilteredSelection:!1},bubbles:!0,composed:!0}))}else this.value="",this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value,selectedItems:[],isFilteredSelection:!1},bubbles:!0,composed:!0}));this.syncFormValue(),this.syncValidity(),this.validateInput(),this.requestUpdate()}}renderChips(){const t=Array.isArray(this.selectedItems)?this.selectedItems.slice(0,this.visibleChips):[],e=this.selectedItems.length-this.visibleChips;return s`
30
+ ${u(t,t=>String(this.getOptionValue(t)),t=>s`
37
31
  <span class="chip" ?compact=${this.compact} part="chip">
38
32
  <span class="chip-label" part="chip-label"
39
33
  >${this.truncateText(String(this.getOptionLabel(t)),this.chipSize)}</span
40
34
  >
41
- ${c(this.multiSelect,()=>i`
35
+ ${c(this.multiSelect,()=>s`
42
36
  <sky-icon
43
37
  class="remove-chip"
44
38
  part="remove-chip-icon"
@@ -49,7 +43,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
49
43
  `)}
50
44
  </span>
51
45
  `)}
52
- ${c(e>0,()=>i`
46
+ ${c(e>0,()=>s`
53
47
  <span
54
48
  class="chip overflow-chip"
55
49
  part="overflow-chip"
@@ -60,7 +54,26 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
60
54
  + ${e}
61
55
  </span>
62
56
  `)}
63
- `}handleKeydown(t){if(t.target?.closest(".search-container"))return;const{key:e,shiftKey:i}=t;if(!this.open&&("ArrowDown"===e||"ArrowUp"===e||"Enter"===e))return this.dropdownPopover.openPopover(),void t.preventDefault();if(!this.open)return;const s=this.searchable||this.addOption,o=this.multiSelect&&this.selectAll?s?1:0:this.headerRows,r=this.headerRows+Math.max(0,this.filteredOptions.length)-1;if(this.activeIndex<o&&(this.activeIndex=o),"ArrowDown"===e){const e=this.activeIndex<o?o:this.activeIndex;return this.activeIndex=e>=r?o:e+1,this.scrollActiveItemIntoView(),void t.preventDefault()}if("ArrowUp"===e){const e=this.activeIndex<o?o:this.activeIndex;return this.activeIndex=e<=o?r:e-1,this.scrollActiveItemIntoView(),void t.preventDefault()}if("Tab"===e){if(i){const t=this.activeIndex<o?o:this.activeIndex;this.activeIndex=t<=o?r:t-1}else{const t=this.activeIndex<o?o:this.activeIndex;this.activeIndex=t>=r?o:t+1}return this.scrollActiveItemIntoView(),void t.preventDefault()}return"Enter"===e?(t.preventDefault(),t.stopPropagation(),void this.commitDropdownEnter()):this.readonly?void("Escape"===e&&(this.open=!1,t.preventDefault())):"Home"===e?(this.activeIndex=o,this.scrollActiveItemIntoView(),void t.preventDefault()):"End"===e?(this.activeIndex=Math.max(o,r),this.scrollActiveItemIntoView(),void t.preventDefault()):void 0}get headerRows(){let t=0;return(this.searchable||this.addOption)&&(t+=1),this.multiSelect&&this.selectAll&&(t+=1),t}getOptionByActiveIndex(){if(!this.open)return null;const t=this.activeIndex;if(t<0)return null;if((this.searchable||this.addOption)&&0===t)return{kind:"search"};const e=this.searchable||this.addOption?1:0;if(this.multiSelect&&this.selectAll&&t===e)return{kind:"select-all"};const i=t-this.headerRows;return i>=0&&i<this.filteredOptions.length?{kind:"option",optionIndex:i}:null}commitDropdownEnter(){const t=this.getOptionByActiveIndex();if(t)if("search"!==t.kind)if("select-all"!==t.kind){if("option"===t.kind&&"number"==typeof t.optionIndex){const e=this.filteredOptions[t.optionIndex].original;this.selectOption(e)}}else this.toggleSelectAll();else this.addOption&&this.canAddaddOption()?(this.dispatchEvent(new CustomEvent("add-new-option",{detail:{value:this.searchQuery.trim()},bubbles:!0,composed:!0})),this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions()):this.filteredOptions.length>0&&this.selectOption(this.filteredOptions[0].original)}focusOnOpen(){const t=this.searchInputEl;if(t)return document.activeElement!==t&&requestAnimationFrame(()=>t.focus()),this.activeIndex=0,void this.scrollActiveItemIntoView();let e=0;if(this.selectedItems.length>0){const t=this.getOptionValue(this.selectedItems[0]),i=this.filteredOptions.findIndex(e=>this.getOptionValue(e.original)===t);i>=0&&(e=i)}this.activeIndex=this.headerRows+e,this.scrollActiveItemIntoView()}canAddaddOption(){if(!this.addOption)return!1;const t=this.searchQuery.trim();if(!t)return!1;return!(Array.isArray(this.options)?this.options:[]).some(e=>{const i=String(this.getOptionLabel(e)||"").toLowerCase(),s=(this.getOptionValue(e)??"").toString().toLowerCase();return i===t.toLowerCase()||s===t.toLowerCase()})}scrollActiveItemIntoView(){const t=Array.from(this.rowEls).find(t=>Number(t.dataset.rowIndex)===this.activeIndex);t?.scrollIntoView({block:"nearest",behavior:"smooth"})}toggleDropdown(t){t.stopPropagation(),this.disabled||this.readonly||(this.hiddenChipsOpen&&this.hiddenPopover.closePopover("api"),this.validationActive=!0,this.dropdownPopover.toggle())}renderDropdown(){return i`
57
+ `}resolveMultiDisplay(){const t=this.multiDisplay;return"text"===t||"count"===t||"chips"===t?t:"chips"}renderSelectedValue(){if(!this.selectedItems.length)return null;if(!this.multiSelect){const t=String(this.getOptionLabel(this.selectedItems[0]));return s`
58
+ <span
59
+ class="value-summary"
60
+ part="value-summary single-select-chip"
61
+ title=${t}
62
+ >${t}</span
63
+ >
64
+ `}const t=this.resolveMultiDisplay();if("text"===t){const t=this.selectedItems.map(t=>String(this.getOptionLabel(t))).join(", ");return s`
65
+ <span class="value-summary" part="value-summary" title=${t}
66
+ >${t}</span
67
+ >
68
+ `}if("count"===t){const t=this.selectedItems.length,e=String(this.getOptionLabel(this.selectedItems[0])),i=1===t?e:`${e} +${t-1}`,o=this.selectedItems.map(t=>String(this.getOptionLabel(t))).join(", ");return s`
69
+ <span class="value-summary" part="value-summary" title=${o}
70
+ >${i}</span
71
+ >
72
+ `}return s`
73
+ <div class="chip-container" part="chip-container" ?compact=${this.compact}>
74
+ ${this.renderChips()}
75
+ </div>
76
+ `}handleKeydown(t){if(t.target?.closest(".search-container"))return;const{key:e,shiftKey:i}=t;if(!this.open&&("ArrowDown"===e||"ArrowUp"===e||"Enter"===e))return this.dropdownPopover.openPopover(),void t.preventDefault();if(!this.open)return;const s=this.searchable||this.addOption,o=this.multiSelect&&this.selectAll?s?1:0:this.headerRows,r=this.headerRows+Math.max(0,this.filteredOptions.length)-1;if(this.activeIndex<o&&(this.activeIndex=o),"ArrowDown"===e){const e=this.activeIndex<o?o:this.activeIndex;return this.activeIndex=e>=r?o:e+1,this.scrollActiveItemIntoView(),void t.preventDefault()}if("ArrowUp"===e){const e=this.activeIndex<o?o:this.activeIndex;return this.activeIndex=e<=o?r:e-1,this.scrollActiveItemIntoView(),void t.preventDefault()}if("Tab"===e){if(i){const t=this.activeIndex<o?o:this.activeIndex;this.activeIndex=t<=o?r:t-1}else{const t=this.activeIndex<o?o:this.activeIndex;this.activeIndex=t>=r?o:t+1}return this.scrollActiveItemIntoView(),void t.preventDefault()}return"Enter"===e?(t.preventDefault(),t.stopPropagation(),void this.commitDropdownEnter()):this.readonly?void("Escape"===e&&(this.open=!1,t.preventDefault())):"Home"===e?(this.activeIndex=o,this.scrollActiveItemIntoView(),void t.preventDefault()):"End"===e?(this.activeIndex=Math.max(o,r),this.scrollActiveItemIntoView(),void t.preventDefault()):void 0}get headerRows(){let t=0;return(this.searchable||this.addOption)&&(t+=1),this.multiSelect&&this.selectAll&&(t+=1),t}getOptionByActiveIndex(){if(!this.open)return null;const t=this.activeIndex;if(t<0)return null;if((this.searchable||this.addOption)&&0===t)return{kind:"search"};const e=this.searchable||this.addOption?1:0;if(this.multiSelect&&this.selectAll&&t===e)return{kind:"select-all"};const i=t-this.headerRows;return i>=0&&i<this.filteredOptions.length?{kind:"option",optionIndex:i}:null}commitDropdownEnter(){const t=this.getOptionByActiveIndex();if(t)if("search"!==t.kind)if("select-all"!==t.kind){if("option"===t.kind&&"number"==typeof t.optionIndex){const e=this.filteredOptions[t.optionIndex].original;this.selectOption(e)}}else this.toggleSelectAll();else this.addOption&&this.canAddaddOption()?(this.dispatchEvent(new CustomEvent("add-new-option",{detail:{value:this.searchQuery.trim()},bubbles:!0,composed:!0})),this.searchQuery="",this.emitSearchQueryChanged(),this.filterOptions()):this.filteredOptions.length>0&&this.selectOption(this.filteredOptions[0].original)}focusOnOpen(){const t=this.searchInputEl;if(t&&document.activeElement!==t&&requestAnimationFrame(()=>t.focus()),this.filteredOptions.length>0){let t=0;if(this.selectedItems.length>0){const e=this.getOptionValue(this.selectedItems[0]),i=this.filteredOptions.findIndex(t=>this.getOptionValue(t.original)===e);i>=0&&(t=i)}return this.activeIndex=this.headerRows+t,void this.scrollActiveItemIntoView()}this.activeIndex=this.searchable||this.addOption?0:-1}canAddaddOption(){if(!this.addOption)return!1;const t=this.searchQuery.trim();if(!t)return!1;return!(Array.isArray(this.options)?this.options:[]).some(e=>{const i=String(this.getOptionLabel(e)||"").toLowerCase(),s=(this.getOptionValue(e)??"").toString().toLowerCase();return i===t.toLowerCase()||s===t.toLowerCase()})}scrollActiveItemIntoView(){const t=Array.from(this.rowEls).find(t=>Number(t.dataset.rowIndex)===this.activeIndex);t?.scrollIntoView({block:"nearest",behavior:"smooth"})}toggleDropdown(t){t.stopPropagation(),this.disabled||this.readonly||(this.hiddenChipsOpen&&this.hiddenPopover.closePopover("api"),this.validationActive=!0,this.dropdownPopover.toggle())}renderDropdown(){return s`
64
77
  <div
65
78
  class="dropdown"
66
79
  part="dropdown"
@@ -73,7 +86,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
73
86
  min-width: var(--sky-dd-width, 100%);
74
87
  "
75
88
  >
76
- ${c(this.searchable||this.addOption,()=>i`
89
+ ${c(this.searchable||this.addOption,()=>s`
77
90
  <div
78
91
  class="search-container"
79
92
  data-row-index="0"
@@ -96,7 +109,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
96
109
  class="input"
97
110
  />
98
111
 
99
- ${c(this.addOption,()=>i`
112
+ ${c(this.addOption,()=>s`
100
113
  <sky-icon
101
114
  class="new-option-btn"
102
115
  icon="ion:add"
@@ -110,7 +123,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
110
123
  `)}
111
124
 
112
125
  <div class="dropdown-scroller">
113
- ${c(this.multiSelect&&this.selectAll&&this.filteredOptions.length,()=>{const t=this.searchable||this.addOption?1:0,e=p({"dropdown-item":!0,active:this.activeIndex===t,selected:this.isAllFilteredSelected()});return i`
126
+ ${c(this.multiSelect&&this.selectAll&&this.filteredOptions.length,()=>{const t=this.searchable||this.addOption?1:0,e=y({"dropdown-item":!0,active:this.activeIndex===t,selected:this.isAllFilteredSelected()});return s`
114
127
  <div
115
128
  class=${e}
116
129
  data-row-index=${t}
@@ -125,36 +138,37 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
125
138
  Select All
126
139
  </div>
127
140
  `})}
128
- ${c(this.filteredOptions.length>0,()=>d(this.filteredOptions,({original:t,_idx:e})=>`${e}-${String(this.getOptionValue(t))}`,({original:t,highlighted:e,_idx:s},o)=>{const r=`option-${s}`,a=this.optionSlotSet.has(r),n=t=>String(this.getOptionValue(t.original??t)),l=Array.isArray(this.selectedItems)&&this.selectedItems.some(e=>n(e)===n(t)),d=this.headerRows+o,y=d===this.activeIndex,u=p({"dropdown-item":!0,active:y,selected:l});return i`
141
+ ${c(this.filteredOptions.length>0,()=>u(this.filteredOptions,({original:t,_idx:e})=>`${e}-${String(this.getOptionValue(t))}`,({original:t,highlighted:e,_idx:i},o)=>{const r=`option-${i}`,n=this.optionSlotSet.has(r),a=t=>String(this.getOptionValue(t.original??t)),l=Array.isArray(this.selectedItems)&&this.selectedItems.some(e=>a(e)===a(t)),h=this.headerRows+o,d=h===this.activeIndex,u=y({"dropdown-item":!0,active:d,selected:l});return s`
129
142
  <div
130
143
  class=${u}
131
- data-row-index=${d}
144
+ data-row-index=${h}
132
145
  style="justify-content: ${this.justify};"
133
146
  part="option"
134
147
  @click=${()=>this.selectOption(t)}
148
+ @pointerenter=${()=>{this.activeIndex=h}}
135
149
  ?compact=${this.compact}
136
150
  >
137
- ${c(this.multiSelect,()=>i` <sky-checkbox
151
+ ${c(this.multiSelect,()=>s` <sky-checkbox
138
152
  .checked=${l}
139
153
  readonly
140
154
  ></sky-checkbox>`)}
141
- ${c(a,()=>i`
155
+ ${c(n,()=>s`
142
156
  <div style="display: flex; gap: 8px;width:100%">
143
157
  <slot name=${r}>
144
158
  <span
145
159
  class="highlighted-text"
146
160
  part="highlighted-text"
147
- >${h(e)}</span
161
+ >${p(e)}</span
148
162
  >
149
163
  </slot>
150
164
  </div>
151
- `,()=>i`<span
165
+ `,()=>s`<span
152
166
  class="highlighted-text"
153
167
  part="highlighted-text"
154
- >${h(e)}</span
168
+ >${p(e)}</span
155
169
  >`)}
156
170
  </div>
157
- `}),()=>i`<div
171
+ `}),()=>s`<div
158
172
  class="dropdown-item"
159
173
  part="no-options"
160
174
  data-row-index=${this.headerRows}
@@ -163,86 +177,157 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
163
177
  </div>`)}
164
178
  </div>
165
179
  </div>
166
- `}getOptionValue(t){return this.emitFullObject?t:"object"==typeof t&&null!==t?this.emittedKey in t?t[this.emittedKey]:"value"in t?t.value:t:t}getOptionLabel(t){if(!t)return"";if(!Array.isArray(this.options)||this.options,this.displayKey&&"object"==typeof t&&t[this.displayKey])return String(t[this.displayKey]);if("object"==typeof t){const e=Object.values(t).filter(t=>"string"==typeof t);return e.length>0?e[0]:JSON.stringify(t)}return String(t)}renderValidationErrors(){if(!this.showErrors||!this.validationActive)return null;const t=this.getErrorMessages();if(!t.length)return null;const e=`${this.id||"sky-combobox"}-errors`;return i`
180
+ `}getOptionValue(t){return this.emitFullObject?t:"object"==typeof t&&null!==t?this.emittedKey in t?t[this.emittedKey]:"value"in t?t.value:t:t}getOptionLabel(t){if(!t)return"";if(!Array.isArray(this.options)||this.options,this.displayKey&&"object"==typeof t&&t[this.displayKey])return String(t[this.displayKey]);if("object"==typeof t){const e=Object.values(t).filter(t=>"string"==typeof t);return e.length>0?e[0]:JSON.stringify(t)}return String(t)}renderValidationErrors(){if(!this.showErrors||!this.validationActive)return null;const t=this.getErrorMessages();if(!t.length)return null;const e=`${this.id||"sky-combobox"}-errors`;return s`
167
181
  <div class="progress-message">
168
182
  <ul id=${e} class="error-list" part="error-list">
169
- ${d(t,t=>t,t=>i`<li class="error" part="error-item">${t}</li>`)}
183
+ ${u(t,t=>t,t=>s`<li class="error" part="error-item">${t}</li>`)}
170
184
  </ul>
171
185
  </div>
172
- `}getErrorMessages(){const t=Array.isArray(this.validationErrors)?this.validationErrors:[];switch(this.errorDisplayMode){case"single":return t.slice(0,1);case"all":return t;default:return[]}}handleIconClick(t,e){this.dispatchEvent(new CustomEvent("icon-click",{detail:{position:t,event:e},bubbles:!0,composed:!0}))}render(){const t=p({"icon-slot":!0,left:!0,focused:this.focused}),e=p({"icon-slot":!0,right:!0,focused:this.focused}),s=p({"placeholder-label":!0,active:this.selectedItems.length>0});return i`
173
- <div class="combo-box-container" part="combo-box-container">
174
- ${c(this.label,()=>i`<div class="label" part="label">${this.label}</div>`)}
175
- <div
176
- class="input-wrapper"
177
- tabindex="0"
178
- part="input-wrapper"
179
- ?disabled=${this.disabled}
186
+ `}getErrorMessages(){const t=Array.isArray(this.validationErrors)?this.validationErrors:[];switch(this.errorDisplayMode){case"single":return t.slice(0,1);case"all":return t;default:return[]}}handleIconClick(t,e){this.dispatchEvent(new CustomEvent("icon-click",{detail:{position:t,event:e},bubbles:!0,composed:!0}))}render(){const t=y({"icon-slot":!0,left:!0,focused:this.focused}),e=y({"icon-slot":!0,right:!0,focused:this.focused}),i=y({"placeholder-label":!0,active:this.selectedItems.length>0}),r="fieldset"===this.variant,n="inside"===this.variant,a=this.label?r?s`<legend class="label" part="label">${this.label}</legend>`:s`<div class="label" part="label">${this.label}</div>`:null,l=s`
187
+ <div
188
+ class=${t}
189
+ part="icon-slot"
190
+ ?filled=${this.hasLeftIcon}
191
+ @click=${t=>this.handleIconClick("left",t)}
192
+ >
193
+ <slot name="icon-left" @slotchange=${this.onIconSlotChange}></slot>
194
+ </div>
195
+ `,h=c(this.selectedItems.length>0,()=>this.renderSelectedValue(),()=>s`<label
196
+ class=${i}
197
+ part="placeholder-label"
198
+ ?compact=${this.compact}
199
+ >
200
+ <span style="color:${this.prefixColor}">${this.prefix}</span
201
+ >${this.placeholder}<span style="color:${this.suffixColor}"
202
+ >${this.suffix}</span
203
+ >
204
+ </label>`),d=s`
205
+ <div class="field-trailing" part="field-trailing">
206
+ ${c(this.clearable&&!this.enforceMinOneSelection&&(this.value||this.selectedItems.length),()=>s`<sky-icon
207
+ class="clear-button"
208
+ part="clear-button"
209
+ ?compact=${this.compact}
210
+ @click=${t=>{t.stopPropagation(),this.handleClear()}}
211
+ ?loading=${this.loading}
212
+ icon="ion:close"
213
+ ></sky-icon>`)}
214
+ ${c(this.loading,()=>s`<div class="loading-indicator right"></div>`,()=>this.hasRightIcon?s`<div
215
+ part="icon-slot"
216
+ class=${e}
217
+ ?filled=${!0}
218
+ @click=${t=>this.handleIconClick("right",t)}
219
+ >
220
+ <slot
221
+ name="icon-right"
222
+ @slotchange=${this.onIconSlotChange}
223
+ ></slot>
224
+ </div>`:s`<slot
225
+ name="icon-right"
226
+ style="display:none"
227
+ @slotchange=${this.onIconSlotChange}
228
+ ></slot>`)}
229
+ <sky-icon
230
+ class="dropdown-button"
231
+ part="dropdown-button"
180
232
  ?compact=${this.compact}
181
- ?loading=${this.loading}
182
- ?open=${this.open}
183
- ?invalid=${this.invalid}
184
- @click=${t=>{this.disabled||this.readonly||this.toggleDropdown(t)}}
185
- @keydown=${this.handleKeydown}
233
+ @click=${t=>{t.stopPropagation(),this.disabled||this.readonly||this.toggleDropdown(t)}}
234
+ icon=${this.open?"ion:ios-arrow-up":"ion:chevron-down"}
186
235
  >
187
- <!-- Left Icon or Loading Indicator -->
236
+ </sky-icon>
237
+ </div>
238
+ `,p=s`
239
+ ${l}
240
+ <div class="field-main" part="field-main">${h}</div>
241
+ ${this.readonly?o:d}
242
+ `,u=s`
243
+ ${l}
244
+ <div class="input-inside-main">
245
+ ${a}
246
+ <div class="input-inside-row">
247
+ <div class="field-main" part="field-main">${h}</div>
248
+ </div>
249
+ </div>
250
+ ${this.readonly?o:d}
251
+ `,v=n?u:p,m=t=>{this.disabled||this.readonly||this.toggleDropdown(t)},g=this.handleKeydown,f=r?s`
252
+ <fieldset
253
+ class="input-wrapper"
254
+ tabindex="0"
255
+ part="input-wrapper"
256
+ ?disabled=${this.disabled}
257
+ ?compact=${this.compact}
258
+ ?loading=${this.loading}
259
+ ?open=${this.open}
260
+ ?invalid=${this.invalid}
261
+ @click=${m}
262
+ @keydown=${g}
263
+ >
264
+ ${a}
265
+ <div class="input-fieldset-body">${v}</div>
266
+ </fieldset>
267
+ `:s`
188
268
  <div
189
- class=${t}
190
- part="icon-slot"
191
- ?filled=${this.hasLeftIcon}
192
- @click=${t=>this.handleIconClick("left",t)}
269
+ class="input-wrapper"
270
+ tabindex="0"
271
+ part="input-wrapper"
272
+ ?disabled=${this.disabled}
273
+ ?compact=${this.compact}
274
+ ?loading=${this.loading}
275
+ ?open=${this.open}
276
+ ?invalid=${this.invalid}
277
+ @click=${m}
278
+ @keydown=${g}
193
279
  >
194
- <slot name="icon-left" @slotchange=${this.onIconSlotChange}></slot>
280
+ ${v}
195
281
  </div>
196
- ${c(this.selectedItems.length>0,()=>i`
197
- <div
198
- class="chip-container"
199
- part="chip-container"
200
- ?compact=${this.compact}
201
- >
202
- ${this.renderChips()}
203
- </div>
204
- `,()=>i`<label
205
- class=${s}
206
- part="placeholder-label"
207
- ?compact=${this.compact}
208
- >
209
- <span style="color:${this.prefixColor}">${this.prefix}</span
210
- >${this.placeholder}<span style="color:${this.suffixColor}"
211
- >${this.suffix}</span
212
- >
213
- </label>`)}
214
- ${c(this.clearable&&!this.enforceMinOneSelection&&(this.value||this.selectedItems.length),()=>i`<sky-icon
215
- class="clear-button"
216
- part="clear-button"
217
- @click=${this.handleClear}
218
- ?loading=${this.loading}
219
- icon="ion:close"
220
- ></sky-icon>`)}
221
- ${c(this.loading,()=>i`<div class="loading-indicator right"></div>`,()=>i`<div
222
- part="icon-slot"
223
- class=${e}
224
- ?filled=${this.hasRightIcon}
225
- @click=${t=>this.handleIconClick("right",t)}
226
- >
227
- <slot name="icon-right" @slotchange=${this.onIconSlotChange}></slot>
228
- </div>`)}
229
- <sky-icon
230
- class="dropdown-button"
231
- part="dropdown-button"
232
- @click=${t=>{this.disabled||this.readonly||this.toggleDropdown(t)}}
233
- icon=${this.open?"ion:ios-arrow-up":"ion:chevron-down"}
234
- >
235
- </sky-icon>
236
- </div>
282
+ `;return s`
283
+ <div class="combo-box-container" part="combo-box-container">
284
+ ${r||n?o:a}
285
+ ${f}
237
286
  ${this.renderHiddenChipsDropdown()} ${this.renderDropdown()}
238
287
  ${this.renderValidationErrors()}
239
288
  <slot style="display:none" @slotchange=${this.refreshOptionSlots}></slot>
240
289
  </div>
241
- `}};x.dependencies={"sky-icon":m,"sky-checkbox":g},x._SEARCH_DEBOUNCE_MS=150,x._SEARCH_DEBOUNCE_OPTIONS_THRESHOLD=30,x._CLOSE_RESET_MS=250,x.styles=t`
290
+ `}};S.dependencies={"sky-icon":b,"sky-checkbox":k},S._SEARCH_DEBOUNCE_MS=150,S._SEARCH_DEBOUNCE_OPTIONS_THRESHOLD=30,S._CLOSE_RESET_MS=250,S.styles=e`
242
291
  :host {
243
292
  display: block;
244
293
  font-family: var(--sky-font);
245
294
  width: 100%;
295
+ --sky-input-height: 36px;
296
+ --sky-input-height-compact: 28px;
297
+ --sky-input-border-width: 1px;
298
+ --sky-input-pad-x: var(--sky-space-3, 12px);
299
+ --sky-input-pad-x-sm: var(--sky-space-1, 4px);
300
+ --sky-input-pad-x-xs: 0px;
301
+ --sky-input-pad-y: var(--sky-space-1, 4px);
302
+ --sky-input-pad-y-sm: 0px;
303
+ --sky-input-gap: var(--sky-space-1, 4px);
304
+ --sky-input-icon-width: 2rem;
305
+ }
306
+
307
+ :host([compact]) {
308
+ --sky-input-pad-x: var(--sky-space-2, 8px);
309
+ --sky-input-pad-x-sm: var(--sky-space-1, 4px);
310
+ --sky-input-icon-width: 1.75rem;
311
+ }
312
+
313
+ :host([compact]) .combo-box-container > .label {
314
+ font-size: var(--sky-font-size-xs);
315
+ margin-bottom: var(--sky-space-1, 4px);
316
+ line-height: 1.2;
317
+ }
318
+
319
+ :host([compact]) .placeholder-label,
320
+ :host([compact]) .chip[single-select] {
321
+ font-size: var(--sky-font-size-sm);
322
+ }
323
+
324
+ :host([compact]) .icon-slot {
325
+ font-size: var(--sky-font-size-lg);
326
+ }
327
+
328
+ :host([compact]) .clear-button,
329
+ :host([compact]) .dropdown-button {
330
+ font-size: var(--sky-font-size-md);
246
331
  }
247
332
 
248
333
  :host([disabled]) {
@@ -254,30 +339,268 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
254
339
  cursor: default;
255
340
  }
256
341
 
257
- :host([variant="highlight"]) {
258
- .label{
259
- color: var(--sky-dropdown-color);
260
- }
342
+ :host([variant="highlight"]) .label {
343
+ color: var(--sky-dropdown-color);
344
+ }
345
+
346
+ /* Fieldset / legend */
347
+ :host([variant="fieldset"]) {
348
+ overflow: visible;
349
+ padding-block-start: 0;
350
+ }
351
+
352
+ :host([variant="fieldset"]) .combo-box-container {
353
+ overflow: visible;
354
+ }
355
+
356
+ :host([variant="fieldset"]) fieldset.input-wrapper {
357
+ display: block;
358
+ height: auto;
359
+ margin: 0;
360
+ min-inline-size: 0;
361
+ min-width: 0;
362
+ padding: 0;
363
+ overflow: visible;
364
+ background: var(--sky-glass-solid);
365
+ box-shadow: none;
366
+ }
367
+
368
+ :host([variant="fieldset"]) fieldset.input-wrapper[compact] {
369
+ height: auto;
370
+ }
371
+
372
+ :host([variant="fieldset"]) .input-fieldset-body {
373
+ display: flex;
374
+ width: 100%;
375
+ align-items: center;
376
+ box-sizing: border-box;
377
+ height: calc(
378
+ var(--sky-input-height) - 2 * var(--sky-input-border-width)
379
+ );
380
+ min-height: calc(
381
+ var(--sky-input-height) - 2 * var(--sky-input-border-width)
382
+ );
383
+ background: transparent;
384
+ border-radius: inherit;
385
+ flex-wrap: nowrap;
386
+ min-width: 0;
387
+ overflow: hidden;
261
388
  }
262
389
 
263
- .combo-box-container:focus-within .label {
390
+ :host([variant="fieldset"]) fieldset.input-wrapper[compact] .input-fieldset-body {
391
+ height: calc(
392
+ var(--sky-input-height-compact) - 2 * var(--sky-input-border-width)
393
+ );
394
+ min-height: calc(
395
+ var(--sky-input-height-compact) - 2 * var(--sky-input-border-width)
396
+ );
397
+ }
398
+
399
+ /* Multi chips stay single-line; do not grow taller than sky-input */
400
+ :host([variant="fieldset"]) .input-fieldset-body:has(.chip:not([single-select])) {
401
+ height: calc(
402
+ var(--sky-input-height) - 2 * var(--sky-input-border-width)
403
+ );
404
+ min-height: calc(
405
+ var(--sky-input-height) - 2 * var(--sky-input-border-width)
406
+ );
407
+ padding-block: 0;
408
+ }
409
+
410
+ :host([variant="fieldset"][compact])
411
+ .input-fieldset-body:has(.chip:not([single-select])) {
412
+ height: calc(
413
+ var(--sky-input-height-compact) - 2 * var(--sky-input-border-width)
414
+ );
415
+ min-height: calc(
416
+ var(--sky-input-height-compact) - 2 * var(--sky-input-border-width)
417
+ );
418
+ padding-block: 0;
419
+ }
420
+
421
+ :host([variant="fieldset"]) legend.label {
422
+ float: unset;
423
+ width: auto;
424
+ max-width: calc(100% - 2 * var(--sky-input-pad-x));
425
+ margin-inline-start: var(--sky-input-pad-x);
426
+ margin-bottom: 0;
427
+ padding-inline: var(--sky-input-pad-x-sm);
428
+ padding-block: 2px;
429
+ border: none;
430
+ background: transparent;
431
+ background-color: transparent;
432
+ color: var(--sky-text-secondary);
433
+ font-size: var(--sky-font-size-xs);
434
+ line-height: 1.4;
435
+ overflow: visible;
436
+ text-overflow: ellipsis;
437
+ white-space: nowrap;
438
+ pointer-events: none;
439
+ }
440
+
441
+ :host([variant="fieldset"]) .combo-box-container:focus-within legend.label,
442
+ :host([variant="fieldset"]) .input-wrapper[open] legend.label {
264
443
  color: var(--sky-dropdown-color);
265
- font-size: var(--sky-font-size-sm);
266
- transition: all 0.3s ease;
444
+ font-size: var(--sky-font-size-xs);
445
+ }
446
+
447
+ :host([variant="fieldset"]) .input-wrapper::after {
448
+ content: none;
449
+ display: none;
450
+ }
451
+
452
+ :host([variant="fieldset"]) .input-wrapper[open],
453
+ :host([variant="fieldset"]) .input-wrapper:focus-visible {
454
+ border-color: var(--sky-dropdown-color);
455
+ }
456
+
457
+ :host([variant="fieldset"][validationActive]:invalid) .input-wrapper {
458
+ border-color: var(--sky-danger-primary);
459
+ }
460
+
461
+ :host([variant="fieldset"][validationActive]:invalid) legend.label {
462
+ color: var(--sky-danger-primary);
463
+ }
464
+
465
+ :host([variant="fieldset"][compact]) legend.label,
466
+ :host([variant="fieldset"][compact]) .combo-box-container:focus-within legend.label,
467
+ :host([variant="fieldset"][compact]) .input-wrapper[open] legend.label {
468
+ font-size: var(--sky-font-size-xs);
469
+ line-height: 1.4;
470
+ }
471
+
472
+ /* Inside: label in the wrapper above value row — keep tokens in sync with sky-input */
473
+ :host([variant="inside"]) {
474
+ --sky-input-height-inside: 44px;
475
+ --sky-input-height-inside-compact: 40px;
476
+ --sky-input-inside-label-block: 0.15rem;
477
+ --sky-input-inside-value-min: 1.375rem;
478
+ }
479
+
480
+ :host([variant="inside"]) .input-wrapper {
481
+ height: auto;
482
+ min-height: var(--sky-input-height-inside);
483
+ align-items: center;
484
+ padding-block: var(--sky-input-pad-y-sm, 0px);
485
+ overflow: hidden;
486
+ }
487
+
488
+ :host([variant="inside"]) .input-wrapper[compact] {
489
+ height: auto;
490
+ min-height: var(--sky-input-height-inside-compact);
491
+ padding-block: var(--sky-input-pad-y-sm, 0px);
492
+ }
493
+
494
+ :host([variant="inside"]) .input-inside-main {
495
+ flex: 1 1 0%;
496
+ min-width: 0;
497
+ display: flex;
498
+ flex-direction: column;
499
+ justify-content: center;
500
+ gap: 0.15rem;
501
+ padding-block: var(--sky-input-inside-label-block);
502
+ padding-inline: 0;
503
+ overflow: hidden;
504
+ }
505
+
506
+ :host([variant="inside"]) .input-inside-main > .label {
507
+ margin: 0;
508
+ padding-inline: var(--sky-input-pad-x);
509
+ font-size: var(--sky-font-size-xs);
510
+ line-height: 1.3;
511
+ min-height: calc(var(--sky-font-size-xs) * 1.3);
512
+ color: var(--sky-text-secondary);
513
+ pointer-events: none;
514
+ overflow: hidden;
515
+ text-overflow: ellipsis;
516
+ white-space: nowrap;
517
+ flex: 0 0 auto;
518
+ }
519
+
520
+ :host([variant="inside"][compact]) .input-inside-main > .label {
521
+ font-size: 0.6875rem;
522
+ line-height: 1.3;
523
+ min-height: calc(0.6875rem * 1.3);
524
+ }
525
+
526
+ :host([variant="inside"]) .combo-box-container:focus-within .input-inside-main > .label,
527
+ :host([variant="inside"]) .input-wrapper[open] .input-inside-main > .label {
528
+ color: var(--sky-dropdown-color);
529
+ font-size: var(--sky-font-size-xs);
530
+ }
531
+
532
+ :host([variant="inside"][compact]) .combo-box-container:focus-within .input-inside-main > .label,
533
+ :host([variant="inside"][compact]) .input-wrapper[open] .input-inside-main > .label {
534
+ font-size: 0.6875rem;
535
+ }
536
+
537
+ :host([variant="inside"][validationActive]:invalid) .input-inside-main > .label {
538
+ color: var(--sky-danger-primary);
539
+ }
540
+
541
+ :host([variant="inside"]) .input-inside-row {
542
+ display: flex;
543
+ align-items: center;
544
+ min-width: 0;
545
+ width: 100%;
546
+ min-height: var(--sky-input-inside-value-min);
547
+ gap: 0;
548
+ overflow: hidden;
549
+ flex: 0 0 auto;
550
+ }
551
+
552
+ /* Match sky-input: label + value share pad-x; zero start when left icon present */
553
+ :host([variant="inside"]) .input-inside-main > .label,
554
+ :host([variant="inside"]) .chip-container,
555
+ :host([variant="inside"]) .value-summary,
556
+ :host([variant="inside"]) .placeholder-label {
557
+ padding-inline-start: var(--sky-input-pad-x);
558
+ padding-inline-end: var(--sky-input-pad-x);
267
559
  }
560
+
561
+ :host([variant="inside"]) .input-wrapper:has(.icon-slot[filled].left) .input-inside-main > .label,
562
+ :host([variant="inside"]) .input-wrapper:has(.icon-slot[filled].left) .chip-container,
563
+ :host([variant="inside"]) .input-wrapper:has(.icon-slot[filled].left) .value-summary,
564
+ :host([variant="inside"]) .input-wrapper:has(.icon-slot[filled].left) .placeholder-label {
565
+ padding-inline-start: 0;
566
+ }
567
+
568
+ /* Left icon / trailing chrome centered to label+value column (like sky-input) */
569
+ :host([variant="inside"]) .icon-slot,
570
+ :host([variant="inside"]) .icon-slot[filled] {
571
+ align-self: center;
572
+ height: auto;
573
+ max-height: none;
574
+ align-items: center;
575
+ justify-content: center;
576
+ }
577
+
578
+ :host([variant="inside"]) .field-trailing {
579
+ align-self: center;
580
+ padding-inline-start: 0;
581
+ }
582
+
583
+ /* Outside labels — keep accent while dropdown is open (focus may leave into popover) */
584
+ .combo-box-container:focus-within > .label,
585
+ .combo-box-container:has(.input-wrapper[open]) > .label {
586
+ color: var(--sky-dropdown-color);
587
+ transition: color 0.3s ease;
588
+ }
589
+
590
+ :host([compact]) .combo-box-container:focus-within > .label,
591
+ :host([compact]) .combo-box-container:has(.input-wrapper[open]) > .label {
592
+ font-size: var(--sky-font-size-xs);
593
+ }
594
+
268
595
  .label {
269
596
  font-size: var(--sky-font-size-sm);
270
- margin-bottom: 5px;
597
+ margin-bottom: var(--sky-space-1, 4px);
271
598
  text-align: start;
272
599
  white-space: nowrap;
273
600
  overflow: hidden;
274
601
  text-overflow: ellipsis;
275
602
  font-family: var(--sky-font);
276
- }
277
-
278
- .combo-box-container:focus-within[compact] .label {
279
- font-size: var(--sky-font-size-xs);
280
- color: var(--sky-dropdown-color);
603
+ line-height: 1.35;
281
604
  }
282
605
 
283
606
  .combo-box-container {
@@ -364,16 +687,19 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
364
687
  -webkit-backdrop-filter: none;
365
688
  box-sizing: border-box;
366
689
  border-radius: var(--sky-radius-secondary);
367
- height: 38px;
690
+ height: var(--sky-input-height);
691
+ min-height: var(--sky-input-height);
368
692
  width: 100%;
369
693
  flex-wrap: nowrap;
370
694
  position: relative;
695
+ overflow: hidden;
371
696
  border: var(--sky-border-primary);
372
697
  box-shadow: var(--sky-box-shadow-primary);
373
- transition: border-color 0.3s ease, box-shadow 0.3s ease;
698
+ transition:
699
+ border-color var(--sky-transition-normal, 200ms ease),
700
+ box-shadow var(--sky-transition-normal, 200ms ease);
374
701
  flex: 1 1 auto;
375
702
  min-width: 0;
376
-
377
703
  }
378
704
 
379
705
  .input-wrapper:focus-visible {
@@ -407,7 +733,8 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
407
733
  opacity: 1;
408
734
  border-bottom-color: var(--sky-danger-primary);
409
735
  }
410
- :host([validationActive]:invalid) .label {
736
+
737
+ :host([validationActive]:invalid) .label {
411
738
  color: var(--sky-danger-primary);
412
739
  }
413
740
 
@@ -418,14 +745,43 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
418
745
  .placeholder-label.active[compact] {
419
746
  top: 10px;
420
747
  background-color: var(--sky-dropdown-color);
421
- color: white;
748
+ color: var(--sky-on-color-fallback-light, var(--sky-text-white));
422
749
  font-size: var(--sky-font-size-xs);
423
750
  padding: 0 5px;
424
751
  border-radius: 4px;
425
752
  }
426
753
 
427
754
  .input-wrapper[compact] {
428
- height: 30px;
755
+ height: var(--sky-input-height-compact);
756
+ min-height: var(--sky-input-height-compact);
757
+ border-radius: var(--sky-radius-primary);
758
+ }
759
+
760
+ /* Multi chips stay single-line; do not grow taller than sky-input.
761
+ Exempt inside variant — it needs two rows (label + value). */
762
+ .input-wrapper:has(.chip:not([single-select])) {
763
+ height: var(--sky-input-height);
764
+ min-height: var(--sky-input-height);
765
+ padding-block: 0;
766
+ }
767
+
768
+ .input-wrapper[compact]:has(.chip:not([single-select])) {
769
+ height: var(--sky-input-height-compact);
770
+ min-height: var(--sky-input-height-compact);
771
+ padding-block: 0;
772
+ }
773
+
774
+ :host([variant="inside"]) .input-wrapper,
775
+ :host([variant="inside"]) .input-wrapper:has(.chip),
776
+ :host([variant="inside"]) .input-wrapper[compact]:has(.chip) {
777
+ height: auto;
778
+ min-height: var(--sky-input-height-inside);
779
+ padding-block: var(--sky-input-pad-y-sm, 0px);
780
+ }
781
+
782
+ :host([variant="inside"][compact]) .input-wrapper,
783
+ :host([variant="inside"][compact]) .input-wrapper:has(.chip) {
784
+ min-height: var(--sky-input-height-inside-compact);
429
785
  }
430
786
 
431
787
  :host([compact]) .placeholder-label {
@@ -433,23 +789,71 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
433
789
  }
434
790
 
435
791
  sky-icon {
436
- display: inline-block;
792
+ display: inline-flex;
793
+ align-items: center;
794
+ justify-content: center;
437
795
  width: 1em;
438
796
  height: 1em;
797
+ flex-shrink: 0;
798
+ }
799
+
800
+ /* Value column: takes remaining width; never paints under trailing actions */
801
+ .field-main {
802
+ flex: 1 1 0%;
803
+ min-width: 0;
804
+ max-width: 100%;
805
+ overflow: hidden;
806
+ display: flex;
807
+ align-items: center;
808
+ align-self: stretch;
809
+ position: relative;
810
+ z-index: 0;
439
811
  }
440
812
 
441
813
  .chip-container {
442
- margin-left: 5px;
443
814
  display: flex;
444
- gap: 8px;
445
- flex: 1 1 auto;
815
+ gap: var(--sky-input-gap);
816
+ flex: 1 1 0%;
817
+ width: 100%;
446
818
  min-width: 0;
819
+ max-width: 100%;
447
820
  flex-wrap: nowrap;
821
+ align-items: center;
822
+ overflow: hidden;
823
+ box-sizing: border-box;
824
+ margin: 0;
825
+ padding-inline: var(--sky-input-pad-x) var(--sky-input-pad-x-sm);
448
826
  }
449
827
 
450
- :dir(rtl).chip-container {
451
- margin-right: 5px;
452
- margin-left: 0px;
828
+ .input-wrapper:has(.icon-slot[filled].left) .chip-container {
829
+ padding-inline-start: var(--sky-input-pad-x-sm);
830
+ }
831
+
832
+ .value-summary {
833
+ display: block;
834
+ flex: 1 1 0%;
835
+ width: 100%;
836
+ min-width: 0;
837
+ max-width: 100%;
838
+ box-sizing: border-box;
839
+ margin: 0;
840
+ padding-inline: var(--sky-input-pad-x) var(--sky-input-pad-x-sm);
841
+ overflow: hidden;
842
+ text-overflow: ellipsis;
843
+ white-space: nowrap;
844
+ font-size: var(--sky-font-size-md);
845
+ color: var(--sky-text-primary);
846
+ font-family: var(--sky-font);
847
+ line-height: 1.25;
848
+ text-align: start;
849
+ }
850
+
851
+ .input-wrapper:has(.icon-slot[filled].left) .value-summary {
852
+ padding-inline-start: var(--sky-input-pad-x-sm);
853
+ }
854
+
855
+ :host([compact]) .value-summary {
856
+ font-size: var(--sky-font-size-sm);
453
857
  }
454
858
 
455
859
  .chip-container::-webkit-scrollbar {
@@ -463,15 +867,22 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
463
867
  .chip {
464
868
  background-color: var(--sky-glass-primary);
465
869
  border-radius: var(--sky-radius-primary);
466
- padding: 4px 8px;
870
+ padding: 0 6px;
871
+ height: 1.25rem;
872
+ max-height: calc(var(--sky-input-height) - 10px);
467
873
  font-size: var(--sky-font-size-sm);
468
- display: flex;
874
+ line-height: 1;
875
+ display: inline-flex;
469
876
  align-items: center;
470
- gap: 6px;
471
- flex-shrink: 0;
877
+ gap: 4px;
878
+ flex: 0 1 auto;
879
+ max-width: 100%;
472
880
  min-width: 0;
473
881
  border: var(--sky-border-primary);
474
882
  font-family: var(--sky-font);
883
+ text-align: start;
884
+ box-sizing: border-box;
885
+ white-space: nowrap;
475
886
  }
476
887
 
477
888
  .chip .chip-label {
@@ -480,33 +891,20 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
480
891
  overflow: hidden;
481
892
  text-overflow: ellipsis;
482
893
  white-space: nowrap;
894
+ line-height: 1;
483
895
  }
484
896
 
485
- .chip[single-select] {
486
- background-color: transparent;
487
- box-shadow: none;
488
- border: none;
489
- font-size: var(--sky-font-size-md);
490
- padding: 4px;
491
- gap: 0;
492
- overflow: hidden;
493
- text-overflow: ellipsis;
897
+ .chip.overflow-chip {
898
+ flex: 0 0 auto;
494
899
  white-space: nowrap;
495
- min-width: 0;
496
- width:100%;
900
+ max-width: none;
497
901
  }
498
902
 
499
- .chip[single-select] .chip-label {
500
- flex: 1 1 auto;
501
- min-width: 0;
502
- }
503
-
504
- :host([icon-left]) .chip[single-select] {
505
- padding:4px 0;
506
- }
507
-
508
- .chip[single-select] .remove-chip {
509
- display: none;
903
+ :host([compact]) .chip {
904
+ height: 1.125rem;
905
+ max-height: calc(var(--sky-input-height-compact) - 8px);
906
+ padding: 0 4px;
907
+ font-size: var(--sky-font-size-xs);
510
908
  }
511
909
 
512
910
  .chip .remove-chip[compact] {
@@ -587,11 +985,9 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
587
985
  var(--sky-box-shadow-inset),
588
986
  var(--sky-box-shadow-tertiary);
589
987
  box-sizing: border-box;
590
- pointer-events: auto;
591
- margin: 0;
592
-
988
+ pointer-events: auto;
989
+ margin: 0;
593
990
  border: var(--sky-border-tertiary);
594
-
595
991
  }
596
992
 
597
993
  .dropdown-scroller {
@@ -626,17 +1022,6 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
626
1022
  background-color: transparent;
627
1023
  }
628
1024
 
629
- .dropdown-item.active {
630
- background-color: var(--sky-hover-primary);
631
- }
632
- .dropdown-item.selected {
633
- color: var(--sky-dropdown-color, var(--sky-active-primary));
634
- }
635
-
636
- .dropdown-item.active.selected {
637
- background-color: var(--sky-active-g0);
638
- }
639
-
640
1025
  .dropdown-item {
641
1026
  display: flex;
642
1027
  align-items: center;
@@ -647,12 +1032,34 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
647
1032
  text-align: left;
648
1033
  font-size: var(--sky-font-size-sm);
649
1034
  color: var(--sky-text-primary);
650
- transition: all 0.2s ease-in-out;
1035
+ transition:
1036
+ background-color 0.15s ease,
1037
+ color 0.15s ease;
651
1038
  box-sizing: border-box;
652
1039
  margin: 2px 0;
653
1040
  font-family: var(--sky-font);
654
1041
  }
655
1042
 
1043
+ .dropdown-item:hover {
1044
+ background-color: var(--sky-hover-primary);
1045
+ }
1046
+
1047
+ .dropdown-item.active {
1048
+ background-color: var(--sky-hover-primary);
1049
+ }
1050
+
1051
+ .dropdown-item.selected {
1052
+ color: var(--sky-dropdown-color, var(--sky-active-primary));
1053
+ background-color: var(--sky-active-g0, var(--sky-hover-primary));
1054
+ font-weight: var(--sky-font-weight-medium, 500);
1055
+ }
1056
+
1057
+ .dropdown-item.active.selected,
1058
+ .dropdown-item.selected:hover {
1059
+ background-color: var(--sky-active-g0, var(--sky-hover-primary));
1060
+ color: var(--sky-dropdown-color, var(--sky-active-primary));
1061
+ }
1062
+
656
1063
  :host([compact]) .dropdown-item {
657
1064
  font-size: var(--sky-font-size-sm);
658
1065
  padding: 5px 8px;
@@ -664,47 +1071,44 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
664
1071
  justify-content: center;
665
1072
  font-size: var(--sky-font-size-xl);
666
1073
  align-items: center;
667
- border-radius: var(--sky-radius-secondary);
668
- height: inherit;
1074
+ align-self: center;
1075
+ color: var(--sky-text-primary);
1076
+ height: 100%;
669
1077
  max-height: 100%;
670
1078
  box-sizing: border-box;
671
- min-width: 36px;
672
- background: var(--sky-glass-solid);
673
- color: var(--sky-text-primary);
674
- backdrop-filter: none;
675
- -webkit-backdrop-filter: none;
676
-
677
- transition:
678
- transform 0.3s ease,
679
- color 0.3s ease;
680
- }
681
-
682
- .hidden-chips-dropdown {
683
- position: fixed; /* important: popover top layer */
684
- background: var(--sky-glass-tertiary);
685
- background-image: var(--sky-glass-surface);
686
- backdrop-filter: var(--sky-blur-tertiary) var(--sky-brightness-tertiary)
687
- var(--sky-saturation-tertiary);
688
- -webkit-backdrop-filter: var(--sky-blur-tertiary)
689
- var(--sky-brightness-tertiary) var(--sky-saturation-tertiary);
690
- box-shadow:
691
- var(--sky-box-shadow-inset),
692
- var(--sky-box-shadow-tertiary);
693
- border-radius: var(--sky-radius-secondary);
694
- border: var(--sky-border-tertiary);
695
- width: max-content;
696
-
697
- opacity: 0;
698
- transform: scale(0.98);
699
- transition: opacity 0.15s ease, transform 0.15s ease;
700
- margin: 0;
701
- }
702
-
703
- .hidden-chips-dropdown:popover-open {
704
- opacity: 1;
705
- transform: scale(1);
706
- }
1079
+ flex: 0 0 var(--sky-input-icon-width);
1080
+ width: var(--sky-input-icon-width);
1081
+ min-width: var(--sky-input-icon-width);
1082
+ padding: 0;
1083
+ background: none;
1084
+ border: none;
1085
+ transition: color var(--sky-transition-normal, 200ms ease);
1086
+ }
707
1087
 
1088
+ .hidden-chips-dropdown {
1089
+ position: fixed; /* important: popover top layer */
1090
+ background: var(--sky-glass-tertiary);
1091
+ background-image: var(--sky-glass-surface);
1092
+ backdrop-filter: var(--sky-blur-tertiary) var(--sky-brightness-tertiary)
1093
+ var(--sky-saturation-tertiary);
1094
+ -webkit-backdrop-filter: var(--sky-blur-tertiary)
1095
+ var(--sky-brightness-tertiary) var(--sky-saturation-tertiary);
1096
+ box-shadow:
1097
+ var(--sky-box-shadow-inset),
1098
+ var(--sky-box-shadow-tertiary);
1099
+ border-radius: var(--sky-radius-secondary);
1100
+ border: var(--sky-border-tertiary);
1101
+ width: max-content;
1102
+ opacity: 0;
1103
+ transform: scale(0.98);
1104
+ transition: opacity 0.15s ease, transform 0.15s ease;
1105
+ margin: 0;
1106
+ }
1107
+
1108
+ .hidden-chips-dropdown:popover-open {
1109
+ opacity: 1;
1110
+ transform: scale(1);
1111
+ }
708
1112
 
709
1113
  .hidden-chip-inner {
710
1114
  padding: 4px 8px;
@@ -724,112 +1128,131 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
724
1128
 
725
1129
  .icon-slot[filled] {
726
1130
  display: flex;
1131
+ flex-shrink: 0;
727
1132
  cursor: pointer;
728
1133
  }
729
- .icon-slot.left {
730
- border-right: var(--sky-border-primary);
731
- }
732
-
733
- :dir(rtl) .icon-slot.left {
734
- border-left: var(--sky-border-primary);
735
- border-right: unset;
736
- }
737
1134
 
738
- .icon-slot.right {
739
- border-left: var(--sky-border-primary);
740
- }
741
-
742
- :dir(rtl) .icon-slot.right {
743
- border-right: var(--sky-border-primary);
744
- border-left: unset;
745
- }
746
-
747
- .input-wrapper[open] .icon-slot {
748
- transform: translate(-5px, -5px);
749
- border: var(--sky-border-primary) !important;
1135
+ .icon-slot[filled]:hover,
1136
+ .icon-slot[filled]:active,
1137
+ .icon-slot.focused,
1138
+ .input-wrapper[open] .icon-slot[filled] {
750
1139
  color: var(--sky-dropdown-color);
751
- background-color: var(--sky-glass-solid);
752
- }
753
-
754
- :dir(rtl) .input-wrapper[open] .icon-slot {
755
- transform: translate(5px, -5px);
756
- }
757
-
758
- .input-wrapper[open] .icon-slot.right {
759
- transform: translate(5px, -5px);
760
- }
761
-
762
- :dir(rtl) .input-wrapper[open] .icon-slot.right {
763
- transform: translate(-5px, -5px);
764
1140
  }
765
1141
 
766
1142
  .placeholder-label {
767
1143
  white-space: nowrap;
768
- padding: 0 8px;
1144
+ box-sizing: border-box;
1145
+ padding-inline: var(--sky-input-pad-x);
769
1146
  flex: 1 1 0%;
1147
+ width: 100%;
1148
+ min-width: 0;
770
1149
  text-align: start;
771
1150
  font-size: var(--sky-font-size-md);
1151
+ line-height: 1.25;
772
1152
  color: var(--sky-text-tertiary);
773
- transition: all 0.3s ease;
1153
+ transition: color var(--sky-transition-normal, 200ms ease);
774
1154
  pointer-events: none;
775
1155
  overflow: hidden;
776
1156
  text-overflow: ellipsis;
777
1157
  font-family: var(--sky-font);
1158
+ display: flex;
1159
+ align-items: center;
1160
+ align-self: stretch;
1161
+ }
1162
+
1163
+ .input-wrapper:has(.icon-slot[filled].left) .placeholder-label {
1164
+ padding-inline-start: var(--sky-input-pad-x-sm);
778
1165
  }
779
1166
 
780
1167
  .placeholder-label.active {
781
1168
  display: none;
782
1169
  }
783
1170
 
784
- .dropdown-item:hover {
785
- background-color: var(--sky-hover-primary);
1171
+ .field-trailing {
1172
+ display: flex;
1173
+ flex: 0 0 auto;
1174
+ flex-shrink: 0;
1175
+ align-items: center;
1176
+ justify-content: flex-end;
1177
+ align-self: stretch;
1178
+ gap: var(--sky-input-pad-x-sm);
1179
+ padding-inline-end: var(--sky-input-pad-x-sm);
1180
+ padding-inline-start: var(--sky-input-pad-x-sm);
1181
+ box-sizing: border-box;
1182
+ position: relative;
1183
+ z-index: 1;
1184
+ /* Opaque rail so value text never shows through behind clear */
1185
+ background: var(--sky-glass-solid);
1186
+ isolation: isolate;
786
1187
  }
787
1188
 
788
- .clear-button {
789
- flex-shrink: 0;
790
- margin-inline-end: var(--sky-space-1, 4px);
1189
+ sky-icon.clear-button {
1190
+ box-sizing: border-box;
1191
+ flex: 0 0 auto;
1192
+ width: 1.125rem;
1193
+ height: 1.125rem;
1194
+ min-width: 1.125rem;
1195
+ min-height: 1.125rem;
1196
+ margin: 0;
1197
+ padding: 0;
791
1198
  border: none;
792
- font-size: var(--sky-font-size-xl);
1199
+ font-size: 0.75rem;
1200
+ line-height: 1;
793
1201
  color: var(--sky-dropdown-color);
794
1202
  background-color: var(--sky-hover-primary);
795
1203
  border-radius: var(--sky-radius-full);
796
1204
  backdrop-filter: none;
797
1205
  -webkit-backdrop-filter: none;
798
1206
  cursor: pointer;
799
- transition: color 0.3s ease;
1207
+ transition: color var(--sky-transition-normal, 200ms ease);
800
1208
  }
801
1209
 
802
- .clear-button[compact] {
803
- font-size: var(--sky-font-size-md);
1210
+ sky-icon.clear-button[compact] {
1211
+ width: 1rem;
1212
+ height: 1rem;
1213
+ min-width: 1rem;
1214
+ min-height: 1rem;
1215
+ font-size: 0.6875rem;
804
1216
  }
805
1217
 
806
- .clear-button:hover {
1218
+ sky-icon.clear-button:hover {
807
1219
  color: var(--sky-danger-primary);
808
1220
  }
809
1221
 
810
- .dropdown-button {
811
- flex-shrink: 0;
812
- color: var(--sky-text-primary);
813
- height: 100%;
814
- width: auto;
815
- aspect-ratio: 1;
816
- display: flex;
1222
+ sky-icon.dropdown-button {
1223
+ box-sizing: border-box;
1224
+ flex: 0 0 auto;
1225
+ width: var(--sky-input-icon-width);
1226
+ height: auto;
1227
+ min-width: calc(var(--sky-input-icon-width) - 0.25rem);
1228
+ margin: 0;
1229
+ padding: 0;
817
1230
  border: none;
818
1231
  font-size: var(--sky-font-size-sm);
1232
+ color: var(--sky-text-primary);
1233
+ display: inline-flex;
1234
+ align-items: center;
1235
+ justify-content: center;
819
1236
  cursor: pointer;
820
- transition: color 0.3s ease;
1237
+ transition: color var(--sky-transition-normal, 200ms ease);
1238
+ background: none;
821
1239
  }
822
1240
 
823
- .dropdown-button[compact] {
1241
+ sky-icon.dropdown-button:hover,
1242
+ .input-wrapper[open] sky-icon.dropdown-button {
1243
+ color: var(--sky-dropdown-color);
1244
+ }
1245
+
1246
+ sky-icon.dropdown-button[compact] {
824
1247
  font-size: var(--sky-font-size-md);
825
1248
  }
826
1249
 
827
1250
  .loading-indicator {
828
1251
  flex-shrink: 0;
829
- margin-inline-end: var(--sky-space-1, 4px);
1252
+ margin-inline-end: var(--sky-input-pad-x-sm);
830
1253
  width: 16px;
831
1254
  height: 16px;
832
- border: 2px solid var(--sky-text-white);
1255
+ border: 2px solid var(--sky-border-light, var(--sky-text-tertiary));
833
1256
  border-top: 2px solid var(--sky-dropdown-color, var(--sky-active-primary));
834
1257
  border-radius: var(--sky-radius-full);
835
1258
  animation: spin 1s linear infinite;
@@ -870,13 +1293,13 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
870
1293
  white-space: nowrap;
871
1294
  text-overflow: ellipsis;
872
1295
  font-size: var(--sky-font-size-sm);
873
- margin-left: 5px;
1296
+ margin-inline-start: var(--sky-input-pad-x-sm);
874
1297
  font-family: var(--sky-font);
875
1298
  }
876
1299
 
877
1300
  :dir(rtl) .progress-message {
878
- margin-left: unset;
879
- margin-right: 5px;
1301
+ margin-inline-start: unset;
1302
+ margin-inline-end: var(--sky-input-pad-x-sm);
880
1303
  }
881
1304
 
882
1305
  .error-list {
@@ -932,7 +1355,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
932
1355
  content: "";
933
1356
  width: 8px;
934
1357
  height: 4px;
935
- border: 2px solid var(--sky-text-white);
1358
+ border: 2px solid var(--sky-on-color-fallback-light, var(--sky-text-white));
936
1359
  border-top: none;
937
1360
  border-right: none;
938
1361
  position: absolute;
@@ -953,7 +1376,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
953
1376
  .sky-checkbox.indeterminate::after {
954
1377
  width: 8px;
955
1378
  height: 2px;
956
- background-color: var(--sky-text-white);
1379
+ background-color: var(--sky-on-color-fallback-light, var(--sky-text-white));
957
1380
  border: none;
958
1381
  top: 50%;
959
1382
  left: 50%;
@@ -970,5 +1393,7 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
970
1393
  opacity: 0.6;
971
1394
  cursor: not-allowed;
972
1395
  }
973
- `,x.shadowRootOptions={...e.shadowRootOptions,delegatesFocus:!0},k([s()],x.prototype,"value",2),k([s({type:String})],x.prototype,"placeholder",2),k([s({type:String})],x.prototype,"searchPlaceholder",2),k([s({type:String})],x.prototype,"label",2),k([s({type:Array})],x.prototype,"options",1),k([s({type:Number})],x.prototype,"chipSize",2),k([s({type:String})],x.prototype,"color",2),k([s({type:Boolean,reflect:!0})],x.prototype,"clearable",2),k([s({type:Boolean,reflect:!0})],x.prototype,"loading",2),k([s({type:Boolean,reflect:!0})],x.prototype,"compact",2),k([s({type:Boolean,reflect:!0})],x.prototype,"disabled",2),k([s({type:Boolean,reflect:!0})],x.prototype,"searchable",2),k([s({type:Boolean,reflect:!0})],x.prototype,"multiSelect",2),k([s({type:Number,reflect:!0})],x.prototype,"visibleChips",2),k([s({type:Boolean,reflect:!0})],x.prototype,"selectAll",2),k([s({type:Array})],x.prototype,"validations",1),k([s({type:Boolean})],x.prototype,"showErrors",2),k([s({type:String})],x.prototype,"errorDisplayMode",2),k([s({type:Boolean,reflect:!0})],x.prototype,"required",2),k([s({type:Boolean,reflect:!0})],x.prototype,"emitFullObject",2),k([s({type:String})],x.prototype,"emittedKey",2),k([s({type:String})],x.prototype,"displayKey",2),k([s({type:Boolean})],x.prototype,"addOption",2),k([s({type:Boolean})],x.prototype,"validationArrayFormat",2),k([s({type:String})],x.prototype,"prefix",2),k([s({type:String})],x.prototype,"suffix",2),k([s({type:String})],x.prototype,"prefixColor",2),k([s({type:String})],x.prototype,"suffixColor",2),k([s({type:String})],x.prototype,"justify",2),k([s({type:Number})],x.prototype,"zIndex",2),k([s({type:String})],x.prototype,"height",2),k([s({type:String})],x.prototype,"requiredMessage",2),k([s({type:Boolean,reflect:!0})],x.prototype,"readonly",2),k([s({type:Boolean})],x.prototype,"enforceMinOneSelection",2),k([s({type:Boolean})],x.prototype,"openAbove",2),k([s({type:Boolean,reflect:!0})],x.prototype,"validationActive",2),k([s({type:Boolean,reflect:!0})],x.prototype,"invalid",2),k([s({type:String,reflect:!0})],x.prototype,"variant",2),k([s({type:String,attribute:!1})],x.prototype,"searchQuery",2),k([o()],x.prototype,"filteredOptions",2),k([o()],x.prototype,"focused",2),k([o()],x.prototype,"open",2),k([o()],x.prototype,"selectedItems",2),k([o()],x.prototype,"hiddenChipsOpen",2),k([o()],x.prototype,"activeIndex",2),k([o()],x.prototype,"validationErrors",2),k([o()],x.prototype,"validationStatus",2),k([o()],x.prototype,"hasLeftIcon",2),k([o()],x.prototype,"hasRightIcon",2),k([o()],x.prototype,"optionSlotSet",2),k([r(".input-wrapper")],x.prototype,"inputWrapperEl",2),k([r(".dropdown")],x.prototype,"dropdownEl",2),k([r(".hidden-chips-dropdown")],x.prototype,"hiddenDropdownEl",2),k([r(".search-container .input")],x.prototype,"searchInputEl",2),k([r(".overflow-chip")],x.prototype,"overflowChipEl",2),k([r(".combo-box-container")],x.prototype,"comboContainerEl",2),k([a("[data-row-index]")],x.prototype,"rowEls",2),k([n({slot:"icon-left"})],x.prototype,"iconLeftEls",2),k([n({slot:"icon-right"})],x.prototype,"iconRightEls",2),x=k([l("sky-combobox")],x);export{x as SkyCombobox};
1396
+
1397
+ ${t(m([{selector:".placeholder-label.active[compact]",fillVar:"--sky-dropdown-color"},{selector:".sky-checkbox:checked::after",fillVar:"--sky-active-primary",property:"border-color"},{selector:".sky-checkbox.indeterminate::after",fillVar:"--sky-active-primary",property:"background-color"}]))}
1398
+ `,S.shadowRootOptions={...i.shadowRootOptions,delegatesFocus:!0},I([r()],S.prototype,"value",2),I([r({type:String})],S.prototype,"placeholder",2),I([r({type:String})],S.prototype,"searchPlaceholder",2),I([r({type:String})],S.prototype,"label",2),I([r({type:Array})],S.prototype,"options",1),I([r({type:Number})],S.prototype,"chipSize",2),I([r({type:String})],S.prototype,"color",2),I([r({type:Boolean,reflect:!0})],S.prototype,"clearable",2),I([r({type:Boolean,reflect:!0})],S.prototype,"loading",2),I([r({type:Boolean,reflect:!0})],S.prototype,"compact",2),I([r({type:Boolean,reflect:!0})],S.prototype,"disabled",2),I([r({type:Boolean,reflect:!0})],S.prototype,"searchable",2),I([r({type:Boolean,reflect:!0})],S.prototype,"multiSelect",2),I([r({type:Number,reflect:!0})],S.prototype,"visibleChips",2),I([r({type:Boolean,reflect:!0})],S.prototype,"selectAll",2),I([r({type:Array})],S.prototype,"validations",1),I([r({type:Boolean})],S.prototype,"showErrors",2),I([r({type:String})],S.prototype,"errorDisplayMode",2),I([r({type:Boolean,reflect:!0})],S.prototype,"required",2),I([r({type:Boolean,reflect:!0})],S.prototype,"emitFullObject",2),I([r({type:String})],S.prototype,"emittedKey",2),I([r({type:String})],S.prototype,"displayKey",2),I([r({type:Boolean})],S.prototype,"addOption",2),I([r({type:Boolean})],S.prototype,"validationArrayFormat",2),I([r({type:String})],S.prototype,"prefix",2),I([r({type:String})],S.prototype,"suffix",2),I([r({type:String})],S.prototype,"prefixColor",2),I([r({type:String})],S.prototype,"suffixColor",2),I([r({type:String})],S.prototype,"justify",2),I([r({type:Number})],S.prototype,"zIndex",2),I([r({type:String})],S.prototype,"height",2),I([r({type:String})],S.prototype,"requiredMessage",2),I([r({type:Boolean,reflect:!0})],S.prototype,"readonly",2),I([r({type:Boolean})],S.prototype,"enforceMinOneSelection",2),I([r({type:Boolean})],S.prototype,"openAbove",2),I([r({type:Boolean,reflect:!0})],S.prototype,"validationActive",2),I([r({type:Boolean,reflect:!0})],S.prototype,"invalid",2),I([r({type:String,reflect:!0})],S.prototype,"variant",2),I([r({type:String,reflect:!0,attribute:"multi-display"})],S.prototype,"multiDisplay",2),I([r({type:String,attribute:!1})],S.prototype,"searchQuery",2),I([n()],S.prototype,"filteredOptions",2),I([n()],S.prototype,"focused",2),I([n()],S.prototype,"open",2),I([n()],S.prototype,"selectedItems",2),I([n()],S.prototype,"hiddenChipsOpen",2),I([n()],S.prototype,"activeIndex",2),I([n()],S.prototype,"validationErrors",2),I([n()],S.prototype,"validationStatus",2),I([n()],S.prototype,"hasLeftIcon",2),I([n()],S.prototype,"hasRightIcon",2),I([n()],S.prototype,"optionSlotSet",2),I([a(".input-wrapper")],S.prototype,"inputWrapperEl",2),I([a(".dropdown")],S.prototype,"dropdownEl",2),I([a(".hidden-chips-dropdown")],S.prototype,"hiddenDropdownEl",2),I([a(".search-container .input")],S.prototype,"searchInputEl",2),I([a(".overflow-chip")],S.prototype,"overflowChipEl",2),I([a(".combo-box-container")],S.prototype,"comboContainerEl",2),I([l("[data-row-index]")],S.prototype,"rowEls",2),I([h({slot:"icon-left"})],S.prototype,"iconLeftEls",2),I([h({slot:"icon-right"})],S.prototype,"iconRightEls",2),S=I([d("sky-combobox")],S);export{S as SkyCombobox};
974
1399
  //# sourceMappingURL=sky-combobox.js.map