@warp-ds/elements 2.9.1-next.1 → 2.9.1-next.3

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 (108) hide show
  1. package/dist/custom-elements.json +21 -23
  2. package/dist/docs/attention/api.md +6 -3
  3. package/dist/docs/attention/attention.md +6 -3
  4. package/dist/docs/slider-thumb/api.md +0 -24
  5. package/dist/docs/slider-thumb/slider-thumb.md +0 -24
  6. package/dist/index.d.ts +0 -18
  7. package/dist/packages/affix/affix.js +11 -12
  8. package/dist/packages/affix/affix.js.map +4 -4
  9. package/dist/packages/alert/alert.d.ts +1 -1
  10. package/dist/packages/alert/alert.js.map +1 -1
  11. package/dist/packages/attention/attention.d.ts +3 -2
  12. package/dist/packages/attention/attention.js +27 -28
  13. package/dist/packages/attention/attention.js.map +4 -4
  14. package/dist/packages/breadcrumbs/breadcrumbs.js +7 -8
  15. package/dist/packages/breadcrumbs/breadcrumbs.js.map +4 -4
  16. package/dist/packages/button/button.d.ts +4 -2
  17. package/dist/packages/button/button.js +14 -15
  18. package/dist/packages/button/button.js.map +4 -4
  19. package/dist/packages/card/card.js +8 -9
  20. package/dist/packages/card/card.js.map +4 -4
  21. package/dist/packages/checkbox/checkbox.d.ts +2 -0
  22. package/dist/packages/checkbox/checkbox.js +3 -3
  23. package/dist/packages/checkbox/checkbox.js.map +2 -2
  24. package/dist/packages/checkbox/checkbox.test.js +20 -0
  25. package/dist/packages/checkbox-group/checkbox-group.d.ts +2 -0
  26. package/dist/packages/checkbox-group/checkbox-group.js +15 -16
  27. package/dist/packages/checkbox-group/checkbox-group.js.map +4 -4
  28. package/dist/packages/checkbox-group/locales/da/messages.mjs +1 -1
  29. package/dist/packages/checkbox-group/locales/en/messages.mjs +1 -1
  30. package/dist/packages/checkbox-group/locales/fi/messages.mjs +1 -1
  31. package/dist/packages/checkbox-group/locales/nb/messages.mjs +1 -1
  32. package/dist/packages/checkbox-group/locales/sv/messages.mjs +1 -1
  33. package/dist/packages/combobox/combobox.js +13 -14
  34. package/dist/packages/combobox/combobox.js.map +4 -4
  35. package/dist/packages/combobox/locales/da/messages.mjs +1 -1
  36. package/dist/packages/combobox/locales/en/messages.mjs +1 -1
  37. package/dist/packages/combobox/locales/fi/messages.mjs +1 -1
  38. package/dist/packages/combobox/locales/nb/messages.mjs +1 -1
  39. package/dist/packages/combobox/locales/sv/messages.mjs +1 -1
  40. package/dist/packages/datepicker/datepicker.d.ts +2 -0
  41. package/dist/packages/datepicker/datepicker.js +51 -52
  42. package/dist/packages/datepicker/datepicker.js.map +4 -4
  43. package/dist/packages/datepicker/datepicker.stories.js +8 -1
  44. package/dist/packages/datepicker/datepicker.test.js +23 -1
  45. package/dist/packages/datepicker/locales/da/messages.mjs +1 -1
  46. package/dist/packages/datepicker/locales/en/messages.mjs +1 -1
  47. package/dist/packages/datepicker/locales/fi/messages.mjs +1 -1
  48. package/dist/packages/datepicker/locales/nb/messages.mjs +1 -1
  49. package/dist/packages/datepicker/locales/sv/messages.mjs +1 -1
  50. package/dist/packages/link/link.d.ts +2 -0
  51. package/dist/packages/modal-header/modal-header.js +13 -14
  52. package/dist/packages/modal-header/modal-header.js.map +4 -4
  53. package/dist/packages/page-indicator/page-indicator.js +7 -8
  54. package/dist/packages/page-indicator/page-indicator.js.map +4 -4
  55. package/dist/packages/pagination/locales/da/messages.mjs +1 -1
  56. package/dist/packages/pagination/locales/en/messages.mjs +1 -1
  57. package/dist/packages/pagination/locales/fi/messages.mjs +1 -1
  58. package/dist/packages/pagination/locales/nb/messages.mjs +1 -1
  59. package/dist/packages/pagination/locales/sv/messages.mjs +1 -1
  60. package/dist/packages/pagination/pagination.js +31 -32
  61. package/dist/packages/pagination/pagination.js.map +4 -4
  62. package/dist/packages/pill/pill.js +11 -12
  63. package/dist/packages/pill/pill.js.map +4 -4
  64. package/dist/packages/radio/radio.d.ts +2 -0
  65. package/dist/packages/radio/radio.js +2 -2
  66. package/dist/packages/radio/radio.js.map +2 -2
  67. package/dist/packages/radio/radio.test.js +21 -1
  68. package/dist/packages/radio-group/radio-group.d.ts +2 -0
  69. package/dist/packages/radio-group/radio-group.js +17 -18
  70. package/dist/packages/radio-group/radio-group.js.map +4 -4
  71. package/dist/packages/select/select.js +19 -20
  72. package/dist/packages/select/select.js.map +4 -4
  73. package/dist/packages/select/select.stories.js +7 -5
  74. package/dist/packages/select/select.test.js +23 -2
  75. package/dist/packages/slider/locales/da/messages.mjs +1 -1
  76. package/dist/packages/slider/locales/en/messages.mjs +1 -1
  77. package/dist/packages/slider/locales/fi/messages.mjs +1 -1
  78. package/dist/packages/slider/locales/nb/messages.mjs +1 -1
  79. package/dist/packages/slider/locales/sv/messages.mjs +1 -1
  80. package/dist/packages/slider/slider.d.ts +2 -0
  81. package/dist/packages/slider/slider.js +22 -23
  82. package/dist/packages/slider/slider.js.map +4 -4
  83. package/dist/packages/slider/slider.stories.js +6 -3
  84. package/dist/packages/slider-thumb/slider-thumb.d.ts +5 -0
  85. package/dist/packages/slider-thumb/slider-thumb.js +33 -34
  86. package/dist/packages/slider-thumb/slider-thumb.js.map +4 -4
  87. package/dist/packages/step/locales/da/messages.mjs +1 -1
  88. package/dist/packages/step/locales/en/messages.mjs +1 -1
  89. package/dist/packages/step/locales/fi/messages.mjs +1 -1
  90. package/dist/packages/step/locales/nb/messages.mjs +1 -1
  91. package/dist/packages/step/locales/sv/messages.mjs +1 -1
  92. package/dist/packages/step/step.js +11 -12
  93. package/dist/packages/step/step.js.map +4 -4
  94. package/dist/packages/switch/switch.d.ts +2 -0
  95. package/dist/packages/tab/tab.d.ts +2 -0
  96. package/dist/packages/tabs/tabs.js +1 -1
  97. package/dist/packages/tabs/tabs.js.map +3 -3
  98. package/dist/packages/textarea/textarea.d.ts +2 -0
  99. package/dist/packages/textarea/textarea.js +20 -21
  100. package/dist/packages/textarea/textarea.js.map +4 -4
  101. package/dist/packages/textfield/textfield.d.ts +2 -0
  102. package/dist/packages/textfield/textfield.js +9 -8
  103. package/dist/packages/textfield/textfield.js.map +3 -3
  104. package/dist/packages/textfield/textfield.test.js +17 -0
  105. package/dist/packages/toast/toast.js +13 -14
  106. package/dist/packages/toast/toast.js.map +4 -4
  107. package/dist/web-types.json +6 -6
  108. package/package.json +19 -19
