@warp-ds/elements 2.9.2-next.1 → 2.10.0-next.10
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/README.md +4 -0
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/custom-elements.json +508 -145
- package/dist/docs/affix/affix.md +2 -2
- package/dist/docs/affix/styling.md +1 -0
- package/dist/docs/alert/alert.md +2 -2
- package/dist/docs/alert/styling.md +1 -0
- package/dist/docs/attention/attention.md +2 -0
- package/dist/docs/attention/styling.md +1 -0
- package/dist/docs/badge/badge.md +2 -0
- package/dist/docs/badge/styling.md +1 -0
- package/dist/docs/box/box.md +22 -40
- package/dist/docs/box/examples.md +20 -38
- package/dist/docs/box/styling.md +1 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +8 -2
- package/dist/docs/breadcrumbs/examples.md +7 -1
- package/dist/docs/breadcrumbs/styling.md +1 -0
- package/dist/docs/button/accessibility.md +42 -0
- package/dist/docs/button/api.md +63 -39
- package/dist/docs/button/button.md +395 -42
- package/dist/docs/button/examples.md +126 -0
- package/dist/docs/button/styling.md +72 -0
- package/dist/docs/button/usage.md +89 -0
- package/dist/docs/card/accessibility.md +74 -0
- package/dist/docs/card/api.md +9 -3
- package/dist/docs/card/card.md +236 -5
- package/dist/docs/card/examples.md +75 -0
- package/dist/docs/card/styling.md +1 -0
- package/dist/docs/card/usage.md +76 -0
- package/dist/docs/checkbox/api.md +128 -0
- package/dist/docs/checkbox/checkbox.md +134 -0
- package/dist/docs/checkbox-group/accessibility.md +71 -0
- package/dist/docs/checkbox-group/api.md +79 -0
- package/dist/docs/checkbox-group/checkbox-group.md +492 -0
- package/dist/docs/checkbox-group/examples.md +105 -0
- package/dist/docs/checkbox-group/styling.md +132 -0
- package/dist/docs/checkbox-group/usage.md +95 -0
- package/dist/docs/combobox/accessibility.md +71 -0
- package/dist/docs/combobox/api.md +60 -30
- package/dist/docs/combobox/combobox.md +205 -32
- package/dist/docs/combobox/examples.md +44 -0
- package/dist/docs/combobox/styling.md +1 -0
- package/dist/docs/combobox/usage.md +28 -0
- package/dist/docs/datepicker/accessibility.md +25 -0
- package/dist/docs/datepicker/api.md +22 -14
- package/dist/docs/datepicker/datepicker.md +208 -16
- package/dist/docs/datepicker/examples.md +75 -0
- package/dist/docs/datepicker/styling.md +1 -0
- package/dist/docs/datepicker/usage.md +84 -0
- package/dist/docs/expandable/api.md +20 -32
- package/dist/docs/expandable/examples.md +54 -0
- package/dist/docs/expandable/expandable.md +74 -32
- package/dist/docs/expandable/styling.md +1 -0
- package/dist/docs/icon/accessibility.md +5 -0
- package/dist/docs/icon/api.md +43 -0
- package/dist/docs/icon/examples.md +45 -0
- package/dist/docs/icon/icon.md +115 -0
- package/dist/docs/icon/styling.md +1 -0
- package/dist/docs/icon/usage.md +11 -0
- package/dist/docs/index.md +46 -0
- package/dist/docs/link/api.md +18 -22
- package/dist/docs/link/examples.md +75 -0
- package/dist/docs/link/link.md +113 -24
- package/dist/docs/link/styling.md +1 -0
- package/dist/docs/link/usage.md +18 -0
- package/dist/docs/modal/api.md +51 -0
- package/dist/docs/modal/examples.md +67 -0
- package/dist/docs/modal/modal.md +240 -0
- package/dist/docs/modal/styling.md +1 -0
- package/dist/docs/modal/usage.md +110 -0
- package/dist/docs/modal-footer/api.md +11 -0
- package/dist/docs/modal-footer/modal-footer.md +17 -0
- package/dist/docs/modal-header/api.md +42 -0
- package/dist/docs/modal-header/modal-header.md +48 -0
- package/dist/docs/page-indicator/api.md +6 -6
- package/dist/docs/page-indicator/examples.md +8 -0
- package/dist/docs/page-indicator/page-indicator.md +25 -6
- package/dist/docs/page-indicator/styling.md +1 -0
- package/dist/docs/page-indicator/usage.md +8 -0
- package/dist/docs/pagination/api.md +12 -10
- package/dist/docs/pagination/examples.md +20 -0
- package/dist/docs/pagination/pagination.md +52 -12
- package/dist/docs/pagination/styling.md +1 -0
- package/dist/docs/pagination/usage.md +18 -0
- package/dist/docs/pill/accessibility.md +2 -0
- package/dist/docs/pill/api.md +10 -26
- package/dist/docs/pill/examples.md +23 -0
- package/dist/docs/pill/pill.md +45 -28
- package/dist/docs/pill/styling.md +1 -0
- package/dist/docs/pill/usage.md +8 -0
- package/dist/docs/radio/radio.md +1 -7
- package/dist/docs/select/select.md +2 -0
- package/dist/docs/select/styling.md +1 -0
- package/dist/docs/slider/slider.md +2 -0
- package/dist/docs/slider/styling.md +1 -0
- package/dist/docs/slider-thumb/slider-thumb.md +2 -0
- package/dist/docs/slider-thumb/styling.md +1 -0
- package/dist/docs/step-indicator/step-indicator.md +2 -0
- package/dist/docs/step-indicator/styling.md +1 -0
- package/dist/docs/switch/styling.md +1 -0
- package/dist/docs/switch/switch.md +2 -0
- package/dist/docs/tabs/styling.md +1 -0
- package/dist/docs/tabs/tabs.md +2 -0
- package/dist/docs/textarea/styling.md +1 -0
- package/dist/docs/textarea/textarea.md +2 -0
- package/dist/docs/textfield/styling.md +1 -0
- package/dist/docs/textfield/textfield.md +2 -0
- package/dist/index.d.ts +950 -602
- package/dist/packages/affix/affix.hydration.test.js +1 -1
- package/dist/packages/affix/affix.js +4 -4
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/alert/alert.hydration.test.js +1 -1
- package/dist/packages/alert/alert.js +3 -3
- package/dist/packages/alert/alert.js.map +3 -3
- package/dist/packages/attention/attention.hydration.test.js +1 -1
- package/dist/packages/attention/attention.js +397 -444
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/attention/attention.test.js +1 -1
- package/dist/packages/badge/badge.hydration.test.js +1 -1
- package/dist/packages/box/box.hydration.test.js +1 -1
- package/dist/packages/box/box.js +1 -1
- package/dist/packages/box/box.js.map +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.js +3 -2
- package/dist/packages/breadcrumbs/breadcrumbs.js +4 -4
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/button/button.d.ts +54 -37
- package/dist/packages/button/button.hydration.test.js +1 -1
- package/dist/packages/button/button.js +385 -432
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/button.stories.d.ts +29 -0
- package/dist/packages/button/button.stories.js +176 -2
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/button/styles.d.ts +22 -1
- package/dist/packages/button/styles.js +390 -1
- package/dist/packages/card/card.d.ts +9 -6
- package/dist/packages/card/card.hydration.test.js +1 -1
- package/dist/packages/card/card.js +3 -3
- package/dist/packages/card/card.js.map +4 -4
- package/dist/packages/checkbox/checkbox.d.ts +45 -14
- package/dist/packages/checkbox/checkbox.hydration.test.js +1 -1
- package/dist/packages/checkbox/checkbox.js +3 -3
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox/checkbox.react.stories.d.ts +1 -1
- package/dist/packages/checkbox/checkbox.stories.d.ts +2 -2
- package/dist/packages/checkbox/checkbox.test.js +1 -1
- package/dist/packages/checkbox/react.d.ts +2 -2
- package/dist/packages/checkbox-group/checkbox-group.a11y.test.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.d.ts +35 -8
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.js +6 -6
- package/dist/packages/checkbox-group/checkbox-group.js.map +4 -4
- package/dist/packages/checkbox-group/react.d.ts +3 -3
- package/dist/packages/combobox/combobox.a11y.test.js +24 -0
- package/dist/packages/combobox/combobox.d.ts +65 -45
- package/dist/packages/combobox/combobox.hydration.test.js +39 -1
- package/dist/packages/combobox/combobox.js +21 -21
- package/dist/packages/combobox/combobox.js.map +4 -4
- package/dist/packages/combobox/combobox.stories.js +28 -15
- package/dist/packages/combobox/combobox.test.js +110 -0
- package/dist/packages/datepicker/DatePicker.test.js +1 -1
- package/dist/packages/datepicker/datepicker.d.ts +22 -30
- package/dist/packages/datepicker/datepicker.hydration.test.js +1 -1
- package/dist/packages/datepicker/datepicker.js +49 -49
- package/dist/packages/datepicker/datepicker.js.map +4 -4
- package/dist/packages/datepicker/datepicker.test.js +1 -1
- package/dist/packages/expandable/expandable.d.ts +11 -32
- package/dist/packages/expandable/expandable.hydration.test.js +1 -1
- package/dist/packages/expandable/expandable.js +11 -11
- package/dist/packages/expandable/expandable.js.map +3 -3
- package/dist/packages/expandable/expandable.react.stories.d.ts +2 -2
- package/dist/packages/expandable/react.d.ts +1 -1
- package/dist/packages/icon/icon.d.ts +16 -4
- package/dist/packages/icon/icon.hydration.test.js +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +3 -3
- package/dist/packages/icon/icon.react.stories.d.ts +1 -1
- package/dist/packages/icon/react.d.ts +2 -2
- package/dist/packages/link/link.d.ts +15 -16
- package/dist/packages/link/link.hydration.test.js +1 -1
- package/dist/packages/link/link.js +420 -190
- package/dist/packages/link/link.js.map +4 -4
- package/dist/packages/link/link.test.js +1 -1
- package/dist/packages/link/styles.d.ts +5 -0
- package/dist/packages/link/styles.js +80 -0
- package/dist/packages/modal/index.d.ts +4 -4
- package/dist/packages/modal/index.js +4 -4
- package/dist/packages/modal/modal.d.ts +22 -12
- package/dist/packages/modal/modal.hydration.test.js +1 -1
- package/dist/packages/modal/modal.js +5 -5
- package/dist/packages/modal/modal.js.map +3 -3
- package/dist/packages/modal/modal.react.stories.d.ts +3 -3
- package/dist/packages/modal/modal.stories.d.ts +2 -1
- package/dist/packages/modal/modal.stories.js +85 -3
- package/dist/packages/modal/react.d.ts +2 -2
- package/dist/packages/modal-footer/modal-footer.d.ts +5 -3
- package/dist/packages/modal-footer/modal-footer.js +4 -4
- package/dist/packages/modal-footer/modal-footer.js.map +3 -3
- package/dist/packages/modal-footer/react.d.ts +1 -1
- package/dist/packages/modal-header/modal-header.d.ts +21 -11
- package/dist/packages/modal-header/modal-header.js +11 -9
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/modal-header/react.d.ts +2 -2
- package/dist/packages/page-indicator/page-indicator.d.ts +9 -14
- package/dist/packages/page-indicator/page-indicator.hydration.test.js +1 -1
- package/dist/packages/page-indicator/page-indicator.js +5 -5
- package/dist/packages/page-indicator/page-indicator.js.map +4 -4
- package/dist/packages/pagination/pagination.d.ts +11 -11
- package/dist/packages/pagination/pagination.hydration.test.js +1 -1
- package/dist/packages/pagination/pagination.js +4 -4
- package/dist/packages/pagination/pagination.js.map +4 -4
- package/dist/packages/pagination/pagination.test.js +1 -1
- package/dist/packages/pill/pill.d.ts +14 -29
- package/dist/packages/pill/pill.hydration.test.js +1 -1
- package/dist/packages/pill/pill.js +3 -3
- package/dist/packages/pill/pill.js.map +4 -4
- package/dist/packages/pill/pill.react.stories.d.ts +2 -2
- package/dist/packages/pill/react.d.ts +1 -1
- package/dist/packages/radio/radio.hydration.test.js +1 -1
- package/dist/packages/radio/radio.js +3 -3
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio/radio.test.js +1 -1
- package/dist/packages/radio-group/radio-group.a11y.test.js +7 -3
- package/dist/packages/radio-group/radio-group.hydration.test.js +6 -2
- package/dist/packages/radio-group/radio-group.js +11 -11
- package/dist/packages/radio-group/radio-group.js.map +4 -4
- package/dist/packages/select/select.a11y.test.js +6 -2
- package/dist/packages/select/select.hydration.test.js +1 -1
- package/dist/packages/select/select.js +7 -7
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/select/select.test.js +4 -2
- package/dist/packages/slider/slider.hydration.test.js +7 -2
- package/dist/packages/slider/slider.js +5 -5
- package/dist/packages/slider/slider.js.map +4 -4
- package/dist/packages/slider/slider.react.stories.js +2 -2
- package/dist/packages/slider/slider.test.js +1 -1
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.js +1 -1
- package/dist/packages/slider-thumb/slider-thumb.js +20 -20
- package/dist/packages/slider-thumb/slider-thumb.js.map +4 -4
- package/dist/packages/step/step.hydration.test.js +1 -1
- package/dist/packages/step/step.js +8 -8
- package/dist/packages/step/step.js.map +4 -4
- package/dist/packages/step-indicator/step-indicator.hydration.test.js +1 -1
- package/dist/packages/switch/switch.a11y.test.js +1 -1
- package/dist/packages/switch/switch.hydration.test.js +1 -1
- package/dist/packages/switch/switch.js +1 -1
- package/dist/packages/switch/switch.js.map +1 -1
- package/dist/packages/tab/tab.hydration.test.js +1 -1
- package/dist/packages/tab/tab.js +10 -10
- package/dist/packages/tab/tab.js.map +2 -2
- package/dist/packages/tab-panel/tab-panel.hydration.test.js +1 -1
- package/dist/packages/tab-panel/tab-panel.js +3 -3
- package/dist/packages/tab-panel/tab-panel.js.map +2 -2
- package/dist/packages/tabs/tabs.a11y.test.js +2 -2
- package/dist/packages/tabs/tabs.hydration.test.js +1 -1
- package/dist/packages/tabs/tabs.js +1 -1
- package/dist/packages/tabs/tabs.js.map +2 -2
- package/dist/packages/tabs/tabs.test.js +4 -4
- package/dist/packages/textarea/textarea.hydration.test.js +1 -1
- package/dist/packages/textarea/textarea.js +4 -4
- package/dist/packages/textarea/textarea.js.map +3 -3
- package/dist/packages/textarea/textarea.test.js +1 -1
- package/dist/packages/textfield/textfield.hydration.test.js +1 -1
- package/dist/packages/textfield/textfield.js +1 -1
- package/dist/packages/textfield/textfield.js.map +1 -1
- package/dist/packages/textfield/textfield.test.js +1 -1
- package/dist/packages/toast/toast.js +6 -6
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/packages/toast/toast.stories.d.ts +1 -5
- package/dist/packages/toast/toast.stories.js +0 -17
- package/dist/packages/toast-container/toast-container.js +2 -2
- package/dist/packages/toast-container/toast-container.js.map +2 -2
- package/dist/web-types.json +509 -172
- package/eik/index.js +2536 -0
- package/package.json +18 -12
- package/dist/docs/radio/examples.md +0 -1
- package/dist/docs/radio/usage.md +0 -1
- package/dist/packages/button/styles/w-button.styles.d.ts +0 -1
- package/dist/packages/button/styles/w-button.styles.js +0 -282
- package/dist/packages/link/styles/w-link.styles.d.ts +0 -1
- package/dist/packages/link/styles/w-link.styles.js +0 -213
- /package/dist/docs/{radio → modal}/accessibility.md +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
1
|
+
var je=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var le=o=>{throw TypeError(o)};var b=(o,e,r,t)=>{for(var a=t>1?void 0:t?Ye(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&&je(e,r,a),a};var ce=(o,e,r)=>e.has(o)||le("Cannot "+r);var de=(o,e,r)=>(ce(o,e,"read from private field"),r?r.call(o):e.get(o)),be=(o,e,r)=>e.has(o)?le("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),ue=(o,e,r,t)=>(ce(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r);var S=o=>typeof o=="string",De=o=>typeof o=="function",he=new Map,ve="en";function W(o){return[...Array.isArray(o)?o:[o],ve]}function ee(o,e,r){let t=W(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 q(()=>R("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(S(e)?new Date(e):e)}function qe(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 ee(o,e,t)}function G(o,e,r){let t=W(o);return q(()=>R("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function ge(o,e,r,{offset:t=0,...a}){let l=W(o),s=e?q(()=>R("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):q(()=>R("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return a[r]??a[s.select(r-t)]??a.other}function q(o,e){let r=o(),t=he.get(r);return t||(t=e(),he.set(r,t)),t}function R(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var pe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,we=o=>o.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,t)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(t,16);return String.fromCharCode(a)}}),me="%__lingui_octothorpe__%",Re=(o,e,r={})=>{let t=e||o,a=s=>typeof s=="object"?s:r[s],l=(s,n)=>{let h=Object.keys(r).length?a("number"):void 0,m=G(t,s,h);return n.replace(new RegExp(me,"g"),m)};return{plural:(s,n)=>{let{offset:h=0}=n,m=ge(t,!1,s,n);return l(s-h,m)},selectordinal:(s,n)=>{let{offset:h=0}=n,m=ge(t,!0,s,n);return l(s-h,m)},select:Qe,number:(s,n)=>G(t,s,a(n)||{style:n}),date:(s,n)=>ee(t,s,a(n)||n),time:(s,n)=>qe(t,s,a(n)||n)}},Qe=(o,e)=>e[o]??e.other;function Xe(o,e,r){return(t={},a)=>{let l=Re(e,r,a),s=(h,m=!1)=>Array.isArray(h)?h.reduce((C,E)=>{if(E==="#"&&m)return C+me;if(S(E))return C+E;let[T,k,M]=E,F={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(M).forEach(([V,P])=>{F[V]=s(P,k==="plural"||k==="selectordinal")}):F=M;let f;if(k){let V=l[k];f=V(t[T],F)}else f=t[T];return f==null?C:C+f},""):h,n=s(o);return S(n)&&pe.test(n)?we(n):S(n)?n:n?String(n):""}}var Ze=Object.defineProperty,Ue=(o,e,r)=>e in o?Ze(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Be=(o,e,r)=>(Ue(o,typeof e!="symbol"?e+"":e,r),r),J=class{constructor(){Be(this,"_events",{})}on(e,r){var t;return(t=this._events)[e]??(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}},He=Object.defineProperty,Ge=(o,e,r)=>e in o?He(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,$=(o,e,r)=>(Ge(o,typeof e!="symbol"?e+"":e,r),r),K=class extends J{constructor(e){super(),$(this,"_locale",""),$(this,"_locales"),$(this,"_localeData",{}),$(this,"_messages",{}),$(this,"_missing"),$(this,"_messageCompiler"),$(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??ve,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let 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?.message;e||(e=""),S(e)||(r=e.values||r,a=e.message,e=e.id);let l=this.messages[e],s=l===void 0,n=this._missing;if(n&&s)return De(n)?n(this._locale,e):n;s&&this.emit("missing",{id:e,locale:this._locale});let h=l||a||e;return S(h)&&(this._messageCompiler?h=this._messageCompiler(h):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
|
-
> ${
|
|
3
|
+
> ${h}
|
|
4
4
|
|
|
5
5
|
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
6
6
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
7
7
|
|
|
8
8
|
Please compile your catalog first.
|
|
9
|
-
`)),
|
|
9
|
+
`)),S(h)&&pe.test(h)?we(h):S(h)?h:Xe(h,this._locale,this._locales)(r,t?.formats)}date(e,r){return ee(this._locales||this._locale,e,r)}number(e,r){return G(this._locales||this._locale,e,r)}};function Je(o={}){return new K(o)}var _=Je();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)},v=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 fe(o){var e,r,t,a,l,s,n,h,m,C,E,T,k,M,F,f,V,P,U;class Ne extends o{constructor(...i){var c,g,p;super(...i),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),n.set(this,!0),m.set(this,""),C.set(this,()=>{v(this,a,!0,"f"),v(this,r,!0,"f"),d(this,e,"m",f).call(this)}),E.set(this,()=>{v(this,r,!1,"f"),d(this,e,"m",V).call(this,this.shouldFormValueUpdate()?d(this,m,"f"):""),!this.validity.valid&&d(this,a,"f")&&v(this,t,!0,"f");let z=d(this,e,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),T.set(this,()=>{var z;d(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,n,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),d(this,e,"m",f).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),k.set(this,void 0),M.set(this,!1),F.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",d(this,C,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",d(this,E,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",d(this,T,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let i=this.validators.map(p=>p.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...i])]}static getValidator(i){return this.validators.find(c=>c.attribute===i)||null}static getValidators(i){return this.validators.filter(c=>{var g;if(c.attribute===i||!((g=c.attribute)===null||g===void 0)&&g.includes(i))return!0})}get form(){return this.internals.form}get showError(){return d(this,e,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(i,c,g){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,i,c,g);let O=this.constructor.getValidators(i);O?.length&&this.validationTarget&&this.setValue(d(this,m,"f"))}setValue(i){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,m,i,"f");let p=this.shouldFormValueUpdate()?i:null;this.internals.setFormValue(p),d(this,e,"m",V).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),d(this,e,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(i=>i(d(this,F,"f")))}formResetCallback(){var i,c;v(this,a,!1,"f"),v(this,t,!1,"f"),d(this,e,"m",f).call(this),(i=this.resetFormControl)===null||i===void 0||i.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,d(this,e,"m",f).call(this)?this.validationMessage:"")}}return r=new WeakMap,t=new WeakMap,a=new WeakMap,l=new WeakMap,s=new WeakMap,n=new WeakMap,m=new WeakMap,C=new WeakMap,E=new WeakMap,T=new WeakMap,k=new WeakMap,M=new WeakMap,F=new WeakMap,e=new WeakSet,h=function(){let i=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return i.querySelectorAll(c)},f=function(){if(this.hasAttribute("disabled"))return!1;let i=d(this,t,"f")||d(this,a,"f")&&!this.validity.valid&&!d(this,r,"f");return i&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),i},V=function(i){let c=this.constructor,g={},p=c.validators,z=[],O=p.some(y=>y.isValid instanceof Promise);d(this,M,"f")||(v(this,F,new Promise(y=>{v(this,k,y,"f")}),"f"),v(this,M,!0,"f")),d(this,l,"f")&&(d(this,l,"f").abort(),v(this,s,d(this,l,"f"),"f"));let N=new AbortController;v(this,l,N,"f");let j,se=!1;p.length&&(p.forEach(y=>{let B=y.key||"customError",I=y.isValid(this,i,N.signal);I instanceof Promise?(z.push(I),I.then(H=>{H!=null&&(g[B]=!H,j=d(this,e,"m",U).call(this,y,i),d(this,e,"m",P).call(this,g,j))})):(g[B]=!I,this.validity[B]!==!I&&(se=!0),!I&&!j&&(j=d(this,e,"m",U).call(this,y,i)))}),Promise.allSettled(z).then(()=>{var y;N?.signal.aborted||(v(this,M,!1,"f"),(y=d(this,k,"f"))===null||y===void 0||y.call(this))}),(se||!O)&&d(this,e,"m",P).call(this,g,j))},P=function(i,c){if(this.validationTarget)this.internals.setValidity(i,c,this.validationTarget),v(this,n,!1,"f");else{if(this.internals.setValidity(i,c),this.internals.validity.valid)return;v(this,n,!0,"f")}},U=function(i,c){if(this.validityCallback){let g=this.validityCallback(i.key||"customError");if(g)return g}return i.message instanceof Function?i.message(this,c):i.message},Ne}import{html as Z,LitElement as Ae,nothing as nr}from"lit";import{property as w,query as sr}from"lit/decorators.js";var Ke=["en","nb","fi","da","sv"],re="en",Q=o=>Ke.find(e=>o===e||o.toLowerCase().includes(e))||re;function ye(){if(typeof window>"u"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Q(o)}try{let o=ke(document);if(o)return Q(o);let e=tr();if(e)return Q(e);let r=ke(Ce());return r?Q(r):re}catch(o){return console.warn("could not detect locale, falling back to source locale",o),re}}var _e=(o,e,r,t,a)=>{_.load("en",o),_.load("nb",e),_.load("fi",r),_.load("da",t),_.load("sv",a);let l=ye();_.activate(l),ze(),er()},We="warp-i18n-change";function ze(){typeof window>"u"||window.dispatchEvent(new Event(We))}var xe=!1;function er(){if(xe||typeof window>"u"||!document?.documentElement)return;xe=!0;let o=()=>{let a=ye();_.locale!==a&&(_.activate(a),ze())},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=Ce();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=rr();t&&e.observe(t,{attributes:!0,attributeFilter:["lang"]})}function Ce(){try{return window.parent?.document??null}catch{return null}}function ke(o){try{return o?.documentElement?.lang??""}catch{return""}}function rr(){try{return window.frameElement??null}catch{return null}}function tr(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{html as ar,LitElement as Se,nothing as ir}from"lit";import{property as L}from"lit/decorators.js";import{css as Ee}from"lit";var X=Ee`
|
|
10
10
|
*,
|
|
11
11
|
:before,
|
|
12
12
|
:after {
|
|
@@ -279,7 +279,7 @@ Please compile your catalog first.
|
|
|
279
279
|
svg {
|
|
280
280
|
pointer-events: none;
|
|
281
281
|
}
|
|
282
|
-
`,
|
|
282
|
+
`,pr=Ee`*, :before, :after {
|
|
283
283
|
--w-rotate: 0;
|
|
284
284
|
--w-rotate-x: 0;
|
|
285
285
|
--w-rotate-y: 0;
|
|
@@ -2445,485 +2445,345 @@ Please compile your catalog first.
|
|
|
2445
2445
|
display: none
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
`;import{css as
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
);
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
);
|
|
2460
|
-
|
|
2461
|
-
--
|
|
2462
|
-
--
|
|
2463
|
-
--_border-
|
|
2464
|
-
--_border: var(--border, var(--w-s-color-border));
|
|
2465
|
-
|
|
2466
|
-
--
|
|
2467
|
-
|
|
2468
|
-
--_font-size: var(--font-size, var(--w-font-size-m));
|
|
2469
|
-
--_line-height: var(--line-height, var(--w-line-height-m));
|
|
2470
|
-
--_font-weight: var(--font-weight,
|
|
2471
|
-
|
|
2472
|
-
--
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
cursor: pointer;
|
|
2482
|
-
transition:
|
|
2448
|
+
`;import{css as or}from"lit";import{css as Y}from"lit";var te=Y`
|
|
2449
|
+
:host {
|
|
2450
|
+
display: inline-block;
|
|
2451
|
+
|
|
2452
|
+
/* Internal resolved vars (defaults) */
|
|
2453
|
+
--_bg: var(--w-c-button-bg, var(--w-s-color-background));
|
|
2454
|
+
--_bg-hover: var(--w-c-button-bg-hover, var(--w-s-color-background-hover));
|
|
2455
|
+
--_bg-active: var(--w-c-button-bg-active, var(--w-s-color-background-active));
|
|
2456
|
+
|
|
2457
|
+
--_color: var(--w-c-button-color, var(--w-s-color-text-link));
|
|
2458
|
+
--_color-hover: var(--w-c-button-color-hover, var(--_color));
|
|
2459
|
+
--_color-active: var(--w-c-button-color-active, var(--_color));
|
|
2460
|
+
|
|
2461
|
+
--_border-width: var(--w-c-button-border-width, 2px);
|
|
2462
|
+
--_border-color: var(--w-c-button-border-color, var(--w-s-color-border));
|
|
2463
|
+
--_border-color-hover: var(--w-c-button-border-color-hover, var(--w-s-color-border-hover));
|
|
2464
|
+
--_border-color-active: var(--w-c-button-border-color-active, var(--w-s-color-border-active));
|
|
2465
|
+
|
|
2466
|
+
--_radius: var(--w-c-button-radius, 8px);
|
|
2467
|
+
|
|
2468
|
+
--_font-size: var(--w-c-button-font-size, var(--w-font-size-m));
|
|
2469
|
+
--_line-height: var(--w-c-button-line-height, var(--w-line-height-m));
|
|
2470
|
+
--_font-weight: var(--w-c-button-font-weight, 700);
|
|
2471
|
+
|
|
2472
|
+
--_pad-x: var(--w-c-button-padding-x, 16px);
|
|
2473
|
+
--_pad-y: var(--w-c-button-padding-y, 13px);
|
|
2474
|
+
|
|
2475
|
+
--_outline-width: var(--w-c-button-outline-width, 2px);
|
|
2476
|
+
--_outline-color: var(--w-c-button-outline-color, var(--w-s-color-border-focus));
|
|
2477
|
+
--_outline-offset: var(--w-c-button-outline-offset, var(--w-outline-offset, 1px));
|
|
2478
|
+
|
|
2479
|
+
--_transition: var(
|
|
2480
|
+
--w-c-button-transition,
|
|
2483
2481
|
color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2484
2482
|
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2485
|
-
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1)
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
color: var(--_text-color);
|
|
2491
|
-
border: var(--_border-width) solid var(--_border);
|
|
2492
|
-
border-radius: var(--_border-radius);
|
|
2493
|
-
padding: calc(var(--_padding-y) - var(--_border-width))
|
|
2494
|
-
calc(var(--_padding-x) - var(--_border-width));
|
|
2495
|
-
font-size: var(--_font-size);
|
|
2496
|
-
line-height: var(--_line-height);
|
|
2497
|
-
font-weight: var(--_font-weight);
|
|
2483
|
+
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1)
|
|
2484
|
+
);
|
|
2485
|
+
|
|
2486
|
+
/* Icon color for pill/icon-only variants (semantic; default dark grey icon) */
|
|
2487
|
+
--w-c-button-icon-color: var(--w-s-color-icon);
|
|
2498
2488
|
}
|
|
2499
2489
|
|
|
2500
|
-
:host(:
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2490
|
+
:host(:focus-visible) {
|
|
2491
|
+
outline: none;
|
|
2492
|
+
}
|
|
2493
|
+
`,oe=Y`
|
|
2494
|
+
:host([variant='primary']) {
|
|
2495
|
+
--w-c-button-bg: var(--w-s-color-background-primary);
|
|
2496
|
+
--w-c-button-bg-hover: var(--w-s-color-background-primary-hover);
|
|
2497
|
+
--w-c-button-bg-active: var(--w-s-color-background-primary-active);
|
|
2498
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2499
|
+
--w-c-button-border-width: 0px;
|
|
2504
2500
|
}
|
|
2505
2501
|
|
|
2506
|
-
:host(
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2502
|
+
:host([variant='negative']) {
|
|
2503
|
+
--w-c-button-bg: var(--w-s-color-background-negative);
|
|
2504
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-hover);
|
|
2505
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-active);
|
|
2506
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2507
|
+
--w-c-button-border-width: 0px;
|
|
2510
2508
|
}
|
|
2511
2509
|
|
|
2512
|
-
:host(
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
:host([variant="primary"]) {
|
|
2519
|
-
--background: var(--w-s-color-background-primary);
|
|
2520
|
-
--background-hover: var(--w-s-color-background-primary-hover);
|
|
2521
|
-
--background-active: var(--w-s-color-background-primary-active);
|
|
2522
|
-
--color: var(--w-s-color-text-inverted);
|
|
2523
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2524
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2525
|
-
--border-width: 0px;
|
|
2526
|
-
}
|
|
2527
|
-
:host([variant="quiet"]),
|
|
2528
|
-
:host([quiet]) /* deprecated, backwards compatibility, use variant="quiet" */ {
|
|
2529
|
-
--background: transparent;
|
|
2530
|
-
--color: var(--w-s-color-text-link);
|
|
2531
|
-
--color-hover: var(--w-s-color-text-link-hover);
|
|
2532
|
-
--color-active: var(--w-s-color-text-link-active);
|
|
2533
|
-
--border-width: 0px;
|
|
2534
|
-
}
|
|
2535
|
-
:host([variant="negative"]) {
|
|
2536
|
-
--background: var(--w-s-color-background-negative);
|
|
2537
|
-
--background-hover: var(--w-s-color-background-negative-hover);
|
|
2538
|
-
--background-active: var(--w-s-color-background-negative-active);
|
|
2539
|
-
--color: var(--w-s-color-text-inverted);
|
|
2540
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2541
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2542
|
-
--border-width: 0px;
|
|
2543
|
-
}
|
|
2544
|
-
:host([variant="negativeQuiet"]),
|
|
2545
|
-
:host([quiet][variant="negative"]) /* deprecated, backwards compatibility */ {
|
|
2546
|
-
--background: transparent;
|
|
2547
|
-
--background-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2548
|
-
--background-active: var(--w-s-color-background-negative-subtle-active);
|
|
2549
|
-
--color: var(--w-s-color-text-negative);
|
|
2550
|
-
--color-hover: var(--w-s-color-text-negative);
|
|
2551
|
-
--color-active: var(--w-s-color-text-negative);
|
|
2552
|
-
--border-width: 0px;
|
|
2553
|
-
}
|
|
2554
|
-
:host([variant="utility"]) {
|
|
2555
|
-
--background: var(--w-s-color-background);
|
|
2556
|
-
--background-hover: var(--w-s-color-background-hover);
|
|
2557
|
-
--background-active: var(--w-s-color-background-active);
|
|
2558
|
-
--color: var(--w-s-color-text);
|
|
2559
|
-
--color-hover: var(--w-s-color-text);
|
|
2560
|
-
--color-active: var(--w-s-color-text);
|
|
2561
|
-
--border-radius: var(--w-button-radius-utility, 4px);
|
|
2562
|
-
--border-width: 1px;
|
|
2563
|
-
}
|
|
2564
|
-
:host([variant="utilityQuiet"]),
|
|
2565
|
-
:host([quiet][variant="utility"]) /* deprecated, backwards compatibility */ {
|
|
2566
|
-
--background: transparent;
|
|
2567
|
-
--color: var(--w-s-color-text);
|
|
2568
|
-
--color-hover: var(--w-s-color-text);
|
|
2569
|
-
--color-active: var(--w-s-color-text);
|
|
2570
|
-
--border-width: 0px;
|
|
2571
|
-
}
|
|
2572
|
-
:host([variant="overlay"]) {
|
|
2573
|
-
--background: var(--w-color-background);
|
|
2574
|
-
--background-hover: var(--w-color-background-hover);
|
|
2575
|
-
--background-active: var(--w-color-background-active);
|
|
2576
|
-
--color: var(--w-s-color-text);
|
|
2577
|
-
--color-hover: var(--w-s-color-text);
|
|
2578
|
-
--color-active: var(--w-s-color-text);
|
|
2579
|
-
--border-radius: 9999px;
|
|
2580
|
-
--border-width: 0px;
|
|
2581
|
-
}
|
|
2582
|
-
:host([variant="overlayQuiet"]),
|
|
2583
|
-
:host([quiet][variant="overlay"]) /* deprecated, backwards compatibility */ {
|
|
2584
|
-
--background: transparent;
|
|
2585
|
-
--background-hover: var(--w-s-color-background-hover);
|
|
2586
|
-
--background-active: var(--w-s-color-background-active);
|
|
2587
|
-
--color: var(--w-s-color-text);
|
|
2588
|
-
--color-hover: var(--w-s-color-text);
|
|
2589
|
-
--color-active: var(--w-s-color-text);
|
|
2590
|
-
--border-radius: 9999px;
|
|
2591
|
-
--border-width: 0px;
|
|
2592
|
-
}
|
|
2593
|
-
:host([variant="overlayInverted"]) {
|
|
2594
|
-
--background: var(--w-s-color-background-inverted);
|
|
2595
|
-
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2596
|
-
--background-active: var(--w-s-color-background-inverted-active);
|
|
2597
|
-
--color: var(--w-s-color-text-inverted);
|
|
2598
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2599
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2600
|
-
--border-radius: 9999px;
|
|
2601
|
-
--border-width: 0px;
|
|
2602
|
-
}
|
|
2603
|
-
:host([variant="overlayInvertedQuiet"]),
|
|
2604
|
-
:host([quiet][variant="overlayInverted"]) /* deprecated, backwards compatibility */ {
|
|
2605
|
-
--background: transparent;
|
|
2606
|
-
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2607
|
-
--background-active: var(--w-s-color-background-inverted-active);
|
|
2608
|
-
--color: var(--w-s-color-text-inverted);
|
|
2609
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2610
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2611
|
-
--border-radius: 9999px;
|
|
2612
|
-
--border-width: 0px;
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
|
-
:host([variant="link"]) {
|
|
2616
|
-
--background: none;
|
|
2617
|
-
--background-hover: none;
|
|
2618
|
-
--background-active: none;
|
|
2619
|
-
--border-width: 0px;
|
|
2620
|
-
--font-weight: normal;
|
|
2621
|
-
display: inline;
|
|
2510
|
+
:host([variant='negativeQuiet']) {
|
|
2511
|
+
--w-c-button-bg: transparent;
|
|
2512
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2513
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-subtle-active);
|
|
2514
|
+
--w-c-button-color: var(--w-s-color-text-negative);
|
|
2515
|
+
--w-c-button-border-width: 0px;
|
|
2622
2516
|
}
|
|
2623
2517
|
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
--
|
|
2628
|
-
--
|
|
2629
|
-
--background-active: var(--w-s-color-background-disabled);
|
|
2630
|
-
--color: var(--w-s-color-text-inverted);
|
|
2631
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2632
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2633
|
-
--border-width: 0px;
|
|
2634
|
-
}
|
|
2635
|
-
|
|
2636
|
-
:host(:disabled) a,
|
|
2637
|
-
:host([disabled]) a {
|
|
2638
|
-
cursor: not-allowed;
|
|
2639
|
-
pointer-events: none;
|
|
2518
|
+
:host([variant='utility']) {
|
|
2519
|
+
--w-c-button-bg: var(--w-s-color-background);
|
|
2520
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2521
|
+
--w-c-button-radius: 4px;
|
|
2522
|
+
--w-c-button-border-width: 1px;
|
|
2640
2523
|
}
|
|
2641
2524
|
|
|
2642
|
-
:host([variant=
|
|
2643
|
-
|
|
2525
|
+
:host([variant='utilityQuiet']) {
|
|
2526
|
+
--w-c-button-bg: transparent;
|
|
2527
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2528
|
+
--w-c-button-border-width: 0px;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
:host([variant='quiet']) {
|
|
2532
|
+
--w-c-button-bg: transparent;
|
|
2533
|
+
--w-c-button-border-width: 0px;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
:host([variant='overlay']) {
|
|
2537
|
+
--w-c-button-bg: var(--w-s-color-background);
|
|
2538
|
+
--w-c-button-bg-hover: var(--w-s-color-background-hover);
|
|
2539
|
+
--w-c-button-bg-active: var(--w-s-color-background-active);
|
|
2540
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2541
|
+
--w-c-button-radius: 9999px;
|
|
2542
|
+
--w-c-button-border-width: 0px;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
:host([variant='overlayInverted']) {
|
|
2546
|
+
--w-c-button-bg: var(--w-s-color-background-inverted);
|
|
2547
|
+
--w-c-button-bg-hover: var(--w-s-color-background-inverted-hover);
|
|
2548
|
+
--w-c-button-bg-active: var(--w-s-color-background-inverted-active);
|
|
2549
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2550
|
+
--w-c-button-radius: 9999px;
|
|
2551
|
+
--w-c-button-border-width: 0px;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
:host([variant='overlayQuiet']) {
|
|
2555
|
+
--w-c-button-bg: transparent;
|
|
2556
|
+
--w-c-button-bg-hover: var(--w-s-color-background-hover);
|
|
2557
|
+
--w-c-button-bg-active: var(--w-s-color-background-active);
|
|
2558
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2559
|
+
--w-c-button-radius: 9999px;
|
|
2560
|
+
--w-c-button-border-width: 0px;
|
|
2644
2561
|
}
|
|
2645
2562
|
|
|
2646
|
-
|
|
2563
|
+
:host([variant='overlayInvertedQuiet']) {
|
|
2564
|
+
--w-c-button-bg: transparent;
|
|
2565
|
+
--w-c-button-bg-hover: var(--w-s-color-background-inverted-hover);
|
|
2566
|
+
--w-c-button-bg-active: var(--w-s-color-background-inverted-active);
|
|
2567
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2568
|
+
--w-c-button-radius: 9999px;
|
|
2569
|
+
--w-c-button-border-width: 0px;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
:host([variant='link']) {
|
|
2573
|
+
--w-c-button-bg: transparent;
|
|
2574
|
+
--w-c-button-border-width: 0px;
|
|
2575
|
+
--w-c-button-padding-x: 0px;
|
|
2576
|
+
--w-c-button-padding-y: 0px;
|
|
2577
|
+
--w-c-button-font-weight: 400;
|
|
2578
|
+
|
|
2579
|
+
--w-c-button-bg-hover: transparent;
|
|
2580
|
+
--w-c-button-bg-active: transparent;
|
|
2581
|
+
|
|
2582
|
+
--w-c-button-color: var(--w-s-color-text-link);
|
|
2583
|
+
--w-c-button-color-hover: var(--w-s-color-text-link-hover, var(--w-c-button-color));
|
|
2584
|
+
--w-c-button-color-active: var(--w-s-color-text-link-active, var(--w-c-button-color));
|
|
2585
|
+
}
|
|
2586
|
+
`,ae=Y`
|
|
2647
2587
|
:host([small]) {
|
|
2648
|
-
--padding-x: 12px;
|
|
2649
|
-
--padding-y: 8px;
|
|
2650
|
-
--font-size: var(--w-font-size-xs);
|
|
2651
|
-
--line-height: var(--w-line-height-xs);
|
|
2588
|
+
--w-c-button-padding-x: 12px;
|
|
2589
|
+
--w-c-button-padding-y: 8px;
|
|
2590
|
+
--w-c-button-font-size: var(--w-font-size-xs);
|
|
2591
|
+
--w-c-button-line-height: var(--w-line-height-xs);
|
|
2652
2592
|
}
|
|
2593
|
+
`,ie=Y`
|
|
2594
|
+
:host([disabled]) {
|
|
2595
|
+
pointer-events: none;
|
|
2653
2596
|
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2597
|
+
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
2598
|
+
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
2599
|
+
--w-c-button-bg-active: var(--w-s-color-background-disabled);
|
|
2600
|
+
|
|
2601
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2602
|
+
--w-c-button-border-width: 0px;
|
|
2658
2603
|
}
|
|
2659
|
-
|
|
2660
|
-
${
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
>
|
|
2667
|
-
<slot></slot>
|
|
2668
|
-
</a>
|
|
2669
|
-
`}};x.shadowRootOptions={...ye.shadowRootOptions,delegatesFocus:!0},x.styles=[X,ke],b([S({type:Boolean,reflect:!0})],x.prototype,"autofocus",2),b([S({reflect:!0})],x.prototype,"variant",2),b([S({type:Boolean,reflect:!0})],x.prototype,"small",2),b([S({reflect:!0})],x.prototype,"href",2),b([S({type:Boolean,reflect:!0})],x.prototype,"disabled",2),b([S({reflect:!0})],x.prototype,"target",2),b([S({reflect:!0})],x.prototype,"rel",2),b([S({attribute:"full-width",type:Boolean,reflect:!0})],x.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",x);var ze=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var Ce=JSON.parse('{"button.aria.loading":["Loading..."]}');var Me=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Fe=JSON.parse('{"button.aria.loading":["Laster..."]}');var Ee=JSON.parse('{"button.aria.loading":["Laddar ..."]}');import{css as er}from"lit";var Ve=er`
|
|
2670
|
-
:host {
|
|
2671
|
-
/* Local scoped variables, given the default button (the secondary variant) as a default */
|
|
2672
|
-
--_background: var(--background, var(--w-s-color-background));
|
|
2673
|
-
--_background-hover: var(
|
|
2674
|
-
--background-hover,
|
|
2675
|
-
var(--w-s-color-background-hover)
|
|
2676
|
-
);
|
|
2677
|
-
--_background-active: var(
|
|
2678
|
-
--background-active,
|
|
2679
|
-
var(--w-s-color-background-active)
|
|
2680
|
-
);
|
|
2681
|
-
--_text-color: var(--color, var(--w-s-color-text-link));
|
|
2682
|
-
--_text-color-hover: var(--color-hover, var(--w-s-color-text-link));
|
|
2683
|
-
--_text-color-active: var(--color-active, var(--w-s-color-text-link));
|
|
2684
|
-
--_border-width: var(--border-width, 2px);
|
|
2685
|
-
--_border: var(--border, var(--w-s-color-border));
|
|
2686
|
-
--_border-hover: var(--border-hover, var(--w-s-color-border-hover));
|
|
2687
|
-
--_border-active: var(--border-active, var(--w-s-color-border-active));
|
|
2688
|
-
--_border-radius: var(--border-radius, var(--w-button-radius-default, 8px));
|
|
2689
|
-
--_font-size: var(--font-size, var(--w-font-size-m));
|
|
2690
|
-
--_line-height: var(--line-height, var(--w-line-height-m));
|
|
2691
|
-
--_font-weight: var(--font-weight, bold);
|
|
2692
|
-
--_padding-x: var(--padding-x, 16px);
|
|
2693
|
-
--_padding-y: var(--padding-y, 13px);
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
button {
|
|
2697
|
-
/* Base setup for all buttons */
|
|
2604
|
+
`,Me=Y`
|
|
2605
|
+
${te}
|
|
2606
|
+
|
|
2607
|
+
/* ============================================================
|
|
2608
|
+
* Base element (NATIVE button mode ONLY)
|
|
2609
|
+
* ============================================================ */
|
|
2610
|
+
button[part='base'] {
|
|
2698
2611
|
display: inline-flex;
|
|
2699
2612
|
justify-content: center;
|
|
2700
2613
|
align-items: center;
|
|
2701
2614
|
text-align: center;
|
|
2615
|
+
|
|
2702
2616
|
cursor: pointer;
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
border: var(--_border-width) solid var(--_border);
|
|
2714
|
-
border-radius: var(--_border-radius);
|
|
2715
|
-
padding: calc(var(--_padding-y) - var(--_border-width))
|
|
2716
|
-
calc(var(--_padding-x) - var(--_border-width));
|
|
2617
|
+
|
|
2618
|
+
background-color: var(--_bg);
|
|
2619
|
+
color: var(--_color);
|
|
2620
|
+
|
|
2621
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
2622
|
+
border-radius: var(--_radius);
|
|
2623
|
+
|
|
2624
|
+
padding: calc(var(--_pad-y) - var(--_border-width))
|
|
2625
|
+
calc(var(--_pad-x) - var(--_border-width));
|
|
2626
|
+
|
|
2717
2627
|
font-size: var(--_font-size);
|
|
2718
2628
|
line-height: var(--_line-height);
|
|
2719
2629
|
font-weight: var(--_font-weight);
|
|
2630
|
+
|
|
2631
|
+
transition: var(--_transition);
|
|
2720
2632
|
}
|
|
2721
2633
|
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
color: var(--_text-color-hover);
|
|
2634
|
+
/* Optional: helps avoid "grew a bit" from slot typography differences */
|
|
2635
|
+
button[part='base'] ::slotted(*) {
|
|
2636
|
+
line-height: inherit;
|
|
2726
2637
|
}
|
|
2727
2638
|
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2639
|
+
/* ============================================================
|
|
2640
|
+
* Link mode wrapper (w-link host carries part="base" in button.ts)
|
|
2641
|
+
* Keep it layout-only to avoid double chrome.
|
|
2642
|
+
* ============================================================ */
|
|
2643
|
+
:host > w-link[part='base'] {
|
|
2644
|
+
display: inline-block;
|
|
2645
|
+
padding: 0;
|
|
2646
|
+
border: 0;
|
|
2647
|
+
background: transparent;
|
|
2732
2648
|
}
|
|
2733
2649
|
|
|
2734
|
-
button
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
/* Variants config */
|
|
2740
|
-
:host([variant="primary"]) {
|
|
2741
|
-
--background: var(--w-s-color-background-primary);
|
|
2742
|
-
--background-hover: var(--w-s-color-background-primary-hover);
|
|
2743
|
-
--background-active: var(--w-s-color-background-primary-active);
|
|
2744
|
-
--color: var(--w-s-color-text-inverted);
|
|
2745
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2746
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2747
|
-
--border-width: 0px;
|
|
2748
|
-
}
|
|
2749
|
-
:host([variant="quiet"]),
|
|
2750
|
-
:host([quiet]) /* deprecated, backwards compatibility, use variant="quiet" */ {
|
|
2751
|
-
--background: transparent;
|
|
2752
|
-
--color: var(--w-s-color-text-link);
|
|
2753
|
-
--color-hover: var(--w-s-color-text-link-hover);
|
|
2754
|
-
--color-active: var(--w-s-color-text-link-active);
|
|
2755
|
-
--border-width: 0px;
|
|
2756
|
-
}
|
|
2757
|
-
:host([variant="negative"]) {
|
|
2758
|
-
--background: var(--w-s-color-background-negative);
|
|
2759
|
-
--background-hover: var(--w-s-color-background-negative-hover);
|
|
2760
|
-
--background-active: var(--w-s-color-background-negative-active);
|
|
2761
|
-
--color: var(--w-s-color-text-inverted);
|
|
2762
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2763
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2764
|
-
--border-width: 0px;
|
|
2765
|
-
}
|
|
2766
|
-
:host([variant="negativeQuiet"]),
|
|
2767
|
-
:host([quiet][variant="negative"]) /* deprecated, backwards compatibility */ {
|
|
2768
|
-
--background: transparent;
|
|
2769
|
-
--background-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2770
|
-
--background-active: var(--w-s-color-background-negative-subtle-active);
|
|
2771
|
-
--color: var(--w-s-color-text-negative);
|
|
2772
|
-
--color-hover: var(--w-s-color-text-negative);
|
|
2773
|
-
--color-active: var(--w-s-color-text-negative);
|
|
2774
|
-
--border-width: 0px;
|
|
2775
|
-
}
|
|
2776
|
-
:host([variant="utility"]) {
|
|
2777
|
-
--background: var(--w-s-color-background);
|
|
2778
|
-
--background-hover: var(--w-s-color-background-hover);
|
|
2779
|
-
--background-active: var(--w-s-color-background-active);
|
|
2780
|
-
--color: var(--w-s-color-text);
|
|
2781
|
-
--color-hover: var(--w-s-color-text);
|
|
2782
|
-
--color-active: var(--w-s-color-text);
|
|
2783
|
-
--border-radius: var(--w-button-radius-utility, 4px);
|
|
2784
|
-
--border-width: 1px;
|
|
2785
|
-
}
|
|
2786
|
-
:host([variant="utilityQuiet"]),
|
|
2787
|
-
:host([quiet][variant="utility"]) /* deprecated, backwards compatibility */ {
|
|
2788
|
-
--background: transparent;
|
|
2789
|
-
--color: var(--w-s-color-text);
|
|
2790
|
-
--color-hover: var(--w-s-color-text);
|
|
2791
|
-
--color-active: var(--w-s-color-text);
|
|
2792
|
-
--border-width: 0px;
|
|
2793
|
-
}
|
|
2794
|
-
:host([variant="overlay"]) {
|
|
2795
|
-
--background: var(--w-color-background);
|
|
2796
|
-
--background-hover: var(--w-color-background-hover);
|
|
2797
|
-
--background-active: var(--w-color-background-active);
|
|
2798
|
-
--color: var(--w-s-color-text);
|
|
2799
|
-
--color-hover: var(--w-s-color-text);
|
|
2800
|
-
--color-active: var(--w-s-color-text);
|
|
2801
|
-
--border-radius: 9999px;
|
|
2802
|
-
--border-width: 0px;
|
|
2803
|
-
}
|
|
2804
|
-
:host([variant="overlayQuiet"]),
|
|
2805
|
-
:host([quiet][variant="overlay"]) /* deprecated, backwards compatibility */ {
|
|
2806
|
-
--background: transparent;
|
|
2807
|
-
--background-hover: var(--w-s-color-background-hover);
|
|
2808
|
-
--background-active: var(--w-s-color-background-active);
|
|
2809
|
-
--color: var(--w-s-color-text);
|
|
2810
|
-
--color-hover: var(--w-s-color-text);
|
|
2811
|
-
--color-active: var(--w-s-color-text);
|
|
2812
|
-
--border-radius: 9999px;
|
|
2813
|
-
--border-width: 0px;
|
|
2814
|
-
}
|
|
2815
|
-
:host([variant="overlayInverted"]) {
|
|
2816
|
-
--background: var(--w-s-color-background-inverted);
|
|
2817
|
-
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2818
|
-
--background-active: var(--w-s-color-background-inverted-active);
|
|
2819
|
-
--color: var(--w-s-color-text-inverted);
|
|
2820
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2821
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2822
|
-
--border-radius: 9999px;
|
|
2823
|
-
--border-width: 0px;
|
|
2824
|
-
}
|
|
2825
|
-
:host([variant="overlayInvertedQuiet"]),
|
|
2826
|
-
:host([quiet][variant="overlayInverted"]) /* deprecated, backwards compatibility */ {
|
|
2827
|
-
--background: transparent;
|
|
2828
|
-
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2829
|
-
--background-active: var(--w-s-color-background-inverted-active);
|
|
2830
|
-
--color: var(--w-s-color-text-inverted);
|
|
2831
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2832
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2833
|
-
--border-radius: 9999px;
|
|
2834
|
-
--border-width: 0px;
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
:host([variant="link"]) {
|
|
2838
|
-
--background: none;
|
|
2839
|
-
--background-hover: none;
|
|
2840
|
-
--background-active: none;
|
|
2841
|
-
--border-width: 0px;
|
|
2842
|
-
--font-weight: normal;
|
|
2843
|
-
display: inline;
|
|
2650
|
+
/* Hover / active (native button mode only) */
|
|
2651
|
+
:host(:not([disabled]):not([loading])) button[part='base']:hover {
|
|
2652
|
+
background-color: var(--_bg-hover);
|
|
2653
|
+
border-color: var(--_border-color-hover);
|
|
2654
|
+
color: var(--_color-hover);
|
|
2844
2655
|
}
|
|
2845
2656
|
|
|
2846
|
-
:host([
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
--border-radius: 50%;
|
|
2851
|
-
--border-width: 0px;
|
|
2852
|
-
--color: var(--w-s-color-icon);
|
|
2853
|
-
--color-hover: var(--w-s-color-icon-hover);
|
|
2854
|
-
--color-active: var(--w-s-color-icon-active);
|
|
2855
|
-
--padding-x: 14px; /* get a total height and width of 44px, matching atomic CSS variant */
|
|
2856
|
-
--padding-y: 14px;
|
|
2657
|
+
:host(:not([disabled]):not([loading])) button[part='base']:active {
|
|
2658
|
+
background-color: var(--_bg-active);
|
|
2659
|
+
border-color: var(--_border-color-active);
|
|
2660
|
+
color: var(--_color-active);
|
|
2857
2661
|
}
|
|
2858
2662
|
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
--background: var(--w-s-color-background-disabled);
|
|
2863
|
-
--background-hover: var(--w-s-color-background-disabled);
|
|
2864
|
-
--background-active: var(--w-s-color-background-disabled);
|
|
2865
|
-
--color: var(--w-s-color-text-inverted);
|
|
2866
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2867
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2868
|
-
--border-width: 0px;
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
:host(:disabled) button,
|
|
2872
|
-
:host([disabled]) button {
|
|
2873
|
-
cursor: not-allowed;
|
|
2874
|
-
pointer-events: none;
|
|
2663
|
+
:host(:focus-visible) button[part='base'] {
|
|
2664
|
+
outline: var(--_outline-width) solid var(--_outline-color);
|
|
2665
|
+
outline-offset: var(--_outline-offset);
|
|
2875
2666
|
}
|
|
2876
2667
|
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
--
|
|
2668
|
+
/* ============================================================
|
|
2669
|
+
* Variants (shared + button-specific quiet mappings)
|
|
2670
|
+
* ============================================================ */
|
|
2671
|
+
${oe}
|
|
2672
|
+
|
|
2673
|
+
/* Button-specific: quiet attribute backwards compatibility */
|
|
2674
|
+
:host([variant='negative'][quiet]) {
|
|
2675
|
+
--w-c-button-bg: transparent;
|
|
2676
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2677
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-subtle-active);
|
|
2678
|
+
--w-c-button-color: var(--w-s-color-text-negative);
|
|
2679
|
+
--w-c-button-border-width: 0px;
|
|
2885
2680
|
}
|
|
2886
2681
|
|
|
2887
|
-
:host([
|
|
2888
|
-
|
|
2889
|
-
|
|
2682
|
+
:host([variant='utility'][quiet]) {
|
|
2683
|
+
--w-c-button-bg: transparent;
|
|
2684
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2685
|
+
--w-c-button-border-width: 0px;
|
|
2890
2686
|
}
|
|
2891
2687
|
|
|
2892
|
-
:
|
|
2893
|
-
|
|
2688
|
+
/* Button-specific: pill variant */
|
|
2689
|
+
:host([variant='pill']) {
|
|
2690
|
+
--w-c-button-bg: transparent;
|
|
2691
|
+
--w-c-button-radius: 50%;
|
|
2692
|
+
--w-c-button-border-width: 0px;
|
|
2693
|
+
--w-c-button-padding-x: 14px;
|
|
2694
|
+
--w-c-button-padding-y: 14px;
|
|
2695
|
+
|
|
2696
|
+
/* pill uses semantic icon color (dark grey by default) */
|
|
2697
|
+
--w-c-button-color: var(--w-c-button-icon-color, var(--w-s-color-icon));
|
|
2894
2698
|
}
|
|
2895
2699
|
|
|
2896
|
-
/*
|
|
2897
|
-
:host([
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
--font-size: var(--w-font-size-xs);
|
|
2901
|
-
--line-height: var(--w-line-height-xs);
|
|
2700
|
+
/* Button-specific: link variant element styles */
|
|
2701
|
+
:host([variant='link']) button[part='base'] {
|
|
2702
|
+
display: inline;
|
|
2703
|
+
padding: 0;
|
|
2902
2704
|
}
|
|
2903
2705
|
|
|
2904
|
-
:host([
|
|
2905
|
-
|
|
2906
|
-
|
|
2706
|
+
:host([variant='link']:not([disabled]):not([loading])) button[part='base']:hover {
|
|
2707
|
+
text-decoration: underline;
|
|
2708
|
+
background-color: transparent;
|
|
2709
|
+
border-color: transparent;
|
|
2710
|
+
color: var(--w-c-button-color-hover);
|
|
2907
2711
|
}
|
|
2908
2712
|
|
|
2909
|
-
/*
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2713
|
+
/* ===== Size ===== */
|
|
2714
|
+
${ae}
|
|
2715
|
+
|
|
2716
|
+
:host([small][variant='pill']) {
|
|
2717
|
+
--w-c-button-padding-x: 8px;
|
|
2718
|
+
--w-c-button-padding-y: 8px;
|
|
2913
2719
|
}
|
|
2914
2720
|
|
|
2915
|
-
|
|
2916
|
-
|
|
2721
|
+
/* ===== Layout ===== */
|
|
2722
|
+
|
|
2723
|
+
:host([full-width]) button[part='base'],
|
|
2724
|
+
:host([full-width]) > w-link[part='base'] {
|
|
2725
|
+
width: 100%;
|
|
2917
2726
|
}
|
|
2918
2727
|
|
|
2919
|
-
:host([
|
|
2920
|
-
width: auto;
|
|
2921
|
-
max-width: none;
|
|
2728
|
+
:host([icon-only]) button[part='base'] {
|
|
2922
2729
|
aspect-ratio: 1 / 1;
|
|
2730
|
+
padding-left: calc(var(--w-c-button-padding-y) - var(--w-c-button-border-width, 0px));
|
|
2731
|
+
padding-right: calc(var(--w-c-button-padding-y) - var(--w-c-button-border-width, 0px));
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
/* ============================================================
|
|
2735
|
+
* STATE OVERRIDES (must be last so they win over variants)
|
|
2736
|
+
* Disabled first, Loading last (loading is disabled-like + visuals)
|
|
2737
|
+
*
|
|
2738
|
+
* IMPORTANT:
|
|
2739
|
+
* Some variant selectors are more specific (e.g. [variant='negative']:not([quiet])).
|
|
2740
|
+
* To ensure states always win, we match similar specificity via extra attribute selectors.
|
|
2741
|
+
* ============================================================ */
|
|
2742
|
+
|
|
2743
|
+
/* ===== Disabled ===== */
|
|
2744
|
+
${ie}
|
|
2745
|
+
|
|
2746
|
+
/* Additional specificity for button to override quiet variants */
|
|
2747
|
+
:host([disabled][variant]),
|
|
2748
|
+
:host([disabled][quiet]) {
|
|
2749
|
+
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
2750
|
+
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
2751
|
+
--w-c-button-bg-active: var(--w-s-color-background-disabled);
|
|
2752
|
+
|
|
2753
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2754
|
+
|
|
2755
|
+
--w-c-button-border-width: 0px;
|
|
2756
|
+
--w-c-button-border-color: transparent;
|
|
2757
|
+
--w-c-button-border-color-hover: transparent;
|
|
2758
|
+
--w-c-button-border-color-active: transparent;
|
|
2759
|
+
|
|
2760
|
+
--w-c-button-color-hover: var(--w-s-color-text-inverted);
|
|
2761
|
+
--w-c-button-color-active: var(--w-s-color-text-inverted);
|
|
2923
2762
|
}
|
|
2924
2763
|
|
|
2925
|
-
/*
|
|
2926
|
-
:host([loading])
|
|
2764
|
+
/* ===== Loading (wins over everything) ===== */
|
|
2765
|
+
:host([loading]),
|
|
2766
|
+
:host([loading][variant]),
|
|
2767
|
+
:host([loading][quiet]) {
|
|
2768
|
+
pointer-events: none;
|
|
2769
|
+
|
|
2770
|
+
/* Strong overrides so variants can't leak through */
|
|
2771
|
+
--w-c-button-bg: var(--w-s-color-background-subtle);
|
|
2772
|
+
--w-c-button-bg-hover: var(--w-s-color-background-subtle);
|
|
2773
|
+
--w-c-button-bg-active: var(--w-s-color-background-subtle);
|
|
2774
|
+
|
|
2775
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2776
|
+
--w-c-button-color-hover: var(--w-s-color-text);
|
|
2777
|
+
--w-c-button-color-active: var(--w-s-color-text);
|
|
2778
|
+
|
|
2779
|
+
--w-c-button-border-width: 0px;
|
|
2780
|
+
--w-c-button-border-color: transparent;
|
|
2781
|
+
--w-c-button-border-color-hover: transparent;
|
|
2782
|
+
--w-c-button-border-color-active: transparent;
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
/* Loading stripes (native button mode only) */
|
|
2786
|
+
:host([loading]) button[part='base'] {
|
|
2927
2787
|
background-image: linear-gradient(
|
|
2928
2788
|
135deg,
|
|
2929
2789
|
rgba(0, 0, 0, 0.05) 25%,
|
|
@@ -2938,6 +2798,12 @@ ${_e.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0
|
|
|
2938
2798
|
animation: animate-inprogress 3s linear infinite;
|
|
2939
2799
|
}
|
|
2940
2800
|
|
|
2801
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2802
|
+
:host([loading]) button[part='base'] {
|
|
2803
|
+
animation: none;
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2941
2807
|
@keyframes animate-inprogress {
|
|
2942
2808
|
0% {
|
|
2943
2809
|
background-position: 0 0;
|
|
@@ -2946,8 +2812,92 @@ ${_e.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0
|
|
|
2946
2812
|
background-position: 60px 0;
|
|
2947
2813
|
}
|
|
2948
2814
|
}
|
|
2949
|
-
`;
|
|
2950
|
-
${
|
|
2815
|
+
`;var Fe=or`
|
|
2816
|
+
${te}
|
|
2817
|
+
|
|
2818
|
+
/* ============================================================
|
|
2819
|
+
* Link element (anchor with button styling)
|
|
2820
|
+
* ============================================================ */
|
|
2821
|
+
a[part='base'] {
|
|
2822
|
+
display: inline-flex;
|
|
2823
|
+
justify-content: center;
|
|
2824
|
+
align-items: center;
|
|
2825
|
+
text-align: center;
|
|
2826
|
+
|
|
2827
|
+
cursor: pointer;
|
|
2828
|
+
text-decoration: none;
|
|
2829
|
+
|
|
2830
|
+
background-color: var(--_bg);
|
|
2831
|
+
color: var(--_color);
|
|
2832
|
+
|
|
2833
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
2834
|
+
border-radius: var(--_radius);
|
|
2835
|
+
|
|
2836
|
+
padding: calc(var(--_pad-y) - var(--_border-width))
|
|
2837
|
+
calc(var(--_pad-x) - var(--_border-width));
|
|
2838
|
+
|
|
2839
|
+
font-size: var(--_font-size);
|
|
2840
|
+
line-height: var(--_line-height);
|
|
2841
|
+
font-weight: var(--_font-weight);
|
|
2842
|
+
|
|
2843
|
+
transition: var(--_transition);
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
:host(:not([disabled])) a[part='base']:hover {
|
|
2847
|
+
background-color: var(--_bg-hover);
|
|
2848
|
+
border-color: var(--_border-color-hover);
|
|
2849
|
+
color: var(--_color-hover);
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
:host(:not([disabled])) a[part='base']:active {
|
|
2853
|
+
background-color: var(--_bg-active);
|
|
2854
|
+
border-color: var(--_border-color-active);
|
|
2855
|
+
color: var(--_color-active);
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
:host(:focus-visible) a[part='base'] {
|
|
2859
|
+
outline: var(--_outline-width) solid var(--_outline-color);
|
|
2860
|
+
outline-offset: var(--_outline-offset);
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
/* ===== Variants (shared from button) ===== */
|
|
2864
|
+
${oe}
|
|
2865
|
+
|
|
2866
|
+
/* Link-specific: link variant element styles */
|
|
2867
|
+
:host([variant='link']) a[part='base'] {
|
|
2868
|
+
display: inline;
|
|
2869
|
+
padding: 0;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
:host([variant='link']:not([disabled])) a[part='base']:hover {
|
|
2873
|
+
text-decoration: underline;
|
|
2874
|
+
background-color: transparent;
|
|
2875
|
+
border-color: transparent;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
/* ===== Sizes (shared from button) ===== */
|
|
2879
|
+
${ae}
|
|
2880
|
+
|
|
2881
|
+
/* ===== Layout ===== */
|
|
2882
|
+
:host([full-width]) a[part='base'] {
|
|
2883
|
+
width: 100%;
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
/* ===== Disabled (shared from button) ===== */
|
|
2887
|
+
${ie}
|
|
2888
|
+
`;var Le=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],x=class extends Se{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!Le.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2889
|
+
${Le.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){return ar`
|
|
2890
|
+
<a
|
|
2891
|
+
href="${this.href}"
|
|
2892
|
+
part="base"
|
|
2893
|
+
target="${this.target}"
|
|
2894
|
+
rel="${this.target==="_blank"?this.rel||"noopener":ir}"
|
|
2895
|
+
tabindex="0"
|
|
2896
|
+
>
|
|
2897
|
+
<slot></slot>
|
|
2898
|
+
</a>
|
|
2899
|
+
`}};x.shadowRootOptions={...Se.shadowRootOptions,delegatesFocus:!0},x.styles=[X,Fe],b([L({type:Boolean,reflect:!0})],x.prototype,"autofocus",2),b([L({reflect:!0})],x.prototype,"variant",2),b([L({type:Boolean,reflect:!0})],x.prototype,"small",2),b([L({reflect:!0})],x.prototype,"href",2),b([L({type:Boolean,reflect:!0})],x.prototype,"disabled",2),b([L({reflect:!0})],x.prototype,"target",2),b([L({reflect:!0})],x.prototype,"rel",2),b([L({attribute:"full-width",type:Boolean,reflect:!0})],x.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",x);import{ifDefined as ne}from"lit/directives/if-defined.js";var Ve=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var $e=JSON.parse('{"button.aria.loading":["Loading..."]}');var Te=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Ie=JSON.parse('{"button.aria.loading":["Laster..."]}');var Pe=JSON.parse('{"button.aria.loading":["Laddar ..."]}');var Oe=["primary","secondary","negative","negativeQuiet","utility","pill","link","quiet","utilityQuiet","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],D,u=class extends fe(Ae){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,D,null);_e($e,Ie,Te,Ve,Pe),this.ariaValueTextLoading=_.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(!Oe.includes(r))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2900
|
+
${Oe.join(", ")}.`);ue(this,D,this.value)}closestWithId(r){let t=this.shadowRoot,a=null;try{for(;t;){if(a=t.getElementById(r),a)return a;t=t.getRootNode().host?.getRootNode()}}catch{}return document.getElementById(r)}firstUpdated(){this.autofocus&&!this.href&&setTimeout(()=>this.focus(),0),this.buttonEl&&this.commandfor&&(this.buttonEl.commandForElement=this.closestWithId(this.commandfor))}_handleButtonClick(){this.type==="submit"?this.internals.form.requestSubmit():this.type==="reset"&&this.internals.form.reset()}resetFormControl(){this.value=de(this,D)}render(){let r=this.variant||"secondary";return Z` ${this.href?Z`
|
|
2951
2901
|
<w-link
|
|
2952
2902
|
href=${this.href}
|
|
2953
2903
|
target=${this.target}
|
|
@@ -2964,8 +2914,11 @@ ${Le.join(", ")}.`);ne(this,q,this.value)}firstUpdated(){this.autofocus&&!this.h
|
|
|
2964
2914
|
`:Z`
|
|
2965
2915
|
<button
|
|
2966
2916
|
type=${this.type||"button"}
|
|
2967
|
-
|
|
2917
|
+
part="base"
|
|
2918
|
+
class=${ne(this.buttonClass)}
|
|
2968
2919
|
@click="${this._handleButtonClick}"
|
|
2920
|
+
commandfor=${ne(this.commandfor)}
|
|
2921
|
+
command=${ne(this.command)}
|
|
2969
2922
|
>
|
|
2970
2923
|
<slot></slot>
|
|
2971
2924
|
</button>
|
|
@@ -2975,5 +2928,5 @@ ${Le.join(", ")}.`);ne(this,q,this.value)}firstUpdated(){this.autofocus&&!this.h
|
|
|
2975
2928
|
role="progressbar"
|
|
2976
2929
|
aria-valuenow="{0}"
|
|
2977
2930
|
aria-valuetext=${this.ariaValueTextLoading}
|
|
2978
|
-
></span>`:
|
|
2931
|
+
></span>`:nr}`}};D=new WeakMap,u.styles=[X,Me],u.shadowRootOptions={...Ae.shadowRootOptions,delegatesFocus:!0},b([w({reflect:!0})],u.prototype,"type",2),b([w({type:Boolean,reflect:!0})],u.prototype,"autofocus",2),b([w({reflect:!0})],u.prototype,"variant",2),b([w({type:Boolean,reflect:!0})],u.prototype,"quiet",2),b([w({type:Boolean,reflect:!0,attribute:"icon-only"})],u.prototype,"iconOnly",2),b([w({type:Boolean,reflect:!0})],u.prototype,"small",2),b([w({type:Boolean,reflect:!0})],u.prototype,"loading",2),b([w({reflect:!0})],u.prototype,"href",2),b([w({reflect:!0})],u.prototype,"target",2),b([w({type:Boolean,reflect:!0})],u.prototype,"disabled",2),b([w({reflect:!0})],u.prototype,"rel",2),b([w({attribute:"full-width",type:Boolean,reflect:!0})],u.prototype,"fullWidth",2),b([w({attribute:"button-class",reflect:!0})],u.prototype,"buttonClass",2),b([w({reflect:!0})],u.prototype,"name",2),b([w({reflect:!0})],u.prototype,"value",2),b([w()],u.prototype,"commandfor",2),b([w()],u.prototype,"command",2),b([sr("button")],u.prototype,"buttonEl",2);customElements.get("w-button")||customElements.define("w-button",u);export{u as WarpButton};
|
|
2979
2932
|
//# sourceMappingURL=button.js.map
|