@warp-ds/elements 2.8.2-next.5 → 2.9.0-next.1

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 (30) hide show
  1. package/dist/custom-elements.json +79 -6
  2. package/dist/index.d.ts +28 -6
  3. package/dist/packages/attention/attention.js +506 -233
  4. package/dist/packages/attention/attention.js.map +4 -4
  5. package/dist/packages/button/button.d.ts +8 -17
  6. package/dist/packages/button/button.js +494 -221
  7. package/dist/packages/button/button.js.map +4 -4
  8. package/dist/packages/button/button.react.stories.d.ts +1 -1
  9. package/dist/packages/button/styles/w-button.styles.d.ts +1 -0
  10. package/dist/packages/button/styles/w-button.styles.js +282 -0
  11. package/dist/packages/combobox/combobox.hydration.test.js +57 -0
  12. package/dist/packages/combobox/combobox.js +25 -11
  13. package/dist/packages/combobox/combobox.js.map +2 -2
  14. package/dist/packages/datepicker/datepicker.js +8 -15
  15. package/dist/packages/datepicker/datepicker.js.map +2 -2
  16. package/dist/packages/datepicker/styles/w-datepicker.styles.js +3 -9
  17. package/dist/packages/link/link.js +197 -217
  18. package/dist/packages/link/link.js.map +4 -4
  19. package/dist/packages/link/link.test.js +0 -14
  20. package/dist/packages/link/styles/w-link.styles.js +213 -0
  21. package/dist/packages/slider/slider.js +18 -17
  22. package/dist/packages/slider/slider.js.map +3 -3
  23. package/dist/packages/slider/slider.react.stories.js +6 -2
  24. package/dist/packages/slider/slider.stories.js +18 -12
  25. package/dist/packages/slider-thumb/slider-thumb.js +12 -12
  26. package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
  27. package/dist/web-types.json +27 -11
  28. package/package.json +1 -1
  29. package/dist/packages/link/styles.js +0 -236
  30. /package/dist/packages/link/{styles.d.ts → styles/w-link.styles.d.ts} +0 -0