@@ -1,5 +1,4 @@
1
- var we=Object.create;var D=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty;var q=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var _e=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of xe(e))!ye.call(o,a)&&a!==r&&D(o,a,{get:()=>e[a],enumerable:!(t=Z(e,a))||t.enumerable});return o};var ze=(o,e,r)=>(r=o!=null?we(ke(o)):{},_e(e||!o||!o.__esModule?D(r,"default",{value:o,enumerable:!0}):r,o));var p=(o,e,r,t)=>{for(var a=t>1?void 0:t?Z(e,r):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(a=(t?n(e,r,a):n(a))||a);return t&&a&&D(e,r,a),a};var J=q(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.errorMessages=x.ErrorType=void 0;var y;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(y=x.ErrorType||(x.ErrorType={}));x.errorMessages=new Map([[y.MalformedUnicode,"malformed Unicode character escape sequence"],[y.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[y.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[y.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[y.EndOfString,"malformed escape sequence at end of string"]])});var K=q(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.unraw=m.errorMessages=m.ErrorType=void 0;var c=J();Object.defineProperty(m,"ErrorType",{enumerable:!0,get:function(){return c.ErrorType}});Object.defineProperty(m,"errorMessages",{enumerable:!0,get:function(){return c.errorMessages}});function Te(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function M(o,e,r){let t=Te(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(c.errorMessages.get(e));return t}function Ne(o){let e=M(o,c.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function V(o,e){let r=M(o,c.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=M(e,c.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function De(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function je(o){if(!De(o))throw new SyntaxError(c.errorMessages.get(c.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=M(e,c.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(c.errorMessages.get(c.ErrorType.CodePointLimit)):t}}function Ae(o,e=!1){if(e)throw new SyntaxError(c.errorMessages.get(c.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var $e=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Pe(o){return $e.get(o)||o}var Ye=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function B(o,e=!1){return o.replace(Ye,function(r,t,a,s,n,i,l,g,f){if(t!==void 0)return"\\";if(a!==void 0)return Ne(a);if(s!==void 0)return je(s);if(n!==void 0)return V(n,i);if(l!==void 0)return V(l);if(g==="0")return"\0";if(g!==void 0)return Ae(g,!e);if(f!==void 0)return Pe(f);throw new SyntaxError(c.errorMessages.get(c.ErrorType.EndOfString))})}m.unraw=B;m.default=B});import{html as ve,LitElement as tr}from"lit";import{html as Ce,LitElement as Me}from"lit";import{property as j,state as Le}from"lit/decorators.js";import{classMap as Se}from"lit/directives/class-map.js";import{css as Ee}from"lit";var G=Ee`
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,n;s>=0;s--)(n=t[s])&&(a=(o?n(e,r,a):n(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`
3
2
  :host {
4
3
  display: inline-block;
5
4
  }
@@ -24,7 +23,7 @@ var we=Object.create;var D=Object.defineProperty;var Z=Object.getOwnPropertyDesc
24
23
  --w-icon-size: 32px;
25
24
  }
26
25
 
27
- `;var A=new Map,Fe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Oe(o,e={}){var t;let r=(t=e.responseParser)!=null?t:(a=>a.text());return A.has(o)||A.set(o,fetch(o).then(r)),A.get(o)}var h=class extends Me{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let t=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${r}.svg`;try{let a=await Oe(t);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch(a){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(Fe,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",t=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="${Se(a)}" style="${s}" part="w-${t.toLowerCase()}">${this.svg}</div>`}};h.styles=[G],p([j({type:String,reflect:!0})],h.prototype,"name",2),p([j({type:String,reflect:!0})],h.prototype,"size",2),p([j({type:String,reflect:!0,useDefault:!0})],h.prototype,"locale",2),p([Le()],h.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",h);var C=function(){for(var o=[],e=arguments.length;e--;)o[e]=arguments[e];return o.reduce(function(r,t){return r.concat(typeof t=="string"?t:Array.isArray(t)?C.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var ee=ze(K(),1);var v=o=>typeof o=="string",Ie=o=>typeof o=="function",Q=new Map,re="en";function I(o){return[...Array.isArray(o)?o:[o],re]}function R(o,e,r){let t=I(o);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 L(()=>S("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(v(e)?new Date(e):e)}function Re(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return R(o,e,t)}function $(o,e,r){let t=I(o);return L(()=>S("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function W(o,e,r,{offset:t=0,...a}){var i,l;let s=I(o),n=e?L(()=>S("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):L(()=>S("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(l=(i=a[r])!=null?i:a[n.select(r-t)])!=null?l:a.other}function L(o,e){let r=o(),t=Q.get(r);return t||(t=e(),Q.set(r,t)),t}function S(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var oe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,te="%__lingui_octothorpe__%",Ue=(o,e,r={})=>{let t=e||o,a=n=>typeof n=="object"?n:r[n],s=(n,i)=>{let l=Object.keys(r).length?a("number"):void 0,g=$(t,n,l);return i.replace(new RegExp(te,"g"),g)};return{plural:(n,i)=>{let{offset:l=0}=i,g=W(t,!1,n,i);return s(n-l,g)},selectordinal:(n,i)=>{let{offset:l=0}=i,g=W(t,!0,n,i);return s(n-l,g)},select:Xe,number:(n,i)=>$(t,n,a(i)||{style:i}),date:(n,i)=>R(t,n,a(i)||i),time:(n,i)=>Re(t,n,a(i)||i)}},Xe=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function He(o,e,r){return(t={},a)=>{let s=Ue(e,r,a),n=(l,g=!1)=>Array.isArray(l)?l.reduce((f,z)=>{if(z==="#"&&g)return f+te;if(v(z))return f+z;let[X,w,H]=z,T={};w==="plural"||w==="selectordinal"||w==="select"?Object.entries(H).forEach(([N,fe])=>{T[N]=n(fe,w==="plural"||w==="selectordinal")}):T=H;let E;if(w){let N=s[w];E=N(t[X],T)}else E=t[X];return E==null?f:f+E},""):l,i=n(o);return v(i)&&oe.test(i)?(0,ee.unraw)(i):v(i)?i:i?String(i):""}}var Ze=Object.defineProperty,qe=(o,e,r)=>e in o?Ze(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ge=(o,e,r)=>(qe(o,typeof e!="symbol"?e+"":e,r),r),P=class{constructor(){Ge(this,"_events",{})}on(e,r){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Je=Object.defineProperty,Ve=(o,e,r)=>e in o?Je(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,k=(o,e,r)=>(Ve(o,typeof e!="symbol"?e+"":e,r),r),Y=class extends P{constructor(e){var r;super(),k(this,"_locale",""),k(this,"_locales"),k(this,"_localeData",{}),k(this,"_messages",{}),k(this,"_missing"),k(this,"_messageCompiler"),k(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((r=e.locale)!=null?r:re,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let t=this._localeData[e];t?Object.assign(t,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(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,t){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=t==null?void 0:t.message;e||(e=""),v(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],n=s===void 0,i=this._missing;if(i&&n)return Ie(i)?i(this._locale,e):i;n&&this.emit("missing",{id:e,locale:this._locale});let l=s||a||e;return v(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
26
+ `;var M=new Map,ue='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function he(t,e={}){var o;let r=(o=e.responseParser)!=null?o:(a=>a.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(a){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 Y(t){return[...Array.isArray(t)?t:[t],X]}function $(t,e,r){let o=Y(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 $(t,e,o)}function j(t,e,r){let o=Y(t);return _(()=>z("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function I(t,e,r,{offset:o=0,...a}){var i,l;let s=Y(t),n=e?_(()=>z("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):_(()=>z("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(l=(i=a[r])!=null?i:a[n.select(r-o)])!=null?l: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}/,G=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)}}),V="%__lingui_octothorpe__%",we=(t,e,r={})=>{let o=e||t,a=n=>typeof n=="object"?n:r[n],s=(n,i)=>{let l=Object.keys(r).length?a("number"):void 0,h=j(o,n,l);return i.replace(new RegExp(V,"g"),h)};return{plural:(n,i)=>{let{offset:l=0}=i,h=I(o,!1,n,i);return s(n-l,h)},selectordinal:(n,i)=>{let{offset:l=0}=i,h=I(o,!0,n,i);return s(n-l,h)},select:fe,number:(n,i)=>j(o,n,a(i)||{style:i}),date:(n,i)=>$(o,n,a(i)||i),time:(n,i)=>ve(o,n,a(i)||i)}},fe=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function xe(t,e,r){return(o={},a)=>{let s=we(e,r,a),n=(l,h=!1)=>Array.isArray(l)?l.reduce((f,x)=>{if(x==="#"&&h)return f+V;if(u(x))return f+x;let[N,m,D]=x,F={};m==="plural"||m==="selectordinal"||m==="select"?Object.entries(D).forEach(([S,ne])=>{F[S]=n(ne,m==="plural"||m==="selectordinal")}):F=D;let k;if(m){let S=s[m];k=S(o[N],F)}else k=o[N];return k==null?f:f+k},""):l,i=n(t);return u(i)&&Z.test(i)?G(i):u(i)?i:i?String(i):""}}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 a;var o;return(a=(o=this._events)[e])!=null||(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){var r;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((r=e.locale)!=null?r:X,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_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==null?void 0:o.message;e||(e=""),u(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],n=s===void 0,i=this._missing;if(i&&n)return me(i)?i(this._locale,e):i;n&&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:
28
27
 
29
28
  > ${l}
30
29
 
@@ -32,7 +31,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
32
31
  ICU features such as interpolation and plurals will not work properly for that message.
33
32
 
34
33
  Please compile your catalog first.
35
- `)),v(l)&&oe.test(l)?JSON.parse(`"${l}"`):v(l)?l:He(l,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return R(this._locales||this._locale,e,r)}number(e,r){return $(this._locales||this._locale,e,r)}};function Be(o={}){return new Y(o)}var b=Be();import{property as _}from"lit/decorators.js";var Ke=["en","nb","fi","da","sv"],U="en",F=o=>Ke.find(e=>o===e||o.toLowerCase().includes(e))||U;function O(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return F(o)}try{let o=ie(document);if(o)return F(o);let e=rr();if(e)return F(e);let r=ie(le());return r?F(r):U}catch(o){return console.warn("could not detect locale, falling back to source locale",o),U}}var ne=(o,e,r,t,a)=>{b.load("en",o),b.load("nb",e),b.load("fi",r),b.load("da",t),b.load("sv",a);let s=O();b.activate(s),se(),We()},Qe="warp-i18n-change";function se(){typeof window!="undefined"&&window.dispatchEvent(new Event(Qe))}var ae=!1;function We(){if(ae||typeof window=="undefined"||!(document!=null&&document.documentElement))return;ae=!0;let o=()=>{let a=O();b.locale!==a&&(b.activate(a),se())},e=new MutationObserver(a=>{for(let s of a)if(s.type==="attributes"&&s.attributeName==="lang"){o();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=le();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=er();t&&e.observe(t,{attributes:!0,attributeFilter:["lang"]})}function le(){var o,e;try{return(e=(o=window.parent)==null?void 0:o.document)!=null?e:null}catch(r){return null}}function ie(o){var e,r;try{return(r=(e=o==null?void 0:o.documentElement)==null?void 0:e.lang)!=null?r:""}catch(t){return""}}function er(){var o;try{return(o=window.frameElement)!=null?o:null}catch(e){return null}}function rr(){var o,e,r;try{return(r=(e=(o=window.frameElement)==null?void 0:o.getAttribute)==null?void 0:e.call(o,"lang"))!=null?r:""}catch(t){return""}}import{css as ce}from"lit";var de=ce`
34
+ `)),u(l)&&Z.test(l)?G(l):u(l)?l:xe(l,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return $(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 Fe=["en","nb","fi","da","sv"],A="en",L=t=>Fe.find(e=>t===e||t.toLowerCase().includes(e))||A;function E(){if(typeof window=="undefined"){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()},Se="warp-i18n-change";function q(){typeof window!="undefined"&&window.dispatchEvent(new Event(Se))}var J=!1;function Ce(){if(J||typeof window=="undefined"||!(document!=null&&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(){var t,e;try{return(e=(t=window.parent)==null?void 0:t.document)!=null?e:null}catch(r){return null}}function H(t){var e,r;try{return(r=(e=t==null?void 0:t.documentElement)==null?void 0:e.lang)!=null?r:""}catch(o){return""}}function Me(){var t;try{return(t=window.frameElement)!=null?t:null}catch(e){return null}}function je(){var t,e,r;try{return(r=(e=(t=window.frameElement)==null?void 0:t.getAttribute)==null?void 0:e.call(t,"lang"))!=null?r:""}catch(o){return""}}import{css as K}from"lit";var Q=K`
36
35
  *,
37
36
  :before,
38
37
  :after {
@@ -305,7 +304,7 @@ Please compile your catalog first.
305
304
  svg {
306
305
  pointer-events: none;
307
306
  }
308
- `,yr=ce`*, :before, :after {
307
+ `,Be=K`*, :before, :after {
309
308
  --w-rotate: 0;
310
309
  --w-rotate-x: 0;
311
310
  --w-rotate-y: 0;
@@ -2471,16 +2470,16 @@ Please compile your catalog first.
2471
2470
  display: none
2472
2471
  }
2473
2472
  }
2474
- `;var pe=JSON.parse('{"pill.aria.openFilter":["\xC5bn filter"],"pill.aria.removeFilter":["Fjern filter ",["label"]]}');var be=JSON.parse('{"pill.aria.openFilter":["Open filter"],"pill.aria.removeFilter":["Remove filter ",["label"]]}');var ge=JSON.parse('{"pill.aria.openFilter":["Avaa suodatin"],"pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');var ue=JSON.parse('{"pill.aria.openFilter":["\xC5pne filter"],"pill.aria.removeFilter":["Fjern filter ",["label"]]}');var me=JSON.parse('{"pill.aria.openFilter":["\xD6ppna filter"],"pill.aria.removeFilter":["Ta bort filtret ",["label"]]}');import{css as or}from"lit";var he=or`*,: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 d={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"},u=class extends tr{constructor(){super();this.canClose=!1;this.suggestion=!1;ne(be,ue,ge,pe,me),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 C([d.button,d.label,this.suggestion?d.suggestion:d.filter,this.canClose?d.labelWithClose:d.labelWithoutClose])}get _closeClasses(){return C([d.button,d.close,this.suggestion?d.suggestion:d.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 ve`
2475
- <div class="${d.wrapper}">
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{css 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`
2474
+ <div class="${c.wrapper}">
2476
2475
  <button type="button" class="${this._labelClasses}" @click="${this._onClick}">
2477
- <span class="${d.a11y}">${this.openAriaLabel?this.openAriaLabel:this.openFilterSrText}</span>
2476
+ <span class="${c.a11y}">${this.openAriaLabel?this.openAriaLabel:this.openFilterSrText}</span>
2478
2477
  <slot></slot>
2479
2478
  </button>
2480
- ${this.canClose?ve` <button type="button" class="${this._closeClasses}" @click="${this._onClose}">
2481
- <span class="${d.a11y}">${this.closeAriaLabel?this.closeAriaLabel:this.removeFilterSrText}</span>
2482
- <w-icon name="Close" size="small" locale="${O()}" class="${d.closeIcon}" class="flex"></w-icon>
2479
+ ${this.canClose?ie` <button type="button" class="${this._closeClasses}" @click="${this._onClose}">
2480
+ <span class="${c.a11y}">${this.closeAriaLabel?this.closeAriaLabel:this.removeFilterSrText}</span>
2481
+ <w-icon name="Close" size="small" locale="${E()}" class="${c.closeIcon}" class="flex"></w-icon>
2483
2482
  </button>`:null}
2484
2483
  </div>
2485
- `}};u.styles=[de,he],p([_({attribute:"can-close",type:Boolean})],u.prototype,"canClose",2),p([_({attribute:"suggestion",type:Boolean})],u.prototype,"suggestion",2),p([_({attribute:"open-sr-label",type:String})],u.prototype,"openSrLabel",2),p([_({attribute:"open-aria-label",type:String})],u.prototype,"openAriaLabel",2),p([_({attribute:"close-sr-label",type:String})],u.prototype,"closeSrLabel",2),p([_({attribute:"close-aria-label",type:String})],u.prototype,"closeAriaLabel",2);customElements.get("w-pill")||customElements.define("w-pill",u);export{u as WarpPill};
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};
2486
2485
  //# sourceMappingURL=pill.js.map