@nuralyui/checkbox 0.0.5 → 0.0.7

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,221 @@
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,e=Symbol(),s=new WeakMap;class o{constructor(t,i,s){if(this._$cssResult$=!0,s!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const h=(t,...i)=>{const s=1===t.length?t[0]:i.reduce(((i,e,s)=>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.")})(e)+t[s+1]),t[0]);return new o(s,t,e)},r=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const e of t.cssRules)i+=e.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,e))(i)})(t):t
7
+ /**
8
+ * @license
9
+ * Copyright 2017 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */;var n;const l=window,c=l.trustedTypes,d=c?c.emptyScript:"",a=l.reactiveElementPolyfillSupport,u={toAttribute(t,i){switch(i){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},v=(t,i)=>i!==t&&(i==i||t==t),b={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:v},f="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,e)=>{const s=this._$Ep(e,i);void 0!==s&&(this._$Ev.set(s,e),t.push(s))})),t}static createProperty(t,i=b){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,e,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(s){const o=this[t];this[i]=s,this.requestUpdate(t,o,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||b}static finalize(){if(this.hasOwnProperty(f))return!1;this[f]=!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 e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(r(t))}else void 0!==t&&i.push(r(t));return i}static _$Ep(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"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,e;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.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 e;const s=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,s)=>{i?e.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((i=>{const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=i.cssText,e.appendChild(s)}))})(s,this.constructor.elementStyles),s}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,e){this._$AK(t,e)}_$EO(t,i,e=b){var s;const o=this.constructor._$Ep(t,e);if(void 0!==o&&!0===e.reflect){const h=(void 0!==(null===(s=e.converter)||void 0===s?void 0:s.toAttribute)?e.converter:u).toAttribute(i,e.type);this._$El=t,null==h?this.removeAttribute(o):this.setAttribute(o,h),this._$El=null}}_$AK(t,i){var e;const s=this.constructor,o=s._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=s.getPropertyOptions(o),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(e=t.converter)||void 0===e?void 0:e.fromAttribute)?t.converter:u;this._$El=o,this[o]=h.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,e){let s=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,e))):s=!1),!this.isUpdatePending&&s&&(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 e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),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(e)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(e)}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 m;p[f]=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==a||a({ReactiveElement:p}),(null!==(n=l.reactiveElementVersions)&&void 0!==n?n:l.reactiveElementVersions=[]).push("1.6.3");const y=window,g=y.trustedTypes,k=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,x="$lit$",w=`lit$${(Math.random()+"").slice(9)}$`,$="?"+w,S=`<${$}>`,A=document,E=()=>A.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,_="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,j=/>/g,T=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,O=/"/g,N=/^(?:script|style|textarea|title)$/i,I=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),P=new WeakMap,L=A.createTreeWalker(A,129,null,!1);function q(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(i):i}class B{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let o=0,h=0;const r=t.length-1,n=this.parts,[l,c]=((t,i)=>{const e=t.length-1,s=[];let o,h=2===i?"<svg>":"",r=R;for(let i=0;i<e;i++){const e=t[i];let n,l,c=-1,d=0;for(;d<e.length&&(r.lastIndex=d,l=r.exec(e),null!==l);)d=r.lastIndex,r===R?"!--"===l[1]?r=U:void 0!==l[1]?r=j:void 0!==l[2]?(N.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=T):void 0!==l[3]&&(r=T):r===T?">"===l[0]?(r=null!=o?o:R,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,n=l[1],r=void 0===l[3]?T:'"'===l[3]?O:M):r===O||r===M?r=T:r===U||r===j?r=R:(r=T,o=void 0);const a=r===T&&t[i+1].startsWith("/>")?" ":"";h+=r===R?e+S:c>=0?(s.push(n),e.slice(0,c)+x+e.slice(c)+w+a):e+w+(-2===c?(s.push(void 0),i):a)}return[q(t,h+(t[e]||"<?>")+(2===i?"</svg>":"")),s]})(t,i);if(this.el=B.createElement(l,e),L.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=L.nextNode())&&n.length<r;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(x)||i.startsWith(w)){const e=c[h++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+x).split(w),i=/([.?@])?(.*)/.exec(e);n.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?W:"?"===i[1]?J:"@"===i[1]?G:V})}else n.push({type:6,index:o})}for(const i of t)s.removeAttribute(i)}if(N.test(s.tagName)){const t=s.textContent.split(w),i=t.length-1;if(i>0){s.textContent=g?g.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],E()),L.nextNode(),n.push({type:2,index:++o});s.append(t[i],E())}}}else if(8===s.nodeType)if(s.data===$)n.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(w,t+1));)n.push({type:7,index:o}),t+=w.length-1}o++}}static createElement(t,i){const e=A.createElement("template");return e.innerHTML=t,e}}function F(t,i,e=t,s){var o,h,r,n;if(i===I)return i;let l=void 0!==s?null===(o=e._$Co)||void 0===o?void 0:o[s]:e._$Cl;const c=z(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(h=null==l?void 0:l._$AO)||void 0===h||h.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,e,s)),void 0!==s?(null!==(r=(n=e)._$Co)&&void 0!==r?r:n._$Co=[])[s]=l:e._$Cl=l),void 0!==l&&(i=F(t,l._$AS(t,i.values),l,s)),i}class K{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:e},parts:s}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:A).importNode(e,!0);L.currentNode=o;let h=L.nextNode(),r=0,n=0,l=s[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new H(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new Q(h,this,t)),this._$AV.push(i),l=s[++n]}r!==(null==l?void 0:l.index)&&(h=L.nextNode(),r++)}return L.currentNode=A,o}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class H{constructor(t,i,e,s){var o;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(o=null==s?void 0:s.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=F(this,t,i),z(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>C(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&&z(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=B.createElement(q(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(e);else{const t=new K(o,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new B(t)),i}T(t){C(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const o of t)s===i.length?i.push(e=new H(this.k(E()),this.k(E()),this,this.options)):e=i[s],e._$AI(o),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.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 V{constructor(t,i,e,s,o){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const o=this.strings;let h=!1;if(void 0===o)t=F(this,t,i,0),h=!z(t)||t!==this._$AH&&t!==I,h&&(this._$AH=t);else{const s=t;let r,n;for(t=o[0],r=0;r<o.length-1;r++)n=F(this,s[e+r],i,r),n===I&&(n=this._$AH[r]),h||(h=!z(n)||n!==this._$AH[r]),n===D?t=D:t!==D&&(t+=(null!=n?n:"")+o[r+1]),this._$AH[r]=n}h&&!s&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const Z=g?g.emptyScript:"";class J extends V{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 V{constructor(t,i,e,s,o){super(t,i,e,s,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=F(this,t,i,0))&&void 0!==e?e:D)===I)return;const s=this._$AH,o=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==D&&(s===D||o);o&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const X=y.litHtmlPolyfillSupport;
18
+ /**
19
+ * @license
20
+ * Copyright 2017 Google LLC
21
+ * SPDX-License-Identifier: BSD-3-Clause
22
+ */
23
+ var Y;null==X||X(B,H),(null!==(m=y.litHtmlVersions)&&void 0!==m?m:y.litHtmlVersions=[]).push("2.8.0");const tt=window,it=tt.trustedTypes,et=it?it.createPolicy("lit-html",{createHTML:t=>t}):void 0,st="$lit$",ot=`lit$${(Math.random()+"").slice(9)}$`,ht="?"+ot,rt=`<${ht}>`,nt=document,lt=()=>nt.createComment(""),ct=t=>null===t||"object"!=typeof t&&"function"!=typeof t,dt=Array.isArray,at="[ \t\n\f\r]",ut=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vt=/-->/g,bt=/>/g,ft=RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,mt=/"/g,yt=/^(?:script|style|textarea|title)$/i,gt=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),kt=Symbol.for("lit-noChange"),xt=Symbol.for("lit-nothing"),wt=new WeakMap,$t=nt.createTreeWalker(nt,129,null,!1);function St(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==et?et.createHTML(i):i}const At=(t,i)=>{const e=t.length-1,s=[];let o,h=2===i?"<svg>":"",r=ut;for(let i=0;i<e;i++){const e=t[i];let n,l,c=-1,d=0;for(;d<e.length&&(r.lastIndex=d,l=r.exec(e),null!==l);)d=r.lastIndex,r===ut?"!--"===l[1]?r=vt:void 0!==l[1]?r=bt:void 0!==l[2]?(yt.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=ft):void 0!==l[3]&&(r=ft):r===ft?">"===l[0]?(r=null!=o?o:ut,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,n=l[1],r=void 0===l[3]?ft:'"'===l[3]?mt:pt):r===mt||r===pt?r=ft:r===vt||r===bt?r=ut:(r=ft,o=void 0);const a=r===ft&&t[i+1].startsWith("/>")?" ":"";h+=r===ut?e+rt:c>=0?(s.push(n),e.slice(0,c)+st+e.slice(c)+ot+a):e+ot+(-2===c?(s.push(void 0),i):a)}return[St(t,h+(t[e]||"<?>")+(2===i?"</svg>":"")),s]};class Et{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let o=0,h=0;const r=t.length-1,n=this.parts,[l,c]=At(t,i);if(this.el=Et.createElement(l,e),$t.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=$t.nextNode())&&n.length<r;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(st)||i.startsWith(ot)){const e=c[h++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+st).split(ot),i=/([.?@])?(.*)/.exec(e);n.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?Ut:"?"===i[1]?Tt:"@"===i[1]?Mt:Rt})}else n.push({type:6,index:o})}for(const i of t)s.removeAttribute(i)}if(yt.test(s.tagName)){const t=s.textContent.split(ot),i=t.length-1;if(i>0){s.textContent=it?it.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],lt()),$t.nextNode(),n.push({type:2,index:++o});s.append(t[i],lt())}}}else if(8===s.nodeType)if(s.data===ht)n.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(ot,t+1));)n.push({type:7,index:o}),t+=ot.length-1}o++}}static createElement(t,i){const e=nt.createElement("template");return e.innerHTML=t,e}}function zt(t,i,e=t,s){var o,h,r,n;if(i===kt)return i;let l=void 0!==s?null===(o=e._$Co)||void 0===o?void 0:o[s]:e._$Cl;const c=ct(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(h=null==l?void 0:l._$AO)||void 0===h||h.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,e,s)),void 0!==s?(null!==(r=(n=e)._$Co)&&void 0!==r?r:n._$Co=[])[s]=l:e._$Cl=l),void 0!==l&&(i=zt(t,l._$AS(t,i.values),l,s)),i}class Ct{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:e},parts:s}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:nt).importNode(e,!0);$t.currentNode=o;let h=$t.nextNode(),r=0,n=0,l=s[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new _t(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new Ot(h,this,t)),this._$AV.push(i),l=s[++n]}r!==(null==l?void 0:l.index)&&(h=$t.nextNode(),r++)}return $t.currentNode=nt,o}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class _t{constructor(t,i,e,s){var o;this.type=2,this._$AH=xt,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(o=null==s?void 0:s.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=zt(this,t,i),ct(t)?t===xt||null==t||""===t?(this._$AH!==xt&&this._$AR(),this._$AH=xt):t!==this._$AH&&t!==kt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>dt(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!==xt&&ct(this._$AH)?this._$AA.nextSibling.data=t:this.$(nt.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Et.createElement(St(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(e);else{const t=new Ct(o,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=wt.get(t.strings);return void 0===i&&wt.set(t.strings,i=new Et(t)),i}T(t){dt(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const o of t)s===i.length?i.push(e=new _t(this.k(lt()),this.k(lt()),this,this.options)):e=i[s],e._$AI(o),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.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 Rt{constructor(t,i,e,s,o){this.type=1,this._$AH=xt,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=xt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const o=this.strings;let h=!1;if(void 0===o)t=zt(this,t,i,0),h=!ct(t)||t!==this._$AH&&t!==kt,h&&(this._$AH=t);else{const s=t;let r,n;for(t=o[0],r=0;r<o.length-1;r++)n=zt(this,s[e+r],i,r),n===kt&&(n=this._$AH[r]),h||(h=!ct(n)||n!==this._$AH[r]),n===xt?t=xt:t!==xt&&(t+=(null!=n?n:"")+o[r+1]),this._$AH[r]=n}h&&!s&&this.j(t)}j(t){t===xt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Ut extends Rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===xt?void 0:t}}const jt=it?it.emptyScript:"";class Tt extends Rt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==xt?this.element.setAttribute(this.name,jt):this.element.removeAttribute(this.name)}}class Mt extends Rt{constructor(t,i,e,s,o){super(t,i,e,s,o),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=zt(this,t,i,0))&&void 0!==e?e:xt)===kt)return;const s=this._$AH,o=t===xt&&s!==xt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==xt&&(s===xt||o);o&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Ot{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){zt(this,t)}}const Nt=tt.litHtmlPolyfillSupport;null==Nt||Nt(Et,_t),(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 It,Dt;class Pt extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,e)=>{var s,o;const h=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:i;let r=h._$litPart$;if(void 0===r){const t=null!==(o=null==e?void 0:e.renderBefore)&&void 0!==o?o:null;h._$litPart$=r=new _t(i.insertBefore(lt(),t),t,void 0,null!=e?e:{})}return r._$AI(t),r})(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 kt}}Pt.finalized=!0,Pt._$litElement$=!0,null===(It=globalThis.litElementHydrateSupport)||void 0===It||It.call(globalThis,{LitElement:Pt});const Lt=globalThis.litElementPolyfillSupport;null==Lt||Lt({LitElement:Pt}),(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 qt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(e){e.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(e){e.createProperty(i.key,t)}};
36
+ /**
37
+ * @license
38
+ * Copyright 2017 Google LLC
39
+ * SPDX-License-Identifier: BSD-3-Clause
40
+ */function Bt(t){return(i,e)=>void 0!==e?((t,i,e)=>{i.constructor.createProperty(e,t)})(t,i,e):qt(t,i)
41
+ /**
42
+ * @license
43
+ * Copyright 2021 Google LLC
44
+ * SPDX-License-Identifier: BSD-3-Clause
45
+ */}var Ft;null===(Ft=window.HTMLSlotElement)||void 0===Ft||Ft.prototype.assignedElements;const Kt=[h`
46
+ :host {
47
+ display: flex;
48
+ align-items: center;
49
+ flex-wrap: wrap;
50
+ gap: var(--hybrid-checkbox-gap, var(--hybrid-checkbox-local-gap));
51
+ font-family: var(--hybrid-checkbox-font-family, var(--hybrid-checkbox-local-font-family));
52
+ color: var(--hybrid-checkbox-color, var(--hybrid-checkbox-local-color));
53
+ }
54
+
55
+ :host(:not([checked]):not([indeterminate]):not([disabled])) input {
56
+ background-color: var(--hybrid-checkbox-empty-background-color, var(--hybrid-checkbox-local-empty-background-color));
57
+ border: var(--hybrid-checkbox-empty-border, var(--hybrid-checkbox-local-empty-border));
58
+ }
59
+
60
+ :host(:not([disabled])[checked]) input,
61
+ :host(:not([disabled])[indeterminate]) input {
62
+ background-color: var(--hybrid-checkbox-filled-background-color, var(--hybrid-checkbox-local-filled-background-color));
63
+ }
64
+ :host([disabled]) {
65
+ color: var(--hybrid-checkbox-disabled-text-color, var(--hybrid-checkbox-local-disabled-text-color));
66
+ }
67
+ :host([disabled]) input {
68
+ background-color: var(--hybrid-checkbox-disabled-background-color, var(--hybrid-checkbox-local-disabled-background-color));
69
+ cursor: not-allowed;
70
+ }
71
+ input {
72
+ appearance: none;
73
+ width: var(--hybrid-checkbox-medium-width, var(--hybrid-checkbox-local-medium-width));
74
+ height: var(--hybrid-checkbox-medium-height, var(--hybrid-checkbox-local-medium-height));
75
+ cursor: pointer;
76
+ position: relative;
77
+ border-radius: var(--hybrid-checkbox-border-radius, var(--hybrid-checkbox-local-border-radius));
78
+ }
79
+ input:after {
80
+ color: var(--hybrid-checkbox-symbol-color, var(--hybrid-checkbox-local-symbol-color));
81
+ position: absolute;
82
+ left: 50%;
83
+ top: 50%;
84
+ transform: translate(-50%, -51%);
85
+ }
86
+ input:focus {
87
+ border: var(--hybrid-checkbox-focus-border, var(--hybrid-checkbox-local-focus-border));
88
+ outline: var(--hybrid-checkbox-focus-outline, var(--hybrid-checkbox-local-focus-outline));
89
+ }
90
+ :host([size='large']) input {
91
+ width: var(--hybrid-checkbox-large-width, var(--hybrid-checkbox-local-large-width));
92
+ height: var(--hybrid-checkbox-large-height, var(--hybrid-checkbox-local-large-height));
93
+ }
94
+ :host([size='small']) input {
95
+ width: var(--hybrid-checkbox-small-width, var(--hybrid-checkbox-local-small-width));
96
+ height: var(--hybrid-checkbox-small-height, var(--hybrid-checkbox-local-small-height));
97
+ }
98
+
99
+ :host([indeterminate][size='medium']) input:after {
100
+ font-size: var(--hybrid-checkbox-medium-indeterminate-size, var(--hybrid-checkbox-local-medium-indeterminate-size));
101
+ }
102
+ :host([indeterminate][size='large']) input:after {
103
+ font-size: var(--hybrid-checkbox-large-indeterminate-size, var(--hybrid-checkbox-local-large-indeterminate-size));
104
+ }
105
+
106
+ :host([indeterminate][size='small']) input:after {
107
+ font-size: var(--hybrid-checkbox-small-indeterminate-size, var(--hybrid-checkbox-local-small-indeterminate-size));
108
+ }
109
+
110
+ :host([checked]) input:after {
111
+ border: solid;
112
+ border-width: 0 2px 2px 0;
113
+ transform: translate(-50%, -51%) rotate(45deg);
114
+ content: '';
115
+ }
116
+ :host([checked][size='small']) input:after {
117
+ width: var(--hybrid-checkbox-small-checked-width, var(--hybrid-checkbox-local-small-checked-width));
118
+ height: var(--hybrid-checkbox-small-checked-height, var(--hybrid-checkbox-local-small-checked-height));
119
+ }
120
+ :host([checked][size='large']) input:after {
121
+ width: var(--hybrid-checkbox-large-checked-width, var(--hybrid-checkbox-local-large-checked-width));
122
+ height: var(--hybrid-checkbox-large-checked-height, var(--hybrid-checkbox-local-large-checked-height));
123
+ }
124
+ :host([checked][size='medium']) input:after {
125
+ width: var(--hybrid-checkbox-medium-checked-width, var(--hybrid-checkbox-local-medium-checked-width));
126
+ height: var(--hybrid-checkbox-medium-checked-height, var(--hybrid-checkbox-local-medium-checked-height));
127
+ }
128
+
129
+ :host([indeterminate]:not([checked])) input:after {
130
+ content: '-';
131
+ }
132
+ :host(:not([checked]):not([indeterminate])) input:after {
133
+ content: '';
134
+ }
135
+
136
+ /* ========================================
137
+ * DARK THEME OVERRIDES
138
+ * ========================================
139
+ * Dark theme styles using data-theme attribute on input element
140
+ * These override the light theme defaults when data-theme="dark" is applied
141
+ */
142
+ input[data-theme="dark"] {
143
+ --hybrid-checkbox-local-empty-border: 1px solid #ffffff;
144
+ --hybrid-checkbox-local-empty-background-color: #161616;
145
+ --hybrid-checkbox-local-filled-background-color: #ffffff;
146
+ --hybrid-checkbox-local-symbol-color: #161616;
147
+ --hybrid-checkbox-local-focus-outline: 2px solid #ffffff;
148
+ --hybrid-checkbox-local-focus-border: 2px solid #161616;
149
+ --hybrid-checkbox-local-disabled-background-color: #6f6f6f;
150
+ --hybrid-checkbox-local-disabled-text-color: #6f6f6f;
151
+ }
152
+
153
+ :host([data-theme="dark"]) {
154
+ --hybrid-checkbox-local-color: #ffffff;
155
+ }
156
+ `,h`
157
+ :host {
158
+ /* Light theme defaults (local component properties) */
159
+ --hybrid-checkbox-local-filled-background-color: #161616;
160
+ --hybrid-checkbox-local-color: #000000;
161
+ --hybrid-checkbox-local-empty-background-color: #ffffff;
162
+ --hybrid-checkbox-local-disabled-background-color: #c6c6c6;
163
+ --hybrid-checkbox-local-disabled-text-color: #c6c6c6;
164
+ --hybrid-checkbox-local-empty-border: 1px solid #161616;
165
+ --hybrid-checkbox-local-symbol-color: #ffffff;
166
+ --hybrid-checkbox-local-focus-border: 2px solid #ffffff;
167
+ --hybrid-checkbox-local-focus-outline: 2px solid #0f62fe;
168
+ --hybrid-checkbox-local-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, SFProLocalRange;
169
+ --hybrid-checkbox-local-border-radius: 1px;
170
+ --hybrid-checkbox-local-gap: 5px;
171
+
172
+ /* Size variables */
173
+ --hybrid-checkbox-local-medium-width: 20px;
174
+ --hybrid-checkbox-local-medium-height: 20px;
175
+ --hybrid-checkbox-local-small-width: 15px;
176
+ --hybrid-checkbox-local-small-height: 15px;
177
+ --hybrid-checkbox-local-large-width: 25px;
178
+ --hybrid-checkbox-local-large-height: 25px;
179
+
180
+ --hybrid-checkbox-local-small-indeterminate-size: 10px;
181
+ --hybrid-checkbox-local-large-indeterminate-size: 18px;
182
+ --hybrid-checkbox-local-medium-indeterminate-size: 13px;
183
+
184
+ --hybrid-checkbox-local-small-checked-width: 2px;
185
+ --hybrid-checkbox-local-small-checked-height: 7px;
186
+ --hybrid-checkbox-local-medium-checked-width: 3px;
187
+ --hybrid-checkbox-local-medium-checked-height: 9px;
188
+ --hybrid-checkbox-local-large-checked-width: 4px;
189
+ --hybrid-checkbox-local-large-checked-height: 10px;
190
+ }
191
+ `],Ht=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.setupSystemThemeListener()}disconnectedCallback(){var t,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,i;const e=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return"dark"===e||"light"===e?e:(null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"}setupThemeObserver(){this.themeObserver=new MutationObserver((()=>{this.requestUpdate()})),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},Vt=()=>{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(Vt())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(!Vt())return!0;let i=!0;for(const e of this.requiredComponents)if(!this.isComponentAvailable(e)){i=!1;const s=new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(e,s):console.error(s.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 e;const s=Object.assign(Object.assign({},i),{timestamp:Date.now(),componentName:(null===(e=this.tagName)||void 0===e?void 0:e.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,s)}dispatchInputEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,originalEvent:i.originalEvent},i);this.dispatchCustomEvent(t,e)}dispatchFocusEvent(t,i){const e=Object.assign({target:i.target||this,value:i.value,focused:i.focused,cursorPosition:i.cursorPosition,selectedText:i.selectedText},i);this.dispatchCustomEvent(t,e)}dispatchValidationEvent(t,i){var e;const s=Object.assign({target:i.target||this,value:i.value,isValid:null!==(e=i.isValid)&&void 0!==e&&e,error:i.error},i);this.dispatchCustomEvent(t,s)}dispatchActionEvent(t,i){const e=Object.assign({target:i.target||this,action:i.action,previousValue:i.previousValue,newValue:i.newValue},i);this.dispatchCustomEvent(t,e)}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}},Jt=t=>class extends t{get checkboxElement(){var t;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="checkbox"]');if(!i)throw new Error("CheckboxFocusMixin requires a checkbox input element");return i}focus(t={}){const i=this.checkboxElement;i&&i.focus({preventScroll:t.preventScroll})}blur(){const t=this.checkboxElement;t&&t.blur()}isFocused(){const t=this.checkboxElement;return!!t&&document.activeElement===t}get nativeElement(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('input[type="checkbox"]'))||null}},Gt=t=>class extends t{handleChange(t){var i;const e=t.target.checked,s=this.name,o=this.value;this.indeterminate&&(this.indeterminate=!1),this.checked=e,null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-change",{checked:e,value:o,name:s,indeterminate:!1})}handleFocus(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-focus",{originalEvent:t})}handleBlur(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-blur",{originalEvent:t})}handleKeydown(t){var i,e,s;if(null===(i=this.isActivationKey)||void 0===i?void 0:i.call(this,t)){t.preventDefault();const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('input[type="checkbox"]'),s=this.disabled;i&&!s&&i.click()}null===(s=this.dispatchCustomEvent)||void 0===s||s.call(this,"nr-keydown",{key:t.key,code:t.code,originalEvent:t})}handleMouseEnter(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-mouseenter",{originalEvent:t})}handleMouseLeave(t){var i;null===(i=this.dispatchCustomEvent)||void 0===i||i.call(this,"nr-mouseleave",{originalEvent:t})}};
192
+ /**
193
+ * @license
194
+ * Copyright 2023 Nuraly, Laabidi Aymen
195
+ * SPDX-License-Identifier: MIT
196
+ */
197
+ var Qt=function(t,i,e,s){for(var o,h=arguments.length,r=h<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(h<3?o(r):h>3?o(i,e,r):o(i,e))||r);return h>3&&r&&Object.defineProperty(i,e,r),r};let Xt=class extends(Gt(Jt((t=>Wt(Ht(Zt(t))))(Pt)))){constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.indeterminate=!1,this._size="medium",this.autoFocus=!1,this.title="",this.tabIndex=0,this.required=!1,this.id=""}get size(){return this._size}set size(t){["small","medium","large"].includes(t)?this._size=t:(console.warn(`Invalid size value: ${t}. Using default size: medium`),this._size="medium")}connectedCallback(){super.connectedCallback(),this.validateDependencies(),this.autoFocus&&requestAnimationFrame((()=>{this.focus()}))}updated(t){super.updated(t),this.setAttribute("data-theme",this.currentTheme)}getCommonAttributes(){return{"data-theme":this.currentTheme,"data-size":this.size}}render(){var t,i,e;const s=this.getCommonAttributes();return gt`
198
+ <input
199
+ type="checkbox"
200
+ .checked=${this.checked}
201
+ .disabled=${this.disabled}
202
+ .indeterminate=${this.indeterminate}
203
+ name=${null!==(t=this.name)&&void 0!==t?t:""}
204
+ value=${null!==(i=this.value)&&void 0!==i?i:""}
205
+ id=${this.id}
206
+ title=${this.title}
207
+ ?required=${this.required}
208
+ data-theme="${s["data-theme"]}"
209
+ data-size="${s["data-size"]}"
210
+ aria-checked=${this.indeterminate?"mixed":this.checked?"true":"false"}
211
+ aria-disabled=${this.disabled?"true":"false"}
212
+ tabindex=${this.disabled?-1:null!==(e=this.tabIndex)&&void 0!==e?e:0}
213
+ @change=${this.handleChange}
214
+ @focus=${this.handleFocus}
215
+ @blur=${this.handleBlur}
216
+ @keydown=${this.handleKeydown}
217
+ @mouseenter=${this.handleMouseEnter}
218
+ @mouseleave=${this.handleMouseLeave}
219
+ />
220
+ <slot></slot>
221
+ `}};Xt.styles=Kt,Qt([Bt({type:Boolean,reflect:!0})],Xt.prototype,"checked",void 0),Qt([Bt({type:Boolean,reflect:!0})],Xt.prototype,"disabled",void 0),Qt([Bt({type:Boolean,reflect:!0})],Xt.prototype,"indeterminate",void 0),Qt([Bt({reflect:!0})],Xt.prototype,"size",null),Qt([Bt({type:String})],Xt.prototype,"name",void 0),Qt([Bt({type:String})],Xt.prototype,"value",void 0),Qt([Bt({type:Boolean})],Xt.prototype,"autoFocus",void 0),Qt([Bt({type:String})],Xt.prototype,"title",void 0),Qt([Bt({type:Number})],Xt.prototype,"tabIndex",void 0),Qt([Bt({type:Boolean})],Xt.prototype,"required",void 0),Qt([Bt({type:String})],Xt.prototype,"id",void 0),Xt=Qt([(t=>i=>"function"==typeof i?((t,i)=>(customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:e,elements:s}=i;return{kind:e,elements:s,finisher(i){customElements.define(t,i)}}})(t,i))("nr-checkbox")],Xt);export{Xt as NrCheckboxElement};
@@ -5,22 +5,57 @@
5
5
  */
6
6
  import { LitElement } from 'lit';
7
7
  import { CheckboxSize } from './checkbox.types.js';
8
- declare const NrCheckboxElement_base: (new (...args: any[]) => import("../../shared/dependency-mixin.js").DependencyAware) & (new (...args: any[]) => import("../../shared/theme-mixin.js").ThemeAware) & typeof LitElement;
8
+ declare const NrCheckboxElement_base: (new (...args: any[]) => import("./mixins/checkbox-event-mixin.js").CheckboxEventCapable) & (new (...args: any[]) => import("./mixins/checkbox-focus-mixin.js").CheckboxFocusCapable) & (new (...args: any[]) => import("../../shared/dependency-mixin.js").DependencyAware) & (new (...args: any[]) => import("../../shared/theme-mixin.js").ThemeAware) & (new (...args: any[]) => import("../../shared/event-handler-mixin.js").EventHandlerCapable) & typeof LitElement;
9
+ /**
10
+ * Versatile checkbox component with support for indeterminate state, theming, and multiple sizes.
11
+ *
12
+ * @example
13
+ * ```html
14
+ * <nr-checkbox>Check me</nr-checkbox>
15
+ * <nr-checkbox checked>Already checked</nr-checkbox>
16
+ * <nr-checkbox indeterminate>Indeterminate state</nr-checkbox>
17
+ * <nr-checkbox size="large" disabled>Large disabled</nr-checkbox>
18
+ * ```
19
+ *
20
+ * @fires nr-change - Dispatched when checkbox state changes
21
+ * @fires nr-focus - Dispatched when checkbox receives focus
22
+ * @fires nr-blur - Dispatched when checkbox loses focus
23
+ * @fires nr-keydown - Dispatched on keydown events
24
+ * @fires nr-mouseenter - Dispatched when mouse enters checkbox
25
+ * @fires nr-mouseleave - Dispatched when mouse leaves checkbox
26
+ *
27
+ * @slot default - Checkbox label content
28
+ */
9
29
  export declare class NrCheckboxElement extends NrCheckboxElement_base {
10
30
  static styles: import("lit").CSSResult[];
31
+ /** Whether the checkbox is checked */
11
32
  checked: boolean;
33
+ /** Whether the checkbox is disabled */
12
34
  disabled: boolean;
35
+ /** Whether the checkbox is in indeterminate state */
13
36
  indeterminate: boolean;
37
+ /** Checkbox size (small, medium, large) */
14
38
  get size(): CheckboxSize;
15
39
  set size(value: CheckboxSize);
16
40
  private _size;
41
+ /** Form field name */
17
42
  name?: string;
43
+ /** Form field value */
18
44
  value?: string;
45
+ /** Whether the checkbox should be focused when mounted */
46
+ autoFocus: boolean;
47
+ /** Checkbox title attribute */
48
+ title: string;
49
+ /** Tab index */
50
+ tabIndex: number;
51
+ /** Whether the checkbox is required */
52
+ required: boolean;
53
+ /** Checkbox ID */
54
+ id: string;
19
55
  connectedCallback(): void;
20
56
  updated(changedProperties: Map<string, any>): void;
21
- private updateThemeFromParent;
57
+ private getCommonAttributes;
22
58
  render(): import("lit").TemplateResult<1>;
23
- onChange(event: Event): void;
24
59
  }
25
60
  export {};
26
61
  //# sourceMappingURL=checkbox.component.d.ts.map
@@ -13,14 +13,50 @@ import { LitElement, html } from 'lit';
13
13
  import { customElement, property } from 'lit/decorators.js';
14
14
  import { styles } from './checkbox.style.js';
15
15
  import { NuralyUIBaseMixin } from '../../shared/base-mixin.js';
16
- let NrCheckboxElement = class NrCheckboxElement extends NuralyUIBaseMixin(LitElement) {
16
+ import { CheckboxFocusMixin, CheckboxEventMixin } from './mixins/index.js';
17
+ /**
18
+ * Versatile checkbox component with support for indeterminate state, theming, and multiple sizes.
19
+ *
20
+ * @example
21
+ * ```html
22
+ * <nr-checkbox>Check me</nr-checkbox>
23
+ * <nr-checkbox checked>Already checked</nr-checkbox>
24
+ * <nr-checkbox indeterminate>Indeterminate state</nr-checkbox>
25
+ * <nr-checkbox size="large" disabled>Large disabled</nr-checkbox>
26
+ * ```
27
+ *
28
+ * @fires nr-change - Dispatched when checkbox state changes
29
+ * @fires nr-focus - Dispatched when checkbox receives focus
30
+ * @fires nr-blur - Dispatched when checkbox loses focus
31
+ * @fires nr-keydown - Dispatched on keydown events
32
+ * @fires nr-mouseenter - Dispatched when mouse enters checkbox
33
+ * @fires nr-mouseleave - Dispatched when mouse leaves checkbox
34
+ *
35
+ * @slot default - Checkbox label content
36
+ */
37
+ let NrCheckboxElement = class NrCheckboxElement extends CheckboxEventMixin(CheckboxFocusMixin(NuralyUIBaseMixin(LitElement))) {
17
38
  constructor() {
18
39
  super(...arguments);
40
+ /** Whether the checkbox is checked */
19
41
  this.checked = false;
42
+ /** Whether the checkbox is disabled */
20
43
  this.disabled = false;
44
+ /** Whether the checkbox is in indeterminate state */
21
45
  this.indeterminate = false;
22
46
  this._size = "medium" /* CheckboxSize.Medium */;
47
+ /** Whether the checkbox should be focused when mounted */
48
+ this.autoFocus = false;
49
+ /** Checkbox title attribute */
50
+ this.title = '';
51
+ /** Tab index */
52
+ this.tabIndex = 0;
53
+ /** Whether the checkbox is required */
54
+ this.required = false;
55
+ /** Checkbox ID */
56
+ this.id = '';
57
+ // Event handling methods are now provided by CheckboxEventMixin
23
58
  }
59
+ /** Checkbox size (small, medium, large) */
24
60
  get size() {
25
61
  return this._size;
26
62
  }
@@ -34,55 +70,58 @@ let NrCheckboxElement = class NrCheckboxElement extends NuralyUIBaseMixin(LitEle
34
70
  this._size = "medium" /* CheckboxSize.Medium */;
35
71
  }
36
72
  }
73
+ // Focus/blur methods and nativeElement are now provided by CheckboxFocusMixin
37
74
  connectedCallback() {
38
75
  super.connectedCallback();
39
- this.updateThemeFromParent();
76
+ this.validateDependencies();
77
+ // Handle autoFocus
78
+ if (this.autoFocus) {
79
+ // Use requestAnimationFrame to ensure the element is fully rendered
80
+ requestAnimationFrame(() => {
81
+ this.focus();
82
+ });
83
+ }
40
84
  }
41
85
  updated(changedProperties) {
42
86
  super.updated(changedProperties);
43
- this.updateThemeFromParent();
87
+ // Update data-theme attribute on host for CSS theming
88
+ this.setAttribute('data-theme', this.currentTheme);
44
89
  }
45
- updateThemeFromParent() {
46
- var _a;
47
- // Check for parent container theme first
48
- const parentTheme = (_a = this.closest('[data-theme]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-theme');
49
- const effectiveTheme = parentTheme || this.currentTheme;
50
- this.setAttribute('data-theme', effectiveTheme);
90
+ getCommonAttributes() {
91
+ return {
92
+ 'data-theme': this.currentTheme,
93
+ 'data-size': this.size
94
+ };
51
95
  }
52
96
  render() {
53
97
  var _a, _b, _c;
54
- // Check for parent container theme first
55
- const parentTheme = (_a = this.closest('[data-theme]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-theme');
56
- const effectiveTheme = parentTheme || this.currentTheme;
98
+ const commonAttributes = this.getCommonAttributes();
57
99
  return html `
58
100
  <input
59
101
  type="checkbox"
60
102
  .checked=${this.checked}
61
103
  .disabled=${this.disabled}
62
104
  .indeterminate=${this.indeterminate}
63
- name=${(_b = this.name) !== null && _b !== void 0 ? _b : ''}
64
- value=${(_c = this.value) !== null && _c !== void 0 ? _c : ''}
65
- data-theme="${effectiveTheme}"
105
+ name=${(_a = this.name) !== null && _a !== void 0 ? _a : ''}
106
+ value=${(_b = this.value) !== null && _b !== void 0 ? _b : ''}
107
+ id=${this.id}
108
+ title=${this.title}
109
+ ?required=${this.required}
110
+ data-theme="${commonAttributes['data-theme']}"
111
+ data-size="${commonAttributes['data-size']}"
66
112
  aria-checked=${this.indeterminate ? 'mixed' : (this.checked ? 'true' : 'false')}
67
- @change=${this.onChange}
113
+ aria-disabled=${this.disabled ? 'true' : 'false'}
114
+ tabindex=${this.disabled ? -1 : ((_c = this.tabIndex) !== null && _c !== void 0 ? _c : 0)}
115
+ @change=${this.handleChange}
116
+ @focus=${this.handleFocus}
117
+ @blur=${this.handleBlur}
118
+ @keydown=${this.handleKeydown}
119
+ @mouseenter=${this.handleMouseEnter}
120
+ @mouseleave=${this.handleMouseLeave}
68
121
  />
69
122
  <slot></slot>
70
123
  `;
71
124
  }
72
- onChange(event) {
73
- const target = event.target;
74
- if (this.indeterminate) {
75
- this.indeterminate = false;
76
- }
77
- this.checked = target.checked;
78
- this.dispatchEvent(new CustomEvent('nr-change', {
79
- bubbles: true,
80
- composed: true,
81
- detail: {
82
- value: this.checked,
83
- },
84
- }));
85
- }
86
125
  };
87
126
  NrCheckboxElement.styles = styles;
88
127
  __decorate([
@@ -103,6 +142,21 @@ __decorate([
103
142
  __decorate([
104
143
  property({ type: String })
105
144
  ], NrCheckboxElement.prototype, "value", void 0);
145
+ __decorate([
146
+ property({ type: Boolean })
147
+ ], NrCheckboxElement.prototype, "autoFocus", void 0);
148
+ __decorate([
149
+ property({ type: String })
150
+ ], NrCheckboxElement.prototype, "title", void 0);
151
+ __decorate([
152
+ property({ type: Number })
153
+ ], NrCheckboxElement.prototype, "tabIndex", void 0);
154
+ __decorate([
155
+ property({ type: Boolean })
156
+ ], NrCheckboxElement.prototype, "required", void 0);
157
+ __decorate([
158
+ property({ type: String })
159
+ ], NrCheckboxElement.prototype, "id", void 0);
106
160
  NrCheckboxElement = __decorate([
107
161
  customElement('nr-checkbox')
108
162
  ], NrCheckboxElement);
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.component.ts"],"names":[],"mappings":"A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E,IAAI,EAAC,CAAC;kDACzB;AAGhB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDACxB;AAGjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;wDACnB;AAGtB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;6CAGzB;AAaD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;+CACX;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACV;AA9BJ,iBAAiB;IAD7B,aAAa,CAAC,aAAa,CAAC;GAChB,iBAAiB,CAsF7B;SAtFY,iBAAiB","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './checkbox.style.js';\nimport { CheckboxSize } from './checkbox.types.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\n\n@customElement('nr-checkbox')\nexport class NrCheckboxElement extends NuralyUIBaseMixin(LitElement) {\n static override styles = styles;\n @property({type: Boolean, reflect: true})\n checked = false;\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n @property({type: Boolean, reflect: true})\n indeterminate = false;\n\n @property({reflect: true})\n get size(): CheckboxSize {\n return this._size;\n }\n set size(value: CheckboxSize) {\n const validSizes = [CheckboxSize.Small, CheckboxSize.Medium, CheckboxSize.Large];\n if (validSizes.includes(value)) {\n this._size = value;\n } else {\n console.warn(`Invalid size value: ${value}. Using default size: ${CheckboxSize.Medium}`);\n this._size = CheckboxSize.Medium;\n }\n }\n private _size: CheckboxSize = CheckboxSize.Medium;\n\n @property({type: String})\n name?: string;\n\n @property({type: String})\n value?: string;\n\n override connectedCallback() {\n super.connectedCallback();\n this.updateThemeFromParent();\n }\n\n override updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n this.updateThemeFromParent();\n }\n\n private updateThemeFromParent() {\n // Check for parent container theme first\n const parentTheme = this.closest('[data-theme]')?.getAttribute('data-theme');\n const effectiveTheme = parentTheme || this.currentTheme;\n this.setAttribute('data-theme', effectiveTheme);\n }\n\n override render() {\n // Check for parent container theme first\n const parentTheme = this.closest('[data-theme]')?.getAttribute('data-theme');\n const effectiveTheme = parentTheme || this.currentTheme;\n \n return html`\n <input \n type=\"checkbox\" \n .checked=${this.checked} \n .disabled=${this.disabled} \n .indeterminate=${this.indeterminate}\n name=${this.name ?? ''}\n value=${this.value ?? ''}\n data-theme=\"${effectiveTheme}\"\n aria-checked=${this.indeterminate ? 'mixed' : (this.checked ? 'true' : 'false')}\n @change=${this.onChange} \n />\n <slot></slot>\n `;\n }\n\n onChange(event: Event) {\n const target = event.target as HTMLInputElement;\n if (this.indeterminate) {\n this.indeterminate = false;\n }\n this.checked = target.checked;\n this.dispatchEvent(\n new CustomEvent('nr-change', {\n bubbles: true,\n composed: true,\n detail: {\n value: this.checked,\n },\n })\n );\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,kBAAkB,CACvD,kBAAkB,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C,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;kDACzB;AAIhB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDACxB;AAIjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;wDACnB;AAItB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;6CAGzB;AAcD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;+CACX;AAId;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACV;AAIf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oDACR;AAIlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACL;AAIpB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mDACH;AAItB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;mDACT;AAIjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACR;AA7DN,iBAAiB;IAD7B,aAAa,CAAC,aAAa,CAAC;GAChB,iBAAiB,CA0H7B;SA1HY,iBAAiB","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './checkbox.style.js';\nimport { CheckboxSize } from './checkbox.types.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\nimport { CheckboxFocusMixin, CheckboxEventMixin } from './mixins/index.js';\n\n/**\n * Versatile checkbox component with support for indeterminate state, theming, and multiple sizes.\n * \n * @example\n * ```html\n * <nr-checkbox>Check me</nr-checkbox>\n * <nr-checkbox checked>Already checked</nr-checkbox>\n * <nr-checkbox indeterminate>Indeterminate state</nr-checkbox>\n * <nr-checkbox size=\"large\" disabled>Large disabled</nr-checkbox>\n * ```\n * \n * @fires nr-change - Dispatched when checkbox state changes\n * @fires nr-focus - Dispatched when checkbox receives focus\n * @fires nr-blur - Dispatched when checkbox loses focus\n * @fires nr-keydown - Dispatched on keydown events\n * @fires nr-mouseenter - Dispatched when mouse enters checkbox\n * @fires nr-mouseleave - Dispatched when mouse leaves checkbox\n * \n * @slot default - Checkbox label content\n */\n\n@customElement('nr-checkbox')\nexport class NrCheckboxElement extends CheckboxEventMixin(\n CheckboxFocusMixin(\n NuralyUIBaseMixin(LitElement)\n )\n) {\n static override styles = styles;\n \n /** Whether the checkbox is checked */\n @property({type: Boolean, reflect: true})\n checked = false;\n\n /** Whether the checkbox is disabled */\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n /** Whether the checkbox is in indeterminate state */\n @property({type: Boolean, reflect: true})\n indeterminate = false;\n\n /** Checkbox size (small, medium, large) */\n @property({reflect: true})\n get size(): CheckboxSize {\n return this._size;\n }\n set size(value: CheckboxSize) {\n const validSizes = [CheckboxSize.Small, CheckboxSize.Medium, CheckboxSize.Large];\n if (validSizes.includes(value)) {\n this._size = value;\n } else {\n console.warn(`Invalid size value: ${value}. Using default size: ${CheckboxSize.Medium}`);\n this._size = CheckboxSize.Medium;\n }\n }\n private _size: CheckboxSize = CheckboxSize.Medium;\n\n /** Form field name */\n @property({type: String})\n name?: string;\n\n /** Form field value */\n @property({type: String})\n value?: string;\n\n /** Whether the checkbox should be focused when mounted */\n @property({type: Boolean})\n autoFocus = false;\n\n /** Checkbox title attribute */\n @property({type: String})\n override title = '';\n\n /** Tab index */\n @property({type: Number})\n override tabIndex = 0;\n\n /** Whether the checkbox is required */\n @property({type: Boolean})\n required = false;\n\n /** Checkbox ID */\n @property({type: String})\n override id = '';\n\n // Focus/blur methods and nativeElement are now provided by CheckboxFocusMixin\n\n override connectedCallback() {\n super.connectedCallback();\n this.validateDependencies();\n \n // Handle autoFocus\n if (this.autoFocus) {\n // Use requestAnimationFrame to ensure the element is fully rendered\n requestAnimationFrame(() => {\n this.focus();\n });\n }\n }\n\n override updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n // Update data-theme attribute on host for CSS theming\n this.setAttribute('data-theme', this.currentTheme);\n }\n\n private getCommonAttributes() {\n return {\n 'data-theme': this.currentTheme,\n 'data-size': this.size\n };\n }\n\n override render() {\n const commonAttributes = this.getCommonAttributes();\n \n return html`\n <input \n type=\"checkbox\" \n .checked=${this.checked} \n .disabled=${this.disabled} \n .indeterminate=${this.indeterminate}\n name=${this.name ?? ''}\n value=${this.value ?? ''}\n id=${this.id}\n title=${this.title}\n ?required=${this.required}\n data-theme=\"${commonAttributes['data-theme']}\"\n data-size=\"${commonAttributes['data-size']}\"\n aria-checked=${this.indeterminate ? 'mixed' : (this.checked ? 'true' : 'false')}\n aria-disabled=${this.disabled ? 'true' : 'false'}\n tabindex=${this.disabled ? -1 : (this.tabIndex ?? 0)}\n @change=${this.handleChange} \n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @keydown=${this.handleKeydown}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n />\n <slot></slot>\n `;\n }\n\n // Event handling methods are now provided by CheckboxEventMixin\n}\n"]}
package/checkbox.style.js CHANGED
@@ -1,68 +1,68 @@
1
1
  import { css } from 'lit';
2
- import { styleVariables } from './checkbox.variables.js';
2
+ import { styleVariables } from './checkbox.style.variables.js';
3
3
  const checkBoxStyles = css `
4
4
  :host {
5
5
  display: flex;
6
6
  align-items: center;
7
7
  flex-wrap: wrap;
8
- gap: var(--hybrid-checkbox-gap);
9
- font-family: var(--hybrid-checkbox-font-family);
10
- color: var(--hybrid-checkbox-color);
8
+ gap: var(--hybrid-checkbox-gap, var(--hybrid-checkbox-local-gap));
9
+ font-family: var(--hybrid-checkbox-font-family, var(--hybrid-checkbox-local-font-family));
10
+ color: var(--hybrid-checkbox-color, var(--hybrid-checkbox-local-color));
11
11
  }
12
12
 
13
13
  :host(:not([checked]):not([indeterminate]):not([disabled])) input {
14
- background-color: var(--hybrid-checkbox-empty-background-color);
15
- border: var(--hybrid-checkbox-empty-border);
14
+ background-color: var(--hybrid-checkbox-empty-background-color, var(--hybrid-checkbox-local-empty-background-color));
15
+ border: var(--hybrid-checkbox-empty-border, var(--hybrid-checkbox-local-empty-border));
16
16
  }
17
17
 
18
18
  :host(:not([disabled])[checked]) input,
19
19
  :host(:not([disabled])[indeterminate]) input {
20
- background-color: var(--hybrid-checkbox-filled-background-color);
20
+ background-color: var(--hybrid-checkbox-filled-background-color, var(--hybrid-checkbox-local-filled-background-color));
21
21
  }
22
22
  :host([disabled]) {
23
- color: var(--hybrid-checkbox-disabled-text-color);
23
+ color: var(--hybrid-checkbox-disabled-text-color, var(--hybrid-checkbox-local-disabled-text-color));
24
24
  }
25
25
  :host([disabled]) input {
26
- background-color: var(--hybrid-checkbox-disabled-background-color);
26
+ background-color: var(--hybrid-checkbox-disabled-background-color, var(--hybrid-checkbox-local-disabled-background-color));
27
27
  cursor: not-allowed;
28
28
  }
29
29
  input {
30
30
  appearance: none;
31
- width: var(--hybrid-checkbox-medium-width);
32
- height: var(--hybrid-checkbox-medium-height);
31
+ width: var(--hybrid-checkbox-medium-width, var(--hybrid-checkbox-local-medium-width));
32
+ height: var(--hybrid-checkbox-medium-height, var(--hybrid-checkbox-local-medium-height));
33
33
  cursor: pointer;
34
34
  position: relative;
35
- border-radius: var(--hybrid-checkbox-border-radius);
35
+ border-radius: var(--hybrid-checkbox-border-radius, var(--hybrid-checkbox-local-border-radius));
36
36
  }
37
37
  input:after {
38
- color: var(--hybrid-checkbox-symbol-color);
38
+ color: var(--hybrid-checkbox-symbol-color, var(--hybrid-checkbox-local-symbol-color));
39
39
  position: absolute;
40
40
  left: 50%;
41
41
  top: 50%;
42
42
  transform: translate(-50%, -51%);
43
43
  }
44
44
  input:focus {
45
- border: var(--hybrid-checkbox-focus-border);
46
- outline: var(--hybrid-checkbox-focus-outline);
45
+ border: var(--hybrid-checkbox-focus-border, var(--hybrid-checkbox-local-focus-border));
46
+ outline: var(--hybrid-checkbox-focus-outline, var(--hybrid-checkbox-local-focus-outline));
47
47
  }
48
48
  :host([size='large']) input {
49
- width: var(--hybrid-checkbox-large-width);
50
- height: var(--hybrid-checkbox-large-height);
49
+ width: var(--hybrid-checkbox-large-width, var(--hybrid-checkbox-local-large-width));
50
+ height: var(--hybrid-checkbox-large-height, var(--hybrid-checkbox-local-large-height));
51
51
  }
52
52
  :host([size='small']) input {
53
- width: var(--hybrid-checkbox-small-width);
54
- height: var(--hybrid-checkbox-small-height);
53
+ width: var(--hybrid-checkbox-small-width, var(--hybrid-checkbox-local-small-width));
54
+ height: var(--hybrid-checkbox-small-height, var(--hybrid-checkbox-local-small-height));
55
55
  }
56
56
 
57
57
  :host([indeterminate][size='medium']) input:after {
58
- font-size: var(--hybrid-checkbox-medium-indeterminate-size);
58
+ font-size: var(--hybrid-checkbox-medium-indeterminate-size, var(--hybrid-checkbox-local-medium-indeterminate-size));
59
59
  }
60
60
  :host([indeterminate][size='large']) input:after {
61
- font-size: var(--hybrid-checkbox-large-indeterminate-size);
61
+ font-size: var(--hybrid-checkbox-large-indeterminate-size, var(--hybrid-checkbox-local-large-indeterminate-size));
62
62
  }
63
63
 
64
64
  :host([indeterminate][size='small']) input:after {
65
- font-size: var(--hybrid-checkbox-small-indeterminate-size);
65
+ font-size: var(--hybrid-checkbox-small-indeterminate-size, var(--hybrid-checkbox-local-small-indeterminate-size));
66
66
  }
67
67
 
68
68
  :host([checked]) input:after {
@@ -72,16 +72,16 @@ const checkBoxStyles = css `
72
72
  content: '';
73
73
  }
74
74
  :host([checked][size='small']) input:after {
75
- width: var(--hybrid-checkbox-small-checked-width);
76
- height: var(--hybrid-checkbox-small-checked-height);
75
+ width: var(--hybrid-checkbox-small-checked-width, var(--hybrid-checkbox-local-small-checked-width));
76
+ height: var(--hybrid-checkbox-small-checked-height, var(--hybrid-checkbox-local-small-checked-height));
77
77
  }
78
78
  :host([checked][size='large']) input:after {
79
- width: var(--hybrid-checkbox-large-checked-width);
80
- height: var(--hybrid-checkbox-large-checked-height);
79
+ width: var(--hybrid-checkbox-large-checked-width, var(--hybrid-checkbox-local-large-checked-width));
80
+ height: var(--hybrid-checkbox-large-checked-height, var(--hybrid-checkbox-local-large-checked-height));
81
81
  }
82
82
  :host([checked][size='medium']) input:after {
83
- width: var(--hybrid-checkbox-medium-checked-width);
84
- height: var(--hybrid-checkbox-medium-checked-height);
83
+ width: var(--hybrid-checkbox-medium-checked-width, var(--hybrid-checkbox-local-medium-checked-width));
84
+ height: var(--hybrid-checkbox-medium-checked-height, var(--hybrid-checkbox-local-medium-checked-height));
85
85
  }
86
86
 
87
87
  :host([indeterminate]:not([checked])) input:after {
@@ -90,6 +90,27 @@ const checkBoxStyles = css `
90
90
  :host(:not([checked]):not([indeterminate])) input:after {
91
91
  content: '';
92
92
  }
93
+
94
+ /* ========================================
95
+ * DARK THEME OVERRIDES
96
+ * ========================================
97
+ * Dark theme styles using data-theme attribute on input element
98
+ * These override the light theme defaults when data-theme="dark" is applied
99
+ */
100
+ input[data-theme="dark"] {
101
+ --hybrid-checkbox-local-empty-border: 1px solid #ffffff;
102
+ --hybrid-checkbox-local-empty-background-color: #161616;
103
+ --hybrid-checkbox-local-filled-background-color: #ffffff;
104
+ --hybrid-checkbox-local-symbol-color: #161616;
105
+ --hybrid-checkbox-local-focus-outline: 2px solid #ffffff;
106
+ --hybrid-checkbox-local-focus-border: 2px solid #161616;
107
+ --hybrid-checkbox-local-disabled-background-color: #6f6f6f;
108
+ --hybrid-checkbox-local-disabled-text-color: #6f6f6f;
109
+ }
110
+
111
+ :host([data-theme="dark"]) {
112
+ --hybrid-checkbox-local-color: #ffffff;
113
+ }
93
114
  `;
94
115
  export const styles = [checkBoxStyles, styleVariables];
95
116
  //# sourceMappingURL=checkbox.style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.style.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0FzB,CAAC;AACF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {css} from 'lit';\nimport {styleVariables} from './checkbox.variables.js';\n\nconst checkBoxStyles = css`\n :host {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--hybrid-checkbox-gap);\n font-family: var(--hybrid-checkbox-font-family);\n color: var(--hybrid-checkbox-color);\n }\n\n :host(:not([checked]):not([indeterminate]):not([disabled])) input {\n background-color: var(--hybrid-checkbox-empty-background-color);\n border: var(--hybrid-checkbox-empty-border);\n }\n\n :host(:not([disabled])[checked]) input,\n :host(:not([disabled])[indeterminate]) input {\n background-color: var(--hybrid-checkbox-filled-background-color);\n }\n :host([disabled]) {\n color: var(--hybrid-checkbox-disabled-text-color);\n }\n :host([disabled]) input {\n background-color: var(--hybrid-checkbox-disabled-background-color);\n cursor: not-allowed;\n }\n input {\n appearance: none;\n width: var(--hybrid-checkbox-medium-width);\n height: var(--hybrid-checkbox-medium-height);\n cursor: pointer;\n position: relative;\n border-radius: var(--hybrid-checkbox-border-radius);\n }\n input:after {\n color: var(--hybrid-checkbox-symbol-color);\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -51%);\n }\n input:focus {\n border: var(--hybrid-checkbox-focus-border);\n outline: var(--hybrid-checkbox-focus-outline);\n }\n :host([size='large']) input {\n width: var(--hybrid-checkbox-large-width);\n height: var(--hybrid-checkbox-large-height);\n }\n :host([size='small']) input {\n width: var(--hybrid-checkbox-small-width);\n height: var(--hybrid-checkbox-small-height);\n }\n\n :host([indeterminate][size='medium']) input:after {\n font-size: var(--hybrid-checkbox-medium-indeterminate-size);\n }\n :host([indeterminate][size='large']) input:after {\n font-size: var(--hybrid-checkbox-large-indeterminate-size);\n }\n\n :host([indeterminate][size='small']) input:after {\n font-size: var(--hybrid-checkbox-small-indeterminate-size);\n }\n\n :host([checked]) input:after {\n border: solid;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -51%) rotate(45deg);\n content: '';\n }\n :host([checked][size='small']) input:after {\n width: var(--hybrid-checkbox-small-checked-width);\n height: var(--hybrid-checkbox-small-checked-height);\n }\n :host([checked][size='large']) input:after {\n width: var(--hybrid-checkbox-large-checked-width);\n height: var(--hybrid-checkbox-large-checked-height);\n }\n :host([checked][size='medium']) input:after {\n width: var(--hybrid-checkbox-medium-checked-width);\n height: var(--hybrid-checkbox-medium-checked-height);\n }\n\n :host([indeterminate]:not([checked])) input:after {\n content: '-';\n }\n :host(:not([checked]):not([indeterminate])) input:after {\n content: '';\n }\n`;\nexport const styles = [checkBoxStyles, styleVariables];\n"]}
1
+ {"version":3,"file":"checkbox.style.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAE7D,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GzB,CAAC;AACF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {css} from 'lit';\nimport {styleVariables} from './checkbox.style.variables.js';\n\nconst checkBoxStyles = css`\n :host {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--hybrid-checkbox-gap, var(--hybrid-checkbox-local-gap));\n font-family: var(--hybrid-checkbox-font-family, var(--hybrid-checkbox-local-font-family));\n color: var(--hybrid-checkbox-color, var(--hybrid-checkbox-local-color));\n }\n\n :host(:not([checked]):not([indeterminate]):not([disabled])) input {\n background-color: var(--hybrid-checkbox-empty-background-color, var(--hybrid-checkbox-local-empty-background-color));\n border: var(--hybrid-checkbox-empty-border, var(--hybrid-checkbox-local-empty-border));\n }\n\n :host(:not([disabled])[checked]) input,\n :host(:not([disabled])[indeterminate]) input {\n background-color: var(--hybrid-checkbox-filled-background-color, var(--hybrid-checkbox-local-filled-background-color));\n }\n :host([disabled]) {\n color: var(--hybrid-checkbox-disabled-text-color, var(--hybrid-checkbox-local-disabled-text-color));\n }\n :host([disabled]) input {\n background-color: var(--hybrid-checkbox-disabled-background-color, var(--hybrid-checkbox-local-disabled-background-color));\n cursor: not-allowed;\n }\n input {\n appearance: none;\n width: var(--hybrid-checkbox-medium-width, var(--hybrid-checkbox-local-medium-width));\n height: var(--hybrid-checkbox-medium-height, var(--hybrid-checkbox-local-medium-height));\n cursor: pointer;\n position: relative;\n border-radius: var(--hybrid-checkbox-border-radius, var(--hybrid-checkbox-local-border-radius));\n }\n input:after {\n color: var(--hybrid-checkbox-symbol-color, var(--hybrid-checkbox-local-symbol-color));\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -51%);\n }\n input:focus {\n border: var(--hybrid-checkbox-focus-border, var(--hybrid-checkbox-local-focus-border));\n outline: var(--hybrid-checkbox-focus-outline, var(--hybrid-checkbox-local-focus-outline));\n }\n :host([size='large']) input {\n width: var(--hybrid-checkbox-large-width, var(--hybrid-checkbox-local-large-width));\n height: var(--hybrid-checkbox-large-height, var(--hybrid-checkbox-local-large-height));\n }\n :host([size='small']) input {\n width: var(--hybrid-checkbox-small-width, var(--hybrid-checkbox-local-small-width));\n height: var(--hybrid-checkbox-small-height, var(--hybrid-checkbox-local-small-height));\n }\n\n :host([indeterminate][size='medium']) input:after {\n font-size: var(--hybrid-checkbox-medium-indeterminate-size, var(--hybrid-checkbox-local-medium-indeterminate-size));\n }\n :host([indeterminate][size='large']) input:after {\n font-size: var(--hybrid-checkbox-large-indeterminate-size, var(--hybrid-checkbox-local-large-indeterminate-size));\n }\n\n :host([indeterminate][size='small']) input:after {\n font-size: var(--hybrid-checkbox-small-indeterminate-size, var(--hybrid-checkbox-local-small-indeterminate-size));\n }\n\n :host([checked]) input:after {\n border: solid;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -51%) rotate(45deg);\n content: '';\n }\n :host([checked][size='small']) input:after {\n width: var(--hybrid-checkbox-small-checked-width, var(--hybrid-checkbox-local-small-checked-width));\n height: var(--hybrid-checkbox-small-checked-height, var(--hybrid-checkbox-local-small-checked-height));\n }\n :host([checked][size='large']) input:after {\n width: var(--hybrid-checkbox-large-checked-width, var(--hybrid-checkbox-local-large-checked-width));\n height: var(--hybrid-checkbox-large-checked-height, var(--hybrid-checkbox-local-large-checked-height));\n }\n :host([checked][size='medium']) input:after {\n width: var(--hybrid-checkbox-medium-checked-width, var(--hybrid-checkbox-local-medium-checked-width));\n height: var(--hybrid-checkbox-medium-checked-height, var(--hybrid-checkbox-local-medium-checked-height));\n }\n\n :host([indeterminate]:not([checked])) input:after {\n content: '-';\n }\n :host(:not([checked]):not([indeterminate])) input:after {\n content: '';\n }\n\n /* ========================================\n * DARK THEME OVERRIDES\n * ========================================\n * Dark theme styles using data-theme attribute on input element\n * These override the light theme defaults when data-theme=\"dark\" is applied\n */\n input[data-theme=\"dark\"] {\n --hybrid-checkbox-local-empty-border: 1px solid #ffffff;\n --hybrid-checkbox-local-empty-background-color: #161616;\n --hybrid-checkbox-local-filled-background-color: #ffffff;\n --hybrid-checkbox-local-symbol-color: #161616;\n --hybrid-checkbox-local-focus-outline: 2px solid #ffffff;\n --hybrid-checkbox-local-focus-border: 2px solid #161616;\n --hybrid-checkbox-local-disabled-background-color: #6f6f6f;\n --hybrid-checkbox-local-disabled-text-color: #6f6f6f;\n }\n\n :host([data-theme=\"dark\"]) {\n --hybrid-checkbox-local-color: #ffffff;\n }\n`;\nexport const styles = [checkBoxStyles, styleVariables];\n"]}
@@ -1,2 +1,2 @@
1
1
  export declare const styleVariables: import("lit").CSSResult;
2
- //# sourceMappingURL=checkbox.variables.d.ts.map
2
+ //# sourceMappingURL=checkbox.style.variables.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { css } from 'lit';
2
+ export const styleVariables = css `
3
+ :host {
4
+ /* Light theme defaults (local component properties) */
5
+ --hybrid-checkbox-local-filled-background-color: #161616;
6
+ --hybrid-checkbox-local-color: #000000;
7
+ --hybrid-checkbox-local-empty-background-color: #ffffff;
8
+ --hybrid-checkbox-local-disabled-background-color: #c6c6c6;
9
+ --hybrid-checkbox-local-disabled-text-color: #c6c6c6;
10
+ --hybrid-checkbox-local-empty-border: 1px solid #161616;
11
+ --hybrid-checkbox-local-symbol-color: #ffffff;
12
+ --hybrid-checkbox-local-focus-border: 2px solid #ffffff;
13
+ --hybrid-checkbox-local-focus-outline: 2px solid #0f62fe;
14
+ --hybrid-checkbox-local-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, SFProLocalRange;
15
+ --hybrid-checkbox-local-border-radius: 1px;
16
+ --hybrid-checkbox-local-gap: 5px;
17
+
18
+ /* Size variables */
19
+ --hybrid-checkbox-local-medium-width: 20px;
20
+ --hybrid-checkbox-local-medium-height: 20px;
21
+ --hybrid-checkbox-local-small-width: 15px;
22
+ --hybrid-checkbox-local-small-height: 15px;
23
+ --hybrid-checkbox-local-large-width: 25px;
24
+ --hybrid-checkbox-local-large-height: 25px;
25
+
26
+ --hybrid-checkbox-local-small-indeterminate-size: 10px;
27
+ --hybrid-checkbox-local-large-indeterminate-size: 18px;
28
+ --hybrid-checkbox-local-medium-indeterminate-size: 13px;
29
+
30
+ --hybrid-checkbox-local-small-checked-width: 2px;
31
+ --hybrid-checkbox-local-small-checked-height: 7px;
32
+ --hybrid-checkbox-local-medium-checked-width: 3px;
33
+ --hybrid-checkbox-local-medium-checked-height: 9px;
34
+ --hybrid-checkbox-local-large-checked-width: 4px;
35
+ --hybrid-checkbox-local-large-checked-height: 10px;
36
+ }
37
+ `;
38
+ //# sourceMappingURL=checkbox.style.variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.style.variables.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.style.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmChC,CAAC","sourcesContent":["import {css} from 'lit';\n\nexport const styleVariables = css`\n :host {\n /* Light theme defaults (local component properties) */\n --hybrid-checkbox-local-filled-background-color: #161616;\n --hybrid-checkbox-local-color: #000000;\n --hybrid-checkbox-local-empty-background-color: #ffffff;\n --hybrid-checkbox-local-disabled-background-color: #c6c6c6;\n --hybrid-checkbox-local-disabled-text-color: #c6c6c6;\n --hybrid-checkbox-local-empty-border: 1px solid #161616;\n --hybrid-checkbox-local-symbol-color: #ffffff;\n --hybrid-checkbox-local-focus-border: 2px solid #ffffff;\n --hybrid-checkbox-local-focus-outline: 2px solid #0f62fe;\n --hybrid-checkbox-local-font-family: Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Ubuntu, Cantarell, \"Noto Sans\", sans-serif, \"system-ui\", \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, SFProLocalRange;\n --hybrid-checkbox-local-border-radius: 1px;\n --hybrid-checkbox-local-gap: 5px;\n\n /* Size variables */\n --hybrid-checkbox-local-medium-width: 20px;\n --hybrid-checkbox-local-medium-height: 20px;\n --hybrid-checkbox-local-small-width: 15px;\n --hybrid-checkbox-local-small-height: 15px;\n --hybrid-checkbox-local-large-width: 25px;\n --hybrid-checkbox-local-large-height: 25px;\n\n --hybrid-checkbox-local-small-indeterminate-size: 10px;\n --hybrid-checkbox-local-large-indeterminate-size: 18px;\n --hybrid-checkbox-local-medium-indeterminate-size: 13px;\n\n --hybrid-checkbox-local-small-checked-width: 2px;\n --hybrid-checkbox-local-small-checked-height: 7px;\n --hybrid-checkbox-local-medium-checked-width: 3px;\n --hybrid-checkbox-local-medium-checked-height: 9px;\n --hybrid-checkbox-local-large-checked-width: 4px;\n --hybrid-checkbox-local-large-checked-height: 10px;\n }\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuralyui/checkbox",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -11,5 +11,19 @@
11
11
  "test": "echo \"Error: no test specified\" && exit 1"
12
12
  },
13
13
  "author": "Labidi Aymen",
14
- "license": "ISC"
14
+ "license": "ISC",
15
+ "exports": {
16
+ ".": {
17
+ "import": "./index.js"
18
+ },
19
+ "./bundle": {
20
+ "import": "./bundle.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "bundle.js",
25
+ "*.js",
26
+ "*.d.ts",
27
+ "*.js.map"
28
+ ]
15
29
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.component.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;;AAGnD,qBACa,iBAAkB,SAAQ,sBAA6B;IAClE,OAAgB,MAAM,4BAAU;IAEhC,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAGjB,aAAa,UAAS;IAEtB,IACI,IAAI,IAAI,YAAY,CAEvB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,YAAY,EAQ3B;IACD,OAAO,CAAC,KAAK,CAAqC;IAGlD,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,CAAC;IAEN,iBAAiB;IAKjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAKpD,OAAO,CAAC,qBAAqB;IAOpB,MAAM;IAqBf,QAAQ,CAAC,KAAK,EAAE,KAAK;CAgBtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.style.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.style.ts"],"names":[],"mappings":"AA8FA,eAAO,MAAM,MAAM,2BAAmC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.types.ts"],"names":[],"mappings":"AAAA,0BAAkB,YAAY;IAC5B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.variables.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.variables.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,yBAmD1B,CAAC"}
@@ -1,54 +0,0 @@
1
- import { css } from 'lit';
2
- export const styleVariables = css `
3
- :host {
4
- /* Light theme defaults */
5
- --hybrid-checkbox-filled-background-color: #161616;
6
- --hybrid-checkbox-color: #000000;
7
- --hybrid-checkbox-empty-background-color: #ffffff;
8
- --hybrid-checkbox-disabled-background-color: #c6c6c6;
9
- --hybrid-checkbox-disabled-text-color: #c6c6c6;
10
- --hybrid-checkbox-empty-border: 1px solid #161616;
11
- --hybrid-checkbox-symbol-color: #ffffff;
12
- --hybrid-checkbox-focus-border: 2px solid #ffffff;
13
- --hybrid-checkbox-focus-outline: 2px solid #0f62fe;
14
- --hybrid-checkbox-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, SFProLocalRange;
15
- --hybrid-checkbox-border-radius: 1px;
16
- --hybrid-checkbox-gap: 5px;
17
-
18
- /* Size variables */
19
- --hybrid-checkbox-medium-width: 20px;
20
- --hybrid-checkbox-medium-height: 20px;
21
- --hybrid-checkbox-small-width: 15px;
22
- --hybrid-checkbox-small-height: 15px;
23
- --hybrid-checkbox-large-width: 25px;
24
- --hybrid-checkbox-large-height: 25px;
25
-
26
- --hybrid-checkbox-small-indeterminate-size: 10px;
27
- --hybrid-checkbox-large-indeterminate-size: 18px;
28
- --hybrid-checkbox-medium-indeterminate-size: 13px;
29
-
30
- --hybrid-checkbox-small-checked-width: 2px;
31
- --hybrid-checkbox-small-checked-height: 7px;
32
- --hybrid-checkbox-medium-checked-width: 3px;
33
- --hybrid-checkbox-medium-checked-height: 9px;
34
- --hybrid-checkbox-large-checked-width: 4px;
35
- --hybrid-checkbox-large-checked-height: 10px;
36
- }
37
-
38
- /* Dark theme overrides using data-theme attribute */
39
- input[data-theme="dark"] {
40
- --hybrid-checkbox-empty-border: 1px solid #ffffff;
41
- --hybrid-checkbox-empty-background-color: #161616;
42
- --hybrid-checkbox-filled-background-color: #ffffff;
43
- --hybrid-checkbox-symbol-color: #161616;
44
- --hybrid-checkbox-focus-outline: 2px solid #ffffff;
45
- --hybrid-checkbox-focus-border: 2px solid #161616;
46
- --hybrid-checkbox-disabled-background-color: #6f6f6f;
47
- --hybrid-checkbox-disabled-text-color: #6f6f6f;
48
- }
49
-
50
- :host([data-theme="dark"]) {
51
- --hybrid-checkbox-color: #ffffff;
52
- }
53
- `;
54
- //# sourceMappingURL=checkbox.variables.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.variables.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDhC,CAAC","sourcesContent":["import {css} from 'lit';\n\nexport const styleVariables = css`\n :host {\n /* Light theme defaults */\n --hybrid-checkbox-filled-background-color: #161616;\n --hybrid-checkbox-color: #000000;\n --hybrid-checkbox-empty-background-color: #ffffff;\n --hybrid-checkbox-disabled-background-color: #c6c6c6;\n --hybrid-checkbox-disabled-text-color: #c6c6c6;\n --hybrid-checkbox-empty-border: 1px solid #161616;\n --hybrid-checkbox-symbol-color: #ffffff;\n --hybrid-checkbox-focus-border: 2px solid #ffffff;\n --hybrid-checkbox-focus-outline: 2px solid #0f62fe;\n --hybrid-checkbox-font-family: Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Ubuntu, Cantarell, \"Noto Sans\", sans-serif, \"system-ui\", \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, SFProLocalRange;\n --hybrid-checkbox-border-radius: 1px;\n --hybrid-checkbox-gap: 5px;\n\n /* Size variables */\n --hybrid-checkbox-medium-width: 20px;\n --hybrid-checkbox-medium-height: 20px;\n --hybrid-checkbox-small-width: 15px;\n --hybrid-checkbox-small-height: 15px;\n --hybrid-checkbox-large-width: 25px;\n --hybrid-checkbox-large-height: 25px;\n\n --hybrid-checkbox-small-indeterminate-size: 10px;\n --hybrid-checkbox-large-indeterminate-size: 18px;\n --hybrid-checkbox-medium-indeterminate-size: 13px;\n\n --hybrid-checkbox-small-checked-width: 2px;\n --hybrid-checkbox-small-checked-height: 7px;\n --hybrid-checkbox-medium-checked-width: 3px;\n --hybrid-checkbox-medium-checked-height: 9px;\n --hybrid-checkbox-large-checked-width: 4px;\n --hybrid-checkbox-large-checked-height: 10px;\n }\n\n /* Dark theme overrides using data-theme attribute */\n input[data-theme=\"dark\"] {\n --hybrid-checkbox-empty-border: 1px solid #ffffff;\n --hybrid-checkbox-empty-background-color: #161616;\n --hybrid-checkbox-filled-background-color: #ffffff;\n --hybrid-checkbox-symbol-color: #161616;\n --hybrid-checkbox-focus-outline: 2px solid #ffffff;\n --hybrid-checkbox-focus-border: 2px solid #161616;\n --hybrid-checkbox-disabled-background-color: #6f6f6f;\n --hybrid-checkbox-disabled-text-color: #6f6f6f;\n }\n\n :host([data-theme=\"dark\"]) {\n --hybrid-checkbox-color: #ffffff;\n }\n`;\n"]}
@@ -1,13 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Nuraly, Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- import { LitElement } from 'lit';
7
- import '../checkbox.component.js';
8
- export declare class CheckBoxDemo extends LitElement {
9
- render(): import("lit").TemplateResult<1>;
10
- handleChange(event: CustomEvent): void;
11
- handleSubmit(event: Event): void;
12
- }
13
- //# sourceMappingURL=checkbox-demo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox-demo.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/demo/checkbox-demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAEvC,OAAO,0BAA0B,CAAC;AAElC,qBACa,YAAa,SAAQ,UAAU;IACjC,MAAM;IAkFf,YAAY,CAAC,KAAK,EAAE,WAAW;IAc/B,YAAY,CAAC,KAAK,EAAE,KAAK;CAO1B"}
@@ -1,123 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Nuraly, Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
- return c > 3 && r && Object.defineProperty(target, key, r), r;
11
- };
12
- import { LitElement, html } from 'lit';
13
- import { customElement } from 'lit/decorators.js';
14
- import '../checkbox.component.js';
15
- let CheckBoxDemo = class CheckBoxDemo extends LitElement {
16
- render() {
17
- return html `
18
- <h3>Default checkbox</h3>
19
-
20
- <nr-checkbox indeterminate>Default: indeterminate</nr-checkbox>
21
- <nr-checkbox checked>Default: checked</nr-checkbox>
22
- <nr-checkbox>Default (unchecked)</nr-checkbox>
23
- <nr-checkbox disabled>Checkbox disabled</nr-checkbox>
24
- <nr-checkbox disabled indeterminate>Checkbox disabled and indeterminate</nr-checkbox>
25
- <nr-checkbox disabled checked>Checkbox disabled and checked</nr-checkbox>
26
- <hr />
27
-
28
- <h3>Theme Support</h3>
29
- <p>The checkbox component now supports automatic theme detection and management through the NuralyUIBaseMixin, using data-theme attributes like the button component.</p>
30
- <div data-theme="light" style="padding: 10px; border: 1px solid #ccc; margin: 10px 0; background-color: #ffffff; color: #000000;">
31
- <p>Light theme context (data-theme="light"):</p>
32
- <nr-checkbox checked>Light theme checkbox</nr-checkbox>
33
- <nr-checkbox indeterminate>Light theme indeterminate</nr-checkbox>
34
- <nr-checkbox>Light theme unchecked</nr-checkbox>
35
- <nr-checkbox disabled checked>Light theme disabled</nr-checkbox>
36
- </div>
37
- <div data-theme="dark" style="padding: 10px; border: 1px solid #666; margin: 10px 0; background-color: #2a2a2a; color: white;">
38
- <p>Dark theme context (data-theme="dark"):</p>
39
- <nr-checkbox checked>Dark theme checkbox</nr-checkbox>
40
- <nr-checkbox indeterminate>Dark theme indeterminate</nr-checkbox>
41
- <nr-checkbox>Dark theme unchecked</nr-checkbox>
42
- <nr-checkbox disabled checked>Dark theme disabled</nr-checkbox>
43
- </div>
44
- <hr />
45
-
46
- <h3>Form Integration</h3>
47
- <form @submit=${this.handleSubmit}>
48
- <nr-checkbox name="terms" value="accepted" @nr-change=${this.handleChange}>I accept the terms and conditions</nr-checkbox>
49
- <nr-checkbox name="newsletter" value="subscribed" @nr-change=${this.handleChange}>Subscribe to newsletter</nr-checkbox>
50
- <nr-checkbox name="marketing" value="opted-in" indeterminate @nr-change=${this.handleChange}>Marketing communications (some selected)</nr-checkbox>
51
- <br><br>
52
- <button type="submit">Submit Form</button>
53
- </form>
54
- <hr />
55
-
56
- <h3>Sizes with check</h3>
57
-
58
- <nr-checkbox checked>Medium checkbox (default)</nr-checkbox>
59
- <nr-checkbox size="small" checked>Small checkbox</nr-checkbox>
60
- <nr-checkbox size="large" checked>Large checkbox</nr-checkbox>
61
- <nr-checkbox checked disabled>Medium checkbox (default)</nr-checkbox>
62
- <nr-checkbox size="small" checked disabled>Small checkbox</nr-checkbox>
63
- <nr-checkbox size="large" checked disabled>Large checkbox</nr-checkbox>
64
- <hr />
65
-
66
- <h3>Sizes with indeterminate</h3>
67
- <nr-checkbox indeterminate>Medium checkbox (default)</nr-checkbox>
68
- <nr-checkbox size="small" indeterminate>Small checkbox</nr-checkbox>
69
- <nr-checkbox size="large" indeterminate>Large checkbox</nr-checkbox>
70
- <nr-checkbox indeterminate disabled>Medium checkbox (default)</nr-checkbox>
71
- <nr-checkbox size="small" indeterminate disabled>Small checkbox</nr-checkbox>
72
- <nr-checkbox size="large" indeterminate disabled>Large checkbox</nr-checkbox>
73
- <hr />
74
-
75
- <h3>Sizes with unchecked</h3>
76
-
77
- <nr-checkbox>Medium checkbox (default)</nr-checkbox>
78
- <nr-checkbox size="small">Small checkbox</nr-checkbox>
79
- <nr-checkbox size="large">Large checkbox</nr-checkbox>
80
- <nr-checkbox disabled>Medium checkbox (default)</nr-checkbox>
81
- <nr-checkbox size="small" disabled>Small checkbox</nr-checkbox>
82
- <nr-checkbox size="large" disabled>Large checkbox</nr-checkbox>
83
- <hr />
84
-
85
- <h3>Event Handling Demo</h3>
86
- <nr-checkbox @nr-change=${this.handleChange}>Click me to see event details</nr-checkbox>
87
- <p id="event-output">Event output will appear here...</p>
88
- <hr />
89
-
90
- <h3>Size Validation Demo</h3>
91
- <nr-checkbox size=${'invalid-size'}>This checkbox will use default size (check console for warning)</nr-checkbox>
92
- <nr-checkbox size="small">Valid small size</nr-checkbox>
93
- <nr-checkbox size="medium">Valid medium size</nr-checkbox>
94
- <nr-checkbox size="large">Valid large size</nr-checkbox>
95
- `;
96
- }
97
- handleChange(event) {
98
- var _a;
99
- const target = event.target;
100
- const output = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#event-output');
101
- if (output) {
102
- output.textContent = `Event: nr-change, Checked: ${event.detail.value}, Name: ${target.name || 'N/A'}, Value: ${target.value || 'N/A'}`;
103
- }
104
- console.log('Checkbox changed:', {
105
- checked: event.detail.value,
106
- name: target.name,
107
- value: target.value,
108
- size: target.size
109
- });
110
- }
111
- handleSubmit(event) {
112
- event.preventDefault();
113
- const form = event.target;
114
- const formData = new FormData(form);
115
- console.log('Form submitted:', Object.fromEntries(formData));
116
- alert('Form submitted! Check console for form data.');
117
- }
118
- };
119
- CheckBoxDemo = __decorate([
120
- customElement('nr-checkbox-demo')
121
- ], CheckBoxDemo);
122
- export { CheckBoxDemo };
123
- //# sourceMappingURL=checkbox-demo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox-demo.js","sourceRoot":"","sources":["../../../../src/components/checkbox/demo/checkbox-demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,0BAA0B,CAAC;AAGlC,IAAa,YAAY,GAAzB,MAAa,YAAa,SAAQ,UAAU;IACjC,MAAM;QACb,OAAO,IAAI,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GY,YAAY","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport '../checkbox.component.js';\n\n@customElement('nr-checkbox-demo')\nexport class CheckBoxDemo extends LitElement {\n override render() {\n return html`\n <h3>Default checkbox</h3>\n\n <nr-checkbox indeterminate>Default: indeterminate</nr-checkbox>\n <nr-checkbox checked>Default: checked</nr-checkbox>\n <nr-checkbox>Default (unchecked)</nr-checkbox>\n <nr-checkbox disabled>Checkbox disabled</nr-checkbox>\n <nr-checkbox disabled indeterminate>Checkbox disabled and indeterminate</nr-checkbox>\n <nr-checkbox disabled checked>Checkbox disabled and checked</nr-checkbox>\n <hr />\n\n <h3>Theme Support</h3>\n <p>The checkbox component now supports automatic theme detection and management through the NuralyUIBaseMixin, using data-theme attributes like the button component.</p>\n <div data-theme=\"light\" style=\"padding: 10px; border: 1px solid #ccc; margin: 10px 0; background-color: #ffffff; color: #000000;\">\n <p>Light theme context (data-theme=\"light\"):</p>\n <nr-checkbox checked>Light theme checkbox</nr-checkbox>\n <nr-checkbox indeterminate>Light theme indeterminate</nr-checkbox>\n <nr-checkbox>Light theme unchecked</nr-checkbox>\n <nr-checkbox disabled checked>Light theme disabled</nr-checkbox>\n </div>\n <div data-theme=\"dark\" style=\"padding: 10px; border: 1px solid #666; margin: 10px 0; background-color: #2a2a2a; color: white;\">\n <p>Dark theme context (data-theme=\"dark\"):</p>\n <nr-checkbox checked>Dark theme checkbox</nr-checkbox>\n <nr-checkbox indeterminate>Dark theme indeterminate</nr-checkbox>\n <nr-checkbox>Dark theme unchecked</nr-checkbox>\n <nr-checkbox disabled checked>Dark theme disabled</nr-checkbox>\n </div>\n <hr />\n \n <h3>Form Integration</h3>\n <form @submit=${this.handleSubmit}>\n <nr-checkbox name=\"terms\" value=\"accepted\" @nr-change=${this.handleChange}>I accept the terms and conditions</nr-checkbox>\n <nr-checkbox name=\"newsletter\" value=\"subscribed\" @nr-change=${this.handleChange}>Subscribe to newsletter</nr-checkbox>\n <nr-checkbox name=\"marketing\" value=\"opted-in\" indeterminate @nr-change=${this.handleChange}>Marketing communications (some selected)</nr-checkbox>\n <br><br>\n <button type=\"submit\">Submit Form</button>\n </form>\n <hr />\n\n <h3>Sizes with check</h3>\n\n <nr-checkbox checked>Medium checkbox (default)</nr-checkbox>\n <nr-checkbox size=\"small\" checked>Small checkbox</nr-checkbox>\n <nr-checkbox size=\"large\" checked>Large checkbox</nr-checkbox>\n <nr-checkbox checked disabled>Medium checkbox (default)</nr-checkbox>\n <nr-checkbox size=\"small\" checked disabled>Small checkbox</nr-checkbox>\n <nr-checkbox size=\"large\" checked disabled>Large checkbox</nr-checkbox>\n <hr />\n \n <h3>Sizes with indeterminate</h3>\n <nr-checkbox indeterminate>Medium checkbox (default)</nr-checkbox>\n <nr-checkbox size=\"small\" indeterminate>Small checkbox</nr-checkbox>\n <nr-checkbox size=\"large\" indeterminate>Large checkbox</nr-checkbox>\n <nr-checkbox indeterminate disabled>Medium checkbox (default)</nr-checkbox>\n <nr-checkbox size=\"small\" indeterminate disabled>Small checkbox</nr-checkbox>\n <nr-checkbox size=\"large\" indeterminate disabled>Large checkbox</nr-checkbox>\n <hr />\n \n <h3>Sizes with unchecked</h3>\n\n <nr-checkbox>Medium checkbox (default)</nr-checkbox>\n <nr-checkbox size=\"small\">Small checkbox</nr-checkbox>\n <nr-checkbox size=\"large\">Large checkbox</nr-checkbox>\n <nr-checkbox disabled>Medium checkbox (default)</nr-checkbox>\n <nr-checkbox size=\"small\" disabled>Small checkbox</nr-checkbox>\n <nr-checkbox size=\"large\" disabled>Large checkbox</nr-checkbox>\n <hr />\n\n <h3>Event Handling Demo</h3>\n <nr-checkbox @nr-change=${this.handleChange}>Click me to see event details</nr-checkbox>\n <p id=\"event-output\">Event output will appear here...</p>\n <hr />\n\n <h3>Size Validation Demo</h3>\n <nr-checkbox size=${'invalid-size' as any}>This checkbox will use default size (check console for warning)</nr-checkbox>\n <nr-checkbox size=\"small\">Valid small size</nr-checkbox>\n <nr-checkbox size=\"medium\">Valid medium size</nr-checkbox>\n <nr-checkbox size=\"large\">Valid large size</nr-checkbox>\n `;\n }\n\n handleChange(event: CustomEvent) {\n const target = event.target as any;\n const output = this.shadowRoot?.querySelector('#event-output');\n if (output) {\n output.textContent = `Event: nr-change, Checked: ${event.detail.value}, Name: ${target.name || 'N/A'}, Value: ${target.value || 'N/A'}`;\n }\n console.log('Checkbox changed:', {\n checked: event.detail.value,\n name: target.name,\n value: target.value,\n size: target.size\n });\n }\n\n handleSubmit(event: Event) {\n event.preventDefault();\n const form = event.target as HTMLFormElement;\n const formData = new FormData(form);\n console.log('Form submitted:', Object.fromEntries(formData));\n alert('Form submitted! Check console for form data.');\n }\n}\n"]}
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
package/react.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,eAAO,MAAM,UAAU;;EAOrB,CAAC"}
@@ -1,2 +0,0 @@
1
- import '../checkbox.component';
2
- //# sourceMappingURL=checkbox_test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox_test.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/test/checkbox_test.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,CAAC"}
@@ -1,88 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { html, fixture, expect } from '@open-wc/testing';
11
- import '../checkbox.component';
12
- suite('nr-checkbox', () => {
13
- test('init checkbox', () => __awaiter(void 0, void 0, void 0, function* () {
14
- const el = yield fixture(html `<nr-checkbox></nr-checkbox>`);
15
- const input = el.shadowRoot.querySelector('input[type="checkbox"]');
16
- const inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');
17
- expect(el.disabled).to.be.false;
18
- expect(el.indeterminate).to.be.false;
19
- expect(el.disabled).to.be.false;
20
- expect(input).to.exist;
21
- expect(inputContent).to.equal('""');
22
- }));
23
- test('should reflect the checked attribute', () => __awaiter(void 0, void 0, void 0, function* () {
24
- const el = yield fixture(html `<nr-checkbox checked></nr-checkbox>`);
25
- const input = el.shadowRoot.querySelector('input');
26
- const inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');
27
- expect(el.checked).to.be.true;
28
- expect(input.checked).to.be.true;
29
- expect(inputContent).to.not.be.empty;
30
- expect(inputContent).to.contain('✔');
31
- expect(inputContent).to.not.contain('-');
32
- }));
33
- test('should reflect the disabled attribute', () => __awaiter(void 0, void 0, void 0, function* () {
34
- const el = yield fixture(html `<nr-checkbox disabled></nr-checkbox>`);
35
- const input = el.shadowRoot.querySelector('input');
36
- expect(el.disabled).to.be.true;
37
- expect(input.disabled).to.be.true;
38
- }));
39
- test('should reflect indeterminate attribubute', () => __awaiter(void 0, void 0, void 0, function* () {
40
- const el = yield fixture(html `<nr-checkbox indeterminate></nr-checkbox>`);
41
- const input = el.shadowRoot.querySelector('input');
42
- const inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');
43
- expect(el.indeterminate).to.be.true;
44
- expect(inputContent).to.not.be.empty;
45
- expect(inputContent).to.contain('-');
46
- expect(inputContent).to.not.contain('✔');
47
- }));
48
- test('should toggle checked state on change', () => __awaiter(void 0, void 0, void 0, function* () {
49
- const el = yield fixture(html `<nr-checkbox></nr-checkbox>`);
50
- let input = el.shadowRoot.querySelector('input');
51
- let inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');
52
- expect(el.checked).to.be.false;
53
- expect(inputContent).to.equal('""');
54
- input.click();
55
- yield el.updateComplete;
56
- input = el.shadowRoot.querySelector('input');
57
- inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');
58
- expect(el.checked).to.be.true;
59
- expect(inputContent).to.contain('✔');
60
- input.click();
61
- yield el.updateComplete;
62
- input = el.shadowRoot.querySelector('input');
63
- inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');
64
- expect(el.checked).to.be.false;
65
- expect(inputContent).to.equal('""');
66
- }));
67
- test('should dispatch "nr-change" event on change', () => __awaiter(void 0, void 0, void 0, function* () {
68
- const el = yield fixture(html `<nr-checkbox></nr-checkbox>`);
69
- const input = el.shadowRoot.querySelector('input');
70
- let checkboxChangedDispatched = false;
71
- el.addEventListener('nr-change', () => {
72
- checkboxChangedDispatched = true;
73
- });
74
- input.click();
75
- expect(checkboxChangedDispatched).to.be.true;
76
- }));
77
- test('should not dispatch "nr-change" event on change when checkbox is disabled', () => __awaiter(void 0, void 0, void 0, function* () {
78
- const el = yield fixture(html `<nr-checkbox disabled></nr-checkbox>`);
79
- const input = el.shadowRoot.querySelector('input');
80
- let checkboxChangedDispatched = false;
81
- el.addEventListener('nr-change', () => {
82
- checkboxChangedDispatched = true;
83
- });
84
- input.click();
85
- expect(checkboxChangedDispatched).to.be.false;
86
- }));
87
- });
88
- //# sourceMappingURL=checkbox_test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox_test.js","sourceRoot":"","sources":["../../../../src/components/checkbox/test/checkbox_test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,M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M,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAChD,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, fixture, expect } from '@open-wc/testing';\nimport '../checkbox.component';\nimport { NrCheckboxElement } from '../checkbox.component';\n\nsuite('nr-checkbox', () => {\n test('init checkbox', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox></nr-checkbox>`)!;\n const input = el.shadowRoot!.querySelector('input[type=\"checkbox\"]')!;\n const inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');\n expect(el.disabled).to.be.false;\n expect(el.indeterminate).to.be.false;\n expect(el.disabled).to.be.false;\n expect(input).to.exist;\n expect(inputContent).to.equal('\"\"');\n });\n\n test('should reflect the checked attribute', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox checked></nr-checkbox>`);\n const input: HTMLInputElement = el.shadowRoot!.querySelector('input')!;\n const inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');\n expect(el.checked).to.be.true;\n expect(input.checked).to.be.true;\n expect(inputContent).to.not.be.empty;\n expect(inputContent).to.contain('✔');\n expect(inputContent).to.not.contain('-');\n });\n\n test('should reflect the disabled attribute', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox disabled></nr-checkbox>`)!;\n const input: HTMLInputElement = el.shadowRoot!.querySelector('input')!;\n expect(el.disabled).to.be.true;\n expect(input.disabled).to.be.true;\n });\n\n test('should reflect indeterminate attribubute', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox indeterminate></nr-checkbox>`);\n const input: HTMLInputElement = el.shadowRoot!.querySelector('input')!;\n const inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');\n\n expect(el.indeterminate).to.be.true;\n expect(inputContent).to.not.be.empty;\n expect(inputContent).to.contain('-');\n expect(inputContent).to.not.contain('✔');\n });\n\n test('should toggle checked state on change', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox></nr-checkbox>`);\n let input: HTMLInputElement = el.shadowRoot!.querySelector('input')!;\n let inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');\n\n expect(el.checked).to.be.false;\n expect(inputContent).to.equal('\"\"');\n\n input.click();\n await el.updateComplete;\n input = el.shadowRoot!.querySelector('input')!;\n inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');\n\n expect(el.checked).to.be.true;\n expect(inputContent).to.contain('✔');\n\n input.click();\n await el.updateComplete;\n input = el.shadowRoot!.querySelector('input')!;\n inputContent = window.getComputedStyle(input, '::after').getPropertyValue('content');\n expect(el.checked).to.be.false;\n expect(inputContent).to.equal('\"\"');\n });\n\n test('should dispatch \"nr-change\" event on change', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox></nr-checkbox>`)!;\n const input: HTMLInputElement = el.shadowRoot!.querySelector('input')!;\n let checkboxChangedDispatched = false;\n\n el.addEventListener('nr-change', () => {\n checkboxChangedDispatched = true;\n });\n\n input.click();\n\n expect(checkboxChangedDispatched).to.be.true;\n });\n\n test('should not dispatch \"nr-change\" event on change when checkbox is disabled', async () => {\n const el: NrCheckboxElement = await fixture(html`<nr-checkbox disabled></nr-checkbox>`)!;\n const input: HTMLInputElement = el.shadowRoot!.querySelector('input')!;\n let checkboxChangedDispatched = false;\n\n el.addEventListener('nr-change', () => {\n checkboxChangedDispatched = true;\n });\n\n input.click();\n\n expect(checkboxChangedDispatched).to.be.false;\n });\n});\n"]}