@nadicodeai/ui 12.1.54 → 12.1.56

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.
Files changed (43) hide show
  1. package/dist/eslint/index.js +27 -69
  2. package/dist/eslint/rules/jsx-class-utility.js +2 -56
  3. package/dist/eslint/rules/no-choice-control-wrapper.js +95 -0
  4. package/dist/eslint/rules/no-comment.js +44 -0
  5. package/dist/eslint/rules/no-subject-derived-expectation.js +55 -1
  6. package/dist/eslint/strict-design-system.js +224 -0
  7. package/dist/standalone/index.d.ts +6 -0
  8. package/dist/standalone/index.js +3 -0
  9. package/dist/standalone/orb-page.d.ts +2 -0
  10. package/dist/standalone/orb-page.d.ts.map +1 -0
  11. package/dist/standalone/orb-page.js +11 -0
  12. package/dist/styles/components.css +1 -1
  13. package/package.json +7 -2
  14. package/dist/.build-kind +0 -1
  15. package/dist/eslint/rules/card-row-owner.js +0 -167
  16. package/dist/eslint/rules/confirm-destructive-action.js +0 -177
  17. package/dist/eslint/rules/drawer-owns-its-edges.js +0 -66
  18. package/dist/eslint/rules/expect-chain.js +0 -60
  19. package/dist/eslint/rules/icon-control-accessible-name.js +0 -156
  20. package/dist/eslint/rules/menu-command-owner.js +0 -45
  21. package/dist/eslint/rules/no-bare-page-navigation.js +0 -46
  22. package/dist/eslint/rules/no-elevated-edge.js +0 -141
  23. package/dist/eslint/rules/no-existence-only-assertion.js +0 -89
  24. package/dist/eslint/rules/no-invalid-token-utility.js +0 -46
  25. package/dist/eslint/rules/no-mono-title-register.js +0 -73
  26. package/dist/eslint/rules/no-native-visible-control.js +0 -92
  27. package/dist/eslint/rules/no-nested-overlay.js +0 -56
  28. package/dist/eslint/rules/no-off-grid-spacing.js +0 -115
  29. package/dist/eslint/rules/no-paired-size-utility.js +0 -66
  30. package/dist/eslint/rules/no-raw-shadow.js +0 -70
  31. package/dist/eslint/rules/no-repainted-focus.js +0 -75
  32. package/dist/eslint/rules/no-resting-settings-control.js +0 -89
  33. package/dist/eslint/rules/no-route-width-override.js +0 -135
  34. package/dist/eslint/rules/no-store-cast.js +0 -46
  35. package/dist/eslint/rules/no-token-category-bypass.js +0 -53
  36. package/dist/eslint/rules/no-unpinned-vercel-functions-import.js +0 -104
  37. package/dist/eslint/rules/one-control-height.js +0 -163
  38. package/dist/eslint/rules/overlay-body-owns-scroll.js +0 -62
  39. package/dist/eslint/rules/overlay-mounts-closed.js +0 -102
  40. package/dist/eslint/rules/prefer-radio-for-few-static-options.js +0 -77
  41. package/dist/eslint/rules/settings-section-description.js +0 -45
  42. package/dist/eslint/rules/shadcn-composition.js +0 -197
  43. package/dist/eslint/rules/table-column-wraps-by-meta.js +0 -55
