tekivex-ui 2.5.6 → 2.5.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/README.md +5 -5
- package/dist/{TkxForm-DwV_n-eE.cjs → TkxForm-BK5Sq7oj.cjs} +1 -1
- package/dist/{TkxForm-DSMDo2Ol.js → TkxForm-br3i_vo8.js} +3 -3
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +1 -1
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +4 -4
- package/dist/{index-eT_U4qB2.js → index-CAXjeKoK.js} +13 -12
- package/dist/index-DB_m7X7e.cjs +2 -0
- package/dist/index.cjs +21 -21
- package/dist/index.js +1062 -1059
- package/dist/quantum.cjs +1 -1
- package/dist/quantum.js +3 -3
- package/dist/realtime.cjs +1 -1
- package/dist/realtime.js +2 -2
- package/dist/{security-C369oOWH.cjs → security-DMqZVW5d.cjs} +1 -1
- package/dist/{security-CzAmaMqa.js → security-loRa1HyV.js} +1 -1
- package/dist/src/components/TkxAlert.d.ts.map +1 -1
- package/dist/src/components/TkxToast.d.ts +2 -1
- package/dist/src/components/TkxToast.d.ts.map +1 -1
- package/dist/src/engine/wcag.d.ts.map +1 -1
- package/dist/{tkx-BeNyC0w7.cjs → tkx-69KQ0myA.cjs} +1 -1
- package/dist/{tkx-BJ10JtMv.js → tkx-C_AlpMt4.js} +1 -1
- package/package.json +2 -2
- package/src/components/TkxAlert.tsx +2 -1
- package/src/components/TkxBadge.tsx +2 -2
- package/src/components/TkxToast.tsx +5 -4
- package/src/engine/wcag.ts +2 -1
- package/dist/index-BINBzXuY.cjs +0 -2
package/dist/quantum.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("react"),Z=require("./index-BINBzXuY.cjs"),se=require("./tkx-BeNyC0w7.cjs"),Y=require("./security-C369oOWH.cjs");class R{constructor(e,o){this.re=e,this.im=o}add(e){return new R(this.re+e.re,this.im+e.im)}sub(e){return new R(this.re-e.re,this.im-e.im)}mul(e){return new R(this.re*e.re-this.im*e.im,this.re*e.im+this.im*e.re)}scale(e){return new R(this.re*e,this.im*e)}conjugate(){return new R(this.re,-this.im)}magnitudeSquared(){return this.re*this.re+this.im*this.im}magnitude(){return Math.sqrt(this.magnitudeSquared())}static fromPolar(e,o){return new R(e*Math.cos(o),e*Math.sin(o))}static zero(){return new R(0,0)}static one(){return new R(1,0)}}class I{constructor(e=R.one(),o=R.zero()){this.alpha=e,this.beta=o,this.normalize()}normalize(){const e=Math.sqrt(this.alpha.magnitudeSquared()+this.beta.magnitudeSquared());e>0&&(this.alpha=this.alpha.scale(1/e),this.beta=this.beta.scale(1/e))}hadamard(){const e=1/Math.SQRT2,o=this.alpha.add(this.beta).scale(e),a=this.alpha.sub(this.beta).scale(e);return new I(o,a)}ry(e){const o=Math.cos(e/2),a=Math.sin(e/2),r=this.alpha.scale(o).sub(this.beta.scale(a)),l=this.alpha.scale(a).add(this.beta.scale(o));return new I(r,l)}phase(e){const o=R.fromPolar(1,e);return new I(this.alpha,this.beta.mul(o))}measure(){const e=this.beta.magnitudeSquared();return Math.random()<e?1:0}expectation(){return this.beta.magnitudeSquared()}getAlpha(){return this.alpha}getBeta(){return this.beta}}class ae{constructor(e){this.qubits=Array.from({length:e},()=>new I)}get size(){return this.qubits.length}getQubit(e){return this.qubits[e]}superpose(){this.qubits=this.qubits.map(e=>e.hadamard())}cnot(e,o){const a=this.qubits[e],r=this.qubits[o],l=a.expectation();this.qubits[o]=r.ry(Math.PI*l)}rotate(e,o){this.qubits[e]=this.qubits[e].ry(o)}measure(){return this.qubits.map(e=>e.measure())}probs(){return this.qubits.map(e=>e.expectation())}}class V{constructor(e=1,o=.995,a=.3,r=1e-6){this.temperature=e,this.coolingRate=o,this.tunnelingStrength=a,this.minTemp=r}anneal(e,o,a,r=1e3){let l=e,i=o(l),d=l,s=i,c=this.temperature,g=0,h=0;for(let m=0;m<r&&c>this.minTemp;m++){const b=a(l),p=o(b),v=p-i;let S=!1;if(v<=0)S=!0;else{const k=Math.exp(-v/c),q=Math.sqrt(2*Math.abs(v)),E=Math.abs(v),w=Math.exp(-2*q*Math.sqrt(E)*this.tunnelingStrength);Math.random()<k+w&&(S=!0,Math.random()<w/(k+w+1e-10)&&h++)}S&&(l=b,i=p,g++,i<s&&(d=l,s=i)),c*=this.coolingRate}return{state:d,energy:s,iterations:r,accepted:g,tunnels:h}}}class ie{constructor(e,o){const a=Math.sqrt(2/(e+o));this.weights=Array.from({length:e},()=>Array.from({length:o},()=>(Math.random()*2-1)*a)),this.visibleBias=Array.from({length:e},()=>0),this.hiddenBias=Array.from({length:o},()=>0)}sigmoid(e){const o=(Math.random()-.5)*.1;return 1/(1+Math.exp(-(e+o)))}sample(e){return Math.random()<e?1:0}energy(e,o){const a=this.visibleBias.reduce((i,d,s)=>i+d*e[s],0),r=this.hiddenBias.reduce((i,d,s)=>i+d*o[s],0);let l=0;for(let i=0;i<e.length;i++)for(let d=0;d<o.length;d++)l+=e[i]*this.weights[i][d]*o[d];return-(a+r+l)}hiddenProbs(e){return this.hiddenBias.map((o,a)=>{const r=o+e.reduce((l,i,d)=>l+this.weights[d][a]*i,0);return this.sigmoid(r)})}visibleProbs(e){return this.visibleBias.map((o,a)=>{const r=o+e.reduce((l,i,d)=>l+this.weights[a][d]*i,0);return this.sigmoid(r)})}gibbs(e,o=1){let a=[...e],r=[];for(let l=0;l<o;l++)r=this.hiddenProbs(a).map(i=>this.sample(i)),a=this.visibleProbs(r).map(i=>this.sample(i));return{visible:a,hidden:r}}trainCD1(e,o=.01){const a=this.visibleBias.length,r=this.hiddenBias.length,l=Array.from({length:a},()=>Array(r).fill(0)),i=Array(a).fill(0),d=Array(r).fill(0);for(const c of e){const g=this.hiddenProbs(c),h=g.map(p=>this.sample(p)),m=this.visibleProbs(h).map(p=>this.sample(p)),b=this.hiddenProbs(m);for(let p=0;p<a;p++){for(let v=0;v<r;v++)l[p][v]+=c[p]*g[v]-m[p]*b[v];i[p]+=c[p]-m[p]}for(let p=0;p<r;p++)d[p]+=g[p]-b[p]}const s=e.length;for(let c=0;c<a;c++){for(let g=0;g<r;g++)this.weights[c][g]+=o*l[c][g]/s;this.visibleBias[c]+=o*i[c]/s}for(let c=0;c<r;c++)this.hiddenBias[c]+=o*d[c]/s}infer(e){const o=this.hiddenProbs(e),a=o.map(l=>this.sample(l)),r=this.visibleProbs(a);return{hidden:o,visible:r,energy:this.energy(e,a),iterations:1}}}class G{amplify(e,o,a=.5){const r=e.length;if(r===0)return[];const l=e.map(o),i=l.filter(h=>h>a).length,d=Math.max(1,i);let s=Array(r).fill(1/Math.sqrt(r));const c=Math.max(1,Math.floor(Math.PI/4*Math.sqrt(r/d)));for(let h=0;h<c;h++){for(let b=0;b<r;b++)l[b]>a&&(s[b]=-s[b]);const m=s.reduce((b,p)=>b+p,0)/r;s=s.map(b=>2*m-b)}return e.map((h,m)=>({index:m,amplitude:s[m],probability:s[m]*s[m],classicalSimilarity:l[m],combined:s[m]*s[m]*.6+l[m]*.4})).sort((h,m)=>m.combined-h.combined)}}const J=[{keywords:["email","e-mail","mail"],type:"email",validations:[{rule:"required",message:"Email is required"},{rule:"pattern",value:"^[^@]+@[^@]+\\.[^@]+$",message:"Enter a valid email address"},{rule:"maxLength",value:254,message:"Email too long"}],placeholder:"you@example.com",label:"Email Address",confidence:.98},{keywords:["password","passwd","pwd","pass"],type:"password",validations:[{rule:"required",message:"Password is required"},{rule:"minLength",value:8,message:"Password must be at least 8 characters"},{rule:"pattern",value:"(?=.*[A-Z])(?=.*[0-9])",message:"Include uppercase and a number"}],placeholder:"••••••••",label:"Password",confidence:.97},{keywords:["confirm_password","confirmpassword","confirm_pass","repassword","password2","repeat_password"],type:"password",validations:[{rule:"required",message:"Please confirm your password"},{rule:"match",value:"password",message:"Passwords do not match"}],placeholder:"••••••••",label:"Confirm Password",confidence:.95},{keywords:["phone","mobile","cell","tel","telephone","contact_number"],type:"tel",validations:[{rule:"pattern",value:"^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$",message:"Enter a valid phone number"}],placeholder:"+1 (555) 000-0000",label:"Phone Number",confidence:.93},{keywords:["age"],type:"number",validations:[{rule:"min",value:0,message:"Age cannot be negative"},{rule:"max",value:150,message:"Enter a valid age"},{rule:"integer",message:"Age must be a whole number"}],placeholder:"25",label:"Age",confidence:.9},{keywords:["price","amount","cost","fee","payment","salary","wage","total"],type:"number",validations:[{rule:"min",value:0,message:"Amount cannot be negative"},{rule:"pattern",value:"^\\d+(\\.\\d{1,2})?$",message:"Enter a valid amount (e.g. 9.99)"}],placeholder:"0.00",label:"Amount",confidence:.88},{keywords:["url","website","site","link","homepage","web"],type:"url",validations:[{rule:"pattern",value:"https?://.+",message:"Enter a valid URL starting with http:// or https://"}],placeholder:"https://example.com",label:"Website URL",confidence:.92},{keywords:["zip","zipcode","postal","postcode","pin_code"],type:"text",validations:[{rule:"pattern",value:"^[0-9]{5}(-[0-9]{4})?$",message:"Enter a valid ZIP code (e.g. 12345)"}],placeholder:"12345",label:"ZIP / Postal Code",confidence:.91},{keywords:["date","dob","birthday","birth_date","birthdate","born"],type:"date",validations:[{rule:"required",message:"Date is required"}],placeholder:"YYYY-MM-DD",label:"Date of Birth",confidence:.89},{keywords:["first_name","firstname","fname","given_name"],type:"text",validations:[{rule:"minLength",value:2,message:"First name too short"},{rule:"maxLength",value:50,message:"First name too long"}],placeholder:"Jane",label:"First Name",confidence:.9},{keywords:["last_name","lastname","lname","surname","family_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Last name too short"},{rule:"maxLength",value:50,message:"Last name too long"}],placeholder:"Doe",label:"Last Name",confidence:.9},{keywords:["name","full_name","fullname","display_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Name too short"},{rule:"maxLength",value:100,message:"Name too long"}],placeholder:"Jane Doe",label:"Full Name",confidence:.85},{keywords:["username","user_name","handle","login","loginname"],type:"text",validations:[{rule:"minLength",value:3,message:"Username must be at least 3 characters"},{rule:"maxLength",value:32,message:"Username too long"},{rule:"pattern",value:"^[a-zA-Z0-9_.-]+$",message:"Only letters, numbers, _, - and . allowed"}],placeholder:"cooluser42",label:"Username",confidence:.94},{keywords:["bio","biography","about","description","summary","details"],type:"textarea",validations:[{rule:"maxLength",value:500,message:"Bio must be under 500 characters"}],placeholder:"Tell us about yourself...",label:"Bio",confidence:.87},{keywords:["message","comment","feedback","note","notes","remarks","body"],type:"textarea",validations:[{rule:"minLength",value:10,message:"Message too short"},{rule:"maxLength",value:2e3,message:"Message too long"}],placeholder:"Write your message here...",label:"Message",confidence:.86},{keywords:["search","query","q","keyword","find"],type:"search",validations:[],placeholder:"Search...",label:"Search",confidence:.9},{keywords:["otp","one_time_password","verification_code","pin","code"],type:"text",validations:[{rule:"minLength",value:4,message:"Code too short"},{rule:"maxLength",value:8,message:"Code too long"},{rule:"pattern",value:"^[0-9]+$",message:"Code must be numeric"}],placeholder:"123456",label:"Verification Code",confidence:.92},{keywords:["color","colour","hex_color","brand_color"],type:"color",validations:[],placeholder:"#3b82f6",label:"Color",confidence:.95},{keywords:["address","street","street_address","addr"],type:"text",validations:[{rule:"maxLength",value:200,message:"Address too long"}],placeholder:"123 Main Street",label:"Street Address",confidence:.87},{keywords:["city","town","municipality"],type:"text",validations:[{rule:"maxLength",value:100,message:"City name too long"}],placeholder:"San Francisco",label:"City",confidence:.89},{keywords:["country","nation","country_code"],type:"text",validations:[],placeholder:"United States",label:"Country",confidence:.88},{keywords:["company","organization","org","employer","company_name"],type:"text",validations:[{rule:"maxLength",value:200,message:"Company name too long"}],placeholder:"Acme Inc.",label:"Company",confidence:.87}];function X(n){const e=n.toLowerCase().replace(/[\s-]/g,"_"),a=new G().amplify(J,r=>{let l=0;for(const i of r.keywords)e===i?l=Math.max(l,1):e.includes(i)||i.includes(e)?l=Math.max(l,.8):i.split("_").some(d=>e.includes(d))&&(l=Math.max(l,.5));return l},.3);if(a.length>0&&a[0].combined>.1){const r=J[a[0].index];return{type:r.type,validations:r.validations,placeholder:r.placeholder,confidence:Math.min(r.confidence*a[0].combined*2,.99),label:r.label}}return{type:"text",validations:[{rule:"maxLength",value:255,message:"Input too long"}],placeholder:n.replace(/_/g," "),confidence:.3,label:n.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}}function O(n,e,o){const a=e/100,r=o/100,l=a*Math.min(r,1-r),i=d=>{const s=(d+n/30)%12,c=r-l*Math.max(Math.min(s-3,9-s,1),-1);return Math.round(255*c).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function ue(n){const e=n.replace("#",""),o=e.length===3?e.split("").map(a=>a+a).join(""):e;return[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)]}function K(n){const[e,o,a]=ue(n).map(r=>{const l=r/255;return l<=.03928?l/12.92:((l+.055)/1.055)**2.4});return .2126*e+.7152*o+.0722*a}function H(n,e){const o=K(n),a=K(e),r=Math.max(o,a),l=Math.min(o,a);return(r+.05)/(l+.05)}function pe(n,e){const o=r=>O(r.h,r.s,r.l),a=e?n.text.l-20:n.text.l+15;return{primary:o(n.primary),secondary:o(n.secondary),background:o(n.bg),surface:o(n.surface),text:o(n.text),textMuted:O(n.text.h,Math.max(0,n.text.s-10),Math.max(20,Math.min(85,a))),border:o(n.border),error:e?"#f87171":"#dc2626",warning:e?"#fbbf24":"#d97706",success:e?"#34d399":"#059669",accent:o(n.accent)}}function he(n,e){let o=0;const a=k=>O(k.h,k.s,k.l),r=a(n.text),l=a(n.bg),i=a(n.surface),d=a(n.primary),s=H(r,l),c=H(r,i),g=H(d,l);s<4.5&&(o+=(4.5-s)*10),c<4.5&&(o+=(4.5-c)*8),g<3&&(o+=(3-g)*5);const m=Math.abs((n.secondary.h-n.primary.h+360)%360-137.508);o+=m*.05;const b=Math.abs((n.accent.h-n.primary.h+360)%360-120);o+=b*.03;const p=(n.primary.s+n.secondary.s)/2;p<20&&(o+=(20-p)*.5),p>90&&(o+=(p-90)*.5);const v=n.bg.l;e?(v>25&&(o+=(v-25)*2),v<3&&(o+=(3-v)*2),n.text.l<70&&(o+=(70-n.text.l)*1.5)):(v<90&&(o+=(90-v)*2),v>100&&(o+=(v-100)*2),n.text.l>30&&(o+=(n.text.l-30)*1.5));const S=Math.abs(n.surface.l-n.bg.l);return S<2&&(o+=(2-S)*2),S>12&&(o+=(S-12)*1),o}function ee(n,e,o){return Math.max(e,Math.min(o,n))}function le(n,e,o=800){const a=e?{primary:{h:n,s:70,l:55},secondary:{h:(n+137.5)%360,s:65,l:50},bg:{h:n,s:10,l:8},surface:{h:n,s:10,l:13},text:{h:n,s:15,l:90},border:{h:n,s:15,l:22},accent:{h:(n+120)%360,s:75,l:60}}:{primary:{h:n,s:65,l:40},secondary:{h:(n+137.5)%360,s:55,l:38},bg:{h:n,s:15,l:97},surface:{h:n,s:12,l:100},text:{h:n,s:15,l:12},border:{h:n,s:12,l:85},accent:{h:(n+120)%360,s:70,l:42}},l=new V(1.5,.994,.35,1e-5).anneal(a,i=>he(i,e),i=>{const d=["primary","secondary","bg","surface","text","border","accent"],s=d[Math.floor(Math.random()*d.length)],c=["h","s","l"],g=c[Math.floor(Math.random()*c.length)],h=(Math.random()-.5)*(g==="h"?30:15),m={...i,[s]:{...i[s]}};return g==="h"?m[s]={...m[s],h:(i[s].h+h+360)%360}:g==="s"?m[s]={...m[s],s:ee(i[s].s+h,0,100)}:m[s]={...m[s],l:ee(i[s].l+h,0,100)},m},o);return pe(l.state,e)}const U={qubit(){return new I},register(n){return new ae(n)},annealer(n,e,o){return new V(n,e,o)},qbm(n,e){return new ie(n,e)},amplifier(){return new G},inferField:X,optimizeTheme:le,contrast:H,hslToHex:O};function me(n,e,o,a){const r=o.trim();switch(n){case"required":return r!=="";case"email":case"pattern":if(typeof e=="string")try{return r===""||new RegExp(e).test(r)}catch{return!0}return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r);case"phone":return r===""||/^\+?[\d\s\-()]{7,15}$/.test(r);case"url":return r===""||/^https?:\/\/.+/.test(r);case"minLength":case"min":{const l=Number(e??0);return r===""||(isNaN(Number(r))?r.length>=l:Number(r)>=l)}case"maxLength":case"max":{const l=Number(e??1/0);return r===""||(isNaN(Number(r))?r.length<=l:Number(r)<=l)}case"integer":return r===""||/^\d+$/.test(r);case"alphanumeric":return r===""||/^[a-zA-Z0-9]+$/.test(r);case"match":return r===(a[typeof e=="string"?e:"password"]??"");default:return!0}}function xe({phase:n,collapsed:e,primaryColor:o,borderColor:a}){const d=e?0:n,s=e?0:n*1.618,c=12+10*Math.sin(d)*Math.cos(s),g=12-10*Math.cos(d);return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",style:{flexShrink:0,opacity:e?.4:1,transition:"opacity 0.6s"},children:[t.jsx("circle",{cx:12,cy:12,r:10,fill:"none",stroke:a,strokeWidth:"0.8"}),t.jsx("ellipse",{cx:12,cy:12,rx:10,ry:10*.3,fill:"none",stroke:a,strokeWidth:"0.5",strokeDasharray:"2 2"}),t.jsx("line",{x1:12,y1:2,x2:12,y2:22,stroke:a,strokeWidth:"0.5"}),t.jsx("line",{x1:12,y1:12,x2:c,y2:g,stroke:o,strokeWidth:"1.5",style:{transition:e?"all 0.6s ease-out":"none"}}),t.jsx("circle",{cx:c,cy:g,r:"2",fill:o,style:{transition:e?"all 0.6s ease-out":"none"}})]})}function ge({confidence:n,theme:e}){const o=Math.round(n*100),a=o>=80?e.success:o>=60?e.warning:e.danger;return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",fontSize:"10px",fontWeight:600,padding:"1px 5px",borderRadius:"999px",backgroundColor:`${a}22`,color:a,border:`1px solid ${a}44`,marginLeft:"6px",verticalAlign:"middle",letterSpacing:"0.03em"},children:["⚛ ",o,"%"]})}function fe({config:n,intel:e,qubitPhase:o,value:a,error:r,touched:l,showConfidence:i,showQuantumState:d,collapsed:s,onChange:c,onBlur:g,theme:h,mounted:m,index:b}){const p=n.type??e.type,v=n.label??e.label,S=n.placeholder??e.placeholder,k=n.required!==void 0?n.required:e.validations.some($=>$.rule==="required"),q=Y.sanitizeString(v),E=p==="textarea",w=l&&r!=="",A=`qf-${n.name}`,W={width:"100%",padding:"9px 12px",border:`1.5px solid ${w?h.danger:h.border}`,borderRadius:"8px",backgroundColor:h.surface,color:h.text,fontSize:"14px",fontFamily:"inherit",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s",resize:E?"vertical":void 0,minHeight:E?"80px":void 0};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",opacity:m?1:0,transform:m?"scaleY(1)":"scaleY(0.92)",transition:`opacity 0.35s ease ${b*60}ms, transform 0.35s ease ${b*60}ms`,transformOrigin:"top"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d&&t.jsx(xe,{phase:o,collapsed:s,primaryColor:h.primary,borderColor:h.border}),t.jsxs("label",{htmlFor:A,style:{fontSize:"13px",fontWeight:500,color:h.text,cursor:"pointer"},children:[q,k&&t.jsx("span",{"aria-hidden":"true",style:{color:h.danger,marginLeft:"3px"},children:"*"})]}),i&&t.jsx(ge,{confidence:e.confidence,theme:h})]}),E?t.jsx("textarea",{id:A,value:a,onChange:$=>c($.target.value),onBlur:g,placeholder:S,"aria-invalid":w,"aria-required":k,style:W}):t.jsx("input",{id:A,type:p,value:a,onChange:$=>c($.target.value),onBlur:g,placeholder:S,"aria-invalid":w,"aria-required":k,style:W}),w&&t.jsxs("span",{role:"alert",style:{fontSize:"12px",color:h.danger,display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),Y.sanitizeString(r)]})]})}function ye(n){let e=2166136261;for(let o=0;o<n.length;o++)e^=n.charCodeAt(o),e=Math.imul(e,16777619)>>>0;return(e&65535)/65535*Math.PI*2}function de({fields:n,onSubmit:e,submitLabel:o="Submit",layout:a="vertical",showConfidence:r=!0,showQuantumState:l=!1}){const i=Z.useTheme(),d=n.map(f=>X(f.name)),[s,c]=x.useState(()=>Object.fromEntries(n.map(f=>[f.name,""]))),[g,h]=x.useState({}),[m,b]=x.useState({}),[p,v]=x.useState(!1),[S,k]=x.useState(!1),[q,E]=x.useState(!1);x.useEffect(()=>{const f=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(f)},[]);const w=x.useCallback((f,u)=>{const y=n.find(M=>M.name===f),C=d[n.findIndex(M=>M.name===f)];if(!y||!C)return"";const j=u[f]??"";for(const{rule:M,value:P,message:_}of C.validations)if(!(M==="required"&&y.required===!1)&&!me(M,P,j,u))return _;return""},[n]),A=x.useCallback(f=>{const u={};for(const y of n){const C=w(y.name,f);C&&(u[y.name]=C)}return u},[n,w]),W=x.useCallback((f,u)=>{c(y=>{var j;const C={...y,[f]:u};if(m[f]&&(h(M=>({...M,[f]:w(f,C)})),f==="password")){const M=(j=n.find(P=>["confirmpassword","confirm_password","passwordconfirm"].includes(P.name.toLowerCase().replace(/[\s_-]/g,""))))==null?void 0:j.name;M&&m[M]&&h(P=>({...P,[M]:w(M,C)}))}return C}),E(!0)},[n,m,w]),$=x.useCallback(f=>{b(u=>({...u,[f]:!0})),h(u=>({...u,[f]:w(f,s)}))},[s,w]),N=x.useCallback(async f=>{f.preventDefault();const u=Object.fromEntries(n.map(C=>[C.name,!0]));b(u);const y=A(s);if(h(y),!(Object.keys(y).length>0)){v(!0);try{await e(s)}finally{v(!1)}}},[n,s,A,e]),B=d.length>0?Math.round(d.reduce((f,u)=>f+u.confidence,0)/d.length*100):0,F=B>=80?i.success:B>=60?i.warning:i.danger,L=a==="horizontal";return t.jsxs("form",{onSubmit:N,noValidate:!0,className:se.tkx("w-full"),style:{backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:"12px",padding:"24px",position:"relative",boxSizing:"border-box"},children:[t.jsx("span",{"aria-label":"Powered by Quantum AI",style:{position:"absolute",top:"16px",right:"16px",fontSize:"10px",fontWeight:700,padding:"3px 8px",borderRadius:"999px",backgroundColor:`${i.primary}20`,color:i.primary,border:`1px solid ${i.primary}44`,letterSpacing:"0.04em",userSelect:"none"},children:"⚛ Quantum AI"}),r&&t.jsxs("div",{style:{marginBottom:"20px",paddingRight:"100px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[t.jsx("span",{style:{fontSize:"11px",color:i.textMuted,fontWeight:500},children:"Form Intelligence Confidence"}),t.jsxs("span",{style:{fontSize:"11px",fontWeight:700,color:F},children:[B,"%"]})]}),t.jsx("div",{style:{height:"4px",borderRadius:"4px",backgroundColor:i.border,overflow:"hidden"},children:t.jsx("div",{style:{height:"100%",width:`${B}%`,backgroundColor:F,borderRadius:"4px",transition:"width 0.8s ease"}})})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:L?"repeat(auto-fill, minmax(260px, 1fr))":"1fr",gap:"16px",marginBottom:"20px"},children:n.map((f,u)=>t.jsx(fe,{config:f,intel:d[u],qubitPhase:ye(f.name),value:s[f.name]??"",error:g[f.name]??"",touched:m[f.name]??!1,showConfidence:r,showQuantumState:l,collapsed:q,onChange:y=>W(f.name,y),onBlur:()=>$(f.name),theme:i,mounted:S,index:u},f.name))}),t.jsx("button",{type:"submit",disabled:p,style:{width:"100%",padding:"10px 20px",borderRadius:"8px",border:"none",backgroundColor:p?`${i.primary}88`:i.primary,color:i.bg,fontSize:"14px",fontWeight:700,fontFamily:"inherit",cursor:p?"not-allowed":"pointer",transition:"background-color 0.15s, opacity 0.15s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:p?t.jsxs(t.Fragment,{children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{animation:"qf-spin 0.8s linear infinite"},"aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]}),"Processing…"]}):Y.sanitizeString(o)}),t.jsx("style",{children:"@keyframes qf-spin { to { transform: rotate(360deg); } }"})]})}de.displayName="TkxQuantumForm";function te(n){return n?{primary:"#00f5d4",secondary:"#7b2ff7",background:"#0a0a0f",surface:"#12121a",text:"#e8e8f4",textMuted:"#8888aa",border:"#2a2a3e",error:"#f87171",warning:"#fbbf24",success:"#34d399",accent:"#ff6b6b"}:{primary:"#0d7c5f",secondary:"#6930c3",background:"#f8f6f1",surface:"#ffffff",text:"#1a1815",textMuted:"#6b6560",border:"#ddd8cc",error:"#dc2626",warning:"#d97706",success:"#059669",accent:"#e05a00"}}function be({points:n,primary:e}){if(n.length<2)return t.jsx("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"center",color:"#888",fontSize:12},children:"Waiting for data..."});const o=280,a=48,r=Math.max(...n.map(c=>c.energy)),l=Math.min(...n.map(c=>c.energy)),i=r-l||1,d=n[n.length-1].iteration||1,s=n.map(c=>{const g=c.iteration/d*o,h=a-(c.energy-l)/i*(a-4)-2;return`${g.toFixed(1)},${h.toFixed(1)}`}).join(" ");return t.jsxs("svg",{width:o,height:a,style:{display:"block"},children:[t.jsx("polyline",{points:s,fill:"none",stroke:e,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),t.jsxs("text",{x:2,y:10,fontSize:9,fill:"#888",children:["E=",r.toFixed(1)]}),t.jsxs("text",{x:2,y:a-2,fontSize:9,fill:"#888",children:["E=",l.toFixed(1)]})]})}function ve({label:n,value:e,onChange:o,text:a,border:r}){return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[t.jsx("input",{type:"color",value:e,onChange:l=>o(l.target.value),style:{width:32,height:32,border:`1px solid ${r}`,borderRadius:6,padding:2,cursor:"pointer",background:"transparent"}}),t.jsx("div",{style:{width:60,height:28,borderRadius:6,background:e,border:`1px solid ${r}`}}),t.jsx("span",{style:{flex:1,fontSize:13,color:a,fontFamily:"monospace"},children:n}),t.jsx("code",{style:{fontSize:12,color:a,opacity:.7,fontFamily:"monospace"},children:e})]})}function ke({label:n,ratio:e}){const o=e>=4.5,a=e>=4.5,r=e>=7;return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[t.jsx("span",{style:{fontSize:11,opacity:.8,minWidth:140},children:n}),t.jsxs("span",{style:{fontSize:12,fontWeight:600},children:[e.toFixed(2),":1"]}),t.jsx("span",{style:{fontSize:11,color:a?"#22c55e":"#ef4444"},children:a?"✓ AA":"✗ AA"}),t.jsx("span",{style:{fontSize:11,color:r?"#22c55e":"#888"},children:r?"✓ AAA":"— AAA"}),t.jsx("span",{style:{fontSize:13},children:o?"✅":"❌"})]})}function we({onThemeChange:n,initialHue:e=210,initialMode:o="dark"}){const a=Z.useTheme(),[r,l]=x.useState(o),[i,d]=x.useState(e),[s,c]=x.useState(()=>te(o==="dark")),[g,h]=x.useState(!1),[m,b]=x.useState([]),[p,v]=x.useState(!1),S=x.useRef(null),k=r==="dark",q=x.useCallback((u,y)=>{c(C=>{const j={...C,[u]:y};return n==null||n(j),j})},[n]),E=x.useCallback(()=>{if(g)return;h(!0),b([]);let u=0;const y=600,C=60,j=[],M=()=>{u+=C,U.optimizeTheme(i,k,u);const P=u/y,_=50*(1-P)+2,Q=(Math.random()-.5)*8*(1-P*.8);if(j.push({iteration:u,energy:Math.max(0,_+Q)}),b([...j]),u<y)S.current=window.setTimeout(M,40);else{const z=U.optimizeTheme(i,k,1e3);c(z),n==null||n(z),h(!1)}};S.current=window.setTimeout(M,16)},[i,k,g,n]),w=x.useCallback(()=>{const u=r==="dark"?"light":"dark";l(u);const y=te(u==="dark");c(y),n==null||n(y)},[r,n]),A=x.useCallback(()=>{const u=`export const myTheme = {
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("react"),Z=require("./index-DB_m7X7e.cjs"),se=require("./tkx-69KQ0myA.cjs"),Y=require("./security-DMqZVW5d.cjs");class R{constructor(e,o){this.re=e,this.im=o}add(e){return new R(this.re+e.re,this.im+e.im)}sub(e){return new R(this.re-e.re,this.im-e.im)}mul(e){return new R(this.re*e.re-this.im*e.im,this.re*e.im+this.im*e.re)}scale(e){return new R(this.re*e,this.im*e)}conjugate(){return new R(this.re,-this.im)}magnitudeSquared(){return this.re*this.re+this.im*this.im}magnitude(){return Math.sqrt(this.magnitudeSquared())}static fromPolar(e,o){return new R(e*Math.cos(o),e*Math.sin(o))}static zero(){return new R(0,0)}static one(){return new R(1,0)}}class I{constructor(e=R.one(),o=R.zero()){this.alpha=e,this.beta=o,this.normalize()}normalize(){const e=Math.sqrt(this.alpha.magnitudeSquared()+this.beta.magnitudeSquared());e>0&&(this.alpha=this.alpha.scale(1/e),this.beta=this.beta.scale(1/e))}hadamard(){const e=1/Math.SQRT2,o=this.alpha.add(this.beta).scale(e),a=this.alpha.sub(this.beta).scale(e);return new I(o,a)}ry(e){const o=Math.cos(e/2),a=Math.sin(e/2),r=this.alpha.scale(o).sub(this.beta.scale(a)),l=this.alpha.scale(a).add(this.beta.scale(o));return new I(r,l)}phase(e){const o=R.fromPolar(1,e);return new I(this.alpha,this.beta.mul(o))}measure(){const e=this.beta.magnitudeSquared();return Math.random()<e?1:0}expectation(){return this.beta.magnitudeSquared()}getAlpha(){return this.alpha}getBeta(){return this.beta}}class ae{constructor(e){this.qubits=Array.from({length:e},()=>new I)}get size(){return this.qubits.length}getQubit(e){return this.qubits[e]}superpose(){this.qubits=this.qubits.map(e=>e.hadamard())}cnot(e,o){const a=this.qubits[e],r=this.qubits[o],l=a.expectation();this.qubits[o]=r.ry(Math.PI*l)}rotate(e,o){this.qubits[e]=this.qubits[e].ry(o)}measure(){return this.qubits.map(e=>e.measure())}probs(){return this.qubits.map(e=>e.expectation())}}class V{constructor(e=1,o=.995,a=.3,r=1e-6){this.temperature=e,this.coolingRate=o,this.tunnelingStrength=a,this.minTemp=r}anneal(e,o,a,r=1e3){let l=e,i=o(l),d=l,s=i,c=this.temperature,g=0,h=0;for(let m=0;m<r&&c>this.minTemp;m++){const b=a(l),p=o(b),v=p-i;let S=!1;if(v<=0)S=!0;else{const k=Math.exp(-v/c),q=Math.sqrt(2*Math.abs(v)),E=Math.abs(v),w=Math.exp(-2*q*Math.sqrt(E)*this.tunnelingStrength);Math.random()<k+w&&(S=!0,Math.random()<w/(k+w+1e-10)&&h++)}S&&(l=b,i=p,g++,i<s&&(d=l,s=i)),c*=this.coolingRate}return{state:d,energy:s,iterations:r,accepted:g,tunnels:h}}}class ie{constructor(e,o){const a=Math.sqrt(2/(e+o));this.weights=Array.from({length:e},()=>Array.from({length:o},()=>(Math.random()*2-1)*a)),this.visibleBias=Array.from({length:e},()=>0),this.hiddenBias=Array.from({length:o},()=>0)}sigmoid(e){const o=(Math.random()-.5)*.1;return 1/(1+Math.exp(-(e+o)))}sample(e){return Math.random()<e?1:0}energy(e,o){const a=this.visibleBias.reduce((i,d,s)=>i+d*e[s],0),r=this.hiddenBias.reduce((i,d,s)=>i+d*o[s],0);let l=0;for(let i=0;i<e.length;i++)for(let d=0;d<o.length;d++)l+=e[i]*this.weights[i][d]*o[d];return-(a+r+l)}hiddenProbs(e){return this.hiddenBias.map((o,a)=>{const r=o+e.reduce((l,i,d)=>l+this.weights[d][a]*i,0);return this.sigmoid(r)})}visibleProbs(e){return this.visibleBias.map((o,a)=>{const r=o+e.reduce((l,i,d)=>l+this.weights[a][d]*i,0);return this.sigmoid(r)})}gibbs(e,o=1){let a=[...e],r=[];for(let l=0;l<o;l++)r=this.hiddenProbs(a).map(i=>this.sample(i)),a=this.visibleProbs(r).map(i=>this.sample(i));return{visible:a,hidden:r}}trainCD1(e,o=.01){const a=this.visibleBias.length,r=this.hiddenBias.length,l=Array.from({length:a},()=>Array(r).fill(0)),i=Array(a).fill(0),d=Array(r).fill(0);for(const c of e){const g=this.hiddenProbs(c),h=g.map(p=>this.sample(p)),m=this.visibleProbs(h).map(p=>this.sample(p)),b=this.hiddenProbs(m);for(let p=0;p<a;p++){for(let v=0;v<r;v++)l[p][v]+=c[p]*g[v]-m[p]*b[v];i[p]+=c[p]-m[p]}for(let p=0;p<r;p++)d[p]+=g[p]-b[p]}const s=e.length;for(let c=0;c<a;c++){for(let g=0;g<r;g++)this.weights[c][g]+=o*l[c][g]/s;this.visibleBias[c]+=o*i[c]/s}for(let c=0;c<r;c++)this.hiddenBias[c]+=o*d[c]/s}infer(e){const o=this.hiddenProbs(e),a=o.map(l=>this.sample(l)),r=this.visibleProbs(a);return{hidden:o,visible:r,energy:this.energy(e,a),iterations:1}}}class G{amplify(e,o,a=.5){const r=e.length;if(r===0)return[];const l=e.map(o),i=l.filter(h=>h>a).length,d=Math.max(1,i);let s=Array(r).fill(1/Math.sqrt(r));const c=Math.max(1,Math.floor(Math.PI/4*Math.sqrt(r/d)));for(let h=0;h<c;h++){for(let b=0;b<r;b++)l[b]>a&&(s[b]=-s[b]);const m=s.reduce((b,p)=>b+p,0)/r;s=s.map(b=>2*m-b)}return e.map((h,m)=>({index:m,amplitude:s[m],probability:s[m]*s[m],classicalSimilarity:l[m],combined:s[m]*s[m]*.6+l[m]*.4})).sort((h,m)=>m.combined-h.combined)}}const J=[{keywords:["email","e-mail","mail"],type:"email",validations:[{rule:"required",message:"Email is required"},{rule:"pattern",value:"^[^@]+@[^@]+\\.[^@]+$",message:"Enter a valid email address"},{rule:"maxLength",value:254,message:"Email too long"}],placeholder:"you@example.com",label:"Email Address",confidence:.98},{keywords:["password","passwd","pwd","pass"],type:"password",validations:[{rule:"required",message:"Password is required"},{rule:"minLength",value:8,message:"Password must be at least 8 characters"},{rule:"pattern",value:"(?=.*[A-Z])(?=.*[0-9])",message:"Include uppercase and a number"}],placeholder:"••••••••",label:"Password",confidence:.97},{keywords:["confirm_password","confirmpassword","confirm_pass","repassword","password2","repeat_password"],type:"password",validations:[{rule:"required",message:"Please confirm your password"},{rule:"match",value:"password",message:"Passwords do not match"}],placeholder:"••••••••",label:"Confirm Password",confidence:.95},{keywords:["phone","mobile","cell","tel","telephone","contact_number"],type:"tel",validations:[{rule:"pattern",value:"^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$",message:"Enter a valid phone number"}],placeholder:"+1 (555) 000-0000",label:"Phone Number",confidence:.93},{keywords:["age"],type:"number",validations:[{rule:"min",value:0,message:"Age cannot be negative"},{rule:"max",value:150,message:"Enter a valid age"},{rule:"integer",message:"Age must be a whole number"}],placeholder:"25",label:"Age",confidence:.9},{keywords:["price","amount","cost","fee","payment","salary","wage","total"],type:"number",validations:[{rule:"min",value:0,message:"Amount cannot be negative"},{rule:"pattern",value:"^\\d+(\\.\\d{1,2})?$",message:"Enter a valid amount (e.g. 9.99)"}],placeholder:"0.00",label:"Amount",confidence:.88},{keywords:["url","website","site","link","homepage","web"],type:"url",validations:[{rule:"pattern",value:"https?://.+",message:"Enter a valid URL starting with http:// or https://"}],placeholder:"https://example.com",label:"Website URL",confidence:.92},{keywords:["zip","zipcode","postal","postcode","pin_code"],type:"text",validations:[{rule:"pattern",value:"^[0-9]{5}(-[0-9]{4})?$",message:"Enter a valid ZIP code (e.g. 12345)"}],placeholder:"12345",label:"ZIP / Postal Code",confidence:.91},{keywords:["date","dob","birthday","birth_date","birthdate","born"],type:"date",validations:[{rule:"required",message:"Date is required"}],placeholder:"YYYY-MM-DD",label:"Date of Birth",confidence:.89},{keywords:["first_name","firstname","fname","given_name"],type:"text",validations:[{rule:"minLength",value:2,message:"First name too short"},{rule:"maxLength",value:50,message:"First name too long"}],placeholder:"Jane",label:"First Name",confidence:.9},{keywords:["last_name","lastname","lname","surname","family_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Last name too short"},{rule:"maxLength",value:50,message:"Last name too long"}],placeholder:"Doe",label:"Last Name",confidence:.9},{keywords:["name","full_name","fullname","display_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Name too short"},{rule:"maxLength",value:100,message:"Name too long"}],placeholder:"Jane Doe",label:"Full Name",confidence:.85},{keywords:["username","user_name","handle","login","loginname"],type:"text",validations:[{rule:"minLength",value:3,message:"Username must be at least 3 characters"},{rule:"maxLength",value:32,message:"Username too long"},{rule:"pattern",value:"^[a-zA-Z0-9_.-]+$",message:"Only letters, numbers, _, - and . allowed"}],placeholder:"cooluser42",label:"Username",confidence:.94},{keywords:["bio","biography","about","description","summary","details"],type:"textarea",validations:[{rule:"maxLength",value:500,message:"Bio must be under 500 characters"}],placeholder:"Tell us about yourself...",label:"Bio",confidence:.87},{keywords:["message","comment","feedback","note","notes","remarks","body"],type:"textarea",validations:[{rule:"minLength",value:10,message:"Message too short"},{rule:"maxLength",value:2e3,message:"Message too long"}],placeholder:"Write your message here...",label:"Message",confidence:.86},{keywords:["search","query","q","keyword","find"],type:"search",validations:[],placeholder:"Search...",label:"Search",confidence:.9},{keywords:["otp","one_time_password","verification_code","pin","code"],type:"text",validations:[{rule:"minLength",value:4,message:"Code too short"},{rule:"maxLength",value:8,message:"Code too long"},{rule:"pattern",value:"^[0-9]+$",message:"Code must be numeric"}],placeholder:"123456",label:"Verification Code",confidence:.92},{keywords:["color","colour","hex_color","brand_color"],type:"color",validations:[],placeholder:"#3b82f6",label:"Color",confidence:.95},{keywords:["address","street","street_address","addr"],type:"text",validations:[{rule:"maxLength",value:200,message:"Address too long"}],placeholder:"123 Main Street",label:"Street Address",confidence:.87},{keywords:["city","town","municipality"],type:"text",validations:[{rule:"maxLength",value:100,message:"City name too long"}],placeholder:"San Francisco",label:"City",confidence:.89},{keywords:["country","nation","country_code"],type:"text",validations:[],placeholder:"United States",label:"Country",confidence:.88},{keywords:["company","organization","org","employer","company_name"],type:"text",validations:[{rule:"maxLength",value:200,message:"Company name too long"}],placeholder:"Acme Inc.",label:"Company",confidence:.87}];function X(n){const e=n.toLowerCase().replace(/[\s-]/g,"_"),a=new G().amplify(J,r=>{let l=0;for(const i of r.keywords)e===i?l=Math.max(l,1):e.includes(i)||i.includes(e)?l=Math.max(l,.8):i.split("_").some(d=>e.includes(d))&&(l=Math.max(l,.5));return l},.3);if(a.length>0&&a[0].combined>.1){const r=J[a[0].index];return{type:r.type,validations:r.validations,placeholder:r.placeholder,confidence:Math.min(r.confidence*a[0].combined*2,.99),label:r.label}}return{type:"text",validations:[{rule:"maxLength",value:255,message:"Input too long"}],placeholder:n.replace(/_/g," "),confidence:.3,label:n.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}}function O(n,e,o){const a=e/100,r=o/100,l=a*Math.min(r,1-r),i=d=>{const s=(d+n/30)%12,c=r-l*Math.max(Math.min(s-3,9-s,1),-1);return Math.round(255*c).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function ue(n){const e=n.replace("#",""),o=e.length===3?e.split("").map(a=>a+a).join(""):e;return[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)]}function K(n){const[e,o,a]=ue(n).map(r=>{const l=r/255;return l<=.03928?l/12.92:((l+.055)/1.055)**2.4});return .2126*e+.7152*o+.0722*a}function H(n,e){const o=K(n),a=K(e),r=Math.max(o,a),l=Math.min(o,a);return(r+.05)/(l+.05)}function pe(n,e){const o=r=>O(r.h,r.s,r.l),a=e?n.text.l-20:n.text.l+15;return{primary:o(n.primary),secondary:o(n.secondary),background:o(n.bg),surface:o(n.surface),text:o(n.text),textMuted:O(n.text.h,Math.max(0,n.text.s-10),Math.max(20,Math.min(85,a))),border:o(n.border),error:e?"#f87171":"#dc2626",warning:e?"#fbbf24":"#d97706",success:e?"#34d399":"#059669",accent:o(n.accent)}}function he(n,e){let o=0;const a=k=>O(k.h,k.s,k.l),r=a(n.text),l=a(n.bg),i=a(n.surface),d=a(n.primary),s=H(r,l),c=H(r,i),g=H(d,l);s<4.5&&(o+=(4.5-s)*10),c<4.5&&(o+=(4.5-c)*8),g<3&&(o+=(3-g)*5);const m=Math.abs((n.secondary.h-n.primary.h+360)%360-137.508);o+=m*.05;const b=Math.abs((n.accent.h-n.primary.h+360)%360-120);o+=b*.03;const p=(n.primary.s+n.secondary.s)/2;p<20&&(o+=(20-p)*.5),p>90&&(o+=(p-90)*.5);const v=n.bg.l;e?(v>25&&(o+=(v-25)*2),v<3&&(o+=(3-v)*2),n.text.l<70&&(o+=(70-n.text.l)*1.5)):(v<90&&(o+=(90-v)*2),v>100&&(o+=(v-100)*2),n.text.l>30&&(o+=(n.text.l-30)*1.5));const S=Math.abs(n.surface.l-n.bg.l);return S<2&&(o+=(2-S)*2),S>12&&(o+=(S-12)*1),o}function ee(n,e,o){return Math.max(e,Math.min(o,n))}function le(n,e,o=800){const a=e?{primary:{h:n,s:70,l:55},secondary:{h:(n+137.5)%360,s:65,l:50},bg:{h:n,s:10,l:8},surface:{h:n,s:10,l:13},text:{h:n,s:15,l:90},border:{h:n,s:15,l:22},accent:{h:(n+120)%360,s:75,l:60}}:{primary:{h:n,s:65,l:40},secondary:{h:(n+137.5)%360,s:55,l:38},bg:{h:n,s:15,l:97},surface:{h:n,s:12,l:100},text:{h:n,s:15,l:12},border:{h:n,s:12,l:85},accent:{h:(n+120)%360,s:70,l:42}},l=new V(1.5,.994,.35,1e-5).anneal(a,i=>he(i,e),i=>{const d=["primary","secondary","bg","surface","text","border","accent"],s=d[Math.floor(Math.random()*d.length)],c=["h","s","l"],g=c[Math.floor(Math.random()*c.length)],h=(Math.random()-.5)*(g==="h"?30:15),m={...i,[s]:{...i[s]}};return g==="h"?m[s]={...m[s],h:(i[s].h+h+360)%360}:g==="s"?m[s]={...m[s],s:ee(i[s].s+h,0,100)}:m[s]={...m[s],l:ee(i[s].l+h,0,100)},m},o);return pe(l.state,e)}const U={qubit(){return new I},register(n){return new ae(n)},annealer(n,e,o){return new V(n,e,o)},qbm(n,e){return new ie(n,e)},amplifier(){return new G},inferField:X,optimizeTheme:le,contrast:H,hslToHex:O};function me(n,e,o,a){const r=o.trim();switch(n){case"required":return r!=="";case"email":case"pattern":if(typeof e=="string")try{return r===""||new RegExp(e).test(r)}catch{return!0}return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r);case"phone":return r===""||/^\+?[\d\s\-()]{7,15}$/.test(r);case"url":return r===""||/^https?:\/\/.+/.test(r);case"minLength":case"min":{const l=Number(e??0);return r===""||(isNaN(Number(r))?r.length>=l:Number(r)>=l)}case"maxLength":case"max":{const l=Number(e??1/0);return r===""||(isNaN(Number(r))?r.length<=l:Number(r)<=l)}case"integer":return r===""||/^\d+$/.test(r);case"alphanumeric":return r===""||/^[a-zA-Z0-9]+$/.test(r);case"match":return r===(a[typeof e=="string"?e:"password"]??"");default:return!0}}function xe({phase:n,collapsed:e,primaryColor:o,borderColor:a}){const d=e?0:n,s=e?0:n*1.618,c=12+10*Math.sin(d)*Math.cos(s),g=12-10*Math.cos(d);return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",style:{flexShrink:0,opacity:e?.4:1,transition:"opacity 0.6s"},children:[t.jsx("circle",{cx:12,cy:12,r:10,fill:"none",stroke:a,strokeWidth:"0.8"}),t.jsx("ellipse",{cx:12,cy:12,rx:10,ry:10*.3,fill:"none",stroke:a,strokeWidth:"0.5",strokeDasharray:"2 2"}),t.jsx("line",{x1:12,y1:2,x2:12,y2:22,stroke:a,strokeWidth:"0.5"}),t.jsx("line",{x1:12,y1:12,x2:c,y2:g,stroke:o,strokeWidth:"1.5",style:{transition:e?"all 0.6s ease-out":"none"}}),t.jsx("circle",{cx:c,cy:g,r:"2",fill:o,style:{transition:e?"all 0.6s ease-out":"none"}})]})}function ge({confidence:n,theme:e}){const o=Math.round(n*100),a=o>=80?e.success:o>=60?e.warning:e.danger;return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",fontSize:"10px",fontWeight:600,padding:"1px 5px",borderRadius:"999px",backgroundColor:`${a}22`,color:a,border:`1px solid ${a}44`,marginLeft:"6px",verticalAlign:"middle",letterSpacing:"0.03em"},children:["⚛ ",o,"%"]})}function fe({config:n,intel:e,qubitPhase:o,value:a,error:r,touched:l,showConfidence:i,showQuantumState:d,collapsed:s,onChange:c,onBlur:g,theme:h,mounted:m,index:b}){const p=n.type??e.type,v=n.label??e.label,S=n.placeholder??e.placeholder,k=n.required!==void 0?n.required:e.validations.some($=>$.rule==="required"),q=Y.sanitizeString(v),E=p==="textarea",w=l&&r!=="",A=`qf-${n.name}`,W={width:"100%",padding:"9px 12px",border:`1.5px solid ${w?h.danger:h.border}`,borderRadius:"8px",backgroundColor:h.surface,color:h.text,fontSize:"14px",fontFamily:"inherit",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s",resize:E?"vertical":void 0,minHeight:E?"80px":void 0};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",opacity:m?1:0,transform:m?"scaleY(1)":"scaleY(0.92)",transition:`opacity 0.35s ease ${b*60}ms, transform 0.35s ease ${b*60}ms`,transformOrigin:"top"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d&&t.jsx(xe,{phase:o,collapsed:s,primaryColor:h.primary,borderColor:h.border}),t.jsxs("label",{htmlFor:A,style:{fontSize:"13px",fontWeight:500,color:h.text,cursor:"pointer"},children:[q,k&&t.jsx("span",{"aria-hidden":"true",style:{color:h.danger,marginLeft:"3px"},children:"*"})]}),i&&t.jsx(ge,{confidence:e.confidence,theme:h})]}),E?t.jsx("textarea",{id:A,value:a,onChange:$=>c($.target.value),onBlur:g,placeholder:S,"aria-invalid":w,"aria-required":k,style:W}):t.jsx("input",{id:A,type:p,value:a,onChange:$=>c($.target.value),onBlur:g,placeholder:S,"aria-invalid":w,"aria-required":k,style:W}),w&&t.jsxs("span",{role:"alert",style:{fontSize:"12px",color:h.danger,display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),Y.sanitizeString(r)]})]})}function ye(n){let e=2166136261;for(let o=0;o<n.length;o++)e^=n.charCodeAt(o),e=Math.imul(e,16777619)>>>0;return(e&65535)/65535*Math.PI*2}function de({fields:n,onSubmit:e,submitLabel:o="Submit",layout:a="vertical",showConfidence:r=!0,showQuantumState:l=!1}){const i=Z.useTheme(),d=n.map(f=>X(f.name)),[s,c]=x.useState(()=>Object.fromEntries(n.map(f=>[f.name,""]))),[g,h]=x.useState({}),[m,b]=x.useState({}),[p,v]=x.useState(!1),[S,k]=x.useState(!1),[q,E]=x.useState(!1);x.useEffect(()=>{const f=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(f)},[]);const w=x.useCallback((f,u)=>{const y=n.find(M=>M.name===f),C=d[n.findIndex(M=>M.name===f)];if(!y||!C)return"";const j=u[f]??"";for(const{rule:M,value:P,message:_}of C.validations)if(!(M==="required"&&y.required===!1)&&!me(M,P,j,u))return _;return""},[n]),A=x.useCallback(f=>{const u={};for(const y of n){const C=w(y.name,f);C&&(u[y.name]=C)}return u},[n,w]),W=x.useCallback((f,u)=>{c(y=>{var j;const C={...y,[f]:u};if(m[f]&&(h(M=>({...M,[f]:w(f,C)})),f==="password")){const M=(j=n.find(P=>["confirmpassword","confirm_password","passwordconfirm"].includes(P.name.toLowerCase().replace(/[\s_-]/g,""))))==null?void 0:j.name;M&&m[M]&&h(P=>({...P,[M]:w(M,C)}))}return C}),E(!0)},[n,m,w]),$=x.useCallback(f=>{b(u=>({...u,[f]:!0})),h(u=>({...u,[f]:w(f,s)}))},[s,w]),N=x.useCallback(async f=>{f.preventDefault();const u=Object.fromEntries(n.map(C=>[C.name,!0]));b(u);const y=A(s);if(h(y),!(Object.keys(y).length>0)){v(!0);try{await e(s)}finally{v(!1)}}},[n,s,A,e]),B=d.length>0?Math.round(d.reduce((f,u)=>f+u.confidence,0)/d.length*100):0,F=B>=80?i.success:B>=60?i.warning:i.danger,L=a==="horizontal";return t.jsxs("form",{onSubmit:N,noValidate:!0,className:se.tkx("w-full"),style:{backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:"12px",padding:"24px",position:"relative",boxSizing:"border-box"},children:[t.jsx("span",{"aria-label":"Powered by Quantum AI",style:{position:"absolute",top:"16px",right:"16px",fontSize:"10px",fontWeight:700,padding:"3px 8px",borderRadius:"999px",backgroundColor:`${i.primary}20`,color:i.primary,border:`1px solid ${i.primary}44`,letterSpacing:"0.04em",userSelect:"none"},children:"⚛ Quantum AI"}),r&&t.jsxs("div",{style:{marginBottom:"20px",paddingRight:"100px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[t.jsx("span",{style:{fontSize:"11px",color:i.textMuted,fontWeight:500},children:"Form Intelligence Confidence"}),t.jsxs("span",{style:{fontSize:"11px",fontWeight:700,color:F},children:[B,"%"]})]}),t.jsx("div",{style:{height:"4px",borderRadius:"4px",backgroundColor:i.border,overflow:"hidden"},children:t.jsx("div",{style:{height:"100%",width:`${B}%`,backgroundColor:F,borderRadius:"4px",transition:"width 0.8s ease"}})})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:L?"repeat(auto-fill, minmax(260px, 1fr))":"1fr",gap:"16px",marginBottom:"20px"},children:n.map((f,u)=>t.jsx(fe,{config:f,intel:d[u],qubitPhase:ye(f.name),value:s[f.name]??"",error:g[f.name]??"",touched:m[f.name]??!1,showConfidence:r,showQuantumState:l,collapsed:q,onChange:y=>W(f.name,y),onBlur:()=>$(f.name),theme:i,mounted:S,index:u},f.name))}),t.jsx("button",{type:"submit",disabled:p,style:{width:"100%",padding:"10px 20px",borderRadius:"8px",border:"none",backgroundColor:p?`${i.primary}88`:i.primary,color:i.bg,fontSize:"14px",fontWeight:700,fontFamily:"inherit",cursor:p?"not-allowed":"pointer",transition:"background-color 0.15s, opacity 0.15s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:p?t.jsxs(t.Fragment,{children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{animation:"qf-spin 0.8s linear infinite"},"aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]}),"Processing…"]}):Y.sanitizeString(o)}),t.jsx("style",{children:"@keyframes qf-spin { to { transform: rotate(360deg); } }"})]})}de.displayName="TkxQuantumForm";function te(n){return n?{primary:"#00f5d4",secondary:"#7b2ff7",background:"#0a0a0f",surface:"#12121a",text:"#e8e8f4",textMuted:"#8888aa",border:"#2a2a3e",error:"#f87171",warning:"#fbbf24",success:"#34d399",accent:"#ff6b6b"}:{primary:"#0d7c5f",secondary:"#6930c3",background:"#f8f6f1",surface:"#ffffff",text:"#1a1815",textMuted:"#6b6560",border:"#ddd8cc",error:"#dc2626",warning:"#d97706",success:"#059669",accent:"#e05a00"}}function be({points:n,primary:e}){if(n.length<2)return t.jsx("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"center",color:"#888",fontSize:12},children:"Waiting for data..."});const o=280,a=48,r=Math.max(...n.map(c=>c.energy)),l=Math.min(...n.map(c=>c.energy)),i=r-l||1,d=n[n.length-1].iteration||1,s=n.map(c=>{const g=c.iteration/d*o,h=a-(c.energy-l)/i*(a-4)-2;return`${g.toFixed(1)},${h.toFixed(1)}`}).join(" ");return t.jsxs("svg",{width:o,height:a,style:{display:"block"},children:[t.jsx("polyline",{points:s,fill:"none",stroke:e,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),t.jsxs("text",{x:2,y:10,fontSize:9,fill:"#888",children:["E=",r.toFixed(1)]}),t.jsxs("text",{x:2,y:a-2,fontSize:9,fill:"#888",children:["E=",l.toFixed(1)]})]})}function ve({label:n,value:e,onChange:o,text:a,border:r}){return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[t.jsx("input",{type:"color",value:e,onChange:l=>o(l.target.value),style:{width:32,height:32,border:`1px solid ${r}`,borderRadius:6,padding:2,cursor:"pointer",background:"transparent"}}),t.jsx("div",{style:{width:60,height:28,borderRadius:6,background:e,border:`1px solid ${r}`}}),t.jsx("span",{style:{flex:1,fontSize:13,color:a,fontFamily:"monospace"},children:n}),t.jsx("code",{style:{fontSize:12,color:a,opacity:.7,fontFamily:"monospace"},children:e})]})}function ke({label:n,ratio:e}){const o=e>=4.5,a=e>=4.5,r=e>=7;return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[t.jsx("span",{style:{fontSize:11,opacity:.8,minWidth:140},children:n}),t.jsxs("span",{style:{fontSize:12,fontWeight:600},children:[e.toFixed(2),":1"]}),t.jsx("span",{style:{fontSize:11,color:a?"#22c55e":"#ef4444"},children:a?"✓ AA":"✗ AA"}),t.jsx("span",{style:{fontSize:11,color:r?"#22c55e":"#888"},children:r?"✓ AAA":"— AAA"}),t.jsx("span",{style:{fontSize:13},children:o?"✅":"❌"})]})}function we({onThemeChange:n,initialHue:e=210,initialMode:o="dark"}){const a=Z.useTheme(),[r,l]=x.useState(o),[i,d]=x.useState(e),[s,c]=x.useState(()=>te(o==="dark")),[g,h]=x.useState(!1),[m,b]=x.useState([]),[p,v]=x.useState(!1),S=x.useRef(null),k=r==="dark",q=x.useCallback((u,y)=>{c(C=>{const j={...C,[u]:y};return n==null||n(j),j})},[n]),E=x.useCallback(()=>{if(g)return;h(!0),b([]);let u=0;const y=600,C=60,j=[],M=()=>{u+=C,U.optimizeTheme(i,k,u);const P=u/y,_=50*(1-P)+2,Q=(Math.random()-.5)*8*(1-P*.8);if(j.push({iteration:u,energy:Math.max(0,_+Q)}),b([...j]),u<y)S.current=window.setTimeout(M,40);else{const z=U.optimizeTheme(i,k,1e3);c(z),n==null||n(z),h(!1)}};S.current=window.setTimeout(M,16)},[i,k,g,n]),w=x.useCallback(()=>{const u=r==="dark"?"light":"dark";l(u);const y=te(u==="dark");c(y),n==null||n(y)},[r,n]),A=x.useCallback(()=>{const u=`export const myTheme = {
|
|
2
2
|
${Object.entries(s).map(([y,C])=>` ${y}: '${C}',`).join(`
|
|
3
3
|
`)}
|
|
4
4
|
};`;typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(u).then(()=>{v(!0),setTimeout(()=>v(!1),2e3)})},[s]),W=[{label:"Text on Background",fg:s.text,bg:s.background},{label:"Text on Surface",fg:s.text,bg:s.surface},{label:"Primary on Background",fg:s.primary,bg:s.background},{label:"TextMuted on Background",fg:s.textMuted,bg:s.background}],$="linear-gradient(to right,"+["hsl(0,80%,55%)","hsl(30,80%,55%)","hsl(60,80%,55%)","hsl(90,80%,55%)","hsl(120,80%,55%)","hsl(150,80%,55%)","hsl(180,80%,55%)","hsl(210,80%,55%)","hsl(240,80%,55%)","hsl(270,80%,55%)","hsl(300,80%,55%)","hsl(330,80%,55%)","hsl(360,80%,55%)"].join(",")+")",N={fontFamily:"system-ui, -apple-system, sans-serif",background:s.background,color:s.text,border:`1px solid ${s.border}`,borderRadius:12,padding:20,maxWidth:900,display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},B={background:s.surface,border:`1px solid ${s.border}`,borderRadius:8,padding:16},F={fontSize:13,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:s.primary,marginBottom:12,marginTop:0},L={padding:"8px 16px",borderRadius:8,border:"none",cursor:"pointer",fontWeight:600,fontSize:13,transition:"opacity 0.15s"},f=se.tkx;return t.jsxs("div",{style:N,children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gridColumn:"1/-1"},children:[t.jsxs("div",{children:[t.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:700},children:"Theme Builder"}),t.jsx("p",{style:{margin:"2px 0 0",fontSize:12,color:s.textMuted},children:"Quantum-powered color optimization"})]}),t.jsx("button",{onClick:w,style:{...L,background:s.surface,color:s.text,border:`1px solid ${s.border}`},children:k?"☀ Light":"🌙 Dark"})]}),t.jsxs("div",{style:B,children:[t.jsx("p",{style:F,children:"Base Hue"}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[t.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:`hsl(${i},70%,55%)`,border:`2px solid ${s.border}`,flexShrink:0}}),t.jsx("input",{type:"range",min:0,max:360,value:i,onChange:u=>d(Number(u.target.value)),style:{flex:1,height:16,borderRadius:8,background:$,outline:"none",border:"none",cursor:"pointer",appearance:"none",WebkitAppearance:"none"}}),t.jsxs("span",{style:{fontSize:13,fontFamily:"monospace",minWidth:32},children:[i,"°"]})]})]}),t.jsxs("div",{style:B,children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[t.jsx("button",{onClick:E,disabled:g,style:{...L,background:g?s.border:s.primary,color:k?"#000":"#fff",opacity:g?.7:1,flex:1},children:g?"⟳ Optimizing...":"⚛ Generate with Quantum Annealing"}),t.jsx("div",{style:{padding:"3px 8px",background:s.primary+"22",border:`1px solid ${s.primary}44`,borderRadius:20,fontSize:10,color:s.primary,fontWeight:700,whiteSpace:"nowrap"},children:"⚛ Quantum Annealing"})]}),(g||m.length>0)&&t.jsxs("div",{children:[t.jsx("p",{style:{fontSize:11,color:s.textMuted,margin:"0 0 4px"},children:"Energy landscape (lower = better palette)"}),t.jsx(be,{points:m,primary:s.primary})]})]}),t.jsxs("div",{style:B,children:[t.jsx("p",{style:F,children:"Color Tokens"}),Object.keys(s).map(u=>t.jsx(ve,{label:u,value:s[u],onChange:y=>q(u,y),text:s.text,border:s.border},u))]}),t.jsx("button",{onClick:A,style:{...L,background:s.accent,color:"#fff",width:"100%"},children:p?"✓ Copied to Clipboard!":"⬇ Export Theme"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{style:B,children:[t.jsx("p",{style:F,children:"Live Preview"}),t.jsxs("div",{style:{marginBottom:12},children:[t.jsx("p",{style:{fontSize:11,color:s.textMuted,margin:"0 0 6px"},children:"Buttons"}),t.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[t.jsx("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:s.primary,color:k?"#000":"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Primary"}),t.jsx("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:s.secondary,color:"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Secondary"}),t.jsx("button",{style:{padding:"8px 16px",borderRadius:8,border:`1px solid ${s.border}`,background:"transparent",color:s.text,fontWeight:600,fontSize:13,cursor:"pointer"},children:"Outline"})]})]}),t.jsxs("div",{style:{marginBottom:12},children:[t.jsx("p",{style:{fontSize:11,color:s.textMuted,margin:"0 0 6px"},children:"Card"}),t.jsxs("div",{style:{background:s.surface,border:`1px solid ${s.border}`,borderRadius:8,padding:12},children:[t.jsx("div",{style:{fontSize:14,fontWeight:700,marginBottom:4},children:"Card Title"}),t.jsx("div",{style:{fontSize:12,color:s.textMuted,lineHeight:1.4},children:"Sample card with surface background and muted text content."}),t.jsxs("div",{style:{marginTop:8,display:"flex",gap:6},children:[t.jsx("span",{style:{padding:"2px 8px",borderRadius:20,background:s.primary+"33",color:s.primary,fontSize:11,fontWeight:600},children:"Tag"}),t.jsx("span",{style:{padding:"2px 8px",borderRadius:20,background:s.accent+"33",color:s.accent,fontSize:11,fontWeight:600},children:"Accent"})]})]})]}),t.jsxs("div",{style:{marginBottom:12},children:[t.jsx("p",{style:{fontSize:11,color:s.textMuted,margin:"0 0 6px"},children:"Input"}),t.jsx("input",{type:"text",placeholder:"Type something...",readOnly:!0,style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${s.border}`,background:s.background,color:s.text,fontSize:13,outline:"none",boxSizing:"border-box"}})]}),t.jsxs("div",{style:{marginBottom:12},children:[t.jsx("p",{style:{fontSize:11,color:s.textMuted,margin:"0 0 6px"},children:"Progress"}),t.jsx("div",{style:{height:8,borderRadius:4,background:s.border,overflow:"hidden"},children:t.jsx("div",{style:{height:"100%",width:"68%",background:`linear-gradient(to right, ${s.primary}, ${s.accent})`,borderRadius:4,transition:"width 0.4s ease"}})})]}),t.jsxs("div",{children:[t.jsx("p",{style:{fontSize:11,color:s.textMuted,margin:"0 0 6px"},children:"Status Badges"}),t.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[{label:"Error",color:s.error},{label:"Warning",color:s.warning},{label:"Success",color:s.success}].map(({label:u,color:y})=>t.jsx("span",{style:{padding:"3px 10px",borderRadius:4,background:y+"22",color:y,border:`1px solid ${y}44`,fontSize:11,fontWeight:700},children:u},u))})]})]}),t.jsxs("div",{style:B,children:[t.jsx("p",{style:F,children:"WCAG Contrast Check"}),W.map(u=>t.jsx(ke,{label:u.label,ratio:U.contrast(u.fg,u.bg)},u.label)),t.jsx("p",{style:{fontSize:10,color:s.textMuted,marginTop:8,marginBottom:0},children:"AA requires 4.5:1 (normal text). AAA requires 7:1."})]}),t.jsxs("div",{style:B,children:[t.jsx("p",{style:F,children:"Color Palette"}),t.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:Object.entries(s).map(([u,y])=>t.jsx("div",{title:`${u}: ${y}`,style:{width:36,height:36,borderRadius:6,background:y,border:`2px solid ${s.border}`,cursor:"default",flexShrink:0}},u))})]})]}),typeof f=="function"&&null,typeof a.bg=="string"&&null]})}const re=[{label:"Hello World",code:`<div style={{ padding: 24, fontFamily: 'sans-serif', color: '#e8e8f4' }}>
|
package/dist/quantum.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as c, jsx as a, Fragment as pe } from "react/jsx-runtime";
|
|
2
2
|
import Z, { useState as A, useEffect as V, useCallback as R, useRef as X } from "react";
|
|
3
|
-
import { u as K } from "./index-
|
|
4
|
-
import { t as le } from "./tkx-
|
|
5
|
-
import { s as J } from "./security-
|
|
3
|
+
import { u as K } from "./index-CAXjeKoK.js";
|
|
4
|
+
import { t as le } from "./tkx-C_AlpMt4.js";
|
|
5
|
+
import { s as J } from "./security-loRa1HyV.js";
|
|
6
6
|
class W {
|
|
7
7
|
constructor(e, n) {
|
|
8
8
|
this.re = e, this.im = n;
|
package/dist/realtime.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),K=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),K=require("./index-DB_m7X7e.cjs"),z=require("./security-DMqZVW5d.cjs"),O=64,se=5;let ae=!1;function Ee(){if(ae||typeof document>"u")return;ae=!0;const e=document.createElement("style");e.id="tkx-live-feed-styles",e.textContent=`
|
|
2
2
|
@keyframes tkx-feed-slide-in {
|
|
3
3
|
from { transform: translateY(-20px); opacity: 0; }
|
|
4
4
|
to { transform: translateY(0); opacity: 1; }
|
package/dist/realtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as D, useState as C, useMemo as Q, useEffect as V, useCallback as K, createElement as n } from "react";
|
|
2
|
-
import { u as tt } from "./index-
|
|
3
|
-
import { s as z } from "./security-
|
|
2
|
+
import { u as tt } from "./index-CAXjeKoK.js";
|
|
3
|
+
import { s as z } from "./security-loRa1HyV.js";
|
|
4
4
|
const _ = 64, ut = 5;
|
|
5
5
|
let ft = !1;
|
|
6
6
|
function It() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-DB_m7X7e.cjs"),g={"<":"<",">":">","&":"&","'":"'",'"':"""};function u(t){return String(t).replace(/[<>&'"]/g,n=>g[n]??n)}function p(t){const n={};for(const e of Object.keys(t))n[e]=f(t[e]);return n}function f(t){return typeof t=="string"?u(t):Array.isArray(t)?t.map(f):t!==null&&typeof t=="object"&&!$(t)?p(t):t}function $(t){return typeof t=="object"&&t!==null&&"$$typeof"in t}function h(t,n){const e=[];for(const[s,i]of Object.entries(n)){const o=t[s],c=o==null;if(i.required&&c){e.push(`prop '${s}' is required`);continue}if(!c){if(typeof o!==i.type){e.push(`prop '${s}' must be of type ${i.type}, got ${typeof o}`);continue}i.type==="number"&&typeof o=="number"&&(i.min!==void 0&&o<i.min&&e.push(`prop '${s}' must be >= ${i.min}`),i.max!==void 0&&o>i.max&&e.push(`prop '${s}' must be <= ${i.max}`)),i.type==="string"&&typeof o=="string"&&i.pattern&&!i.pattern.test(o)&&e.push(`prop '${s}' does not match pattern ${i.pattern}`),i.enum&&!i.enum.includes(o)&&e.push(`prop '${s}' must be one of: ${i.enum.join(", ")}`)}}return{valid:e.length===0,errors:e}}const l=new Map;function b(t,n){const e={"default-src":["'self'"],"style-src":n.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":n.allowDataUrls?["'self'","data:"]:n.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":n.allowScripts?["'self'"]:["'none'"]},s={componentId:t,permissions:n,directives:e};return l.set(t,s),s}function H(t,n){const e=l.get(t);return(e==null?void 0:e.permissions[n])===!0}let r=[];function y(t,n,e){const s=a.fnv1aHash(JSON.stringify(e??{})),i=r.length>0?r[r.length-1].chainHash:"00000000",o=a.fnv1aHash(i+s+n+t),c=Object.freeze({timestamp:Date.now(),component:n,action:t,propsHash:s,chainHash:o});return r=Object.freeze([...r,c]),c}function m(t){let n=r;return t!=null&&t.component&&(n=n.filter(e=>e.component===t.component)),t!=null&&t.action&&(n=n.filter(e=>e.action===t.action)),t!=null&&t.limit&&(n=n.slice(-t.limit)),n}function d(){let t="00000000";for(const n of r){if(a.fnv1aHash(t+n.propsHash+n.component+n.action)!==n.chainHash)return!1;t=n.chainHash}return!0}const S={sanitize:u,sanitizeProps:p,validateProps:h,createCSP:b,hasPermission:H,audit:y,getAuditLog:m,verifyAuditIntegrity:d};exports.Shield=S;exports.audit=y;exports.getAuditLog=m;exports.sanitizeProps=p;exports.sanitizeString=u;exports.validateProps=h;exports.verifyAuditIntegrity=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TkxAlert.d.ts","sourceRoot":"","sources":["../../../src/components/TkxAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAMlD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"TkxAlert.d.ts","sourceRoot":"","sources":["../../../src/components/TkxAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAMlD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,2CAiDnH"}
|
|
@@ -13,11 +13,12 @@ export interface ToastItem {
|
|
|
13
13
|
}
|
|
14
14
|
export interface TkxToastProps {
|
|
15
15
|
position?: ToastPosition;
|
|
16
|
+
children?: React.ReactNode;
|
|
16
17
|
}
|
|
17
18
|
export declare function useToast(): {
|
|
18
19
|
toast: (item: Omit<ToastItem, "id">) => string;
|
|
19
20
|
dismiss: (id: string) => void;
|
|
20
21
|
dismissAll: () => void;
|
|
21
22
|
};
|
|
22
|
-
export declare function TkxToastProvider({ position }: TkxToastProps): import("react").
|
|
23
|
+
export declare function TkxToastProvider({ position, children }: TkxToastProps): import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
//# sourceMappingURL=TkxToast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TkxToast.d.ts","sourceRoot":"","sources":["../../../src/components/TkxToast.tsx"],"names":[],"mappings":"AAgBA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,GAAG,eAAe,CAAC;AAEvH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"TkxToast.d.ts","sourceRoot":"","sources":["../../../src/components/TkxToast.tsx"],"names":[],"mappings":"AAgBA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,GAAG,eAAe,CAAC;AAEvH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA2DD,wBAAgB,QAAQ;kBACW,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC;kBACrB,MAAM;;EAGxC;AAuID,wBAAgB,gBAAgB,CAAC,EAAE,QAAsB,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAsDnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wcag.d.ts","sourceRoot":"","sources":["../../../src/engine/wcag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wcag.d.ts","sourceRoot":"","sources":["../../../src/engine/wcag.ts"],"names":[],"mappings":"AAiBA,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,OAAO,CAE1E;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,OAAO,CAE3E;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAMjF;AAID,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,IAAI,CAAC;IACrE,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,eAAe,IAAI,SAAS,CA2B3C;AAcD,MAAM,WAAW,SAAS;IACxB,QAAQ,IAAI,IAAI,CAAC;IACjB,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,CA8CjE;AAID,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,aAAa,EAChB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAChC,IAAI,CAgCN;AAED,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,aAAa,EAChB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAkCN;AAID,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAG7C;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,QAAQ,GAAG,WAAsB,GAAG,IAAI,CAgB3G;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;CAYtB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Q=require("./index-BINBzXuY.cjs"),l={0:"0",px:"1px","0.5":"2px",1:"4px","1.5":"6px",2:"8px","2.5":"10px",3:"12px","3.5":"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},D={...l,screen:"100vh"},x={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},y={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},H={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},tt={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},et={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},rt={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},nt={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},k={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},it=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(t=>[String(t),String(t/100)])),Y=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),ot={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},st=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,at=new Set(["behavior","-moz-binding","-webkit-binding","src"]),lt=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function q(t){return st.test(t)||t.includes("}")||t.includes("{")||t.includes("<")||t.includes(">")?null:t}function ct(t){const o=t.toLowerCase().trim();return at.has(o)||!lt.has(o)?null:o}function i(t){const o=t.match(/^\[(.+)]$/);return o?q(o[1]):null}function h(t){if(Y.has(t))return`var(--tkx-${t})`;if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="white")return"#ffffff";if(t==="black")return"#000000";if(t==="inherit")return"inherit";const o=i(t);return o||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t),t)}function ft(t){const o=t.match(/^\[([a-zA-Z-]+):(.+)]$/);if(o){const r=ct(o[1]),n=q(o[2]);return r&&n?{[r]:n}:null}const s={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(s[t])return{display:s[t]};const a={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(a[t])return{"flex-direction":a[t]};const f={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(f[t])return{"flex-wrap":f[t]};const b={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(b[t])return{flex:b[t]};if(t==="grow"||t==="flex-grow")return{"flex-grow":"1"};if(t==="grow-0")return{"flex-grow":"0"};if(t==="shrink"||t==="flex-shrink")return{"flex-shrink":"1"};if(t==="shrink-0"||t==="flex-shrink-0")return{"flex-shrink":"0"};const $={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if($[t])return{"align-items":$[t]};const d={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(d[t])return{"justify-content":d[t]};const c={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(c[t])return{"align-self":c[t]};const m={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(m[t])return{"align-content":m[t]};let e;if(e=t.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":e[1]==="none"?"none":e[1]==="subgrid"?"subgrid":`repeat(${e[1]},minmax(0,1fr))`};if(e=t.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":e[1]==="none"?"none":e[1]==="subgrid"?"subgrid":`repeat(${e[1]},minmax(0,1fr))`};if(e=t.match(/^col-span-(full|\d+)$/))return{"grid-column":e[1]==="full"?"1 / -1":`span ${e[1]} / span ${e[1]}`};if(e=t.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":e[1]};if(e=t.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":e[1]};if(e=t.match(/^row-span-(full|\d+)$/))return{"grid-row":e[1]==="full"?"1 / -1":`span ${e[1]} / span ${e[1]}`};if(e=t.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":e[1]};if(e=t.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":e[1]};if(t==="grid-flow-row")return{"grid-auto-flow":"row"};if(t==="grid-flow-col")return{"grid-auto-flow":"column"};if(t==="grid-flow-dense")return{"grid-auto-flow":"dense"};if(t==="grid-flow-row-dense")return{"grid-auto-flow":"row dense"};if(t==="grid-flow-col-dense")return{"grid-auto-flow":"column dense"};if(e=t.match(/^p-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{padding:r}}if(e=t.match(/^px-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-left":r,"padding-right":r}}if(e=t.match(/^py-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-top":r,"padding-bottom":r}}if(e=t.match(/^pt-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-top":r}}if(e=t.match(/^pr-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-right":r}}if(e=t.match(/^pb-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-bottom":r}}if(e=t.match(/^pl-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-left":r}}if(e=t.match(/^-?m-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{margin:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?mx-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n){const p=r&&n!=="0"?`-${n}`:n;return{"margin-left":p,"margin-right":p}}}if(e=t.match(/^-?my-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n){const p=r&&n!=="0"?`-${n}`:n;return{"margin-top":p,"margin-bottom":p}}}if(e=t.match(/^-?mt-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-top":r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?mr-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-right":r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?mb-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-bottom":r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?ml-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-left":r&&n!=="0"?`-${n}`:n}}if(t==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(t==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(e=t.match(/^gap-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{gap:r}}if(e=t.match(/^gap-x-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"column-gap":r}}if(e=t.match(/^gap-y-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"row-gap":r}}if(e=t.match(/^w-(.+)$/)){const r=e[1],n=l[r]??x[r]??i(r);if(n)return{width:n}}if(e=t.match(/^min-w-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"min-width":r}}if(e=t.match(/^max-w-(.+)$/)){const n={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[e[1]]??l[e[1]]??i(e[1]);if(n)return{"max-width":n}}if(e=t.match(/^h-(.+)$/)){const r=e[1],n=D[r]??x[r]??i(r);if(n)return{height:n}}if(e=t.match(/^min-h-(.+)$/)){const n={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[e[1]]??l[e[1]]??i(e[1]);if(n)return{"min-height":n}}if(e=t.match(/^max-h-(.+)$/)){const r=D[e[1]]??i(e[1]);if(r)return{"max-height":r}}if(e=t.match(/^size-(.+)$/)){const r=l[e[1]]??x[e[1]]??i(e[1]);if(r)return{width:r,height:r}}if(e=t.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[r,n]=tt[e[1]]??["1rem","1.5rem"];return{"font-size":r,"line-height":n}}if(e=t.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":et[e[1]]??e[1]};if(e=t.match(/^leading-(.+)$/)){const r=rt[e[1]]??i(e[1]);if(r)return{"line-height":r}}if(e=t.match(/^tracking-(.+)$/)){const r=nt[e[1]]??i(e[1]);if(r)return{"letter-spacing":r}}const u={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(u[t])return{"text-align":u[t]};if(t==="italic")return{"font-style":"italic"};if(t==="not-italic")return{"font-style":"normal"};if(t==="uppercase")return{"text-transform":"uppercase"};if(t==="lowercase")return{"text-transform":"lowercase"};if(t==="capitalize")return{"text-transform":"capitalize"};if(t==="normal-case")return{"text-transform":"none"};if(t==="underline")return{"text-decoration-line":"underline"};if(t==="overline")return{"text-decoration-line":"overline"};if(t==="line-through")return{"text-decoration-line":"line-through"};if(t==="no-underline")return{"text-decoration-line":"none"};if(t==="truncate")return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if(t==="text-ellipsis")return{"text-overflow":"ellipsis"};if(t==="text-clip")return{"text-overflow":"clip"};if(t==="whitespace-normal")return{"white-space":"normal"};if(t==="whitespace-nowrap")return{"white-space":"nowrap"};if(t==="whitespace-pre")return{"white-space":"pre"};if(t==="whitespace-pre-wrap")return{"white-space":"pre-wrap"};if(t==="whitespace-pre-line")return{"white-space":"pre-line"};if(t==="break-words")return{"overflow-wrap":"break-word"};if(t==="break-all")return{"word-break":"break-all"};if(t==="break-keep")return{"word-break":"keep-all"};if(t==="font-mono")return{"font-family":"var(--tkx-font-mono,monospace)"};if(t==="font-sans")return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if(t==="font-serif")return{"font-family":"ui-serif,Georgia,serif"};if(t==="antialiased")return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(e=t.match(/^indent-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"text-indent":r}}if(e=t.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":e[1],"-webkit-box-orient":"vertical"};if(e=t.match(/^text-(.+)$/)){const[r,n]=e[1].split("/"),p=h(r);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(r)){if(n){const J=parseInt(n)/100;return{color:p,opacity:String(J)}}return{color:p}}}if(e=t.match(/^bg-(.+)$/)){const[r,n]=e[1].split("/"),p=h(r);return n?{"background-color":p,opacity:String(parseInt(n)/100)}:r==="none"?{background:"none"}:{"background-color":p}}if(e=t.match(/^border-color-(.+)$/))return{"border-color":h(e[1])};if(e=t.match(/^fill-(.+)$/))return{fill:h(e[1])};if(e=t.match(/^stroke-(.+)$/))return{stroke:h(e[1])};if(e=t.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":h(e[1])};if(e=t.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":h(e[1])};if(e=t.match(/^accent-(.+)$/))return{"accent-color":h(e[1])};if(e=t.match(/^caret-(.+)$/))return{"caret-color":h(e[1])};if(e=t.match(/^outline-color-(.+)$/))return{"outline-color":h(e[1])};if(t==="border")return{"border-width":"1px"};if(e=t.match(/^border-(\d+)$/))return{"border-width":`${e[1]}px`};if(t==="border-t")return{"border-top-width":"1px"};if(e=t.match(/^border-t-(\d+)$/))return{"border-top-width":`${e[1]}px`};if(t==="border-r")return{"border-right-width":"1px"};if(e=t.match(/^border-r-(\d+)$/))return{"border-right-width":`${e[1]}px`};if(t==="border-b")return{"border-bottom-width":"1px"};if(e=t.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${e[1]}px`};if(t==="border-l")return{"border-left-width":"1px"};if(e=t.match(/^border-l-(\d+)$/))return{"border-left-width":`${e[1]}px`};if(t==="border-x")return{"border-left-width":"1px","border-right-width":"1px"};if(t==="border-y")return{"border-top-width":"1px","border-bottom-width":"1px"};if(t==="border-none")return{"border-style":"none"};if(t==="border-solid")return{"border-style":"solid"};if(t==="border-dashed")return{"border-style":"dashed"};if(t==="border-dotted")return{"border-style":"dotted"};if(t==="border-double")return{"border-style":"double"};if((e=t.match(/^border-([a-zA-Z].*)$/))&&Y.has(e[1]))return{"border-color":`var(--tkx-${e[1]})`};if(e=t.match(/^border-\[(.+)]$/))return{"border-color":e[1]};if(t==="border-0")return{"border-width":"0"};if(t==="rounded")return{"border-radius":y[""]};if(e=t.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":y[e[1]]??i(e[1])??e[1]};if(e=t.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const r=e[1],n=y[e[2]??""]??y[""];return{t:{"border-top-left-radius":n,"border-top-right-radius":n},r:{"border-top-right-radius":n,"border-bottom-right-radius":n},b:{"border-bottom-left-radius":n,"border-bottom-right-radius":n},l:{"border-top-left-radius":n,"border-bottom-left-radius":n},tl:{"border-top-left-radius":n},tr:{"border-top-right-radius":n},br:{"border-bottom-right-radius":n},bl:{"border-bottom-left-radius":n}}[r]??{}}const w={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if(t==="ring")return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((e=t.match(/^ring-(\d+)$/))&&w[e[1]])return{"box-shadow":`0 0 0 ${w[e[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(t==="ring-inset")return{"--tkx-ring-offset":"inset"};if(e=t.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${e[1]}px`,"box-shadow":`0 0 0 ${e[1]}px var(--tkx-bg)`};if(t==="shadow")return{"box-shadow":H[""]};if(e=t.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":H[e[1]]};if(e=t.match(/^opacity-(\d+)$/)){const r=it[e[1]];if(r!==void 0)return{opacity:r}}if(t==="bg-none")return{background:"none"};const M={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(M[t])return{"background-size":M[t]};const C={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(C[t])return{"background-position":C[t]};const W={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(W[t])return{"background-repeat":W[t]};if(t==="backdrop-blur")return{"backdrop-filter":`blur(${k[""]})`};if(e=t.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${k[e[1]]})`};if(t==="blur")return{filter:`blur(${k[""]})`};if(e=t.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${k[e[1]]})`};if(t==="grayscale")return{filter:"grayscale(100%)"};if(t==="grayscale-0")return{filter:"grayscale(0)"};if(t==="invert")return{filter:"invert(100%)"};if(t==="invert-0")return{filter:"invert(0)"};const E={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(E[t])return{position:E[t]};if(t==="inset-0")return{top:"0",right:"0",bottom:"0",left:"0"};if(t==="inset-auto")return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if(t==="inset-full")return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if(t==="inset-x-0")return{left:"0",right:"0"};if(t==="inset-y-0")return{top:"0",bottom:"0"};if(e=t.match(/^-?top-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{top:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?right-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{right:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?bottom-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{bottom:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?left-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{left:r&&n!=="0"?`-${n}`:n}}const K={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(e=t.match(/^z-(.+)$/)){const r=K[e[1]]??i(e[1]);if(r)return{"z-index":r}}const P={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(P[t])return{overflow:P[t]};if(e=t.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${e[1]}`]:e[2]};if(t==="scrollbar-hide")return{"-ms-overflow-style":"none","scrollbar-width":"none"};if(t==="visible")return{visibility:"visible"};if(t==="invisible")return{visibility:"hidden"};if(t==="collapse")return{visibility:"collapse"};const O={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(O[t])return{cursor:O[t]};if(t==="select-none")return{"user-select":"none"};if(t==="select-text")return{"user-select":"text"};if(t==="select-all")return{"user-select":"all"};if(t==="select-auto")return{"user-select":"auto"};if(t==="pointer-events-none")return{"pointer-events":"none"};if(t==="pointer-events-auto")return{"pointer-events":"auto"};const j={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(e=t.match(/^scale-(.+)$/)){const r=j[e[1]]??i(e[1]);if(r)return{transform:`scale(${r})`}}if(e=t.match(/^scale-x-(.+)$/)){const r=j[e[1]]??i(e[1]);if(r)return{transform:`scaleX(${r})`}}if(e=t.match(/^scale-y-(.+)$/)){const r=j[e[1]]??i(e[1]);if(r)return{transform:`scaleY(${r})`}}const V={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(e=t.match(/^-?rotate-(.+)$/)){const r=t.startsWith("-"),n=V[e[1]]??i(e[1]);if(n)return{transform:r?`rotate(-${n})`:`rotate(${n})`}}if(e=t.match(/^-?translate-x-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{transform:`translateX(${r&&n!=="0"?`-${n}`:n})`}}if(e=t.match(/^-?translate-y-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{transform:`translateY(${r&&n!=="0"?`-${n}`:n})`}}if(e=t.match(/^-?skew-x-(.+)$/)){const r=t.startsWith("-"),n=i(e[1])??`${e[1]}deg`;return{transform:r?`skewX(-${n})`:`skewX(${n})`}}if(e=t.match(/^-?skew-y-(.+)$/)){const r=t.startsWith("-"),n=i(e[1])??`${e[1]}deg`;return{transform:r?`skewY(-${n})`:`skewY(${n})`}}const R={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(R[t])return{"transform-origin":R[t]};const I={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(I[t])return{"transition-property":I[t],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const T={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(e=t.match(/^duration-(.+)$/)){const r=T[e[1]]??i(e[1]);if(r)return{"transition-duration":r}}if(e=t.match(/^delay-(.+)$/)){const r=T[e[1]]??i(e[1]);if(r)return{"transition-delay":r}}const N={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(N[t])return{"transition-timing-function":N[t]};const _={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(_[t])return{animation:_[t]};const F={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};if(F[t])return{"object-fit":F[t]};if(t==="aspect-square")return{"aspect-ratio":"1 / 1"};if(t==="aspect-video")return{"aspect-ratio":"16 / 9"};if(t==="aspect-auto")return{"aspect-ratio":"auto"};if(e=t.match(/^aspect-\[(.+)]$/))return{"aspect-ratio":e[1]};if(t==="list-none")return{"list-style-type":"none"};if(t==="list-disc")return{"list-style-type":"disc"};if(t==="list-decimal")return{"list-style-type":"decimal"};if(t==="list-inside")return{"list-style-position":"inside"};if(t==="list-outside")return{"list-style-position":"outside"};if(e=t.match(/^columns-(\d+)$/))return{columns:e[1]};if(t==="resize")return{resize:"both"};if(t==="resize-none")return{resize:"none"};if(t==="resize-x")return{resize:"horizontal"};if(t==="resize-y")return{resize:"vertical"};if(t==="sr-only")return{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"};if(t==="not-sr-only")return{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"};if(t==="focus-ring")return{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"};if(t==="appearance-none")return{appearance:"none"};if(t==="outline-none")return{outline:"none"};if(t==="outline")return{outline:"2px solid currentColor","outline-offset":"2px"};if(t==="float-left")return{float:"left"};if(t==="float-right")return{float:"right"};if(t==="float-none")return{float:"none"};if(t==="clear-both")return{clear:"both"};if(t==="isolate")return{isolation:"isolate"};if(t==="isolation-auto")return{isolation:"auto"};if(e=t.match(/^will-change-(.+)$/))return{"will-change":e[1]};if(t==="touch-manipulation")return{"touch-action":"manipulation"};if(t==="touch-none")return{"touch-action":"none"};if(t==="touch-pan-x")return{"touch-action":"pan-x"};if(t==="touch-pan-y")return{"touch-action":"pan-y"};if(t==="scroll-smooth")return{"scroll-behavior":"smooth"};if(t==="scroll-auto")return{"scroll-behavior":"auto"};if(e=t.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))return{[e[1]]:e[2]};const U=Z(t);return U||null}function dt(t){let o=0,s=-1;for(let a=0;a<t.length;a++)if(t[a]==="[")o++;else if(t[a]==="]")o--;else if(t[a]===":"&&o===0){s=a;break}return s===-1?{variant:null,utility:t}:{variant:t.slice(0,s),utility:t.slice(s+1)}}function G(t,o){for(const[s,a]of Object.entries(o))t[s]=a}function A(t){return Object.entries(t).map(([o,s])=>`${o}:${s}`).join(";")}const S=new Map;let g=null,v=null;function L(){return(!g||!g.isConnected)&&(g=document.getElementById("tkx-atomic"),g||(g=document.createElement("style"),g.id="tkx-atomic",document.head.appendChild(g))),g}function pt(){if(v)return v;try{const t=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t],v=t,t}catch{return null}}function mt(t,o){if(S.has(t)||(S.set(t,o),typeof document>"u"))return;const s=pt();if(s){const a=ht(o);for(const f of a)try{s.insertRule(f,s.cssRules.length)}catch{L().textContent+=f+`
|
|
1
|
+
"use strict";const Q=require("./index-DB_m7X7e.cjs"),l={0:"0",px:"1px","0.5":"2px",1:"4px","1.5":"6px",2:"8px","2.5":"10px",3:"12px","3.5":"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},D={...l,screen:"100vh"},x={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},y={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},H={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},tt={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},et={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},rt={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},nt={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},k={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},it=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(t=>[String(t),String(t/100)])),Y=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),ot={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},st=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,at=new Set(["behavior","-moz-binding","-webkit-binding","src"]),lt=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function q(t){return st.test(t)||t.includes("}")||t.includes("{")||t.includes("<")||t.includes(">")?null:t}function ct(t){const o=t.toLowerCase().trim();return at.has(o)||!lt.has(o)?null:o}function i(t){const o=t.match(/^\[(.+)]$/);return o?q(o[1]):null}function h(t){if(Y.has(t))return`var(--tkx-${t})`;if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="white")return"#ffffff";if(t==="black")return"#000000";if(t==="inherit")return"inherit";const o=i(t);return o||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t),t)}function ft(t){const o=t.match(/^\[([a-zA-Z-]+):(.+)]$/);if(o){const r=ct(o[1]),n=q(o[2]);return r&&n?{[r]:n}:null}const s={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(s[t])return{display:s[t]};const a={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(a[t])return{"flex-direction":a[t]};const f={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(f[t])return{"flex-wrap":f[t]};const b={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(b[t])return{flex:b[t]};if(t==="grow"||t==="flex-grow")return{"flex-grow":"1"};if(t==="grow-0")return{"flex-grow":"0"};if(t==="shrink"||t==="flex-shrink")return{"flex-shrink":"1"};if(t==="shrink-0"||t==="flex-shrink-0")return{"flex-shrink":"0"};const $={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if($[t])return{"align-items":$[t]};const d={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(d[t])return{"justify-content":d[t]};const c={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(c[t])return{"align-self":c[t]};const m={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(m[t])return{"align-content":m[t]};let e;if(e=t.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":e[1]==="none"?"none":e[1]==="subgrid"?"subgrid":`repeat(${e[1]},minmax(0,1fr))`};if(e=t.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":e[1]==="none"?"none":e[1]==="subgrid"?"subgrid":`repeat(${e[1]},minmax(0,1fr))`};if(e=t.match(/^col-span-(full|\d+)$/))return{"grid-column":e[1]==="full"?"1 / -1":`span ${e[1]} / span ${e[1]}`};if(e=t.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":e[1]};if(e=t.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":e[1]};if(e=t.match(/^row-span-(full|\d+)$/))return{"grid-row":e[1]==="full"?"1 / -1":`span ${e[1]} / span ${e[1]}`};if(e=t.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":e[1]};if(e=t.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":e[1]};if(t==="grid-flow-row")return{"grid-auto-flow":"row"};if(t==="grid-flow-col")return{"grid-auto-flow":"column"};if(t==="grid-flow-dense")return{"grid-auto-flow":"dense"};if(t==="grid-flow-row-dense")return{"grid-auto-flow":"row dense"};if(t==="grid-flow-col-dense")return{"grid-auto-flow":"column dense"};if(e=t.match(/^p-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{padding:r}}if(e=t.match(/^px-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-left":r,"padding-right":r}}if(e=t.match(/^py-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-top":r,"padding-bottom":r}}if(e=t.match(/^pt-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-top":r}}if(e=t.match(/^pr-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-right":r}}if(e=t.match(/^pb-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-bottom":r}}if(e=t.match(/^pl-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"padding-left":r}}if(e=t.match(/^-?m-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{margin:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?mx-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n){const p=r&&n!=="0"?`-${n}`:n;return{"margin-left":p,"margin-right":p}}}if(e=t.match(/^-?my-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n){const p=r&&n!=="0"?`-${n}`:n;return{"margin-top":p,"margin-bottom":p}}}if(e=t.match(/^-?mt-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-top":r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?mr-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-right":r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?mb-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-bottom":r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?ml-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??i(e[1]);if(n)return{"margin-left":r&&n!=="0"?`-${n}`:n}}if(t==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(t==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(e=t.match(/^gap-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{gap:r}}if(e=t.match(/^gap-x-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"column-gap":r}}if(e=t.match(/^gap-y-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"row-gap":r}}if(e=t.match(/^w-(.+)$/)){const r=e[1],n=l[r]??x[r]??i(r);if(n)return{width:n}}if(e=t.match(/^min-w-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"min-width":r}}if(e=t.match(/^max-w-(.+)$/)){const n={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[e[1]]??l[e[1]]??i(e[1]);if(n)return{"max-width":n}}if(e=t.match(/^h-(.+)$/)){const r=e[1],n=D[r]??x[r]??i(r);if(n)return{height:n}}if(e=t.match(/^min-h-(.+)$/)){const n={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[e[1]]??l[e[1]]??i(e[1]);if(n)return{"min-height":n}}if(e=t.match(/^max-h-(.+)$/)){const r=D[e[1]]??i(e[1]);if(r)return{"max-height":r}}if(e=t.match(/^size-(.+)$/)){const r=l[e[1]]??x[e[1]]??i(e[1]);if(r)return{width:r,height:r}}if(e=t.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[r,n]=tt[e[1]]??["1rem","1.5rem"];return{"font-size":r,"line-height":n}}if(e=t.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":et[e[1]]??e[1]};if(e=t.match(/^leading-(.+)$/)){const r=rt[e[1]]??i(e[1]);if(r)return{"line-height":r}}if(e=t.match(/^tracking-(.+)$/)){const r=nt[e[1]]??i(e[1]);if(r)return{"letter-spacing":r}}const u={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(u[t])return{"text-align":u[t]};if(t==="italic")return{"font-style":"italic"};if(t==="not-italic")return{"font-style":"normal"};if(t==="uppercase")return{"text-transform":"uppercase"};if(t==="lowercase")return{"text-transform":"lowercase"};if(t==="capitalize")return{"text-transform":"capitalize"};if(t==="normal-case")return{"text-transform":"none"};if(t==="underline")return{"text-decoration-line":"underline"};if(t==="overline")return{"text-decoration-line":"overline"};if(t==="line-through")return{"text-decoration-line":"line-through"};if(t==="no-underline")return{"text-decoration-line":"none"};if(t==="truncate")return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if(t==="text-ellipsis")return{"text-overflow":"ellipsis"};if(t==="text-clip")return{"text-overflow":"clip"};if(t==="whitespace-normal")return{"white-space":"normal"};if(t==="whitespace-nowrap")return{"white-space":"nowrap"};if(t==="whitespace-pre")return{"white-space":"pre"};if(t==="whitespace-pre-wrap")return{"white-space":"pre-wrap"};if(t==="whitespace-pre-line")return{"white-space":"pre-line"};if(t==="break-words")return{"overflow-wrap":"break-word"};if(t==="break-all")return{"word-break":"break-all"};if(t==="break-keep")return{"word-break":"keep-all"};if(t==="font-mono")return{"font-family":"var(--tkx-font-mono,monospace)"};if(t==="font-sans")return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if(t==="font-serif")return{"font-family":"ui-serif,Georgia,serif"};if(t==="antialiased")return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(e=t.match(/^indent-(.+)$/)){const r=l[e[1]]??i(e[1]);if(r)return{"text-indent":r}}if(e=t.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":e[1],"-webkit-box-orient":"vertical"};if(e=t.match(/^text-(.+)$/)){const[r,n]=e[1].split("/"),p=h(r);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(r)){if(n){const J=parseInt(n)/100;return{color:p,opacity:String(J)}}return{color:p}}}if(e=t.match(/^bg-(.+)$/)){const[r,n]=e[1].split("/"),p=h(r);return n?{"background-color":p,opacity:String(parseInt(n)/100)}:r==="none"?{background:"none"}:{"background-color":p}}if(e=t.match(/^border-color-(.+)$/))return{"border-color":h(e[1])};if(e=t.match(/^fill-(.+)$/))return{fill:h(e[1])};if(e=t.match(/^stroke-(.+)$/))return{stroke:h(e[1])};if(e=t.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":h(e[1])};if(e=t.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":h(e[1])};if(e=t.match(/^accent-(.+)$/))return{"accent-color":h(e[1])};if(e=t.match(/^caret-(.+)$/))return{"caret-color":h(e[1])};if(e=t.match(/^outline-color-(.+)$/))return{"outline-color":h(e[1])};if(t==="border")return{"border-width":"1px"};if(e=t.match(/^border-(\d+)$/))return{"border-width":`${e[1]}px`};if(t==="border-t")return{"border-top-width":"1px"};if(e=t.match(/^border-t-(\d+)$/))return{"border-top-width":`${e[1]}px`};if(t==="border-r")return{"border-right-width":"1px"};if(e=t.match(/^border-r-(\d+)$/))return{"border-right-width":`${e[1]}px`};if(t==="border-b")return{"border-bottom-width":"1px"};if(e=t.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${e[1]}px`};if(t==="border-l")return{"border-left-width":"1px"};if(e=t.match(/^border-l-(\d+)$/))return{"border-left-width":`${e[1]}px`};if(t==="border-x")return{"border-left-width":"1px","border-right-width":"1px"};if(t==="border-y")return{"border-top-width":"1px","border-bottom-width":"1px"};if(t==="border-none")return{"border-style":"none"};if(t==="border-solid")return{"border-style":"solid"};if(t==="border-dashed")return{"border-style":"dashed"};if(t==="border-dotted")return{"border-style":"dotted"};if(t==="border-double")return{"border-style":"double"};if((e=t.match(/^border-([a-zA-Z].*)$/))&&Y.has(e[1]))return{"border-color":`var(--tkx-${e[1]})`};if(e=t.match(/^border-\[(.+)]$/))return{"border-color":e[1]};if(t==="border-0")return{"border-width":"0"};if(t==="rounded")return{"border-radius":y[""]};if(e=t.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":y[e[1]]??i(e[1])??e[1]};if(e=t.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const r=e[1],n=y[e[2]??""]??y[""];return{t:{"border-top-left-radius":n,"border-top-right-radius":n},r:{"border-top-right-radius":n,"border-bottom-right-radius":n},b:{"border-bottom-left-radius":n,"border-bottom-right-radius":n},l:{"border-top-left-radius":n,"border-bottom-left-radius":n},tl:{"border-top-left-radius":n},tr:{"border-top-right-radius":n},br:{"border-bottom-right-radius":n},bl:{"border-bottom-left-radius":n}}[r]??{}}const w={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if(t==="ring")return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((e=t.match(/^ring-(\d+)$/))&&w[e[1]])return{"box-shadow":`0 0 0 ${w[e[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(t==="ring-inset")return{"--tkx-ring-offset":"inset"};if(e=t.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${e[1]}px`,"box-shadow":`0 0 0 ${e[1]}px var(--tkx-bg)`};if(t==="shadow")return{"box-shadow":H[""]};if(e=t.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":H[e[1]]};if(e=t.match(/^opacity-(\d+)$/)){const r=it[e[1]];if(r!==void 0)return{opacity:r}}if(t==="bg-none")return{background:"none"};const M={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(M[t])return{"background-size":M[t]};const C={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(C[t])return{"background-position":C[t]};const W={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(W[t])return{"background-repeat":W[t]};if(t==="backdrop-blur")return{"backdrop-filter":`blur(${k[""]})`};if(e=t.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${k[e[1]]})`};if(t==="blur")return{filter:`blur(${k[""]})`};if(e=t.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${k[e[1]]})`};if(t==="grayscale")return{filter:"grayscale(100%)"};if(t==="grayscale-0")return{filter:"grayscale(0)"};if(t==="invert")return{filter:"invert(100%)"};if(t==="invert-0")return{filter:"invert(0)"};const E={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(E[t])return{position:E[t]};if(t==="inset-0")return{top:"0",right:"0",bottom:"0",left:"0"};if(t==="inset-auto")return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if(t==="inset-full")return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if(t==="inset-x-0")return{left:"0",right:"0"};if(t==="inset-y-0")return{top:"0",bottom:"0"};if(e=t.match(/^-?top-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{top:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?right-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{right:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?bottom-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{bottom:r&&n!=="0"?`-${n}`:n}}if(e=t.match(/^-?left-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{left:r&&n!=="0"?`-${n}`:n}}const K={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(e=t.match(/^z-(.+)$/)){const r=K[e[1]]??i(e[1]);if(r)return{"z-index":r}}const P={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(P[t])return{overflow:P[t]};if(e=t.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${e[1]}`]:e[2]};if(t==="scrollbar-hide")return{"-ms-overflow-style":"none","scrollbar-width":"none"};if(t==="visible")return{visibility:"visible"};if(t==="invisible")return{visibility:"hidden"};if(t==="collapse")return{visibility:"collapse"};const O={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(O[t])return{cursor:O[t]};if(t==="select-none")return{"user-select":"none"};if(t==="select-text")return{"user-select":"text"};if(t==="select-all")return{"user-select":"all"};if(t==="select-auto")return{"user-select":"auto"};if(t==="pointer-events-none")return{"pointer-events":"none"};if(t==="pointer-events-auto")return{"pointer-events":"auto"};const j={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(e=t.match(/^scale-(.+)$/)){const r=j[e[1]]??i(e[1]);if(r)return{transform:`scale(${r})`}}if(e=t.match(/^scale-x-(.+)$/)){const r=j[e[1]]??i(e[1]);if(r)return{transform:`scaleX(${r})`}}if(e=t.match(/^scale-y-(.+)$/)){const r=j[e[1]]??i(e[1]);if(r)return{transform:`scaleY(${r})`}}const V={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(e=t.match(/^-?rotate-(.+)$/)){const r=t.startsWith("-"),n=V[e[1]]??i(e[1]);if(n)return{transform:r?`rotate(-${n})`:`rotate(${n})`}}if(e=t.match(/^-?translate-x-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{transform:`translateX(${r&&n!=="0"?`-${n}`:n})`}}if(e=t.match(/^-?translate-y-(.+)$/)){const r=t.startsWith("-"),n=l[e[1]]??x[e[1]]??i(e[1]);if(n)return{transform:`translateY(${r&&n!=="0"?`-${n}`:n})`}}if(e=t.match(/^-?skew-x-(.+)$/)){const r=t.startsWith("-"),n=i(e[1])??`${e[1]}deg`;return{transform:r?`skewX(-${n})`:`skewX(${n})`}}if(e=t.match(/^-?skew-y-(.+)$/)){const r=t.startsWith("-"),n=i(e[1])??`${e[1]}deg`;return{transform:r?`skewY(-${n})`:`skewY(${n})`}}const R={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(R[t])return{"transform-origin":R[t]};const I={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(I[t])return{"transition-property":I[t],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const T={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(e=t.match(/^duration-(.+)$/)){const r=T[e[1]]??i(e[1]);if(r)return{"transition-duration":r}}if(e=t.match(/^delay-(.+)$/)){const r=T[e[1]]??i(e[1]);if(r)return{"transition-delay":r}}const N={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(N[t])return{"transition-timing-function":N[t]};const _={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(_[t])return{animation:_[t]};const F={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};if(F[t])return{"object-fit":F[t]};if(t==="aspect-square")return{"aspect-ratio":"1 / 1"};if(t==="aspect-video")return{"aspect-ratio":"16 / 9"};if(t==="aspect-auto")return{"aspect-ratio":"auto"};if(e=t.match(/^aspect-\[(.+)]$/))return{"aspect-ratio":e[1]};if(t==="list-none")return{"list-style-type":"none"};if(t==="list-disc")return{"list-style-type":"disc"};if(t==="list-decimal")return{"list-style-type":"decimal"};if(t==="list-inside")return{"list-style-position":"inside"};if(t==="list-outside")return{"list-style-position":"outside"};if(e=t.match(/^columns-(\d+)$/))return{columns:e[1]};if(t==="resize")return{resize:"both"};if(t==="resize-none")return{resize:"none"};if(t==="resize-x")return{resize:"horizontal"};if(t==="resize-y")return{resize:"vertical"};if(t==="sr-only")return{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"};if(t==="not-sr-only")return{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"};if(t==="focus-ring")return{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"};if(t==="appearance-none")return{appearance:"none"};if(t==="outline-none")return{outline:"none"};if(t==="outline")return{outline:"2px solid currentColor","outline-offset":"2px"};if(t==="float-left")return{float:"left"};if(t==="float-right")return{float:"right"};if(t==="float-none")return{float:"none"};if(t==="clear-both")return{clear:"both"};if(t==="isolate")return{isolation:"isolate"};if(t==="isolation-auto")return{isolation:"auto"};if(e=t.match(/^will-change-(.+)$/))return{"will-change":e[1]};if(t==="touch-manipulation")return{"touch-action":"manipulation"};if(t==="touch-none")return{"touch-action":"none"};if(t==="touch-pan-x")return{"touch-action":"pan-x"};if(t==="touch-pan-y")return{"touch-action":"pan-y"};if(t==="scroll-smooth")return{"scroll-behavior":"smooth"};if(t==="scroll-auto")return{"scroll-behavior":"auto"};if(e=t.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))return{[e[1]]:e[2]};const U=Z(t);return U||null}function dt(t){let o=0,s=-1;for(let a=0;a<t.length;a++)if(t[a]==="[")o++;else if(t[a]==="]")o--;else if(t[a]===":"&&o===0){s=a;break}return s===-1?{variant:null,utility:t}:{variant:t.slice(0,s),utility:t.slice(s+1)}}function G(t,o){for(const[s,a]of Object.entries(o))t[s]=a}function A(t){return Object.entries(t).map(([o,s])=>`${o}:${s}`).join(";")}const S=new Map;let g=null,v=null;function L(){return(!g||!g.isConnected)&&(g=document.getElementById("tkx-atomic"),g||(g=document.createElement("style"),g.id="tkx-atomic",document.head.appendChild(g))),g}function pt(){if(v)return v;try{const t=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t],v=t,t}catch{return null}}function mt(t,o){if(S.has(t)||(S.set(t,o),typeof document>"u"))return;const s=pt();if(s){const a=ht(o);for(const f of a)try{s.insertRule(f,s.cssRules.length)}catch{L().textContent+=f+`
|
|
2
2
|
`}}else L().textContent+=o+`
|
|
3
3
|
`}function ht(t){const o=[];let s=0,a=0;for(let f=0;f<t.length;f++)if(t[f]==="{")s++;else if(t[f]==="}"&&(s--,s===0)){const b=t.slice(a,f+1).trim();b&&o.push(b),a=f+1}return o}function B(t){const o=[];for(const s of t)if(s){if(typeof s=="string")o.push(...s.split(/\s+/).filter(Boolean));else if(Array.isArray(s))o.push(...B(s));else if(typeof s=="object")for(const[a,f]of Object.entries(s))f&&o.push(a)}return o}function X(...t){const o=B(t);if(o.length===0)return"";const s={base:{},variants:{}};for(const c of o){const{variant:m,utility:e}=dt(c),u=ft(e);u&&(m?(s.variants[m]||(s.variants[m]={}),G(s.variants[m],u)):G(s.base,u))}const a=[],f=A(s.base),b=[f,...Object.entries(s.variants).map(([c,m])=>`${c}{${A(m)}}`)].join("|"),$=Q.fnv1aHash(b),d=`tkx-${$}`;f&&a.push(`.${d}{${f}}`);for(const[c,m]of Object.entries(s.variants)){const e=A(m);if(e)if(c.startsWith("@")){const u=c.slice(1),w=ot[u];w&&a.push(`@media(min-width:${w}){.${d}{${e}}}`)}else if(c==="motion-safe")a.push(`@media(prefers-reduced-motion:no-preference){.${d}{${e}}}`);else if(c==="motion-reduce")a.push(`@media(prefers-reduced-motion:reduce){.${d}{${e}}}`);else if(c==="contrast-more")a.push(`@media(prefers-contrast:more){.${d}{${e}}}`);else if(c==="forced-colors")a.push(`@media(forced-colors:active){.${d}{${e}}}`);else if(c==="dark")a.push(`@media(prefers-color-scheme:dark){.${d}{${e}}}`);else if(c==="print")a.push(`@media print{.${d}{${e}}}`);else if(c==="group-hover")a.push(`.group:hover .${d}{${e}}`);else if(c==="group-focus")a.push(`.group:focus-within .${d}{${e}}`);else if(c==="peer-hover")a.push(`.peer:hover~.${d}{${e}}`);else{const w={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[c]??`:${c}`;a.push(`.${d}${w}{${e}}`)}}return a.length>0&&mt($,a.join("")),d}const ut=X;function xt(){return Array.from(S.values()).join(`
|
|
4
4
|
`)}function gt(){S.clear(),g=null,v&&typeof document<"u"&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==v),v=null)}function bt(...t){return t.filter(Boolean).join(" ")}const z=new Map;function wt(t){z.set(t.name,t.utilities)}function vt(t){z.delete(t)}function $t(){return Array.from(z.keys())}function Z(t){for(const o of z.values())if(o[t])return o[t];return null}exports.cx=bt;exports.extractAtomicCSS=xt;exports.resetAtomicCSS=gt;exports.resolvePluginUtility=Z;exports.tkx=X;exports.tkxListPlugins=$t;exports.tkxPlugin=wt;exports.tkxRemovePlugin=vt;exports.tx=ut;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tekivex-ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.7",
|
|
4
4
|
"description": "Production-grade React component library — 70+ components, WCAG 2.1 AAA, WAI-ARIA 1.2, built-in charts, headless primitives, zero-runtime CSS engine, TypeScript-first.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"require": "./dist/index.cjs",
|
|
13
13
|
"types": "./dist/index.d.ts"
|
|
14
14
|
},
|
|
15
|
-
"./styles": "./dist/
|
|
15
|
+
"./styles": "./dist/style.css",
|
|
16
16
|
"./themes": {
|
|
17
17
|
"import": "./dist/themes.js",
|
|
18
18
|
"require": "./dist/themes.cjs",
|
|
@@ -49,7 +49,8 @@ export function TkxAlert({ variant, title, children, dismissible, onDismiss, ico
|
|
|
49
49
|
if (safeTitle) {
|
|
50
50
|
announce(safeTitle, variant === 'danger' || variant === 'warning' ? 'assertive' : 'polite');
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
}, [safeTitle, variant]);
|
|
53
54
|
|
|
54
55
|
const colorMap: Record<AlertVariant, string> = {
|
|
55
56
|
info: theme.info, success: theme.success, warning: theme.warning, danger: theme.danger,
|
|
@@ -31,8 +31,8 @@ export const TkxBadge = forwardRef<HTMLSpanElement, TkxBadgeProps>(
|
|
|
31
31
|
default: theme.border, primary: theme.primary, secondary: theme.secondary,
|
|
32
32
|
danger: theme.danger, warning: theme.warning, success: theme.success, info: theme.info,
|
|
33
33
|
};
|
|
34
|
-
const bgColor = colorMap[variant];
|
|
35
|
-
const textColor = getAccessibleForeground(bgColor, ['#ffffff', '#000000', theme.bg]);
|
|
34
|
+
const bgColor = colorMap[variant] || '#666666';
|
|
35
|
+
const textColor = getAccessibleForeground(bgColor, ['#ffffff', '#000000', theme.bg || '#000000']);
|
|
36
36
|
|
|
37
37
|
const safeChildren = typeof children === 'string' ? sanitizeString(children) : children;
|
|
38
38
|
|
|
@@ -28,6 +28,7 @@ export interface ToastItem {
|
|
|
28
28
|
|
|
29
29
|
export interface TkxToastProps {
|
|
30
30
|
position?: ToastPosition;
|
|
31
|
+
children?: React.ReactNode;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
// ── Module-level store ────────────────────────────────────────────────────────
|
|
@@ -227,7 +228,7 @@ function ToastCard({ toast, position, onDismiss, reduced }: ToastCardProps) {
|
|
|
227
228
|
|
|
228
229
|
// ── Provider ──────────────────────────────────────────────────────────────────
|
|
229
230
|
|
|
230
|
-
export function TkxToastProvider({ position = 'top-right' }: TkxToastProps) {
|
|
231
|
+
export function TkxToastProvider({ position = 'top-right', children }: TkxToastProps) {
|
|
231
232
|
const [toasts, setToasts] = useState<ToastItem[]>([...visible]);
|
|
232
233
|
const reduced = useReducedMotion();
|
|
233
234
|
|
|
@@ -263,11 +264,11 @@ export function TkxToastProvider({ position = 'top-right' }: TkxToastProps) {
|
|
|
263
264
|
}
|
|
264
265
|
}, []);
|
|
265
266
|
|
|
266
|
-
if (typeof document === 'undefined') return
|
|
267
|
+
if (typeof document === 'undefined') return <>{children}</>;
|
|
267
268
|
|
|
268
269
|
const ordered = isBottom ? [...toasts].reverse() : toasts;
|
|
269
270
|
|
|
270
|
-
return createPortal(
|
|
271
|
+
return <>{children}{createPortal(
|
|
271
272
|
<div
|
|
272
273
|
aria-label="Notifications"
|
|
273
274
|
className={tkx('fixed z-[9999] flex flex-col gap-2 pointer-events-none')}
|
|
@@ -280,5 +281,5 @@ export function TkxToastProvider({ position = 'top-right' }: TkxToastProps) {
|
|
|
280
281
|
))}
|
|
281
282
|
</div>,
|
|
282
283
|
document.body,
|
|
283
|
-
)
|
|
284
|
+
)}</>;
|
|
284
285
|
}
|
package/src/engine/wcag.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// ── Color Contrast ───────────────────────────────────────────────────────────
|
|
5
5
|
|
|
6
6
|
function hexToRgb(hex: string): [number, number, number] {
|
|
7
|
+
if (!hex || typeof hex !== 'string') return [0, 0, 0];
|
|
7
8
|
const clean = hex.replace('#', '');
|
|
8
9
|
const full = clean.length === 3
|
|
9
10
|
? clean.split('').map((c) => c + c).join('')
|
|
@@ -11,7 +12,7 @@ function hexToRgb(hex: string): [number, number, number] {
|
|
|
11
12
|
const r = parseInt(full.slice(0, 2), 16);
|
|
12
13
|
const g = parseInt(full.slice(2, 4), 16);
|
|
13
14
|
const b = parseInt(full.slice(4, 6), 16);
|
|
14
|
-
return [r, g, b];
|
|
15
|
+
return [isNaN(r) ? 0 : r, isNaN(g) ? 0 : g, isNaN(b) ? 0 : b];
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export function relativeLuminance(hex: string): number {
|
package/dist/index-BINBzXuY.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("react"),G=2166136261,W=16777619;function v(n){let e=G;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,W)>>>0;return e.toString(16).padStart(8,"0")}class M{constructor(e=512){this.cache=new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(e,512)}get(e){if(!this.cache.has(e)){this.misses++;return}this.hits++;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}has(e){return this.cache.has(e)}invalidate(e){e!==void 0?this.cache.delete(e):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const e=this.hits+this.misses;return e===0?0:this.hits/e*100}}const f=new M(512);function $(n,e){const t=f.get(n);if(t!==void 0)return t;const s=e();return f.set(n,s),s}const C=[];let b=!1;const m=[];let y=0,l=0;function _(){const n=C.splice(0),e=performance.now();for(const s of n)try{s()}catch{}const t=performance.now()-e;y+=t,l++,m.push({duration:t,timestamp:Date.now()}),m.length>100&&m.shift()}function H(n){C.push(n),b||(b=!0,queueMicrotask(()=>{_(),b=!1}))}function X(n){const e=n!==void 0?m.slice(-n):m.slice();return{avgRenderTime:l===0?0:y/l,cacheHitRate:f.cacheHitRate,renderCount:l,recent:e}}function Q(n){n!==void 0?f.invalidate(n):f.invalidate()}const Z={hash:v,memoize:$,batchUpdate:H,invalidate:Q,get avgRenderTime(){return l===0?0:y/l},get cacheHitRate(){return f.cacheHitRate},getMetrics:X},x=new Map;function R(n){return n.replace(/([A-Z])/g,"-$1").toLowerCase()}function J(n){return"tkx-"+v(n)}function j(n){const e=J(n);return x.has(e)||x.set(e,n),e}function D(n,...e){const t=n.reduce((r,a,i)=>r+a+(e[i]!==void 0?String(e[i]):""),"");return{className:j(t.trim()),styles:t.trim()}}function z(n){const e=Object.entries(n).map(([s,r])=>`${R(s)}: ${r};`).join(" ");return{className:j(e),styles:e}}const Y={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function L(n,e){return`@media (min-width: ${Y[n]}) { ${e} }`}function F(n,e){const t=Object.entries(e).map(([s,r])=>{const a=Object.entries(r).map(([i,o])=>`${R(i)}: ${o};`).join(" ");return`${s} { ${a} }`}).join(" ");return`@keyframes ${n} { ${t} }`}function w(n,e){return e!==void 0?`--tkx-${n}: ${e};`:`var(--tkx-${n})`}function A(){return Array.from(x.entries()).map(([n,e])=>`.${n} { ${e} }`).join(`
|
|
2
|
-
`)}function O(){x.clear()}function N(){if(typeof document>"u")return;let n=document.getElementById("tkx-styles");n||(n=document.createElement("style"),n.id="tkx-styles",document.head.appendChild(n)),n.textContent=A()}const ee={css:D,fromObject:z,responsive:L,keyframes:F,cssVar:w,extractCSS:A,injectStyles:N,resetStyles:O};function te(n){const e=n.replace("#",""),t=e.length===3?e.split("").map(i=>i+i).join(""):e,s=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return[s,r,a]}function S(n){const[e,t,s]=te(n).map(r=>{const a=r/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*e+.7152*t+.0722*s}function d(n,e){const t=S(n),s=S(e),r=Math.max(t,s),a=Math.min(t,s);return(r+.05)/(a+.05)}function g(n,e,t=!1){return d(n,e)>=(t?3:4.5)}function B(n,e,t=!1){return d(n,e)>=(t?4.5:7)}function P(n,e){const s=e??["#ffffff","#000000"];return s.reduce((r,a)=>d(a,n)>d(r,n)?a:r,s[0])}function K(){const n=document.createElement("div"),e=document.createElement("div");for(const t of[n,e])t.setAttribute("aria-atomic","true"),t.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(t);return n.setAttribute("aria-live","polite"),e.setAttribute("aria-live","assertive"),{announce(t,s="polite"){const r=s==="assertive"?e:n;r.textContent="",setTimeout(()=>{r.textContent=t},0)},destroy(){n.remove(),e.remove()}}}const ne=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function U(n){let e=null,t=null;function s(){return Array.from(n.querySelectorAll(ne)).filter(r=>!r.closest("[hidden]")&&!r.closest('[aria-hidden="true"]'))}return{activate(){e=document.activeElement;const r=s();r.length>0&&r[0].focus(),t=a=>{if(a.key!=="Tab")return;const i=s();if(i.length===0)return;const o=i[0],h=i[i.length-1];a.shiftKey?document.activeElement===o&&(a.preventDefault(),h.focus()):document.activeElement===h&&(a.preventDefault(),o.focus())},n.addEventListener("keydown",t)},deactivate(){t&&n.removeEventListener("keydown",t),e instanceof HTMLElement&&e.focus(),e=null,t=null}}}function V(n,e,t,s){let r=e;switch(n.key){case"ArrowLeft":case"ArrowUp":n.preventDefault(),r=e===0?t-1:e-1;break;case"ArrowRight":case"ArrowDown":n.preventDefault(),r=e===t-1?0:e+1;break;case"Home":n.preventDefault(),r=0;break;case"End":n.preventDefault(),r=t-1;break;case"Enter":case" ":n.preventDefault(),s(e);return;default:return}s(r)}function re(n,e,t,s,r){let a=e;switch(n.key){case"ArrowUp":n.preventDefault(),a=e===0?t-1:e-1;break;case"ArrowDown":n.preventDefault(),a=e===t-1?0:e+1;break;case"Home":n.preventDefault(),a=0;break;case"End":n.preventDefault(),a=t-1;break;case"Enter":case" ":n.preventDefault(),s(e);return;case"Escape":n.preventDefault(),r==null||r();return;default:return}s(a)}function q(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function I(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function se(n,e="polite"){if(typeof document>"u")return;let t=document.getElementById("tkx-live-region");t||(t=document.createElement("div"),t.id="tkx-live-region",t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(t)),t.textContent="",setTimeout(()=>{t&&(t.textContent=n)},0)}const ae={contrastRatio:d,meetsAA:g,meetsAAA:B,getAccessibleForeground:P,createAnnouncer:K,createFocusTrap:U,handleTabsKeyboard:V,handleMenuKeyboard:re,prefersReducedMotion:q,prefersHighContrast:I,announce:se},ie=typeof window<"u"?u.useLayoutEffect:u.useEffect,E={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},oe={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},ce=/^#[0-9a-fA-F]{3,8}$/;function le(n,e){const t={...n,...e};for(const[s,r]of Object.entries(t))if(!ce.test(r))throw new Error(`Invalid hex color for theme token '${s}': ${r}`);return g(t.text,t.bg)||console.warn(`[TekiVex] Theme contrast warning: text (${t.text}) vs bg (${t.bg}) does not meet WCAG AA minimum (4.5:1)`),g(t.primary,t.bg)||console.warn(`[TekiVex] Theme contrast warning: primary (${t.primary}) vs bg (${t.bg}) does not meet WCAG AA minimum`),t}const k=u.createContext(E);function ue({theme:n=E,children:e}){ie(()=>{const s=Object.entries(n).map(([a,i])=>w(a,i)).join(" ");let r=document.getElementById("tkx-theme");if(!r){r=document.createElement("style"),r.id="tkx-theme";const a=document.head.querySelector("style");a?document.head.insertBefore(r,a):document.head.appendChild(r)}r.textContent=`:root { ${s} }`},[n]);const t=Object.fromEntries(Object.entries(n).map(([s,r])=>[`--tkx-${s}`,r]));return u.createElement(k.Provider,{value:n},u.createElement("div",{style:{display:"contents",...t}},e))}function fe(){return u.useContext(k)}function de(n){const e=n.replace("#",""),t=parseInt(e.slice(0,2),16)/255,s=parseInt(e.slice(2,4),16)/255,r=parseInt(e.slice(4,6),16)/255,a=Math.max(t,s,r),i=Math.min(t,s,r);let o=0,h=0;const T=(a+i)/2;if(a!==i){const p=a-i;switch(h=T>.5?p/(2-a-i):p/(a+i),a){case t:o=((s-r)/p+(s<r?6:0))/6;break;case s:o=((r-t)/p+2)/6;break;case r:o=((t-s)/p+4)/6;break}}return[Math.round(o*360),Math.round(h*100),Math.round(T*100)]}function c(n,e,t){e/=100,t/=100;const s=e*Math.min(t,1-t),r=a=>{const i=(a+n/30)%12,o=t-s*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*o).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function he(n){const[e,t]=de(n);return{50:c(e,Math.min(t,30),96),100:c(e,Math.min(t,40),90),200:c(e,Math.min(t,50),80),300:c(e,t,70),400:c(e,t,60),500:n,600:c(e,t,45),700:c(e,t,35),800:c(e,t,25),900:c(e,t,15)}}const pe={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1.15"}},me={0:"0px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",4:"16px",5:"20px",6:"24px",8:"32px",10:"40px",12:"48px",16:"64px",20:"80px",24:"96px"},xe={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},ge={none:"none",xs:"0 1px 2px 0 rgba(0,0,0,0.05)",sm:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)"},be={hide:-1,base:0,dropdown:1e3,sticky:1100,fixed:1200,overlay:1300,modal:1400,popover:1500,tooltip:1600,toast:1700,max:9999},ve={none:"0",sm:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px",full:"9999px"};exports.LRUCache=M;exports.Quantum=Z;exports.TKX=ee;exports.ThemeContext=k;exports.ThemeProvider=ue;exports.WCAGEngine=ae;exports.auroraLight=oe;exports.batchUpdate=H;exports.breakpoints=xe;exports.contrastRatio=d;exports.createAnnouncer=K;exports.createFocusTrap=U;exports.createTheme=le;exports.css=D;exports.cssVar=w;exports.extractCSS=A;exports.fnv1aHash=v;exports.fromObject=z;exports.generatePalette=he;exports.getAccessibleForeground=P;exports.handleTabsKeyboard=V;exports.injectStyles=N;exports.keyframes=F;exports.meetsAA=g;exports.meetsAAA=B;exports.memoize=$;exports.prefersHighContrast=I;exports.prefersReducedMotion=q;exports.quantumDark=E;exports.radii=ve;exports.resetStyles=O;exports.responsive=L;exports.shadows=ge;exports.spacing=me;exports.typography=pe;exports.useTheme=fe;exports.zIndex=be;
|