@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.
- package/dist/custom-elements.json +79 -6
- package/dist/index.d.ts +28 -6
- package/dist/packages/attention/attention.js +506 -233
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/button/button.d.ts +8 -17
- package/dist/packages/button/button.js +494 -221
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.react.stories.d.ts +1 -1
- package/dist/packages/button/styles/w-button.styles.d.ts +1 -0
- package/dist/packages/button/styles/w-button.styles.js +282 -0
- package/dist/packages/combobox/combobox.hydration.test.js +57 -0
- package/dist/packages/combobox/combobox.js +25 -11
- package/dist/packages/combobox/combobox.js.map +2 -2
- package/dist/packages/datepicker/datepicker.js +8 -15
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/datepicker/styles/w-datepicker.styles.js +3 -9
- package/dist/packages/link/link.js +197 -217
- package/dist/packages/link/link.js.map +4 -4
- package/dist/packages/link/link.test.js +0 -14
- package/dist/packages/link/styles/w-link.styles.js +213 -0
- package/dist/packages/slider/slider.js +18 -17
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.react.stories.js +6 -2
- package/dist/packages/slider/slider.stories.js +18 -12
- package/dist/packages/slider-thumb/slider-thumb.js +12 -12
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/web-types.json +27 -11
- package/package.json +1 -1
- package/dist/packages/link/styles.js +0 -236
- /package/dist/packages/link/{styles.d.ts → styles/w-link.styles.d.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function
|
|
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
|
-
> ${
|
|
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
|
-
`)),
|
|
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
|
-
`,
|
|
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
|
|
2450
|
-
|
|
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(
|
|
2454
|
-
|
|
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
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
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))
|
|
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
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
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
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
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
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
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
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
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
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
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
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
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
|
-
|
|
2632
|
-
|
|
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
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
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
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
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
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
aspect-ratio: 1 / 1;
|
|
2654
|
-
}
|
|
2888
|
+
:host([loading]) button {
|
|
2889
|
+
cursor: wait;
|
|
2890
|
+
pointer-events: none;
|
|
2891
|
+
}
|
|
2655
2892
|
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2893
|
+
:host([variant="link"]):hover {
|
|
2894
|
+
text-decoration: underline;
|
|
2895
|
+
}
|
|
2659
2896
|
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
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
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
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
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
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
|