@@ -0,0 +1,3 @@
1
+ export const agentOrbScript = "\"use strict\";(()=>{function U(n,e,t){return n+(e-n)*t}function at(n){return n-Math.floor(n)}function V(n,e){let t=Math.floor(n),a=Math.floor(e),o=n-t,s=e-a;o=o*o*(3-2*o),s=s*s*(3-2*s);let r=_(t,a),p=_(t+1,a),c=_(t,a+1),M=_(t+1,a+1);return r+(p-r)*o+(c-r)*s+(r-p-c+M)*o*s}function _(n,e){let t=Math.sin(n*12.9898+e*78.233)*43758.5453;return t-Math.floor(t)}function J(n,e){let t=Math.PI*(3-Math.sqrt(5)),a=1-2*(n+.5)/e,o=Math.sqrt(1-a*a),s=n*t;return[o*Math.cos(s),a,o*Math.sin(s)]}function Pt(n,e){return Math.atan2(Math.sin(n-e),Math.cos(n-e))}function j(n,e,t,a,o){let s=Math.sin(e),r=Math.cos(e),p=Math.sin(n),c=Math.cos(n);return(M,O,u)=>{let i=M*c+u*p,d=-M*p+u*c,m=O*r-d*s,f=O*s+d*r;return[t+i*o,a-m*o,f]}}function rt(n,e,t,a){if(!a){let s=Math.round((t?1-n:n)*255);return`rgba(${s},${s},${s},${e})`}let o=s=>Math.round(t?s*(1-n):s+(255-s)*n);return`rgba(${o(a.r)},${o(a.g)},${o(a.b)},${e})`}function it(n,e,t,a=.3,o){for(let s of e){let r=s.a??1,p=Math.min(1,Math.max(0,s.white));n.fillStyle=rt(p,r,t,o),n.beginPath(),n.arc(s.x,s.y,s.r,0,Math.PI*2),n.fill()}}function ct(n,e,t,a){for(let o of e){let s=o.a??1,r=Math.min(1,Math.max(0,o.white));n.strokeStyle=rt(r,s,t,a),n.lineWidth=o.w,n.beginPath(),n.moveTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.stroke()}}function q(n,e,t=.3){let a=[];for(let o of n)(o.a??1)<.02||(o.r=Math.max(t,o.r),a.push(o));return a.sort((o,s)=>o.z-s.z),{dots:a,lines:e.filter(o=>(o.a??1)>=.02)}}function ht(n,e,t,a){e.lines.length&&ct(n,e.lines,t,a),it(n,e.dots,t,.3,a)}function $(n,e){return(n/300)**e}var St=[[\"latRings\",\"lonDensity\"],[\"rings\",\"lonDensity\"],[\"lanes\",\"segs\"]],At=[\"orbitN\",\"ghostN\",\"nodeN\",\"strandN\",\"signals\"],vt=[\"iconD\"],kt=[\"rBase\",\"rDepth\",\"rActive\",\"rDot\",\"ghostR\",\"partR\",\"partRDepth\",\"nodeR\",\"nodeRDepth\"];function Rt(n,e){let t={...n},a=new Set,o=Math.sqrt(e);for(let[s,r]of St){let p=t[s],c=t[r];p!=null&&c!=null&&!a.has(s)&&!a.has(r)&&(t[s]=Math.max(2,Math.round(p*o)),t[r]=Math.max(2,Math.round(c*o)),a.add(s),a.add(r))}for(let s of At){let r=t[s];r!=null&&r!==0&&!a.has(s)&&(t[s]=Math.max(1,Math.round(r*e)))}for(let s of vt){let r=t[s];r!=null&&(t[s]=Math.max(.02,r*e))}return t}function Dt(n,e){let t={...n};for(let a of kt){let o=t[a];o!=null&&(t[a]=o*e)}return t.rSizeMul=(t.rSizeMul??1)*e,t}var zt={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},It=(n,e,t)=>{let a=n/2,o=n/2,s=n/2*.76,r=j(e*.4,.3,a,o,1),p=$(n,t.rsPow??.6),c=[],M=t.ghostN??150;for(let i=0;i<M;i++){let d=J(i,M),[m,f,h]=r(d[0]*s,d[1]*s,d[2]*s),b=(h/s+1)/2;c.push({x:m,y:f,z:h,r:.8*p,white:.78,a:.1+.22*b})}let O=t.strandN??52,u=t.turns??3;for(let i=0;i<3;i++){let d=i/3*2*Math.PI;for(let m=0;m<O;m++){let f=(at(m/O+e*.045)*2-1)*.96,h=Math.sqrt(Math.max(0,1-f*f)),b=Math.min(1,(1-Math.abs(f))/.1),y=f*Math.PI*u+d,l=1+.075*Math.sin(f*Math.PI*u*2+d*2+e*.8),x=h*s*l,[g,S,w]=r(Math.cos(y)*x,f*s*l,Math.sin(y)*x),P=(w/s+1)/2;c.push({x:g,y:S,z:w,r:((t.rBase??1.2)+(t.rDepth??1.8)*P)*p,white:.55-.45*P,a:b*(.45+.55*P)})}}return q(c,[],t.rMin)};function Ct(n,e,t,a){let o=2*e*t+a,s=n%o,r=new Array(e).fill(0),p=-1;if(s<2*e*t){let c=Math.floor(s/t),M=(s-c*t)/t,u=1-(1-Math.min(1,M/.7))**3;if(c<e){for(let i=0;i<c;i++)r[i]=1;r[c]=u,p=c}else{let i=2*e-1-c;for(let d=0;d<i;d++)r[d]=1;r[i]=1-u,p=i}}return{amount:r,active:p}}function Et(n,e,t){let[a,o,s]=n,r=!1;for(let p=0;p<e.length;p++){if(t.amount[p]<=0)continue;let c=e[p],M=c.axis===0?a:c.axis===1?o:s;if(M<c.lo||M>=c.hi)continue;p===t.active&&(r=!0);let O=c.ang*t.amount[p],u=Math.cos(O),i=Math.sin(O);if(c.axis===0){let d=o*u-s*i;s=o*i+s*u,o=d}else if(c.axis===1){let d=a*u+s*i;s=-a*i+s*u,a=d}else{let d=a*u-o*i;o=a*i+o*u,a=d}}return[a,o,s,r]}function Ft(n){let e=[];for(let t=0;t<n;t++){let a=Math.min(2,Math.floor(_(t,2.3)*3)),o=-1+.5*Math.min(3,Math.floor(_(t,5.9)*4)),s=_(t,7.7)<.5?1:-1;e.push({axis:a,lo:o,hi:o+.5,ang:s*Math.PI/2})}return e}var Nt=(n,e,t)=>{let o=n/2,s=n/2,r=n/2*.82,p=.4+.06*Math.sin(e*.35),c=j(e*.5,p,o,s,r),M=e*(.5+(1.7-.5)*(t.scanMul??1)),O=$(n,t.rsPow??.6),u=t.dimBase??1,i=[],d=t.latRings??17,m=t.lonDensity??44;for(let f=0;f<=d;f++){let h=-Math.PI/2+f/d*Math.PI,b=Math.cos(h),y=Math.sin(h),l=Math.max(1,Math.round(Math.abs(b)*m));for(let x=0;x<l;x++){let g=x/l*2*Math.PI,[S,w,P]=c(b*Math.cos(g),y,b*Math.sin(g)),v=(P+1)/2,R=Pt(g+e*.5,M),k=Math.exp(-(R*R)/.18)*Math.max(0,P);i.push({x:S,y:w,z:P,r:((t.rBase??.6)+(t.rDepth??1.7)*v+(t.rBoost??1)*k)*O,white:(t.inkFar??.62)-(t.inkSpan??.54)*v,a:u+(1-u)*Math.min(1,k)})}}return q(i,[],t.rMin)},Bt=(n,e,t)=>{let a=n/2,o=n/2,s=n/2*.82,r=j(e*.55,.35+.1*Math.sin(e*.9),a,o,s),p=$(n,t.rsPow??.6),c=t.moveCount??14,M=Ft(c),O=Ct(e,c,.42,1.2),u=[],i=t.latRings??15,d=t.lonDensity??40;for(let m=0;m<=i;m++){let f=-Math.PI/2+m/i*Math.PI,h=Math.cos(f),b=Math.sin(f),y=Math.max(1,Math.round(Math.abs(h)*d));for(let l=0;l<y;l++){let x=l/y*2*Math.PI,[g,S,w,P]=Et([h*Math.cos(x),b,h*Math.sin(x)],M,O),[v,R,k]=r(g,S,w),D=(k+1)/2;u.push({x:v,y:R,z:k,r:((t.rBase??.6)+(t.rDepth??1.7)*D+(P?t.rActive??.3:0))*p,white:(t.inkFar??.62)-(t.inkSpan??.54)*D-(P?.14:0)})}}return q(u,[],t.rMin)},Lt=(n,e,t)=>{let a=n/2,o=n/2,s=n/2*.874,r=j(e*.18,.38,a,o,1),p=$(n,t.rsPow??.6),c=[],M=t.rings??15,O=t.lonDensity??40;for(let u=0;u<=M;u++){let i=-Math.PI/2+u/M*Math.PI,d=Math.cos(i),m=Math.sin(i),f=.62*Math.sin(e*2.1-u*.52)+.38*Math.sin(e*1.27+u*.83),h=s*(.88+.105*f),b=Math.max(1,Math.round(Math.abs(d)*O));for(let y=0;y<b;y++){let l=y/b*2*Math.PI,[x,g,S]=r(d*Math.cos(l)*h,m*h,d*Math.sin(l)*h),w=(S/s+1)/2,P=Math.max(0,f);c.push({x,y:g,z:S,r:((t.rBase??.6)+(t.rDepth??1.7)*w)*(1+.4*P)*p,white:.66-.56*w-.1*P})}}return q(c,[],t.rMin)};function Tt(n){return n*n*(3-2*n)}function lt(n){let e=n.length,t=[],a=0;for(let o=0;o<e;o++){let s=n[o],r=n[(o+1)%e],p=Math.hypot(r[0]-s[0],r[1]-s[1]);t.push(p),a+=p}return o=>{let s=o*a,r=0;for(;s>t[r]&&r<e-1;)s-=t[r],r++;let p=n[r],c=n[(r+1)%e],M=t[r]?Math.min(1,s/t[r]):0;return[p[0]+(c[0]-p[0])*M,p[1]+(c[1]-p[1])*M]}}var _t=n=>{let e=-Math.PI/2+n*2*Math.PI;return[Math.cos(e)*.24,Math.sin(e)*.24]},qt=lt([[0,-.26],[.24,.16],[-.24,.16]]),jt=lt([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),Q=[_t,qt,jt];function $t(n){return Math.max(6,Math.round(34*n))}var X=1.4,ut=.9,Y=X+ut,Wt=(n,e,t)=>{let a=Q.length,o=e%(Y*a),s=t.shape!=null&&t.shape>=0&&t.shape<a?Math.floor(t.shape):-1,r=s>=0?s:Math.floor(o/Y),p=s>=0?e%Y:o-r*Y,c=s>=0?0:p>X?Tt((p-X)/ut):0,M=t.spread??1,O=Q[r],u=s>=0?O:Q[(r+1)%a],i=160,d=[];for(let w=0;w<i;w++){let P=w/i,v=O(P),R=u(P);d.push([(v[0]+(R[0]-v[0])*c)*M,(v[1]+(R[1]-v[1])*c)*M])}let m=[],f=0;for(let w=0;w<i;w++){let P=d[w],v=d[(w+1)%i],R=Math.hypot(v[0]-P[0],v[1]-P[1]);m.push(R),f+=R}let h=$t(t.iconD??1),b=(t.rDot??.021)*1.35*M,y=1+.02*Math.sin(p*3.1),l=[],x=n/2,g=0,S=0;for(let w=0;w<h;w++){let P=w/h*f;for(;S+m[g]<P&&g<i-1;)S+=m[g],g++;let v=d[g],R=d[(g+1)%i],k=m[g]?Math.min(1,(P-S)/m[g]):0,D=(v[0]+(R[0]-v[0])*k)*y,C=(v[1]+(R[1]-v[1])*k)*y;l.push({x:x+D*n,y:x+C*n,z:0,r:Math.max(.35,b*n),white:.1})}return q(l,[],t.rMin)},Kt=(n,e,t)=>{let a=n/2,o=n/2,s=n/2*.82,r=j(e*.12,.3,a,o,1),p=$(n,t.rsPow??.6),c=[],M=t.orbitN??12,O=t.ghostN??40,u=t.particles??3;for(let i=0;i<M;i++){let d=_(i,1.7),m=_(i,5.2),f=_(i,8.9),h=s*(.45+.52*d),b=d*2*Math.PI,y=Math.acos(2*m-1),l=Math.sin(y)*Math.cos(b),x=Math.cos(y),g=Math.sin(y)*Math.sin(b),S=-x,w=l,P=0,v=Math.max(1e-6,Math.sqrt(S*S+w*w));S/=v,w/=v;let R=x*P-g*w,k=g*S-l*P,D=l*w-x*S,C=(.25+.55*f)*(f>.5?1:-1);for(let E=0;E<O;E++){let z=E/O*2*Math.PI,[F,N,L]=r((S*Math.cos(z)+R*Math.sin(z))*h,(w*Math.cos(z)+k*Math.sin(z))*h,(P*Math.cos(z)+D*Math.sin(z))*h),B=(L/h+1)/2;c.push({x:F,y:N,z:L,r:(t.ghostR??.9)*p,white:.72,a:(t.ghostA??.5)*(.4+.6*B)})}for(let E=0;E<u;E++){let z=e*C+E/u*2*Math.PI+m*6,[F,N,L]=r((S*Math.cos(z)+R*Math.sin(z))*h,(w*Math.cos(z)+k*Math.sin(z))*h,(P*Math.cos(z)+D*Math.sin(z))*h),B=(L/h+1)/2;c.push({x:F,y:N,z:L,r:((t.partR??1.2)+(t.partRDepth??1.6)*B)*p,white:.3-.22*B})}}return q(c,[],t.rMin)},st=(n,e,t)=>{let a=n/2,o=n/2,s=n/2*.78,r=t.spin??1,p=.3,c=j(e*.1*r,p,a,o,1),M=$(n,t.rsPow??.6),O=[],u=t.ghostN??150;for(let D=0;D<u;D++){let C=J(D,u),[E,z,F]=c(C[0]*s,C[1]*s,C[2]*s),N=(F/s+1)/2;O.push({x:E,y:z,z:F,r:.8*M,white:.78,a:.1+.22*N})}let i=e*.24*r,d=t.faceOn?-p:.55+.3*Math.sin(e*.18)*r,m=Math.cos(i),f=0,h=Math.sin(i),b=-h*Math.sin(d),y=Math.cos(d),l=m*Math.sin(d),x=f*l-h*y,g=h*b-m*l,S=m*y-f*b,w=.23*(t.wobMul??1),P=t.faceOn?s/(1+.85*w):s,v=t.lanes??5,R=t.segs??88,k=Math.max(1,Math.round(v*(t.bandMul??1)));for(let D=0;D<k;D++){let C=(D-(k-1)/2)*.075,E=Math.abs(D-(k-1)/2)/Math.max(1,(k-1)/2);for(let z=0;z<R;z++){let F=z/R*2*Math.PI,N=(.16*Math.sin(F*3-e*1.7+D*.22)+.07*Math.sin(F*5+e*1.1))*(t.wobMul??1),L=t.faceOn?1+N:1,B=t.faceOn?C:C+N,A=m*Math.cos(F)+b*Math.sin(F)+x*B,I=f*Math.cos(F)+y*Math.sin(F)+g*B,T=h*Math.cos(F)+l*Math.sin(F)+S*B,W=Math.sqrt(A*A+I*I+T*T),K=P*L,[wt,Ot,et]=c(A/W*K,I/W*K,T/W*K),G=(et/s+1)/2;O.push({x:wt,y:Ot,z:et,r:((t.rBase??1.1)+(t.rDepth??1.7)*G)*(1-.25*E)*M,white:.52-.44*G+.18*E,a:.4+.6*G})}}return q(O,[],t.rMin)},Yt=(n,e,t)=>{let a=n/2,o=n/2,s=n/2*.8*(t.spread??1),r=j(e*.12,.32,a,o,s),p=$(n,t.rsPow??.6),c=t.nodeN??30,M=t.thr??.72,O=t.nodeR??1.4,u=t.nodeRDepth??1.8,i=[];for(let h=0;h<c;h++){let b=J(h,c),y=b[0]+.3*(V(h*.31+9,e*.24)-.5)*2,l=b[1]+.3*(V(h*.53+27,e*.21)-.5)*2,x=b[2]+.3*(V(h*.77+55,e*.27)-.5)*2,g=Math.sqrt(y*y+l*l+x*x);i.push([y/g,l/g,x/g])}let d=[],m=[];for(let h=0;h<c;h++)for(let b=h+1;b<c;b++){let y=i[h][0]-i[b][0],l=i[h][1]-i[b][1],x=i[h][2]-i[b][2],g=Math.sqrt(y*y+l*l+x*x);if(g>=M)continue;let[S,w,P]=r(i[h][0],i[h][1],i[h][2]),[v,R,k]=r(i[b][0],i[b][1],i[b][2]),D=((P+k)/2+1)/2;d.push({x1:S,y1:w,x2:v,y2:R,white:.42,a:(1-g/M)*(.3+.55*D),w:Math.max(.6,(t.lineW??.8)*p)})}for(let h=0;h<c;h++){let[b,y,l]=r(i[h][0],i[h][1],i[h][2]),x=(l+1)/2,g=1+.25*Math.sin(e*1.4+h*2.7);m.push({x:b,y,z:l,r:(O+u*x)*g*p,white:.55-.45*x})}let f=t.signals??5;for(let h=0;h<f;h++){let b=Math.floor(e*.55+h*7.31),y=Math.floor(_(b,h*3.1+1.7)*c),l=Math.floor(_(b,h*5.7+4.2)*c);if(y===l)continue;let x=at(e*.55+h*7.31),g=U(i[y][0],i[l][0],x),S=U(i[y][1],i[l][1],x),w=U(i[y][2],i[l][2],x),P=Math.max(1e-6,Math.sqrt(g*g+S*S+w*w)),[v,R,k]=r(g/P,S/P,w/P),D=(k+1)/2;m.push({x:v,y:R,z:k,r:(O*1.5+u*D)*p,white:.05,a:.5+.5*D})}return q(m,d,t.rMin)},H={orbits:Kt,globe:Nt,rubik:Bt,wave:Lt,web:Yt,braid:It,ribbon:st,ring:st,morph:Wt},Ht=Object.fromEntries(Object.entries(H).map(([n,e])=>[n,(t,a,o,s,r)=>ht(t,e(a,o,r),s)])),pt={working:\"orbits\",searching:\"globe\",solving:\"rubik\",listening:\"wave\",connecting:\"web\",weaving:\"braid\",composing:\"ribbon\",breathing:\"ring\",shaping:\"morph\"},Gt={orbits:{64:{speed:1.885,count:1,size:1},32:{speed:2.9072,count:.4251,size:1.6849},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},32:{speed:2.3803,count:.1839,size:1.4769,extra:{scanMul:4.2301,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},32:{speed:1.8964,count:.1537,size:1.4951},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},32:{speed:4.1512,count:.169,size:1.3232},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},32:{speed:5.0104,count:.4942,size:1.2571},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},32:{speed:2.2234,count:.2056,size:1.2011},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},32:{speed:2.7776,count:.0969,size:.9766,extra:{spin:0,bandMul:4.49,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},32:{speed:3.5517,count:.0678,size:1.31,extra:{spin:0,bandMul:3.8265,wobMul:.4751}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},32:{speed:2.2057,count:.5937,size:.6916,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},ot=new Map;function Z(n,e){let t=`${n}-${e}`,a=ot.get(t);if(a)return a;let o=pt[n],s=Gt[o][e],r={...zt[o]};s.count!==1&&(r=Rt(r,s.count)),s.size!==1&&(r=Dt(r,s.size)),s.extra&&(r={...r,...s.extra});let p={mode:o,speed:s.speed,opts:r};return ot.set(t,p),p}var dt={ribbon:{speed:.55,tilt:.15},nadia:{speed:.55,tilt:.15},sofia:{speed:.55,tilt:-.15},lattice:{speed:.28,tilt:-.12},orbit:{speed:.7,tilt:.2},globe:{speed:.35,tilt:-.16},network:{speed:.55,tilt:.1},braid:{speed:.65,tilt:-.2},morph:{speed:.9,tilt:.12}};function tt(n){return dt[n].speed}function Mt(n,e){return{idle:1,working:1,thinking:1,waiting:0,blocked:0,done:.65}[n]*tt(e)}var Ut=1.6;function ft(n,e){return n!==\"thinking\"&&n!==\"working\"?1:1-.55*((1-Math.cos(e*Math.PI*2/Ut))/2)}function bt(n,e,t){let a=dt[n],o=.82,s=.82,r=0,p=0,c=0,M=0,O=1;if(e===\"idle\"){let u=Math.sin(t*Math.PI/2);o+=u*.01,s+=u*.01,r=-u*.004}else if(e===\"waiting\")o=.8,s=.84,r=-.015,O=.75;else if(e===\"blocked\"){let u=Math.min(1,t/.25),i=Math.sin(u*Math.PI);o=.8+i*.015,s=.82-u*.08,r=u*.025-i*.018,c=a.tilt*u*.4,O=1-u*.4}else if(e===\"done\"){if(t<.18){let u=Math.sin(Math.PI*t/.18);o+=.03*u,s-=.04*u,r=.012*u}else if(t<1.3){let u=(t-.18)/1.12;r=-.07*Math.sin(Math.PI*u),o+=.025*Math.sin(Math.PI*u),s+=.035*Math.sin(Math.PI*u),c=Math.sin(u*Math.PI*2)*.07}}return{sx:o,sy:s,x:p,y:r,rotation:c,split:M,opacity:O}}function nt(n,e,t,a,o,s,r,p=1){if(!(e!==\"working\"&&e!==\"thinking\"&&e!==\"done\")){if(n.save(),e===\"thinking\"){if(r===\"front\")for(let c=0;c<3;c++){let M=o?.5:(1+Math.cos(a*Math.PI*2/3.6-c*Math.PI*2/3))/2;n.fillStyle=s[c%s.length],n.globalAlpha=(.65+M*.35)*p,n.beginPath(),n.arc(t*(.5+(c-1)*.09),t*.08,Math.max(1,t*(.022+M*.005)),0,Math.PI*2),n.fill()}}else if(e===\"working\"||!o&&a<3.1){let c=e===\"done\"?3:1;for(let M=0;M<c;M++){let O=e===\"done\"?(a-M*.38)/2.2:0;if(O<0||O>1)continue;let u=e===\"done\"?Math.sin(O*Math.PI):1,i=(o?.8:a*Math.PI*2/7.2)+M*2.1,d=Math.PI*1.4,m=-.38+M*.4,f=t*(.44+O*.03),h=t*(.19+O*.11),b=l=>{let x=Math.cos(l)*f,g=Math.sin(l)*h;return[t/2+x*Math.cos(m)-g*Math.sin(m),t/2+x*Math.sin(m)+g*Math.cos(m)]},y=n.createLinearGradient(t*.1,t*.7,t*.9,t*.3);s.forEach((l,x)=>y.addColorStop(x/Math.max(1,s.length-1),l)),n.strokeStyle=y,n.lineCap=\"butt\";for(let l=0;l<100;l++){let x=l/100,g=i-d+d*x,S=Math.sin(g)>=0;if(S!==(r===\"front\"))continue;let w=Math.sin(Math.PI*(.04+x*.92));n.globalAlpha=u*(S?.92:.55)*(.25+w*.75)*p,n.lineWidth=Math.max(.65,t*.027*w),n.beginPath(),n.moveTo(...b(g)),n.lineTo(...b(g+d/100)),n.stroke()}}}n.restore()}}var Vt={orbit:\"working\",globe:\"searching\",lattice:\"solving\",network:\"connecting\",braid:\"weaving\",ribbon:\"composing\",morph:\"shaping\"},Qt={plain:{alpha:1,radius:1},\"over-picture\":{alpha:2.3,radius:1.9}},mt=[\"--nc-identity-azzurro\",\"--nc-identity-verde\",null,\"--nc-identity-rosso\"],yt=[\"--nc-chart-5\",\"--nc-chart-6\",\"--nc-warning\",\"--nc-chart-4\"],Xt=[...yt,...mt.filter(n=>n!==null)],Jt=[\"--nc-identity-cobalto\",\"--nc-identity-giallo\",null,\"--nc-identity-arancio\"],Zt={nadia:mt,sofia:Jt};function tn(n,e){let t=1-2*(n+.5)/e,a=Math.sqrt(1-t*t),o=n*Math.PI*(3-Math.sqrt(5));return[a*Math.cos(o),t,a*Math.sin(o)]}function gt(n,e,t){let a=n/2,o=n/2*.78,s=t.spin??1,r=j(e*.1*s,.3,a,a,1),p=$(n,t.rsPow??.6),c=[],M=t.ghostN??150;for(let v=0;v<M;v++){let[R,k,D]=tn(v,M),[C,E,z]=r(R*o,k*o,D*o);c.push({x:C,y:E,z,r:.8*p,white:.78,a:.1+.22*((z/o+1)/2)})}let O=e*.24*s,u=t.faceOn?-.3:.55+.3*Math.sin(e*.18)*s,[i,d,m]=[Math.cos(O),0,Math.sin(O)],[f,h,b]=[-m*Math.sin(u),Math.cos(u),i*Math.sin(u)],[y,l,x]=[d*b-m*h,m*f-i*b,i*h-d*f],g=t.wobMul??1,S=t.faceOn?o/(1+.85*.23*g):o,w=t.segs??88,P=Math.max(1,Math.round((t.lanes??5)*(t.bandMul??1)));for(let v=0;v<P;v++){let R=(v-(P-1)/2)*.075,k=Math.abs(v-(P-1)/2)/Math.max(1,(P-1)/2);for(let D=0;D<w;D++){let C=D/w*2*Math.PI,E=(.16*Math.sin(C*3-e*1.7+v*.22)+.07*Math.sin(C*5+e*1.1))*g,z=t.faceOn?1+E:1,F=t.faceOn?R:R+E,N=i*Math.cos(C)+f*Math.sin(C)+y*F,L=d*Math.cos(C)+h*Math.sin(C)+l*F,B=m*Math.cos(C)+b*Math.sin(C)+x*F,A=Math.sqrt(N*N+L*L+B*B),[I,T,W]=r(N/A*S*z,L/A*S*z,B/A*S*z),K=(W/o+1)/2;c.push({x:I,y:T,z:W,r:((t.rBase??1.1)+(t.rDepth??1.7)*K)*(1-.25*k)*p,white:.08+.1*k,a:.55+.45*K,stripe:Math.min(3,Math.floor(v/P*4))})}}return q(c,[],t.rMin)}function nn(n,e){for(let t of n.dots)t.x=e-t.x;return n}function en(n,e){let{form:t,size:a,seconds:o,color:s,state:r,age:p,reduced:c,breath:M,celebrationColors:O,stripeColors:u}=e,i=Qt[e.presence],d=Z(Vt[t===\"nadia\"||t===\"sofia\"?\"ribbon\":t],a<=32?20:64),m=t===\"nadia\"?gt(a,o,d.opts):t===\"sofia\"?nn(gt(a,o,d.opts),a):H[d.mode](a,o,d.opts);n.clearRect(0,0,a,a);let f=bt(t,e.motion===\"ambient\"?\"idle\":r,c?r===\"done\"?2:.6:p),h=c?.8:p/(r===\"done\"?.575:.2875),b=(l,x)=>{let g=(l-a/2)*f.sx,S=(x-a/2)*f.sy;return[a/2+g*Math.cos(f.rotation)-S*Math.sin(f.rotation)+(f.x+Math.sign(g)*f.split)*a,a/2+g*Math.sin(f.rotation)+S*Math.cos(f.rotation)+f.y*a]},y=f.opacity*M;e.motion===\"status\"&&nt(n,r,a,h,c,O,\"back\",M),n.fillStyle=s,n.strokeStyle=s;for(let l of m.lines)n.globalAlpha=Math.min(1,Math.max(0,(1-l.white)*(l.a??1)*y*i.alpha)),n.lineWidth=l.w*i.radius,n.beginPath(),n.moveTo(...b(l.x1,l.y1)),n.lineTo(...b(l.x2,l.y2)),n.stroke();for(let l of m.dots)n.fillStyle=l.stripe===void 0?s:u[l.stripe]??s,n.globalAlpha=Math.min(1,Math.max(0,(1-l.white)*(l.a??1)*y*i.alpha)),n.beginPath(),n.arc(...b(l.x,l.y),l.r*i.radius,0,Math.PI*2),n.fill();n.globalAlpha=1,e.motion===\"status\"&&nt(n,r,a,h,c,O,\"front\",M)}function xt(n,e){let{form:t,presence:a=\"plain\"}=e,o=n.getContext(\"2d\");if(!o)return{destroy(){},setPaused(A){},setState(A){}};let s=window.matchMedia(\"(prefers-reduced-motion: reduce)\"),r=e.paused??!1,p=!0,c=!1,M=0,O=.6,u=0,i=0,d=e.state??\"idle\",m=e.motion??\"status\",f=null,h=0,b=1,y=e.size,l=getComputedStyle(n).color,x=[l],g=[l],S=\"\";function w(){let A=n.getBoundingClientRect(),I=Math.min(A.width,A.height);return I>0?I:e.size}function P(){!o||c||!n.isConnected||(o.setTransform(b,0,0,b,0,0),en(o,{form:t,size:y,seconds:O,color:l,state:d,age:u,reduced:s.matches,breath:s.matches?ft(d,i):1,presence:a,motion:m,celebrationColors:x,stripeColors:g}))}function v(){return c||!n.isConnected||!p||document.hidden||r?!1:s.matches?m===\"status\"&&(d===\"thinking\"||d===\"working\"):m===\"ambient\"?!0:d!==\"waiting\"&&!(d===\"blocked\"&&u>=.3)}function R(A){if(M=0,!!v()){if(f!==null){let I=Math.min((A-f)/1e3,.1);s.matches?i+=I:(O+=I*(m===\"ambient\"?tt(t):Mt(d,t)),m===\"status\"&&(u+=I*(d===\"done\"?.575:.2875)),d===\"done\"&&u>=1.8&&(d=\"idle\",u=0))}f=A,A-h>=1e3/30&&(P(),h=A),M=requestAnimationFrame(R)}}function k(){cancelAnimationFrame(M),M=0,f=null,P(),v()&&(M=requestAnimationFrame(R))}function D(A){let I=document.createElement(\"span\");I.hidden=!0,I.style.color=A,(n.parentElement??document.body).append(I);let T=getComputedStyle(I).color;return I.remove(),T||l}function C(A,I){return[I,window.devicePixelRatio||1,A.color,...Xt.map(T=>A.getPropertyValue(T))].join(\"|\")}function E(){C(getComputedStyle(n),w())!==S&&z()}function z(){if(c||!n.isConnected)return;y=w();let A=Math.max(1,Math.round(y*Math.min(window.devicePixelRatio||1,2)));n.width=A,n.height=A,b=A/y;let I=getComputedStyle(n);S=C(I,y),l=I.color,x=yt.map(T=>D(`color-mix(in oklch, ${I.getPropertyValue(T).trim()||l} 75%, white)`)),g=(Zt[t]??[]).map(T=>T&&I.getPropertyValue(T).trim()||l),k()}let F=new IntersectionObserver(([A])=>{p=A?.isIntersecting??!1,k()});F.observe(n);let N=new MutationObserver(E);for(let A=n;A;A=A.parentElement)N.observe(A,{attributes:!0,attributeFilter:[\"class\",\"style\",\"data-theme\"]});let L=new ResizeObserver(()=>{Math.abs(w()-y)>=.5&&z()});L.observe(n);function B(A){A.propertyName===\"color\"&&A.target instanceof Node&&A.target.contains(n)&&E()}return document.addEventListener(\"transitionend\",B,!0),s.addEventListener(\"change\",k),document.addEventListener(\"visibilitychange\",k),window.addEventListener(\"resize\",E),z(),{setState(A){d=A,u=0,i=0,k()},setPaused(A){r=A,k()},destroy(){c=!0,cancelAnimationFrame(M),F.disconnect(),N.disconnect(),L.disconnect(),document.removeEventListener(\"transitionend\",B,!0),s.removeEventListener(\"change\",k),document.removeEventListener(\"visibilitychange\",k),window.removeEventListener(\"resize\",E)}}}for(let n of document.querySelectorAll(\"canvas[data-agent-orb]\"))xt(n,{form:n.dataset.agentOrb,size:Number(n.dataset.size),state:n.dataset.state??\"idle\"});})();\n";
2
+ export const designTokensCss = "@layer tokens, theme;\n\n\n\n\n\n\n\n\n\n@layer tokens {\n :root {\n --nc-action: oklch(0.1776 0.0000 0.00);\n --nc-action-foreground: oklch(1.0000 0.0000 0.00);\n --nc-action-hover: oklch(0.3012 0.0000 0.00);\n --nc-action-active: oklch(0.0000 0.0000 0.00);\n --nc-ink: oklch(0.1776 0.0000 0.00);\n --nc-body: oklch(0.3867 0.0000 0.00);\n --nc-muted: oklch(0.5278 0.0000 0.00);\n --nc-canvas: oklch(1.0000 0.0000 0.00);\n --nc-canvas-soft: oklch(0.9851 0.0000 0.00);\n --nc-canvas-soft-2: oklch(0.9702 0.0000 0.00);\n --nc-material-workspace: oklch(0.9761 0.0000 0.00);\n --nc-material-solid: oklch(1.0000 0.0000 0.00);\n --nc-material-resting: oklch(1.0000 0.0000 0.00);\n --nc-material-raised: oklch(1.0000 0.0000 0.00);\n --nc-material-floating: oklch(1.0000 0.0000 0.00);\n --nc-material-modal: oklch(1.0000 0.0000 0.00);\n --nc-line: oklch(0.9219 0.0000 0.00);\n --nc-input: oklch(0.5624 0.0000 0.00);\n --nc-focus-ring: oklch(0.1776 0.0000 0.00);\n --nc-scrim: oklch(0.1776 0.0000 0.00);\n --nc-link: oklch(0.4815 0.1209 154.24);\n --nc-link-deep: oklch(0.3852 0.0953 154.99);\n --nc-link-bg-soft: oklch(0.9170 0.0519 161.77);\n --nc-info: oklch(0.5005 0.2804 266.17);\n --nc-info-soft: oklch(0.9457 0.0259 276.40);\n --nc-info-deep: oklch(0.3197 0.1758 266.79);\n --nc-success: oklch(0.6415 0.1644 153.23);\n --nc-success-soft: oklch(0.9170 0.0519 161.77);\n --nc-success-deep: oklch(0.3852 0.0953 154.99);\n --nc-error: oklch(0.5688 0.1995 26.59);\n --nc-error-soft: oklch(0.9522 0.0207 17.52);\n --nc-error-deep: oklch(0.4235 0.1525 27.08);\n --nc-warning: oklch(0.8466 0.1678 84.63);\n --nc-warning-soft: oklch(0.9649 0.0461 90.87);\n --nc-warning-deep: oklch(0.4834 0.0995 82.44);\n --nc-navigation-selection-bg: oklch(0.9461 0.0000 0.00);\n --nc-navigation-selection-fg: oklch(0.1776 0.0000 0.00);\n --nc-navigation-selection-hover: oklch(0.9219 0.0000 0.00);\n --nc-state-ready: oklch(0.5278 0.0000 0.00);\n --nc-state-running: oklch(0.5005 0.2804 266.17);\n --nc-state-review: oklch(0.8466 0.1678 84.63);\n --nc-state-blocked: oklch(0.5688 0.1995 26.59);\n --nc-state-complete: oklch(0.6415 0.1644 153.23);\n --nc-identity-verde: oklch(0.6415 0.1644 153.23);\n --nc-identity-rosso: oklch(0.5688 0.1995 26.59);\n --nc-identity-arancio: oklch(0.6824 0.2108 37.70);\n --nc-identity-giallo: oklch(0.8466 0.1678 84.63);\n --nc-identity-cobalto: oklch(0.5005 0.2804 266.17);\n --nc-identity-azzurro: oklch(0.5618 0.2019 258.24);\n --nc-identity-ink: oklch(0.0000 0.0000 0.00);\n --nc-identity-white: oklch(1.0000 0.0000 0.00);\n --nc-logo-dot: oklch(0.5005 0.2804 266.17);\n --nc-chart-1: oklch(0.5005 0.2804 266.17);\n --nc-chart-2: oklch(0.6415 0.1644 153.23);\n --nc-chart-3: oklch(0.7638 0.1562 86.86);\n --nc-chart-4: oklch(0.5688 0.1995 26.59);\n --nc-chart-5: oklch(0.6161 0.1062 208.85);\n --nc-chart-6: oklch(0.5015 0.1883 294.99);\n --nc-dark-canvas: oklch(0.0000 0.0000 0.00);\n --nc-dark-canvas-soft: oklch(0.1776 0.0000 0.00);\n --nc-dark-canvas-soft-2: oklch(0.2178 0.0000 0.00);\n --nc-dark-material-workspace: oklch(0.0000 0.0000 0.00);\n --nc-dark-material-solid: oklch(0.0000 0.0000 0.00);\n --nc-dark-material-resting: oklch(0.1543 0.0000 0.00);\n --nc-dark-material-raised: oklch(0.1822 0.0000 0.00);\n --nc-dark-material-floating: oklch(0.2090 0.0000 0.00);\n --nc-dark-material-modal: oklch(0.2264 0.0000 0.00);\n --nc-dark-ink: oklch(0.9461 0.0000 0.00);\n --nc-dark-body: oklch(0.8297 0.0000 0.00);\n --nc-dark-muted: oklch(0.6500 0.0000 0.00);\n --nc-dark-line: oklch(0.2686 0.0000 0.00);\n --nc-dark-input: oklch(0.5208 0.0000 0.00);\n --nc-dark-on-primary: oklch(0.1448 0.0000 0.00);\n --nc-dark-action: oklch(0.9461 0.0000 0.00);\n --nc-dark-action-foreground: oklch(0.1448 0.0000 0.00);\n --nc-dark-action-hover: oklch(0.8761 0.0000 0.00);\n --nc-dark-action-active: oklch(0.8297 0.0000 0.00);\n --nc-dark-link: oklch(0.7661 0.1498 157.10);\n --nc-dark-link-deep: oklch(0.8524 0.0996 159.83);\n --nc-dark-link-bg-soft: oklch(0.2893 0.0697 156.32);\n --nc-dark-focus-ring: oklch(0.9461 0.0000 0.00);\n --nc-dark-scrim: oklch(0.9461 0.0000 0.00);\n --nc-dark-error: oklch(0.7955 0.0980 21.02);\n --nc-dark-error-soft: oklch(0.2296 0.0728 26.06);\n --nc-dark-error-deep: oklch(0.8856 0.0534 19.64);\n --nc-dark-warning: oklch(0.8939 0.1387 90.47);\n --nc-dark-warning-soft: oklch(0.3135 0.0643 85.04);\n --nc-dark-warning-deep: oklch(0.9320 0.0896 90.86);\n --nc-dark-info: oklch(0.7067 0.1528 272.08);\n --nc-dark-info-soft: oklch(0.2118 0.1033 268.28);\n --nc-dark-info-deep: oklch(0.8222 0.0888 274.44);\n --nc-dark-success: oklch(0.7019 0.1753 153.20);\n --nc-dark-success-soft: oklch(0.2893 0.0697 156.32);\n --nc-dark-success-deep: oklch(0.8524 0.0996 159.83);\n --nc-dark-state-ready: oklch(0.5624 0.0000 0.00);\n --nc-dark-state-running: oklch(0.5923 0.2215 269.61);\n --nc-dark-state-review: oklch(0.8466 0.1678 84.63);\n --nc-dark-state-blocked: oklch(0.5688 0.1995 26.59);\n --nc-dark-state-complete: oklch(0.6415 0.1644 153.23);\n --nc-dark-logo-dot: oklch(0.5923 0.2215 269.61);\n --nc-dark-navigation-selection-bg: oklch(0.2393 0.0000 0.00);\n --nc-dark-navigation-selection-fg: oklch(0.9461 0.0000 0.00);\n --nc-dark-navigation-selection-hover: oklch(0.2686 0.0000 0.00);\n --nc-dark-chart-1: oklch(0.5923 0.2215 269.61);\n --nc-dark-chart-2: oklch(0.6415 0.1644 153.23);\n --nc-dark-chart-3: oklch(0.8939 0.1387 90.47);\n --nc-dark-chart-4: oklch(0.6627 0.1685 23.66);\n --nc-dark-chart-5: oklch(0.7820 0.1247 190.99);\n --nc-dark-chart-6: oklch(0.6297 0.1321 299.36);\n --nc-xxs: 4px;\n --nc-xs: 8px;\n --nc-sm: 12px;\n --nc-md: 16px;\n --nc-lg: 24px;\n --nc-xl: 32px;\n --nc-2xl: 40px;\n --nc-3xl: 48px;\n --nc-4xl: 64px;\n --nc-5xl: 96px;\n --nc-6xl: 128px;\n --nc-guide: 1px;\n --nc-icon-stroke: 1.5px;\n --nc-icon-stroke-sm: 1.25px;\n --nc-focus-outline-width: 2px;\n --nc-focus-outline-offset: 2px;\n --nc-control-height: 32px;\n --nc-control-padding-inline: 10px;\n --nc-touch-target: 44px;\n --nc-rounded-none: 0px;\n --nc-rounded-xs: 2px;\n --nc-rounded-sm: 4px;\n --nc-rounded-md: 6px;\n --nc-rounded-lg: 8px;\n --nc-rounded-xl: 10px;\n --nc-rounded-2xl: 12px;\n --nc-rounded-3xl: 16px;\n --nc-rounded-full: 9999px;\n --nc-type-display-xl-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-display-xl-font-size: 72px;\n --nc-type-display-xl-font-weight: 500;\n --nc-type-display-xl-line-height: 74px;\n --nc-type-display-xl-letter-spacing: -2.52px;\n --nc-type-display-lg-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-display-lg-font-size: 52px;\n --nc-type-display-lg-font-weight: 500;\n --nc-type-display-lg-line-height: 54px;\n --nc-type-display-lg-letter-spacing: -1.5px;\n --nc-type-display-md-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-display-md-font-size: 40px;\n --nc-type-display-md-font-weight: 500;\n --nc-type-display-md-line-height: 42px;\n --nc-type-display-md-letter-spacing: -1px;\n --nc-type-heading-lg-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-heading-lg-font-size: 30px;\n --nc-type-heading-lg-font-weight: 600;\n --nc-type-heading-lg-line-height: 32px;\n --nc-type-heading-lg-letter-spacing: 0px;\n --nc-type-heading-md-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-heading-md-font-size: 24px;\n --nc-type-heading-md-font-weight: 600;\n --nc-type-heading-md-line-height: 32px;\n --nc-type-heading-md-letter-spacing: 0px;\n --nc-type-heading-sm-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-heading-sm-font-size: 20px;\n --nc-type-heading-sm-font-weight: 600;\n --nc-type-heading-sm-line-height: 28px;\n --nc-type-heading-sm-letter-spacing: 0px;\n --nc-type-body-lg-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-body-lg-font-size: 18px;\n --nc-type-body-lg-font-weight: 400;\n --nc-type-body-lg-line-height: 27px;\n --nc-type-body-lg-letter-spacing: 0px;\n --nc-type-body-md-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-body-md-font-size: 16px;\n --nc-type-body-md-font-weight: 400;\n --nc-type-body-md-line-height: 25px;\n --nc-type-body-md-letter-spacing: 0px;\n --nc-type-body-sm-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-body-sm-font-size: 14px;\n --nc-type-body-sm-font-weight: 400;\n --nc-type-body-sm-line-height: 20px;\n --nc-type-body-sm-letter-spacing: 0px;\n --nc-type-caption-font-family:\n Geist,\n Inter,\n system-ui,\n -apple-system,\n sans-serif;\n --nc-type-caption-font-size: 12px;\n --nc-type-caption-font-weight: 400;\n --nc-type-caption-line-height: 16px;\n --nc-type-caption-letter-spacing: 0px;\n --nc-type-code-font-family:\n Geist Mono,\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n monospace;\n --nc-type-code-font-size: 13px;\n --nc-type-code-font-weight: 400;\n --nc-type-code-line-height: 20px;\n --nc-type-code-letter-spacing: 0px;\n --nc-type-label-mono-font-family:\n Geist Mono,\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n monospace;\n --nc-type-label-mono-font-size: 12px;\n --nc-type-label-mono-font-weight: 500;\n --nc-type-label-mono-line-height: 16px;\n --nc-type-label-mono-letter-spacing: 0px;\n --nc-material-scrim-opacity: 10%;\n --nc-material-glass-opacity: 60%;\n --nc-material-glass-saturation: 180%;\n --nc-material-glass-blur: 20px;\n --nc-elevation-resting:\n 0px 1px 2px 0px rgb(0% 0% 0% / 0.05),\n 0px 2px 8px -2px rgb(0% 0% 0% / 0.06),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.08);\n --nc-elevation-raised:\n 0px 1px 2px 0px rgb(0% 0% 0% / 0.06),\n 0px 6px 12px -4px rgb(0% 0% 0% / 0.08),\n 0px 16px 32px -8px rgb(0% 0% 0% / 0.1),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.08);\n --nc-elevation-floating:\n inset 0px 1px 0px 0px rgb(100% 100% 100% / 0.75),\n inset 0px 0px 0px 1px rgb(100% 100% 100% / 0.35),\n 0px 2px 4px 0px rgb(0% 0% 0% / 0.06),\n 0px 12px 24px -6px rgb(0% 0% 0% / 0.12),\n 0px 32px 64px -16px rgb(0% 0% 0% / 0.16),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.08);\n --nc-elevation-modal:\n 0px 2px 4px 0px rgb(0% 0% 0% / 0.06),\n 0px 24px 48px -12px rgb(0% 0% 0% / 0.18),\n 0px 64px 128px -32px rgb(0% 0% 0% / 0.26),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.08);\n --nc-duration-control: 100ms;\n --nc-duration-close: 140ms;\n --nc-duration-confirm: 180ms;\n --nc-duration-open: 220ms;\n --nc-duration-msg-in: 240ms;\n --nc-duration-transition: 240ms;\n --nc-duration-drawer-swipe: 400ms;\n --nc-duration-drawer: 450ms;\n --nc-duration-wait: 1.6s;\n --nc-ease-emphasized: cubic-bezier(0.3, 0.7, 0.2, 1);\n --nc-ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);\n --nc-ease-in-out-strong: cubic-bezier(0.77, 0, 0.175, 1);\n --nc-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);\n --nc-content-max: 1200px;\n --nc-gutter-mobile: 20px;\n --nc-gutter-tablet: 40px;\n --nc-gutter-desktop: 64px;\n --nc-section-step-mobile: 64px;\n --nc-section-step-desktop: 96px;\n }\n}\n\n\n@layer theme {\n .dark {\n --nc-canvas: var(--nc-dark-canvas);\n --nc-canvas-soft: var(--nc-dark-canvas-soft);\n --nc-canvas-soft-2: var(--nc-dark-canvas-soft-2);\n --nc-material-workspace: var(--nc-dark-material-workspace);\n --nc-material-solid: var(--nc-dark-material-solid);\n --nc-material-resting: var(--nc-dark-material-resting);\n --nc-material-raised: var(--nc-dark-material-raised);\n --nc-material-floating: var(--nc-dark-material-floating);\n --nc-material-modal: var(--nc-dark-material-modal);\n --nc-ink: var(--nc-dark-ink);\n --nc-body: var(--nc-dark-body);\n --nc-muted: var(--nc-dark-muted);\n --nc-line: var(--nc-dark-line);\n --nc-input: var(--nc-dark-input);\n --nc-action: var(--nc-dark-action);\n --nc-action-foreground: var(--nc-dark-action-foreground);\n --nc-action-hover: var(--nc-dark-action-hover);\n --nc-action-active: var(--nc-dark-action-active);\n --nc-link: var(--nc-dark-link);\n --nc-link-deep: var(--nc-dark-link-deep);\n --nc-link-bg-soft: var(--nc-dark-link-bg-soft);\n --nc-focus-ring: var(--nc-dark-focus-ring);\n --nc-scrim: var(--nc-dark-scrim);\n --nc-error: var(--nc-dark-error);\n --nc-error-soft: var(--nc-dark-error-soft);\n --nc-error-deep: var(--nc-dark-error-deep);\n --nc-warning: var(--nc-dark-warning);\n --nc-warning-soft: var(--nc-dark-warning-soft);\n --nc-warning-deep: var(--nc-dark-warning-deep);\n --nc-info: var(--nc-dark-info);\n --nc-info-soft: var(--nc-dark-info-soft);\n --nc-info-deep: var(--nc-dark-info-deep);\n --nc-success: var(--nc-dark-success);\n --nc-success-soft: var(--nc-dark-success-soft);\n --nc-success-deep: var(--nc-dark-success-deep);\n --nc-state-ready: var(--nc-dark-state-ready);\n --nc-state-running: var(--nc-dark-state-running);\n --nc-state-review: var(--nc-dark-state-review);\n --nc-state-blocked: var(--nc-dark-state-blocked);\n --nc-state-complete: var(--nc-dark-state-complete);\n --nc-logo-dot: var(--nc-dark-logo-dot);\n --nc-navigation-selection-bg: var(--nc-dark-navigation-selection-bg);\n --nc-navigation-selection-fg: var(--nc-dark-navigation-selection-fg);\n --nc-navigation-selection-hover: var(--nc-dark-navigation-selection-hover);\n --nc-chart-1: var(--nc-dark-chart-1);\n --nc-chart-2: var(--nc-dark-chart-2);\n --nc-chart-3: var(--nc-dark-chart-3);\n --nc-chart-4: var(--nc-dark-chart-4);\n --nc-chart-5: var(--nc-dark-chart-5);\n --nc-chart-6: var(--nc-dark-chart-6);\n --nc-elevation-resting:\n inset 0px 1px 0px 0px rgb(100% 100% 100% / 0.05),\n inset 0px 0px 0px 1px rgb(100% 100% 100% / 0.07),\n 0px 1px 2px 0px rgb(0% 0% 0% / 0.6),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.8);\n --nc-elevation-raised:\n inset 0px 1px 0px 0px rgb(100% 100% 100% / 0.07),\n inset 0px 0px 0px 1px rgb(100% 100% 100% / 0.09),\n 0px 16px 32px -8px rgb(0% 0% 0% / 0.6),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.8);\n --nc-elevation-floating:\n inset 0px 1px 0px 0px rgb(100% 100% 100% / 0.09),\n inset 0px 0px 0px 1px rgb(100% 100% 100% / 0.11),\n 0px 12px 24px -6px rgb(0% 0% 0% / 0.6),\n 0px 32px 64px -16px rgb(0% 0% 0% / 0.7),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.8);\n --nc-elevation-modal:\n inset 0px 1px 0px 0px rgb(100% 100% 100% / 0.11),\n inset 0px 0px 0px 1px rgb(100% 100% 100% / 0.13),\n 0px 64px 128px -32px rgb(0% 0% 0% / 0.8),\n 0px 0px 0px 1px rgb(0% 0% 0% / 0.8);\n }\n}";
3
+ export const brandWordmarkSvg = "<svg data-slot=\"brand-wordmark\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 858 150\" width=\"137\" height=\"24\" class=\"block h-6 w-auto\" role=\"img\" aria-label=\"nadicode\"><g fill=\"none\" stroke=\"currentColor\" stroke-width=\"18\"><path d=\"M9 150V100A41 41 0 0 1 91 100V150\"></path><circle cx=\"172\" cy=\"100\" r=\"41\"></circle><path d=\"M213 50V150\"></path><circle cx=\"294\" cy=\"100\" r=\"41\"></circle><path d=\"M335 0V150\"></path><path d=\"M375 50V150\"></path><path d=\"M484.99 71.01A41 41 0 1 0 484.99 128.99\"></path><circle cx=\"564\" cy=\"100\" r=\"41\"></circle><circle cx=\"686\" cy=\"100\" r=\"41\"></circle><path d=\"M727 0V150\"></path><path d=\"M767 100H849A41 41 0 1 0 839.41 126.35\"></path></g><circle cx=\"375\" cy=\"21\" r=\"14\" fill=\"var(--nc-logo-dot)\"></circle></svg>";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=orb-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orb-page.d.ts","sourceRoot":"","sources":["../../src/standalone/orb-page.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { mountAgentOrb } from "../internal/agent-orb.js";
2
+ // Mounts every `<canvas data-agent-orb="<figure>">` on a page React never
3
+ // loads on, such as a document a route handler answers with. A canvas names
4
+ // its figure, `data-size` and, for an orb at work, `data-state`.
5
+ for (const canvas of document.querySelectorAll("canvas[data-agent-orb]")) {
6
+ mountAgentOrb(canvas, {
7
+ form: canvas.dataset.agentOrb,
8
+ size: Number(canvas.dataset.size),
9
+ state: (canvas.dataset.state ?? "idle"),
10
+ });
11
+ }
@@ -52,7 +52,7 @@
52
52
  * own optical ring in the current mode (design-system DESIGN.md
53
53
  * "core.elevation"). An elevated surface therefore draws no second edge:
