@nuralyui/label 0.0.13 → 0.0.15

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/bundle.js ADDED
@@ -0,0 +1,158 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const t=window,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),e=new WeakMap;class o{constructor(t,i,e){if(this._$cssResult$=!0,e!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const s=this.t;if(i&&void 0===t){const i=void 0!==s&&1===s.length;i&&(t=e.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&e.set(s,t))}return t}toString(){return this.cssText}}const n=(t,...i)=>{const e=1===t.length?t[0]:i.reduce(((i,s,e)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[e+1]),t[0]);return new o(e,t,s)},l=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const s of t.cssRules)i+=s.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,s))(i)})(t):t
7
+ /**
8
+ * @license
9
+ * Copyright 2017 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */;var r;const a=window,h=a.trustedTypes,c=h?h.emptyScript:"",u=a.reactiveElementPolyfillSupport,d={toAttribute(t,i){switch(i){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},v=(t,i)=>i!==t&&(i==i||t==t),f={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:v},y="finalized";class p extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e))})),t}static createProperty(t,i=f){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const o=this[t];this[i]=e,this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty(y))return!1;this[y]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)i.unshift(l(t))}else void 0!==t&&i.push(l(t));return i}static _$Ep(t,i){const s=i.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var s;const e=null!==(s=this.shadowRoot)&&void 0!==s?s:this.attachShadow(this.constructor.shadowRootOptions);return((s,e)=>{i?s.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((i=>{const e=document.createElement("style"),o=t.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,s.appendChild(e)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$EO(t,i,s=f){var e;const o=this.constructor._$Ep(t,s);if(void 0!==o&&!0===s.reflect){const n=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:d).toAttribute(i,s.type);this._$El=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,i){var s;const e=this.constructor,o=e._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=e.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:d;this._$El=o,this[o]=n.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
12
+ /**
13
+ * @license
14
+ * Copyright 2017 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ */
17
+ var b;p[y]=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:p}),(null!==(r=a.reactiveElementVersions)&&void 0!==r?r:a.reactiveElementVersions=[]).push("1.6.3");const g=window,m=g.trustedTypes,w=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",S=`lit$${(Math.random()+"").slice(9)}$`,A="?"+S,x=`<${A}>`,E=document,_=()=>E.createComment(""),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,z="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,O=/>/g,U=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,R=/"/g,q=/^(?:script|style|textarea|title)$/i,N=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),I=new WeakMap,P=E.createTreeWalker(E,129,null,!1);function L(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(i):i}class K{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const l=t.length-1,r=this.parts,[a,h]=((t,i)=>{const s=t.length-1,e=[];let o,n=2===i?"<svg>":"",l=T;for(let i=0;i<s;i++){const s=t[i];let r,a,h=-1,c=0;for(;c<s.length&&(l.lastIndex=c,a=l.exec(s),null!==a);)c=l.lastIndex,l===T?"!--"===a[1]?l=j:void 0!==a[1]?l=O:void 0!==a[2]?(q.test(a[2])&&(o=RegExp("</"+a[2],"g")),l=U):void 0!==a[3]&&(l=U):l===U?">"===a[0]?(l=null!=o?o:T,h=-1):void 0===a[1]?h=-2:(h=l.lastIndex-a[2].length,r=a[1],l=void 0===a[3]?U:'"'===a[3]?R:M):l===R||l===M?l=U:l===j||l===O?l=T:(l=U,o=void 0);const u=l===U&&t[i+1].startsWith("/>")?" ":"";n+=l===T?s+x:h>=0?(e.push(r),s.slice(0,h)+$+s.slice(h)+S+u):s+S+(-2===h?(e.push(void 0),i):u)}return[L(t,n+(t[s]||"<?>")+(2===i?"</svg>":"")),e]})(t,i);if(this.el=K.createElement(a,s),P.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=P.nextNode())&&r.length<l;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith($)||i.startsWith(S)){const s=h[n++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+$).split(S),i=/([.?@])?(.*)/.exec(s);r.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?W:"?"===i[1]?J:"@"===i[1]?G:H})}else r.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(q.test(e.tagName)){const t=e.textContent.split(S),i=t.length-1;if(i>0){e.textContent=m?m.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],_()),P.nextNode(),r.push({type:2,index:++o});e.append(t[i],_())}}}else if(8===e.nodeType)if(e.data===A)r.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(S,t+1));)r.push({type:7,index:o}),t+=S.length-1}o++}}static createElement(t,i){const s=E.createElement("template");return s.innerHTML=t,s}}function V(t,i,s=t,e){var o,n,l,r;if(i===N)return i;let a=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const h=C(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,e)),void 0!==e?(null!==(l=(r=s)._$Co)&&void 0!==l?l:r._$Co=[])[e]=a:s._$Cl=a),void 0!==a&&(i=V(t,a._$AS(t,i.values),a,e)),i}class B{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:E).importNode(s,!0);P.currentNode=o;let n=P.nextNode(),l=0,r=0,a=e[0];for(;void 0!==a;){if(l===a.index){let i;2===a.type?i=new F(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new Q(n,this,t)),this._$AV.push(i),a=e[++r]}l!==(null==a?void 0:a.index)&&(n=P.nextNode(),l++)}return P.currentNode=E,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class F{constructor(t,i,s,e){var o;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=V(this,t,i),C(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==N&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>k(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==D&&C(this._$AH)?this._$AA.nextSibling.data=t:this.$(E.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=K.createElement(L(e.h,e.h[0]),this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new B(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=I.get(t.strings);return void 0===i&&I.set(t.strings,i=new K(t)),i}T(t){k(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new F(this.k(_()),this.k(_()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class H{constructor(t,i,s,e,o){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=V(this,t,i,0),n=!C(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const e=t;let l,r;for(t=o[0],l=0;l<o.length-1;l++)r=V(this,e[s+l],i,l),r===N&&(r=this._$AH[l]),n||(n=!C(r)||r!==this._$AH[l]),r===D?t=D:t!==D&&(t+=(null!=r?r:"")+o[l+1]),this._$AH[l]=r}n&&!e&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const Z=m?m.emptyScript:"";class J extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,Z):this.element.removeAttribute(this.name)}}class G extends H{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=V(this,t,i,0))&&void 0!==s?s:D)===N)return;const e=this._$AH,o=t===D&&e!==D||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==D&&(e===D||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t)}}const X=g.litHtmlPolyfillSupport;
18
+ /**
19
+ * @license
20
+ * Copyright 2017 Google LLC
21
+ * SPDX-License-Identifier: BSD-3-Clause
22
+ */
23
+ var Y;null==X||X(K,F),(null!==(b=g.litHtmlVersions)&&void 0!==b?b:g.litHtmlVersions=[]).push("2.8.0");const tt=window,it=tt.trustedTypes,st=it?it.createPolicy("lit-html",{createHTML:t=>t}):void 0,et="$lit$",ot=`lit$${(Math.random()+"").slice(9)}$`,nt="?"+ot,lt=`<${nt}>`,rt=document,at=()=>rt.createComment(""),ht=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ct=Array.isArray,ut="[ \t\n\f\r]",dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,ft=/>/g,yt=RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,bt=/"/g,gt=/^(?:script|style|textarea|title)$/i,mt=(t=>(i,...s)=>({_$litType$:t,strings:i,values:s}))(1),wt=Symbol.for("lit-noChange"),$t=Symbol.for("lit-nothing"),St=new WeakMap,At=rt.createTreeWalker(rt,129,null,!1);function xt(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==st?st.createHTML(i):i}const Et=(t,i)=>{const s=t.length-1,e=[];let o,n=2===i?"<svg>":"",l=dt;for(let i=0;i<s;i++){const s=t[i];let r,a,h=-1,c=0;for(;c<s.length&&(l.lastIndex=c,a=l.exec(s),null!==a);)c=l.lastIndex,l===dt?"!--"===a[1]?l=vt:void 0!==a[1]?l=ft:void 0!==a[2]?(gt.test(a[2])&&(o=RegExp("</"+a[2],"g")),l=yt):void 0!==a[3]&&(l=yt):l===yt?">"===a[0]?(l=null!=o?o:dt,h=-1):void 0===a[1]?h=-2:(h=l.lastIndex-a[2].length,r=a[1],l=void 0===a[3]?yt:'"'===a[3]?bt:pt):l===bt||l===pt?l=yt:l===vt||l===ft?l=dt:(l=yt,o=void 0);const u=l===yt&&t[i+1].startsWith("/>")?" ":"";n+=l===dt?s+lt:h>=0?(e.push(r),s.slice(0,h)+et+s.slice(h)+ot+u):s+ot+(-2===h?(e.push(void 0),i):u)}return[xt(t,n+(t[s]||"<?>")+(2===i?"</svg>":"")),e]};class _t{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const l=t.length-1,r=this.parts,[a,h]=Et(t,i);if(this.el=_t.createElement(a,s),At.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(e=At.nextNode())&&r.length<l;){if(1===e.nodeType){if(e.hasAttributes()){const t=[];for(const i of e.getAttributeNames())if(i.endsWith(et)||i.startsWith(ot)){const s=h[n++];if(t.push(i),void 0!==s){const t=e.getAttribute(s.toLowerCase()+et).split(ot),i=/([.?@])?(.*)/.exec(s);r.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?jt:"?"===i[1]?Ut:"@"===i[1]?Mt:Tt})}else r.push({type:6,index:o})}for(const i of t)e.removeAttribute(i)}if(gt.test(e.tagName)){const t=e.textContent.split(ot),i=t.length-1;if(i>0){e.textContent=it?it.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],at()),At.nextNode(),r.push({type:2,index:++o});e.append(t[i],at())}}}else if(8===e.nodeType)if(e.data===nt)r.push({type:2,index:o});else{let t=-1;for(;-1!==(t=e.data.indexOf(ot,t+1));)r.push({type:7,index:o}),t+=ot.length-1}o++}}static createElement(t,i){const s=rt.createElement("template");return s.innerHTML=t,s}}function Ct(t,i,s=t,e){var o,n,l,r;if(i===wt)return i;let a=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const h=ht(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,e)),void 0!==e?(null!==(l=(r=s)._$Co)&&void 0!==l?l:r._$Co=[])[e]=a:s._$Cl=a),void 0!==a&&(i=Ct(t,a._$AS(t,i.values),a,e)),i}class kt{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:rt).importNode(s,!0);At.currentNode=o;let n=At.nextNode(),l=0,r=0,a=e[0];for(;void 0!==a;){if(l===a.index){let i;2===a.type?i=new zt(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new Rt(n,this,t)),this._$AV.push(i),a=e[++r]}l!==(null==a?void 0:a.index)&&(n=At.nextNode(),l++)}return At.currentNode=rt,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class zt{constructor(t,i,s,e){var o;this.type=2,this._$AH=$t,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Ct(this,t,i),ht(t)?t===$t||null==t||""===t?(this._$AH!==$t&&this._$AR(),this._$AH=$t):t!==this._$AH&&t!==wt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ct(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$t&&ht(this._$AH)?this._$AA.nextSibling.data=t:this.$(rt.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=_t.createElement(xt(e.h,e.h[0]),this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new kt(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=St.get(t.strings);return void 0===i&&St.set(t.strings,i=new _t(t)),i}T(t){ct(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new zt(this.k(at()),this.k(at()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Tt{constructor(t,i,s,e,o){this.type=1,this._$AH=$t,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$t}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=Ct(this,t,i,0),n=!ht(t)||t!==this._$AH&&t!==wt,n&&(this._$AH=t);else{const e=t;let l,r;for(t=o[0],l=0;l<o.length-1;l++)r=Ct(this,e[s+l],i,l),r===wt&&(r=this._$AH[l]),n||(n=!ht(r)||r!==this._$AH[l]),r===$t?t=$t:t!==$t&&(t+=(null!=r?r:"")+o[l+1]),this._$AH[l]=r}n&&!e&&this.j(t)}j(t){t===$t?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class jt extends Tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$t?void 0:t}}const Ot=it?it.emptyScript:"";class Ut extends Tt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==$t?this.element.setAttribute(this.name,Ot):this.element.removeAttribute(this.name)}}class Mt extends Tt{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=Ct(this,t,i,0))&&void 0!==s?s:$t)===wt)return;const e=this._$AH,o=t===$t&&e!==$t||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==$t&&(e===$t||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Ct(this,t)}}const qt=tt.litHtmlPolyfillSupport;null==qt||qt(_t,zt),(null!==(Y=tt.litHtmlVersions)&&void 0!==Y?Y:tt.litHtmlVersions=[]).push("2.8.0");
24
+ /**
25
+ * @license
26
+ * Copyright 2017 Google LLC
27
+ * SPDX-License-Identifier: BSD-3-Clause
28
+ */
29
+ var Nt,Dt;class It extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const s=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=s.firstChild),s}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new zt(i.insertBefore(at(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return wt}}It.finalized=!0,It._$litElement$=!0,null===(Nt=globalThis.litElementHydrateSupport)||void 0===Nt||Nt.call(globalThis,{LitElement:It});const Pt=globalThis.litElementPolyfillSupport;null==Pt||Pt({LitElement:It}),(null!==(Dt=globalThis.litElementVersions)&&void 0!==Dt?Dt:globalThis.litElementVersions=[]).push("3.3.3");
30
+ /**
31
+ * @license
32
+ * Copyright 2017 Google LLC
33
+ * SPDX-License-Identifier: BSD-3-Clause
34
+ */
35
+ const Lt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(s){s.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(s){s.createProperty(i.key,t)}};
36
+ /**
37
+ * @license
38
+ * Copyright 2017 Google LLC
39
+ * SPDX-License-Identifier: BSD-3-Clause
40
+ */function Kt(t){return(i,s)=>void 0!==s?((t,i,s)=>{i.constructor.createProperty(s,t)})(t,i,s):Lt(t,i)
41
+ /**
42
+ * @license
43
+ * Copyright 2021 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ */}var Vt;null===(Vt=window.HTMLSlotElement)||void 0===Vt||Vt.prototype.assignedElements;var Bt=n`
46
+ ${n`
47
+ :host {
48
+ /* Typography */
49
+ --nuraly-label-local-font-family: var(--nuraly-typograpnr-label-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));
50
+ --nuraly-label-local-font-weight: var(--nuraly-typograpnr-label-font-weight, var(--nuraly-font-weight-medium, 500));
51
+ --nuraly-label-local-line-height: var(--nuraly-typograpnr-label-line-height, var(--nuraly-line-height-base, 1.5));
52
+
53
+ /* Size variants */
54
+ --nuraly-label-local-small-font-size: var(--nuraly-typograpnr-label-small-font-size, var(--nuraly-font-size-xs, 12px));
55
+ --nuraly-label-local-medium-font-size: var(--nuraly-typograpnr-label-medium-font-size, var(--nuraly-font-size-sm, 14px));
56
+ --nuraly-label-local-large-font-size: var(--nuraly-typograpnr-label-large-font-size, var(--nuraly-font-size-base, 16px));
57
+
58
+ /* Default font size */
59
+ --nuraly-label-local-font-size: var(--nuraly-label-local-medium-font-size);
60
+
61
+ /* Colors */
62
+ --nuraly-label-local-text-color: var(--nuraly-color-label-text, var(--nuraly-color-text-primary, #000000));
63
+ --nuraly-label-local-secondary-color: var(--nuraly-color-label-secondary, var(--nuraly-color-text-secondary, #666666));
64
+ --nuraly-label-local-error-color: var(--nuraly-color-label-error, var(--nuraly-color-error-500, #ff4d4f));
65
+ --nuraly-label-local-warning-color: var(--nuraly-color-label-warning, var(--nuraly-color-warning-500, #faad14));
66
+ --nuraly-label-local-success-color: var(--nuraly-color-label-success, var(--nuraly-color-success-500, #52c41a));
67
+ --nuraly-label-local-required-color: var(--nuraly-color-label-required, var(--nuraly-color-error-500, #ff4d4f));
68
+ --nuraly-label-local-disabled-color: var(--nuraly-color-label-disabled, var(--nuraly-color-text-disabled, #bfbfbf));
69
+
70
+ /* Spacing */
71
+ --nuraly-label-local-margin-bottom: var(--nuraly-spacing-label-margin-bottom, var(--nuraly-spacing-xs, 4px));
72
+ --nuraly-label-local-required-margin: var(--nuraly-spacing-label-required-margin, var(--nuraly-spacing-2xs, 2px));
73
+
74
+ /* Transitions */
75
+ --nuraly-label-local-transition-duration: var(--nuraly-transition-label-duration, var(--nuraly-transition-duration-base, 150ms));
76
+ --nuraly-label-local-transition-timing: var(--nuraly-transition-label-timing, var(--nuraly-transition-timing-ease, ease));
77
+ }
78
+ `}
79
+
80
+ :host {
81
+ display: inline-block;
82
+ width: fit-content;
83
+ }
84
+
85
+ label {
86
+ font-family: var(--nuraly-label-local-font-family);
87
+ font-size: var(--nuraly-label-local-font-size);
88
+ font-weight: var(--nuraly-label-local-font-weight);
89
+ line-height: var(--nuraly-label-local-line-height);
90
+ color: var(--nuraly-label-local-text-color);
91
+ margin: 0;
92
+ margin-bottom: var(--nuraly-label-local-margin-bottom);
93
+ display: block;
94
+ user-select: none;
95
+ cursor: pointer;
96
+ transition: color var(--nuraly-label-local-transition-duration) var(--nuraly-label-local-transition-timing);
97
+ }
98
+
99
+ /* Size variants */
100
+ :host([size="small"]) label {
101
+ font-size: var(--nuraly-label-local-small-font-size);
102
+ }
103
+
104
+ :host([size="large"]) label {
105
+ font-size: var(--nuraly-label-local-large-font-size);
106
+ }
107
+
108
+ /* Variant colors */
109
+ :host([variant="secondary"]) label {
110
+ color: var(--nuraly-label-local-secondary-color);
111
+ }
112
+
113
+ :host([variant="error"]) label {
114
+ color: var(--nuraly-label-local-error-color);
115
+ }
116
+
117
+ :host([variant="warning"]) label {
118
+ color: var(--nuraly-label-local-warning-color);
119
+ }
120
+
121
+ :host([variant="success"]) label {
122
+ color: var(--nuraly-label-local-success-color);
123
+ }
124
+
125
+ /* Disabled state */
126
+ :host([disabled]) label {
127
+ color: var(--nuraly-label-local-disabled-color);
128
+ cursor: not-allowed;
129
+ opacity: 0.6;
130
+ }
131
+
132
+ /* Required asterisk */
133
+ .required-asterisk {
134
+ color: var(--nuraly-label-local-required-color);
135
+ margin-left: var(--nuraly-label-local-required-margin);
136
+ font-weight: normal;
137
+ }
138
+
139
+ /* Focus-within for accessibility when label is associated with form elements */
140
+ :host(:focus-within) label:not([disabled]) {
141
+ opacity: 0.8;
142
+ }
143
+ `
144
+ /**
145
+ * @license
146
+ * Copyright 2023 Nuraly, Laabidi Aymen
147
+ * SPDX-License-Identifier: MIT
148
+ */;const Ft=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,i,s;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.designSystemObserver)||void 0===i||i.disconnect(),null===(s=this.mediaQuery)||void 0===s||s.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const s=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return s||((null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const i=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===i?i:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver((()=>{this.requestUpdate()})),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},Ht=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},Wt=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(Ht())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!Ht())return!0;let i=!0;for(const s of this.requiredComponents)if(!this.isComponentAvailable(s)){i=!1;const e=new Error(`Required component "${s}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(s,e):console.error(e.message)}return i}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter((t=>!this.isComponentAvailable(t)))}areDependenciesAvailable(){return this.requiredComponents.every((t=>this.isComponentAvailable(t)))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const i=this.requiredComponents.indexOf(t);i>-1&&this.requiredComponents.splice(i,1)}},Zt=t=>class extends t{dispatchCustomEvent(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,i){var s;const e=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(s=this.tagName)||void 0===s?void 0:s.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,e)}dispatchInputEvent(t,i){const s=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,s)}dispatchFocusEvent(t,i){const s=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,s)}dispatchValidationEvent(t,i){var s;const e=Object.assign({target:i.target||this,value:i.value,isValid:null!==(s=i.isValid)&&void 0!==s&&s,error:i.error},i);this.dispatchCustomEvent(t,e)}dispatchActionEvent(t,i){const s=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,s)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}};
149
+ /**
150
+ * @license
151
+ * Copyright 2023 Nuraly, Laabidi Aymen
152
+ * SPDX-License-Identifier: MIT
153
+ */var Jt=function(t,i,s,e){for(var o,n=arguments.length,l=n<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,r=t.length-1;r>=0;r--)(o=t[r])&&(l=(n<3?o(l):n>3?o(i,s,l):o(i,s))||l);return n>3&&l&&Object.defineProperty(i,s,l),l};let Gt=class extends((t=>Wt(Ft(Zt(t))))(It)){constructor(){super(...arguments),this.size="medium",this.variant="default",this.required=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.updateDataTheme()}updated(){this.updateDataTheme()}updateDataTheme(){this.closest("[data-theme]")||this.setAttribute("data-theme",this.currentTheme)}render(){return mt`
154
+ <label for=${this.for||""}>
155
+ <slot></slot>
156
+ ${this.required?mt`<span class="required-asterisk">*</span>`:""}
157
+ </label>
158
+ `}};Gt.styles=Bt,Jt([Kt({reflect:!0})],Gt.prototype,"size",void 0),Jt([Kt({reflect:!0})],Gt.prototype,"variant",void 0),Jt([Kt({type:Boolean,reflect:!0})],Gt.prototype,"required",void 0),Jt([Kt({type:Boolean,reflect:!0})],Gt.prototype,"disabled",void 0),Jt([Kt()],Gt.prototype,"for",void 0),Jt([Kt()],Gt.prototype,"value",void 0),Gt=Jt([(t=>i=>"function"==typeof i?((t,i)=>(customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:s,elements:e}=i;return{kind:s,elements:e,finisher(i){customElements.define(t,i)}}})(t,i))("nr-label")],Gt);export{Gt as HyTextLabel};
@@ -1,7 +1,18 @@
1
1
  import { LitElement } from "lit";
2
- export declare class HyTextLabel extends LitElement {
2
+ import { LabelSize, LabelVariant } from './label.types.js';
3
+ declare const HyTextLabel_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
4
+ export declare class HyTextLabel extends HyTextLabel_base {
3
5
  static styles: import("lit").CSSResult;
6
+ size: LabelSize;
7
+ variant: LabelVariant;
8
+ required: boolean;
9
+ disabled: boolean;
10
+ for?: string;
4
11
  value: string;
12
+ connectedCallback(): void;
13
+ updated(): void;
14
+ private updateDataTheme;
5
15
  render(): import("lit").TemplateResult<1>;
6
16
  }
17
+ export {};
7
18
  //# sourceMappingURL=label.component.d.ts.map
@@ -7,25 +7,58 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html, LitElement } from "lit";
8
8
  import { customElement, property } from "lit/decorators.js";
9
9
  import styles from "./label.style.js";
10
- let HyTextLabel = class HyTextLabel extends LitElement {
10
+ import { NuralyUIBaseMixin } from '@nuralyui/common/mixins';
11
+ let HyTextLabel = class HyTextLabel extends NuralyUIBaseMixin(LitElement) {
11
12
  constructor() {
12
13
  super(...arguments);
14
+ this.size = 'medium';
15
+ this.variant = 'default';
16
+ this.required = false;
17
+ this.disabled = false;
13
18
  this.value = '';
14
19
  }
20
+ connectedCallback() {
21
+ super.connectedCallback();
22
+ this.updateDataTheme();
23
+ }
24
+ updated() {
25
+ this.updateDataTheme();
26
+ }
27
+ updateDataTheme() {
28
+ if (!this.closest('[data-theme]')) {
29
+ this.setAttribute('data-theme', this.currentTheme);
30
+ }
31
+ }
15
32
  render() {
16
- return html `
17
- <label>
18
- <slot></slot>
19
- </label>
33
+ return html `
34
+ <label for=${this.for || ''}>
35
+ <slot></slot>
36
+ ${this.required ? html `<span class="required-asterisk">*</span>` : ''}
37
+ </label>
20
38
  `;
21
39
  }
22
40
  };
23
41
  HyTextLabel.styles = styles;
42
+ __decorate([
43
+ property({ reflect: true })
44
+ ], HyTextLabel.prototype, "size", void 0);
45
+ __decorate([
46
+ property({ reflect: true })
47
+ ], HyTextLabel.prototype, "variant", void 0);
48
+ __decorate([
49
+ property({ type: Boolean, reflect: true })
50
+ ], HyTextLabel.prototype, "required", void 0);
51
+ __decorate([
52
+ property({ type: Boolean, reflect: true })
53
+ ], HyTextLabel.prototype, "disabled", void 0);
54
+ __decorate([
55
+ property()
56
+ ], HyTextLabel.prototype, "for", void 0);
24
57
  __decorate([
25
58
  property()
26
59
  ], HyTextLabel.prototype, "value", void 0);
27
60
  HyTextLabel = __decorate([
28
- customElement('hy-label')
61
+ customElement('nr-label')
29
62
  ], HyTextLabel);
30
63
  export { HyTextLabel };
31
64
  //# sourceMappingURL=label.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"label.component.js","sourceRoot":"","sources":["../../../src/components/label/label.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAGtC,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IAA3C;;QAII,UAAK,GAAC,EAAE,CAAA;IAWZ,CAAC;IATY,MAAM;QAEX,OAAO,IAAI,CAAA;;;;SAIV,CAAA;IAEL,CAAC;CACJ,CAAA;AAdkB,kBAAM,GAAC,MAAM,CAAA;AAG5B;IADA,QAAQ,EAAE;0CACF;AAJC,WAAW;IADvB,aAAa,CAAC,UAAU,CAAC;GACb,WAAW,CAevB;SAfY,WAAW","sourcesContent":["import { html, LitElement } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport styles from \"./label.style.js\";\n\n@customElement('hy-label')\nexport class HyTextLabel extends LitElement{\n static override styles=styles\n\n @property()\n value=''\n\n override render(){\n\n return html` \n <label>\n <slot></slot>\n </label>\n `\n\n }\n}"]}
1
+ {"version":3,"file":"label.component.js","sourceRoot":"","sources":["../../../src/components/label/label.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAA9D;;QAII,SAAI,GAAc,QAAQ,CAAC;QAG3B,YAAO,GAAiB,SAAS,CAAC;QAGlC,aAAQ,GAAG,KAAK,CAAC;QAGjB,aAAQ,GAAG,KAAK,CAAC;QAMjB,UAAK,GAAG,EAAE,CAAC;IAyBf,CAAC;IAvBY,iBAAiB;QACtB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAEQ,OAAO;QACZ,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAEM,eAAe;QAClB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;YAC/B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;SACtD;IACL,CAAC;IAEQ,MAAM;QACX,OAAO,IAAI,CAAA;yBACM,IAAI,CAAC,GAAG,IAAI,EAAE;;kBAErB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA,0CAA0C,CAAC,CAAC,CAAC,EAAE;;SAE5E,CAAC;IACN,CAAC;CACJ,CAAA;AA3CmB,kBAAM,GAAG,MAAO,CAAA;AAGhC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACD;AAG3B;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACM;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC1B;AAGjB;IADC,QAAQ,EAAE;wCACE;AAGb;IADC,QAAQ,EAAE;0CACA;AAnBF,WAAW;IADvB,aAAa,CAAC,UAAU,CAAC;GACb,WAAW,CA4CvB;SA5CY,WAAW","sourcesContent":["import { html, LitElement } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport styles from \"./label.style.js\";\nimport { LabelSize, LabelVariant } from './label.types.js';\nimport { NuralyUIBaseMixin } from '@nuralyui/common/mixins';\n\n@customElement('nr-label')\nexport class HyTextLabel extends NuralyUIBaseMixin(LitElement) {\n static override styles = styles;\n\n @property({ reflect: true })\n size: LabelSize = 'medium';\n\n @property({ reflect: true })\n variant: LabelVariant = 'default';\n\n @property({ type: Boolean, reflect: true })\n required = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property()\n for?: string;\n\n @property()\n value = '';\n\n override connectedCallback() {\n super.connectedCallback();\n this.updateDataTheme();\n }\n\n override updated() {\n this.updateDataTheme();\n }\n\n private updateDataTheme() {\n if (!this.closest('[data-theme]')) {\n this.setAttribute('data-theme', this.currentTheme);\n }\n }\n\n override render() {\n return html`\n <label for=${this.for || ''}>\n <slot></slot>\n ${this.required ? html`<span class=\"required-asterisk\">*</span>` : ''}\n </label>\n `;\n }\n}"]}
package/label.style.js CHANGED
@@ -1,56 +1,70 @@
1
1
  import { css } from "lit";
2
+ import { styleVariables } from './label.style.variables.js';
2
3
  export default css `
3
- :host {
4
- /* Default color variables */
5
- --text-label-local-dark-color: white; /* Dark mode text color */
6
- --text-label-local-light-color: black; /* Light mode text color */
7
-
8
- /* Font size and related properties */
9
- --text-label-font-size: 13px; /* Default font size */
10
- --text-label-font-weight: normal; /* Default font weight */
11
- --text-label-line-height: 1.5; /* Default line height */
12
-
13
- /* Padding and margin */
14
- --text-label-padding: 0; /* Default padding */
15
- --text-label-margin: 0; /* Default margin */
16
-
17
- /* Use the local color variable first, then fallback to global or defined values */
18
- --resolved-text-label-color: var(--text-label-color, var( --text-label-local-color));
19
- --resolved-text-label-font-size: var(--text-label-font-size);
20
- --resolved-text-label-font-weight: var(--text-label-font-weight);
21
- --resolved-text-label-line-height: var(--text-label-line-height);
22
- --resolved-text-label-padding: var(--text-label-padding);
23
- --resolved-text-label-margin: var(--text-label-margin);
24
-
25
- display: inline-block;
26
- width: fit-content;
27
- }
28
-
29
- label {
30
- /* Apply resolved styles
31
- color: var(--resolved-text-label-color);
32
- font-size: var(--resolved-text-label-font-size);
33
- font-weight: var(--resolved-text-label-font-weight);
34
- line-height: var(--resolved-text-label-line-height);
35
- padding: var(--resolved-text-label-padding);
36
- margin: var(--resolved-text-label-margin);
37
- display: block;
38
- user-select: none;*/
39
- font-size: var(--resolved-text-label-font-size);
40
- color: var(--resolved-text-label-color);
41
- }
42
-
43
- @media (prefers-color-scheme: dark) {
44
- :host {
45
- /* Update resolved color for dark mode */
46
- --resolved-text-label-color: var(--text-label-dark-color, var(--text-label-color, var(--text-label-local-dark-color))); }
47
- }
48
-
49
- @media (prefers-color-scheme: light) {
50
- :host {
51
- --resolved-text-label-color: var(--text-label-color, var(--text-label-local-color));
52
- /* Optionally update color for light mode */
53
- }
54
- }
4
+ ${styleVariables}
5
+
6
+ :host {
7
+ display: inline-block;
8
+ width: fit-content;
9
+ }
10
+
11
+ label {
12
+ font-family: var(--nuraly-label-local-font-family);
13
+ font-size: var(--nuraly-label-local-font-size);
14
+ font-weight: var(--nuraly-label-local-font-weight);
15
+ line-height: var(--nuraly-label-local-line-height);
16
+ color: var(--nuraly-label-local-text-color);
17
+ margin: 0;
18
+ margin-bottom: var(--nuraly-label-local-margin-bottom);
19
+ display: block;
20
+ user-select: none;
21
+ cursor: pointer;
22
+ transition: color var(--nuraly-label-local-transition-duration) var(--nuraly-label-local-transition-timing);
23
+ }
24
+
25
+ /* Size variants */
26
+ :host([size="small"]) label {
27
+ font-size: var(--nuraly-label-local-small-font-size);
28
+ }
29
+
30
+ :host([size="large"]) label {
31
+ font-size: var(--nuraly-label-local-large-font-size);
32
+ }
33
+
34
+ /* Variant colors */
35
+ :host([variant="secondary"]) label {
36
+ color: var(--nuraly-label-local-secondary-color);
37
+ }
38
+
39
+ :host([variant="error"]) label {
40
+ color: var(--nuraly-label-local-error-color);
41
+ }
42
+
43
+ :host([variant="warning"]) label {
44
+ color: var(--nuraly-label-local-warning-color);
45
+ }
46
+
47
+ :host([variant="success"]) label {
48
+ color: var(--nuraly-label-local-success-color);
49
+ }
50
+
51
+ /* Disabled state */
52
+ :host([disabled]) label {
53
+ color: var(--nuraly-label-local-disabled-color);
54
+ cursor: not-allowed;
55
+ opacity: 0.6;
56
+ }
57
+
58
+ /* Required asterisk */
59
+ .required-asterisk {
60
+ color: var(--nuraly-label-local-required-color);
61
+ margin-left: var(--nuraly-label-local-required-margin);
62
+ font-weight: normal;
63
+ }
64
+
65
+ /* Focus-within for accessibility when label is associated with form elements */
66
+ :host(:focus-within) label:not([disabled]) {
67
+ opacity: 0.8;
68
+ }
55
69
  `;
56
70
  //# sourceMappingURL=label.style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"label.style.js","sourceRoot":"","sources":["../../../src/components/label/label.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDjB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport default css`\n :host {\n /* Default color variables */\n --text-label-local-dark-color: white; /* Dark mode text color */\n --text-label-local-light-color: black; /* Light mode text color */\n\n /* Font size and related properties */\n --text-label-font-size: 13px; /* Default font size */\n --text-label-font-weight: normal; /* Default font weight */\n --text-label-line-height: 1.5; /* Default line height */\n\n /* Padding and margin */\n --text-label-padding: 0; /* Default padding */\n --text-label-margin: 0; /* Default margin */\n\n /* Use the local color variable first, then fallback to global or defined values */\n --resolved-text-label-color: var(--text-label-color, var( --text-label-local-color));\n --resolved-text-label-font-size: var(--text-label-font-size);\n --resolved-text-label-font-weight: var(--text-label-font-weight);\n --resolved-text-label-line-height: var(--text-label-line-height);\n --resolved-text-label-padding: var(--text-label-padding);\n --resolved-text-label-margin: var(--text-label-margin);\n\n display: inline-block;\n width: fit-content;\n }\n\n label {\n /* Apply resolved styles \n color: var(--resolved-text-label-color);\n font-size: var(--resolved-text-label-font-size);\n font-weight: var(--resolved-text-label-font-weight);\n line-height: var(--resolved-text-label-line-height);\n padding: var(--resolved-text-label-padding);\n margin: var(--resolved-text-label-margin);\n display: block;\n user-select: none;*/\n font-size: var(--resolved-text-label-font-size);\n color: var(--resolved-text-label-color);\n }\n\n @media (prefers-color-scheme: dark) {\n :host {\n /* Update resolved color for dark mode */\n --resolved-text-label-color: var(--text-label-dark-color, var(--text-label-color, var(--text-label-local-dark-color))); }\n }\n\n @media (prefers-color-scheme: light) {\n :host {\n --resolved-text-label-color: var(--text-label-color, var(--text-label-local-color));\n /* Optionally update color for light mode */\n }\n }\n`;"]}
1
+ {"version":3,"file":"label.style.js","sourceRoot":"","sources":["../../../src/components/label/label.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,eAAe,GAAG,CAAA;IACd,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEjB,CAAC","sourcesContent":["import { css } from \"lit\";\nimport { styleVariables } from './label.style.variables.js';\n\nexport default css`\n ${styleVariables}\n\n :host {\n display: inline-block;\n width: fit-content;\n }\n\n label {\n font-family: var(--nuraly-label-local-font-family);\n font-size: var(--nuraly-label-local-font-size);\n font-weight: var(--nuraly-label-local-font-weight);\n line-height: var(--nuraly-label-local-line-height);\n color: var(--nuraly-label-local-text-color);\n margin: 0;\n margin-bottom: var(--nuraly-label-local-margin-bottom);\n display: block;\n user-select: none;\n cursor: pointer;\n transition: color var(--nuraly-label-local-transition-duration) var(--nuraly-label-local-transition-timing);\n }\n\n /* Size variants */\n :host([size=\"small\"]) label {\n font-size: var(--nuraly-label-local-small-font-size);\n }\n\n :host([size=\"large\"]) label {\n font-size: var(--nuraly-label-local-large-font-size);\n }\n\n /* Variant colors */\n :host([variant=\"secondary\"]) label {\n color: var(--nuraly-label-local-secondary-color);\n }\n\n :host([variant=\"error\"]) label {\n color: var(--nuraly-label-local-error-color);\n }\n\n :host([variant=\"warning\"]) label {\n color: var(--nuraly-label-local-warning-color);\n }\n\n :host([variant=\"success\"]) label {\n color: var(--nuraly-label-local-success-color);\n }\n\n /* Disabled state */\n :host([disabled]) label {\n color: var(--nuraly-label-local-disabled-color);\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Required asterisk */\n .required-asterisk {\n color: var(--nuraly-label-local-required-color);\n margin-left: var(--nuraly-label-local-required-margin);\n font-weight: normal;\n }\n\n /* Focus-within for accessibility when label is associated with form elements */\n :host(:focus-within) label:not([disabled]) {\n opacity: 0.8;\n }\n`;"]}
@@ -0,0 +1,2 @@
1
+ export declare const styleVariables: import("lit").CSSResult;
2
+ //# sourceMappingURL=label.style.variables.d.ts.map
@@ -0,0 +1,35 @@
1
+ import { css } from 'lit';
2
+ export const styleVariables = css `
3
+ :host {
4
+ /* Typography */
5
+ --nuraly-label-local-font-family: var(--nuraly-typograpnr-label-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));
6
+ --nuraly-label-local-font-weight: var(--nuraly-typograpnr-label-font-weight, var(--nuraly-font-weight-medium, 500));
7
+ --nuraly-label-local-line-height: var(--nuraly-typograpnr-label-line-height, var(--nuraly-line-height-base, 1.5));
8
+
9
+ /* Size variants */
10
+ --nuraly-label-local-small-font-size: var(--nuraly-typograpnr-label-small-font-size, var(--nuraly-font-size-xs, 12px));
11
+ --nuraly-label-local-medium-font-size: var(--nuraly-typograpnr-label-medium-font-size, var(--nuraly-font-size-sm, 14px));
12
+ --nuraly-label-local-large-font-size: var(--nuraly-typograpnr-label-large-font-size, var(--nuraly-font-size-base, 16px));
13
+
14
+ /* Default font size */
15
+ --nuraly-label-local-font-size: var(--nuraly-label-local-medium-font-size);
16
+
17
+ /* Colors */
18
+ --nuraly-label-local-text-color: var(--nuraly-color-label-text, var(--nuraly-color-text-primary, #000000));
19
+ --nuraly-label-local-secondary-color: var(--nuraly-color-label-secondary, var(--nuraly-color-text-secondary, #666666));
20
+ --nuraly-label-local-error-color: var(--nuraly-color-label-error, var(--nuraly-color-error-500, #ff4d4f));
21
+ --nuraly-label-local-warning-color: var(--nuraly-color-label-warning, var(--nuraly-color-warning-500, #faad14));
22
+ --nuraly-label-local-success-color: var(--nuraly-color-label-success, var(--nuraly-color-success-500, #52c41a));
23
+ --nuraly-label-local-required-color: var(--nuraly-color-label-required, var(--nuraly-color-error-500, #ff4d4f));
24
+ --nuraly-label-local-disabled-color: var(--nuraly-color-label-disabled, var(--nuraly-color-text-disabled, #bfbfbf));
25
+
26
+ /* Spacing */
27
+ --nuraly-label-local-margin-bottom: var(--nuraly-spacing-label-margin-bottom, var(--nuraly-spacing-xs, 4px));
28
+ --nuraly-label-local-required-margin: var(--nuraly-spacing-label-required-margin, var(--nuraly-spacing-2xs, 2px));
29
+
30
+ /* Transitions */
31
+ --nuraly-label-local-transition-duration: var(--nuraly-transition-label-duration, var(--nuraly-transition-duration-base, 150ms));
32
+ --nuraly-label-local-transition-timing: var(--nuraly-transition-label-timing, var(--nuraly-transition-timing-ease, ease));
33
+ }
34
+ `;
35
+ //# sourceMappingURL=label.style.variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.style.variables.js","sourceRoot":"","sources":["../../../src/components/label/label.style.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgChC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styleVariables = css`\n :host {\n /* Typography */\n --nuraly-label-local-font-family: var(--nuraly-typograpnr-label-font-family, var(--nuraly-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif));\n --nuraly-label-local-font-weight: var(--nuraly-typograpnr-label-font-weight, var(--nuraly-font-weight-medium, 500));\n --nuraly-label-local-line-height: var(--nuraly-typograpnr-label-line-height, var(--nuraly-line-height-base, 1.5));\n\n /* Size variants */\n --nuraly-label-local-small-font-size: var(--nuraly-typograpnr-label-small-font-size, var(--nuraly-font-size-xs, 12px));\n --nuraly-label-local-medium-font-size: var(--nuraly-typograpnr-label-medium-font-size, var(--nuraly-font-size-sm, 14px));\n --nuraly-label-local-large-font-size: var(--nuraly-typograpnr-label-large-font-size, var(--nuraly-font-size-base, 16px));\n\n /* Default font size */\n --nuraly-label-local-font-size: var(--nuraly-label-local-medium-font-size);\n\n /* Colors */\n --nuraly-label-local-text-color: var(--nuraly-color-label-text, var(--nuraly-color-text-primary, #000000));\n --nuraly-label-local-secondary-color: var(--nuraly-color-label-secondary, var(--nuraly-color-text-secondary, #666666));\n --nuraly-label-local-error-color: var(--nuraly-color-label-error, var(--nuraly-color-error-500, #ff4d4f));\n --nuraly-label-local-warning-color: var(--nuraly-color-label-warning, var(--nuraly-color-warning-500, #faad14));\n --nuraly-label-local-success-color: var(--nuraly-color-label-success, var(--nuraly-color-success-500, #52c41a));\n --nuraly-label-local-required-color: var(--nuraly-color-label-required, var(--nuraly-color-error-500, #ff4d4f));\n --nuraly-label-local-disabled-color: var(--nuraly-color-label-disabled, var(--nuraly-color-text-disabled, #bfbfbf));\n\n /* Spacing */\n --nuraly-label-local-margin-bottom: var(--nuraly-spacing-label-margin-bottom, var(--nuraly-spacing-xs, 4px));\n --nuraly-label-local-required-margin: var(--nuraly-spacing-label-required-margin, var(--nuraly-spacing-2xs, 2px));\n\n /* Transitions */\n --nuraly-label-local-transition-duration: var(--nuraly-transition-label-duration, var(--nuraly-transition-duration-base, 150ms));\n --nuraly-label-local-transition-timing: var(--nuraly-transition-label-timing, var(--nuraly-transition-timing-ease, ease));\n }\n`;"]}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Label component size variants
3
+ */
4
+ export declare type LabelSize = 'small' | 'medium' | 'large';
5
+ /**
6
+ * Label component variants
7
+ */
8
+ export declare type LabelVariant = 'default' | 'secondary' | 'success' | 'warning' | 'error';
9
+ /**
10
+ * Label component props interface
11
+ */
12
+ export interface LabelProps {
13
+ /**
14
+ * The size of the label
15
+ * @default 'medium'
16
+ */
17
+ size?: LabelSize;
18
+ /**
19
+ * The visual variant of the label
20
+ * @default 'default'
21
+ */
22
+ variant?: LabelVariant;
23
+ /**
24
+ * Whether the label is required (shows asterisk)
25
+ * @default false
26
+ */
27
+ required?: boolean;
28
+ /**
29
+ * Whether the label is disabled
30
+ * @default false
31
+ */
32
+ disabled?: boolean;
33
+ /**
34
+ * The for attribute to associate with form elements
35
+ */
36
+ for?: string;
37
+ /**
38
+ * Custom CSS class
39
+ */
40
+ className?: string;
41
+ }
42
+ //# sourceMappingURL=label.types.d.ts.map
package/label.types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=label.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.types.js","sourceRoot":"","sources":["../../../src/components/label/label.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Label component size variants\n */\nexport type LabelSize = 'small' | 'medium' | 'large';\n\n/**\n * Label component variants\n */\nexport type LabelVariant = 'default' | 'secondary' | 'success' | 'warning' | 'error';\n\n/**\n * Label component props interface\n */\nexport interface LabelProps {\n /**\n * The size of the label\n * @default 'medium'\n */\n size?: LabelSize;\n\n /**\n * The visual variant of the label\n * @default 'default'\n */\n variant?: LabelVariant;\n\n /**\n * Whether the label is required (shows asterisk)\n * @default false\n */\n required?: boolean;\n\n /**\n * Whether the label is disabled\n * @default false\n */\n disabled?: boolean;\n\n /**\n * The for attribute to associate with form elements\n */\n for?: string;\n\n /**\n * Custom CSS class\n */\n className?: string;\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuralyui/label",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -8,5 +8,19 @@
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
10
  "author": "Labidi Aymen",
11
- "license": "ISC"
11
+ "license": "ISC",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./index.js"
15
+ },
16
+ "./bundle": {
17
+ "import": "./bundle.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "bundle.js",
22
+ "*.js",
23
+ "*.d.ts",
24
+ "*.js.map"
25
+ ]
12
26
  }
package/react.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createComponent } from '@lit-labs/react';
2
2
  import * as React from 'react';
3
3
  export const HyLabel = createComponent({
4
- tagName: 'hy-label',
4
+ tagName: 'nr-label',
5
5
  elementClass: class extends HTMLElement {
6
6
  },
7
7
  react: React,
package/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/label/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;IACrC,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,KAAM,SAAQ,WAAW;KAAG;IAC1C,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,KAAK,EAAE,OAAO;KACf;CACF,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\n\nexport const HyLabel = createComponent({\n tagName: 'hy-label',\n elementClass: class extends HTMLElement {},\n react: React,\n events: {\n click: 'click',\n },\n});\n"]}
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/label/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;IACrC,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,KAAM,SAAQ,WAAW;KAAG;IAC1C,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,KAAK,EAAE,OAAO;KACf;CACF,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\n\nexport const HyLabel = createComponent({\n tagName: 'nr-label',\n elementClass: class extends HTMLElement {},\n react: React,\n events: {\n click: 'click',\n },\n});\n"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=label.demo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"label.demo.d.ts","sourceRoot":"","sources":["../../../../src/components/label/demo/label.demo.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=label.demo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"label.demo.js","sourceRoot":"","sources":["../../../../src/components/label/demo/label.demo.ts"],"names":[],"mappings":"","sourcesContent":[""]}
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/label/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"label.component.d.ts","sourceRoot":"","sources":["../../../src/components/label/label.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,qBACa,WAAY,SAAQ,UAAU;IACxC,OAAgB,MAAM,0BAAO;IAG5B,KAAK,SAAG;IAEC,MAAM;CASlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"label.style.d.ts","sourceRoot":"","sources":["../../../src/components/label/label.style.ts"],"names":[],"mappings":";AAEA,wBAqDE"}
package/react.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/label/react.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOlB,CAAC"}