@warp-ds/elements 2.4.0-next.9 → 2.5.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.
- package/dist/custom-elements.json +29 -7
- package/dist/index.d.ts +16 -14
- package/dist/packages/attention/attention.js +12 -12
- package/dist/packages/attention/attention.js.map +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.js +9 -9
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/button/button.js +8 -8
- package/dist/packages/button/button.js.map +3 -3
- package/dist/packages/card/card.js +8 -8
- package/dist/packages/card/card.js.map +3 -3
- package/dist/packages/combobox/combobox.js +13 -13
- package/dist/packages/combobox/combobox.js.map +3 -3
- package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
- package/dist/packages/datepicker/datepicker.js +15 -15
- package/dist/packages/datepicker/datepicker.js.map +3 -3
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
- package/dist/packages/i18n.js +6 -2
- package/dist/packages/icon/icon.d.ts +27 -0
- package/dist/packages/icon/icon.js +101 -0
- package/dist/packages/icon/icon.react.stories.d.ts +28 -0
- package/dist/packages/icon/icon.react.stories.js +37 -0
- package/dist/packages/icon/icon.stories.d.ts +39 -0
- package/dist/packages/icon/icon.stories.js +43 -0
- package/dist/packages/icon/react.d.ts +2 -0
- package/dist/packages/icon/react.js +11 -0
- package/dist/packages/icon/style.d.ts +1 -0
- package/dist/packages/icon/style.js +27 -0
- package/dist/packages/modal-header/modal-header.js +7 -7
- package/dist/packages/modal-header/modal-header.js.map +3 -3
- package/dist/packages/page-indicator/locales/da/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/en/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/fi/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/nb/messages.mjs +1 -0
- package/dist/packages/page-indicator/locales/sv/messages.mjs +1 -0
- package/dist/packages/page-indicator/page-indicator.d.ts +16 -0
- package/dist/packages/page-indicator/page-indicator.js +14 -5
- package/dist/packages/page-indicator/page-indicator.js.map +4 -4
- package/dist/packages/page-indicator/page-indicator.stories.js +22 -6
- package/dist/packages/page-indicator/page-indicator.test.d.ts +1 -0
- package/dist/packages/page-indicator/page-indicator.test.js +118 -0
- package/dist/packages/pagination/pagination.js +14 -14
- package/dist/packages/pagination/pagination.js.map +3 -3
- package/dist/packages/pill/pill.js +8 -8
- package/dist/packages/pill/pill.js.map +3 -3
- package/dist/packages/select/select.js +15 -15
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/select/select.react.stories.d.ts +1 -1
- package/dist/packages/slider/slider.js +17 -17
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/step/locales/da/messages.d.mts +1 -0
- package/dist/packages/step/locales/en/messages.d.mts +1 -0
- package/dist/packages/step/locales/fi/messages.d.mts +1 -0
- package/dist/packages/step/locales/nb/messages.d.mts +1 -0
- package/dist/packages/step/locales/sv/messages.d.mts +1 -0
- package/dist/packages/step/step.js +7 -7
- package/dist/packages/step/step.js.map +4 -4
- package/dist/packages/step-indicator/step-indicator.d.ts +0 -1
- package/dist/packages/step-indicator/step-indicator.js +5 -14
- package/dist/packages/step-indicator/step-indicator.js.map +4 -4
- package/dist/packages/tabs/tabs.react.stories.js +6 -6
- package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/packages/toast/toast.js +8 -8
- package/dist/packages/toast/toast.js.map +3 -3
- package/dist/web-types.json +6 -6
- package/package.json +1 -1
- /package/dist/packages/{step-indicator → page-indicator}/locales/da/messages.d.mts +0 -0
- /package/dist/packages/{step-indicator → page-indicator}/locales/en/messages.d.mts +0 -0
- /package/dist/packages/{step-indicator → page-indicator}/locales/fi/messages.d.mts +0 -0
- /package/dist/packages/{step-indicator → page-indicator}/locales/nb/messages.d.mts +0 -0
- /package/dist/packages/{step-indicator → page-indicator}/locales/sv/messages.d.mts +0 -0
- /package/dist/packages/{step-indicator → step}/locales/da/messages.mjs +0 -0
- /package/dist/packages/{step-indicator → step}/locales/en/messages.mjs +0 -0
- /package/dist/packages/{step-indicator → step}/locales/fi/messages.mjs +0 -0
- /package/dist/packages/{step-indicator → step}/locales/nb/messages.mjs +0 -0
- /package/dist/packages/{step-indicator → step}/locales/sv/messages.mjs +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Be=Object.create;var ne=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var ve=
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function sr(
|
|
1
|
+
var Be=Object.create;var ne=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var ve=o=>{throw TypeError(o)};var pe=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var We=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ge(e))!Ke.call(o,a)&&a!==r&&ne(o,a,{get:()=>e[a],enumerable:!(t=he(e,a))||t.enumerable});return o};var er=(o,e,r)=>(r=o!=null?Be(Je(o)):{},We(e||!o||!o.__esModule?ne(r,"default",{value:o,enumerable:!0}):r,o));var m=(o,e,r,t)=>{for(var a=t>1?void 0:t?he(e,r):e,g=o.length-1,u;g>=0;g--)(u=o[g])&&(a=(t?u(e,r,a):u(a))||a);return t&&a&&ne(e,r,a),a};var me=(o,e,r)=>e.has(o)||ve("Cannot "+r);var fe=(o,e,r)=>(me(o,e,"read from private field"),r?r.call(o):e.get(o)),we=(o,e,r)=>e.has(o)?ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),xe=(o,e,r,t)=>(me(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r);var ye=pe(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.errorMessages=N.ErrorType=void 0;var R;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.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 _e=pe(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.unraw=E.errorMessages=E.ErrorType=void 0;var _=ye();Object.defineProperty(E,"ErrorType",{enumerable:!0,get:function(){return _.ErrorType}});Object.defineProperty(E,"errorMessages",{enumerable:!0,get:function(){return _.errorMessages}});function rr(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function K(o,e,r){let t=rr(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(_.errorMessages.get(e));return t}function or(o){let e=K(o,_.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function ke(o,e){let r=K(o,_.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=K(e,_.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function tr(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function ar(o){if(!tr(o))throw new SyntaxError(_.errorMessages.get(_.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=K(e,_.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(_.errorMessages.get(_.ErrorType.CodePointLimit)):t}}function ir(o,e=!1){if(e)throw new SyntaxError(_.errorMessages.get(_.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var nr=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function sr(o){return nr.get(o)||o}var lr=/\\(?:(\\)|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 $e(o,e=!1){return o.replace(lr,function(r,t,a,g,u,l,p,k,Q){if(t!==void 0)return"\\";if(a!==void 0)return or(a);if(g!==void 0)return ar(g);if(u!==void 0)return ke(u,l);if(p!==void 0)return ke(p);if(k==="0")return"\0";if(k!==void 0)return ir(k,!e);if(Q!==void 0)return sr(Q);throw new SyntaxError(_.errorMessages.get(_.ErrorType.EndOfString))})}E.unraw=$e;E.default=$e});var se=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)?se.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var Se=er(_e(),1);var T=o=>typeof o=="string",dr=o=>typeof o=="function",Ce=new Map,Me="en";function ue(o){return[...Array.isArray(o)?o:[o],Me]}function be(o,e,r){let t=ue(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 W(()=>ee("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(T(e)?new Date(e):e)}function cr(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 be(o,e,t)}function le(o,e,r){let t=ue(o);return W(()=>ee("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function ze(o,e,r,{offset:t=0,...a}){var l,p;let g=ue(o),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-t)])!=null?p:a.other}function W(o,e){let r=o(),t=Ce.get(r);return t||(t=e(),Ce.set(r,t)),t}function ee(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var Le=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Qe="%__lingui_octothorpe__%",ur=(o,e,r={})=>{let t=e||o,a=u=>typeof u=="object"?u:r[u],g=(u,l)=>{let p=Object.keys(r).length?a("number"):void 0,k=le(t,u,p);return l.replace(new RegExp(Qe,"g"),k)};return{plural:(u,l)=>{let{offset:p=0}=l,k=ze(t,!1,u,l);return g(u-p,k)},selectordinal:(u,l)=>{let{offset:p=0}=l,k=ze(t,!0,u,l);return g(u-p,k)},select:br,number:(u,l)=>le(t,u,a(l)||{style:l}),date:(u,l)=>be(t,u,a(l)||l),time:(u,l)=>cr(t,u,a(l)||l)}},br=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function gr(o,e,r){return(t={},a)=>{let g=ur(e,r,a),u=(p,k=!1)=>Array.isArray(p)?p.reduce((Q,D)=>{if(D==="#"&&k)return Q+Qe;if(T(D))return Q+D;let[U,M,P]=D,O={};M==="plural"||M==="selectordinal"||M==="select"?Object.entries(P).forEach(([A,X])=>{O[A]=u(X,M==="plural"||M==="selectordinal")}):O=P;let C;if(M){let A=g[M];C=A(t[U],O)}else C=t[U];return C==null?Q:Q+C},""):p,l=u(o);return T(l)&&Le.test(l)?(0,Se.unraw)(l):T(l)?l:l?String(l):""}}var hr=Object.defineProperty,vr=(o,e,r)=>e in o?hr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,pr=(o,e,r)=>(vr(o,typeof e!="symbol"?e+"":e,r),r),de=class{constructor(){pr(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}},mr=Object.defineProperty,fr=(o,e,r)=>e in o?mr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,I=(o,e,r)=>(fr(o,typeof e!="symbol"?e+"":e,r),r),ce=class extends de{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:Me,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=""),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 dr(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:
|
|
3
3
|
|
|
4
4
|
> ${p}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
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
|
-
`)),
|
|
10
|
+
`)),T(p)&&Le.test(p)?JSON.parse(`"${p}"`):T(p)?p:gr(p,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return be(this._locales||this._locale,e,r)}number(e,r){return le(this._locales||this._locale,e,r)}};function wr(o={}){return new ce(o)}var F=wr();var v=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)},x=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 qe(o){var e,r,t,a,g,u,l,p,k,Q,D,U,M,P,O,C,A,X,te;class Ze extends o{constructor(...c){var h,w,$;super(...c),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),t.set(this,!1),a.set(this,!1),g.set(this,void 0),u.set(this,void 0),l.set(this,!0),k.set(this,""),Q.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,t,!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,t,!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,Q,"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,t,!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,t,!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,t=new WeakMap,a=new WeakMap,g=new WeakMap,u=new WeakMap,l=new WeakMap,k=new WeakMap,Q=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,t,"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 B=new AbortController;x(this,g,B,"f");let G,ge=!1;$.length&&($.forEach(L=>{let ae=L.key||"customError",Y=L.isValid(this,c,B.signal);Y instanceof Promise?(q.push(Y),Y.then(ie=>{ie!=null&&(w[ae]=!ie,G=v(this,e,"m",te).call(this,L,c),v(this,e,"m",X).call(this,w,G))})):(w[ae]=!Y,this.validity[ae]!==!Y&&(ge=!0),!Y&&!G&&(G=v(this,e,"m",te).call(this,L,c)))}),Promise.allSettled(q).then(()=>{var L;B!=null&&B.signal.aborted||(x(this,P,!1,"f"),(L=v(this,M,"f"))===null||L===void 0||L.call(this))}),(ge||!Z)&&v(this,e,"m",X).call(this,w,G))},X=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")}},te=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},Ze}import{css as Re,html as oe,LitElement as Xe}from"lit";import{property as S}from"lit/decorators.js";var xr=["en","nb","fi","da","sv"],Fe="en",Ee=o=>xr.find(e=>o===e||o.toLowerCase().includes(e))||Fe;function yr(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Ee(o)}try{let o=document.documentElement.lang;return Ee(o)}catch(o){return console.warn("could not detect locale, falling back to source locale",o),Fe}}var De=(o,e,r,t,a)=>{F.load("en",o),F.load("nb",e),F.load("fi",r),F.load("da",t),F.load("sv",a);let g=yr();F.activate(g)};import{html as $r,LitElement as Te}from"lit";import{property as V}from"lit/decorators.js";import{classMap as _r}from"lit/directives/class-map.js";import{css as Pe}from"lit";var re=Pe`
|
|
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
|
-
`,
|
|
283
|
+
`,Tr=Pe`*, :before, :after {
|
|
284
284
|
--w-rotate: 0;
|
|
285
285
|
--w-rotate-x: 0;
|
|
286
286
|
--w-rotate-y: 0;
|
|
@@ -2446,7 +2446,7 @@ Please compile your catalog first.
|
|
|
2446
2446
|
display: none
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
`;import{css as
|
|
2449
|
+
`;import{css as kr}from"lit";var Oe=kr`.w-button,
|
|
2450
2450
|
.w-button--secondary {
|
|
2451
2451
|
/* Local scoped variables, given the default button (the secondary variant) as a default */
|
|
2452
2452
|
--_background: var(--background, var(--w-s-color-background));
|
|
@@ -2681,13 +2681,13 @@ Please compile your catalog first.
|
|
|
2681
2681
|
background-position: 60px 0;
|
|
2682
2682
|
}
|
|
2683
2683
|
}`;var Ve=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],z=class extends Te{constructor(){super(...arguments);this.variant="secondary"}connectedCallback(){if(super.connectedCallback(),!Ve.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2684
|
-
${Ve.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){let
|
|
2684
|
+
${Ve.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){let r={"w-button":this.variant!=="link","w-button--primary":this.variant==="primary","w-button--secondary":this.variant==="secondary","w-button--negative":this.variant==="negative","w-button--utility":this.variant==="utility","w-button--quiet":this.variant==="quiet","w-button--negative-quiet":this.variant==="negativeQuiet","w-button--utility-quiet":this.variant==="utilityQuiet","w-button--overlay":this.variant==="overlay","w-button--overlay-inverted":this.variant==="overlayInverted","w-button--overlay-quiet":this.variant==="overlayQuiet","w-button--overlay-inverted-quiet":this.variant==="overlayInvertedQuiet","w-button--small":this.small,"w-button--full-width":this.fullWidth,"w-button--disabled":this.disabled};return $r`<a
|
|
2685
2685
|
href=${this.href}
|
|
2686
2686
|
target=${this.target}
|
|
2687
2687
|
rel=${this.target==="_blank"?this.rel||"noopener":void 0}
|
|
2688
|
-
class=${
|
|
2688
|
+
class=${_r(r)}>
|
|
2689
2689
|
<slot></slot>
|
|
2690
|
-
</a>`}};z.shadowRootOptions={...Te.shadowRootOptions,delegatesFocus:!0},z.styles=[re,Oe],m([T({type:Boolean,reflect:!0})],z.prototype,"autofocus",2),m([T({reflect:!0})],z.prototype,"variant",2),m([T({type:Boolean,reflect:!0})],z.prototype,"small",2),m([T({reflect:!0})],z.prototype,"href",2),m([T({type:Boolean,reflect:!0})],z.prototype,"disabled",2),m([T({reflect:!0})],z.prototype,"target",2),m([T({reflect:!0})],z.prototype,"rel",2),m([T({attribute:"full-width",type:Boolean,reflect:!0})],z.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",z);var je=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var Ae=JSON.parse('{"button.aria.loading":["Loading..."]}');var Ne=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Ie=JSON.parse('{"button.aria.loading":["Laster..."]}');var Ue=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as zr}from"lit";var Ye=zr`*,: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 He=["primary","secondary","negative","utility","pill","link"],V="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"},g={primary:`border-0 rounded-radius-default ${V}`,secondary:`border-2 rounded-radius-default ${V}`,utility:`border rounded-radius-utility ${V}`,negative:`border-0 rounded-radius-default ${V}`,pill:`p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${V}`,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 ${V}`,utilityQuiet:`border-0 rounded-4 ${V}`,negativeQuiet:`border-0 rounded-8 ${V}`,isDisabled:`font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${f.disabled}`},d={secondary:`${n.medium} ${s.medium} ${g.secondary} ${f.secondary}`,secondaryHref:`${n.medium} ${s.medium} ${g.secondary} ${f.secondary}`,secondaryDisabled:`${n.medium} ${s.medium} ${g.secondary} ${i.isDisabled}`,secondarySmall:`${s.xsmall} ${n.xsmall} ${g.secondary} ${f.secondary}`,secondarySmallDisabled:`${s.xsmall} ${n.xsmall} ${g.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} ${g.secondary} ${i.inProgress}`,secondarySmallLoading:`${s.xsmall} ${n.xsmall} ${g.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} ${g.primary} ${f.primary}`,primaryDisabled:`${n.large} ${s.medium} ${i.isDisabled} ${g.primary}`,primarySmall:`${n.small} ${s.xsmall} ${g.primary} ${f.primary}`,primarySmallDisabled:`${n.small} ${s.xsmall} ${i.isDisabled} ${g.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} ${g.primary}`,primarySmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${g.primary}`,primarySmallQuietLoading:`${n.small} ${s.xsmall} ${i.quiet} ${i.inProgress} ${g.primary}`,primaryQuietLoading:`${n.large} ${s.medium} ${i.quiet} ${i.inProgress}`,utility:`${n.utility} ${s.medium} ${g.utility} ${f.utility}`,utilityDisabled:`${n.utility} ${s.medium} ${g.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} ${g.utility} ${f.utility}`,utilitySmallDisabled:`${n.smallUtility} ${s.xsmall} ${g.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} ${g.utility} ${i.inProgress}`,utilitySmallLoading:`${n.smallUtility} ${s.xsmall} ${g.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} ${g.negative} ${f.destructive}`,negativeDisabled:`${n.large} ${s.medium} ${g.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} ${g.negative} ${f.destructive}`,negativeSmallDisabled:`${n.small} ${s.xsmall} ${g.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} ${g.negative} ${i.inProgress}`,negativeSmallLoading:`${n.small} ${s.xsmall} ${i.inProgress} ${g.negative}`,negativeQuietLoading:`${n.large} ${s.medium} ${i.negativeQuiet} ${g.negative} ${i.inProgress}`,negativeSmallQuietLoading:`${n.small} ${s.xsmall} ${i.negativeQuiet} ${i.inProgress}`,pill:`${n.pill} ${s.medium} ${g.pill} ${f.pill}`,pillSmall:`${n.pillSmall} ${s.xsmall} ${g.pill} ${f.pill}`,pillLoading:`${n.pill} ${s.medium} ${g.pill} ${i.inProgress}`,pillSmallLoading:`${n.pillSmall} ${s.xsmall} ${g.pill} ${i.inProgress}`,link:`${n.link} ${s.medium} ${g.link}`,linkSmall:`${n.link} ${s.xsmall} ${g.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 qe(Xe){constructor(){super();this.type="button";we(this,J,null);De(Ae,Ie,Ne,je,Ue),this.variant="secondary",this.ariaValueTextLoading=G._({id:"button.aria.loading",message:"Loading...",comment:"Screen reader message for buttons that are loading"})}updated(o){o.has("value")&&this.setValue(this.value)}connectedCallback(){if(super.connectedCallback(),!He.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2690
|
+
</a>`}};z.shadowRootOptions={...Te.shadowRootOptions,delegatesFocus:!0},z.styles=[re,Oe],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 je=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var Ae=JSON.parse('{"button.aria.loading":["Loading..."]}');var Ne=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Ie=JSON.parse('{"button.aria.loading":["Laster..."]}');var Ue=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as Cr}from"lit";var Ye=Cr`*,: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 He=["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 qe(Xe){constructor(){super();this.type="button";we(this,J,null);De(Ae,Ie,Ne,je,Ue),this.variant="secondary",this.ariaValueTextLoading=F._({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(){if(super.connectedCallback(),!He.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2691
2691
|
${He.join(", ")}.`);xe(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(){return se(this.buttonClass,[this.variant==="primary"&&this._primaryClasses,this.variant==="secondary"&&this._secondaryClasses,this.variant==="utility"&&this._utilityClasses,this.variant==="negative"&&this._negativeClasses,this.variant==="pill"&&this._pillClasses,this.variant==="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=fe(this,J)}render(){return oe` ${this.href?oe`<w-link
|
|
2692
2692
|
href=${this.href}
|
|
2693
2693
|
target=${this.target}
|