54
54
  * never pair one of these with border-*, ring-*, or another box-shadow
55
- * (`nadicodeai/no-elevated-edge` enforces it). Declared as utilities so
55
+ * (`repo/no-elevated-edge` enforces it). Declared as utilities so
56
56
  * variant prefixes can gate them.
57
57
  */
58
58
  @utility nc-elevation-resting {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.54",
3
+ "version": "12.1.56",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/agent-orb.d.ts",
25
25
  "import": "./dist/agent-orb.js"
26
26
  },
27
+ "./standalone": {
28
+ "types": "./dist/standalone/index.d.ts",
29
+ "import": "./dist/standalone/index.js"
30
+ },
27
31
  "./hooks": {
28
32
  "types": "./dist/hooks/index.d.ts",
29
33
  "import": "./dist/hooks/index.js"
@@ -77,7 +81,7 @@
77
81
  "@assistant-ui/react": "0.15.22",
78
82
  "@assistant-ui/react-markdown": "0.14.17",
79
83
  "@base-ui/react": "^1.8.0",
80
- "@nadicodeai/design-system": "12.1.54",
84
+ "@nadicodeai/design-system": "12.1.56",
81
85
  "class-variance-authority": "^0.7.1",
82
86
  "clsx": "^2.1.1",
83
87
  "cmdk": "^1.1.1",
@@ -118,6 +122,7 @@
118
122
  "@types/react": "19.3.0",
119
123
  "@types/react-dom": "19.3.0",
120
124
  "axe-core": "^4.13.0",
125
+ "esbuild": "^0.28.2",
121
126
  "eslint": "^9.39.4",
122
127
  "jsdom": "^30.1.1",
123
128
  "postcss": "^8.5.28",
package/dist/.build-kind DELETED
@@ -1 +0,0 @@
1
- clean
@@ -1,167 +0,0 @@
1
- /*
2
- * Cards that share a row share one height, and one component makes that true.
3
- *
4
- * What is read is a JSX element's OWN class utilities together with its OWN
5
- * direct children: the utilities say whether the element puts its children side
6
- * by side — a grid with more than one column, or a flex that is not a column —
7
- * and the children say whether those are cards. A `Card`, anything whose name
8
- * ends in `Card` (`OverviewChartCard`), and a `.map()` whose callback returns
9
- * one all count, because a mapped list is the row that goes ragged first.
10
- *
11
- * Why: a hand-written row leaves each card at its content's height, so three
12
- * cards with 4, 5 and 5 rows end on three different lines and a finished
13
- * analytics surface reads as broken (`rule/card-row-equal-height`). `CardRow`
14
- * from `@nadicodeai/ui` stretches its cells and makes each card fill the one it
15
- * lands in; a row written by hand has to remember both halves and usually
16
- * remembers neither.
17
- *
18
- * A vertical stack is not a row and is never reported: `flex-col`, a `grid`
19
- * with one column or no column count at all, and `space-y-*` each put one card
20
- * under the next, where equal height means nothing.
21
- *
22
- * What it cannot see, by design, because each would need another file: a card
23
- * behind an intermediate wrapper element, a card a child component renders from
24
- * its own file, and a class list the shared reader's one hop cannot resolve.
25
- * Those stay review findings. `packages/ui/src` is exempt by default, since that
26
- * is where `CardRow` and the package's own compositions are built;
27
- * `packageOwnedPrimitives: "lint"` holds the package to the rule too.
28
- *
29
- * Standard tool checked first: `better-tailwindcss/no-restricted-classes`
30
- * matches a class wherever it is written and would have to ban `grid-cols-2`
31
- * outright; it cannot ask what the element carrying it contains. "A multi-column
32
- * container whose children are cards" is a relationship between a class list and
33
- * a child list, so it is read here, on the shared class and component-name
34
- * readers.
35
- */
36
- import {
37
- jsxComponentName,
38
- openingElementClassUtilities,
39
- packageOwnedPrimitivesSchema,
40
- skipsPackageOwnedPrimitive,
41
- } from "./jsx-class-utility.js";
42
-
43
- const OWNER = "CardRow";
44
-
45
- function withoutVariants(token) {
46
- let bracketDepth = 0;
47
- let start = 0;
48
- for (let index = 0; index < token.length; index += 1) {
49
- if (token[index] === "[") bracketDepth += 1;
50
- if (token[index] === "]") bracketDepth = Math.max(0, bracketDepth - 1);
51
- if (token[index] === ":" && bracketDepth === 0) start = index + 1;
52
- }
53
- return token.slice(start);
54
- }
55
-
56
- /**
57
- * The utility that makes this element a row, or undefined. A `grid-cols-*` of
58
- * anything but one, an arbitrary column template, an explicit `flex-row`, or a
59
- * bare `flex` that no `flex-col` turns on its side — at any breakpoint, since a
60
- * row at `lg` is still a row.
61
- */
62
- function rowUtility(utilities) {
63
- const unqualified = utilities.map(withoutVariants);
64
- for (const utility of unqualified) {
65
- if (!utility.startsWith("grid-cols-")) continue;
66
- const columns = utility.slice("grid-cols-".length);
67
- if (columns !== "1") return utility;
68
- }
69
- if (unqualified.includes("flex-row")) return "flex-row";
70
- if (unqualified.includes("flex") && !unqualified.includes("flex-col")) return "flex";
71
- return undefined;
72
- }
73
-
74
- function isCardName(name) {
75
- return typeof name === "string" && (name === "Card" || /Card$/.test(name));
76
- }
77
-
78
- /** The element a `.map()` or `Array.from()` callback renders, descended through its return. */
79
- function mappedElement(expression) {
80
- if (expression?.type !== "CallExpression") return undefined;
81
- const { callee } = expression;
82
- if (callee.type !== "MemberExpression" || callee.computed) return undefined;
83
- if (callee.property.name !== "map" && callee.property.name !== "from") return undefined;
84
- const callback = expression.arguments.find(
85
- (argument) =>
86
- argument.type === "ArrowFunctionExpression" || argument.type === "FunctionExpression",
87
- );
88
- if (!callback) return undefined;
89
- if (callback.body.type !== "BlockStatement") return returnedElement(callback.body);
90
- for (const statement of callback.body.body) {
91
- if (statement.type !== "ReturnStatement") continue;
92
- const element = returnedElement(statement.argument);
93
- if (element) return element;
94
- }
95
- return undefined;
96
- }
97
-
98
- /** The JSX element one expression renders, through parentheses and conditionals. */
99
- function returnedElement(node) {
100
- if (!node) return undefined;
101
- switch (node.type) {
102
- case "JSXElement":
103
- return node;
104
- case "ConditionalExpression":
105
- return returnedElement(node.consequent) ?? returnedElement(node.alternate);
106
- case "LogicalExpression":
107
- return returnedElement(node.right);
108
- default:
109
- return undefined;
110
- }
111
- }
112
-
113
- /**
114
- * How many cards this element lays out directly. A `.map()` counts as two: one
115
- * expression stands for however many records there are, which is the case the
116
- * ragged edge shows up in. A card behind a condition counts as one.
117
- */
118
- function cardChildCount(node, context) {
119
- let count = 0;
120
- for (const child of node.children) {
121
- if (child.type === "JSXElement") {
122
- if (isCardName(jsxComponentName(child.openingElement, context))) count += 1;
123
- continue;
124
- }
125
- if (child.type !== "JSXExpressionContainer") continue;
126
- const mapped = mappedElement(child.expression);
127
- if (mapped) {
128
- if (isCardName(jsxComponentName(mapped.openingElement, context))) count += 2;
129
- continue;
130
- }
131
- const conditional = returnedElement(child.expression);
132
- if (conditional && isCardName(jsxComponentName(conditional.openingElement, context)))
133
- count += 1;
134
- }
135
- return count;
136
- }
137
-
138
- export const cardRowOwner = {
139
- meta: {
140
- type: "problem",
141
- docs: {
142
- description: "Require the shared CardRow owner for a row of sibling cards",
143
- },
144
- schema: [packageOwnedPrimitivesSchema],
145
- messages: {
146
- cardRowOwner:
147
- '"{{utility}}" lays these cards side by side without the owner of that row. An alignment class or a wrapper around a card is then enough for the shortest card to stop at its content and the row to end on a ragged edge. Use CardRow from @nadicodeai/ui, which stretches its cells and makes every card fill the one it lands in, wrapped in a list item or not (rule/card-row-equal-height).',
148
- },
149
- },
150
- create(context) {
151
- if (skipsPackageOwnedPrimitive(context)) return {};
152
- return {
153
- JSXElement(node) {
154
- if (jsxComponentName(node.openingElement, context) === OWNER) return;
155
- const utility = rowUtility(openingElementClassUtilities(node.openingElement, context));
156
- if (!utility) return;
157
- const count = cardChildCount(node, context);
158
- if (count < 2) return;
159
- context.report({
160
- node: node.openingElement,
161
- messageId: "cardRowOwner",
162
- data: { utility },
163
- });
164
- },
165
- };
166
- },
167
- };
@@ -1,177 +0,0 @@
1
- /*
2
- * A destructive Server Action never fires on a bare form or submit button.
3
- *
4
- * Two shapes are destructive, and both are read off the JSX itself rather than
5
- * out of a registry:
6
- *
7
- * - the bound symbol follows the Portal's destructive-action naming convention
8
- * (`archiveThingAction`, `removeMemberAction`, `revokeInstallationAction`);
9
- * - the form submits a lifecycle change to `archived`, which is how an archive
10
- * is written through an otherwise ordinary update action — the hidden field
11
- * is the destructive part, not the symbol's name.
12
- *
13
- * The approved carriers are `ConfirmedActionForm` and a destructive
14
- * `ActionDialogForm`. A component that receives a destructive action as a prop
15
- * binds it under that prop's name, so the convention holds at the site where
16
- * the binding is actually written and this rule sees it there.
17
- *
18
- * Standard tool checked first: `no-restricted-syntax` judges one
19
- * node at a time, and the archive shape is a relationship between two — an
20
- * ordinary `action={updateCustomerAction}` binding on the form, and the
21
- * `lifecycle_status="archived"` field somewhere below it, which is what makes
22
- * that ordinary binding destructive. A selector can match either node alone;
23
- * neither alone is a violation. Customer archival in
24
- * `apps/portal/src/components/customers/customer-settings-tab.tsx` is exactly that
25
- * shape, so the relationship has to be read, and that is what this rule does.
26
- *
27
- * Replaces the vitest guard that joined a hand-kept `CONFIRM_REQUIRED_ACTIONS`
28
- * ledger of file paths and symbols against a TypeScript AST walk (#821, #822).
29
- * What the ledger held that a derivation cannot — an action that destroys
30
- * nothing yet still deserves a confirmation, such as starting an impersonation,
31
- * and the `confirm*` callbacks behind `ConfirmDialog` — is judgment, and ADR
32
- * 0057 puts judgment in review rather than in machinery.
33
- */
34
-
35
- const DESTRUCTIVE_ACTION_NAME =
36
- /^(?:archive|cancel|decline|remove|revoke|suspend|unassign)[A-Z][A-Za-z]*Action$/;
37
- const BINDING_ATTRIBUTES = new Set(["action", "formAction"]);
38
- const LIFECYCLE_FIELD = "lifecycle_status";
39
- const ARCHIVED = "archived";
40
-
41
- function elementName(openingElement) {
42
- return openingElement?.name?.type === "JSXIdentifier" ? openingElement.name.name : undefined;
43
- }
44
-
45
- function openingElementOf(node) {
46
- if (node.type === "JSXElement") return node.openingElement;
47
- return node.type === "JSXOpeningElement" ? node : undefined;
48
- }
49
-
50
- function attributeValue(openingElement, name) {
51
- for (const attribute of openingElement.attributes) {
52
- if (attribute.type !== "JSXAttribute" || attribute.name.name !== name) continue;
53
- const value = attribute.value;
54
- if (value === null) return true;
55
- if (value.type === "Literal") return value.value;
56
- if (value.type === "JSXExpressionContainer" && value.expression.type === "Literal") {
57
- return value.expression.value;
58
- }
59
- return undefined;
60
- }
61
- return undefined;
62
- }
63
-
64
- /** Every identifier named anywhere inside a subtree. */
65
- function identifiers(node, found = []) {
66
- if (!node || typeof node.type !== "string") return found;
67
- if (node.type === "Identifier") {
68
- found.push(node.name);
69
- return found;
70
- }
71
- for (const [key, value] of Object.entries(node)) {
72
- if (key === "parent") continue;
73
- if (Array.isArray(value)) {
74
- for (const child of value) identifiers(child, found);
75
- } else if (value && typeof value === "object") {
76
- identifiers(value, found);
77
- }
78
- }
79
- return found;
80
- }
81
-
82
- /*
83
- * The children a JSX subtree renders. A field is as often written inside a
84
- * `{condition && <input …/>}` or a ternary as it is written bare, so the walk
85
- * steps through the expression container and the two operators that carry JSX
86
- * inside it. Nothing is evaluated: both branches of a `&&` or a `?:` count as
87
- * rendered, because either one may be.
88
- */
89
- function renderedChildren(node) {
90
- switch (node.type) {
91
- case "JSXElement":
92
- case "JSXFragment":
93
- return node.children;
94
- case "JSXExpressionContainer":
95
- return [node.expression];
96
- case "LogicalExpression":
97
- return [node.left, node.right];
98
- case "ConditionalExpression":
99
- return [node.consequent, node.alternate];
100
- default:
101
- return [];
102
- }
103
- }
104
-
105
- /** True when the subtree submits a lifecycle change to `archived`. */
106
- function submitsArchive(node) {
107
- const opening = openingElementOf(node);
108
- if (
109
- opening &&
110
- attributeValue(opening, "name") === LIFECYCLE_FIELD &&
111
- attributeValue(opening, "value") === ARCHIVED
112
- ) {
113
- return true;
114
- }
115
- return renderedChildren(node).some((child) => submitsArchive(child));
116
- }
117
-
118
- function enclosingForm(node, sourceCode) {
119
- const ancestors = sourceCode.getAncestors(node);
120
- for (let index = ancestors.length - 1; index >= 0; index -= 1) {
121
- const ancestor = ancestors[index];
122
- if (ancestor.type === "JSXElement" && elementName(ancestor.openingElement) === "form") {
123
- return ancestor;
124
- }
125
- }
126
- return undefined;
127
- }
128
-
129
- export const confirmDestructiveAction = {
130
- meta: {
131
- type: "problem",
132
- docs: {
133
- description:
134
- "Require a destructive Server Action to be bound through an approved confirmation component",
135
- },
136
- schema: [],
137
- messages: {
138
- unconfirmed:
139
- "A destructive Server Action has no opt-out: bind {{binding}} through ConfirmedActionForm, a destructive ActionDialogForm, or ConfirmDialog onConfirm — never on a bare <{{tag}}>.",
140
- },
141
- },
142
- create(context) {
143
- return {
144
- JSXOpeningElement(node) {
145
- const tag = elementName(node);
146
- if (!tag) return;
147
-
148
- for (const attribute of node.attributes) {
149
- if (attribute.type !== "JSXAttribute" || attribute.name.type !== "JSXIdentifier")
150
- continue;
151
- if (!BINDING_ATTRIBUTES.has(attribute.name.name)) continue;
152
-
153
- const bound = identifiers(attribute.value).filter((name) =>
154
- DESTRUCTIVE_ACTION_NAME.test(name),
155
- );
156
- const scope =
157
- attribute.name.name === "formAction"
158
- ? enclosingForm(node, context.sourceCode)
159
- : node.parent;
160
- const destructive = bound.length > 0 || (scope ? submitsArchive(scope) : false);
161
- if (!destructive) continue;
162
-
163
- const approved =
164
- tag === "ConfirmedActionForm" ||
165
- (tag === "ActionDialogForm" && attributeValue(node, "destructive") !== undefined);
166
- if (approved) continue;
167
-
168
- context.report({
169
- node: attribute,
170
- messageId: "unconfirmed",
171
- data: { binding: bound[0] ?? `the ${ARCHIVED} lifecycle change`, tag },
172
- });
173
- }
174
- },
175
- };
176
- },
177
- };
@@ -1,66 +0,0 @@
1
- /*
2
- * Standard tool checked first: `better-tailwindcss/no-restricted-classes` bans a
3
- * class everywhere and cannot ask which element it sits on or what that element
4
- * wraps, so the relationship is read here on the shared readers.
5
- */
6
- import { jsxComponentName, openingElementClassUtilities } from "./jsx-class-utility.js";
7
-
8
- const SLOTS = new Set(["DrawerHeader", "DrawerBody", "DrawerFooter"]);
9
-
10
- const EDGE = /^border(?:-[tby])?(?:-\d+)?$/;
11
-
12
- function edgeUtility(node, context) {
13
- return openingElementClassUtilities(node, context).find((utility) =>
14
- EDGE.test(utility.split(":").at(-1).replace(/^!/, "")),
15
- );
16
- }
17
-
18
- function wrappedSlot(element, context) {
19
- for (const child of element.children) {
20
- if (child.type !== "JSXElement") continue;
21
- const name = jsxComponentName(child.openingElement, context);
22
- if (name && SLOTS.has(name)) return name;
23
- }
24
- return undefined;
25
- }
26
-
27
- export const drawerOwnsItsEdges = {
28
- meta: {
29
- type: "problem",
30
- docs: {
31
- description: "Keep the edges between a drawer's header, body and footer with the drawer",
32
- },
33
- schema: [],
34
- messages: {
35
- slotEdge:
36
- '"{{utility}}" gives <{{slot}}> a second edge. The drawer draws the hairline between its header, its body and its footer; drop the border class (rule/drawer-owns-its-edges).',
37
- wrapperEdge:
38
- '"{{utility}}" draws an edge around <{{slot}}>. The drawer draws the hairline between its header, its body and its footer; render the slot without this wrapper (rule/drawer-owns-its-edges).',
39
- },
40
- },
41
- create(context) {
42
- return {
43
- JSXElement(element) {
44
- const utility = edgeUtility(element.openingElement, context);
45
- if (!utility) return;
46
- const own = jsxComponentName(element.openingElement, context);
47
- if (own && SLOTS.has(own)) {
48
- context.report({
49
- node: element.openingElement,
50
- messageId: "slotEdge",
51
- data: { utility, slot: own },
52
- });
53
- return;
54
- }
55
- const slot = wrappedSlot(element, context);
56
- if (slot) {
57
- context.report({
58
- node: element.openingElement,
59
- messageId: "wrapperEdge",
60
- data: { utility, slot },
61
- });
62
- }
63
- },
64
- };
65
- },
66
- };
@@ -1,60 +0,0 @@
1
- /*
2
- * One reader for `expect(subject).<modifiers>.<matcher>(args)`.
3
- *
4
- * Both assertion rules here judge a call by its matcher name, and the matcher
5
- * is not the callee's property in the general case: `not`, `resolves` and
6
- * `rejects` sit between `expect(...)` and the matcher, so the name has to be
7
- * read by walking the member chain back to the `expect` call. This is that
8
- * walk, kept in one place so the two rules cannot disagree about what counts
9
- * as an assertion.
10
- */
11
-
12
- function propertyName(member) {
13
- if (!member.computed && member.property.type === "Identifier") return member.property.name;
14
- if (member.computed && member.property.type === "Literal") {
15
- return typeof member.property.value === "string" ? member.property.value : undefined;
16
- }
17
- return undefined;
18
- }
19
-
20
- /** `a?.b` and `a?.()` arrive wrapped; the rules want the expression itself. */
21
- function unwrapChain(node) {
22
- return node?.type === "ChainExpression" ? node.expression : node;
23
- }
24
-
25
- function isExpectCall(node) {
26
- if (node?.type !== "CallExpression") return false;
27
- if (node.callee.type === "Identifier") return node.callee.name === "expect";
28
- // `expect.soft(value)` and `expect.poll(fn)` open the same chain.
29
- return node.callee.type === "MemberExpression" && node.callee.object.type === "Identifier"
30
- ? node.callee.object.name === "expect"
31
- : false;
32
- }
33
-
34
- /**
35
- * Reads an assertion call. Returns `{ matcher, modifiers, subject, args }` for
36
- * `expect(subject).<modifiers>.<matcher>(args)`, or `undefined` when the call
37
- * is not an `expect` chain. `subject` is unwrapped of its `ChainExpression`.
38
- */
39
- export function expectAssertion(node) {
40
- if (node.type !== "CallExpression" || node.callee.type !== "MemberExpression") return undefined;
41
- const matcher = propertyName(node.callee);
42
- if (!matcher) return undefined;
43
-
44
- const modifiers = [];
45
- let current = node.callee.object;
46
- while (current.type === "MemberExpression") {
47
- const name = propertyName(current);
48
- if (!name) return undefined;
49
- modifiers.unshift(name);
50
- current = current.object;
51
- }
52
- if (!isExpectCall(current)) return undefined;
53
-
54
- return {
55
- matcher,
56
- modifiers,
57
- subject: unwrapChain(current.arguments[0]),
58
- args: node.arguments,
59
- };
60
- }