@warp-ds/elements 2.10.0-next.17 → 2.10.0-next.19
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 +285 -159
- package/dist/docs/affix/affix.md +117 -0
- package/dist/docs/affix/styling.md +107 -0
- package/dist/docs/breadcrumb-item/api.md +27 -0
- package/dist/docs/breadcrumb-item/breadcrumb-item.md +34 -0
- package/dist/docs/breadcrumbs/accessibility.md +8 -18
- package/dist/docs/breadcrumbs/breadcrumbs.md +120 -34
- package/dist/docs/breadcrumbs/examples.md +8 -8
- package/dist/docs/breadcrumbs/styling.md +96 -0
- package/dist/docs/breadcrumbs/usage.md +8 -8
- package/dist/docs/index.md +2 -1
- package/dist/docs/select/select.md +91 -0
- package/dist/docs/select/styling.md +91 -0
- package/dist/docs/textarea/styling.md +91 -0
- package/dist/docs/textarea/textarea.md +91 -0
- package/dist/docs/textfield/api.md +8 -0
- package/dist/docs/textfield/styling.md +95 -0
- package/dist/docs/textfield/textfield.md +103 -0
- package/dist/index.d.ts +175 -64
- package/dist/packages/affix/affix-styles.d.ts +8 -0
- package/dist/packages/affix/affix-styles.js +108 -0
- package/dist/packages/affix/affix.d.ts +11 -8
- package/dist/packages/affix/affix.js +118 -17
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/affix/affix.react.stories.d.ts +1 -1
- package/dist/packages/affix/react.d.ts +1 -1
- package/dist/packages/alert/alert.js.map +1 -1
- package/dist/packages/attention/attention.js.map +1 -1
- package/dist/packages/breadcrumb-item/breadcrumb-item.d.ts +29 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.js +2529 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.js.map +7 -0
- package/dist/packages/breadcrumb-item/react.d.ts +2 -0
- package/dist/packages/breadcrumb-item/react.js +11 -0
- package/dist/packages/breadcrumb-item/styles.d.ts +4 -0
- package/dist/packages/breadcrumb-item/styles.js +81 -0
- package/dist/packages/breadcrumbs/breadcrumbs.d.ts +2 -0
- package/dist/packages/breadcrumbs/breadcrumbs.js +11 -13
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +11 -10
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +4 -5
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +14 -11
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/checkbox-group/react.d.ts +1 -1
- package/dist/packages/combobox/combobox.react.stories.d.ts +2 -2
- package/dist/packages/combobox/react.d.ts +1 -1
- package/dist/packages/datepicker/datepicker.js.map +1 -1
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +2 -2
- package/dist/packages/datepicker/react.d.ts +1 -1
- package/dist/packages/expandable/expandable.js.map +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +1 -1
- package/dist/packages/icon/icon.react.stories.d.ts +2 -1
- package/dist/packages/icon/icon.react.stories.js +1 -1
- package/dist/packages/modal-header/modal-header.js.map +1 -1
- package/dist/packages/pagination/pagination.js.map +1 -1
- package/dist/packages/pagination/pagination.react.stories.d.ts +2 -2
- package/dist/packages/pagination/react.d.ts +1 -1
- package/dist/packages/pill/pill.js.map +1 -1
- package/dist/packages/radio-group/react.d.ts +1 -1
- package/dist/packages/select/input-styles.d.ts +11 -0
- package/dist/packages/select/input-styles.js +88 -0
- package/dist/packages/select/react.d.ts +1 -1
- package/dist/packages/select/select.js +96 -19
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/select/select.react.stories.d.ts +2 -2
- package/dist/packages/slider/react.d.ts +1 -1
- package/dist/packages/slider/slider.react.stories.d.ts +1 -1
- package/dist/packages/slider-thumb/react.d.ts +1 -1
- package/dist/packages/snackbar/snackbar.d.ts +2 -2
- package/dist/packages/snackbar/snackbar.js +1 -1
- package/dist/packages/snackbar/snackbar.js.map +2 -2
- package/dist/packages/step/step.js.map +1 -1
- package/dist/packages/textarea/input-styles.d.ts +11 -0
- package/dist/packages/textarea/input-styles.js +88 -0
- package/dist/packages/textarea/react.d.ts +1 -1
- package/dist/packages/textarea/textarea.js +99 -20
- package/dist/packages/textarea/textarea.js.map +4 -4
- package/dist/packages/textarea/textarea.react.stories.d.ts +2 -2
- package/dist/packages/textfield/input-styles.d.ts +11 -0
- package/dist/packages/textfield/input-styles.js +88 -0
- package/dist/packages/textfield/locales/da/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/da/messages.mjs +1 -0
- package/dist/packages/textfield/locales/en/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/en/messages.mjs +1 -0
- package/dist/packages/textfield/locales/fi/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/fi/messages.mjs +1 -0
- package/dist/packages/textfield/locales/nb/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/nb/messages.mjs +1 -0
- package/dist/packages/textfield/locales/sv/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/sv/messages.mjs +1 -0
- package/dist/packages/textfield/react.d.ts +1 -1
- package/dist/packages/textfield/textfield.d.ts +11 -1
- package/dist/packages/textfield/textfield.js +111 -24
- package/dist/packages/textfield/textfield.js.map +4 -4
- package/dist/packages/textfield/textfield.react.stories.d.ts +2 -2
- package/dist/packages/toast/styles.js +1 -1
- package/dist/packages/toast/toast.js +7 -7
- package/dist/packages/toast/toast.js.map +2 -2
- package/dist/packages/toast-container/toast-container.js +8 -8
- package/dist/packages/toast-container/toast-container.js.map +3 -3
- package/dist/web-types.json +96 -50
- package/eik/index.js +20 -20
- package/package.json +8 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var me=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ve(e,r):e,d=t.length-1,s;d>=0;d--)(s=t[d])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&me(e,r,a),a};var B=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?B.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var F=t=>typeof t=="string",fe=t=>typeof t=="function",te=new Map,ie="en";function q(t){return[...Array.isArray(t)?t:[t],ie]}function K(t,e,r){let o=q(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return N(()=>O("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(F(e)?new Date(e):e)}function we(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return K(t,e,o)}function G(t,e,r){let o=q(t);return N(()=>O("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function ae(t,e,r,{offset:o=0,...a}){let d=q(t),s=e?N(()=>O("plural-ordinal",d),()=>new Intl.PluralRules(d,{type:"ordinal"})):N(()=>O("plural-cardinal",d),()=>new Intl.PluralRules(d,{type:"cardinal"}));return a[r]??a[s.select(r-o)]??a.other}function N(t,e){let r=t(),o=te.get(r);return o||(o=e(),te.set(r,o)),o}function O(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var ne=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,se=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),le="%__lingui_octothorpe__%",xe=(t,e,r={})=>{let o=e||t,a=s=>typeof s=="object"?s:r[s],d=(s,n)=>{let b=Object.keys(r).length?a("number"):void 0,g=G(o,s,b);return n.replace(new RegExp(le,"g"),g)};return{plural:(s,n)=>{let{offset:b=0}=n,g=ae(o,!1,s,n);return d(s-b,g)},selectordinal:(s,n)=>{let{offset:b=0}=n,g=ae(o,!0,s,n);return d(s-b,g)},select:ke,number:(s,n)=>G(o,s,a(n)||{style:n}),date:(s,n)=>K(o,s,a(n)||n),time:(s,n)=>we(o,s,a(n)||n)}},ke=(t,e)=>e[t]??e.other;function ye(t,e,r){return(o={},a)=>{let d=xe(e,r,a),s=(b,g=!1)=>Array.isArray(b)?b.reduce((y,_)=>{if(_==="#"&&g)return y+le;if(F(_))return y+_;let[P,v,z]=_,C={};v==="plural"||v==="selectordinal"||v==="select"?Object.entries(z).forEach(([M,T])=>{C[M]=s(T,v==="plural"||v==="selectordinal")}):C=z;let m;if(v){let M=d[v];m=M(o[P],C)}else m=o[P];return m==null?y:y+m},""):b,n=s(t);return F(n)&&ne.test(n)?se(n):F(n)?n:n?String(n):""}}var _e=Object.defineProperty,ze=(t,e,r)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ce=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r),U=class{constructor(){Ce(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Fe=Object.defineProperty,Ee=(t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e,r)=>(Ee(t,typeof e!="symbol"?e+"":e,r),r),H=class extends U{constructor(e){super(),L(this,"_locale",""),L(this,"_locales"),L(this,"_localeData",{}),L(this,"_messages",{}),L(this,"_missing"),L(this,"_messageCompiler"),L(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??ie,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 o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o?.message;e||(e=""),F(e)||(r=e.values||r,a=e.message,e=e.id);let d=this.messages[e],s=d===void 0,n=this._missing;if(n&&s)return fe(n)?n(this._locale,e):n;s&&this.emit("missing",{id:e,locale:this._locale});let b=d||a||e;return F(b)&&(this._messageCompiler?b=this._messageCompiler(b):console.warn(`Uncompiled message detected! Message:
|
|
1
|
+
var me=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ve(e,r):e,d=t.length-1,s;d>=0;d--)(s=t[d])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&me(e,r,a),a};var U=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?U.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var c=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},h=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function te(t){var e,r,o,a,d,s,n,p,g,y,_,P,v,z,C,m,M,T,X;class ge extends t{constructor(...i){var l,b,u;super(...i),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),d.set(this,void 0),s.set(this,void 0),n.set(this,!0),g.set(this,""),y.set(this,()=>{h(this,a,!0,"f"),h(this,r,!0,"f"),c(this,e,"m",m).call(this)}),_.set(this,()=>{h(this,r,!1,"f"),c(this,e,"m",M).call(this,this.shouldFormValueUpdate()?c(this,g,"f"):""),!this.validity.valid&&c(this,a,"f")&&h(this,o,!0,"f");let x=c(this,e,"m",m).call(this);this.validationMessageCallback&&this.validationMessageCallback(x?this.internals.validationMessage:"")}),P.set(this,()=>{var x;c(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),h(this,n,!1,"f")),h(this,a,!0,"f"),h(this,o,!0,"f"),c(this,e,"m",m).call(this),(x=this===null||this===void 0?void 0:this.validationMessageCallback)===null||x===void 0||x.call(this,this.showError?this.internals.validationMessage:"")}),v.set(this,void 0),z.set(this,!1),C.set(this,Promise.resolve()),(l=this.addEventListener)===null||l===void 0||l.call(this,"focus",c(this,y,"f")),(b=this.addEventListener)===null||b===void 0||b.call(this,"blur",c(this,_,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"invalid",c(this,P,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let i=this.validators.map(u=>u.attribute).flat(),l=super.observedAttributes||[];return[...new Set([...l,...i])]}static getValidator(i){return this.validators.find(l=>l.attribute===i)||null}static getValidators(i){return this.validators.filter(l=>{var b;if(l.attribute===i||!((b=l.attribute)===null||b===void 0)&&b.includes(i))return!0})}get form(){return this.internals.form}get showError(){return c(this,e,"m",m).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(i,l,b){var u;(u=super.attributeChangedCallback)===null||u===void 0||u.call(this,i,l,b);let j=this.constructor.getValidators(i);j?.length&&this.validationTarget&&this.setValue(c(this,g,"f"))}setValue(i){var l;h(this,o,!1,"f"),(l=this.validationMessageCallback)===null||l===void 0||l.call(this,""),h(this,g,i,"f");let u=this.shouldFormValueUpdate()?i:null;this.internals.setFormValue(u),c(this,e,"m",M).call(this,u),this.valueChangedCallback&&this.valueChangedCallback(u),c(this,e,"m",m).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(i=>i(c(this,C,"f")))}formResetCallback(){var i,l;h(this,a,!1,"f"),h(this,o,!1,"f"),c(this,e,"m",m).call(this),(i=this.resetFormControl)===null||i===void 0||i.call(this),(l=this.validationMessageCallback)===null||l===void 0||l.call(this,c(this,e,"m",m).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,d=new WeakMap,s=new WeakMap,n=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakMap,P=new WeakMap,v=new WeakMap,z=new WeakMap,C=new WeakMap,e=new WeakSet,p=function(){let i=this.getRootNode(),l=`${this.localName}[name="${this.getAttribute("name")}"]`;return i.querySelectorAll(l)},m=function(){if(this.hasAttribute("disabled"))return!1;let i=c(this,o,"f")||c(this,a,"f")&&!this.validity.valid&&!c(this,r,"f");return i&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),i},M=function(i){let l=this.constructor,b={},u=l.validators,x=[],j=u.some(f=>f.isValid instanceof Promise);c(this,z,"f")||(h(this,C,new Promise(f=>{h(this,v,f,"f")}),"f"),h(this,z,!0,"f")),c(this,d,"f")&&(c(this,d,"f").abort(),h(this,s,c(this,d,"f"),"f"));let $=new AbortController;h(this,d,$,"f");let Y,oe=!1;u.length&&(u.forEach(f=>{let Z=f.key||"customError",S=f.isValid(this,i,$.signal);S instanceof Promise?(x.push(S),S.then(G=>{G!=null&&(b[Z]=!G,Y=c(this,e,"m",X).call(this,f,i),c(this,e,"m",T).call(this,b,Y))})):(b[Z]=!S,this.validity[Z]!==!S&&(oe=!0),!S&&!Y&&(Y=c(this,e,"m",X).call(this,f,i)))}),Promise.allSettled(x).then(()=>{var f;$?.signal.aborted||(h(this,z,!1,"f"),(f=c(this,v,"f"))===null||f===void 0||f.call(this))}),(oe||!j)&&c(this,e,"m",T).call(this,b,Y))},T=function(i,l){if(this.validationTarget)this.internals.setValidity(i,l,this.validationTarget),h(this,n,!1,"f");else{if(this.internals.setValidity(i,l),this.internals.validity.valid)return;h(this,n,!0,"f")}},X=function(i,l){if(this.validityCallback){let b=this.validityCallback(i.key||"customError");if(b)return b}return i.message instanceof Function?i.message(this,l):i.message},ge}var F=t=>typeof t=="string",fe=t=>typeof t=="function",ae=new Map,ne="en";function q(t){return[...Array.isArray(t)?t:[t],ne]}function K(t,e,r){let o=q(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return N(()=>O("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(F(e)?new Date(e):e)}function we(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return K(t,e,o)}function B(t,e,r){let o=q(t);return N(()=>O("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function ie(t,e,r,{offset:o=0,...a}){let d=q(t),s=e?N(()=>O("plural-ordinal",d),()=>new Intl.PluralRules(d,{type:"ordinal"})):N(()=>O("plural-cardinal",d),()=>new Intl.PluralRules(d,{type:"cardinal"}));return a[r]??a[s.select(r-o)]??a.other}function N(t,e){let r=t(),o=ae.get(r);return o||(o=e(),ae.set(r,o)),o}function O(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var se=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,le=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),ce="%__lingui_octothorpe__%",xe=(t,e,r={})=>{let o=e||t,a=s=>typeof s=="object"?s:r[s],d=(s,n)=>{let p=Object.keys(r).length?a("number"):void 0,g=B(o,s,p);return n.replace(new RegExp(ce,"g"),g)};return{plural:(s,n)=>{let{offset:p=0}=n,g=ie(o,!1,s,n);return d(s-p,g)},selectordinal:(s,n)=>{let{offset:p=0}=n,g=ie(o,!0,s,n);return d(s-p,g)},select:ke,number:(s,n)=>B(o,s,a(n)||{style:n}),date:(s,n)=>K(o,s,a(n)||n),time:(s,n)=>we(o,s,a(n)||n)}},ke=(t,e)=>e[t]??e.other;function ye(t,e,r){return(o={},a)=>{let d=xe(e,r,a),s=(p,g=!1)=>Array.isArray(p)?p.reduce((y,_)=>{if(_==="#"&&g)return y+ce;if(F(_))return y+_;let[P,v,z]=_,C={};v==="plural"||v==="selectordinal"||v==="select"?Object.entries(z).forEach(([M,T])=>{C[M]=s(T,v==="plural"||v==="selectordinal")}):C=z;let m;if(v){let M=d[v];m=M(o[P],C)}else m=o[P];return m==null?y:y+m},""):p,n=s(t);return F(n)&&se.test(n)?le(n):F(n)?n:n?String(n):""}}var _e=Object.defineProperty,ze=(t,e,r)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ce=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r),W=class{constructor(){Ce(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Fe=Object.defineProperty,Ee=(t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e,r)=>(Ee(t,typeof e!="symbol"?e+"":e,r),r),H=class extends W{constructor(e){super(),L(this,"_locale",""),L(this,"_locales"),L(this,"_localeData",{}),L(this,"_messages",{}),L(this,"_missing"),L(this,"_messageCompiler"),L(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??ne,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 o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o?.message;e||(e=""),F(e)||(r=e.values||r,a=e.message,e=e.id);let d=this.messages[e],s=d===void 0,n=this._missing;if(n&&s)return fe(n)?n(this._locale,e):n;s&&this.emit("missing",{id:e,locale:this._locale});let p=d||a||e;return F(p)&&(this._messageCompiler?p=this._messageCompiler(p):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
|
-
> ${
|
|
3
|
+
> ${p}
|
|
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
|
-
`)),F(
|
|
9
|
+
`)),F(p)&&se.test(p)?le(p):F(p)?p:ye(p,this._locale,this._locales)(r,o?.formats)}date(e,r){return K(this._locales||this._locale,e,r)}number(e,r){return B(this._locales||this._locale,e,r)}};function Me(t={}){return new H(t)}var J=Me();import{html as A,LitElement as Xe}from"lit";import{property as D}from"lit/decorators.js";var Le=["en","nb","fi","da","sv"],Q="en",I=t=>Le.find(e=>t===e||t.toLowerCase().includes(e))||Q;function R(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return I(t)}try{let t=de(document);if(t)return I(t);let e=Se();if(e)return I(e);let r=de(Pe());return r?I(r):Q}catch(t){return console.warn("could not detect locale, falling back to source locale",t),Q}}function Pe(){try{return window.parent?.document??null}catch{return null}}function de(t){try{return t?.documentElement?.lang??""}catch{return""}}function Se(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as Te}from"lit";import{unsafeCSS as Ve}from"lit";var pe=Te`
|
|
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
|
-
`,Je=
|
|
282
|
+
`,Je=Ve(`*, :before, :after {
|
|
283
283
|
--w-rotate: 0;
|
|
284
284
|
--w-rotate-x: 0;
|
|
285
285
|
--w-rotate-y: 0;
|
|
@@ -2445,7 +2445,106 @@ Please compile your catalog first.
|
|
|
2445
2445
|
display: none
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
`);import{
|
|
2448
|
+
`);import{css as je}from"lit";var be=je`
|
|
2449
|
+
/* Wrapper component tokens with semantic fallbacks */
|
|
2450
|
+
:host {
|
|
2451
|
+
/* Internal tokens - not part of public API */
|
|
2452
|
+
--_wrapper-bg: var(--w-c-affix-wrapper-bg, transparent);
|
|
2453
|
+
--_wrapper-border-radius: var(--w-c-affix-wrapper-border-radius, 0.4rem);
|
|
2454
|
+
--_wrapper-padding-left: var(--w-c-affix-wrapper-padding-left, 1.2rem);
|
|
2455
|
+
--_wrapper-padding-right: var(--w-c-affix-wrapper-padding-right, 1.2rem);
|
|
2456
|
+
--_wrapper-width-with-label: var(
|
|
2457
|
+
--w-c-affix-wrapper-width-with-label,
|
|
2458
|
+
max-content
|
|
2459
|
+
);
|
|
2460
|
+
--_wrapper-width-with-icon: var(--w-c-affix-wrapper-width-with-icon, 4rem);
|
|
2461
|
+
|
|
2462
|
+
/* Label tokens */
|
|
2463
|
+
--_label-color: var(--w-c-affix-label-color, var(--w-s-color-text));
|
|
2464
|
+
--_label-font-size: var(--w-c-affix-label-font-size, var(--w-font-size-xs));
|
|
2465
|
+
--_label-line-height: var(
|
|
2466
|
+
--w-c-affix-label-line-height,
|
|
2467
|
+
var(--w-line-height-xs)
|
|
2468
|
+
);
|
|
2469
|
+
--_label-font-weight: var(--w-c-affix-label-font-weight, 700);
|
|
2470
|
+
--_label-cursor: var(--w-c-affix-label-cursor, default);
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
/* Base wrapper styles (applied to all variants) */
|
|
2474
|
+
[part="wrapper"] {
|
|
2475
|
+
position: absolute;
|
|
2476
|
+
top: 0;
|
|
2477
|
+
bottom: 0;
|
|
2478
|
+
display: flex;
|
|
2479
|
+
justify-content: center;
|
|
2480
|
+
align-items: center;
|
|
2481
|
+
background-color: var(--_wrapper-bg);
|
|
2482
|
+
border-radius: var(--_wrapper-border-radius);
|
|
2483
|
+
-webkit-font-smoothing: antialiased;
|
|
2484
|
+
-moz-osx-font-smoothing: grayscale;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
/* Prefix positioning */
|
|
2488
|
+
:host([slot="prefix"]) [part="wrapper"] {
|
|
2489
|
+
left: 0;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
/* Suffix positioning */
|
|
2493
|
+
:host([slot="suffix"]) [part="wrapper"] {
|
|
2494
|
+
right: 0;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
/* Width variants */
|
|
2498
|
+
[part="wrapper"].has-label {
|
|
2499
|
+
width: var(--_wrapper-width-with-label);
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
:host([slot="prefix"]) [part="wrapper"].has-label {
|
|
2503
|
+
padding-left: var(--_wrapper-padding-left);
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
:host([slot="suffix"]) [part="wrapper"].has-label {
|
|
2507
|
+
padding-right: var(--_wrapper-padding-right);
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
[part="wrapper"].has-icon {
|
|
2511
|
+
width: var(--_wrapper-width-with-icon);
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/* Label styling */
|
|
2515
|
+
[part="label"] {
|
|
2516
|
+
display: block;
|
|
2517
|
+
position: relative;
|
|
2518
|
+
font-size: var(--_label-font-size);
|
|
2519
|
+
line-height: var(--_label-line-height);
|
|
2520
|
+
font-weight: var(--_label-font-weight);
|
|
2521
|
+
color: var(--_label-color);
|
|
2522
|
+
cursor: var(--_label-cursor);
|
|
2523
|
+
padding-bottom: 0;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
/* Button wrapper for interactive variants */
|
|
2527
|
+
button[part="wrapper"] {
|
|
2528
|
+
border: none;
|
|
2529
|
+
outline: none;
|
|
2530
|
+
cursor: pointer;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
/* Focus styles for interactive variants */
|
|
2534
|
+
button[part="wrapper"]:focus {
|
|
2535
|
+
outline: 2px solid var(--w-s-color-border-focus);
|
|
2536
|
+
outline-offset: var(--w-outline-offset, -2px);
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
button[part="wrapper"]:focus-visible {
|
|
2540
|
+
outline: 2px solid var(--w-s-color-border-focus);
|
|
2541
|
+
outline-offset: var(--w-outline-offset, -2px);
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
button[part="wrapper"]:not(:focus-visible) {
|
|
2545
|
+
outline: none;
|
|
2546
|
+
}
|
|
2547
|
+
`;import{unsafeCSS as $e}from"lit";var he=$e("*,: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}.focus\\:\\[--w-outline-offset\\:-2px\\]:focus{--w-outline-offset:-2px}.bg-transparent{background-color:#0000}.rounded-4{border-radius:4px}.block{display:block}.flex{display:flex}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-center{align-items:center}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-center{justify-content:center}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-text{color:var(--w-s-color-text)}.w-40{width:4rem}.w-max{width:max-content}.pb-0{padding-bottom:0}.pl-12{padding-left:1.2rem}.pr-12{padding-right:1.2rem}.cursor-default{cursor:default}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}");import{html as Ae,LitElement as De}from"lit";import{property as ee,state as Ne}from"lit/decorators.js";import{classMap as Oe}from"lit/directives/class-map.js";import{css as Ye}from"lit";var ue=Ye`
|
|
2449
2548
|
:host {
|
|
2450
2549
|
display: inline-block;
|
|
2451
2550
|
}
|
|
@@ -2469,16 +2568,17 @@ Please compile your catalog first.
|
|
|
2469
2568
|
.w-icon--l {
|
|
2470
2569
|
--w-icon-size: 32px;
|
|
2471
2570
|
}
|
|
2472
|
-
`;var
|
|
2473
|
-
class="${
|
|
2571
|
+
`;var re=new Map,Ie='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Re(t,e={}){let r=e.responseParser??(o=>o.text());return re.has(t)||re.set(t,fetch(t).then(r)),re.get(t)}var E=class extends De{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let o=`https://assets.finn.no/pkg/eikons/~1/${this.locale}/${r}.svg`;try{let a=await Re(o);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch{return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(Ie,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",o=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},d=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return Ae`<div
|
|
2572
|
+
class="${Oe(a)}"
|
|
2474
2573
|
style="${d}"
|
|
2475
2574
|
part="w-${o.toLowerCase()}"
|
|
2476
2575
|
>
|
|
2477
2576
|
${this.svg}
|
|
2478
|
-
</div>`}};E.styles=[ue],w([
|
|
2577
|
+
</div>`}};E.styles=[ue],w([ee({type:String,reflect:!0})],E.prototype,"name",2),w([ee({type:String,reflect:!0})],E.prototype,"size",2),w([ee({type:String,reflect:!0,useDefault:!0})],E.prototype,"locale",2),w([Ne()],E.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",E);var k=class extends te(Xe){constructor(){super(...arguments);this.ariaLabel=null;this.clear=!1;this.search=!1;this.label="";this.icon=null}get _wrapperClasses(){return U([this.label?"has-label":"has-icon"])}resetContainingTextField(r){let o=this.closest("w-textfield");o&&o.resetFormControl(),r.stopPropagation()}submitContainingForm(r){let o=this.internals.form;o&&o.submit(),r.stopPropagation()}get _searchButton(){let r=this.ariaLabel||J._({id:"affix.aria.search",message:"Search",comment:"Aria label for the search button in affix"});return A`
|
|
2479
2578
|
<button
|
|
2579
|
+
part="wrapper"
|
|
2480
2580
|
aria-label="${r}"
|
|
2481
|
-
class="${this.
|
|
2581
|
+
class="${this._wrapperClasses}"
|
|
2482
2582
|
type="submit"
|
|
2483
2583
|
@click="${this.submitContainingForm.bind(this)}"
|
|
2484
2584
|
>
|
|
@@ -2489,10 +2589,11 @@ Please compile your catalog first.
|
|
|
2489
2589
|
class="flex"
|
|
2490
2590
|
></w-icon>
|
|
2491
2591
|
</button>
|
|
2492
|
-
`}get _clearButton(){let r=this.ariaLabel||J._({id:"affix.aria.clearInput",message:"Clear input",comment:"Aria label for the clear input button in affix"});return
|
|
2592
|
+
`}get _clearButton(){let r=this.ariaLabel||J._({id:"affix.aria.clearInput",message:"Clear input",comment:"Aria label for the clear input button in affix"});return A`
|
|
2493
2593
|
<button
|
|
2594
|
+
part="wrapper"
|
|
2494
2595
|
aria-label="${r}"
|
|
2495
|
-
class="${this.
|
|
2596
|
+
class="${this._wrapperClasses}"
|
|
2496
2597
|
type="reset"
|
|
2497
2598
|
@click="${this.resetContainingTextField.bind(this)}"
|
|
2498
2599
|
>
|
|
@@ -2503,8 +2604,8 @@ Please compile your catalog first.
|
|
|
2503
2604
|
class="flex"
|
|
2504
2605
|
></w-icon>
|
|
2505
2606
|
</button>
|
|
2506
|
-
`}get _icon(){return this.icon?
|
|
2507
|
-
<div class="${this.
|
|
2607
|
+
`}get _icon(){return this.icon?A`
|
|
2608
|
+
<div part="wrapper" class="${this._wrapperClasses}">
|
|
2508
2609
|
<w-icon
|
|
2509
2610
|
name="${this.icon}"
|
|
2510
2611
|
size="small"
|
|
@@ -2512,9 +2613,9 @@ Please compile your catalog first.
|
|
|
2512
2613
|
class="flex"
|
|
2513
2614
|
></w-icon>
|
|
2514
2615
|
</div>
|
|
2515
|
-
`:""}get _text(){return
|
|
2516
|
-
<div class="${this.
|
|
2517
|
-
<span
|
|
2616
|
+
`:""}get _text(){return A`
|
|
2617
|
+
<div part="wrapper" class="${this._wrapperClasses}">
|
|
2618
|
+
<span part="label">${this.label}</span>
|
|
2518
2619
|
</div>
|
|
2519
|
-
`}get _markup(){if(this.label)return this._text;if(this.icon)return this._icon;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return
|
|
2620
|
+
`}get _markup(){if(this.label)return this._text;if(this.icon)return this._icon;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return A`${this._markup}`}};k.styles=[pe,he,be],w([D({attribute:"aria-label",reflect:!0,useDefault:!0})],k.prototype,"ariaLabel",2),w([D({type:Boolean})],k.prototype,"clear",2),w([D({type:Boolean})],k.prototype,"search",2),w([D({reflect:!0,useDefault:!0})],k.prototype,"label",2),w([D({reflect:!0,useDefault:!0})],k.prototype,"icon",2);customElements.get("w-affix")||customElements.define("w-affix",k);export{k as WarpAffix};
|
|
2520
2621
|
//# sourceMappingURL=affix.js.map
|