@@ -1,13 +1,13 @@
1
- var er=Object.create;var se=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var rr=Object.getOwnPropertyNames;var tr=Object.getPrototypeOf,or=Object.prototype.hasOwnProperty;var me=t=>{throw TypeError(t)};var fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ar=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of rr(e))!or.call(t,a)&&a!==r&&se(t,a,{get:()=>e[a],enumerable:!(o=pe(e,a))||o.enumerable});return t};var ir=(t,e,r)=>(r=t!=null?er(tr(t)):{},ar(e||!t||!t.__esModule?se(r,"default",{value:t,enumerable:!0}):r,t));var m=(t,e,r,o)=>{for(var a=o>1?void 0:o?pe(e,r):e,g=t.length-1,u;g>=0;g--)(u=t[g])&&(a=(o?u(e,r,a):u(a))||a);return o&&a&&se(e,r,a),a};var we=(t,e,r)=>e.has(t)||me("Cannot "+r);var xe=(t,e,r)=>(we(t,e,"read from private field"),r?r.call(t):e.get(t)),ye=(t,e,r)=>e.has(t)?me("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ke=(t,e,r,o)=>(we(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r);var $e=fe(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.errorMessages=N.ErrorType=void 0;var R;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(R=N.ErrorType||(N.ErrorType={}));N.errorMessages=new Map([[R.MalformedUnicode,"malformed Unicode character escape sequence"],[R.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[R.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[R.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[R.EndOfString,"malformed escape sequence at end of string"]])});var ze=fe(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.unraw=F.errorMessages=F.ErrorType=void 0;var _=$e();Object.defineProperty(F,"ErrorType",{enumerable:!0,get:function(){return _.ErrorType}});Object.defineProperty(F,"errorMessages",{enumerable:!0,get:function(){return _.errorMessages}});function nr(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function K(t,e,r){let o=nr(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(_.errorMessages.get(e));return o}function sr(t){let e=K(t,_.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function _e(t,e){let r=K(t,_.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=K(e,_.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function lr(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function dr(t){if(!lr(t))throw new SyntaxError(_.errorMessages.get(_.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=K(e,_.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(_.errorMessages.get(_.ErrorType.CodePointLimit)):o}}function cr(t,e=!1){if(e)throw new SyntaxError(_.errorMessages.get(_.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var ur=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function br(t){return ur.get(t)||t}var gr=/\\(?:(\\)|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 Ce(t,e=!1){return t.replace(gr,function(r,o,a,g,u,l,p,k,E){if(o!==void 0)return"\\";if(a!==void 0)return sr(a);if(g!==void 0)return dr(g);if(u!==void 0)return _e(u,l);if(p!==void 0)return _e(p);if(k==="0")return"\0";if(k!==void 0)return cr(k,!e);if(E!==void 0)return br(E);throw new SyntaxError(_.errorMessages.get(_.ErrorType.EndOfString))})}F.unraw=Ce;F.default=Ce});var le=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)?le.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var Le=ir(ze(),1);var T=t=>typeof t=="string",hr=t=>typeof t=="function",Se=new Map,Ee="en";function be(t){return[...Array.isArray(t)?t:[t],Ee]}function ge(t,e,r){let o=be(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 W(()=>ee("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(T(e)?new Date(e):e)}function vr(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 ge(t,e,o)}function de(t,e,r){let o=be(t);return W(()=>ee("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function Me(t,e,r,{offset:o=0,...a}){var l,p;let g=be(t),u=e?W(()=>ee("plural-ordinal",g),()=>new Intl.PluralRules(g,{type:"ordinal"})):W(()=>ee("plural-cardinal",g),()=>new Intl.PluralRules(g,{type:"cardinal"}));return(p=(l=a[r])!=null?l:a[u.select(r-o)])!=null?p:a.other}function W(t,e){let r=t(),o=Se.get(r);return o||(o=e(),Se.set(r,o)),o}function ee(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var Qe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,qe="%__lingui_octothorpe__%",pr=(t,e,r={})=>{let o=e||t,a=u=>typeof u=="object"?u:r[u],g=(u,l)=>{let p=Object.keys(r).length?a("number"):void 0,k=de(o,u,p);return l.replace(new RegExp(qe,"g"),k)};return{plural:(u,l)=>{let{offset:p=0}=l,k=Me(o,!1,u,l);return g(u-p,k)},selectordinal:(u,l)=>{let{offset:p=0}=l,k=Me(o,!0,u,l);return g(u-p,k)},select:mr,number:(u,l)=>de(o,u,a(l)||{style:l}),date:(u,l)=>ge(o,u,a(l)||l),time:(u,l)=>vr(o,u,a(l)||l)}},mr=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function fr(t,e,r){return(o={},a)=>{let g=pr(e,r,a),u=(p,k=!1)=>Array.isArray(p)?p.reduce((E,D)=>{if(D==="#"&&k)return E+qe;if(T(D))return E+D;let[U,M,P]=D,O={};M==="plural"||M==="selectordinal"||M==="select"?Object.entries(P).forEach(([A,H])=>{O[A]=u(H,M==="plural"||M==="selectordinal")}):O=P;let C;if(M){let A=g[M];C=A(o[U],O)}else C=o[U];return C==null?E:E+C},""):p,l=u(t);return T(l)&&Qe.test(l)?(0,Le.unraw)(l):T(l)?l:l?String(l):""}}var wr=Object.defineProperty,xr=(t,e,r)=>e in t?wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yr=(t,e,r)=>(xr(t,typeof e!="symbol"?e+"":e,r),r),ce=class{constructor(){yr(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}},kr=Object.defineProperty,$r=(t,e,r)=>e in t?kr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I=(t,e,r)=>($r(t,typeof e!="symbol"?e+"":e,r),r),ue=class extends ce{constructor(e){var r;super(),I(this,"_locale",""),I(this,"_locales"),I(this,"_localeData",{}),I(this,"_messages",{}),I(this,"_missing"),I(this,"_messageCompiler"),I(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:Ee,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=""),T(e)||(r=e.values||r,a=e.message,e=e.id);let g=this.messages[e],u=g===void 0,l=this._missing;if(l&&u)return hr(l)?l(this._locale,e):l;u&&this.emit("missing",{id:e,locale:this._locale});let p=g||a||e;return T(p)&&(this._messageCompiler?p=this._messageCompiler(p):console.warn(`Uncompiled message detected! Message:
1
+ var Re=Object.create;var ee=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var ce=o=>{throw TypeError(o)};var de=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Ge=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of He(e))!Ze.call(o,a)&&a!==r&&ee(o,a,{get:()=>e[a],enumerable:!(t=le(e,a))||t.enumerable});return o};var Be=(o,e,r)=>(r=o!=null?Re(Xe(o)):{},Ge(e||!o||!o.__esModule?ee(r,"default",{value:o,enumerable:!0}):r,o));var u=(o,e,r,t)=>{for(var a=t>1?void 0:t?le(e,r):e,l=o.length-1,s;l>=0;l--)(s=o[l])&&(a=(t?s(e,r,a):s(a))||a);return t&&a&&ee(e,r,a),a};var ve=(o,e,r)=>e.has(o)||ce("Cannot "+r);var ue=(o,e,r)=>(ve(o,e,"read from private field"),r?r.call(o):e.get(o)),be=(o,e,r)=>e.has(o)?ce("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),he=(o,e,r,t)=>(ve(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r);var ge=de(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.errorMessages=I.ErrorType=void 0;var D;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(D=I.ErrorType||(I.ErrorType={}));I.errorMessages=new Map([[D.MalformedUnicode,"malformed Unicode character escape sequence"],[D.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[D.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[D.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[D.EndOfString,"malformed escape sequence at end of string"]])});var we=de(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.unraw=E.errorMessages=E.ErrorType=void 0;var w=ge();Object.defineProperty(E,"ErrorType",{enumerable:!0,get:function(){return w.ErrorType}});Object.defineProperty(E,"errorMessages",{enumerable:!0,get:function(){return w.errorMessages}});function Je(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function R(o,e,r){let t=Je(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(w.errorMessages.get(e));return t}function Ke(o){let e=R(o,w.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function pe(o,e){let r=R(o,w.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=R(e,w.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function We(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function er(o){if(!We(o))throw new SyntaxError(w.errorMessages.get(w.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=R(e,w.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(w.errorMessages.get(w.ErrorType.CodePointLimit)):t}}function rr(o,e=!1){if(e)throw new SyntaxError(w.errorMessages.get(w.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var or=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function tr(o){return or.get(o)||o}var ar=/\\(?:(\\)|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 me(o,e=!1){return o.replace(ar,function(r,t,a,l,s,i,v,p,z){if(t!==void 0)return"\\";if(a!==void 0)return Ke(a);if(l!==void 0)return er(l);if(s!==void 0)return pe(s,i);if(v!==void 0)return pe(v);if(p==="0")return"\0";if(p!==void 0)return rr(p,!e);if(z!==void 0)return tr(z);throw new SyntaxError(w.errorMessages.get(w.ErrorType.EndOfString))})}E.unraw=me;E.default=me});var ke=Be(we(),1);var L=o=>typeof o=="string",ir=o=>typeof o=="function",fe=new Map,ye="en";function ae(o){return[...Array.isArray(o)?o:[o],ye]}function ie(o,e,r){let t=ae(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 H(()=>X("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(L(e)?new Date(e):e)}function nr(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 ie(o,e,t)}function re(o,e,r){let t=ae(o);return H(()=>X("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function xe(o,e,r,{offset:t=0,...a}){var i,v;let l=ae(o),s=e?H(()=>X("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):H(()=>X("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return(v=(i=a[r])!=null?i:a[s.select(r-t)])!=null?v:a.other}function H(o,e){let r=o(),t=fe.get(r);return t||(t=e(),fe.set(r,t)),t}function X(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var _e=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ze="%__lingui_octothorpe__%",sr=(o,e,r={})=>{let t=e||o,a=s=>typeof s=="object"?s:r[s],l=(s,i)=>{let v=Object.keys(r).length?a("number"):void 0,p=re(t,s,v);return i.replace(new RegExp(ze,"g"),p)};return{plural:(s,i)=>{let{offset:v=0}=i,p=xe(t,!1,s,i);return l(s-v,p)},selectordinal:(s,i)=>{let{offset:v=0}=i,p=xe(t,!0,s,i);return l(s-v,p)},select:lr,number:(s,i)=>re(t,s,a(i)||{style:i}),date:(s,i)=>ie(t,s,a(i)||i),time:(s,i)=>nr(t,s,a(i)||i)}},lr=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function cr(o,e,r){return(t={},a)=>{let l=sr(e,r,a),s=(v,p=!1)=>Array.isArray(v)?v.reduce((z,F)=>{if(F==="#"&&p)return z+ze;if(L(F))return z+F;let[N,y,S]=F,O={};y==="plural"||y==="selectordinal"||y==="select"?Object.entries(S).forEach(([V,j])=>{O[V]=s(j,y==="plural"||y==="selectordinal")}):O=S;let x;if(y){let V=l[y];x=V(t[N],O)}else x=t[N];return x==null?z:z+x},""):v,i=s(o);return L(i)&&_e.test(i)?(0,ke.unraw)(i):L(i)?i:i?String(i):""}}var dr=Object.defineProperty,vr=(o,e,r)=>e in o?dr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,ur=(o,e,r)=>(vr(o,typeof e!="symbol"?e+"":e,r),r),oe=class{constructor(){ur(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}},br=Object.defineProperty,hr=(o,e,r)=>e in o?br(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,P=(o,e,r)=>(hr(o,typeof e!="symbol"?e+"":e,r),r),te=class extends oe{constructor(e){var r;super(),P(this,"_locale",""),P(this,"_locales"),P(this,"_localeData",{}),P(this,"_messages",{}),P(this,"_missing"),P(this,"_messageCompiler"),P(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:ye,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=""),L(e)||(r=e.values||r,a=e.message,e=e.id);let l=this.messages[e],s=l===void 0,i=this._missing;if(i&&s)return ir(i)?i(this._locale,e):i;s&&this.emit("missing",{id:e,locale:this._locale});let v=l||a||e;return L(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
3
3
 
4
- > ${p}
4
+ > ${v}
5
5
 
6
6
  That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
7
7
  ICU features such as interpolation and plurals will not work properly for that message.
8
8
 
9
9
  Please compile your catalog first.
10
- `)),T(p)&&Qe.test(p)?JSON.parse(`"${p}"`):T(p)?p:fr(p,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return ge(this._locales||this._locale,e,r)}number(e,r){return de(this._locales||this._locale,e,r)}};function _r(t={}){return new ue(t)}var Q=_r();var v=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},x=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function Fe(t){var e,r,o,a,g,u,l,p,k,E,D,U,M,P,O,C,A,H,ae;class We extends t{constructor(...c){var h,w,$;super(...c),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),g.set(this,void 0),u.set(this,void 0),l.set(this,!0),k.set(this,""),E.set(this,()=>{x(this,a,!0,"f"),x(this,r,!0,"f"),v(this,e,"m",C).call(this)}),D.set(this,()=>{x(this,r,!1,"f"),v(this,e,"m",A).call(this,this.shouldFormValueUpdate()?v(this,k,"f"):""),!this.validity.valid&&v(this,a,"f")&&x(this,o,!0,"f");let q=v(this,e,"m",C).call(this);this.validationMessageCallback&&this.validationMessageCallback(q?this.internals.validationMessage:"")}),U.set(this,()=>{var q;v(this,l,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),x(this,l,!1,"f")),x(this,a,!0,"f"),x(this,o,!0,"f"),v(this,e,"m",C).call(this),(q=this===null||this===void 0?void 0:this.validationMessageCallback)===null||q===void 0||q.call(this,this.showError?this.internals.validationMessage:"")}),M.set(this,void 0),P.set(this,!1),O.set(this,Promise.resolve()),(h=this.addEventListener)===null||h===void 0||h.call(this,"focus",v(this,E,"f")),(w=this.addEventListener)===null||w===void 0||w.call(this,"blur",v(this,D,"f")),($=this.addEventListener)===null||$===void 0||$.call(this,"invalid",v(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let c=this.validators.map($=>$.attribute).flat(),h=super.observedAttributes||[];return[...new Set([...h,...c])]}static getValidator(c){return this.validators.find(h=>h.attribute===c)||null}static getValidators(c){return this.validators.filter(h=>{var w;if(h.attribute===c||!((w=h.attribute)===null||w===void 0)&&w.includes(c))return!0})}get form(){return this.internals.form}get showError(){return v(this,e,"m",C).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(c,h,w){var $;($=super.attributeChangedCallback)===null||$===void 0||$.call(this,c,h,w);let Z=this.constructor.getValidators(c);Z!=null&&Z.length&&this.validationTarget&&this.setValue(v(this,k,"f"))}setValue(c){var h;x(this,o,!1,"f"),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,""),x(this,k,c,"f");let $=this.shouldFormValueUpdate()?c:null;this.internals.setFormValue($),v(this,e,"m",A).call(this,$),this.valueChangedCallback&&this.valueChangedCallback($),v(this,e,"m",C).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(c=>c(v(this,O,"f")))}formResetCallback(){var c,h;x(this,a,!1,"f"),x(this,o,!1,"f"),v(this,e,"m",C).call(this),(c=this.resetFormControl)===null||c===void 0||c.call(this),(h=this.validationMessageCallback)===null||h===void 0||h.call(this,v(this,e,"m",C).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,g=new WeakMap,u=new WeakMap,l=new WeakMap,k=new WeakMap,E=new WeakMap,D=new WeakMap,U=new WeakMap,M=new WeakMap,P=new WeakMap,O=new WeakMap,e=new WeakSet,p=function(){let c=this.getRootNode(),h=`${this.localName}[name="${this.getAttribute("name")}"]`;return c.querySelectorAll(h)},C=function(){if(this.hasAttribute("disabled"))return!1;let c=v(this,o,"f")||v(this,a,"f")&&!this.validity.valid&&!v(this,r,"f");return c&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),c},A=function(c){let h=this.constructor,w={},$=h.validators,q=[],Z=$.some(L=>L.isValid instanceof Promise);v(this,P,"f")||(x(this,O,new Promise(L=>{x(this,M,L,"f")}),"f"),x(this,P,!0,"f")),v(this,g,"f")&&(v(this,g,"f").abort(),x(this,u,v(this,g,"f"),"f"));let G=new AbortController;x(this,g,G,"f");let B,ve=!1;$.length&&($.forEach(L=>{let ie=L.key||"customError",Y=L.isValid(this,c,G.signal);Y instanceof Promise?(q.push(Y),Y.then(ne=>{ne!=null&&(w[ie]=!ne,B=v(this,e,"m",ae).call(this,L,c),v(this,e,"m",H).call(this,w,B))})):(w[ie]=!Y,this.validity[ie]!==!Y&&(ve=!0),!Y&&!B&&(B=v(this,e,"m",ae).call(this,L,c)))}),Promise.allSettled(q).then(()=>{var L;G!=null&&G.signal.aborted||(x(this,P,!1,"f"),(L=v(this,M,"f"))===null||L===void 0||L.call(this))}),(ve||!Z)&&v(this,e,"m",H).call(this,w,B))},H=function(c,h){if(this.validationTarget)this.internals.setValidity(c,h,this.validationTarget),x(this,l,!1,"f");else{if(this.internals.setValidity(c,h),this.internals.validity.valid)return;x(this,l,!0,"f")}},ae=function(c,h){if(this.validityCallback){let w=this.validityCallback(c.key||"customError");if(w)return w}return c.message instanceof Function?c.message(this,h):c.message},We}import{css as Be,html as oe,LitElement as Je}from"lit";import{property as S}from"lit/decorators.js";var Cr=["en","nb","fi","da","sv"],he="en",re=t=>Cr.find(e=>t===e||t.toLowerCase().includes(e))||he;function Oe(){if(typeof window=="undefined"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return re(t)}try{let t=Pe(document);if(t)return re(t);let e=Lr();if(e)return re(e);let r=Pe(je());return r?re(r):he}catch(t){return console.warn("could not detect locale, falling back to source locale",t),he}}var Te=(t,e,r,o,a)=>{Q.load("en",t),Q.load("nb",e),Q.load("fi",r),Q.load("da",o),Q.load("sv",a);let g=Oe();Q.activate(g),Ve(),Sr()},zr="warp-i18n-change";function Ve(){typeof window!="undefined"&&window.dispatchEvent(new Event(zr))}var De=!1;function Sr(){if(De||typeof window=="undefined"||!(document!=null&&document.documentElement))return;De=!0;let t=()=>{let a=Oe();Q.locale!==a&&(Q.activate(a),Ve())},e=new MutationObserver(a=>{for(let g of a)if(g.type==="attributes"&&g.attributeName==="lang"){t();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=je();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let o=Mr();o&&e.observe(o,{attributes:!0,attributeFilter:["lang"]})}function je(){var t,e;try{return(e=(t=window.parent)==null?void 0:t.document)!=null?e:null}catch(r){return null}}function Pe(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 Mr(){var t;try{return(t=window.frameElement)!=null?t:null}catch(e){return null}}function Lr(){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{html as Qr,LitElement as Ie}from"lit";import{property as V}from"lit/decorators.js";import{classMap as qr}from"lit/directives/class-map.js";import{css as Ae}from"lit";var te=Ae`
10
+ `)),L(v)&&_e.test(v)?JSON.parse(`"${v}"`):L(v)?v:cr(v,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return ie(this._locales||this._locale,e,r)}number(e,r){return re(this._locales||this._locale,e,r)}};function gr(o={}){return new te(o)}var C=gr();var d=function(o,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!t:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(o):t?t.value:e.get(o)},g=function(o,e,r,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?o!==e||!a:!e.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,r):a?a.value=r:e.set(o,r),r};function Ce(o){var e,r,t,a,l,s,i,v,p,z,F,N,y,S,O,x,V,j,J;class Ue extends o{constructor(...n){var c,h,m;super(...n),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),t.set(this,!1),a.set(this,!1),l.set(this,void 0),s.set(this,void 0),i.set(this,!0),p.set(this,""),z.set(this,()=>{g(this,a,!0,"f"),g(this,r,!0,"f"),d(this,e,"m",x).call(this)}),F.set(this,()=>{g(this,r,!1,"f"),d(this,e,"m",V).call(this,this.shouldFormValueUpdate()?d(this,p,"f"):""),!this.validity.valid&&d(this,a,"f")&&g(this,t,!0,"f");let M=d(this,e,"m",x).call(this);this.validationMessageCallback&&this.validationMessageCallback(M?this.internals.validationMessage:"")}),N.set(this,()=>{var M;d(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),g(this,i,!1,"f")),g(this,a,!0,"f"),g(this,t,!0,"f"),d(this,e,"m",x).call(this),(M=this===null||this===void 0?void 0:this.validationMessageCallback)===null||M===void 0||M.call(this,this.showError?this.internals.validationMessage:"")}),y.set(this,void 0),S.set(this,!1),O.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",d(this,z,"f")),(h=this.addEventListener)===null||h===void 0||h.call(this,"blur",d(this,F,"f")),(m=this.addEventListener)===null||m===void 0||m.call(this,"invalid",d(this,N,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let n=this.validators.map(m=>m.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...n])]}static getValidator(n){return this.validators.find(c=>c.attribute===n)||null}static getValidators(n){return this.validators.filter(c=>{var h;if(c.attribute===n||!((h=c.attribute)===null||h===void 0)&&h.includes(n))return!0})}get form(){return this.internals.form}get showError(){return d(this,e,"m",x).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(n,c,h){var m;(m=super.attributeChangedCallback)===null||m===void 0||m.call(this,n,c,h);let q=this.constructor.getValidators(n);q!=null&&q.length&&this.validationTarget&&this.setValue(d(this,p,"f"))}setValue(n){var c;g(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),g(this,p,n,"f");let m=this.shouldFormValueUpdate()?n:null;this.internals.setFormValue(m),d(this,e,"m",V).call(this,m),this.valueChangedCallback&&this.valueChangedCallback(m),d(this,e,"m",x).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(n=>n(d(this,O,"f")))}formResetCallback(){var n,c;g(this,a,!1,"f"),g(this,t,!1,"f"),d(this,e,"m",x).call(this),(n=this.resetFormControl)===null||n===void 0||n.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,d(this,e,"m",x).call(this)?this.validationMessage:"")}}return r=new WeakMap,t=new WeakMap,a=new WeakMap,l=new WeakMap,s=new WeakMap,i=new WeakMap,p=new WeakMap,z=new WeakMap,F=new WeakMap,N=new WeakMap,y=new WeakMap,S=new WeakMap,O=new WeakMap,e=new WeakSet,v=function(){let n=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return n.querySelectorAll(c)},x=function(){if(this.hasAttribute("disabled"))return!1;let n=d(this,t,"f")||d(this,a,"f")&&!this.validity.valid&&!d(this,r,"f");return n&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),n},V=function(n){let c=this.constructor,h={},m=c.validators,M=[],q=m.some(_=>_.isValid instanceof Promise);d(this,S,"f")||(g(this,O,new Promise(_=>{g(this,y,_,"f")}),"f"),g(this,S,!0,"f")),d(this,l,"f")&&(d(this,l,"f").abort(),g(this,s,d(this,l,"f"),"f"));let Y=new AbortController;g(this,l,Y,"f");let Q,se=!1;m.length&&(m.forEach(_=>{let K=_.key||"customError",A=_.isValid(this,n,Y.signal);A instanceof Promise?(M.push(A),A.then(W=>{W!=null&&(h[K]=!W,Q=d(this,e,"m",J).call(this,_,n),d(this,e,"m",j).call(this,h,Q))})):(h[K]=!A,this.validity[K]!==!A&&(se=!0),!A&&!Q&&(Q=d(this,e,"m",J).call(this,_,n)))}),Promise.allSettled(M).then(()=>{var _;Y!=null&&Y.signal.aborted||(g(this,S,!1,"f"),(_=d(this,y,"f"))===null||_===void 0||_.call(this))}),(se||!q)&&d(this,e,"m",j).call(this,h,Q))},j=function(n,c){if(this.validationTarget)this.internals.setValidity(n,c,this.validationTarget),g(this,i,!1,"f");else{if(this.internals.setValidity(n,c),this.internals.validity.valid)return;g(this,i,!0,"f")}},J=function(n,c){if(this.validityCallback){let h=this.validityCallback(n.key||"customError");if(h)return h}return n.message instanceof Function?n.message(this,c):n.message},Ue}import{html as B,LitElement as Ye,nothing as Cr}from"lit";import{property as f}from"lit/decorators.js";var pr=["en","nb","fi","da","sv"],ne="en",Z=o=>pr.find(e=>o===e||o.toLowerCase().includes(e))||ne;function Fe(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Z(o)}try{let o=Ee(document);if(o)return Z(o);let e=xr();if(e)return Z(e);let r=Ee(Le());return r?Z(r):ne}catch(o){return console.warn("could not detect locale, falling back to source locale",o),ne}}var Se=(o,e,r,t,a)=>{C.load("en",o),C.load("nb",e),C.load("fi",r),C.load("da",t),C.load("sv",a);let l=Fe();C.activate(l),Oe(),wr()},mr="warp-i18n-change";function Oe(){typeof window!="undefined"&&window.dispatchEvent(new Event(mr))}var Me=!1;function wr(){if(Me||typeof window=="undefined"||!(document!=null&&document.documentElement))return;Me=!0;let o=()=>{let a=Fe();C.locale!==a&&(C.activate(a),Oe())},e=new MutationObserver(a=>{for(let l of a)if(l.type==="attributes"&&l.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=fr();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 Ee(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 fr(){var o;try{return(o=window.frameElement)!=null?o:null}catch(e){return null}}function xr(){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{html as yr,LitElement as Ie,nothing as _r}from"lit";import{property as T}from"lit/decorators.js";import{css as Te}from"lit";var G=Te`
11
11
  *,
12
12
  :before,
13
13
  :after {
@@ -280,7 +280,7 @@ Please compile your catalog first.
280
280
  svg {
281
281
  pointer-events: none;
282
282
  }
283
- `,Rr=Ae`*, :before, :after {
283
+ `,Ar=Te`*, :before, :after {
284
284
  --w-rotate: 0;
285
285
  --w-rotate-x: 0;
286
286
  --w-rotate-y: 0;
@@ -2446,24 +2446,255 @@ Please compile your catalog first.
2446
2446
  display: none
2447
2447
  }
2448
2448
  }
2449
- `;import{css as Er}from"lit";var Ne=Er`.w-button,
2450
- .w-button--secondary {
2449
+ `;import{css as kr}from"lit";var Ve=kr`
2450
+ /* If not a link variant this should look like a button */
2451
+ :host(:not([variant="link"])) {
2452
+ --_background: var(--background, var(--w-s-color-background));
2453
+ --_background-hover: var(
2454
+ --background-hover,
2455
+ var(--w-s-color-background-hover)
2456
+ );
2457
+ --_background-active: var(
2458
+ --background-active,
2459
+ var(--w-s-color-background-active)
2460
+ );
2461
+ --_text-color: var(--color, var(--w-s-color-text-link));
2462
+ --_text-color-hover: var(--color-hover, var(--w-s-color-text-link));
2463
+ --_text-color-active: var(--color-active, var(--w-s-color-text-link));
2464
+ --_border-width: var(--border-width, 2px);
2465
+ --_border: var(--border, var(--w-s-color-border));
2466
+ --_border-hover: var(--border-hover, var(--w-s-color-border-hover));
2467
+ --_border-active: var(--border-active, var(--w-s-color-border-active));
2468
+ --_border-radius: var(--border-radius, var(--w-button-radius-default, 8px));
2469
+ --_font-size: var(--font-size, var(--w-font-size-m));
2470
+ --_line-height: var(--line-height, var(--w-line-height-m));
2471
+ --_font-weight: var(--font-weight, bold);
2472
+ --_padding-x: var(--padding-x, 16px);
2473
+ --_padding-y: var(--padding-y, 13px);
2474
+ }
2475
+
2476
+ :host(:not([variant="link"])) a {
2477
+ display: inline-flex;
2478
+ justify-content: center;
2479
+ align-items: center;
2480
+ text-align: center;
2481
+ text-decoration: none;
2482
+ cursor: pointer;
2483
+ transition:
2484
+ color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2485
+ background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2486
+ border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2487
+ fill 150ms cubic-bezier(0.4, 0, 0.2, 1),
2488
+ stroke 150ms cubic-bezier(0.4, 0, 0.2, 1);
2489
+
2490
+ background-color: var(--_background);
2491
+ color: var(--_text-color);
2492
+ border: var(--_border-width) solid var(--_border);
2493
+ border-radius: var(--_border-radius);
2494
+ padding: calc(var(--_padding-y) - var(--_border-width))
2495
+ calc(var(--_padding-x) - var(--_border-width));
2496
+ font-size: var(--_font-size);
2497
+ line-height: var(--_line-height);
2498
+ font-weight: var(--_font-weight);
2499
+ }
2500
+
2501
+ :host(:not([variant="link"])) a:hover {
2502
+ background-color: var(--_background-hover);
2503
+ border-color: var(--_border-hover);
2504
+ color: var(--_text-color-hover);
2505
+ }
2506
+
2507
+ :host(:not([variant="link"])) a:active {
2508
+ background-color: var(--_background-active);
2509
+ border-color: var(--_border-active);
2510
+ color: var(--_text-color-active);
2511
+ }
2512
+
2513
+ :host(:not([variant="link"])) a:focus-visible {
2514
+ outline: 2px solid var(--w-s-color-border-focus);
2515
+ outline-offset: var(--w-outline-offset, 1px);
2516
+ }
2517
+
2518
+ /* Variants config */
2519
+ :host([variant="primary"]) {
2520
+ --background: var(--w-s-color-background-primary);
2521
+ --background-hover: var(--w-s-color-background-primary-hover);
2522
+ --background-active: var(--w-s-color-background-primary-active);
2523
+ --color: var(--w-s-color-text-inverted);
2524
+ --color-hover: var(--w-s-color-text-inverted);
2525
+ --color-active: var(--w-s-color-text-inverted);
2526
+ --border-width: 0px;
2527
+ }
2528
+ :host([variant="quiet"]),
2529
+ :host([quiet]) /* deprecated, backwards compatibility, use variant="quiet" */ {
2530
+ --background: transparent;
2531
+ --color: var(--w-s-color-text-link);
2532
+ --color-hover: var(--w-s-color-text-link-hover);
2533
+ --color-active: var(--w-s-color-text-link-active);
2534
+ --border-width: 0px;
2535
+ }
2536
+ :host([variant="negative"]) {
2537
+ --background: var(--w-s-color-background-negative);
2538
+ --background-hover: var(--w-s-color-background-negative-hover);
2539
+ --background-active: var(--w-s-color-background-negative-active);
2540
+ --color: var(--w-s-color-text-inverted);
2541
+ --color-hover: var(--w-s-color-text-inverted);
2542
+ --color-active: var(--w-s-color-text-inverted);
2543
+ --border-width: 0px;
2544
+ }
2545
+ :host([variant="negativeQuiet"]),
2546
+ :host([quiet][variant="negative"]) /* deprecated, backwards compatibility */ {
2547
+ --background: transparent;
2548
+ --background-hover: var(--w-s-color-background-negative-subtle-hover);
2549
+ --background-active: var(--w-s-color-background-negative-subtle-active);
2550
+ --color: var(--w-s-color-text-negative);
2551
+ --color-hover: var(--w-s-color-text-negative);
2552
+ --color-active: var(--w-s-color-text-negative);
2553
+ --border-width: 0px;
2554
+ }
2555
+ :host([variant="utility"]) {
2556
+ --background: var(--w-s-color-background);
2557
+ --background-hover: var(--w-s-color-background-hover);
2558
+ --background-active: var(--w-s-color-background-active);
2559
+ --color: var(--w-s-color-text);
2560
+ --color-hover: var(--w-s-color-text);
2561
+ --color-active: var(--w-s-color-text);
2562
+ --border-radius: var(--w-button-radius-utility, 4px);
2563
+ --border-width: 1px;
2564
+ }
2565
+ :host([variant="utilityQuiet"]),
2566
+ :host([quiet][variant="utility"]) /* deprecated, backwards compatibility */ {
2567
+ --background: transparent;
2568
+ --color: var(--w-s-color-text);
2569
+ --color-hover: var(--w-s-color-text);
2570
+ --color-active: var(--w-s-color-text);
2571
+ --border-width: 0px;
2572
+ }
2573
+ :host([variant="overlay"]) {
2574
+ --background: var(--w-color-background);
2575
+ --background-hover: var(--w-color-background-hover);
2576
+ --background-active: var(--w-color-background-active);
2577
+ --color: var(--w-s-color-text);
2578
+ --color-hover: var(--w-s-color-text);
2579
+ --color-active: var(--w-s-color-text);
2580
+ --border-radius: 9999px;
2581
+ --border-width: 0px;
2582
+ }
2583
+ :host([variant="overlayQuiet"]),
2584
+ :host([quiet][variant="overlay"]) /* deprecated, backwards compatibility */ {
2585
+ --background: transparent;
2586
+ --background-hover: var(--w-s-color-background-hover);
2587
+ --background-active: var(--w-s-color-background-active);
2588
+ --color: var(--w-s-color-text);
2589
+ --color-hover: var(--w-s-color-text);
2590
+ --color-active: var(--w-s-color-text);
2591
+ --border-radius: 9999px;
2592
+ --border-width: 0px;
2593
+ }
2594
+ :host([variant="overlayInverted"]) {
2595
+ --background: var(--w-s-color-background-inverted);
2596
+ --background-hover: var(--w-s-color-background-inverted-hover);
2597
+ --background-active: var(--w-s-color-background-inverted-active);
2598
+ --color: var(--w-s-color-text-inverted);
2599
+ --color-hover: var(--w-s-color-text-inverted);
2600
+ --color-active: var(--w-s-color-text-inverted);
2601
+ --border-radius: 9999px;
2602
+ --border-width: 0px;
2603
+ }
2604
+ :host([variant="overlayInvertedQuiet"]),
2605
+ :host([quiet][variant="overlayInverted"]) /* deprecated, backwards compatibility */ {
2606
+ --background: transparent;
2607
+ --background-hover: var(--w-s-color-background-inverted-hover);
2608
+ --background-active: var(--w-s-color-background-inverted-active);
2609
+ --color: var(--w-s-color-text-inverted);
2610
+ --color-hover: var(--w-s-color-text-inverted);
2611
+ --color-active: var(--w-s-color-text-inverted);
2612
+ --border-radius: 9999px;
2613
+ --border-width: 0px;
2614
+ }
2615
+
2616
+ :host([variant="link"]) {
2617
+ --background: none;
2618
+ --background-hover: none;
2619
+ --background-active: none;
2620
+ --border-width: 0px;
2621
+ --font-weight: normal;
2622
+ display: inline;
2623
+ }
2624
+
2625
+ /* States config, selects --loading as well since loading is always supposed to be disabled */
2626
+ :host(:disabled),
2627
+ :host([disabled]) {
2628
+ --background: var(--w-s-color-background-disabled);
2629
+ --background-hover: var(--w-s-color-background-disabled);
2630
+ --background-active: var(--w-s-color-background-disabled);
2631
+ --color: var(--w-s-color-text-inverted);
2632
+ --color-hover: var(--w-s-color-text-inverted);
2633
+ --color-active: var(--w-s-color-text-inverted);
2634
+ --border-width: 0px;
2635
+ }
2636
+
2637
+ :host(:disabled) a,
2638
+ :host([disabled]) a {
2639
+ cursor: not-allowed;
2640
+ pointer-events: none;
2641
+ }
2642
+
2643
+ :host([variant="link"]):hover a {
2644
+ text-decoration: underline;
2645
+ }
2646
+
2647
+ /* Sizes config */
2648
+ :host([small]) {
2649
+ --padding-x: 12px;
2650
+ --padding-y: 8px;
2651
+ --font-size: var(--w-font-size-xs);
2652
+ --line-height: var(--w-line-height-xs);
2653
+ }
2654
+
2655
+ /* Width config */
2656
+ :host([full-width]) a {
2657
+ width: 100%;
2658
+ max-width: 100%;
2659
+ }
2660
+ `;var Pe=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],k=class extends Ie{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!Pe.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2661
+ ${Pe.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){return yr`
2662
+ <a
2663
+ href="${this.href}"
2664
+ target="${this.target}"
2665
+ rel="${this.target==="_blank"?this.rel||"noopener":_r}"
2666
+ tabindex="0"
2667
+ >
2668
+ <slot></slot>
2669
+ </a>
2670
+ `}};k.shadowRootOptions={...Ie.shadowRootOptions,delegatesFocus:!0},k.styles=[G,Ve],u([T({type:Boolean,reflect:!0})],k.prototype,"autofocus",2),u([T({reflect:!0})],k.prototype,"variant",2),u([T({type:Boolean,reflect:!0})],k.prototype,"small",2),u([T({reflect:!0})],k.prototype,"href",2),u([T({type:Boolean,reflect:!0})],k.prototype,"disabled",2),u([T({reflect:!0})],k.prototype,"target",2),u([T({reflect:!0})],k.prototype,"rel",2),u([T({attribute:"full-width",type:Boolean,reflect:!0})],k.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",k);var Ne=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var Ae=JSON.parse('{"button.aria.loading":["Loading..."]}');var De=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var je=JSON.parse('{"button.aria.loading":["Laster..."]}');var $e=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as zr}from"lit";var qe=zr`
2671
+ :host {
2451
2672
  /* Local scoped variables, given the default button (the secondary variant) as a default */
2452
2673
  --_background: var(--background, var(--w-s-color-background));
2453
- --_background-hover: var(--background-hover, var(--w-s-color-background-hover));
2454
- --_background-active: var(--background-active, var(--w-s-color-background-active));
2674
+ --_background-hover: var(
2675
+ --background-hover,
2676
+ var(--w-s-color-background-hover)
2677
+ );
2678
+ --_background-active: var(
2679
+ --background-active,
2680
+ var(--w-s-color-background-active)
2681
+ );
2455
2682
  --_text-color: var(--color, var(--w-s-color-text-link));
2683
+ --_text-color-hover: var(--color-hover, var(--w-s-color-text-link));
2684
+ --_text-color-active: var(--color-active, var(--w-s-color-text-link));
2456
2685
  --_border-width: var(--border-width, 2px);
2457
2686
  --_border: var(--border, var(--w-s-color-border));
2458
2687
  --_border-hover: var(--border-hover, var(--w-s-color-border-hover));
2459
2688
  --_border-active: var(--border-active, var(--w-s-color-border-active));
2460
- --_border-radius: var(--w-button-radius-default, 8px);
2689
+ --_border-radius: var(--border-radius, var(--w-button-radius-default, 8px));
2461
2690
  --_font-size: var(--font-size, var(--w-font-size-m));
2462
2691
  --_line-height: var(--line-height, var(--w-line-height-m));
2463
2692
  --_font-weight: var(--font-weight, bold);
2464
2693
  --_padding-x: var(--padding-x, 16px);
2465
2694
  --_padding-y: var(--padding-y, 13px);
2695
+ }
2466
2696
 
2697
+ button {
2467
2698
  /* Base setup for all buttons */
2468
2699
  display: inline-flex;
2469
2700
  justify-content: center;
@@ -2471,237 +2702,279 @@ Please compile your catalog first.
2471
2702
  text-align: center;
2472
2703
  cursor: pointer;
2473
2704
  transition:
2474
- color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2475
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2476
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2477
- fill 150ms cubic-bezier(0.4, 0, 0.2, 1),
2478
- stroke 150ms cubic-bezier(0.4, 0, 0.2, 1);
2705
+ color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2706
+ background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2707
+ border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2708
+ fill 150ms cubic-bezier(0.4, 0, 0.2, 1),
2709
+ stroke 150ms cubic-bezier(0.4, 0, 0.2, 1);
2479
2710
 
2480
2711
  /* Hook the local vars up to the button stuff */
2481
2712
  background-color: var(--_background);
2482
2713
  color: var(--_text-color);
2483
2714
  border: var(--_border-width) solid var(--_border);
2484
2715
  border-radius: var(--_border-radius);
2485
- padding: calc(var(--_padding-y) - var(--_border-width)) calc(var(--_padding-x) - var(--_border-width));
2716
+ padding: calc(var(--_padding-y) - var(--_border-width))
2717
+ calc(var(--_padding-x) - var(--_border-width));
2486
2718
  font-size: var(--_font-size);
2487
2719
  line-height: var(--_line-height);
2488
2720
  font-weight: var(--_font-weight);
2489
- }
2721
+ }
2490
2722
 
2491
- .w-button:hover {
2492
- background-color: var(--_background-hover);
2493
- border-color: var(--_border-hover);
2494
- }
2723
+ button:hover {
2724
+ background-color: var(--_background-hover);
2725
+ border-color: var(--_border-hover);
2726
+ color: var(--_text-color-hover);
2727
+ }
2495
2728
 
2496
- .w-button:active {
2497
- background-color: var(--_background-active);
2498
- border-color: var(--_border-active);
2499
- }
2729
+ button:active {
2730
+ background-color: var(--_background-active);
2731
+ border-color: var(--_border-active);
2732
+ color: var(--_text-color-active);
2733
+ }
2500
2734
 
2501
- .w-button:focus-visible {
2502
- outline: 2px solid var(--w-s-color-border-focus);
2503
- outline-offset: var(--w-outline-offset, 1px);
2504
- }
2735
+ button:focus-visible {
2736
+ outline: 2px solid var(--w-s-color-border-focus);
2737
+ outline-offset: var(--w-outline-offset, 1px);
2738
+ }
2505
2739
 
2506
- /* Variants config */
2507
- .w-button--primary {
2508
- --background: var(--w-color-button-primary-background);
2509
- --background-hover: var(--w-color-button-primary-background-hover);
2510
- --background-active: var(--w-color-button-primary-background-active);
2511
- --color: var(--w-s-color-text-inverted);
2512
- --border-width: 0px;
2513
- }
2514
- .w-button--negative {
2515
- --background: var(--w-s-color-background-negative);
2516
- --background-hover: var(--w-s-color-background-negative-hover);
2517
- --background-active: var(--w-s-color-background-negative-active);
2518
- --color: var(--w-s-color-text-inverted);
2519
- --border-width: 0px;
2520
- }
2521
- .w-button--negative-quiet {
2522
- --background: transparent;
2523
- --background-hover: var(--w-s-color-background-negative-subtle-hover);
2524
- --background-active: var(--w-s-color-background-negative-subtle-active);
2525
- --color: var(--w-s-color-text-negative);
2526
- --border-width: 0px;
2527
- }
2528
- .w-button--utility {
2529
- --background: var(--w-s-color-background);
2530
- --background-hover: var(--w-s-color-background-hover);
2531
- --background-active: var(--w-s-color-background-active);
2532
- --color: var(--w-s-color-text);
2533
- --border-radius: var(--w-button-radius-utility, 4px);
2534
- --border-width: 1px;
2535
- }
2536
- .w-button--utility-quiet {
2537
- --background: transparent;
2538
- --color: var(--w-s-color-text);
2539
- --border-width: 0px;
2540
- }
2541
- .w-button--quiet {
2542
- --background: transparent;
2543
- --border-width: 0px;
2544
- }
2545
- .w-button--overlay {
2546
- --background: var(--w-color-background);
2547
- --background-hover: var(--w-color-background-hover);
2548
- --background-active: var(--w-color-background-active);
2549
- --color: var(--w-s-color-text);
2550
- --border-radius: 9999px;
2551
- --border-width: 0px;
2552
- }
2553
- .w-button--overlay-quiet {
2554
- --background: transparent;
2555
- --background-hover: var(--w-s-color-background-hover);
2556
- --background-active: var(--w-s-color-background-active);
2557
- --color: var(--w-s-color-text);
2558
- --border-radius: 9999px;
2559
- --border-width: 0px;
2560
- }
2561
- .w-button--overlay-inverted {
2562
- --background: var(--w-s-color-background-inverted);
2563
- --background-hover: var(--w-s-color-background-inverted-hover);
2564
- --background-active: var(--w-s-color-background-inverted-active);
2565
- --color: var(--w-s-color-text-inverted);
2566
- --border-radius: 9999px;
2567
- --border-width: 0px;
2568
- }
2569
- .w-button--overlay-inverted-quiet {
2570
- --background: transparent;
2571
- --background-hover: var(--w-s-color-background-inverted-hover);
2572
- --background-active: var(--w-s-color-background-inverted-active);
2573
- --color: var(--w-s-color-text-inverted);
2574
- --border-radius: 9999px;
2575
- --border-width: 0px;
2576
- }
2740
+ /* Variants config */
2741
+ :host([variant="primary"]) {
2742
+ --background: var(--w-s-color-background-primary);
2743
+ --background-hover: var(--w-s-color-background-primary-hover);
2744
+ --background-active: var(--w-s-color-background-primary-active);
2745
+ --color: var(--w-s-color-text-inverted);
2746
+ --color-hover: var(--w-s-color-text-inverted);
2747
+ --color-active: var(--w-s-color-text-inverted);
2748
+ --border-width: 0px;
2749
+ }
2750
+ :host([variant="quiet"]),
2751
+ :host([quiet]) /* deprecated, backwards compatibility, use variant="quiet" */ {
2752
+ --background: transparent;
2753
+ --color: var(--w-s-color-text-link);
2754
+ --color-hover: var(--w-s-color-text-link-hover);
2755
+ --color-active: var(--w-s-color-text-link-active);
2756
+ --border-width: 0px;
2757
+ }
2758
+ :host([variant="negative"]) {
2759
+ --background: var(--w-s-color-background-negative);
2760
+ --background-hover: var(--w-s-color-background-negative-hover);
2761
+ --background-active: var(--w-s-color-background-negative-active);
2762
+ --color: var(--w-s-color-text-inverted);
2763
+ --color-hover: var(--w-s-color-text-inverted);
2764
+ --color-active: var(--w-s-color-text-inverted);
2765
+ --border-width: 0px;
2766
+ }
2767
+ :host([variant="negativeQuiet"]),
2768
+ :host([quiet][variant="negative"]) /* deprecated, backwards compatibility */ {
2769
+ --background: transparent;
2770
+ --background-hover: var(--w-s-color-background-negative-subtle-hover);
2771
+ --background-active: var(--w-s-color-background-negative-subtle-active);
2772
+ --color: var(--w-s-color-text-negative);
2773
+ --color-hover: var(--w-s-color-text-negative);
2774
+ --color-active: var(--w-s-color-text-negative);
2775
+ --border-width: 0px;
2776
+ }
2777
+ :host([variant="utility"]) {
2778
+ --background: var(--w-s-color-background);
2779
+ --background-hover: var(--w-s-color-background-hover);
2780
+ --background-active: var(--w-s-color-background-active);
2781
+ --color: var(--w-s-color-text);
2782
+ --color-hover: var(--w-s-color-text);
2783
+ --color-active: var(--w-s-color-text);
2784
+ --border-radius: var(--w-button-radius-utility, 4px);
2785
+ --border-width: 1px;
2786
+ }
2787
+ :host([variant="utilityQuiet"]),
2788
+ :host([quiet][variant="utility"]) /* deprecated, backwards compatibility */ {
2789
+ --background: transparent;
2790
+ --color: var(--w-s-color-text);
2791
+ --color-hover: var(--w-s-color-text);
2792
+ --color-active: var(--w-s-color-text);
2793
+ --border-width: 0px;
2794
+ }
2795
+ :host([variant="overlay"]) {
2796
+ --background: var(--w-color-background);
2797
+ --background-hover: var(--w-color-background-hover);
2798
+ --background-active: var(--w-color-background-active);
2799
+ --color: var(--w-s-color-text);
2800
+ --color-hover: var(--w-s-color-text);
2801
+ --color-active: var(--w-s-color-text);
2802
+ --border-radius: 9999px;
2803
+ --border-width: 0px;
2804
+ }
2805
+ :host([variant="overlayQuiet"]),
2806
+ :host([quiet][variant="overlay"]) /* deprecated, backwards compatibility */ {
2807
+ --background: transparent;
2808
+ --background-hover: var(--w-s-color-background-hover);
2809
+ --background-active: var(--w-s-color-background-active);
2810
+ --color: var(--w-s-color-text);
2811
+ --color-hover: var(--w-s-color-text);
2812
+ --color-active: var(--w-s-color-text);
2813
+ --border-radius: 9999px;
2814
+ --border-width: 0px;
2815
+ }
2816
+ :host([variant="overlayInverted"]) {
2817
+ --background: var(--w-s-color-background-inverted);
2818
+ --background-hover: var(--w-s-color-background-inverted-hover);
2819
+ --background-active: var(--w-s-color-background-inverted-active);
2820
+ --color: var(--w-s-color-text-inverted);
2821
+ --color-hover: var(--w-s-color-text-inverted);
2822
+ --color-active: var(--w-s-color-text-inverted);
2823
+ --border-radius: 9999px;
2824
+ --border-width: 0px;
2825
+ }
2826
+ :host([variant="overlayInvertedQuiet"]),
2827
+ :host([quiet][variant="overlayInverted"]) /* deprecated, backwards compatibility */ {
2828
+ --background: transparent;
2829
+ --background-hover: var(--w-s-color-background-inverted-hover);
2830
+ --background-active: var(--w-s-color-background-inverted-active);
2831
+ --color: var(--w-s-color-text-inverted);
2832
+ --color-hover: var(--w-s-color-text-inverted);
2833
+ --color-active: var(--w-s-color-text-inverted);
2834
+ --border-radius: 9999px;
2835
+ --border-width: 0px;
2836
+ }
2577
2837
 
2578
- .w-button--link {
2579
- --background: none;
2580
- --background-hover: none;
2581
- --background-active: none;
2582
- --border-width: 0;
2583
- --font-weight: normal;
2584
- display: inline;
2585
- }
2586
- .w-button--overlay {
2587
- --background: var(--w-color-background);
2588
- --background-hover: var(--w-color-background-hover);
2589
- --background-active: var(--w-color-background-active);
2590
- --color: var(--w-s-color-text);
2591
- --border-radius: 9999px;
2592
- --border-width: 0px;
2593
- }
2594
- .w-button--overlay-quiet {
2595
- --background: transparent;
2596
- --background-hover: var(--w-s-color-background-hover);
2597
- --background-active: var(--w-s-color-background-active);
2598
- --color: var(--w-s-color-text);
2599
- --border-radius: 9999px;
2600
- --border-width: 0px;
2601
- }
2602
- .w-button--overlay-inverted {
2603
- --background: var(--w-s-color-background-inverted);
2604
- --background-hover: var(--w-s-color-background-inverted-hover);
2605
- --background-active: var(--w-s-color-background-inverted-active);
2606
- --color: var(--w-s-color-text-inverted);
2607
- --border-radius: 9999px;
2608
- --border-width: 0px;
2609
- }
2610
- .w-button--overlay-inverted-quiet {
2611
- --background: transparent;
2612
- --background-hover: var(--w-s-color-background-inverted-hover);
2613
- --background-active: var(--w-s-color-background-inverted-active);
2614
- --color: var(--w-s-color-text-inverted);
2615
- --border-radius: 9999px;
2616
- --border-width: 0px;
2617
- }
2838
+ :host([variant="link"]) {
2839
+ --background: none;
2840
+ --background-hover: none;
2841
+ --background-active: none;
2842
+ --border-width: 0px;
2843
+ --font-weight: normal;
2844
+ display: inline;
2845
+ }
2618
2846
 
2619
- /* States config, selects --loading as well since loading is always supposed to be disabled */
2620
- .w-button:disabled,
2621
- .w-button--disabled,
2622
- .w-button--loading {
2623
- --background: var(--w-s-color-background-disabled);
2624
- --background-hover: var(--w-s-color-background-disabled);
2625
- --background-active: var(--w-s-color-background-disabled);
2626
- --color: var(--w-s-color-text-inverted);
2627
- --border-width: 0px;
2628
- pointer-events: none;
2629
- }
2847
+ :host([variant="pill"]) {
2848
+ --background: transparent;
2849
+ --background-hover: var(--w-color-button-pill-background-hover); /** TODO: this should use a semantic token */
2850
+ --background-active: var(--w-color-button-pill-background-active); /** TODO: this should use a semantic token */
2851
+ --border-radius: 50%;
2852
+ --border-width: 0px;
2853
+ --color: var(--w-s-color-icon);
2854
+ --color-hover: var(--w-s-color-icon-hover);
2855
+ --color-active: var(--w-s-color-icon-active);
2856
+ --padding-x: 14px; /* get a total height and width of 44px, matching atomic CSS variant */
2857
+ --padding-y: 14px;
2858
+ }
2630
2859
 
2631
- .w-button--link:hover {
2632
- text-decoration: underline;
2633
- }
2860
+ /* States config, selects --loading as well since loading is always supposed to be disabled */
2861
+ :host(:disabled),
2862
+ :host([disabled]) {
2863
+ --background: var(--w-s-color-background-disabled);
2864
+ --background-hover: var(--w-s-color-background-disabled);
2865
+ --background-active: var(--w-s-color-background-disabled);
2866
+ --color: var(--w-s-color-text-inverted);
2867
+ --color-hover: var(--w-s-color-text-inverted);
2868
+ --color-active: var(--w-s-color-text-inverted);
2869
+ --border-width: 0px;
2870
+ }
2634
2871
 
2635
- /* Sizes config */
2636
- .w-button--small {
2637
- --padding-x: 12px;
2638
- --padding-y: 8px;
2639
- --font-size: var(--w-font-size-xs);
2640
- --line-height: var(--w-line-height-xs);
2641
- }
2872
+ :host(:disabled) button,
2873
+ :host([disabled]) button {
2874
+ cursor: not-allowed;
2875
+ pointer-events: none;
2876
+ }
2642
2877
 
2643
- /* Width config */
2644
- .w-button--full-width {
2645
- width: 100%;
2646
- max-width: 100%;
2647
- }
2878
+ :host([loading]) {
2879
+ --background: var(--w-s-color-background-subtle);
2880
+ --background-hover: var(--w-s-color-background-subtle);
2881
+ --background-active: var(--w-s-color-background-subtle);
2882
+ --color: var(--w-s-color-text);
2883
+ --color-hover: var(--w-s-color-text);
2884
+ --color-active: var(--w-s-color-text);
2885
+ --border-width: 0px;
2886
+ }
2648
2887
 
2649
- .w-button--has-icon-only {
2650
- width: auto;
2651
- max-width: none;
2652
- --_padding-x: var(--_padding-y);
2653
- aspect-ratio: 1 / 1;
2654
- }
2888
+ :host([loading]) button {
2889
+ cursor: wait;
2890
+ pointer-events: none;
2891
+ }
2655
2892
 
2656
- a.w-button {
2657
- text-decoration: none !important;
2658
- }
2893
+ :host([variant="link"]):hover {
2894
+ text-decoration: underline;
2895
+ }
2659
2896
 
2660
- /* Copy of loading animation from warp */
2661
- .w-button--loading {
2662
- background-image: linear-gradient(
2663
- 135deg,
2664
- rgba(0, 0, 0, 0.05) 25%,
2665
- transparent 25%,
2666
- transparent 50%,
2667
- rgba(0, 0, 0, 0.05) 50%,
2668
- rgba(0, 0, 0, 0.05) 75%,
2669
- transparent 75%,
2670
- transparent
2671
- );
2672
- background-size: 30px 30px;
2673
- animation: animate-inprogress 3s linear infinite;
2674
- }
2897
+ /* Sizes config */
2898
+ :host([small]) {
2899
+ --padding-x: 12px;
2900
+ --padding-y: 8px;
2901
+ --font-size: var(--w-font-size-xs);
2902
+ --line-height: var(--w-line-height-xs);
2903
+ }
2675
2904
 
2676
- @keyframes animate-inprogress {
2677
- 0% {
2678
- background-position: 0 0;
2679
- }
2680
- 100% {
2681
- background-position: 60px 0;
2682
- }
2683
- }`;var Ue=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],z=class extends Ie{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!Ue.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2684
- ${Ue.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){let r=this.variant||"secondary",o={"w-button":r!=="link","w-button--primary":r==="primary","w-button--secondary":r==="secondary"||!this.variant,"w-button--negative":r==="negative","w-button--utility":r==="utility","w-button--quiet":r==="quiet","w-button--negative-quiet":r==="negativeQuiet","w-button--utility-quiet":r==="utilityQuiet","w-button--overlay":r==="overlay","w-button--overlay-inverted":r==="overlayInverted","w-button--overlay-quiet":r==="overlayQuiet","w-button--overlay-inverted-quiet":r==="overlayInvertedQuiet","w-button--small":this.small,"w-button--full-width":this.fullWidth,"w-button--disabled":this.disabled};return Qr`<a
2685
- href=${this.href}
2686
- target=${this.target}
2687
- rel=${this.target==="_blank"?this.rel||"noopener":void 0}
2688
- class=${qr(o)}>
2689
- <slot></slot>
2690
- </a>`}};z.shadowRootOptions={...Ie.shadowRootOptions,delegatesFocus:!0},z.styles=[te,Ne],m([V({type:Boolean,reflect:!0})],z.prototype,"autofocus",2),m([V({reflect:!0})],z.prototype,"variant",2),m([V({type:Boolean,reflect:!0})],z.prototype,"small",2),m([V({reflect:!0})],z.prototype,"href",2),m([V({type:Boolean,reflect:!0})],z.prototype,"disabled",2),m([V({reflect:!0})],z.prototype,"target",2),m([V({reflect:!0})],z.prototype,"rel",2),m([V({attribute:"full-width",type:Boolean,reflect:!0})],z.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",z);var Ye=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var Re=JSON.parse('{"button.aria.loading":["Loading..."]}');var He=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Xe=JSON.parse('{"button.aria.loading":["Laster..."]}');var Ze=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as Fr}from"lit";var Ge=Fr`*,: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}.text-center{text-align:center}.animate-inprogress{background-size:30px 30px;animation:3s linear infinite animate-inprogress;background-image:linear-gradient(135deg,#0000000d 25%,#0000 0 50%,#0000000d 0 75%,#0000 0,#0000)!important}@keyframes animate-inprogress{0%{background-position:0 0}to{background-position:60px 0}}.hover\\:bg-clip-padding:hover{-webkit-background-clip:padding-box;background-clip:padding-box}.bg-transparent{background-color:#0000}.bg-\\[--w-color-button-primary-background\\]{background-color:var(--w-color-button-primary-background)}.hover\\:bg-\\[--w-color-button-pill-background-hover\\]:hover{background-color:var(--w-color-button-pill-background-hover)}.hover\\:bg-\\[--w-color-button-primary-background-hover\\]:hover{background-color:var(--w-color-button-primary-background-hover)}.active\\:bg-\\[--w-color-button-pill-background-active\\]:active{background-color:var(--w-color-button-pill-background-active)}.active\\:bg-\\[--w-color-button-primary-background-active\\]:active{background-color:var(--w-color-button-primary-background-active)}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-transparent{border-color:#0000}.rounded-4{border-radius:4px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.inline-block{display:inline-block}.inline{display:inline}.inline-flex{display:inline-flex}.hover\\:underline:hover,.focus\\:underline:focus,.active\\:underline:active{text-decoration-line:underline}.hover\\:no-underline:hover,.focus\\:no-underline:focus,.active\\:no-underline:active{text-decoration:none}.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}.justify-center{justify-content:center}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled{background-color:var(--w-s-color-background-disabled)}.s-bg-negative{background-color:var(--w-s-color-background-negative)}.s-bg-subtle{background-color:var(--w-s-color-background-subtle)}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-negative-hover:hover{background-color:var(--w-s-color-background-negative-hover)}.hover\\:s-bg-negative-subtle-hover:hover{background-color:var(--w-s-color-background-negative-subtle-hover)}.active\\:s-bg-active:active{background-color:var(--w-s-color-background-active)}.active\\:s-bg-negative-active:active{background-color:var(--w-s-color-background-negative-active)}.active\\:s-bg-negative-subtle-active:active{background-color:var(--w-s-color-background-negative-subtle-active)}.s-text{color:var(--w-s-color-text)}.s-text-inverted{color:var(--w-s-color-text-inverted)}.s-text-link{color:var(--w-s-color-text-link)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-icon{color:var(--w-s-color-icon)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border{border-color:var(--w-s-color-border)}.hover\\:s-border-hover:hover{border-color:var(--w-s-color-border-hover)}.active\\:s-border-active:active{border-color:var(--w-s-color-border-active)}.max-w-full{max-width:100%}.max-w-max{max-width:max-content}.min-h-32{min-height:3.2rem}.min-w-32{min-width:3.2rem}.w-full{width:100%}.min-h-\\[44px\\]{min-height:44px}.min-w-\\[44px\\]{min-width:44px}.p-0{padding:0}.p-4{padding:.4rem}.px-14{padding-left:1.4rem;padding-right:1.4rem}.px-16{padding-left:1.6rem;padding-right:1.6rem}.py-10{padding-top:1rem;padding-bottom:1rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.py-6{padding-top:.6rem;padding-bottom:.6rem}.py-8{padding-top:.8rem;padding-bottom:.8rem}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.py-\\[11px\\]{padding-top:11px;padding-bottom:11px}.py-\\[7px\\]{padding-top:7px;padding-bottom:7px}.cursor-default{cursor:default}.font-bold{font-weight:700}.pointer-events-none{pointer-events:none}.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-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-\\[24\\]{line-height:2.4rem}`;var Ke=["primary","secondary","negative","utility","pill","link"],j="font-bold focusable justify-center transition-colors ease-in-out",f={primary:"s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",secondary:"s-text-link s-border s-bg hover:s-bg-hover hover:s-border-hover active:s-bg-active",utility:"s-text s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",destructive:"s-bg-negative s-text-inverted hover:s-bg-negative-hover active:s-bg-negative-active",pill:"s-icon hover:s-icon-hover active:s-icon-active bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",disabled:"s-text-inverted s-bg-disabled",quiet:"bg-transparent s-text-link hover:s-bg-hover active:s-bg-active",utilityQuiet:"s-text bg-transparent hover:s-bg-hover active:s-bg-active",negativeQuiet:"bg-transparent s-text-negative hover:s-bg-negative-subtle-hover active:s-bg-negative-subtle-active",loading:"s-text s-bg-subtle",link:"s-text-link"},b={primary:`border-0 rounded-radius-default ${j}`,secondary:`border-2 rounded-radius-default ${j}`,utility:`border rounded-radius-utility ${j}`,negative:`border-0 rounded-radius-default ${j}`,pill:`p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${j}`,link:`bg-transparent focusable ease-in-out inline active:underline hover:underline focus:underline ${f.link}`},n={xsmall:"py-6 px-16",small:"py-8 px-16",medium:"py-10 px-14",large:"py-12 px-16",utility:"py-[11px] px-[15px]",smallUtility:"py-[7px] px-[15px]",pill:"min-h-[44px] min-w-[44px]",pillSmall:"min-h-32 min-w-32",link:"p-0"},s={medium:"text-m leading-[24]",xsmall:"text-xs"},i={inProgress:`border-transparent animate-inprogress pointer-events-none ${f.loading}`,quiet:`border-0 rounded-8 ${j}`,utilityQuiet:`border-0 rounded-4 ${j}`,negativeQuiet:`border-0 rounded-8 ${j}`,isDisabled:`font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${f.disabled}`},d={secondary:`${n.medium} ${s.medium} ${b.secondary} ${f.secondary}`,secondaryHref:`${n.medium} ${s.medium} ${b.secondary} ${f.secondary}`,secondaryDisabled:`${n.medium} ${s.medium} ${b.secondary} ${i.isDisabled}`,secondarySmall:`${s.xsmall} ${n.xsmall} ${b.secondary} ${f.secondary}`,secondarySmallDisabled:`${s.xsmall} ${n.xsmall} ${b.secondary} ${i.isDisabled}`,secondaryQuiet:`${n.medium} ${s.medium} ${i.quiet} ${f.quiet}`,secondaryQuietDisabled:`${n.medium} ${s.medium} ${i.quiet} ${i.isDisabled}`,secondarySmallQuiet:`${s.xsmall} ${n.xsmall} ${i.quiet} ${f.quiet}`,secondarySmallQuietDisabled:`${s.xsmall} ${n.xsmall} ${i.quiet} ${i.isDisabled}`,secondaryLoading:`${n.medium} ${s.medium} ${b.secondary} ${i.inProgress}`,secondarySmallLoading:`${s.xsmall} ${n.xsmall} ${b.secondary} ${i.inProgress}`,secondarySmallQuietLoading:`${s.xsmall} ${n.xsmall} ${i.quiet} ${i.inProgress}`,secondaryQuietLoading:`${n.medium} ${s.medium} ${i.quiet} ${i.inProgress}`,primary:`${n.large} ${s.medium} ${b.primary} ${f.primary}`,primaryDisabled:`${n.large} ${s.medium} ${i.isDisabled} ${b.primary}`,primarySmall:`${n.small} ${s.xsmall} ${b.primary} ${f.primary}`,primarySmallDisabled:`${n.small} ${s.xsmall} ${i.isDisabled} ${b.primary} `,primaryQuiet:`${n.large} ${s.medium} ${i.quiet} ${f.quiet}`,primaryQuietDisabled:`${n.large} ${s.medium} ${i.quiet} ${i.isDisabled}`,primarySmallQuiet:`${n.small} ${s.xsmall} ${i.quiet} ${f.quiet}`,primarySmallQuietDisabled:`${n.small} ${s.xsmall} ${i.quiet} ${i.isDisabled}`,primaryLoading:`${n.large} ${s.medium} ${i.inProgress} ${b.primary}`,primarySmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${b.primary}`,primarySmallQuietLoading:`${n.small} ${s.xsmall} ${i.quiet} ${i.inProgress} ${b.primary}`,primaryQuietLoading:`${n.large} ${s.medium} ${i.quiet} ${i.inProgress}`,utility:`${n.utility} ${s.medium} ${b.utility} ${f.utility}`,utilityDisabled:`${n.utility} ${s.medium} ${b.utility} ${i.isDisabled}`,utilityQuiet:`${n.large} ${s.medium} ${i.utilityQuiet} ${f.utilityQuiet}`,utilityQuietDisabled:`${n.large} ${s.medium} ${i.utilityQuiet} ${i.isDisabled}`,utilitySmall:`${n.smallUtility} ${s.xsmall} ${b.utility} ${f.utility}`,utilitySmallDisabled:`${n.smallUtility} ${s.xsmall} ${b.utility} ${i.isDisabled}`,utilitySmallQuiet:`${n.smallUtility} ${s.xsmall} ${i.utilityQuiet} ${f.utilityQuiet}`,utilitySmallQuietDisabled:`${n.smallUtility} ${s.xsmall} ${i.utilityQuiet} ${i.isDisabled}`,utilityLoading:`${n.large} ${s.medium} ${b.utility} ${i.inProgress}`,utilitySmallLoading:`${n.smallUtility} ${s.xsmall} ${b.utility} ${i.inProgress}`,utilityQuietLoading:`${n.large} ${s.medium} ${i.inProgress} ${i.utilityQuiet}`,utilitySmallQuietLoading:`${n.smallUtility} ${s.xsmall} ${i.inProgress} ${i.utilityQuiet}`,negative:`${n.large} ${s.medium} ${b.negative} ${f.destructive}`,negativeDisabled:`${n.large} ${s.medium} ${b.negative} ${i.isDisabled}`,negativeQuiet:`${n.large} ${s.medium} ${i.negativeQuiet} ${f.negativeQuiet}`,negativeQuietDisabled:`${n.large} ${s.medium} ${i.negativeQuiet}${i.isDisabled}`,negativeSmall:`${n.small} ${s.xsmall} ${b.negative} ${f.destructive}`,negativeSmallDisabled:`${n.small} ${s.xsmall} ${b.negative} ${i.isDisabled}`,negativeSmallQuiet:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${f.negativeQuiet}`,negativeSmallQuietDisabled:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.isDisabled}`,negativeLoading:`${n.large} ${s.medium} ${b.negative} ${i.inProgress}`,negativeSmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${b.negative}`,negativeQuietLoading:`${n.large} ${s.medium} ${i.negativeQuiet} ${b.negative} ${i.inProgress}`,negativeSmallQuietLoading:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.inProgress}`,pill:`${n.pill} ${s.medium} ${b.pill} ${f.pill}`,pillSmall:`${n.pillSmall} ${s.xsmall} ${b.pill} ${f.pill}`,pillLoading:`${n.pill} ${s.medium} ${b.pill} ${i.inProgress}`,pillSmallLoading:`${n.pillSmall} ${s.xsmall} ${b.pill} ${i.inProgress}`,link:`${n.link} ${s.medium} ${b.link}`,linkSmall:`${n.link} ${s.xsmall} ${b.link}`,linkAsButton:"inline-block active:no-underline hover:no-underline focus:no-underline text-center",a11y:"sr-only",fullWidth:"w-full max-w-full",contentWidth:"max-w-max"},J,y=class extends Fe(Je){constructor(){super();this.autofocus=!1;this.quiet=!1;this.small=!1;this.loading=!1;this.fullWidth=!1;ye(this,J,null);Te(Re,Xe,He,Ye,Ze),this.ariaValueTextLoading=Q._({id:"button.aria.loading",message:"Loading...",comment:"Screen reader message for buttons that are loading"})}updated(r){r.has("value")&&this.setValue(this.value)}connectedCallback(){super.connectedCallback();let r=this.variant||"secondary";if(!Ke.includes(r))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2691
- ${Ke.join(", ")}.`);ke(this,J,this.value)}firstUpdated(){this.autofocus&&!this.href&&setTimeout(()=>this.focus(),0)}get _primaryClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.primary,this.small&&!this.quiet&&!this.loading&&d.primarySmall,this.small&&this.quiet&&!this.loading&&d.primarySmallQuiet,this.small&&this.loading&&(this.quiet?d.primarySmallQuietLoading:d.primarySmallLoading),!this.small&&this.quiet&&!this.loading&&d.primaryQuiet,!this.small&&this.loading&&(this.quiet?d.primaryQuietLoading:d.primaryLoading)]}get _secondaryClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.secondary,this.small&&!this.quiet&&!this.loading&&d.secondarySmall,this.small&&this.loading&&(this.quiet?d.secondarySmallQuietLoading:d.secondarySmallLoading),this.small&&this.quiet&&!this.loading&&d.secondarySmallQuiet,!this.small&&this.quiet&&!this.loading&&d.secondaryQuiet,!this.small&&this.loading&&(this.quiet?d.secondaryQuietLoading:d.secondaryLoading)]}get _utilityClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.utility,this.small&&!this.quiet&&!this.loading&&d.utilitySmall,this.small&&this.quiet&&!this.loading&&d.utilitySmallQuiet,this.small&&this.loading&&(this.quiet?d.utilitySmallQuietLoading:d.utilitySmallLoading),!this.small&&this.quiet&&!this.loading&&d.utilityQuiet,!this.small&&this.loading&&(this.quiet?d.utilityQuietLoading:d.utilityLoading)]}get _negativeClasses(){return[!this.small&&!this.quiet&&!this.loading&&d.negative,this.small&&!this.quiet&&!this.loading&&d.negativeSmall,this.small&&this.quiet&&!this.loading&&d.negativeSmallQuiet,this.small&&this.loading&&(this.quiet?d.negativeSmallQuietLoading:d.negativeSmallLoading),!this.small&&this.quiet&&!this.loading&&d.negativeQuiet,!this.small&&this.loading&&(this.quiet?d.negativeQuietLoading:d.negativeLoading)]}get _pillClasses(){return[!this.loading&&(this.small?d.pillSmall:d.pill),this.loading&&(this.small?d.pillSmallLoading:d.pillLoading)]}get _linkClasses(){return[this.small?d.linkSmall:d.link]}get _classes(){let r=this.variant||"secondary";return le(this.buttonClass,[r==="primary"&&this._primaryClasses,r==="secondary"&&this._secondaryClasses,r==="utility"&&this._utilityClasses,r==="negative"&&this._negativeClasses,r==="pill"&&this._pillClasses,r==="link"&&this._linkClasses,this.href&&d.linkAsButton,this.fullWidth?d.fullWidth:d.contentWidth])}_handleButtonClick(){this.type==="submit"?this.internals.form.requestSubmit():this.type==="reset"&&this.internals.form.reset()}resetFormControl(){this.value=xe(this,J)}render(){let r=this.variant||"secondary";return oe` ${this.href?oe`<w-link
2692
- href=${this.href}
2693
- target=${this.target}
2694
- variant=${r}
2695
- ?small=${this.small}
2696
- ?quiet=${this.quiet}
2697
- ?loading=${this.loading}
2698
- ?autofocus=${this.autofocus}
2699
- ?full-width=${this.fullWidth}
2700
- class=${this.buttonClass}
2701
- rel=${this.target==="_blank"?this.rel||"noopener":void 0}>
2702
- <slot></slot>
2703
- </w-link>`:oe`<button type=${this.type||"button"} class=${this._classes} @click="${this._handleButtonClick}">
2704
- <slot></slot>
2705
- </button>`}
2706
- ${this.loading?oe`<span class="sr-only" role="progressbar" aria-valuenow="{0}" aria-valuetext=${this.ariaValueTextLoading}></span>`:null}`}};J=new WeakMap,y.shadowRootOptions={...Je.shadowRootOptions,delegatesFocus:!0},y.styles=[te,Ge,Be`:host([full-width]) { width: 100%; }`,Be`.rounded-radius-default{border-radius:var(--w-button-radius-default,8px);}.rounded-radius-utility{border-radius:var(--w-button-radius-utility,4px);}`],m([S({reflect:!0})],y.prototype,"type",2),m([S({type:Boolean,reflect:!0})],y.prototype,"autofocus",2),m([S({reflect:!0})],y.prototype,"variant",2),m([S({type:Boolean,reflect:!0})],y.prototype,"quiet",2),m([S({type:Boolean,reflect:!0})],y.prototype,"small",2),m([S({type:Boolean,reflect:!0})],y.prototype,"loading",2),m([S({reflect:!0})],y.prototype,"href",2),m([S({reflect:!0})],y.prototype,"target",2),m([S({reflect:!0})],y.prototype,"rel",2),m([S({attribute:"full-width",type:Boolean,reflect:!0})],y.prototype,"fullWidth",2),m([S({attribute:"button-class",reflect:!0})],y.prototype,"buttonClass",2),m([S({reflect:!0})],y.prototype,"name",2),m([S({reflect:!0})],y.prototype,"value",2);customElements.get("w-button")||customElements.define("w-button",y);export{y as WarpButton};
2905
+ :host([small][variant="pill"]) {
2906
+ --padding-x: 8px; /* get a total height and width of 32px, matching atomic CSS variant */
2907
+ --padding-y: 8px;
2908
+ }
2909
+
2910
+ /* Width config */
2911
+ :host([full-width]) button {
2912
+ width: 100%;
2913
+ max-width: 100%;
2914
+ }
2915
+
2916
+ :host([has-icon-only]) {
2917
+ --_padding-x: var(--_padding-y);
2918
+ }
2919
+
2920
+ :host([has-icon-only]) button {
2921
+ width: auto;
2922
+ max-width: none;
2923
+ aspect-ratio: 1 / 1;
2924
+ }
2925
+
2926
+ /* Copy of loading animation from warp */
2927
+ :host([loading]) button {
2928
+ background-image: linear-gradient(
2929
+ 135deg,
2930
+ rgba(0, 0, 0, 0.05) 25%,
2931
+ transparent 25%,
2932
+ transparent 50%,
2933
+ rgba(0, 0, 0, 0.05) 50%,
2934
+ rgba(0, 0, 0, 0.05) 75%,
2935
+ transparent 75%,
2936
+ transparent
2937
+ );
2938
+ background-size: 30px 30px;
2939
+ animation: animate-inprogress 3s linear infinite;
2940
+ }
2941
+
2942
+ @keyframes animate-inprogress {
2943
+ 0% {
2944
+ background-position: 0 0;
2945
+ }
2946
+ 100% {
2947
+ background-position: 60px 0;
2948
+ }
2949
+ }
2950
+ `;import{ifDefined as Mr}from"lit/directives/if-defined.js";var Qe=["primary","secondary","negative","negativeQuiet","utility","pill","link","quiet","utilityQuiet","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],U,b=class extends Ce(Ye){constructor(){super();this.autofocus=!1;this.quiet=!1;this.iconOnly=!1;this.small=!1;this.loading=!1;this.disabled=!1;this.fullWidth=!1;be(this,U,null);Se(Ae,je,De,Ne,$e),this.ariaValueTextLoading=C.t({id:"button.aria.loading",message:"Loading...",comment:"Screen reader message for buttons that are loading"})}updated(r){r.has("value")&&this.setValue(this.value)}connectedCallback(){super.connectedCallback();let r=this.variant||"secondary";if(!Qe.includes(r))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
2951
+ ${Qe.join(", ")}.`);he(this,U,this.value)}firstUpdated(){this.autofocus&&!this.href&&setTimeout(()=>this.focus(),0)}_handleButtonClick(){this.type==="submit"?this.internals.form.requestSubmit():this.type==="reset"&&this.internals.form.reset()}resetFormControl(){this.value=ue(this,U)}render(){let r=this.variant||"secondary";return B` ${this.href?B`
2952
+ <w-link
2953
+ href=${this.href}
2954
+ target=${this.target}
2955
+ variant=${this.quiet?"quiet":r}
2956
+ ?small=${this.small}
2957
+ ?loading=${this.loading}
2958
+ ?autofocus=${this.autofocus}
2959
+ ?full-width=${this.fullWidth}
2960
+ class=${this.buttonClass}
2961
+ rel=${this.target==="_blank"?this.rel||"noopener":void 0}
2962
+ >
2963
+ <slot></slot>
2964
+ </w-link>
2965
+ `:B`
2966
+ <button
2967
+ type=${this.type||"button"}
2968
+ class=${Mr(this.buttonClass)}
2969
+ @click="${this._handleButtonClick}"
2970
+ >
2971
+ <slot></slot>
2972
+ </button>
2973
+ `}
2974
+ ${this.loading?B`<span
2975
+ class="sr-only"
2976
+ role="progressbar"
2977
+ aria-valuenow="{0}"
2978
+ aria-valuetext=${this.ariaValueTextLoading}
2979
+ ></span>`:Cr}`}};U=new WeakMap,b.styles=[G,qe],b.shadowRootOptions={...Ye.shadowRootOptions,delegatesFocus:!0},u([f({reflect:!0})],b.prototype,"type",2),u([f({type:Boolean,reflect:!0})],b.prototype,"autofocus",2),u([f({reflect:!0})],b.prototype,"variant",2),u([f({type:Boolean,reflect:!0})],b.prototype,"quiet",2),u([f({type:Boolean,reflect:!0,attribute:"icon-only"})],b.prototype,"iconOnly",2),u([f({type:Boolean,reflect:!0})],b.prototype,"small",2),u([f({type:Boolean,reflect:!0})],b.prototype,"loading",2),u([f({reflect:!0})],b.prototype,"href",2),u([f({reflect:!0})],b.prototype,"target",2),u([f({type:Boolean,reflect:!0})],b.prototype,"disabled",2),u([f({reflect:!0})],b.prototype,"rel",2),u([f({attribute:"full-width",type:Boolean,reflect:!0})],b.prototype,"fullWidth",2),u([f({attribute:"button-class",reflect:!0})],b.prototype,"buttonClass",2),u([f({reflect:!0})],b.prototype,"name",2),u([f({reflect:!0})],b.prototype,"value",2);customElements.get("w-button")||customElements.define("w-button",b);export{b as WarpButton};
2707
2980
  //# sourceMappingURL=button.js.map