@warp-ds/elements 2.8.1-next.1 → 2.8.1-next.3
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 +183 -2
- package/dist/index.d.ts +21 -2
- package/dist/packages/attention/attention.js +6 -6
- package/dist/packages/attention/attention.js.map +2 -2
- package/dist/packages/box/box.js +3 -3
- package/dist/packages/box/box.js.map +2 -2
- package/dist/packages/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +2 -2
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +11 -20
- package/dist/packages/breadcrumbs/breadcrumbs.test.js +7 -0
- package/dist/packages/button/button.js +2 -2
- package/dist/packages/button/button.js.map +2 -2
- package/dist/packages/checkbox-group/checkbox-group.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.js.map +2 -2
- package/dist/packages/datepicker/datepicker.stories.js +2 -4
- package/dist/packages/icon/icon.react.stories.js +1 -1
- package/dist/packages/icon/icon.stories.js +1 -1
- package/dist/packages/link/link.js +1 -1
- package/dist/packages/link/link.js.map +2 -2
- package/dist/packages/modal/modal.js +4 -3
- package/dist/packages/modal/modal.js.map +3 -3
- package/dist/packages/modal-header/modal-header.js +1 -1
- package/dist/packages/modal-header/modal-header.js.map +2 -2
- package/dist/packages/pill/pill.js +1 -1
- package/dist/packages/pill/pill.js.map +2 -2
- package/dist/packages/select/select.a11y.test.d.ts +1 -0
- package/dist/packages/select/select.a11y.test.js +124 -0
- package/dist/packages/select/select.d.ts +7 -4
- package/dist/packages/select/select.js +21 -21
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/select/select.react.stories.d.ts +1 -1
- package/dist/packages/select/select.test.js +168 -0
- package/dist/packages/slider/slider.stories.js +14 -36
- package/dist/packages/slider-thumb/slider-thumb.js +1 -1
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/packages/tab/tab.js +1 -1
- package/dist/packages/tab/tab.js.map +2 -2
- package/dist/packages/textarea/textarea.js +9 -9
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/packages/textfield/textfield.js +1 -1
- package/dist/packages/textfield/textfield.js.map +2 -2
- package/dist/web-types.json +131 -44
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Be=Object.create;var he=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var _e=t=>{throw TypeError(t)};var Ce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Qe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ge(e))!Ke.call(t,a)&&a!==r&&he(t,a,{get:()=>e[a],enumerable:!(o=ke(e,a))||o.enumerable});return t};var We=(t,e,r)=>(r=t!=null?Be(Je(t)):{},Qe(e||!t||!t.__esModule?he(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ke(e,r):e,l=t.length-1,
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function
|
|
1
|
+
var Be=Object.create;var he=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var _e=t=>{throw TypeError(t)};var Ce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Qe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ge(e))!Ke.call(t,a)&&a!==r&&he(t,a,{get:()=>e[a],enumerable:!(o=ke(e,a))||o.enumerable});return t};var We=(t,e,r)=>(r=t!=null?Be(Je(t)):{},Qe(e||!t||!t.__esModule?he(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ke(e,r):e,l=t.length-1,s;l>=0;l--)(s=t[l])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&he(e,r,a),a};var be=(t,e,r)=>e.has(t)||_e("Cannot "+r);var V=(t,e,r)=>(be(t,e,"read from private field"),r?r.call(t):e.get(t)),I=(t,e,r)=>e.has(t)?_e("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),E=(t,e,r,o)=>(be(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),m=(t,e,r)=>(be(t,e,"access private method"),r);var ze=Ce(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.errorMessages=j.ErrorType=void 0;var U;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(U=j.ErrorType||(j.ErrorType={}));j.errorMessages=new Map([[U.MalformedUnicode,"malformed Unicode character escape sequence"],[U.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[U.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[U.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[U.EndOfString,"malformed escape sequence at end of string"]])});var Fe=Ce(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.unraw=S.errorMessages=S.ErrorType=void 0;var x=ze();Object.defineProperty(S,"ErrorType",{enumerable:!0,get:function(){return x.ErrorType}});Object.defineProperty(S,"errorMessages",{enumerable:!0,get:function(){return x.errorMessages}});function er(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function re(t,e,r){let o=er(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(x.errorMessages.get(e));return o}function rr(t){let e=re(t,x.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function Me(t,e){let r=re(t,x.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=re(e,x.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function tr(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function or(t){if(!tr(t))throw new SyntaxError(x.errorMessages.get(x.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=re(e,x.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(x.errorMessages.get(x.ErrorType.CodePointLimit)):o}}function ar(t,e=!1){if(e)throw new SyntaxError(x.errorMessages.get(x.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var ir=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function sr(t){return ir.get(t)||t}var nr=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function Ee(t,e=!1){return t.replace(nr,function(r,o,a,l,s,i,d,p,y){if(o!==void 0)return"\\";if(a!==void 0)return rr(a);if(l!==void 0)return or(l);if(s!==void 0)return Me(s,i);if(d!==void 0)return Me(d);if(p==="0")return"\0";if(p!==void 0)return ar(p,!e);if(y!==void 0)return sr(y);throw new SyntaxError(x.errorMessages.get(x.ErrorType.EndOfString))})}S.unraw=Ee;S.default=Ee});var ee=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)?ee.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var Oe=We(Fe(),1);var N=t=>typeof t=="string",lr=t=>typeof t=="function",Ve=new Map,Ae="en";function ve(t){return[...Array.isArray(t)?t:[t],Ae]}function me(t,e,r){let o=ve(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 te(()=>oe("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(N(e)?new Date(e):e)}function dr(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 me(t,e,o)}function ue(t,e,r){let o=ve(t);return te(()=>oe("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function Se(t,e,r,{offset:o=0,...a}){var i,d;let l=ve(t),s=e?te(()=>oe("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):te(()=>oe("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return(d=(i=a[r])!=null?i:a[s.select(r-o)])!=null?d:a.other}function te(t,e){let r=t(),o=Ve.get(r);return o||(o=e(),Ve.set(r,o)),o}function oe(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var Pe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ie="%__lingui_octothorpe__%",cr=(t,e,r={})=>{let o=e||t,a=s=>typeof s=="object"?s:r[s],l=(s,i)=>{let d=Object.keys(r).length?a("number"):void 0,p=ue(o,s,d);return i.replace(new RegExp(Ie,"g"),p)};return{plural:(s,i)=>{let{offset:d=0}=i,p=Se(o,!1,s,i);return l(s-d,p)},selectordinal:(s,i)=>{let{offset:d=0}=i,p=Se(o,!0,s,i);return l(s-d,p)},select:hr,number:(s,i)=>ue(o,s,a(i)||{style:i}),date:(s,i)=>me(o,s,a(i)||i),time:(s,i)=>dr(o,s,a(i)||i)}},hr=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function br(t,e,r){return(o={},a)=>{let l=cr(e,r,a),s=(d,p=!1)=>Array.isArray(d)?d.reduce((y,M)=>{if(M==="#"&&p)return y+Ie;if(N(M))return y+M;let[R,C,A]=M,P={};C==="plural"||C==="selectordinal"||C==="select"?Object.entries(A).forEach(([L,X])=>{P[L]=s(X,C==="plural"||C==="selectordinal")}):P=A;let k;if(C){let L=l[C];k=L(o[R],P)}else k=o[R];return k==null?y:y+k},""):d,i=s(t);return N(i)&&Pe.test(i)?(0,Oe.unraw)(i):N(i)?i:i?String(i):""}}var ur=Object.defineProperty,pr=(t,e,r)=>e in t?ur(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gr=(t,e,r)=>(pr(t,typeof e!="symbol"?e+"":e,r),r),pe=class{constructor(){gr(this,"_events",{})}on(e,r){var a;var o;return(a=(o=this._events)[e])!=null||(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},vr=Object.defineProperty,mr=(t,e,r)=>e in t?vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y=(t,e,r)=>(mr(t,typeof e!="symbol"?e+"":e,r),r),ge=class extends pe{constructor(e){var r;super(),Y(this,"_locale",""),Y(this,"_locales"),Y(this,"_localeData",{}),Y(this,"_messages",{}),Y(this,"_missing"),Y(this,"_messageCompiler"),Y(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:Ae,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o==null?void 0:o.message;e||(e=""),N(e)||(r=e.values||r,a=e.message,e=e.id);let l=this.messages[e],s=l===void 0,i=this._missing;if(i&&s)return lr(i)?i(this._locale,e):i;s&&this.emit("missing",{id:e,locale:this._locale});let d=l||a||e;return N(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
|
|
3
3
|
|
|
4
4
|
> ${d}
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),N(d)&&Pe.test(d)?JSON.parse(`"${d}"`):N(d)?d:br(d,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return me(this._locales||this._locale,e,r)}number(e,r){return ue(this._locales||this._locale,e,r)}};function fr(t={}){return new ge(t)}var Ne=fr();var h=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)},v=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,l,
|
|
10
|
+
`)),N(d)&&Pe.test(d)?JSON.parse(`"${d}"`):N(d)?d:br(d,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return me(this._locales||this._locale,e,r)}number(e,r){return ue(this._locales||this._locale,e,r)}};function fr(t={}){return new ge(t)}var Ne=fr();var h=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)},v=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,l,s,i,d,p,y,M,R,C,A,P,k,L,X,le;class Ze extends t{constructor(...n){var c,g,f;super(...n),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),l.set(this,void 0),s.set(this,void 0),i.set(this,!0),p.set(this,""),y.set(this,()=>{v(this,a,!0,"f"),v(this,r,!0,"f"),h(this,e,"m",k).call(this)}),M.set(this,()=>{v(this,r,!1,"f"),h(this,e,"m",L).call(this,this.shouldFormValueUpdate()?h(this,p,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,o,!0,"f");let F=h(this,e,"m",k).call(this);this.validationMessageCallback&&this.validationMessageCallback(F?this.internals.validationMessage:"")}),R.set(this,()=>{var F;h(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,i,!1,"f")),v(this,a,!0,"f"),v(this,o,!0,"f"),h(this,e,"m",k).call(this),(F=this===null||this===void 0?void 0:this.validationMessageCallback)===null||F===void 0||F.call(this,this.showError?this.internals.validationMessage:"")}),C.set(this,void 0),A.set(this,!1),P.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,y,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,M,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"invalid",h(this,R,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let n=this.validators.map(f=>f.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...n])]}static getValidator(n){return this.validators.find(c=>c.attribute===n)||null}static getValidators(n){return this.validators.filter(c=>{var g;if(c.attribute===n||!((g=c.attribute)===null||g===void 0)&&g.includes(n))return!0})}get form(){return this.internals.form}get showError(){return h(this,e,"m",k).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(n,c,g){var f;(f=super.attributeChangedCallback)===null||f===void 0||f.call(this,n,c,g);let B=this.constructor.getValidators(n);B!=null&&B.length&&this.validationTarget&&this.setValue(h(this,p,"f"))}setValue(n){var c;v(this,o,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,p,n,"f");let f=this.shouldFormValueUpdate()?n:null;this.internals.setFormValue(f),h(this,e,"m",L).call(this,f),this.valueChangedCallback&&this.valueChangedCallback(f),h(this,e,"m",k).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(n=>n(h(this,P,"f")))}formResetCallback(){var n,c;v(this,a,!1,"f"),v(this,o,!1,"f"),h(this,e,"m",k).call(this),(n=this.resetFormControl)===null||n===void 0||n.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,e,"m",k).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,s=new WeakMap,i=new WeakMap,p=new WeakMap,y=new WeakMap,M=new WeakMap,R=new WeakMap,C=new WeakMap,A=new WeakMap,P=new WeakMap,e=new WeakSet,d=function(){let n=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return n.querySelectorAll(c)},k=function(){if(this.hasAttribute("disabled"))return!1;let n=h(this,o,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,r,"f");return n&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),n},L=function(n){let c=this.constructor,g={},f=c.validators,F=[],B=f.some(z=>z.isValid instanceof Promise);h(this,A,"f")||(v(this,P,new Promise(z=>{v(this,C,z,"f")}),"f"),v(this,A,!0,"f")),h(this,l,"f")&&(h(this,l,"f").abort(),v(this,s,h(this,l,"f"),"f"));let G=new AbortController;v(this,l,G,"f");let J,ye=!1;f.length&&(f.forEach(z=>{let de=z.key||"customError",H=z.isValid(this,n,G.signal);H instanceof Promise?(F.push(H),H.then(ce=>{ce!=null&&(g[de]=!ce,J=h(this,e,"m",le).call(this,z,n),h(this,e,"m",X).call(this,g,J))})):(g[de]=!H,this.validity[de]!==!H&&(ye=!0),!H&&!J&&(J=h(this,e,"m",le).call(this,z,n)))}),Promise.allSettled(F).then(()=>{var z;G!=null&&G.signal.aborted||(v(this,A,!1,"f"),(z=h(this,C,"f"))===null||z===void 0||z.call(this))}),(ye||!B)&&h(this,e,"m",X).call(this,g,J))},X=function(n,c){if(this.validationTarget)this.internals.setValidity(n,c,this.validationTarget),v(this,i,!1,"f");else{if(this.internals.setValidity(n,c),this.internals.validity.valid)return;v(this,i,!0,"f")}},le=function(n,c){if(this.validityCallback){let g=this.validityCallback(n.key||"customError");if(g)return g}return n.message instanceof Function?n.message(this,c):n.message},Ze}import{html as ae,LitElement as He,nothing as ie}from"lit";import{property as _,query as xr,state as Ue}from"lit/decorators.js";import{ifDefined as se}from"lit/directives/if-defined.js";import{css as $e}from"lit";var Le=$e`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -2446,7 +2446,7 @@ Please compile your catalog first.
|
|
|
2446
2446
|
display: none
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
`;var je="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ye=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=je[r[t]&63];return e};function De(t=""){return`${t}${Ye()}`}import{css as wr}from"lit";var Re=wr`*,: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}.border-1{border-width:1px}.rounded-4{border-radius:4px}.caret-current{caret-color:currentColor}.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}.outline-\\[--w-s-color-border-negative\\]\\!{outline-color:var(--w-s-color-border-negative)!important}.fixed{position:fixed}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled-subtle{background-color:var(--w-s-color-background-disabled-subtle)}.s-text{color:var(--w-s-color-text)}.s-text-disabled{color:var(--w-s-color-text-disabled)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.placeholder\\:s-text-placeholder::placeholder{color:var(--w-s-color-text-placeholder)}.s-border-disabled{border-color:var(--w-s-color-border-disabled)}.s-border-negative{border-color:var(--w-s-color-border-negative)}.s-border-strong{border-color:var(--w-s-color-border-strong)}.hover\\:s-border-negative-hover:hover{border-color:var(--w-s-color-border-negative-hover)}.hover\\:s-border-strong-hover:hover{border-color:var(--w-s-color-border-strong-hover)}.active\\:s-border-selected:active{border-color:var(--w-s-color-border-selected)}.w-full{width:100%}.min-h-\\[42\\]{min-height:4.2rem}.mb-0{margin-bottom:0}.mt-4{margin-top:.4rem}.px-8{padding-left:.8rem;padding-right:.8rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.pb-4{padding-bottom:.4rem}.pl-0{padding-left:0}.pl-8{padding-left:.8rem}.pr-40{padding-right:4rem}.pl-\\[var\\(--w-prefix-width\\,_40px\\)\\]{padding-left:var(--w-prefix-width,40px)}.cursor-pointer{cursor:pointer}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.font-normal{font-weight:400}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-s{font-size:var(--w-font-size-s);line-height:var(--w-line-height-s)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-m{line-height:var(--w-line-height-m)}@media (min-width:480px){.sm\\:min-h-\\[45\\]{min-height:4.5rem}}`;var T={base:"block text-m leading-m mb-0 px-8 py-12 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] caret-current",default:"border-1 s-text s-bg s-border-strong hover:s-border-strong-hover active:s-border-selected",disabled:"border-1 s-text-disabled s-bg-disabled-subtle s-border-disabled pointer-events-none",invalid:"border-1 s-text-negative s-bg s-border-negative hover:s-border-negative-hover outline-[--w-s-color-border-negative]!",readOnly:"pl-0 bg-transparent pointer-events-none",placeholder:"placeholder:s-text-placeholder",suffix:"pr-40",prefix:"pl-[var(--w-prefix-width,_40px)]",textArea:"min-h-[42] sm:min-h-[45]",fixed:"resize-none"},qe={base:"antialiased block relative text-s font-bold pb-4 cursor-pointer s-text flex",optional:"pl-8 font-normal text-s s-text-subtle"},fe={base:"text-xs mt-4 block",color:"s-text-subtle",colorInvalid:"s-text-negative"},Q,
|
|
2449
|
+
`;var je="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ye=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=je[r[t]&63];return e};function De(t=""){return`${t}${Ye()}`}import{css as wr}from"lit";var Re=wr`*,: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}.border-1{border-width:1px}.rounded-4{border-radius:4px}.caret-current{caret-color:currentColor}.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}.outline-\\[--w-s-color-border-negative\\]\\!{outline-color:var(--w-s-color-border-negative)!important}.fixed{position:fixed}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled-subtle{background-color:var(--w-s-color-background-disabled-subtle)}.s-text{color:var(--w-s-color-text)}.s-text-disabled{color:var(--w-s-color-text-disabled)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.placeholder\\:s-text-placeholder::placeholder{color:var(--w-s-color-text-placeholder)}.s-border-disabled{border-color:var(--w-s-color-border-disabled)}.s-border-negative{border-color:var(--w-s-color-border-negative)}.s-border-strong{border-color:var(--w-s-color-border-strong)}.hover\\:s-border-negative-hover:hover{border-color:var(--w-s-color-border-negative-hover)}.hover\\:s-border-strong-hover:hover{border-color:var(--w-s-color-border-strong-hover)}.active\\:s-border-selected:active{border-color:var(--w-s-color-border-selected)}.w-full{width:100%}.min-h-\\[42\\]{min-height:4.2rem}.mb-0{margin-bottom:0}.mt-4{margin-top:.4rem}.px-8{padding-left:.8rem;padding-right:.8rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.pb-4{padding-bottom:.4rem}.pl-0{padding-left:0}.pl-8{padding-left:.8rem}.pr-40{padding-right:4rem}.pl-\\[var\\(--w-prefix-width\\,_40px\\)\\]{padding-left:var(--w-prefix-width,40px)}.cursor-pointer{cursor:pointer}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.font-normal{font-weight:400}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-s{font-size:var(--w-font-size-s);line-height:var(--w-line-height-s)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-m{line-height:var(--w-line-height-m)}@media (min-width:480px){.sm\\:min-h-\\[45\\]{min-height:4.5rem}}`;var T={base:"block text-m leading-m mb-0 px-8 py-12 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] caret-current",default:"border-1 s-text s-bg s-border-strong hover:s-border-strong-hover active:s-border-selected",disabled:"border-1 s-text-disabled s-bg-disabled-subtle s-border-disabled pointer-events-none",invalid:"border-1 s-text-negative s-bg s-border-negative hover:s-border-negative-hover outline-[--w-s-color-border-negative]!",readOnly:"pl-0 bg-transparent pointer-events-none",placeholder:"placeholder:s-text-placeholder",suffix:"pr-40",prefix:"pl-[var(--w-prefix-width,_40px)]",textArea:"min-h-[42] sm:min-h-[45]",fixed:"resize-none"},qe={base:"antialiased block relative text-s font-bold pb-4 cursor-pointer s-text flex",optional:"pl-8 font-normal text-s s-text-subtle"},fe={base:"text-xs mt-4 block",color:"s-text-subtle",colorInvalid:"s-text-negative"},Q,ne,D,q,$,b,we,K,O,Xe,W,xe,u=class extends Te(He){constructor(){super(...arguments);I(this,b);this.disabled=!1;this.invalid=!1;this.readOnly=!1;this.readonly=!1;this.required=!1;this.optional=!1;this.minHeight=Number.NEGATIVE_INFINITY;this.maxHeight=Number.POSITIVE_INFINITY;I(this,Q,null);I(this,ne,De("textarea-"));I(this,D,!1);I(this,q);I(this,$,!1);I(this,W,r=>{r.preventDefault(),E(this,$,!0),m(this,b,O).call(this)})}updated(r){r.has("value")&&this.setValue(this.value),(r.has("value")||r.has("required")||r.has("disabled"))&&m(this,b,O).call(this)}resetFormControl(){this.value=V(this,Q),E(this,$,!1),m(this,b,K).call(this),m(this,b,O).call(this)}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return m(this,b,O).call(this),this.internals.checkValidity()}reportValidity(){return E(this,$,!0),m(this,b,O).call(this),this.internals.checkValidity()}setCustomValidity(r){r?(this.internals.setValidity({customError:!0},r,this._textarea),m(this,b,we).call(this,r)):(m(this,b,K).call(this),m(this,b,O).call(this))}get _textareaStyles(){return ee([T.base,T.textArea,!!this.placeholder&&T.placeholder,!this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&T.default,this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&T.invalid,!this.invalid&&this.disabled&&!(this.readonly||this.readOnly)&&T.disabled,!this.invalid&&!this.disabled&&(this.readonly||this.readOnly)&&T.readOnly,this.maxRows&&T.fixed])}get _helptextstyles(){return ee([fe.base,this.invalid?fe.colorInvalid:fe.color])}get _helpId(){if(this.helpText)return`${this._id}__hint`}get _id(){return V(this,ne)}get _error(){if(this.invalid&&this._helpId)return this._helpId}async connectedCallback(){var r;if(super.connectedCallback(),E(this,Q,this.value),this.setValue(this.value),this.addEventListener("invalid",V(this,W)),await this.updateComplete,this.value||this.minRows){let o=(r=this.shadowRoot)==null?void 0:r.querySelector("textarea");o&&m(this,b,xe).call(this,o)}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",V(this,W))}firstUpdated(r){super.firstUpdated(r),m(this,b,O).call(this)}handler(r){let o=r.currentTarget;this.value=o.value,m(this,b,xe).call(this,o)}render(){return ae`
|
|
2450
2450
|
${this.label?ae`
|
|
2451
2451
|
<label for="${this._id}" class=${qe.base}>
|
|
2452
2452
|
${this.label}
|
|
@@ -2459,11 +2459,11 @@ Please compile your catalog first.
|
|
|
2459
2459
|
<textarea
|
|
2460
2460
|
id="${this._id}"
|
|
2461
2461
|
class="${this._textareaStyles}"
|
|
2462
|
-
name="${
|
|
2463
|
-
placeholder="${
|
|
2462
|
+
name="${se(this.name)}"
|
|
2463
|
+
placeholder="${se(this.placeholder)}"
|
|
2464
2464
|
.value="${this.value||""}"
|
|
2465
|
-
aria-describedby="${
|
|
2466
|
-
aria-errormessage="${
|
|
2465
|
+
aria-describedby="${se(this._helpId||(this.ariaDescription?"aria-description":void 0))}"
|
|
2466
|
+
aria-errormessage="${se(this._error)}"
|
|
2467
2467
|
aria-invalid=${this.invalid?"true":ie}
|
|
2468
2468
|
?disabled="${this.disabled}"
|
|
2469
2469
|
?readonly="${this.readonly||this.readOnly}"
|
|
@@ -2472,5 +2472,5 @@ Please compile your catalog first.
|
|
|
2472
2472
|
@blur="${m(this,b,Xe)}">
|
|
2473
2473
|
</textarea>
|
|
2474
2474
|
${this.helpText?ae`<div class="${this._helptextstyles}" id="${this._helpId}">${this.helpText}</div>`:ie}
|
|
2475
|
-
`}};Q=new WeakMap,
|
|
2475
|
+
`}};Q=new WeakMap,ne=new WeakMap,D=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakSet,we=function(r){V(this,D)||E(this,q,this.helpText),E(this,D,!0),this.invalid=!0,this.helpText=r},K=function(){V(this,D)&&(this.invalid=!1,this.helpText=V(this,q),E(this,q,void 0),E(this,D,!1))},O=function(){var r;if(this.disabled){this.internals.setValidity({}),m(this,b,K).call(this);return}if(this.required&&!this.value){let o=((r=this._textarea)==null?void 0:r.validationMessage)||"";this.internals.setValidity({valueMissing:!0},o,this._textarea),V(this,$)&&m(this,b,we).call(this,o);return}this.internals.setValidity({}),m(this,b,K).call(this)},Xe=function(){E(this,$,!0),m(this,b,O).call(this)},W=new WeakMap,xe=function(r){let o=getComputedStyle(r),a=Number.parseFloat(o.getPropertyValue("border-top-width")),l=Number.parseFloat(o.getPropertyValue("border-bottom-width")),s=Number.parseFloat(o.getPropertyValue("line-height")),i=Number.parseFloat(o.getPropertyValue("padding-top")),d=Number.parseFloat(o.getPropertyValue("padding-bottom")),p=i+d+l+a;this.minRows&&(this.minHeight=s*this.minRows+p),this.maxRows&&(this.maxHeight=s*this.maxRows+p);let y=r.scrollHeight+a+l,M=Math.min(this.maxHeight,Math.max(this.minHeight,y));r.style.setProperty("height",M+"px")},u.shadowRootOptions={...He.shadowRootOptions,delegatesFocus:!0},u.styles=[Le,Re],w([_({type:Boolean,reflect:!0})],u.prototype,"disabled",2),w([_({type:Boolean,reflect:!0})],u.prototype,"invalid",2),w([_({type:String,reflect:!0})],u.prototype,"label",2),w([_({type:String,reflect:!0,attribute:"help-text"})],u.prototype,"helpText",2),w([_({type:Number,reflect:!0,attribute:"maximum-rows"})],u.prototype,"maxRows",2),w([_({type:Number,reflect:!0,attribute:"minimum-rows"})],u.prototype,"minRows",2),w([_({type:String,reflect:!0})],u.prototype,"name",2),w([_({type:String,reflect:!0})],u.prototype,"placeholder",2),w([_({type:Boolean,reflect:!0,attribute:"read-only"})],u.prototype,"readOnly",2),w([_({type:Boolean,reflect:!0})],u.prototype,"readonly",2),w([_({type:Boolean,reflect:!0})],u.prototype,"required",2),w([_({type:String,reflect:!0})],u.prototype,"value",2),w([_({type:Boolean,reflect:!0})],u.prototype,"optional",2),w([Ue()],u.prototype,"minHeight",2),w([Ue()],u.prototype,"maxHeight",2),w([xr("textarea")],u.prototype,"_textarea",2);customElements.get("w-textarea")||customElements.define("w-textarea",u);export{u as WarpTextarea};
|
|
2476
2476
|
//# sourceMappingURL=textarea.js.map
|