@warp-ds/elements 2.10.0-next.12 → 2.10.0-next.13

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 (74) hide show
  1. package/dist/packages/affix/affix.js +8 -8
  2. package/dist/packages/affix/affix.js.map +3 -3
  3. package/dist/packages/alert/alert.js +7 -7
  4. package/dist/packages/alert/alert.js.map +3 -3
  5. package/dist/packages/attention/attention.js +42 -21
  6. package/dist/packages/attention/attention.js.map +3 -3
  7. package/dist/packages/badge/badge.js +6 -6
  8. package/dist/packages/badge/badge.js.map +3 -3
  9. package/dist/packages/box/box.js +6 -6
  10. package/dist/packages/box/box.js.map +3 -3
  11. package/dist/packages/breadcrumbs/breadcrumbs.js +7 -7
  12. package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
  13. package/dist/packages/button/button.js +37 -16
  14. package/dist/packages/button/button.js.map +3 -3
  15. package/dist/packages/button/styles.js +18 -2
  16. package/dist/packages/card/card.js +8 -8
  17. package/dist/packages/card/card.js.map +3 -3
  18. package/dist/packages/checkbox/checkbox.js +9 -9
  19. package/dist/packages/checkbox/checkbox.js.map +3 -3
  20. package/dist/packages/combobox/combobox.js +9 -9
  21. package/dist/packages/combobox/combobox.js.map +3 -3
  22. package/dist/packages/datepicker/datepicker.js +22 -22
  23. package/dist/packages/datepicker/datepicker.js.map +3 -3
  24. package/dist/packages/expandable/expandable.js +14 -14
  25. package/dist/packages/expandable/expandable.js.map +3 -3
  26. package/dist/packages/link/link.js +40 -19
  27. package/dist/packages/link/link.js.map +3 -3
  28. package/dist/packages/link/styles.js +5 -0
  29. package/dist/packages/modal/modal.js +7 -7
  30. package/dist/packages/modal/modal.js.map +3 -3
  31. package/dist/packages/modal-footer/modal-footer.js +7 -7
  32. package/dist/packages/modal-footer/modal-footer.js.map +3 -3
  33. package/dist/packages/modal-header/modal-header.js +10 -10
  34. package/dist/packages/modal-header/modal-header.js.map +3 -3
  35. package/dist/packages/pagination/pagination.js +8 -8
  36. package/dist/packages/pagination/pagination.js.map +3 -3
  37. package/dist/packages/pill/pill.js +9 -9
  38. package/dist/packages/pill/pill.js.map +3 -3
  39. package/dist/packages/radio/radio.js +8 -8
  40. package/dist/packages/radio/radio.js.map +3 -3
  41. package/dist/packages/radio-group/radio-group.js +11 -11
  42. package/dist/packages/radio-group/radio-group.js.map +3 -3
  43. package/dist/packages/select/select.js +13 -13
  44. package/dist/packages/select/select.js.map +3 -3
  45. package/dist/packages/slider/slider.js +13 -13
  46. package/dist/packages/slider/slider.js.map +3 -3
  47. package/dist/packages/slider/styles.js +2 -2
  48. package/dist/packages/slider-thumb/slider-thumb.js +11 -11
  49. package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
  50. package/dist/packages/step/step.js +10 -10
  51. package/dist/packages/step/step.js.map +3 -3
  52. package/dist/packages/step-indicator/step-indicator.js +6 -6
  53. package/dist/packages/step-indicator/step-indicator.js.map +3 -3
  54. package/dist/packages/styles.js +4 -2
  55. package/dist/packages/switch/switch.js +6 -6
  56. package/dist/packages/switch/switch.js.map +3 -3
  57. package/dist/packages/tab/tab.js +7 -7
  58. package/dist/packages/tab/tab.js.map +3 -3
  59. package/dist/packages/tab-panel/tab-panel.js +5 -5
  60. package/dist/packages/tab-panel/tab-panel.js.map +3 -3
  61. package/dist/packages/tabs/tabs.js +6 -6
  62. package/dist/packages/tabs/tabs.js.map +3 -3
  63. package/dist/packages/textarea/textarea.js +10 -10
  64. package/dist/packages/textarea/textarea.js.map +3 -3
  65. package/dist/packages/textfield/textfield.js +10 -10
  66. package/dist/packages/textfield/textfield.js.map +3 -3
  67. package/dist/packages/toast/styles.js +2 -2
  68. package/dist/packages/toast/toast.js +12 -12
  69. package/dist/packages/toast/toast.js.map +3 -3
  70. package/dist/packages/toast-container/toast-container.js +8 -8
  71. package/dist/packages/toast-container/toast-container.js.map +3 -3
  72. package/dist/web-types.json +1 -1
  73. package/eik/index.js +16 -2455
  74. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var se=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var d=(t,e,r,o)=>{for(var a=o>1?void 0:o?le(e,r):e,s=t.length-1,i;s>=0;s--)(i=t[s])&&(a=(o?i(e,r,a):i(a))||a);return o&&a&&se(e,r,a),a};import{html as ie,LitElement as Te}from"lit";import{html as de,LitElement as be}from"lit";import{property as C,state as pe}from"lit/decorators.js";import{classMap as ge}from"lit/directives/class-map.js";import{css as ce}from"lit";var P=ce`
1
+ var ne=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var d=(t,e,r,o)=>{for(var a=o>1?void 0:o?se(e,r):e,s=t.length-1,i;s>=0;s--)(i=t[s])&&(a=(o?i(e,r,a):i(a))||a);return o&&a&&ne(e,r,a),a};import{html as ae,LitElement as $e}from"lit";import{html as ce,LitElement as de}from"lit";import{property as F,state as be}from"lit/decorators.js";import{classMap as pe}from"lit/directives/class-map.js";import{css as le}from"lit";var P=le`
2
2
  :host {
3
3
  display: inline-block;
4
4
  }
