@trendyol/baklava 2.0.0-beta.90 → 2.0.0-beta.91

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 (37) hide show
  1. package/dist/baklava.js +1 -1
  2. package/dist/chunk-3KKF66FB.js +42 -0
  3. package/dist/chunk-3KKF66FB.js.map +7 -0
  4. package/dist/chunk-GXSB4E6R.js +46 -0
  5. package/dist/chunk-GXSB4E6R.js.map +7 -0
  6. package/dist/chunk-S7FKMIX4.js +37 -0
  7. package/dist/chunk-S7FKMIX4.js.map +7 -0
  8. package/dist/{chunk-NYLRILUV.js → chunk-SEMLCEAH.js} +2 -2
  9. package/dist/{chunk-NYLRILUV.js.map → chunk-SEMLCEAH.js.map} +2 -2
  10. package/dist/chunk-VQLW2744.js +27 -0
  11. package/dist/chunk-VQLW2744.js.map +7 -0
  12. package/dist/components/dropdown/bl-dropdown.d.ts +2 -5
  13. package/dist/components/dropdown/bl-dropdown.d.ts.map +1 -1
  14. package/dist/components/dropdown/bl-dropdown.js +1 -1
  15. package/dist/components/dropdown/bl-dropdown.test.d.ts +1 -1
  16. package/dist/components/dropdown/bl-dropdown.test.d.ts.map +1 -1
  17. package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
  18. package/dist/components/input/bl-input.d.ts +6 -1
  19. package/dist/components/input/bl-input.d.ts.map +1 -1
  20. package/dist/components/input/bl-input.js +1 -1
  21. package/dist/components/pagination/bl-pagination.js +1 -1
  22. package/dist/components/popover/bl-popover.js +1 -1
  23. package/dist/components/select/bl-select.d.ts +6 -0
  24. package/dist/components/select/bl-select.d.ts.map +1 -1
  25. package/dist/components/select/bl-select.js +1 -1
  26. package/dist/components/textarea/bl-textarea.d.ts +6 -0
  27. package/dist/components/textarea/bl-textarea.d.ts.map +1 -1
  28. package/dist/components/textarea/bl-textarea.js +1 -1
  29. package/package.json +5 -5
  30. package/dist/chunk-2EMIR5ZN.js +0 -41
  31. package/dist/chunk-2EMIR5ZN.js.map +0 -7
  32. package/dist/chunk-B3HLJT4E.js +0 -23
  33. package/dist/chunk-B3HLJT4E.js.map +0 -7
  34. package/dist/chunk-CMIFBOTH.js +0 -36
  35. package/dist/chunk-CMIFBOTH.js.map +0 -7
  36. package/dist/chunk-NPBDEGIU.js +0 -45
  37. package/dist/chunk-NPBDEGIU.js.map +0 -7
package/dist/baklava.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as S}from"./chunk-QV3A6DWH.js";import{a as b}from"./chunk-J73JZGIX.js";import{a as I}from"./chunk-MGQL62CQ.js";import{a as P}from"./chunk-JMV2HWKD.js";import{a as g}from"./chunk-CMIFBOTH.js";import{a as h}from"./chunk-72WMF254.js";import{b as T,d as G}from"./chunk-B3HLJT4E.js";import{b as D}from"./chunk-VYKKWEKI.js";import{a as B}from"./chunk-EMMMXLJJ.js";import{a as m}from"./chunk-2EMIR5ZN.js";import{a as s}from"./chunk-4UWTC6BR.js";import{a as x}from"./chunk-NPBDEGIU.js";import"./chunk-XQN3H7RG.js";import"./chunk-3B64VOWB.js";import{a as w}from"./chunk-NYLRILUV.js";import"./chunk-ANYJUR6Q.js";import{a as n}from"./chunk-MU34JCL5.js";import{c,f as i}from"./chunk-HTIGXY2B.js";import{a as r}from"./chunk-6IV5ELOB.js";import{a}from"./chunk-TJ47AW2B.js";import{b as f,e as p}from"./chunk-DSM6T5MC.js";import"./chunk-EPJ347EQ.js";import"./chunk-DJOD4BTL.js";import{a as d}from"./chunk-XKX2GLBY.js";import{a as u}from"./chunk-W6FBJD54.js";import{b as l}from"./chunk-ZEBKUNFE.js";import"./chunk-OLPYXE2P.js";import"./chunk-KPAWUBRO.js";import{a as o,b as e,c as t}from"./chunk-F3ZH5IV7.js";import"./chunk-RLMJN536.js";import"./chunk-23UFIOHV.js";import"./chunk-57PTZNIL.js";import"./chunk-NZ3RGSR6.js";export{r as BlAlert,a as BlBadge,l as BlButton,f as BlCheckbox,p as BlCheckboxGroup,d as BlDialog,u as BlDrawer,G as BlDropdown,D as BlDropdownGroup,T as BlDropdownItem,t as BlIcon,x as BlInput,B as BlPagination,w as BlPopover,n as BlProgressIndicator,c as BlRadio,i as BlRadioGroup,m as BlSelect,s as BlSelectOption,S as BlSwitch,I as BlTab,b as BlTabGroup,P as BlTabPanel,g as BlTextarea,h as BlTooltip,e as getIconPath,o as setIconPath};
1
+ import{b as S}from"./chunk-QV3A6DWH.js";import{a as b}from"./chunk-J73JZGIX.js";import{a as I}from"./chunk-MGQL62CQ.js";import{a as P}from"./chunk-JMV2HWKD.js";import{a as g}from"./chunk-S7FKMIX4.js";import{a as h}from"./chunk-72WMF254.js";import{b as T,d as G}from"./chunk-VQLW2744.js";import{b as D}from"./chunk-VYKKWEKI.js";import{a as B}from"./chunk-EMMMXLJJ.js";import{a as m}from"./chunk-3KKF66FB.js";import{a as s}from"./chunk-4UWTC6BR.js";import{a as x}from"./chunk-GXSB4E6R.js";import"./chunk-XQN3H7RG.js";import"./chunk-3B64VOWB.js";import{a as w}from"./chunk-SEMLCEAH.js";import"./chunk-ANYJUR6Q.js";import{a as n}from"./chunk-MU34JCL5.js";import{c,f as i}from"./chunk-HTIGXY2B.js";import{a as r}from"./chunk-6IV5ELOB.js";import{a}from"./chunk-TJ47AW2B.js";import{b as f,e as p}from"./chunk-DSM6T5MC.js";import"./chunk-EPJ347EQ.js";import"./chunk-DJOD4BTL.js";import{a as d}from"./chunk-XKX2GLBY.js";import{a as u}from"./chunk-W6FBJD54.js";import{b as l}from"./chunk-ZEBKUNFE.js";import"./chunk-OLPYXE2P.js";import"./chunk-KPAWUBRO.js";import{a as o,b as e,c as t}from"./chunk-F3ZH5IV7.js";import"./chunk-RLMJN536.js";import"./chunk-23UFIOHV.js";import"./chunk-57PTZNIL.js";import"./chunk-NZ3RGSR6.js";export{r as BlAlert,a as BlBadge,l as BlButton,f as BlCheckbox,p as BlCheckboxGroup,d as BlDialog,u as BlDrawer,G as BlDropdown,D as BlDropdownGroup,T as BlDropdownItem,t as BlIcon,x as BlInput,B as BlPagination,w as BlPopover,n as BlProgressIndicator,c as BlRadio,i as BlRadioGroup,m as BlSelect,s as BlSelectOption,S as BlSwitch,I as BlTab,b as BlTabGroup,P as BlTabPanel,g as BlTextarea,h as BlTooltip,e as getIconPath,o as setIconPath};
2
2
  //# sourceMappingURL=baklava.js.map