@@ -23,7 +23,7 @@ var se=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var d=(t,e,r
23
23
  --w-icon-size: 32px;
24
24
  }
25
25
 
26
- `;var M=new Map,ue='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function he(t,e={}){let r=e.responseParser??(o=>o.text());return M.has(t)||M.set(t,fetch(t).then(r)),M.get(t)}var g=class extends be{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let o=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${r}.svg`;try{let a=await he(o);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch{return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(ue,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",o=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},s=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return de`<div class="${ge(a)}" style="${s}" part="w-${o.toLowerCase()}">${this.svg}</div>`}};g.styles=[P],d([C({type:String,reflect:!0})],g.prototype,"name",2),d([C({type:String,reflect:!0})],g.prototype,"size",2),d([C({type:String,reflect:!0,useDefault:!0})],g.prototype,"locale",2),d([pe()],g.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",g);var y=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?y.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var u=t=>typeof t=="string",me=t=>typeof t=="function",R=new Map,X="en";function $(t){return[...Array.isArray(t)?t:[t],X]}function Y(t,e,r){let o=$(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return _(()=>z("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(u(e)?new Date(e):e)}function ve(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return Y(t,e,o)}function j(t,e,r){let o=$(t);return _(()=>z("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function I(t,e,r,{offset:o=0,...a}){let s=$(t),i=e?_(()=>z("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):_(()=>z("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return a[r]??a[i.select(r-o)]??a.other}function _(t,e){let r=t(),o=R.get(r);return o||(o=e(),R.set(r,o)),o}function z(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var Z=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,V=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),G="%__lingui_octothorpe__%",we=(t,e,r={})=>{let o=e||t,a=i=>typeof i=="object"?i:r[i],s=(i,n)=>{let l=Object.keys(r).length?a("number"):void 0,h=j(o,i,l);return n.replace(new RegExp(G,"g"),h)};return{plural:(i,n)=>{let{offset:l=0}=n,h=I(o,!1,i,n);return s(i-l,h)},selectordinal:(i,n)=>{let{offset:l=0}=n,h=I(o,!0,i,n);return s(i-l,h)},select:fe,number:(i,n)=>j(o,i,a(n)||{style:n}),date:(i,n)=>Y(o,i,a(n)||n),time:(i,n)=>ve(o,i,a(n)||n)}},fe=(t,e)=>e[t]??e.other;function xe(t,e,r){return(o={},a)=>{let s=we(e,r,a),i=(l,h=!1)=>Array.isArray(l)?l.reduce((f,x)=>{if(x==="#"&&h)return f+G;if(u(x))return f+x;let[N,m,D]=x,S={};m==="plural"||m==="selectordinal"||m==="select"?Object.entries(D).forEach(([F,ne])=>{S[F]=i(ne,m==="plural"||m==="selectordinal")}):S=D;let k;if(m){let F=s[m];k=F(o[N],S)}else k=o[N];return k==null?f:f+k},""):l,n=i(t);return u(n)&&Z.test(n)?V(n):u(n)?n:n?String(n):""}}var ke=Object.defineProperty,ye=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_e=(t,e,r)=>(ye(t,typeof e!="symbol"?e+"":e,r),r),O=class{constructor(){_e(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},ze=Object.defineProperty,Le=(t,e,r)=>e in t?ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e,r)=>(Le(t,typeof e!="symbol"?e+"":e,r),r),T=class extends O{constructor(e){super(),v(this,"_locale",""),v(this,"_locales"),v(this,"_localeData",{}),v(this,"_messages",{}),v(this,"_missing"),v(this,"_messageCompiler"),v(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??X,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o?.message;e||(e=""),u(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return me(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let l=s||a||e;return u(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
26
+ `;var M=new Map,ge='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function ue(t,e={}){let r=e.responseParser??(o=>o.text());return M.has(t)||M.set(t,fetch(t).then(r)),M.get(t)}var g=class extends de{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let o=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${r}.svg`;try{let a=await ue(o);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch{return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(ge,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",o=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},s=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return ce`<div class="${pe(a)}" style="${s}" part="w-${o.toLowerCase()}">${this.svg}</div>`}};g.styles=[P],d([F({type:String,reflect:!0})],g.prototype,"name",2),d([F({type:String,reflect:!0})],g.prototype,"size",2),d([F({type:String,reflect:!0,useDefault:!0})],g.prototype,"locale",2),d([be()],g.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",g);var y=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?y.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var u=t=>typeof t=="string",he=t=>typeof t=="function",R=new Map,X="en";function $(t){return[...Array.isArray(t)?t:[t],X]}function Y(t,e,r){let o=$(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return _(()=>z("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(u(e)?new Date(e):e)}function me(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return Y(t,e,o)}function j(t,e,r){let o=$(t);return _(()=>z("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function I(t,e,r,{offset:o=0,...a}){let s=$(t),i=e?_(()=>z("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):_(()=>z("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return a[r]??a[i.select(r-o)]??a.other}function _(t,e){let r=t(),o=R.get(r);return o||(o=e(),R.set(r,o)),o}function z(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var Z=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,V=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),G="%__lingui_octothorpe__%",ve=(t,e,r={})=>{let o=e||t,a=i=>typeof i=="object"?i:r[i],s=(i,n)=>{let l=Object.keys(r).length?a("number"):void 0,h=j(o,i,l);return n.replace(new RegExp(G,"g"),h)};return{plural:(i,n)=>{let{offset:l=0}=n,h=I(o,!1,i,n);return s(i-l,h)},selectordinal:(i,n)=>{let{offset:l=0}=n,h=I(o,!0,i,n);return s(i-l,h)},select:we,number:(i,n)=>j(o,i,a(n)||{style:n}),date:(i,n)=>Y(o,i,a(n)||n),time:(i,n)=>me(o,i,a(n)||n)}},we=(t,e)=>e[t]??e.other;function fe(t,e,r){return(o={},a)=>{let s=ve(e,r,a),i=(l,h=!1)=>Array.isArray(l)?l.reduce((f,x)=>{if(x==="#"&&h)return f+G;if(u(x))return f+x;let[N,m,D]=x,S={};m==="plural"||m==="selectordinal"||m==="select"?Object.entries(D).forEach(([C,ie])=>{S[C]=i(ie,m==="plural"||m==="selectordinal")}):S=D;let k;if(m){let C=s[m];k=C(o[N],S)}else k=o[N];return k==null?f:f+k},""):l,n=i(t);return u(n)&&Z.test(n)?V(n):u(n)?n:n?String(n):""}}var xe=Object.defineProperty,ke=(t,e,r)=>e in t?xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ye=(t,e,r)=>(ke(t,typeof e!="symbol"?e+"":e,r),r),O=class{constructor(){ye(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},_e=Object.defineProperty,ze=(t,e,r)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r),T=class extends O{constructor(e){super(),v(this,"_locale",""),v(this,"_locales"),v(this,"_localeData",{}),v(this,"_messages",{}),v(this,"_missing"),v(this,"_messageCompiler"),v(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??X,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o?.message;e||(e=""),u(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return he(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let l=s||a||e;return u(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
27
27
 
28
28
  > ${l}
29
29
 
@@ -31,7 +31,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
31
31
  ICU features such as interpolation and plurals will not work properly for that message.
32
32
 
33
33
  Please compile your catalog first.
34
- `)),u(l)&&Z.test(l)?V(l):u(l)?l:xe(l,this._locale,this._locales)(r,o?.formats)}date(e,r){return Y(this._locales||this._locale,e,r)}number(e,r){return j(this._locales||this._locale,e,r)}};function Ee(t={}){return new T(t)}var b=Ee();import{property as w}from"lit/decorators.js";var Se=["en","nb","fi","da","sv"],A="en",L=t=>Se.find(e=>t===e||t.toLowerCase().includes(e))||A;function E(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return L(t)}try{let t=H(document);if(t)return L(t);let e=je();if(e)return L(e);let r=H(B());return r?L(r):A}catch(t){return console.warn("could not detect locale, falling back to source locale",t),A}}var U=(t,e,r,o,a)=>{b.load("en",t),b.load("nb",e),b.load("fi",r),b.load("da",o),b.load("sv",a);let s=E();b.activate(s),q(),Ce()},Fe="warp-i18n-change";function q(){typeof window>"u"||window.dispatchEvent(new Event(Fe))}var J=!1;function Ce(){if(J||typeof window>"u"||!document?.documentElement)return;J=!0;let t=()=>{let a=E();b.locale!==a&&(b.activate(a),q())},e=new MutationObserver(a=>{for(let s of a)if(s.type==="attributes"&&s.attributeName==="lang"){t();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=B();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let o=Me();o&&e.observe(o,{attributes:!0,attributeFilter:["lang"]})}function B(){try{return window.parent?.document??null}catch{return null}}function H(t){try{return t?.documentElement?.lang??""}catch{return""}}function Me(){try{return window.frameElement??null}catch{return null}}function je(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as K}from"lit";var Q=K`
34
+ `)),u(l)&&Z.test(l)?V(l):u(l)?l:fe(l,this._locale,this._locales)(r,o?.formats)}date(e,r){return Y(this._locales||this._locale,e,r)}number(e,r){return j(this._locales||this._locale,e,r)}};function Le(t={}){return new T(t)}var b=Le();import{property as w}from"lit/decorators.js";var Ee=["en","nb","fi","da","sv"],A="en",L=t=>Ee.find(e=>t===e||t.toLowerCase().includes(e))||A;function E(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return L(t)}try{let t=H(document);if(t)return L(t);let e=Me();if(e)return L(e);let r=H(B());return r?L(r):A}catch(t){return console.warn("could not detect locale, falling back to source locale",t),A}}var U=(t,e,r,o,a)=>{b.load("en",t),b.load("nb",e),b.load("fi",r),b.load("da",o),b.load("sv",a);let s=E();b.activate(s),q(),Ce()},Se="warp-i18n-change";function q(){typeof window>"u"||window.dispatchEvent(new Event(Se))}var J=!1;function Ce(){if(J||typeof window>"u"||!document?.documentElement)return;J=!0;let t=()=>{let a=E();b.locale!==a&&(b.activate(a),q())},e=new MutationObserver(a=>{for(let s of a)if(s.type==="attributes"&&s.attributeName==="lang"){t();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=B();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let o=Fe();o&&e.observe(o,{attributes:!0,attributeFilter:["lang"]})}function B(){try{return window.parent?.document??null}catch{return null}}function H(t){try{return t?.documentElement?.lang??""}catch{return""}}function Fe(){try{return window.frameElement??null}catch{return null}}function Me(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as je}from"lit";import{unsafeCSS as Oe}from"lit";var K=je`
35
35
  *,
36
36
  :before,
37
37
  :after {
@@ -304,7 +304,7 @@ Please compile your catalog first.
304
304
  svg {
305
305
  pointer-events: none;
306
306
  }
307
- `,Be=K`*, :before, :after {
307
+ `,Qe=Oe(`*, :before, :after {
308
308
  --w-rotate: 0;
309
309
  --w-rotate-x: 0;
310
310
  --w-rotate-y: 0;
@@ -2169,8 +2169,8 @@ Please compile your catalog first.
2169
2169
  overflow-wrap: break-word
2170
2170
  }
2171
2171
 
2172
- .before\\:content-\\[\\"–\\"\\]:before {
2173
- content: "–"
2172
+ .before\\:content-\\[\\"\xE2\u20AC\u201C\\"\\]:before {
2173
+ content: "\xE2\u20AC\u201C"
2174
2174
  }
2175
2175
 
2176
2176
  .before\\:content-\\[\\"\\"\\]:before {
@@ -2470,16 +2470,16 @@ Please compile your catalog first.
2470
2470
  display: none
2471
2471
  }
2472
2472
  }
2473
- `;var W=JSON.parse('{"pill.aria.openFilter":["\xC5bn filter"],"pill.aria.removeFilter":["Fjern filter ",["label"]]}');var ee=JSON.parse('{"pill.aria.openFilter":["Open filter"],"pill.aria.removeFilter":["Remove filter ",["label"]]}');var re=JSON.parse('{"pill.aria.openFilter":["Avaa suodatin"],"pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');var oe=JSON.parse('{"pill.aria.openFilter":["\xC5pne filter"],"pill.aria.removeFilter":["Fjern filter ",["label"]]}');var te=JSON.parse('{"pill.aria.openFilter":["\xD6ppna filter"],"pill.aria.removeFilter":["Ta bort filtret ",["label"]]}');import{unsafeCSS as Oe}from"lit";var ae=Oe("*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.bg-\\[--w-color-pill-suggestion-background\\]{background-color:var(--w-color-pill-suggestion-background)}.hover\\:bg-\\[--w-color-pill-suggestion-background-hover\\]:hover{background-color:var(--w-color-pill-suggestion-background-hover)}.active\\:bg-\\[--w-color-pill-suggestion-background-active\\]:active{background-color:var(--w-color-pill-suggestion-background-active)}.rounded{border-radius:4px}.rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.flex{display:flex}.inline-flex{display:inline-flex}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-center{align-items:center}.static{position:static}.s-bg-primary{background-color:var(--w-s-color-background-primary)}.hover\\:s-bg-primary-hover:hover{background-color:var(--w-s-color-background-primary-hover)}.active\\:s-bg-primary-active:active{background-color:var(--w-s-color-background-primary-active)}.s-text{color:var(--w-s-color-text)}.s-text-inverted{color:var(--w-s-color-text-inverted)}.h-16{height:1.6rem}.py-8{padding-top:.8rem;padding-bottom:.8rem}.pl-12{padding-left:1.2rem}.pl-4{padding-left:.4rem}.pr-12{padding-right:1.2rem}.pr-2{padding-right:.2rem}.font-bold{font-weight:700}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}");var c={wrapper:"flex items-center",button:"inline-flex items-center focusable text-xs transition-all",suggestion:"bg-[--w-color-pill-suggestion-background] hover:bg-[--w-color-pill-suggestion-background-hover] active:bg-[--w-color-pill-suggestion-background-active] s-text font-bold",filter:"s-bg-primary hover:s-bg-primary-hover active:s-bg-primary-active s-text-inverted",label:"pl-12 py-8 rounded-l-full",labelWithoutClose:"pr-12 rounded-r-full",labelWithClose:"pr-2",close:"pr-12 pl-4 py-8 rounded-r-full",closeIcon:"h-16",a11y:"sr-only"},p=class extends Te{constructor(){super();this.canClose=!1;this.suggestion=!1;U(ee,oe,re,W,te),this.canClose=!1,this.suggestion=!1,this.openFilterSrText=b._({id:"pill.aria.openFilter",message:"Open filter",comment:"Fallback screen reader message for open filter"}),this.removeFilterSrText=b._({id:"pill.aria.removeFilter",message:"Remove filter {label}",comment:"Fallback screen reader message for removal of the filter"})}get _labelClasses(){return y([c.button,c.label,this.suggestion?c.suggestion:c.filter,this.canClose?c.labelWithClose:c.labelWithoutClose])}get _closeClasses(){return y([c.button,c.close,this.suggestion?c.suggestion:c.filter])}_onClick(){this.dispatchEvent(new CustomEvent("w-pill-click",{bubbles:!0,composed:!0}))}_onClose(){this.dispatchEvent(new CustomEvent("w-pill-close",{bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.openSrLabel&&(this.openAriaLabel=this.openSrLabel),this.closeSrLabel&&(this.closeAriaLabel=this.closeSrLabel)}render(){return ie`
2473
+ `);var Q=JSON.parse('{"pill.aria.openFilter":["\xC5bn filter"],"pill.aria.removeFilter":["Fjern filter ",["label"]]}');var W=JSON.parse('{"pill.aria.openFilter":["Open filter"],"pill.aria.removeFilter":["Remove filter ",["label"]]}');var ee=JSON.parse('{"pill.aria.openFilter":["Avaa suodatin"],"pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');var re=JSON.parse('{"pill.aria.openFilter":["\xC5pne filter"],"pill.aria.removeFilter":["Fjern filter ",["label"]]}');var oe=JSON.parse('{"pill.aria.openFilter":["\xD6ppna filter"],"pill.aria.removeFilter":["Ta bort filtret ",["label"]]}');import{unsafeCSS as Te}from"lit";var te=Te("*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.bg-\\[--w-color-pill-suggestion-background\\]{background-color:var(--w-color-pill-suggestion-background)}.hover\\:bg-\\[--w-color-pill-suggestion-background-hover\\]:hover{background-color:var(--w-color-pill-suggestion-background-hover)}.active\\:bg-\\[--w-color-pill-suggestion-background-active\\]:active{background-color:var(--w-color-pill-suggestion-background-active)}.rounded{border-radius:4px}.rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.flex{display:flex}.inline-flex{display:inline-flex}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-center{align-items:center}.static{position:static}.s-bg-primary{background-color:var(--w-s-color-background-primary)}.hover\\:s-bg-primary-hover:hover{background-color:var(--w-s-color-background-primary-hover)}.active\\:s-bg-primary-active:active{background-color:var(--w-s-color-background-primary-active)}.s-text{color:var(--w-s-color-text)}.s-text-inverted{color:var(--w-s-color-text-inverted)}.h-16{height:1.6rem}.py-8{padding-top:.8rem;padding-bottom:.8rem}.pl-12{padding-left:1.2rem}.pl-4{padding-left:.4rem}.pr-12{padding-right:1.2rem}.pr-2{padding-right:.2rem}.font-bold{font-weight:700}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}");var c={wrapper:"flex items-center",button:"inline-flex items-center focusable text-xs transition-all",suggestion:"bg-[--w-color-pill-suggestion-background] hover:bg-[--w-color-pill-suggestion-background-hover] active:bg-[--w-color-pill-suggestion-background-active] s-text font-bold",filter:"s-bg-primary hover:s-bg-primary-hover active:s-bg-primary-active s-text-inverted",label:"pl-12 py-8 rounded-l-full",labelWithoutClose:"pr-12 rounded-r-full",labelWithClose:"pr-2",close:"pr-12 pl-4 py-8 rounded-r-full",closeIcon:"h-16",a11y:"sr-only"},p=class extends $e{constructor(){super();this.canClose=!1;this.suggestion=!1;U(W,re,ee,Q,oe),this.canClose=!1,this.suggestion=!1,this.openFilterSrText=b._({id:"pill.aria.openFilter",message:"Open filter",comment:"Fallback screen reader message for open filter"}),this.removeFilterSrText=b._({id:"pill.aria.removeFilter",message:"Remove filter {label}",comment:"Fallback screen reader message for removal of the filter"})}get _labelClasses(){return y([c.button,c.label,this.suggestion?c.suggestion:c.filter,this.canClose?c.labelWithClose:c.labelWithoutClose])}get _closeClasses(){return y([c.button,c.close,this.suggestion?c.suggestion:c.filter])}_onClick(){this.dispatchEvent(new CustomEvent("w-pill-click",{bubbles:!0,composed:!0}))}_onClose(){this.dispatchEvent(new CustomEvent("w-pill-close",{bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.openSrLabel&&(this.openAriaLabel=this.openSrLabel),this.closeSrLabel&&(this.closeAriaLabel=this.closeSrLabel)}render(){return ae`
2474
2474
  <div class="${c.wrapper}">
2475
2475
  <button type="button" class="${this._labelClasses}" @click="${this._onClick}">
2476
2476
  <span class="${c.a11y}">${this.openAriaLabel?this.openAriaLabel:this.openFilterSrText}</span>
2477
2477
  <slot></slot>
2478
2478
  </button>
2479
- ${this.canClose?ie` <button type="button" class="${this._closeClasses}" @click="${this._onClose}">
2479
+ ${this.canClose?ae` <button type="button" class="${this._closeClasses}" @click="${this._onClose}">
2480
2480
  <span class="${c.a11y}">${this.closeAriaLabel?this.closeAriaLabel:this.removeFilterSrText}</span>
2481
2481
  <w-icon name="Close" size="small" locale="${E()}" class="${c.closeIcon}" class="flex"></w-icon>
2482
2482
  </button>`:null}
2483
2483
  </div>
2484
- `}};p.styles=[Q,ae],d([w({attribute:"can-close",type:Boolean})],p.prototype,"canClose",2),d([w({attribute:"suggestion",type:Boolean})],p.prototype,"suggestion",2),d([w({attribute:"open-sr-label",type:String})],p.prototype,"openSrLabel",2),d([w({attribute:"open-aria-label",type:String})],p.prototype,"openAriaLabel",2),d([w({attribute:"close-sr-label",type:String})],p.prototype,"closeSrLabel",2),d([w({attribute:"close-aria-label",type:String})],p.prototype,"closeAriaLabel",2);customElements.get("w-pill")||customElements.define("w-pill",p);export{p as WarpPill};
2484
+ `}};p.styles=[K,te],d([w({attribute:"can-close",type:Boolean})],p.prototype,"canClose",2),d([w({attribute:"suggestion",type:Boolean})],p.prototype,"suggestion",2),d([w({attribute:"open-sr-label",type:String})],p.prototype,"openSrLabel",2),d([w({attribute:"open-aria-label",type:String})],p.prototype,"openAriaLabel",2),d([w({attribute:"close-sr-label",type:String})],p.prototype,"closeSrLabel",2),d([w({attribute:"close-aria-label",type:String})],p.prototype,"closeAriaLabel",2);customElements.get("w-pill")||customElements.define("w-pill",p);export{p as WarpPill};
2485
2485
  //# sourceMappingURL=pill.js.map