@@ -0,0 +1,42 @@
1
+ import{a as m}from"./chunk-3B64VOWB.js";import{b as g,d as y,f as x,g as O,h as _}from"./chunk-ANYJUR6Q.js";import{a as f}from"./chunk-DJOD4BTL.js";import{a as p}from"./chunk-OLPYXE2P.js";import{a as b}from"./chunk-KPAWUBRO.js";import{a as h}from"./chunk-23UFIOHV.js";import{a as c,b as n,f as d,g as u,h as l,i as r,j as a,k as v}from"./chunk-57PTZNIL.js";import{a as o}from"./chunk-NZ3RGSR6.js";var T=c`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-primary-background);--border-color:var(--bl-color-border);--border-focus-color:var(--bl-color-primary-hover);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--label-color:var(--bl-color-content-secondary);--placeholder-color:var(--bl-color-content-tertiary);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-tertiary);--menu-height:250px;--popover-position:var(--bl-popover-position,fixed)}:host([size='large']) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-content-passive)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-hover);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:0;min-width:100%}.placeholder{color:var(--placeholder-color);padding-left:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}.remove-all{display:none}.remove-all::after{content:'';position:absolute;left:1.5rem;bottom:4px;height:1rem;border-left:1px solid var(--bl-color-border)}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-secondary)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-content-passive)}.select-open .select-input,.select-input:focus-visible{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-left:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:', '}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .selected-options li{color:var(--bl-color-content-passive)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-2xs);margin-left:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}legend,label{max-width:max-content;padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);right:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:all ease-in .1s;pointer-events:none;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal)}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color)}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}`,w=T;var t=class extends f(d){constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.multiple=!1;this.autofocus=!1;this.labelFixed=!1;this._isPopoverOpen=!1;this._additionalSelectedOptionCount=0;this._connectedOptions=[];this._cleanUpPopover=null;this._selectedOptions=[];this.dirty=!1;this._interactOutsideHandler=e=>{var s;let i=e.composedPath();(s=i==null?void 0:i.find(z=>z.tagName==="BL-SELECT"))!=null&&s.contains(this)||this.close()};this.focusedOptionIndex=-1}static get styles(){return[w]}get value(){return this._value}set value(e){if(this._value=e,Array.isArray(e)){let i=new FormData;e.forEach(s=>i.append(this.name,`${s}`)),this.setValue(i)}else this.setValue(e);this.setOptionsSelected()}shouldFormValueUpdate(){return this.value!==null&&this.value!==""}setOptionsSelected(){this._connectedOptions.forEach(e=>e.selected=this.value===e.value||Array.isArray(this.value)&&this.value.includes(e.value)),this._selectedOptions=[...this.options.filter(e=>e.selected)]}get options(){return this._connectedOptions}get opened(){return this._isPopoverOpen}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}validityCallback(){if(this.customInvalidText)return this.customInvalidText;let e=document.createElement("select");return e.required=this.required,e.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}resetFormControl(){this.value=this._initialValue}open(){this._isPopoverOpen=!0,this._setupPopover(),document.addEventListener("click",this._interactOutsideHandler,!0),document.addEventListener("focus",this._interactOutsideHandler,!0)}close(){this._isPopoverOpen=!1,this.focusedOptionIndex=-1,this._cleanUpPopover&&this._cleanUpPopover(),document.removeEventListener("click",this._interactOutsideHandler,!0),document.removeEventListener("focus",this._interactOutsideHandler,!0)}_setupPopover(){this._cleanUpPopover=O(this._selectInput,this._popover,()=>{_(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[g(),y(8),x({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:i})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${i}px`)})})}connectedCallback(){var e;super.connectedCallback(),(e=this.form)==null||e.addEventListener("submit",i=>{this.reportValidity()||i.preventDefault()})}disconnectedCallback(){super.disconnectedCallback(),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){let e=n`<ul class="selected-options">
2
+ ${this._selectedOptions.map(s=>n`<li>${s.textContent}</li>`)}
3
+ </ul>`,i=n`<bl-button
4
+ class="remove-all"
5
+ size="small"
6
+ variant="tertiary"
7
+ kind="neutral"
8
+ icon="close"
9
+ @click=${this._onClickRemove}
10
+ ></bl-button>`;return n`<fieldset
11
+ class=${p({"select-input":!0,"has-overflowed-options":this._additionalSelectedOptionCount>0})}
12
+ tabindex="${this.disabled?"-1":0}"
13
+ ?autofocus=${this.autofocus}
14
+ @click=${this.togglePopover}
15
+ >
16
+ <legend><span>${this.label}</span></legend>
17
+ <span class="placeholder">${this.placeholder}</span>
18
+ ${e}
19
+ <span class="additional-selection-count">+${this._additionalSelectedOptionCount}</span>
20
+ <div class="actions">
21
+ ${this.multiple?i:null}
22
+ <bl-icon class="dropdown-icon open" name="arrow_up"></bl-icon>
23
+
24
+ <bl-icon class="dropdown-icon closed" name="arrow_down"></bl-icon>
25
+ </div>
26
+ </fieldset>`}render(){let e=this.checkValidity()?"":n`<p id="errorMessage" aria-live="polite" class="invalid-text">
27
+ ${this.validationMessage}
28
+ </p>`,i=this.helpText?n`<p class="help-text">${this.helpText}</p>`:"",s=this.label?n`<label>${this.label}</label>`:"";return n`<div
29
+ class=${p({"select-wrapper":!0,"select-open":this.opened,selected:this._selectedOptions.length>0,invalid:!this.validity.valid,dirty:this.dirty})}
30
+ @keydown=${this.handleKeydown}
31
+ >
32
+ ${s} ${this.inputTemplate()}
33
+ <div
34
+ class="popover"
35
+ tabindex="${b(this._isPopoverOpen?void 0:"-1")}"
36
+ @bl-select-option=${this._handleSelectOptionEvent}
37
+ >
38
+ <slot></slot>
39
+ </div>
40
+ <div class="hint">${e} ${i}</div>
41
+ </div> `}handleKeydown(e){this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code)?(this.togglePopover(),e.preventDefault()):this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code)?(this.open(),e.preventDefault()):e.code==="Escape"?(this.close(),e.preventDefault()):this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)&&(e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.options.length-1)),this.options[this.focusedOptionIndex].focus(),e.preventDefault())}togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){this._onBlSelect(this._selectedOptions.map(e=>({value:e.value,selected:e.selected,text:e.textContent})))}_handleSingleSelect(e){this.value=e.value,this._handleSelectEvent(),this._isPopoverOpen=!1}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let i=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(i)}_onClickRemove(e){e.stopPropagation(),this._connectedOptions.filter(i=>i.selected).forEach(i=>{i.selected=!1}),this.value=null,this._additionalSelectedOptionCount=0,this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple||!this.selectedOptionsItems||this.selectedOptionsItems.length<2){this._additionalSelectedOptionCount=0;return}let e=[...this.selectedOptionsItems].findIndex(i=>i.offsetLeft>this.selectedOptionsContainer.offsetWidth);e>-1?this._additionalSelectedOptionCount=this.selectedOptionsItems.length-e:this._additionalSelectedOptionCount=0}firstUpdated(){this.value===void 0&&(this.value=""),this._initialValue=this._value}updated(e){e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this.value=null),this._checkAdditionalItemCount()}registerOption(e){this._connectedOptions.push(e),e.selected&&(this.multiple?(Array.isArray(this.value)||(this.value=[]),this.value=[...this.value,e.value]):this.value=e.value),this.setOptionsSelected(),this.requestUpdate()}unregisterOption(e){this._connectedOptions.splice(this._connectedOptions.indexOf(e),1)}};t.shadowRootOptions={...d.shadowRootOptions,delegatesFocus:!0},t.formControlValidators=[m],o([l()],t.prototype,"name",2),o([l()],t.prototype,"value",1),o([l({reflect:!0})],t.prototype,"label",2),o([l({})],t.prototype,"placeholder",2),o([l({type:String,reflect:!0})],t.prototype,"size",2),o([l({type:Boolean,reflect:!0})],t.prototype,"required",2),o([l({type:Boolean,reflect:!0})],t.prototype,"disabled",2),o([l({type:Boolean})],t.prototype,"multiple",2),o([l({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),o([l({type:Boolean,attribute:"label-fixed",reflect:!0})],t.prototype,"labelFixed",2),o([l({type:String,attribute:"help-text"})],t.prototype,"helpText",2),o([l({type:String,attribute:"invalid-text"})],t.prototype,"customInvalidText",2),o([r()],t.prototype,"_isPopoverOpen",2),o([r()],t.prototype,"_additionalSelectedOptionCount",2),o([a(".selected-options")],t.prototype,"selectedOptionsContainer",2),o([v(".selected-options li")],t.prototype,"selectedOptionsItems",2),o([a(".popover")],t.prototype,"_popover",2),o([a(".select-input")],t.prototype,"_selectInput",2),o([h("bl-select")],t.prototype,"_onBlSelect",2),o([r()],t.prototype,"_selectedOptions",2),o([r()],t.prototype,"dirty",2),o([a(".select-input")],t.prototype,"validationTarget",2),t=o([u("bl-select")],t);export{t as a};
42
+ //# sourceMappingURL=chunk-3KKF66FB.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-primary-background);--border-color:var(--bl-color-border);--border-focus-color:var(--bl-color-primary-hover);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--label-color:var(--bl-color-content-secondary);--placeholder-color:var(--bl-color-content-tertiary);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-tertiary);--menu-height:250px;--popover-position:var(--bl-popover-position,fixed)}:host([size='large']) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-content-passive)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-hover);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:0;min-width:100%}.placeholder{color:var(--placeholder-color);padding-left:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}.remove-all{display:none}.remove-all::after{content:'';position:absolute;left:1.5rem;bottom:4px;height:1rem;border-left:1px solid var(--bl-color-border)}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-secondary)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-content-passive)}.select-open .select-input,.select-input:focus-visible{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-left:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:', '}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .selected-options li{color:var(--bl-color-content-passive)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-2xs);margin-left:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}legend,label{max-width:max-content;padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);right:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:all ease-in .1s;pointer-events:none;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal)}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color)}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}`;\nexport default styles;\n", "import {\n autoUpdate,\n computePosition,\n flip,\n MiddlewareState,\n offset,\n size,\n} from '@floating-ui/dom';\nimport { FormControlMixin, requiredValidator } from '@open-wc/form-control';\nimport { FormValue } from '@open-wc/form-helpers';\nimport 'element-internals-polyfill';\nimport { CSSResultGroup, html, LitElement, PropertyValues } from 'lit';\nimport { customElement, property, query, queryAll, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport '../icon/bl-icon';\nimport style from '../select/bl-select.css';\nimport '../select/option/bl-select-option';\nimport type BlSelectOption from './option/bl-select-option';\n\nexport interface ISelectOption<T> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = 'medium' | 'large' | 'small';\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty --bl-popover-position - Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element. Default value is `fixed`\n */\n@customElement('bl-select')\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n static shadowRootOptions = {...LitElement.shadowRootOptions, delegatesFocus: true};\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== '';\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({})\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = 'medium';\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed', reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text' })\n customInvalidText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @query('.selected-options')\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll('.selected-options li')\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query('.popover')\n private _popover: HTMLElement;\n\n @query('.select-input')\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event('bl-select') private _onBlSelect: EventDispatcher<ISelectOption<ValueType>[]>;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement('select');\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query('.select-input')\n validationTarget: HTMLElement;\n\n open() {\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener('click', this._interactOutsideHandler, true);\n document.addEventListener('focus', this._interactOutsideHandler, true);\n }\n\n close() {\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener('click', this._interactOutsideHandler, true);\n document.removeEventListener('focus', this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === 'BL-SELECT')?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: 'bottom',\n strategy: 'fixed',\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty('--left', `${x}px`);\n this._popover.style.setProperty('--top', `${y}px`);\n });\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener('submit', (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(item => html`<li>${item.textContent}</li>`)}\n </ul>`;\n const removeButton = html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`;\n\n return html`<fieldset\n class=${classMap({\n 'select-input': true,\n 'has-overflowed-options': this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? '-1' : 0}\"\n ?autofocus=${this.autofocus}\n @click=${this.togglePopover}\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${this.multiple ? removeButton : null}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n render() {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : '';\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : '';\n\n const label = this.label ? html`<label>${this.label}</label>` : '';\n\n return html`<div\n class=${classMap({\n 'select-wrapper': true,\n 'select-open': this.opened,\n 'selected': this._selectedOptions.length > 0,\n 'invalid': !this.validity.valid,\n 'dirty': this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : '-1')}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n >\n <slot></slot>\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && ['Enter', 'Space'].includes(event.code)) {\n this.togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && ['ArrowDown', 'ArrowUp'].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === 'Escape') {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && ['ArrowDown', 'ArrowUp'].includes(event.code)) {\n event.code === 'ArrowDown' && this.focusedOptionIndex++;\n event.code === 'ArrowUp' && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.options.length - 1)\n );\n\n this.options[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n }\n\n private togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n this._onBlSelect(\n this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n )\n );\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._handleSelectEvent();\n this._isPopoverOpen = false;\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._connectedOptions\n .filter(option => option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = null;\n this._additionalSelectedOptionCount = 0;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n this.value = '' as ValueType;\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has('multiple') &&\n typeof _changedProperties.get('multiple') === 'boolean'\n ) {\n this.value = null;\n }\n\n this._checkAdditionalItemCount();\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-select': BlSelect;\n }\n}\n"],
5
+ "mappings": "6YACO,IAAMA,EAASC,ohLACfC,EAAQF,ECoCf,IAAqBG,EAArB,cAA4EC,EAC1EC,CACF,CAAE,CAFF,kCAgEE,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,cAAW,GAMX,eAAY,GAMZ,gBAAa,GAgBb,KAAQ,eAAiB,GAGzB,KAAQ,+BAAiC,EAmBzC,KAAQ,kBAAiD,CAAC,EAE1D,KAAQ,gBAA0C,KAsBlD,KAAQ,iBAAgD,CAAC,EAGzD,KAAQ,MAAQ,GA+ChB,KAAQ,wBAA2BC,GAAmC,CApPx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S,QAAS,EAAK,CAAC,GA3EvBpB,EA4EnB,wBAMAiC,EAAA,CADCb,EAAS,CAAE,KAAM,OAAQ,CAAC,GAjFRpB,EAkFnB,wBAMAiC,EAAA,CADCb,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAvFvBpB,EAwFnB,yBAMAiC,EAAA,CADCb,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GA7FjDpB,EA8FnB,0BAMAiC,EAAA,CADCb,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,GAnG/BpB,EAoGnB,wBAMAiC,EAAA,CADCb,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GAzGlCpB,EA0GnB,iCAIQiC,EAAA,CADPC,EAAM,GA7GYlC,EA8GX,8BAGAiC,EAAA,CADPC,EAAM,GAhHYlC,EAiHX,8CAGAiC,EAAA,CADPE,EAAM,mBAAmB,GAnHPnC,EAoHX,wCAGAiC,EAAA,CADPb,EAAS,sBAAsB,GAtHbpB,EAuHX,oCAGAiC,EAAA,CADPE,EAAM,UAAU,GAzHEnC,EA0HX,wBAGAiC,EAAA,CADPE,EAAM,eAAe,GA5HHnC,EA6HX,4BAKoBiC,EAAA,CAA3B9B,EAAM,WAAW,GAlICH,EAkIS,2BA0BpBiC,EAAA,CADPC,EAAM,GA3JYlC,EA4JX,gCAGAiC,EAAA,CADPC,EAAM,GA9JYlC,EA+JX,qBA8BRiC,EAAA,CADCE,EAAM,eAAe,GA5LHnC,EA6LnB,gCA7LmBA,EAArBiC,EAAA,CADCb,EAAc,WAAW,GACLpB",
6
+ "names": ["styles", "i", "bl_select_default", "BlSelect", "FormControlMixin", "s", "event", "_a", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "P", "z", "b", "O", "k", "args", "x", "y", "e", "inputSelectedOptions", "item", "removeButton", "o", "invalidMessage", "helpMessage", "label", "l", "optionItem", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "t", "i"]
7
+ }
@@ -0,0 +1,46 @@
1
+ import{a as m}from"./chunk-XQN3H7RG.js";import{a as f}from"./chunk-EPJ347EQ.js";import{a as g}from"./chunk-DJOD4BTL.js";import{a as u}from"./chunk-ZEBKUNFE.js";import{a as p}from"./chunk-OLPYXE2P.js";import{a}from"./chunk-KPAWUBRO.js";import{a as n}from"./chunk-23UFIOHV.js";import{a as h,b as l,f as d,g as b,h as i,i as c,j as v}from"./chunk-57PTZNIL.js";import{a as t}from"./chunk-NZ3RGSR6.js";var T=h`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-border);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-content-primary-contrast);--autofill-bg-color:var(--bl-color-accent-primary-background);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size='large']) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size='small']) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:0;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));background-color:var(--background-color);border-radius:var(--bl-size-3xs);margin:0;width:0;min-width:100%}:host([disabled]) .wrapper{cursor:not-allowed;--background-color:var(--bl-color-secondary-background);--text-color:var(--bl-color-content-passive)}.wrapper:has(input:autofill){--background-color:var(--autofill-bg-color)}.wrapper:has(input:-webkit-autofill){--background-color:var(--autofill-bg-color)}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;max-width:max-content;transition:all ease-in .1s;font:var(--input-font);top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-content-tertiary)}.has-icon label{right:calc(var(--padding-horizontal) + var(--icon-size) + var(--padding-vertical))}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}input{width:100%;align-self:stretch;outline:0;border:0;padding:0;padding-left:var(--label-padding);font:var(--input-font);color:var(--text-color);-webkit-text-fill-color:var(--text-color);background-color:transparent}input::-webkit-credentials-auto-fill-button{color:red}:where(.wrapper:focus-within,.wrapper.has-value) input{padding-left:var(--label-padding)}input:disabled{cursor:not-allowed}input:autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-right:var(--label-padding)}bl-icon:not(.reveal-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name='eye_on']{display:inline-block}.password-visible bl-icon[name='eye_on']{display:none}.password-visible bl-icon[name='eye_off']{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-content-tertiary);-webkit-text-fill-color:var(--bl-color-content-tertiary)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out .4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-content-tertiary);-webkit-text-fill-color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;left:calc(var(--padding-horizontal) - var(--label-padding));right:calc(var(--padding-horizontal) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(:focus-within,.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}.dirty.invalid .custom-icon ~ .error-icon{display:none}`,y=T;var e=class extends g(d){constructor(){super(...arguments);this.type="text";this.value="";this.required=!1;this.autofocus=!1;this.size="medium";this.disabled=!1;this.labelFixed=!1;this.onKeydown=r=>{r.code==="Enter"&&this.form&&u(this.form)};this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1;this.passwordVisible=!1;this.inputId=Math.random().toString(36).substring(2)}static get styles(){return[y]}connectedCallback(){var r;super.connectedCallback(),this.addEventListener("keydown",this.onKeydown),this.addEventListener("invalid",this.onError),(r=this.form)==null||r.addEventListener("submit",()=>{this.reportValidity()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeydown),this.removeEventListener("invalid",this.onError)}textVisibilityToggle(){this.passwordVisible=!this.passwordVisible}validityCallback(){var r;return this.customInvalidText||((r=this.validationTarget)==null?void 0:r.validationMessage)}reportValidity(){return this.dirty=!0,this.checkValidity()}inputHandler(r){let o=r.target.value;this.value=o,this.onInput(o)}changeHandler(r){let o=r.target.value;this.dirty=!0,this.value=o,this.onChange(o)}firstUpdated(){this.setValue(this.value)}async updated(r){r.has("value")&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}render(){let r=this.checkValidity()?"":l`<p id="errorMessage" aria-live="polite" class="invalid-text">
2
+ ${this.validationMessage}
3
+ </p>`,o=this.helpText?l`<p id="helpText" class="help-text">${this.helpText}</p>`:"",x=this.icon?l`<bl-icon class="custom-icon" name="${this.icon}"></bl-icon>`:"",w=this.label?l`<label for=${this.inputId}>${this.label}</label>`:"",s=this.type==="password",k=s?l`<bl-button
4
+ size="small"
5
+ kind="neutral"
6
+ variant="tertiary"
7
+ class="${p({"reveal-button":!0,"password-visible":this.passwordVisible})}"
8
+ aria-label="Toggle password reveal"
9
+ @bl-click="${this.textVisibilityToggle}"
10
+ >
11
+ <bl-icon class="reveal-icon" slot="icon" name="eye_on"></bl-icon>
12
+ <bl-icon class="reveal-icon" slot="icon" name="eye_off"></bl-icon>
13
+ </bl-button>`:"",z={wrapper:!0,dirty:this.dirty,invalid:!this.checkValidity(),"has-icon":s||this.icon||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""},$=this.passwordVisible?"text":"password",E=s?$:this.type;return l`<div class=${p(z)}>
14
+ ${w}
15
+ <fieldset class="input-wrapper">
16
+ <legend><span>${this.label}</span></legend>
17
+ <input
18
+ id=${this.inputId}
19
+ type=${E}
20
+ .value=${f(this.value)}
21
+ inputmode="${a(this.inputmode)}"
22
+ ?autofocus=${this.autofocus}
23
+ autocomplete="${a(this.autocomplete)}"
24
+ placeholder="${a(this.placeholder)}"
25
+ minlength="${a(this.minlength)}"
26
+ maxlength="${a(this.maxlength)}"
27
+ min="${a(this.min)}"
28
+ max="${a(this.max)}"
29
+ pattern="${a(this.pattern)}"
30
+ step="${a(this.step)}"
31
+ ?required=${this.required}
32
+ ?disabled=${this.disabled}
33
+ @change=${this.changeHandler}
34
+ @input=${this.inputHandler}
35
+ aria-invalid=${this.checkValidity()?"false":"true"}
36
+ aria-describedby=${a(this.helpText?"helpText":void 0)}
37
+ aria-errormessage=${a(this.checkValidity()?void 0:"errorMessage")}
38
+ />
39
+ <div class="icon">
40
+ ${k} ${x}
41
+ <bl-icon class="error-icon" name="alert"></bl-icon>
42
+ </div>
43
+ </fieldset>
44
+ <div class="hint">${r} ${o}</div>
45
+ </div>`}};e.shadowRootOptions={...d.shadowRootOptions,delegatesFocus:!0},e.formControlValidators=m,t([v("input")],e.prototype,"validationTarget",2),t([i({reflect:!0})],e.prototype,"name",2),t([i({reflect:!0})],e.prototype,"type",2),t([i({reflect:!0})],e.prototype,"label",2),t([i({reflect:!0})],e.prototype,"placeholder",2),t([i({reflect:!0})],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"required",2),t([i({type:Number,reflect:!0})],e.prototype,"minlength",2),t([i({type:Number,reflect:!0})],e.prototype,"maxlength",2),t([i({type:Number,reflect:!0})],e.prototype,"min",2),t([i({type:Number,reflect:!0})],e.prototype,"max",2),t([i({type:String,reflect:!0})],e.prototype,"pattern",2),t([i({type:Number,reflect:!0})],e.prototype,"step",2),t([i({type:String,reflect:!0})],e.prototype,"autocomplete",2),t([i({type:String,reflect:!0})],e.prototype,"inputmode",2),t([i({type:Boolean,reflect:!0})],e.prototype,"autofocus",2),t([i({type:String,reflect:!0})],e.prototype,"icon",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),t([i({type:String,attribute:"invalid-text",reflect:!0})],e.prototype,"customInvalidText",2),t([i({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),t([n("bl-change")],e.prototype,"onChange",2),t([n("bl-input")],e.prototype,"onInput",2),t([n("bl-invalid")],e.prototype,"onInvalid",2),t([c()],e.prototype,"dirty",2),t([c()],e.prototype,"passwordVisible",2),e=t([b("bl-input")],e);export{e as a};
46
+ //# sourceMappingURL=chunk-GXSB4E6R.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/input/bl-input.css", "../src/components/input/bl-input.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-border);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-content-primary-contrast);--autofill-bg-color:var(--bl-color-accent-primary-background);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size='large']) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size='small']) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:0;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));background-color:var(--background-color);border-radius:var(--bl-size-3xs);margin:0;width:0;min-width:100%}:host([disabled]) .wrapper{cursor:not-allowed;--background-color:var(--bl-color-secondary-background);--text-color:var(--bl-color-content-passive)}.wrapper:has(input:autofill){--background-color:var(--autofill-bg-color)}.wrapper:has(input:-webkit-autofill){--background-color:var(--autofill-bg-color)}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;max-width:max-content;transition:all ease-in .1s;font:var(--input-font);top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-content-tertiary)}.has-icon label{right:calc(var(--padding-horizontal) + var(--icon-size) + var(--padding-vertical))}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}input{width:100%;align-self:stretch;outline:0;border:0;padding:0;padding-left:var(--label-padding);font:var(--input-font);color:var(--text-color);-webkit-text-fill-color:var(--text-color);background-color:transparent}input::-webkit-credentials-auto-fill-button{color:red}:where(.wrapper:focus-within,.wrapper.has-value) input{padding-left:var(--label-padding)}input:disabled{cursor:not-allowed}input:autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-right:var(--label-padding)}bl-icon:not(.reveal-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name='eye_on']{display:inline-block}.password-visible bl-icon[name='eye_on']{display:none}.password-visible bl-icon[name='eye_off']{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-content-tertiary);-webkit-text-fill-color:var(--bl-color-content-tertiary)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out .4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-content-tertiary);-webkit-text-fill-color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;left:calc(var(--padding-horizontal) - var(--label-padding));right:calc(var(--padding-horizontal) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(:focus-within,.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}.dirty.invalid .custom-icon ~ .error-icon{display:none}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { FormControlMixin } from '@open-wc/form-control';\nimport { submit } from '@open-wc/form-helpers';\nimport { live } from 'lit/directives/live.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport { innerInputValidators } from '../../utilities/form-control';\nimport 'element-internals-polyfill';\nimport '../icon/bl-icon';\nimport '../button/bl-button';\n\nimport style from './bl-input.css';\n\nexport type InputSize = 'small' | 'medium' | 'large';\n/**\n * @tag bl-input\n * @summary Baklava Input component\n */\n@customElement('bl-input')\nexport default class BlInput extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n static shadowRootOptions = {...LitElement.shadowRootOptions, delegatesFocus: true};\n\n static formControlValidators = innerInputValidators;\n\n @query('input')\n validationTarget: HTMLInputElement;\n\n /**\n * Sets name of the input\n */\n @property({ reflect: true })\n name?: string;\n\n /**\n * Type of the input. It's used to set `type` attribute of native input inside. Only `text`, `number` and `password` is supported for now.\n */\n @property({ reflect: true })\n type: 'text' | 'password' | 'number' | 'tel' | 'url' = 'text';\n\n /**\n * Sets label of the input\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets placeholder of the input\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets initial value of the input\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * Makes input a mandatory field\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Sets minimum length of the input\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets maximum length of the input\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets the smallest number can be entered to a `number` input\n */\n @property({ type: Number, reflect: true })\n min?: number;\n\n /**\n * Sets the biggest number can be entered to a `number` input\n */\n @property({ type: Number, reflect: true })\n max?: number;\n\n /**\n * Sets a regex pattern form the input validation\n */\n @property({ type: String, reflect: true })\n pattern?: string;\n\n /**\n * Sets the increase and decrease step to a `number` input\n */\n @property({ type: Number, reflect: true })\n step?: number;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: string;\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the custom icon name. `bl-icon` component is used to show an icon\n */\n @property({ type: String, reflect: true })\n icon?: string;\n\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = 'medium';\n\n /**\n * Disables the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed', reflect: true })\n labelFixed = false;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text', reflect: true })\n customInvalidText?: string;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text', reflect: true })\n helpText?: string;\n\n /**\n * Fires when an alteration to the element's value is committed by the user. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.\n */\n @event('bl-change') private onChange: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event('bl-input') private onInput: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event('bl-invalid') private onInvalid: EventDispatcher<ValidityState>;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('keydown', this.onKeydown);\n this.addEventListener('invalid', this.onError);\n\n this.form?.addEventListener('submit', () => {\n this.reportValidity();\n });\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this.onKeydown);\n this.removeEventListener('invalid', this.onError);\n }\n\n private onKeydown = (event: KeyboardEvent): void => {\n if (event.code === 'Enter' && this.form) {\n submit(this.form);\n }\n };\n\n private onError = (): void => {\n this.onInvalid(this.internals.validity);\n };\n\n @state() private dirty = false;\n\n @state() private passwordVisible = false;\n\n private textVisibilityToggle() {\n this.passwordVisible = !this.passwordVisible;\n }\n\n validityCallback(): string | void {\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n private inputHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.value = value;\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.dirty = true;\n this.value = value;\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n }\n\n protected async updated(changedProperties: PropertyValues) {\n if (changedProperties.has('value')) {\n this.setValue(this.value);\n\n await this.validationComplete;\n\n this.requestUpdate();\n }\n }\n\n private inputId = Math.random().toString(36).substring(2);\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : ``;\n const helpMessage = this.helpText\n ? html`<p id=\"helpText\" class=\"help-text\">${this.helpText}</p>`\n : ``;\n\n const icon = this.icon ? html`<bl-icon class=\"custom-icon\" name=\"${this.icon}\"></bl-icon>` : '';\n const label = this.label ? html`<label for=${this.inputId}>${this.label}</label>` : '';\n const passwordInput = this.type === 'password';\n\n const revealButton = passwordInput\n ? html`<bl-button\n size=\"small\"\n kind=\"neutral\"\n variant=\"tertiary\"\n class=\"${classMap({\n 'reveal-button': true,\n 'password-visible': this.passwordVisible,\n })}\"\n aria-label=\"Toggle password reveal\"\n @bl-click=\"${this.textVisibilityToggle}\"\n >\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_on\"></bl-icon>\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_off\"></bl-icon>\n </bl-button>`\n : '';\n\n const classes = {\n 'wrapper': true,\n 'dirty': this.dirty,\n 'invalid': !this.checkValidity(),\n 'has-icon': passwordInput || this.icon || (this.dirty && !this.checkValidity()),\n 'has-value': this.value !== null && this.value !== '',\n };\n\n const passwordType = this.passwordVisible ? 'text' : 'password';\n const inputType = passwordInput ? passwordType : this.type;\n\n return html`<div class=${classMap(classes)}>\n ${label}\n <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <input\n id=${this.inputId}\n type=${inputType}\n .value=${live(this.value)}\n inputmode=\"${ifDefined(this.inputmode)}\"\n ?autofocus=${this.autofocus}\n autocomplete=\"${ifDefined(this.autocomplete)}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n maxlength=\"${ifDefined(this.maxlength)}\"\n min=\"${ifDefined(this.min)}\"\n max=\"${ifDefined(this.max)}\"\n pattern=\"${ifDefined(this.pattern)}\"\n step=\"${ifDefined(this.step)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n aria-invalid=${this.checkValidity() ? 'false' : 'true'}\n aria-describedby=${ifDefined(this.helpText ? 'helpText' : undefined)}\n aria-errormessage=${ifDefined(this.checkValidity() ? undefined : 'errorMessage')}\n />\n <div class=\"icon\">\n ${revealButton} ${icon}\n <bl-icon class=\"error-icon\" name=\"alert\"></bl-icon>\n </div>\n </fieldset>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-input': BlInput;\n }\n}\n"],
5
+ "mappings": "6YACO,IAAMA,EAASC,iqKACfC,EAAQF,ECmBf,IAAqBG,EAArB,cAAqCC,EAAiBC,CAAU,CAAE,CAAlE,kCAsBE,UAAuD,OAkBvD,WAAQ,GAMR,cAAW,GAsDX,eAAY,GAYZ,UAAmB,SAMnB,cAAW,GAMX,gBAAa,GA6Cb,KAAQ,UAAaC,GAA+B,CAC9CA,EAAM,OAAS,SAAW,KAAK,MACjCC,EAAO,KAAK,IAAI,CAEpB,EAEA,KAAQ,QAAU,IAAY,CAC5B,KAAK,UAAU,KAAK,UAAU,QAAQ,CACxC,EAES,KAAQ,MAAQ,GAEhB,KAAQ,gBAAkB,GA4CnC,KAAQ,QAAU,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,EAhOxD,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAsJA,mBAA0B,CA9K5B,IAAAC,EA+KI,MAAM,kBAAkB,EACxB,KAAK,iBAAiB,UAAW,KAAK,SAAS,EAC/C,KAAK,iBAAiB,UAAW,KAAK,OAAO,GAE7CA,EAAA,KAAK,OAAL,MAAAA,EAAW,iBAAiB,SAAU,IAAM,CAC1C,KAAK,eAAe,CACtB,EACF,CAEA,sBAA6B,CAC3B,MAAM,qBAAqB,EAC3B,KAAK,oBAAoB,UAAW,KAAK,SAAS,EAClD,KAAK,oBAAoB,UAAW,KAA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,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GA3HjDxB,EA4HnB,0BAMAsB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,QAAS,EAAK,CAAC,GAjIjDxB,EAkInB,iCAMAsB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAvI9CxB,EAwInB,wBAK4BsB,EAAA,CAA3BnB,EAAM,WAAW,GA7ICH,EA6IS,wBAKDsB,EAAA,CAA1BnB,EAAM,UAAU,GAlJEH,EAkJQ,uBAKEsB,EAAA,CAA5BnB,EAAM,YAAY,GAvJAH,EAuJU,yBA4BZsB,EAAA,CAAhBG,EAAM,GAnLYzB,EAmLF,qBAEAsB,EAAA,CAAhBG,EAAM,GArLYzB,EAqLF,+BArLEA,EAArBsB,EAAA,CADCE,EAAc,UAAU,GACJxB",
6
+ "names": ["styles", "i", "bl_input_default", "BlInput", "FormControlMixin", "s", "event", "submit", "bl_input_default", "_a", "value", "changedProperties", "invalidMessage", "y", "helpMessage", "icon", "label", "passwordInput", "revealButton", "o", "classes", "passwordType", "inputType", "l", "innerInputValidators", "__decorateClass", "i", "e", "t"]
7
+ }
@@ -0,0 +1,37 @@
1
+ import{b as $}from"./chunk-XQN3H7RG.js";import{a as z}from"./chunk-EPJ347EQ.js";import{a as w}from"./chunk-DJOD4BTL.js";import{a as x}from"./chunk-OLPYXE2P.js";import{a as n}from"./chunk-KPAWUBRO.js";import{a as m,b as f,c as y}from"./chunk-RLMJN536.js";import{a as c}from"./chunk-23UFIOHV.js";import{a as u,b as s,c as v,f as p,g,h as a,i as h,j as b}from"./chunk-57PTZNIL.js";import{a as e}from"./chunk-NZ3RGSR6.js";var k=f(class extends y{constructor(o){var l;if(super(o),o.type!==m.ATTRIBUTE||o.name!=="style"||((l=o.strings)===null||l===void 0?void 0:l.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((l,r)=>{let i=o[r];return i==null?l:l+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[l]){let{style:r}=o.element;if(this.vt===void 0){this.vt=new Set;for(let i in l)this.vt.add(i);return this.render(l)}this.vt.forEach(i=>{l[i]==null&&(this.vt.delete(i),i.includes("-")?r.removeProperty(i):r[i]="")});for(let i in l){let d=l[i];d!=null&&(this.vt.add(i),i.includes("-")?r.setProperty(i,d):r[i]=d)}return v}});var V=u`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count:;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height),var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);--border-color:var(--bl-color-border);--background-color:var(--bl-color-content-primary-contrast);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:0;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:0;border-radius:var(--border-radius);color:var(--bl-color-content-primary);resize:vertical;background-color:transparent;display:block}:host([size='large']) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-secondary-background);color:var(--bl-color-content-tertiary);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-secondary-background)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height),var(--maxrow-height))}.wrapper:focus-within{--border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{--border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in .1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-content-tertiary)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within,.wrapper.has-value) label{top:0;left:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within,.wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint>*{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-content-secondary);margin-left:auto}:where(.max-len-invalid,.dirty.invalid) .hint>.counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:where(.dirty.max-len-invalid,.dirty.invalid) .hint>.invalid-text{display:inline-block}.dirty.invalid .hint>.help-text{display:none}`,C=V;var t=class extends w(p){constructor(){super(...arguments);this.name="";this.required=!1;this.disabled=!1;this.expand=!1;this.size="medium";this.labelFixed=!1;this.characterCounter=!1;this.value="";this.rows=4;this.autofocus=!1;this.spellchecker="false";this.customScrollHeight=null;this.inputId=Math.random().toString(36).substring(2);this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[C]}connectedCallback(){var r;super.connectedCallback(),(r=this.internals.form)==null||r.addEventListener("submit",()=>{this.reportValidity()})}inputHandler(r){this.autoResize();let i=r.target.value;this.value=i,this.onInput(i)}changeHandler(r){let i=r.target.value;this.dirty=!0,this.value=i,this.onChange(i)}firstUpdated(){this.setValue(this.value),this.autoResize()}async updated(r){r.has("rows")&&this.autoResize(),r.has("value")&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}reportValidity(){return this.dirty=!0,this.checkValidity()}valueChangedCallback(r){this.value=r}validityCallback(){var r;return this.customInvalidText||((r=this.validationTarget)==null?void 0:r.validationMessage)}autoResize(){if(!this.expand)return;this.validationTarget.style.height="auto";let r=this.validationTarget.scrollHeight;this.customScrollHeight=`${r}px`,this.validationTarget.style.removeProperty("height")}render(){let r=this.internals.validity.tooLong,i=this.checkValidity()?"":s`<p class="invalid-text">${this.validationMessage}</p>`,d=this.helpText?s`<p class="help-text">${this.helpText}</p>`:"",S=this.label?s`<label for="${this.inputId}">${this.label}</label>`:"",E=this.characterCounter&&this.maxlength?`${this.value.length}/${this.maxlength}`:this.characterCounter?`${this.value.length}`:"",M=this.characterCounter?s`<p class="counter-text">${E}</p>`:"",R={wrapper:!0,"has-value":this.value!==null&&this.value!=="",dirty:this.dirty,"max-len-invalid":r,invalid:!this.checkValidity()},H={"--row-count":`${this.rows}`,"--maxrow-count":this.maxRows?`${this.maxRows}`:null,"--scroll-height":this.customScrollHeight};return s`
2
+ <div style=${k(H)} class=${x(R)}>
3
+ ${S}
4
+ <fieldset class="input-wrapper">
5
+ <legend><span>${this.label}</span></legend>
6
+ <textarea
7
+ id="${this.inputId}"
8
+ name="${n(this.name)}"
9
+ .value=${z(this.value)}
10
+ ?autofocus=${this.autofocus}
11
+ autocomplete="${n(this.autocomplete)}"
12
+ inputmode="${n(this.inputmode)}"
13
+ placeholder="${n(this.placeholder)}"
14
+ minlength="${n(this.minlength)}"
15
+ rows="${n(this.rows)}"
16
+ ?required=${this.required}
17
+ ?disabled=${this.disabled}
18
+ spellcheck="${this.spellchecker}"
19
+ @change=${this.changeHandler}
20
+ @input=${this.inputHandler}
21
+ @invalid=${this.onError}
22
+ >
23
+ </textarea>
24
+ </fieldset>
25
+ <div class="hint">${i}${d}${M}</div>
26
+ </div>
27
+ `}};t.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0},t.formControlValidators=$,e([b("textarea")],t.prototype,"validationTarget",2),e([a({type:String,reflect:!0})],t.prototype,"name",2),e([a({type:Boolean,reflect:!0})],t.prototype,"required",2),e([a({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([a({type:Boolean,reflect:!0})],t.prototype,"expand",2),e([a({type:Number,reflect:!0,attribute:"max-rows"})],t.prototype,"maxRows",2),e([a({type:String,reflect:!0})],t.prototype,"size",2),e([a({reflect:!0})],t.prototype,"label",2),e([a({type:Boolean,attribute:"label-fixed",reflect:!0})],t.prototype,"labelFixed",2),e([a({reflect:!0})],t.prototype,"placeholder",2),e([a({type:Boolean,attribute:"character-counter",reflect:!0})],t.prototype,"characterCounter",2),e([a({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),e([a({type:String,attribute:"invalid-text",reflect:!0})],t.prototype,"customInvalidText",2),e([a({type:Number,reflect:!0})],t.prototype,"minlength",2),e([a({type:Number,reflect:!0})],t.prototype,"maxlength",2),e([a({reflect:!0})],t.prototype,"value",2),e([a({type:Number,reflect:!0})],t.prototype,"rows",2),e([a({type:String,reflect:!0})],t.prototype,"inputmode",2),e([a({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),e([a({type:String,reflect:!0})],t.prototype,"autocomplete",2),e([a({type:String,reflect:!0,attribute:"spellcheck"})],t.prototype,"spellchecker",2),e([c("bl-input")],t.prototype,"onInput",2),e([c("bl-change")],t.prototype,"onChange",2),e([c("bl-invalid")],t.prototype,"onInvalid",2),e([h()],t.prototype,"customScrollHeight",2),e([h()],t.prototype,"dirty",2),t=e([g("bl-textarea")],t);export{t as a};
28
+ /*! Bundled license information:
29
+
30
+ lit-html/directives/style-map.js:
31
+ (**
32
+ * @license
33
+ * Copyright 2018 Google LLC
34
+ * SPDX-License-Identifier: BSD-3-Clause
35
+ *)
36
+ */
37
+ //# sourceMappingURL=chunk-S7FKMIX4.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../node_modules/lit-html/src/directives/style-map.ts", "../src/components/textarea/bl-textarea.css", "../src/components/textarea/bl-textarea.ts"],
4
+ "sourcesContent": ["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\n\n/**\n * A key-value set of CSS properties and values.\n *\n * The key should be either a valid CSS property name string, like\n * `'background-color'`, or a valid JavaScript camel case property name\n * for CSSStyleDeclaration like `backgroundColor`.\n */\nexport interface StyleInfo {\n [name: string]: string | undefined | null;\n}\n\nclass StyleMapDirective extends Directive {\n _previousStyleProperties?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'style' ||\n (partInfo.strings?.length as number) > 2\n ) {\n throw new Error(\n 'The `styleMap` directive must be used in the `style` attribute ' +\n 'and must be the only part in the attribute.'\n );\n }\n }\n\n render(styleInfo: Readonly<StyleInfo>) {\n return Object.keys(styleInfo).reduce((style, prop) => {\n const value = styleInfo[prop];\n if (value == null) {\n return style;\n }\n // Convert property names from camel-case to dash-case, i.e.:\n // `backgroundColor` -> `background-color`\n // Vendor-prefixed names need an extra `-` appended to front:\n // `webkitAppearance` -> `-webkit-appearance`\n // Exception is any property name containing a dash, including\n // custom properties; we assume these are already dash-cased i.e.:\n // `--my-button-color` --> `--my-button-color`\n prop = prop\n .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')\n .toLowerCase();\n return style + `${prop}:${value};`;\n }, '');\n }\n\n override update(part: AttributePart, [styleInfo]: DirectiveParameters<this>) {\n const {style} = part.element as HTMLElement;\n\n if (this._previousStyleProperties === undefined) {\n this._previousStyleProperties = new Set();\n for (const name in styleInfo) {\n this._previousStyleProperties.add(name);\n }\n return this.render(styleInfo);\n }\n\n // Remove old properties that no longer exist in styleInfo\n // We use forEach() instead of for-of so that re don't require down-level\n // iteration.\n this._previousStyleProperties!.forEach((name) => {\n // If the name isn't in styleInfo or it's null/undefined\n if (styleInfo[name] == null) {\n this._previousStyleProperties!.delete(name);\n if (name.includes('-')) {\n style.removeProperty(name);\n } else {\n // Note reset using empty string (vs null) as IE11 does not always\n // reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = '';\n }\n }\n });\n\n // Add or update properties\n for (const name in styleInfo) {\n const value = styleInfo[name];\n if (value != null) {\n this._previousStyleProperties.add(name);\n if (name.includes('-')) {\n style.setProperty(name, value);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = value;\n }\n }\n }\n return noChange;\n }\n}\n\n/**\n * A directive that applies CSS properties to an element.\n *\n * `styleMap` can only be used in the `style` attribute and must be the only\n * expression in the attribute. It takes the property names in the\n * {@link StyleInfo styleInfo} object and adds the property values as CSS\n * properties. Property names with dashes (`-`) are assumed to be valid CSS\n * property names and set on the element's style object using `setProperty()`.\n * Names without dashes are assumed to be camelCased JavaScript property names\n * and set on the element's style object using property assignment, allowing the\n * style object to translate JavaScript-style names to CSS property names.\n *\n * For example `styleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\n * '0'})` sets the `background-color`, `border-top` and `--size` properties.\n *\n * @param styleInfo\n * @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}\n */\nexport const styleMap = directive(StyleMapDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {StyleMapDirective};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count:;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height),var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);--border-color:var(--bl-color-border);--background-color:var(--bl-color-content-primary-contrast);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:0;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:0;border-radius:var(--border-radius);color:var(--bl-color-content-primary);resize:vertical;background-color:transparent;display:block}:host([size='large']) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-secondary-background);color:var(--bl-color-content-tertiary);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-secondary-background)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height),var(--maxrow-height))}.wrapper:focus-within{--border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{--border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in .1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-content-tertiary)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within,.wrapper.has-value) label{top:0;left:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within,.wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint>*{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-content-secondary);margin-left:auto}:where(.max-len-invalid,.dirty.invalid) .hint>.counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:where(.dirty.max-len-invalid,.dirty.invalid) .hint>.invalid-text{display:inline-block}.dirty.invalid .hint>.help-text{display:none}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlMixin } from '@open-wc/form-control';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { live } from 'lit/directives/live.js';\nimport { textAreaValidators } from '../../utilities/form-control';\nimport 'element-internals-polyfill';\nimport style from './bl-textarea.css';\n\nexport type TextareaSize = 'small' | 'medium' | 'large';\n/**\n * @tag bl-textarea\n * @summary Baklava Textarea component\n */\n@customElement('bl-textarea')\nexport default class BlTextarea extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n static shadowRootOptions = {...LitElement.shadowRootOptions, delegatesFocus: true};\n\n static formControlValidators = textAreaValidators;\n\n @query('textarea')\n validationTarget: HTMLTextAreaElement;\n\n /**\n * Name of textarea\n */\n @property({ type: String, reflect: true })\n name = '';\n\n /**\n * Makes textarea a mandatory field\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Disables the textarea\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets expandity\n */\n @property({ type: Boolean, reflect: true })\n expand = false;\n\n /**\n * Sets max row when expand is true\n */\n @property({ type: Number, reflect: true, attribute: 'max-rows' })\n maxRows?: number;\n\n /**\n * Sets textarea size.\n */\n @property({ type: String, reflect: true })\n size?: TextareaSize = 'medium';\n\n /**\n * Sets label of the textarea\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed', reflect: true })\n labelFixed = false;\n\n /**\n * Sets placeholder of the textarea\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Enables showing character counter.\n */\n @property({ type: Boolean, attribute: 'character-counter', reflect: true })\n characterCounter = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text', reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text', reflect: true })\n customInvalidText?: string;\n\n /**\n * Sets minimum length of the textarea\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets max length of textarea\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets initial value of the textarea\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * Sets textarea visible row count.\n */\n @property({ type: Number, reflect: true })\n rows?: number = 4;\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: string;\n\n /**\n * Enables/disables spellcheck feature inside the textarea\n */\n @property({ type: String, reflect: true, attribute: 'spellcheck' })\n spellchecker: 'true' | 'false' = 'false';\n\n @event('bl-input') private onInput: EventDispatcher<string>;\n\n @event('bl-change') private onChange: EventDispatcher<string>;\n\n @event('bl-invalid') private onInvalid: EventDispatcher<ValidityState>;\n\n @state()\n private customScrollHeight: string | null = null;\n\n private inputId = Math.random().toString(36).substring(2);\n\n connectedCallback() {\n super.connectedCallback();\n this.internals.form?.addEventListener('submit', () => {\n this.reportValidity();\n });\n }\n\n private onError = (): void => {\n this.onInvalid(this.internals.validity);\n };\n\n private inputHandler(event: Event) {\n this.autoResize();\n\n const value = (event.target as HTMLTextAreaElement).value;\n this.value = value;\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLTextAreaElement).value;\n\n this.dirty = true;\n this.value = value;\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n this.autoResize();\n }\n\n protected async updated(changedProperties: PropertyValues) {\n if (changedProperties.has('rows')) {\n this.autoResize();\n }\n\n if (changedProperties.has('value')) {\n this.setValue(this.value);\n\n await this.validationComplete;\n\n this.requestUpdate();\n }\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n valueChangedCallback(value: string): void {\n this.value = value;\n }\n\n validityCallback(): string | void {\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n private autoResize() {\n if (!this.expand) {\n return;\n }\n\n this.validationTarget.style.height = 'auto';\n const scrollHeight = this.validationTarget.scrollHeight;\n this.customScrollHeight = `${scrollHeight}px`;\n this.validationTarget.style.removeProperty('height');\n }\n\n @state() private dirty = false;\n\n render(): TemplateResult {\n const maxLengthInvalid = this.internals.validity.tooLong;\n const invalidMessage = !this.checkValidity()\n ? html`<p class=\"invalid-text\">${this.validationMessage}</p>`\n : ``;\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : ``;\n\n const label = this.label ? html`<label for=\"${this.inputId}\">${this.label}</label>` : '';\n const characterCounterText =\n this.characterCounter && this.maxlength\n ? `${this.value.length}/${this.maxlength}`\n : this.characterCounter\n ? `${this.value.length}`\n : '';\n const characterCounter = this.characterCounter\n ? html`<p class=\"counter-text\">${characterCounterText}</p>`\n : '';\n\n const wrapperClasses = {\n 'wrapper': true,\n 'has-value': this.value !== null && this.value !== '',\n 'dirty': this.dirty,\n 'max-len-invalid': maxLengthInvalid,\n 'invalid': !this.checkValidity(),\n };\n\n const styles = {\n '--row-count': `${this.rows}`,\n '--maxrow-count': this.maxRows ? `${this.maxRows}` : null,\n '--scroll-height': this.customScrollHeight,\n };\n\n return html`\n <div style=${styleMap(styles)} class=${classMap(wrapperClasses)}>\n ${label}\n <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <textarea\n id=\"${this.inputId}\"\n name=\"${ifDefined(this.name)}\"\n .value=${live(this.value)}\n ?autofocus=${this.autofocus}\n autocomplete=\"${ifDefined(this.autocomplete)}\"\n inputmode=\"${ifDefined(this.inputmode)}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n rows=\"${ifDefined(this.rows)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n spellcheck=\"${this.spellchecker}\"\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n @invalid=${this.onError}\n >\n </textarea>\n </fieldset>\n <div class=\"hint\">${invalidMessage}${helpMessage}${characterCounter}</div>\n </div>\n `;\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-textarea': BlTextarea;\n }\n}\n"],
5
+ "mappings": "saA+HaA,EAAWC,EArGxB,cAAgCC,CAAAA,CAG9BC,YAAYC,EAAAA,CAAAA,IAAAA,EAEV,GADAC,MAAMD,CAAAA,EAEJA,EAASE,OAASC,EAASC,WAC3BJ,EAASK,OAAS,WACjBC,EAAAN,EAASO,WADDF,MACCE,IAAAA,OAAAA,OAAAA,EAASC,QAAoB,EAEvC,MAAUC,MACR,4GAAA,CAIL,CAEDC,OAAOC,EAAAA,CACL,OAAOC,OAAOC,KAAKF,CAAAA,EAAWG,OAAO,CAACC,EAAOC,IAAAA,CAC3C,IAAMC,EAAQN,EAAUK,CAAAA,EACxB,OAAIC,GAAS,KACJF,EAYFA,EAAQ,GAHfC,EAAOA,EACJE,QAAQ,oCAAqC,KAAA,EAC7CC,YAAAA,KACuBF,IAAQ,EACjC,EAAA,CACJ,CAEQG,OAAOC,EAAAA,CAAsBV,CAA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AA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GArHvBvB,EAsHnB,yBAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GA3HtBvB,EA4HnB,4BAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,GAAM,UAAW,YAAa,CAAC,GAjI/CvB,EAkInB,4BAE2BsB,EAAA,CAA1BjB,EAAM,UAAU,GApIEL,EAoIQ,uBAECsB,EAAA,CAA3BjB,EAAM,WAAW,GAtICL,EAsIS,wBAECsB,EAAA,CAA5BjB,EAAM,YAAY,GAxIAL,EAwIU,yBAGrBsB,EAAA,CADPE,EAAM,GA1IYxB,EA2IX,kCA0ESsB,EAAA,CAAhBE,EAAM,GArNYxB,EAqNF,qBArNEA,EAArBsB,EAAA,CADCC,EAAc,aAAa,GACPvB",
6
+ "names": ["styleMap", "directive", "Directive", "constructor", "partInfo", "super", "type", "PartType", "ATTRIBUTE", "name", "_a", "strings", "length", "Error", "render", "styleInfo", "Object", "keys", "reduce", "style", "prop", "value", "replace", "toLowerCase", "update", "part", "element", "this", "_previousStyleProperties", "Set", "add", "forEach", "delete", "includes", "removeProperty", "setProperty", "noChange", "styles", "i", "bl_textarea_default", "BlTextarea", "FormControlMixin", "s", "bl_textarea_default", "_a", "event", "value", "changedProperties", "scrollHeight", "maxLengthInvalid", "invalidMessage", "y", "helpMessage", "label", "characterCounterText", "characterCounter", "wrapperClasses", "styles", "i", "o", "l", "textAreaValidators", "__decorateClass", "e", "t"]
7
+ }
@@ -1,5 +1,5 @@
1
- import{a as m,b as u,c as g,d as f,e as w,f as y,g as E,h as x}from"./chunk-ANYJUR6Q.js";import{a as b}from"./chunk-OLPYXE2P.js";import{a as n}from"./chunk-23UFIOHV.js";import{a as d,b as h,f as v,g as c,h as i,i as s,j as a}from"./chunk-57PTZNIL.js";import{a as r}from"./chunk-NZ3RGSR6.js";var O=d`.popover{--arrow-display:var(--bl-popover-arrow-display,none);--background-color:var(--bl-popover-background-color,var(--bl-color-primary-background));--border-color:var(--bl-popover-border-color,var(--bl-color-primary-hover));--padding:var(--bl-popover-padding,var(--bl-size-m));--border-radius:var(--bl-popover-border-radius,var(--bl-size-3xs));--position:var(--bl-popover-position,fixed);position:var(--position);box-sizing:border-box;border:1px solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-content-primary)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--bl-size-2xs);height:var(--bl-size-2xs);transform:rotate(var(--arrow-rotation));border:1px solid var(--border-color);border-bottom:0;border-right:0}`,_=O;var t=class extends v{constructor(){super(...arguments);this.placement="bottom";this.fitSize=!1;this.offset=8;this._visible=!1;this._handleClickOutside=e=>{let o=e.composedPath();!o.includes(this._target)&&!o.includes(this)&&this.hide()}}static get styles(){return[_]}connectedCallback(){super.connectedCallback(),this._handlePopoverShowEvent=this._handlePopoverShowEvent.bind(this),this._handleKeyupEvent=this._handleKeyupEvent.bind(this),this._handleClickOutside=this._handleClickOutside.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.popoverAutoUpdateCleanup&&this.popoverAutoUpdateCleanup()}getMiddleware(){let e=[];return e.push(f(this.offset),g(),u(),w({padding:4})),this.fitSize&&e.push(y({apply(o){o.elements.floating&&o.elements.reference&&Object.assign(o.elements.floating.style,{width:`${o.elements.reference.getBoundingClientRect().width}px`})}})),e.push(m({element:this.arrow,padding:5})),e}setPopover(){this.target&&(this.popoverAutoUpdateCleanup=E(this.target,this.popover,()=>{x(this.target,this.popover,{placement:this.placement,strategy:"fixed",middleware:this.getMiddleware()}).then(({x:e,y:o,placement:k,middlewareData:l})=>{if(Object.assign(this.popover.style,{left:`${e}px`,top:`${o}px`}),l.arrow){let{x:C,y:M}=l.arrow;Object.assign(this.arrow.style,{left:`${C}px`,top:`${M}px`});let S={top:"bottom",right:"left",bottom:"top",left:"right"},L={top:"225deg",right:"315deg",bottom:"45deg",left:"135deg"},p=k.split("-")[0],z=S[p];this.arrow.style.setProperty(z,"-5px"),this.arrow.style.setProperty("--arrow-rotation",L[p])}})}))}get target(){return this._target}set target(e){typeof e=="string"?this._target=document.getElementById(e):e instanceof Element?this._target=e:console.warn("BlPopover target only accepts an Element instance or a string id of a DOM element.")}show(){this._visible=!0,this.setPopover(),this.onBlPopoverShow(""),document.addEventListener("click",this._handleClickOutside),document.addEventListener("keyup",this._handleKeyupEvent),document.addEventListener("bl-popover-show",this._handlePopoverShowEvent)}hide(){this._visible=!1,document.removeEventListener("click",this._handleClickOutside),document.removeEventListener("keyup",this._handleKeyupEvent),document.removeEventListener("bl-popover-show",this._handlePopoverShowEvent),this.onBlPopoverHide("")}get visible(){return this._visible}_handlePopoverShowEvent(e){e.target!==this&&this.hide()}_handleKeyupEvent(e){e.key==="Escape"&&this.visible&&(this.hide(),e.preventDefault())}render(){let e=b({popover:!0,visible:this._visible});return h`<div class=${e}>
1
+ import{a as m,b as u,c as g,d as f,e as w,f as y,g as E,h as x}from"./chunk-ANYJUR6Q.js";import{a as b}from"./chunk-OLPYXE2P.js";import{a as n}from"./chunk-23UFIOHV.js";import{a as d,b as h,f as v,g as c,h as i,i as s,j as a}from"./chunk-57PTZNIL.js";import{a as r}from"./chunk-NZ3RGSR6.js";var O=d`.popover{--arrow-display:var(--bl-popover-arrow-display,none);--background-color:var(--bl-popover-background-color,var(--bl-color-primary-background));--border-color:var(--bl-popover-border-color,var(--bl-color-primary-hover));--padding:var(--bl-popover-padding,var(--bl-size-m));--border-radius:var(--bl-popover-border-radius,var(--bl-size-3xs));--position:var(--bl-popover-position,fixed);position:var(--position);box-sizing:border-box;border:1px solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-content-primary)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--bl-size-2xs);height:var(--bl-size-2xs);transform:rotate(var(--arrow-rotation));border:1px solid var(--border-color);border-bottom:0;border-right:0}`,_=O;var t=class extends v{constructor(){super(...arguments);this.placement="bottom";this.fitSize=!1;this.offset=8;this._visible=!1;this._handleClickOutside=e=>{let o=e.composedPath();!o.includes(this._target)&&!o.includes(this)&&this.hide()}}static get styles(){return[_]}connectedCallback(){super.connectedCallback(),this._handlePopoverShowEvent=this._handlePopoverShowEvent.bind(this),this._handleKeyupEvent=this._handleKeyupEvent.bind(this),this._handleClickOutside=this._handleClickOutside.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.popoverAutoUpdateCleanup&&this.popoverAutoUpdateCleanup()}getMiddleware(){let e=[];return e.push(f(this.offset),g(),u(),w({padding:4})),this.fitSize&&e.push(y({apply(o){o.elements.floating&&o.elements.reference&&Object.assign(o.elements.floating.style,{"min-width":`${o.elements.reference.getBoundingClientRect().width}px`})}})),e.push(m({element:this.arrow,padding:5})),e}setPopover(){this.target&&(this.popoverAutoUpdateCleanup=E(this.target,this.popover,()=>{x(this.target,this.popover,{placement:this.placement,strategy:"fixed",middleware:this.getMiddleware()}).then(({x:e,y:o,placement:k,middlewareData:l})=>{if(Object.assign(this.popover.style,{left:`${e}px`,top:`${o}px`}),l.arrow){let{x:C,y:M}=l.arrow;Object.assign(this.arrow.style,{left:`${C}px`,top:`${M}px`});let S={top:"bottom",right:"left",bottom:"top",left:"right"},L={top:"225deg",right:"315deg",bottom:"45deg",left:"135deg"},p=k.split("-")[0],z=S[p];this.arrow.style.setProperty(z,"-5px"),this.arrow.style.setProperty("--arrow-rotation",L[p])}})}))}get target(){return this._target}set target(e){typeof e=="string"?this._target=document.getElementById(e):e instanceof Element?this._target=e:console.warn("BlPopover target only accepts an Element instance or a string id of a DOM element.")}show(){this._visible=!0,this.setPopover(),this.onBlPopoverShow(""),document.addEventListener("click",this._handleClickOutside),document.addEventListener("keyup",this._handleKeyupEvent),document.addEventListener("bl-popover-show",this._handlePopoverShowEvent)}hide(){this._visible=!1,document.removeEventListener("click",this._handleClickOutside),document.removeEventListener("keyup",this._handleKeyupEvent),document.removeEventListener("bl-popover-show",this._handlePopoverShowEvent),this.onBlPopoverHide("")}get visible(){return this._visible}_handlePopoverShowEvent(e){e.target!==this&&this.hide()}_handleKeyupEvent(e){e.key==="Escape"&&this.visible&&(this.hide(),e.preventDefault())}render(){let e=b({popover:!0,visible:this._visible});return h`<div class=${e}>
2
2
  <slot id="popover" aria-live=${this._visible?"polite":"off"}></slot>
3
3
  <div class="arrow" aria-hidden="true"></div>
4
4
  </div>`}};r([a(".popover")],t.prototype,"popover",2),r([a(".arrow")],t.prototype,"arrow",2),r([i({type:String})],t.prototype,"placement",2),r([s()],t.prototype,"_target",2),r([i({type:Boolean,attribute:"fit-size"})],t.prototype,"fitSize",2),r([i({type:Number})],t.prototype,"offset",2),r([s()],t.prototype,"_visible",2),r([n("bl-popover-show")],t.prototype,"onBlPopoverShow",2),r([n("bl-popover-hide")],t.prototype,"onBlPopoverHide",2),r([i()],t.prototype,"target",1),t=r([c("bl-popover")],t);export{t as a};
5
- //# sourceMappingURL=chunk-NYLRILUV.js.map
5
+ //# sourceMappingURL=chunk-SEMLCEAH.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/components/popover/bl-popover.css", "../src/components/popover/bl-popover.ts"],
4
- "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`.popover{--arrow-display:var(--bl-popover-arrow-display,none);--background-color:var(--bl-popover-background-color,var(--bl-color-primary-background));--border-color:var(--bl-popover-border-color,var(--bl-color-primary-hover));--padding:var(--bl-popover-padding,var(--bl-size-m));--border-radius:var(--bl-popover-border-radius,var(--bl-size-3xs));--position:var(--bl-popover-position,fixed);position:var(--position);box-sizing:border-box;border:1px solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-content-primary)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--bl-size-2xs);height:var(--bl-size-2xs);transform:rotate(var(--arrow-rotation));border:1px solid var(--border-color);border-bottom:0;border-right:0}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport {\n computePosition,\n flip,\n shift,\n offset,\n arrow,\n inline,\n autoUpdate,\n size,\n Middleware,\n MiddlewareState,\n} from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport style from './bl-popover.css';\nimport { event, EventDispatcher } from '../../utilities/event';\n\nexport type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n | 'right-start'\n | 'right'\n | 'right-end';\n\n/**\n * @tag bl-popover\n * @summary Baklava Popover component\n *\n * @cssproperty [--bl-popover-arrow-display=none] - Sets the display of popovers arrow. Set as `block` to make arrow visible.\n * @cssproperty [--bl-popover-background-color=--bl-color-primary-background] - Sets the background color of popover.\n * @cssproperty [--bl-popover-border-color=--bl-color-primary-hover] - Sets the border color of popover.\n * @cssproperty [--bl-popover-padding=--bl-size-m] - Sets the padding of popover.\n * @cssproperty [--bl-popover-border-radius=--bl-size-3xs] - Sets the border radius of popover.\n * @cssproperty [--bl-popover-position=fixed] - Sets the position of popover. You can set it to `absolute` if parent element is a fixed positioned element like drawer or dialog.\n */\n@customElement('bl-popover')\nexport default class BlPopover extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query('.popover') private popover: HTMLElement;\n @query('.arrow') private arrow: HTMLElement;\n\n /**\n * Sets placement of the popover\n */\n @property({ type: String })\n placement: Placement = 'bottom';\n\n /**\n * Target elements state\n */\n @state() _target: string | Element;\n\n /**\n * Sets size of popover same as trigger element\n */\n @property({ type: Boolean, attribute: 'fit-size' })\n fitSize = false;\n\n /**\n * Sets the distance between popover and target/trigger element\n */\n @property({ type: Number })\n offset = 8;\n\n /**\n * Visibility state\n */\n @state() private _visible = false;\n\n /**\n * Fires when the popover is shown\n */\n @event('bl-popover-show') private onBlPopoverShow: EventDispatcher<string>;\n\n /**\n * Fires when popover becomes hidden\n */\n @event('bl-popover-hide') private onBlPopoverHide: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n\n this._handlePopoverShowEvent = this._handlePopoverShowEvent.bind(this);\n this._handleKeyupEvent = this._handleKeyupEvent.bind(this);\n this._handleClickOutside = this._handleClickOutside.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.popoverAutoUpdateCleanup && this.popoverAutoUpdateCleanup();\n }\n\n private getMiddleware(): Middleware[] {\n const middlewareParams: Middleware[] = [];\n middlewareParams.push(offset(this.offset), inline(), flip(), shift({ padding: 4 }));\n\n if (this.fitSize) {\n middlewareParams.push(\n size({\n apply(args: MiddlewareState) {\n if (args.elements.floating && args.elements.reference) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n }\n },\n })\n );\n }\n\n middlewareParams.push(arrow({ element: this.arrow, padding: 5 }));\n\n return middlewareParams;\n }\n\n private _handleClickOutside = (event: MouseEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n if (!eventPath.includes(this._target as HTMLElement) && !eventPath.includes(this)) {\n this.hide();\n }\n };\n\n private popoverAutoUpdateCleanup: () => void;\n\n private setPopover() {\n if (this.target) {\n this.popoverAutoUpdateCleanup = autoUpdate(this.target as Element, this.popover, () => {\n computePosition(this.target as Element, this.popover, {\n placement: this.placement,\n strategy: 'fixed',\n middleware: this.getMiddleware(),\n }).then(({ x, y, placement, middlewareData }) => {\n Object.assign(this.popover.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n\n if (middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(this.arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`,\n });\n\n const arrowFlipDirections = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n };\n const arrowRotateDegrees = {\n top: '225deg',\n right: '315deg',\n bottom: '45deg',\n left: '135deg',\n };\n const popoverPlacement = placement.split('-')[0] as keyof typeof arrowFlipDirections;\n const arrowDirection = arrowFlipDirections[popoverPlacement];\n\n this.arrow.style.setProperty(arrowDirection, '-5px');\n this.arrow.style.setProperty('--arrow-rotation', arrowRotateDegrees[popoverPlacement]);\n }\n });\n });\n }\n }\n\n /**\n * Sets the target element of the popover to align and trigger.\n * It can be a string id of the target element or can be a direct Element reference of it.\n */\n @property()\n get target(): string | Element {\n return this._target;\n }\n\n set target(value: string | Element) {\n if (typeof value === 'string') {\n this._target = document.getElementById(value) as Element;\n } else if (value instanceof Element) {\n this._target = value;\n } else {\n console.warn(\n 'BlPopover target only accepts an Element instance or a string id of a DOM element.'\n );\n }\n }\n\n /**\n * Shows popover\n */\n show() {\n this._visible = true;\n this.setPopover();\n this.onBlPopoverShow('');\n document.addEventListener('click', this._handleClickOutside);\n document.addEventListener('keyup', this._handleKeyupEvent);\n document.addEventListener('bl-popover-show', this._handlePopoverShowEvent);\n }\n\n /**\n * Hides popover\n */\n hide() {\n this._visible = false;\n document.removeEventListener('click', this._handleClickOutside);\n document.removeEventListener('keyup', this._handleKeyupEvent);\n document.removeEventListener('bl-popover-show', this._handlePopoverShowEvent);\n this.onBlPopoverHide('');\n }\n\n /**\n * Gives the visibility status of the popover\n */\n get visible(): boolean {\n return this._visible;\n }\n\n private _handlePopoverShowEvent(event: Event) {\n if (event.target !== this) {\n this.hide();\n }\n }\n\n private _handleKeyupEvent(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.hide();\n event.preventDefault();\n }\n }\n\n render(): TemplateResult {\n const classes = classMap({\n popover: true,\n visible: this._visible,\n });\n\n return html`<div class=${classes}>\n <slot id=\"popover\" aria-live=${this._visible ? 'polite' : 'off'}></slot>\n <div class=\"arrow\" aria-hidden=\"true\"></div>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-popover': BlPopover;\n }\n}\n"],
5
- "mappings": "mSACO,IAAMA,EAASC,+hCACfC,EAAQF,EC0Cf,IAAqBG,EAArB,cAAuCC,CAAW,CAAlD,kCAYE,eAAuB,SAWvB,aAAU,GAMV,YAAS,EAKA,KAAQ,SAAW,GAiD5B,KAAQ,oBAAuBC,GAAsB,CACnD,IAAMC,EAAYD,EAAM,aAAa,EACjC,CAACC,EAAU,SAAS,KAAK,OAAsB,GAAK,CAACA,EAAU,SAAS,IAAI,GAC9E,KAAK,KAAK,CAEd,EAvFA,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA2CA,mBAAoB,CAClB,MAAM,kBAAkB,EAExB,KAAK,wBAA0B,KAAK,wBAAwB,KAAK,IAAI,EACrE,KAAK,kBAAoB,KAAK,kBAAkB,KAAK,IAAI,EACzD,KAAK,oBAAsB,KAAK,oBAAoB,KAAK,IAAI,CAC/D,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EAE3B,KAAK,0BAA4B,KAAK,yBAAyB,CACjE,CAEQ,eAA8B,CACpC,IAAMC,EAAiC,CAAC,EACxC,OAAAA,EAAiB,KAAKC,EAAO,KAAK,MAAM,EAAGC,EAAO,EAAGC,EAAK,EAAGC,EAAM,CAAE,QAAS,CAAE,CAAC,CAAC,EAE9E,KAAK,SACPJ,EAAiB,KACfK,EAAK,CACH,MAAMC,EAAuB,CACvBA,EAAK,SAAS,UAAYA,EAAK,SAAS,WAC1C,OAAO,OAAOA,EAAK,SAAS,SAAS,MAAO,CAC1C,MAAO,GAAGA,EAAK,SAAS,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CAAjC1B,EAAM,iBAAiB,GA5CLF,EA4Ce,+BAiG9B4B,EAAA,CADHE,EAAS,GA5IS9B,EA6If,sBA7IeA,EAArB4B,EAAA,CADCE,EAAc,YAAY,GACN9B",
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`.popover{--arrow-display:var(--bl-popover-arrow-display,none);--background-color:var(--bl-popover-background-color,var(--bl-color-primary-background));--border-color:var(--bl-popover-border-color,var(--bl-color-primary-hover));--padding:var(--bl-popover-padding,var(--bl-size-m));--border-radius:var(--bl-popover-border-radius,var(--bl-size-3xs));--position:var(--bl-popover-position,fixed);position:var(--position);box-sizing:border-box;border:1px solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-content-primary)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--bl-size-2xs);height:var(--bl-size-2xs);transform:rotate(var(--arrow-rotation));border:1px solid var(--border-color);border-bottom:0;border-right:0}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport {\n computePosition,\n flip,\n shift,\n offset,\n arrow,\n inline,\n autoUpdate,\n size,\n Middleware,\n MiddlewareState,\n} from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport style from './bl-popover.css';\nimport { event, EventDispatcher } from '../../utilities/event';\n\nexport type Placement =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n | 'right-start'\n | 'right'\n | 'right-end';\n\n/**\n * @tag bl-popover\n * @summary Baklava Popover component\n *\n * @cssproperty [--bl-popover-arrow-display=none] - Sets the display of popovers arrow. Set as `block` to make arrow visible.\n * @cssproperty [--bl-popover-background-color=--bl-color-primary-background] - Sets the background color of popover.\n * @cssproperty [--bl-popover-border-color=--bl-color-primary-hover] - Sets the border color of popover.\n * @cssproperty [--bl-popover-padding=--bl-size-m] - Sets the padding of popover.\n * @cssproperty [--bl-popover-border-radius=--bl-size-3xs] - Sets the border radius of popover.\n * @cssproperty [--bl-popover-position=fixed] - Sets the position of popover. You can set it to `absolute` if parent element is a fixed positioned element like drawer or dialog.\n */\n@customElement('bl-popover')\nexport default class BlPopover extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query('.popover') private popover: HTMLElement;\n @query('.arrow') private arrow: HTMLElement;\n\n /**\n * Sets placement of the popover\n */\n @property({ type: String })\n placement: Placement = 'bottom';\n\n /**\n * Target elements state\n */\n @state() _target: string | Element;\n\n /**\n * Sets size of popover same as trigger element\n */\n @property({ type: Boolean, attribute: 'fit-size' })\n fitSize = false;\n\n /**\n * Sets the distance between popover and target/trigger element\n */\n @property({ type: Number })\n offset = 8;\n\n /**\n * Visibility state\n */\n @state() private _visible = false;\n\n /**\n * Fires when the popover is shown\n */\n @event('bl-popover-show') private onBlPopoverShow: EventDispatcher<string>;\n\n /**\n * Fires when popover becomes hidden\n */\n @event('bl-popover-hide') private onBlPopoverHide: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n\n this._handlePopoverShowEvent = this._handlePopoverShowEvent.bind(this);\n this._handleKeyupEvent = this._handleKeyupEvent.bind(this);\n this._handleClickOutside = this._handleClickOutside.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.popoverAutoUpdateCleanup && this.popoverAutoUpdateCleanup();\n }\n\n private getMiddleware(): Middleware[] {\n const middlewareParams: Middleware[] = [];\n middlewareParams.push(offset(this.offset), inline(), flip(), shift({ padding: 4 }));\n\n if (this.fitSize) {\n middlewareParams.push(\n size({\n apply(args: MiddlewareState) {\n if (args.elements.floating && args.elements.reference) {\n Object.assign(args.elements.floating.style, {\n 'min-width': `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n }\n },\n })\n );\n }\n\n middlewareParams.push(arrow({ element: this.arrow, padding: 5 }));\n\n return middlewareParams;\n }\n\n private _handleClickOutside = (event: MouseEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n if (!eventPath.includes(this._target as HTMLElement) && !eventPath.includes(this)) {\n this.hide();\n }\n };\n\n private popoverAutoUpdateCleanup: () => void;\n\n private setPopover() {\n if (this.target) {\n this.popoverAutoUpdateCleanup = autoUpdate(this.target as Element, this.popover, () => {\n computePosition(this.target as Element, this.popover, {\n placement: this.placement,\n strategy: 'fixed',\n middleware: this.getMiddleware(),\n }).then(({ x, y, placement, middlewareData }) => {\n Object.assign(this.popover.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n\n if (middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(this.arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`,\n });\n\n const arrowFlipDirections = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n };\n const arrowRotateDegrees = {\n top: '225deg',\n right: '315deg',\n bottom: '45deg',\n left: '135deg',\n };\n const popoverPlacement = placement.split('-')[0] as keyof typeof arrowFlipDirections;\n const arrowDirection = arrowFlipDirections[popoverPlacement];\n\n this.arrow.style.setProperty(arrowDirection, '-5px');\n this.arrow.style.setProperty('--arrow-rotation', arrowRotateDegrees[popoverPlacement]);\n }\n });\n });\n }\n }\n\n /**\n * Sets the target element of the popover to align and trigger.\n * It can be a string id of the target element or can be a direct Element reference of it.\n */\n @property()\n get target(): string | Element {\n return this._target;\n }\n\n set target(value: string | Element) {\n if (typeof value === 'string') {\n this._target = document.getElementById(value) as Element;\n } else if (value instanceof Element) {\n this._target = value;\n } else {\n console.warn(\n 'BlPopover target only accepts an Element instance or a string id of a DOM element.'\n );\n }\n }\n\n /**\n * Shows popover\n */\n show() {\n this._visible = true;\n this.setPopover();\n this.onBlPopoverShow('');\n document.addEventListener('click', this._handleClickOutside);\n document.addEventListener('keyup', this._handleKeyupEvent);\n document.addEventListener('bl-popover-show', this._handlePopoverShowEvent);\n }\n\n /**\n * Hides popover\n */\n hide() {\n this._visible = false;\n document.removeEventListener('click', this._handleClickOutside);\n document.removeEventListener('keyup', this._handleKeyupEvent);\n document.removeEventListener('bl-popover-show', this._handlePopoverShowEvent);\n this.onBlPopoverHide('');\n }\n\n /**\n * Gives the visibility status of the popover\n */\n get visible(): boolean {\n return this._visible;\n }\n\n private _handlePopoverShowEvent(event: Event) {\n if (event.target !== this) {\n this.hide();\n }\n }\n\n private _handleKeyupEvent(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.hide();\n event.preventDefault();\n }\n }\n\n render(): TemplateResult {\n const classes = classMap({\n popover: true,\n visible: this._visible,\n });\n\n return html`<div class=${classes}>\n <slot id=\"popover\" aria-live=${this._visible ? 'polite' : 'off'}></slot>\n <div class=\"arrow\" aria-hidden=\"true\"></div>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-popover': BlPopover;\n }\n}\n"],
5
+ "mappings": "mSACO,IAAMA,EAASC,+hCACfC,EAAQF,EC0Cf,IAAqBG,EAArB,cAAuCC,CAAW,CAAlD,kCAYE,eAAuB,SAWvB,aAAU,GAMV,YAAS,EAKA,KAAQ,SAAW,GAiD5B,KAAQ,oBAAuBC,GAAsB,CACnD,IAAMC,EAAYD,EAAM,aAAa,EACjC,CAACC,EAAU,SAAS,KAAK,OAAsB,GAAK,CAACA,EAAU,SAAS,IAAI,GAC9E,KAAK,KAAK,CAEd,EAvFA,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA2CA,mBAAoB,CAClB,MAAM,kBAAkB,EAExB,KAAK,wBAA0B,KAAK,wBAAwB,KAAK,IAAI,EACrE,KAAK,kBAAoB,KAAK,kBAAkB,KAAK,IAAI,EACzD,KAAK,oBAAsB,KAAK,oBAAoB,KAAK,IAAI,CAC/D,CAEA,sBAAu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B,EAMM,qBAMzB4B,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GAXP9B,EAYnB,yBAKS4B,EAAA,CAARG,EAAM,GAjBY/B,EAiBV,uBAMT4B,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,UAAW,UAAW,CAAC,GAtB/B9B,EAuBnB,uBAMA4B,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GA5BP9B,EA6BnB,sBAKiB4B,EAAA,CAAhBG,EAAM,GAlCY/B,EAkCF,wBAKiB4B,EAAA,CAAjC1B,EAAM,iBAAiB,GAvCLF,EAuCe,+BAKA4B,EAAA,CAAjC1B,EAAM,iBAAiB,GA5CLF,EA4Ce,+BAiG9B4B,EAAA,CADHE,EAAS,GA5IS9B,EA6If,sBA7IeA,EAArB4B,EAAA,CADCE,EAAc,YAAY,GACN9B",
6
6
  "names": ["styles", "i", "bl_popover_default", "BlPopover", "s", "event", "eventPath", "bl_popover_default", "middlewareParams", "O", "T", "b", "D", "k", "args", "u", "P", "z", "x", "y", "placement", "middlewareData", "arrowX", "arrowY", "arrowFlipDirections", "arrowRotateDegrees", "popoverPlacement", "arrowDirection", "value", "classes", "o", "__decorateClass", "i", "e", "t"]
7
7
  }
@@ -0,0 +1,27 @@
1
+ import{a as m}from"./chunk-VYKKWEKI.js";import{a as l}from"./chunk-KPAWUBRO.js";import{a as n}from"./chunk-23UFIOHV.js";import{a as p,b as a,f as d,g as c,h as o,i as b,j as i}from"./chunk-57PTZNIL.js";import{a as e}from"./chunk-NZ3RGSR6.js";var k=p`:host{position:relative;display:inline-block}:host([kind='neutral']) bl-popover{--bl-popover-border-color:var(--bl-color-secondary)}:host([kind='success']) bl-popover{--bl-popover-border-color:var(--bl-color-success)}:host([kind='danger']) bl-popover{--bl-popover-border-color:var(--bl-color-danger)}`,f=k;var u="bl-dropdown",t=class extends d{constructor(){super(...arguments);this._isPopoverOpen=!1;this.label="Dropdown Button";this.variant="primary";this.kind="default";this.size="medium";this.disabled=!1;this.focusedOptionIndex=-1}static get styles(){return[f]}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown)}firstUpdated(){this._popover.target=this._button}get opened(){return this._isPopoverOpen}_handleClick(){!this._isPopoverOpen&&!this.disabled?this.open():this.close()}handleKeyDown(s){if(["ArrowDown","ArrowRight"].includes(s.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(s.key))this.focusedOptionIndex--;else if(s.key==="Escape"){this.focusedOptionIndex=-1,this.close();return}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.options.length-1)),this.options[this.focusedOptionIndex].focus(),s.preventDefault()}get options(){return[].slice.call(this.querySelectorAll(h))}open(){this._isPopoverOpen=!0,this._popover.show(),this.onOpen("Dropdown opened!")}close(){this._isPopoverOpen=!1,this._popover.visible&&this._popover.hide(),this.onClose("Dropdown closed!")}render(){return a`<bl-button
2
+ dropdown
3
+ .active=${this.opened}
4
+ ?disabled=${l(this.disabled)}
5
+ variant="${this.variant}"
6
+ kind="${this.kind}"
7
+ size="${this.size}"
8
+ aria-label="${l(this.label)}"
9
+ @bl-click="${this._handleClick}"
10
+ >
11
+ ${this.label}
12
+ </bl-button>
13
+ <bl-popover
14
+ fit-size
15
+ placement="bottom-start"
16
+ @bl-popover-hide="${this.close}"
17
+ >
18
+ <slot></slot>
19
+ </bl-popover> `}};e([i("bl-popover")],t.prototype,"_popover",2),e([i("bl-button")],t.prototype,"_button",2),e([b()],t.prototype,"_isPopoverOpen",2),e([o({type:String,reflect:!0})],t.prototype,"label",2),e([o({type:String,reflect:!0})],t.prototype,"variant",2),e([o({type:String,reflect:!0})],t.prototype,"kind",2),e([o({type:String,reflect:!0})],t.prototype,"size",2),e([o({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([n("bl-dropdown-open")],t.prototype,"onOpen",2),e([n("bl-dropdown-close")],t.prototype,"onClose",2),t=e([c(u)],t);var w=p`:host{width:100%;--bl-button-display:block;--bl-button-justify:start}`,v=w;var h="bl-dropdown-item",r=class extends d{static get styles(){return[v]}_handleClick(){this.onClick("Action clicked!")}focus(){this.menuElement.focus()}connectedCallback(){super.connectedCallback(),this.BlDropdownGroupField=this.closest(m),this.BlDropdownField=this.closest(u),!this.BlDropdownField&&!this.BlDropdownGroupField&&console.warn(`bl-dropdown-item is designed to be used inside a ${m} or ${u}`,this)}disconnectedCallback(){super.disconnectedCallback()}render(){return a`<bl-button
20
+ variant="tertiary"
21
+ kind="neutral"
22
+ icon="${l(this.icon)}"
23
+ role="menuitem"
24
+ @click="${this._handleClick}"
25
+ ><slot></slot>
26
+ </bl-button>`}};e([o({type:String})],r.prototype,"icon",2),e([n("bl-dropdown-item-click")],r.prototype,"onClick",2),e([i("[role=menuitem]")],r.prototype,"menuElement",2),r=e([c(h)],r);export{h as a,r as b,u as c,t as d};
27
+ //# sourceMappingURL=chunk-VQLW2744.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/dropdown/bl-dropdown.css", "../src/components/dropdown/bl-dropdown.ts", "../src/components/dropdown/item/bl-dropdown-item.css", "../src/components/dropdown/item/bl-dropdown-item.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{position:relative;display:inline-block}:host([kind='neutral']) bl-popover{--bl-popover-border-color:var(--bl-color-secondary)}:host([kind='success']) bl-popover{--bl-popover-border-color:var(--bl-color-success)}:host([kind='danger']) bl-popover{--bl-popover-border-color:var(--bl-color-danger)}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, TemplateResult } from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { event, EventDispatcher } from '../../utilities/event';\n\nimport style from './bl-dropdown.css';\n\nimport '../button/bl-button';\nimport BlButton, { ButtonSize, ButtonVariant, ButtonKind } from '../button/bl-button';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport BlDropdownItem, { blDropdownItemTag } from './item/bl-dropdown-item';\nimport BlPopover from '../popover/bl-popover';\n\nexport const blDropdownTag = 'bl-dropdown';\n\n/**\n * @tag bl-dropdown\n * @summary Baklava Dropdown component\n */\n@customElement(blDropdownTag)\nexport default class BlDropdown extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query('bl-popover')\n private _popover: BlPopover;\n\n @query('bl-button')\n private _button: BlButton;\n\n @state() private _isPopoverOpen = false;\n\n /**\n * Sets the dropdown button label\n */\n @property({ type: String, reflect: true })\n label = 'Dropdown Button';\n\n /**\n * Sets the dropdown button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = 'primary';\n\n /**\n * Sets the dropdown button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = 'default';\n\n /**\n * Sets the dropdown button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = 'medium';\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Fires when dropdown opened\n */\n @event('bl-dropdown-open') private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when dropdown closed\n */\n @event('bl-dropdown-close') private onClose: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('keydown', this.handleKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this.handleKeyDown);\n }\n\n firstUpdated() {\n // `_button` will be undefined during the initial render.\n // To ensure proper rendering, we set `_popover.target` after the template has been created.\n this._popover.target = this._button;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n private _handleClick() {\n !this._isPopoverOpen && !this.disabled ? this.open() : this.close();\n }\n\n private focusedOptionIndex = -1;\n\n private handleKeyDown(event: KeyboardEvent) {\n // Next action\n if (['ArrowDown', 'ArrowRight'].includes(event.key)) {\n this.focusedOptionIndex++;\n\n // Previous action\n } else if (['ArrowUp', 'ArrowLeft'].includes(event.key)) {\n this.focusedOptionIndex--;\n // Select action\n } else if (event.key === 'Escape') {\n this.focusedOptionIndex = -1;\n this.close();\n return;\n } else {\n // Other keys are not our interest here\n return;\n }\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.options.length - 1)\n );\n\n this.options[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n\n get options(): BlDropdownItem[] {\n return [].slice.call(this.querySelectorAll(blDropdownItemTag));\n }\n\n open() {\n this._isPopoverOpen = true;\n this._popover.show();\n this.onOpen('Dropdown opened!');\n }\n\n close() {\n this._isPopoverOpen = false;\n this._popover.visible && this._popover.hide();\n this.onClose('Dropdown closed!');\n }\n\n render(): TemplateResult {\n return html`<bl-button\n dropdown\n .active=${this.opened}\n ?disabled=${ifDefined(this.disabled)}\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n aria-label=\"${ifDefined(this.label)}\"\n @bl-click=\"${this._handleClick}\"\n >\n ${this.label}\n </bl-button>\n <bl-popover\n fit-size\n placement=\"bottom-start\"\n @bl-popover-hide=\"${this.close}\"\n >\n <slot></slot>\n </bl-popover> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blDropdownTag]: BlDropdown;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{width:100%;--bl-button-display:block;--bl-button-justify:start}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { event, EventDispatcher } from '../../../utilities/event';\nimport type BlDropdownGroup from '../group/bl-dropdown-group';\nimport type BlDropdown from '../bl-dropdown';\n\nimport { blDropdownGroupTag } from '../group/bl-dropdown-group';\nimport { blDropdownTag } from '../bl-dropdown';\n\nimport style from './bl-dropdown-item.css';\n\nimport '../../button/bl-button';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport BlButton from '../../button/bl-button';\n\nexport const blDropdownItemTag = 'bl-dropdown-item';\n\n/**\n * @tag bl-dropdown-item\n * @summary Baklava Dropdown Item component\n */\n@customElement(blDropdownItemTag)\nexport default class BlDropdownItem extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n\n @property({ type: String })\n icon?: string;\n\n @event('bl-dropdown-item-click') private onClick: EventDispatcher<string>;\n\n private _handleClick() {\n this.onClick('Action clicked!');\n }\n\n @query('[role=menuitem]') private menuElement: BlButton;\n\n /**\n * Focuses this action\n */\n focus() {\n this.menuElement.focus();\n }\n\n private BlDropdownGroupField: BlDropdownGroup | null;\n private BlDropdownField: BlDropdown | null;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.BlDropdownGroupField = this.closest<BlDropdownGroup>(blDropdownGroupTag);\n this.BlDropdownField = this.closest<BlDropdown>(blDropdownTag);\n\n if (!this.BlDropdownField && !this.BlDropdownGroupField) {\n console.warn(\n `bl-dropdown-item is designed to be used inside a ${blDropdownGroupTag} or ${blDropdownTag}`,\n this\n );\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n\n render(): TemplateResult {\n return html`<bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"${ifDefined(this.icon)}\"\n role=\"menuitem\"\n @click=\"${this._handleClick}\"\n ><slot></slot>\n </bl-button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blDropdownItemTag]: BlDropdownItem;\n }\n}\n"],
5
+ "mappings": "kPACO,IAAMA,EAASC,gTACfC,EAAQF,ECWR,IAAMG,EAAgB,cAORC,EAArB,cAAwCC,CAAW,CAAnD,kCAWW,KAAQ,eAAiB,GAMlC,WAAQ,kBAMR,aAAyB,UAMzB,UAAmB,UAMnB,UAAmB,SAMnB,cAAW,GAoCX,KAAQ,mBAAqB,GA5E7B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAkDA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,KAAK,iBAAiB,UAAW,KAAK,a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A,cAGG,EAAU,KAAK,IAAI;AAAA;AAAA,gBAEjB,KAAK;AAAA;AAAA,iBAGnB,CACF,EAhDEC,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GATPP,EAUnB,oBAEyCM,EAAA,CAAxCE,EAAM,wBAAwB,GAZZR,EAYsB,uBAMPM,EAAA,CAAjC,EAAM,iBAAiB,GAlBLN,EAkBe,2BAlBfA,EAArBM,EAAA,CADCC,EAAcR,CAAiB,GACXC",
6
+ "names": ["styles", "i", "bl_dropdown_default", "blDropdownTag", "BlDropdown", "s", "bl_dropdown_default", "event", "blDropdownItemTag", "y", "__decorateClass", "t", "e", "styles", "i", "bl_dropdown_item_default", "blDropdownItemTag", "BlDropdownItem", "s", "bl_dropdown_item_default", "blDropdownGroupTag", "blDropdownTag", "y", "__decorateClass", "e", "event"]
7
+ }