view-contracts 0.5.14 → 0.5.16

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/cli-contract.yaml CHANGED
@@ -3,7 +3,7 @@ cli_contracts: 0.1.0
3
3
 
4
4
  info:
5
5
  title: view-contracts CLI
6
- version: 0.5.14
6
+ version: 0.5.16
7
7
  description: >-
8
8
  Contract-first UI design toolchain. Compiles restricted view-contract TSX
9
9
  to language-neutral View IR and renders platform targets (React, SwiftUI, Compose).
package/dist/preview.mjs CHANGED
@@ -29,7 +29,7 @@ var Fb=Object.create;var xa=Object.defineProperty;var qb=Object.getOwnPropertyDe
29
29
  `+h.slice(A,O),A=O+1),C=M;return q+=`
30
30
  `,h.length-A>$&&C>A?q+=h.slice(A,C)+`
31
31
  `+h.slice(C+1):q+=h.slice(A),q.slice(1)}function Qt(h){let $="",x=0;for(let T=0;T<h.length;x>=65536?T+=2:T++){x=kt(h,T);let A=fe[x];!A&&Yt(x)?($+=h[T],x>=65536&&($+=h[T+1])):$+=A||Nt(x)}return $}function wa(h,$,x){let T="",A=h.tag;for(let O=0,C=x.length;O<C;O+=1){let M=x[O];h.replacer&&(M=h.replacer.call(x,String(O),M)),(w(h,$,M,!1,!1)||typeof M>"u"&&w(h,$,null,!1,!1))&&(T!==""&&(T+=","+(h.condenseFlow?"":" ")),T+=h.dump)}h.tag=A,h.dump="["+T+"]"}function Wn(h,$,x,T){let A="",O=h.tag;for(let C=0,M=x.length;C<M;C+=1){let q=x[C];h.replacer&&(q=h.replacer.call(x,String(C),q)),(w(h,$+1,q,!0,!0,!1,!0)||typeof q>"u"&&w(h,$+1,null,!0,!0,!1,!0))&&((!T||A!=="")&&(A+=Gr(h,$)),h.dump&&a===h.dump.charCodeAt(0)?A+="-":A+="- ",A+=h.dump)}h.tag=O,h.dump=A||"[]"}function ba(h,$,x){let T="",A=h.tag,O=Object.keys(x);for(let C=0,M=O.length;C<M;C+=1){let q="";T!==""&&(q+=", "),h.condenseFlow&&(q+='"');let z=O[C],J=x[z];h.replacer&&(J=h.replacer.call(x,z,J)),w(h,$,z,!1,!1)&&(h.dump.length>1024&&(q+="? "),q+=h.dump+(h.condenseFlow?'"':"")+":"+(h.condenseFlow?"":" "),w(h,$,J,!1,!1)&&(q+=h.dump,T+=q))}h.tag=A,h.dump="{"+T+"}"}function $a(h,$,x,T){let A="",O=h.tag,C=Object.keys(x);if(h.sortKeys===!0)C.sort();else if(typeof h.sortKeys=="function")C.sort(h.sortKeys);else if(h.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let M=0,q=C.length;M<q;M+=1){let z="";(!T||A!=="")&&(z+=Gr(h,$));let J=C[M],Q=x[J];if(h.replacer&&(Q=h.replacer.call(x,J,Q)),!w(h,$+1,J,!0,!0,!0))continue;let te=h.tag!==null&&h.tag!=="?"||h.dump&&h.dump.length>1024;te&&(h.dump&&a===h.dump.charCodeAt(0)?z+="?":z+="? "),z+=h.dump,te&&(z+=Gr(h,$)),w(h,$+1,Q,!0,te)&&(h.dump&&a===h.dump.charCodeAt(0)?z+=":":z+=": ",z+=h.dump,A+=z)}h.tag=O,h.dump=A||"{}"}function u(h,$,x){let T=x?h.explicitTypes:h.implicitTypes;for(let A=0,O=T.length;A<O;A+=1){let C=T[A];if((C.instanceOf||C.predicate)&&(!C.instanceOf||typeof $=="object"&&$ instanceof C.instanceOf)&&(!C.predicate||C.predicate($))){if(x?C.multi&&C.representName?h.tag=C.representName($):h.tag=C.tag:h.tag="?",C.represent){let M=h.styleMap[C.tag]||C.defaultStyle,q;if(n.call(C.represent)==="[object Function]")q=C.represent($,M);else if(i.call(C.represent,M))q=C.represent[M]($,M);else throw new t("!<"+C.tag+'> tag resolver accepts not "'+M+'" style');h.dump=q}return!0}}return!1}function w(h,$,x,T,A,O,C){h.tag=null,h.dump=x,u(h,x,!1)||u(h,x,!0);let M=n.call(h.dump),q=T;T&&(T=h.flowLevel<0||h.flowLevel>$);let z=M==="[object Object]"||M==="[object Array]",J,Q;if(z&&(J=h.duplicates.indexOf(x),Q=J!==-1),(h.tag!==null&&h.tag!=="?"||Q||h.indent!==2&&$>0)&&(A=!1),Q&&h.usedDuplicates[J])h.dump="*ref_"+J;else{if(z&&Q&&!h.usedDuplicates[J]&&(h.usedDuplicates[J]=!0),M==="[object Object]")T&&Object.keys(h.dump).length!==0?($a(h,$,h.dump,A),Q&&(h.dump="&ref_"+J+h.dump)):(ba(h,$,h.dump),Q&&(h.dump="&ref_"+J+" "+h.dump));else if(M==="[object Array]")T&&h.dump.length!==0?(h.noArrayIndent&&!C&&$>0?Wn(h,$-1,h.dump,A):Wn(h,$,h.dump,A),Q&&(h.dump="&ref_"+J+h.dump)):(wa(h,$,h.dump),Q&&(h.dump="&ref_"+J+" "+h.dump));else if(M==="[object String]")h.tag!=="?"&&uo(h,h.dump,$,O,q);else{if(M==="[object Undefined]")return!1;if(h.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+M)}if(h.tag!==null&&h.tag!=="?"){let te=encodeURI(h.tag[0]==="!"?h.tag.slice(1):h.tag).replace(/!/g,"%21");h.tag[0]==="!"?te="!"+te:te.slice(0,18)==="tag:yaml.org,2002:"?te="!!"+te.slice(18):te="!<"+te+">",h.dump=te+" "+h.dump}}return!0}function E(h,$){let x=[],T=[];P(h,x,T);let A=T.length;for(let O=0;O<A;O+=1)$.duplicates.push(x[T[O]]);$.usedDuplicates=new Array(A)}function P(h,$,x){if(h!==null&&typeof h=="object"){let T=$.indexOf(h);if(T!==-1)x.indexOf(T)===-1&&x.push(T);else if($.push(h),Array.isArray(h))for(let A=0,O=h.length;A<O;A+=1)P(h[A],$,x);else{let A=Object.keys(h);for(let O=0,C=A.length;O<C;O+=1)P(h[A[O]],$,x)}}}function k(h,$){$=$||{};let x=new ya($);x.noRefs||E(h,x);let T=h;return x.replacer&&(T=x.replacer.call({"":T},"",T)),w(x,0,T,!0,!0)?x.dump+`
32
- `:""}return Wa.dump=k,Wa}function Yb(){if(Pp)return Oe;Pp=1;let e=Jb(),t=Kb();function r(n,i){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return Oe.Type=qe(),Oe.Schema=Ip(),Oe.FAILSAFE_SCHEMA=Np(),Oe.JSON_SCHEMA=jp(),Oe.CORE_SCHEMA=Dp(),Oe.DEFAULT_SCHEMA=Ua(),Oe.load=e.load,Oe.loadAll=e.loadAll,Oe.dump=t.dump,Oe.YAMLException=Jn(),Oe.types={binary:Bp(),float:Lp(),map:Ap(),null:Op(),pairs:Wp(),set:Up(),timestamp:Fp(),bool:Mp(),int:Vp(),merge:qp(),omap:Hp(),seq:Tp(),str:Rp()},Oe.safeLoad=r("safeLoad","load"),Oe.safeLoadAll=r("safeLoadAll","loadAll"),Oe.safeDump=r("safeDump","dump"),Oe}var Oe,mo,er,ip,_a,op,Sa,sp,ka,ap,Ca,lp,Ea,cp,Pa,up,Ia,fp,Ra,pp,Ta,dp,Aa,hp,Na,mp,Oa,gp,Ma,yp,Va,vp,La,wp,ja,bp,Da,$p,Fa,xp,qa,_p,Ba,Sp,Ha,kp,Cp,Wa,Ep,Pp,Xb,nt,gT,yT,vT,wT,bT,$T,xT,_T,ST,kT,CT,ET,PT,IT,Yr=K(()=>{Oe={},mo={},er={};Wa={};Xb=Yb(),nt=zb(Xb),{Type:gT,Schema:yT,FAILSAFE_SCHEMA:vT,JSON_SCHEMA:wT,CORE_SCHEMA:bT,DEFAULT_SCHEMA:$T,load:xT,loadAll:_T,dump:ST,YAMLException:kT,types:CT,safeLoad:ET,safeLoadAll:PT,safeDump:IT}=nt});import{access as AT,readFile as zp}from"node:fs/promises";import{dirname as Qb,resolve as Ce}from"node:path";async function tr(e){let t=Ce(e),r=await zp(t,"utf-8"),n=nt.load(r);return Zb(t,n)}function Zb(e,t){let r=Ie(e);return{...t,openapi:Ce(r,t.openapi),bindings:Ce(r,t.bindings),microContractsConfig:Ce(r,t.microContractsConfig),viewsDir:Ce(r,t.viewsDir),generated:{contractDir:Ce(r,t.generated.contractDir),actions:Ce(r,t.generated.actions),bridge:Ce(r,t.generated.bridge),reactDir:Ce(r,t.generated.reactDir)},runtimeModule:t.runtimeModule?Ce(r,t.runtimeModule):t.componentsModule?Ce(r,t.componentsModule):void 0,themeModule:t.themeModule?Ce(r,t.themeModule):void 0,design:t.design?{tokens:t.design.tokens?Ce(r,t.design.tokens):void 0,theme:t.design.theme?Ce(r,t.design.theme):void 0,extensionsCss:t.design.extensionsCss?Ce(r,t.design.extensionsCss):void 0}:void 0,extensions:t.extensions?Ce(r,t.extensions):void 0}}async function Gp(e){let t=await zp(Ce(e),"utf-8");return nt.load(t)}function Ie(e){return Qb(Ce(e))}function go(e){let t=e.design?.tokens,r=e.design?.theme;if(!t)throw new Error("view-contracts.config.yaml must define design.tokens (project tokens file path).");if(!r)throw new Error("view-contracts.config.yaml must define design.theme (project theme file path).");return{tokensPath:t,themePath:r}}var Mt=K(()=>{"use strict";Yr()});import{readFileSync as e0}from"node:fs";import{createRequire as t0}from"node:module";import{dirname as za,resolve as r0}from"node:path";import{fileURLToPath as n0}from"node:url";function Se(){if(Xr)return Xr;let e=t0(import.meta.url);try{return Xr=za(e.resolve("view-contracts/package.json")),Xr}catch{let t=za(n0(import.meta.url));for(;;){try{let n=r0(t,"package.json");if(JSON.parse(e0(n,"utf8")).name==="view-contracts")return Xr=t,Xr}catch{}let r=za(t);if(r===t)break;t=r}throw new Error("view-contracts package root not found")}}var Xr,Vt=K(()=>{"use strict"});function Jp(e){return vo[e]?.properties??[]}function Kp(e,t){let r=vo[t];return r?r.properties.includes(e):!1}var yo,vo,it,Qr,qT,mt=K(()=>{"use strict";yo={id:{type:"string",category:"identity",lowering:"attribute",description:"Stable identifier for tests and diff updates"},data:{type:"object",category:"identity",lowering:"attribute",description:"Custom data attributes { key: value }; web only (data-<kebab-key>), not rendered on native"},title:{type:"string",category:"identity",lowering:"attribute",description:"Screen title; accessible name of the page"},role:{type:"string",category:"identity",lowering:"attribute",enum:"role",description:"Accessibility semantics (not HTML tag names)"},label:{type:"string",category:"identity",lowering:"attribute",description:"Accessible name; required for IconButton"},visible:{type:"boolean",category:"state",lowering:"none",description:"Show or omit from render tree"},enabled:{type:"boolean",category:"state",lowering:"attribute"},selected:{type:"boolean",category:"state",lowering:"attribute"},checked:{type:"boolean",category:"state",lowering:"attribute"},readonly:{type:"boolean",category:"state",lowering:"attribute"},required:{type:"boolean",category:"state",lowering:"attribute"},width:{type:["string","number"],category:"size",lowering:"inline-css",enum:"widthSize",notes:"string: wrap|fill; number: fixed px/dp/pt; flex ratio uses weight property"},height:{type:["string","number"],category:"size",lowering:"inline-css",enum:"heightSize",notes:"string: wrap|fill; number: fixed px/dp/pt; flex ratio uses weight property"},minWidth:{type:"number",category:"size",lowering:"inline-css"},maxWidth:{type:["string","number"],category:"size",lowering:"inline-css",notes:"number or fill"},minHeight:{type:"number",category:"size",lowering:"inline-css"},maxHeight:{type:["string","number"],category:"size",lowering:"inline-css",notes:"number or fill"},aspectRatio:{type:"number",category:"size",lowering:"inline-css"},weight:{type:"number",category:"size",lowering:"inline-css",notes:"Flex ratio among Row/Column direct children; Spacer is the primary use case"},padding:{type:["string","number"],category:"spacing",lowering:"inline-css",notes:"space token or per-side"},gap:{type:["string","number"],category:"spacing",lowering:"inline-css"},align:{type:"string",category:"alignment",lowering:"inline-css",enum:"align"},justify:{type:"string",category:"alignment",lowering:"inline-css",enum:"justify"},selfAlign:{type:"string",category:"alignment",lowering:"inline-css",enum:"align"},contentAlign:{type:"string",category:"alignment",lowering:"inline-css",enum:"contentAlign"},axis:{type:"string",category:"direction",lowering:"inline-css",enum:"axis"},direction:{type:"string",category:"direction",lowering:"attribute",enum:"direction",description:"Text/layout direction; set at app or screen root, not per layout container"},scroll:{type:"string",category:"overflow",lowering:"inline-css",enum:"scroll"},background:{type:"string",category:"visual",lowering:"inline-css",notes:"color token"},foreground:{type:"string",category:"visual",lowering:"inline-css",notes:"color token"},border:{type:["string","object"],category:"visual",lowering:"inline-css",enum:"border",notes:"none|token|{width,color}"},separator:{type:"number",category:"visual",lowering:"inline-css",notes:"Row separator width in px/dp/pt (0=off)"},separatorColor:{type:"string",category:"visual",lowering:"inline-css",notes:"Row separator color token"},radius:{type:"string",category:"visual",lowering:"inline-css",notes:"radius token"},shadow:{type:"string",category:"visual",lowering:"inline-css",enum:"shadow"},opacity:{type:"number",category:"visual",lowering:"inline-css",notes:"0..1"},clip:{type:"string",category:"visual",lowering:"inline-css",enum:"clip"},textStyle:{type:"string",category:"text",lowering:"inline-css",notes:"typography token"},textAlign:{type:"string",category:"text",lowering:"inline-css",enum:"textAlign"},lineLimit:{type:["string","number"],category:"text",lowering:"inline-css",enum:"lineLimit"},textOverflow:{type:"string",category:"text",lowering:"inline-css",enum:"textOverflow"},fontWeight:{type:"string",category:"text",lowering:"inline-css",enum:"fontWeight"},size:{type:"number",category:"text",lowering:"inline-css",notes:"Font size shorthand (px/dp/pt)"},fit:{type:"string",category:"image",lowering:"inline-css",enum:"imageFit"},src:{type:"string",category:"image",lowering:"attribute",description:"Image source URL or asset reference"},alt:{type:"string",category:"image",lowering:"attribute",description:"Alternative text; not a source reference"},name:{type:"string",category:"identity",lowering:"attribute",description:"Form field name (for FormData) or icon token in the renderer icon set"},action:{type:"action",category:"interaction",lowering:"none",description:"Action descriptor { name, params? }; the element's click/submit action (takes precedence over onClick/onSubmit)"},href:{type:"string",category:"interaction",lowering:"attribute",description:"Navigation target URL"},type:{type:"string",category:"interaction",lowering:"attribute",enum:"buttonType",description:"Button behavior inside a Form; default button"},onClick:{type:"action",category:"interaction",lowering:"none",description:"Action id, not arbitrary code"},onSubmit:{type:"action",category:"interaction",lowering:"none",description:"Form submit/validation action id"},onChange:{type:"action",category:"interaction",lowering:"none"},focusable:{type:"boolean",category:"interaction",lowering:"attribute"},autoFocus:{type:"boolean",category:"interaction",lowering:"attribute"},keyboardType:{type:"string",category:"interaction",lowering:"attribute",enum:"keyboardType"},inputType:{type:"string",category:"interaction",lowering:"attribute",enum:"inputType",description:"HTML input type variant (text, password, email, url, tel)"},value:{type:["string","number","boolean"],category:"data",lowering:"attribute"},binding:{type:"string",category:"data",lowering:"none",description:"ViewModel or form state field identifier"},placeholder:{type:"string",category:"data",lowering:"attribute"},rows:{type:"number",category:"size",lowering:"attribute",description:"Visible text lines"},wrap:{type:"boolean",category:"layout",lowering:"none",description:"Wrap children onto new lines when they overflow"},options:{type:"array",category:"data",lowering:"none",notes:"array<{value,label}>"},error:{type:["string","null"],category:"validation",lowering:"none"},help:{type:["string","null"],category:"validation",lowering:"none"},variant:{type:"string",category:"visual",lowering:"class-name",notes:"design token variant"},theme:{type:"string",category:"visual",lowering:"class-name",notes:"active theme id for runtime theme switching"},display:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS display value (grid, flex, etc.)"},gridTemplateColumns:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS grid-template-columns"},flexDirection:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS flex-direction"},alignItems:{type:"string",category:"alignment",lowering:"inline-css",notes:"CSS align-items"},margin:{type:["string","number"],category:"spacing",lowering:"inline-css",notes:"space token or per-side"},borderColor:{type:"string",category:"visual",lowering:"inline-css",notes:"border color token"},fontSize:{type:["string","number"],category:"text",lowering:"inline-css",notes:"CSS font-size"},flex:{type:"number",category:"size",lowering:"inline-css",description:"Flex grow ratio for proportional sizing in table columns/cells"},each:{type:"string",category:"data",lowering:"none",description:"Iterator variable name for data-bound row repetition"},source:{type:"string",category:"data",lowering:"none",description:"ViewModel array binding for data-driven elements"},headerVisible:{type:"boolean",category:"state",lowering:"attribute"}},vo={App:{description:"App root; holds theme/token/navigation context",tier:"core",category:"structure",notes:"Optional; not required for single-screen DSL",properties:["id","data","visible","padding","direction","theme","variant"],children:{kind:"list",items:["Page"]}},Page:{description:"Screen root; viewport and safe-area boundary",tier:"core",category:"structure",properties:["id","title","data","visible","padding","direction","variant"],children:{kind:"list",items:["Column","Row","Stack","Box"]}},SafeArea:{description:"Insets for OS/browser safe areas",tier:"core",category:"structure",properties:["id","data","visible","padding","variant"],children:{kind:"list",items:["Box","Column","Row"]}},Box:{description:"Single region; background, bounds, child placement",tier:"core",category:"layout",properties:["id","data","visible","role","label","width","height","minWidth","maxWidth","minHeight","maxHeight","padding","margin","gap","contentAlign","background","foreground","border","borderColor","radius","shadow","opacity","clip","selfAlign","display","gridTemplateColumns","flexDirection","variant"],children:{kind:"any"}},Row:{description:"Horizontal child layout",tier:"core",category:"layout",properties:["id","data","visible","role","label","gap","wrap","align","justify","padding","width","height","minWidth","maxWidth","minHeight","maxHeight","variant"],children:{kind:"any"}},Column:{description:"Vertical child layout",tier:"core",category:"layout",properties:["id","data","visible","role","label","gap","align","justify","padding","width","height","minWidth","maxWidth","minHeight","maxHeight","variant"],children:{kind:"any"}},Stack:{description:"Overlay children by z-order (not absolute positioning)",tier:"core",category:"layout",properties:["id","data","visible","role","label","gap","contentAlign","padding","width","height","background","variant"],children:{kind:"any"}},Spacer:{description:"Occupies remaining flex space",tier:"core",category:"layout",notes:"Direct child of Row/Column only",properties:["id","data","visible","width","height","weight","variant"],children:{kind:"none"}},Divider:{description:"Horizontal or vertical separator",tier:"core",category:"layout",properties:["id","data","visible","axis","variant"],children:{kind:"none"}},ScrollArea:{description:"Internal scroll boundary",tier:"core",category:"scroll",properties:["id","data","visible","axis","scroll","width","height","minHeight","maxHeight","padding","variant"],children:{kind:"single"}},List:{description:"Homogeneous list of items",tier:"core",category:"scroll",properties:["id","data","gap","axis","role","visible","variant"],children:{kind:"list",items:["ListItem"]}},ListItem:{description:"One row/cell in a list",tier:"core",category:"scroll",properties:["id","data","selected","padding","gap","role","visible","variant"],children:{kind:"any"}},Text:{description:"Text display",tier:"core",category:"text",properties:["id","data","visible","textStyle","textAlign","lineLimit","textOverflow","fontWeight","fontSize","size","foreground","background","opacity","padding","radius","display","alignItems","role","variant"],children:{kind:"text"}},Link:{description:"Navigable text or region",tier:"optional",category:"text",properties:["id","data","visible","action","onClick","href","label","foreground","role","variant"],children:{kind:"text"}},Image:{description:"Image display",tier:"core",category:"media",properties:["id","data","visible","src","fit","alt","width","height","aspectRatio","radius","variant"],children:{kind:"none"}},Icon:{description:"Icon display; asset set referenced by name token at renderer",tier:"core",category:"media",properties:["id","data","visible","name","alt","foreground","opacity","variant"],children:{kind:"none"}},Button:{description:"Pressable action; label or children required (label is a11y name when both present)",tier:"core",category:"input",properties:["id","data","visible","enabled","action","onClick","type","label","foreground","background","radius","padding","shadow","border","borderColor","fontWeight","fontSize","variant","role"],children:{kind:"list",items:["Text","Icon","Row"]}},IconButton:{description:"Icon-primary button; label required for accessibility",tier:"optional",category:"input",properties:["id","data","visible","enabled","action","onClick","type","label","foreground","background","radius","padding","variant"],children:{kind:"list",items:["Icon"]}},TextInput:{description:"Single-line text input",tier:"core",category:"input",properties:["id","data","visible","enabled","readonly","required","name","value","binding","placeholder","onChange","error","help","keyboardType","inputType","focusable","autoFocus","width","label","foreground","background","radius","padding","border","borderColor","minHeight","fontSize","variant"],children:{kind:"none"}},TextArea:{description:"Multi-line text input",tier:"core",category:"input",properties:["id","data","visible","enabled","readonly","required","name","value","binding","placeholder","onChange","error","help","focusable","width","minHeight","rows","label","foreground","background","radius","padding","border","borderColor","fontSize","variant"],children:{kind:"none"}},Select:{description:"Single selection",tier:"core",category:"input",properties:["id","data","visible","enabled","required","name","value","binding","options","onChange","error","help","width","label","foreground","background","radius","padding","border","borderColor","minHeight","fontSize","variant"],children:{kind:"none"}},Checkbox:{description:"Boolean or multi-select toggle",tier:"core",category:"input",properties:["id","data","visible","enabled","checked","required","binding","name","label","onChange","variant"],children:{kind:"none"}},Radio:{description:"Single choice in a group (use Row/Column to group; binding identifies group)",tier:"core",category:"input",notes:"RadioGroup is expressed via layout Group, not a separate element",properties:["id","data","visible","enabled","checked","binding","name","label","value","onChange","variant"],children:{kind:"none"}},Switch:{description:"On/off toggle",tier:"core",category:"input",properties:["id","data","visible","enabled","checked","binding","name","label","onChange","variant"],children:{kind:"none"}},Form:{description:"Input group submit/validation boundary",tier:"core",category:"form",properties:["id","data","visible","role","label","gap","action","onSubmit","variant"],children:{kind:"any"}},Field:{description:"label/help/error/input unit",tier:"core",category:"form",properties:["id","data","visible","label","help","error","required","gap","variant"],children:{kind:"any"}},Modal:{description:"Primary transient dialog",tier:"core",category:"overlay",notes:"Direct child of Page or App; role defaults to dialog at renderer",properties:["id","data","visible","role","autoFocus","variant"],children:{kind:"list",items:["Box","Column"]}},Drawer:{description:"Edge panel overlay",tier:"extension",category:"overlay",notes:"Placement limited to start/end/bottom at renderer",properties:["id","data","visible","variant"],children:{kind:"list",items:["Box","Column"]}},Popover:{description:"Small anchored panel",tier:"extension",category:"overlay",properties:["id","data","visible","variant"],children:{kind:"list",items:["Box","Column"]}},Tooltip:{description:"Supplementary description",tier:"extension",category:"overlay",properties:["id","data","visible","label","variant"],children:{kind:"text"}},Progress:{description:"Determinate progress",tier:"core",category:"feedback",properties:["id","data","visible","value","variant"],children:{kind:"none"}},Spinner:{description:"Indeterminate loading",tier:"core",category:"feedback",properties:["id","data","visible","role","variant"],children:{kind:"none"}},Table:{description:"Data table with header and repeated rows",tier:"core",category:"data",properties:["id","data","visible","source","gap","border","borderColor","separator","separatorColor","variant"],children:{kind:"list",items:["TableHeader","TableRow"]}},TableHeader:{description:"Table header row defining column labels",tier:"core",category:"data",properties:["id","data","visible","height","border","borderColor","background","alignItems","variant"],children:{kind:"list",items:["TableColumn"]}},TableColumn:{description:"Header cell definition; children override label text",tier:"core",category:"data",properties:["id","data","visible","label","width","flex","align","border","borderColor","padding","fontSize","fontWeight","foreground","variant"],children:{kind:"any"}},TableRow:{description:"Row template repeated for each source item",tier:"core",category:"data",properties:["id","data","visible","each","height","border","borderColor","alignItems","variant"],children:{kind:"list",items:["TableCell"]}},TableCell:{description:"Data cell; children define cell content",tier:"core",category:"data",properties:["id","data","visible","width","flex","align","border","borderColor","padding","fontSize","foreground","variant"],children:{kind:"any"}}},it=new Set(Object.keys(vo)),Qr=new Set(Object.entries(yo).filter(([,e])=>e.lowering==="inline-css").map(([e])=>e)),qT=new Set(Object.entries(yo).filter(([,e])=>e.lowering==="class-name").map(([e])=>e))});import{readFile as i0}from"node:fs/promises";async function Zr(e){return nt.load(await i0(e,"utf-8"))}function wo(e,t,r){for(let n of e)if(!t.has(n))throw new Error(`${r}: unknown element "${n}" \u2014 not in spec/ui-dsl.schema.json vocabulary`)}function Yp(e,t,r){for(let[n,i]of Object.entries(e))for(let o of t)if(i[o]===void 0||i[o]===null||i[o]==="")throw new Error(`${r}: element "${n}" is missing required "${String(o)}"`)}var bo=K(()=>{"use strict";Yr()});import{resolve as o0}from"node:path";function s0(e){wo(Object.keys(e.elements),it,Xp),Yp(e.elements,["tag"],Xp)}async function Ja(e){if(!e&&Ga)return Ga;let t=e??o0(Se(),"renderers/react/elements.yaml"),r=await Zr(t);return s0(r),e||(Ga=r),r}var Xp,Ga,Qp=K(()=>{"use strict";mt();mt();Vt();bo();Xp="renderers/react/elements.yaml",Ga=null});function Zp(e){if(e)return e==="start"?"flex-start":e==="end"?"flex-end":e}function ed(e){if(e)return e==="start"?"flex-start":e==="end"?"flex-end":e==="between"||e==="spaceBetween"?"space-between":e==="around"||e==="spaceAround"?"space-around":e==="spaceEvenly"?"space-evenly":e}var td=K(()=>{"use strict"});function gt(e){return`${e}px`}function en(e){let t=e.match(/^\{([^}]+)\}$/);if(t)return`var(--${t[1].replace(/\./g,"-")})`}function Ka(e){let t={},r=e.width;typeof r=="number"?t.width=gt(r):r==="fill"?t.width="100%":typeof r=="string"&&r!=="wrap"&&(t.width=r),typeof e.minWidth=="number"&&(t.minWidth=gt(e.minWidth));let n=e.maxWidth;typeof n=="number"?t.maxWidth=gt(n):n==="fill"&&(t.maxWidth="100%");let i=e.height;typeof i=="number"?t.height=gt(i):i==="fill"?t.height="100%":typeof i=="string"&&i!=="wrap"&&(t.height=i),typeof e.minHeight=="number"&&(t.minHeight=gt(e.minHeight));let o=e.maxHeight;typeof o=="number"?t.maxHeight=gt(o):o==="fill"&&(t.maxHeight="100%"),e.aspectRatio!==void 0&&(t.aspectRatio=String(e.aspectRatio));let s=e.weight;typeof s=="number"&&(t.flexGrow=s),typeof e.padding=="number"&&(t.padding=gt(e.padding)),typeof e.margin=="number"&&(t.margin=gt(e.margin)),typeof e.gap=="number"&&(t.gap=gt(e.gap));let a=e.textAlign;typeof a=="string"&&(t.textAlign=a==="start"?"left":a==="end"?"right":a);let c=e.contentAlign;typeof c=="string"&&c in rd&&(t.placeItems=rd[c]),typeof e.overflow=="string"&&(t.overflow=e.overflow);let l=e.selfAlign;typeof l=="string"&&(t.alignSelf=l==="start"?"flex-start":l==="end"?"flex-end":l);let p=e.size;typeof p=="number"?t.fontSize=gt(p):typeof p=="string"&&(t.fontSize=p);let f=typeof s=="string"?s:e.fontWeight;typeof f=="string"&&(t.fontWeight=f);let d=e.background;typeof d=="string"&&(t.background=en(d)??d);let m=e.foreground;typeof m=="string"&&(t.color=en(m)??m);let y=e.radius;typeof y=="number"?t.borderRadius=gt(y):typeof y=="string"&&(t.borderRadius=en(y)??y);let g=e.shadow;g===!0?t.boxShadow="var(--ui-shadow)":g===!1?t.boxShadow="none":typeof g=="string"&&(t.boxShadow=a0[g]??en(g)??g);let v=e.border;typeof v=="string"&&(t.border=en(v)??v),typeof e.opacity=="number"&&(t.opacity=e.opacity);let b=e.clip;typeof b=="string"&&(t.overflow=b==="hidden"?"hidden":b);let I=e.align;if(typeof I=="string"){let j=Zp(I);j&&(t.alignItems=j)}let _=e.justify;if(typeof _=="string"){let j=ed(_);j&&(t.justifyContent=j)}typeof e.display=="string"&&(t.display=e.display),typeof e.gridTemplateColumns=="string"&&(t.gridTemplateColumns=e.gridTemplateColumns),typeof e.flexDirection=="string"&&(t.flexDirection=e.flexDirection),typeof e.alignItems=="string"&&(t.alignItems=e.alignItems);let R=e.borderColor;typeof R=="string"&&(t.borderColor=en(R)??R);let N=e.flex;return typeof N=="number"&&(t.flex=N),t}function Kn(e){let t=Object.entries(e);return t.length===0?"":`style={{ ${t.map(([n,i])=>typeof i=="number"?`${n}: ${i}`:`${n}: ${JSON.stringify(i)}`).join(", ")} }}`}var rd,a0,Ya=K(()=>{"use strict";td();rd={topStart:"start start",top:"center start",topEnd:"end start",start:"start center",center:"center center",end:"end center",bottomStart:"start end",bottom:"center end",bottomEnd:"end end"},a0={none:"none",sm:"var(--ui-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))",md:"var(--ui-shadow)",lg:"var(--ui-shadow-lg, 0 10px 15px rgba(0,0,0,0.1))"}});function $o(e,t){let r=e[t];if(r!=null){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="object"&&"kind"in r&&r.kind==="literal")return r.value}}function l0(e,t){if(t!=null&&!(typeof t=="string"||typeof t=="number"||typeof t=="boolean")&&!(typeof t=="object"&&"kind"in t&&t.kind==="literal"))throw new Error(`Style property "${e}" must be a compile-time literal; ViewModel bindings are not allowed on layout/visual props`)}function c0(e){let t={};for(let[r,n]of Object.entries(e)){if(!Qr.has(r))continue;l0(r,n);let i=$o(e,r);i!==void 0&&(t[r]=i)}return t}function u0(e){return e.flex?{display:"flex",flexDirection:e.flex==="column"?"column":"row"}:{}}function f0(e){return e==="horizontal"?{overflowX:"auto",overflowY:"hidden"}:e==="both"?{overflowX:"auto",overflowY:"auto"}:e==="none"?{overflowX:"hidden",overflowY:"hidden"}:{overflowX:"hidden",overflowY:"auto"}}function nd(e,t){let r=c0(t),n=Ka(r);if(n={...n,...u0(e)},e.tableCell){if("alignItems"in n){let i=String(n.alignItems);n.textAlign=i==="flex-end"?"right":i==="center"?"center":"left",delete n.alignItems}"width"in n&&!("flex"in n)&&(n.flexShrink=0,n.flexGrow=0)}if(e.scrollContainer){let i=$o(t,"scroll"),o=$o(t,"axis"),s=typeof i=="string"?i:typeof o=="string"?o==="horizontal"?"horizontal":"vertical":void 0;if(s)return n={...n,...f0(s)},Kn(n);throw new Error("ScrollArea scroll/axis must be compile-time literals")}if(e.flexGrowProp&&t[e.flexGrowProp]){let i=$o(t,e.flexGrowProp);if(typeof i=="number")return n.flexGrow=i,Kn(n);throw new Error(`"${e.flexGrowProp}" on <Spacer> must be a compile-time literal`)}return Kn(n)}var id=K(()=>{"use strict";mt();Ya();Ya()});function od(e){return`data-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`}var sd=K(()=>{"use strict"});function G(e){return" ".repeat(e)}function wr(e,t="vm"){let r=e.scope??t;return e.path?`${r}.${e.path}`:r}function fd(e){return e.parts.map(t=>typeof t=="string"?t:`\${${wr(t)}}`).join("")}function p0(e){return`\`${fd(e)}\``}function xo(e,t=!1){let r=t?" as ActionDescriptor":"";if(!e.params||Object.keys(e.params).length===0)return`{ name: ${JSON.stringify(e.name)} }${r}`;let n=Object.entries(e.params).map(([i,o])=>`${i}: ${rr(o,0)}`).join(", ");return`{ name: ${JSON.stringify(e.name)}, params: { ${n} } }${r}`}function Qa(e,t,r=!1){if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[
32
+ `:""}return Wa.dump=k,Wa}function Yb(){if(Pp)return Oe;Pp=1;let e=Jb(),t=Kb();function r(n,i){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return Oe.Type=qe(),Oe.Schema=Ip(),Oe.FAILSAFE_SCHEMA=Np(),Oe.JSON_SCHEMA=jp(),Oe.CORE_SCHEMA=Dp(),Oe.DEFAULT_SCHEMA=Ua(),Oe.load=e.load,Oe.loadAll=e.loadAll,Oe.dump=t.dump,Oe.YAMLException=Jn(),Oe.types={binary:Bp(),float:Lp(),map:Ap(),null:Op(),pairs:Wp(),set:Up(),timestamp:Fp(),bool:Mp(),int:Vp(),merge:qp(),omap:Hp(),seq:Tp(),str:Rp()},Oe.safeLoad=r("safeLoad","load"),Oe.safeLoadAll=r("safeLoadAll","loadAll"),Oe.safeDump=r("safeDump","dump"),Oe}var Oe,mo,er,ip,_a,op,Sa,sp,ka,ap,Ca,lp,Ea,cp,Pa,up,Ia,fp,Ra,pp,Ta,dp,Aa,hp,Na,mp,Oa,gp,Ma,yp,Va,vp,La,wp,ja,bp,Da,$p,Fa,xp,qa,_p,Ba,Sp,Ha,kp,Cp,Wa,Ep,Pp,Xb,nt,gT,yT,vT,wT,bT,$T,xT,_T,ST,kT,CT,ET,PT,IT,Yr=K(()=>{Oe={},mo={},er={};Wa={};Xb=Yb(),nt=zb(Xb),{Type:gT,Schema:yT,FAILSAFE_SCHEMA:vT,JSON_SCHEMA:wT,CORE_SCHEMA:bT,DEFAULT_SCHEMA:$T,load:xT,loadAll:_T,dump:ST,YAMLException:kT,types:CT,safeLoad:ET,safeLoadAll:PT,safeDump:IT}=nt});import{readFile as zp,stat as AT}from"node:fs/promises";import{dirname as Qb,resolve as Ce}from"node:path";async function tr(e){let t=Ce(e),r=await zp(t,"utf-8"),n=nt.load(r);return Zb(t,n)}function Zb(e,t){let r=Ie(e);return{...t,openapi:Ce(r,t.openapi),bindings:Ce(r,t.bindings),microContractsConfig:Ce(r,t.microContractsConfig),viewsDir:Ce(r,t.viewsDir),generated:{contractDir:Ce(r,t.generated.contractDir),actions:Ce(r,t.generated.actions),bridge:Ce(r,t.generated.bridge),reactDir:Ce(r,t.generated.reactDir)},runtimeModule:t.runtimeModule?Ce(r,t.runtimeModule):t.componentsModule?Ce(r,t.componentsModule):void 0,themeModule:t.themeModule?Ce(r,t.themeModule):void 0,design:t.design?{tokens:t.design.tokens?Ce(r,t.design.tokens):void 0,theme:t.design.theme?Ce(r,t.design.theme):void 0,extensionsCss:t.design.extensionsCss?Ce(r,t.design.extensionsCss):void 0}:void 0,extensions:t.extensions?Ce(r,t.extensions):void 0}}async function Gp(e){let t=await zp(Ce(e),"utf-8");return nt.load(t)}function Ie(e){return Qb(Ce(e))}function go(e){let t=e.design?.tokens,r=e.design?.theme;if(!t)throw new Error("view-contracts.config.yaml must define design.tokens (project tokens file path).");if(!r)throw new Error("view-contracts.config.yaml must define design.theme (project theme file path).");return{tokensPath:t,themePath:r}}var Mt=K(()=>{"use strict";Yr()});import{readFileSync as e0}from"node:fs";import{createRequire as t0}from"node:module";import{dirname as za,resolve as r0}from"node:path";import{fileURLToPath as n0}from"node:url";function Se(){if(Xr)return Xr;let e=t0(import.meta.url);try{return Xr=za(e.resolve("view-contracts/package.json")),Xr}catch{let t=za(n0(import.meta.url));for(;;){try{let n=r0(t,"package.json");if(JSON.parse(e0(n,"utf8")).name==="view-contracts")return Xr=t,Xr}catch{}let r=za(t);if(r===t)break;t=r}throw new Error("view-contracts package root not found")}}var Xr,Vt=K(()=>{"use strict"});function Jp(e){return vo[e]?.properties??[]}function Kp(e,t){let r=vo[t];return r?r.properties.includes(e):!1}var yo,vo,it,Qr,qT,mt=K(()=>{"use strict";yo={id:{type:"string",category:"identity",lowering:"attribute",description:"Stable identifier for tests and diff updates"},data:{type:"object",category:"identity",lowering:"attribute",description:"Custom data attributes { key: value }; web only (data-<kebab-key>), not rendered on native"},title:{type:"string",category:"identity",lowering:"attribute",description:"Screen title; accessible name of the page"},role:{type:"string",category:"identity",lowering:"attribute",enum:"role",description:"Accessibility semantics (not HTML tag names)"},label:{type:"string",category:"identity",lowering:"attribute",description:"Accessible name; required for IconButton"},visible:{type:"boolean",category:"state",lowering:"none",description:"Show or omit from render tree"},enabled:{type:"boolean",category:"state",lowering:"attribute"},selected:{type:"boolean",category:"state",lowering:"attribute"},checked:{type:"boolean",category:"state",lowering:"attribute"},readonly:{type:"boolean",category:"state",lowering:"attribute"},required:{type:"boolean",category:"state",lowering:"attribute"},width:{type:["string","number"],category:"size",lowering:"inline-css",enum:"widthSize",notes:"string: wrap|fill; number: fixed px/dp/pt; flex ratio uses weight property"},height:{type:["string","number"],category:"size",lowering:"inline-css",enum:"heightSize",notes:"string: wrap|fill; number: fixed px/dp/pt; flex ratio uses weight property"},minWidth:{type:"number",category:"size",lowering:"inline-css"},maxWidth:{type:["string","number"],category:"size",lowering:"inline-css",notes:"number or fill"},minHeight:{type:"number",category:"size",lowering:"inline-css"},maxHeight:{type:["string","number"],category:"size",lowering:"inline-css",notes:"number or fill"},aspectRatio:{type:"number",category:"size",lowering:"inline-css"},weight:{type:"number",category:"size",lowering:"inline-css",notes:"Flex ratio among Row/Column direct children; Spacer is the primary use case"},padding:{type:["string","number"],category:"spacing",lowering:"inline-css",notes:"space token or per-side"},gap:{type:["string","number"],category:"spacing",lowering:"inline-css"},align:{type:"string",category:"alignment",lowering:"inline-css",enum:"align"},justify:{type:"string",category:"alignment",lowering:"inline-css",enum:"justify"},selfAlign:{type:"string",category:"alignment",lowering:"inline-css",enum:"align"},contentAlign:{type:"string",category:"alignment",lowering:"inline-css",enum:"contentAlign"},axis:{type:"string",category:"direction",lowering:"inline-css",enum:"axis"},direction:{type:"string",category:"direction",lowering:"attribute",enum:"direction",description:"Text/layout direction; set at app or screen root, not per layout container"},scroll:{type:"string",category:"overflow",lowering:"inline-css",enum:"scroll"},background:{type:"string",category:"visual",lowering:"inline-css",notes:"color token"},foreground:{type:"string",category:"visual",lowering:"inline-css",notes:"color token"},border:{type:["string","object"],category:"visual",lowering:"inline-css",enum:"border",notes:"none|token|{width,color}"},separator:{type:"number",category:"visual",lowering:"inline-css",notes:"Row separator width in px/dp/pt (0=off)"},separatorColor:{type:"string",category:"visual",lowering:"inline-css",notes:"Row separator color token"},radius:{type:"string",category:"visual",lowering:"inline-css",notes:"radius token"},shadow:{type:"string",category:"visual",lowering:"inline-css",enum:"shadow"},opacity:{type:"number",category:"visual",lowering:"inline-css",notes:"0..1"},clip:{type:"string",category:"visual",lowering:"inline-css",enum:"clip"},textStyle:{type:"string",category:"text",lowering:"inline-css",notes:"typography token"},textAlign:{type:"string",category:"text",lowering:"inline-css",enum:"textAlign"},lineLimit:{type:["string","number"],category:"text",lowering:"inline-css",enum:"lineLimit"},textOverflow:{type:"string",category:"text",lowering:"inline-css",enum:"textOverflow"},fontWeight:{type:"string",category:"text",lowering:"inline-css",enum:"fontWeight"},size:{type:"number",category:"text",lowering:"inline-css",notes:"Font size shorthand (px/dp/pt)"},fit:{type:"string",category:"image",lowering:"inline-css",enum:"imageFit"},src:{type:"string",category:"image",lowering:"attribute",description:"Image source URL or asset reference"},alt:{type:"string",category:"image",lowering:"attribute",description:"Alternative text; not a source reference"},name:{type:"string",category:"identity",lowering:"attribute",description:"Form field name (for FormData) or icon token in the renderer icon set"},action:{type:"action",category:"interaction",lowering:"none",description:"Action descriptor { name, params? }; the element's click/submit action (takes precedence over onClick/onSubmit)"},href:{type:"string",category:"interaction",lowering:"attribute",description:"Navigation target URL"},type:{type:"string",category:"interaction",lowering:"attribute",enum:"buttonType",description:"Button behavior inside a Form; default button"},onClick:{type:"action",category:"interaction",lowering:"none",description:"Action id, not arbitrary code"},onSubmit:{type:"action",category:"interaction",lowering:"none",description:"Form submit/validation action id"},onChange:{type:"action",category:"interaction",lowering:"none"},focusable:{type:"boolean",category:"interaction",lowering:"attribute"},autoFocus:{type:"boolean",category:"interaction",lowering:"attribute"},keyboardType:{type:"string",category:"interaction",lowering:"attribute",enum:"keyboardType"},inputType:{type:"string",category:"interaction",lowering:"attribute",enum:"inputType",description:"HTML input type variant (text, password, email, url, tel)"},value:{type:["string","number","boolean"],category:"data",lowering:"attribute"},binding:{type:"string",category:"data",lowering:"none",description:"ViewModel or form state field identifier"},placeholder:{type:"string",category:"data",lowering:"attribute"},rows:{type:"number",category:"size",lowering:"attribute",description:"Visible text lines"},wrap:{type:"boolean",category:"layout",lowering:"none",description:"Wrap children onto new lines when they overflow"},options:{type:"array",category:"data",lowering:"none",notes:"array<{value,label}>"},error:{type:["string","null"],category:"validation",lowering:"none"},help:{type:["string","null"],category:"validation",lowering:"none"},variant:{type:"string",category:"visual",lowering:"class-name",notes:"design token variant"},theme:{type:"string",category:"visual",lowering:"class-name",notes:"active theme id for runtime theme switching"},display:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS display value (grid, flex, etc.)"},gridTemplateColumns:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS grid-template-columns"},flexDirection:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS flex-direction"},alignItems:{type:"string",category:"alignment",lowering:"inline-css",notes:"CSS align-items"},margin:{type:["string","number"],category:"spacing",lowering:"inline-css",notes:"space token or per-side"},borderColor:{type:"string",category:"visual",lowering:"inline-css",notes:"border color token"},fontSize:{type:["string","number"],category:"text",lowering:"inline-css",notes:"CSS font-size"},flex:{type:"number",category:"size",lowering:"inline-css",description:"Flex grow ratio for proportional sizing in table columns/cells"},each:{type:"string",category:"data",lowering:"none",description:"Iterator variable name for data-bound row repetition"},source:{type:"string",category:"data",lowering:"none",description:"ViewModel array binding for data-driven elements"},headerVisible:{type:"boolean",category:"state",lowering:"attribute"}},vo={App:{description:"App root; holds theme/token/navigation context",tier:"core",category:"structure",notes:"Optional; not required for single-screen DSL",properties:["id","data","visible","padding","direction","theme","variant"],children:{kind:"list",items:["Page"]}},Page:{description:"Screen root; viewport and safe-area boundary",tier:"core",category:"structure",properties:["id","title","data","visible","padding","direction","variant"],children:{kind:"list",items:["Column","Row","Stack","Box"]}},SafeArea:{description:"Insets for OS/browser safe areas",tier:"core",category:"structure",properties:["id","data","visible","padding","variant"],children:{kind:"list",items:["Box","Column","Row"]}},Box:{description:"Single region; background, bounds, child placement",tier:"core",category:"layout",properties:["id","data","visible","role","label","width","height","minWidth","maxWidth","minHeight","maxHeight","padding","margin","gap","contentAlign","background","foreground","border","borderColor","radius","shadow","opacity","clip","selfAlign","display","gridTemplateColumns","flexDirection","variant"],children:{kind:"any"}},Row:{description:"Horizontal child layout",tier:"core",category:"layout",properties:["id","data","visible","role","label","gap","wrap","align","justify","padding","width","height","minWidth","maxWidth","minHeight","maxHeight","variant"],children:{kind:"any"}},Column:{description:"Vertical child layout",tier:"core",category:"layout",properties:["id","data","visible","role","label","gap","align","justify","padding","width","height","minWidth","maxWidth","minHeight","maxHeight","variant"],children:{kind:"any"}},Stack:{description:"Overlay children by z-order (not absolute positioning)",tier:"core",category:"layout",properties:["id","data","visible","role","label","gap","contentAlign","padding","width","height","background","variant"],children:{kind:"any"}},Spacer:{description:"Occupies remaining flex space",tier:"core",category:"layout",notes:"Direct child of Row/Column only",properties:["id","data","visible","width","height","weight","variant"],children:{kind:"none"}},Divider:{description:"Horizontal or vertical separator",tier:"core",category:"layout",properties:["id","data","visible","axis","variant"],children:{kind:"none"}},ScrollArea:{description:"Internal scroll boundary",tier:"core",category:"scroll",properties:["id","data","visible","axis","scroll","width","height","minHeight","maxHeight","padding","variant"],children:{kind:"single"}},List:{description:"Homogeneous list of items",tier:"core",category:"scroll",properties:["id","data","gap","axis","role","visible","variant"],children:{kind:"list",items:["ListItem"]}},ListItem:{description:"One row/cell in a list",tier:"core",category:"scroll",properties:["id","data","selected","padding","gap","role","visible","variant"],children:{kind:"any"}},Text:{description:"Text display",tier:"core",category:"text",properties:["id","data","visible","textStyle","textAlign","lineLimit","textOverflow","fontWeight","fontSize","size","foreground","background","opacity","padding","radius","display","alignItems","role","variant"],children:{kind:"text"}},Link:{description:"Navigable text or region",tier:"optional",category:"text",properties:["id","data","visible","action","onClick","href","label","foreground","role","variant"],children:{kind:"text"}},Image:{description:"Image display",tier:"core",category:"media",properties:["id","data","visible","src","fit","alt","width","height","aspectRatio","radius","variant"],children:{kind:"none"}},Icon:{description:"Icon display; asset set referenced by name token at renderer",tier:"core",category:"media",properties:["id","data","visible","name","alt","foreground","opacity","variant"],children:{kind:"none"}},Button:{description:"Pressable action; label or children required (label is a11y name when both present)",tier:"core",category:"input",properties:["id","data","visible","enabled","action","onClick","type","label","foreground","background","radius","padding","shadow","border","borderColor","fontWeight","fontSize","variant","role"],children:{kind:"list",items:["Text","Icon","Row"]}},IconButton:{description:"Icon-primary button; label required for accessibility",tier:"optional",category:"input",properties:["id","data","visible","enabled","action","onClick","type","label","foreground","background","radius","padding","variant"],children:{kind:"list",items:["Icon"]}},TextInput:{description:"Single-line text input",tier:"core",category:"input",properties:["id","data","visible","enabled","readonly","required","name","value","binding","placeholder","onChange","error","help","keyboardType","inputType","focusable","autoFocus","width","label","foreground","background","radius","padding","border","borderColor","minHeight","fontSize","variant"],children:{kind:"none"}},TextArea:{description:"Multi-line text input",tier:"core",category:"input",properties:["id","data","visible","enabled","readonly","required","name","value","binding","placeholder","onChange","error","help","focusable","width","minHeight","rows","label","foreground","background","radius","padding","border","borderColor","fontSize","variant"],children:{kind:"none"}},Select:{description:"Single selection",tier:"core",category:"input",properties:["id","data","visible","enabled","required","name","value","binding","options","onChange","error","help","width","label","foreground","background","radius","padding","border","borderColor","minHeight","fontSize","variant"],children:{kind:"none"}},Checkbox:{description:"Boolean or multi-select toggle",tier:"core",category:"input",properties:["id","data","visible","enabled","checked","required","binding","name","label","onChange","variant"],children:{kind:"none"}},Radio:{description:"Single choice in a group (use Row/Column to group; binding identifies group)",tier:"core",category:"input",notes:"RadioGroup is expressed via layout Group, not a separate element",properties:["id","data","visible","enabled","checked","binding","name","label","value","onChange","variant"],children:{kind:"none"}},Switch:{description:"On/off toggle",tier:"core",category:"input",properties:["id","data","visible","enabled","checked","binding","name","label","onChange","variant"],children:{kind:"none"}},Form:{description:"Input group submit/validation boundary",tier:"core",category:"form",properties:["id","data","visible","role","label","gap","action","onSubmit","variant"],children:{kind:"any"}},Field:{description:"label/help/error/input unit",tier:"core",category:"form",properties:["id","data","visible","label","help","error","required","gap","variant"],children:{kind:"any"}},Modal:{description:"Primary transient dialog",tier:"core",category:"overlay",notes:"Direct child of Page or App; role defaults to dialog at renderer",properties:["id","data","visible","role","autoFocus","variant"],children:{kind:"list",items:["Box","Column"]}},Drawer:{description:"Edge panel overlay",tier:"extension",category:"overlay",notes:"Placement limited to start/end/bottom at renderer",properties:["id","data","visible","variant"],children:{kind:"list",items:["Box","Column"]}},Popover:{description:"Small anchored panel",tier:"extension",category:"overlay",properties:["id","data","visible","variant"],children:{kind:"list",items:["Box","Column"]}},Tooltip:{description:"Supplementary description",tier:"extension",category:"overlay",properties:["id","data","visible","label","variant"],children:{kind:"text"}},Progress:{description:"Determinate progress",tier:"core",category:"feedback",properties:["id","data","visible","value","variant"],children:{kind:"none"}},Spinner:{description:"Indeterminate loading",tier:"core",category:"feedback",properties:["id","data","visible","role","variant"],children:{kind:"none"}},Table:{description:"Data table with header and repeated rows",tier:"core",category:"data",properties:["id","data","visible","source","gap","border","borderColor","separator","separatorColor","variant"],children:{kind:"list",items:["TableHeader","TableRow"]}},TableHeader:{description:"Table header row defining column labels",tier:"core",category:"data",properties:["id","data","visible","height","border","borderColor","background","alignItems","variant"],children:{kind:"list",items:["TableColumn"]}},TableColumn:{description:"Header cell definition; children override label text",tier:"core",category:"data",properties:["id","data","visible","label","width","flex","align","border","borderColor","padding","fontSize","fontWeight","foreground","variant"],children:{kind:"any"}},TableRow:{description:"Row template repeated for each source item",tier:"core",category:"data",properties:["id","data","visible","each","height","border","borderColor","alignItems","variant"],children:{kind:"list",items:["TableCell"]}},TableCell:{description:"Data cell; children define cell content",tier:"core",category:"data",properties:["id","data","visible","width","flex","align","border","borderColor","padding","fontSize","foreground","variant"],children:{kind:"any"}}},it=new Set(Object.keys(vo)),Qr=new Set(Object.entries(yo).filter(([,e])=>e.lowering==="inline-css").map(([e])=>e)),qT=new Set(Object.entries(yo).filter(([,e])=>e.lowering==="class-name").map(([e])=>e))});import{readFile as i0}from"node:fs/promises";async function Zr(e){return nt.load(await i0(e,"utf-8"))}function wo(e,t,r){for(let n of e)if(!t.has(n))throw new Error(`${r}: unknown element "${n}" \u2014 not in spec/ui-dsl.schema.json vocabulary`)}function Yp(e,t,r){for(let[n,i]of Object.entries(e))for(let o of t)if(i[o]===void 0||i[o]===null||i[o]==="")throw new Error(`${r}: element "${n}" is missing required "${String(o)}"`)}var bo=K(()=>{"use strict";Yr()});import{resolve as o0}from"node:path";function s0(e){wo(Object.keys(e.elements),it,Xp),Yp(e.elements,["tag"],Xp)}async function Ja(e){if(!e&&Ga)return Ga;let t=e??o0(Se(),"renderers/react/elements.yaml"),r=await Zr(t);return s0(r),e||(Ga=r),r}var Xp,Ga,Qp=K(()=>{"use strict";mt();mt();Vt();bo();Xp="renderers/react/elements.yaml",Ga=null});function Zp(e){if(e)return e==="start"?"flex-start":e==="end"?"flex-end":e}function ed(e){if(e)return e==="start"?"flex-start":e==="end"?"flex-end":e==="between"||e==="spaceBetween"?"space-between":e==="around"||e==="spaceAround"?"space-around":e==="spaceEvenly"?"space-evenly":e}var td=K(()=>{"use strict"});function gt(e){return`${e}px`}function en(e){let t=e.match(/^\{([^}]+)\}$/);if(t)return`var(--${t[1].replace(/\./g,"-")})`}function Ka(e){let t={},r=e.width;typeof r=="number"?t.width=gt(r):r==="fill"?t.width="100%":typeof r=="string"&&r!=="wrap"&&(t.width=r),typeof e.minWidth=="number"&&(t.minWidth=gt(e.minWidth));let n=e.maxWidth;typeof n=="number"?t.maxWidth=gt(n):n==="fill"&&(t.maxWidth="100%");let i=e.height;typeof i=="number"?t.height=gt(i):i==="fill"?t.height="100%":typeof i=="string"&&i!=="wrap"&&(t.height=i),typeof e.minHeight=="number"&&(t.minHeight=gt(e.minHeight));let o=e.maxHeight;typeof o=="number"?t.maxHeight=gt(o):o==="fill"&&(t.maxHeight="100%"),e.aspectRatio!==void 0&&(t.aspectRatio=String(e.aspectRatio));let s=e.weight;typeof s=="number"&&(t.flexGrow=s),typeof e.padding=="number"&&(t.padding=gt(e.padding)),typeof e.margin=="number"&&(t.margin=gt(e.margin)),typeof e.gap=="number"&&(t.gap=gt(e.gap));let a=e.textAlign;typeof a=="string"&&(t.textAlign=a==="start"?"left":a==="end"?"right":a);let c=e.contentAlign;typeof c=="string"&&c in rd&&(t.placeItems=rd[c]),typeof e.overflow=="string"&&(t.overflow=e.overflow);let l=e.selfAlign;typeof l=="string"&&(t.alignSelf=l==="start"?"flex-start":l==="end"?"flex-end":l);let p=e.size;typeof p=="number"?t.fontSize=gt(p):typeof p=="string"&&(t.fontSize=p);let f=typeof s=="string"?s:e.fontWeight;typeof f=="string"&&(t.fontWeight=f);let d=e.background;typeof d=="string"&&(t.background=en(d)??d);let m=e.foreground;typeof m=="string"&&(t.color=en(m)??m);let y=e.radius;typeof y=="number"?t.borderRadius=gt(y):typeof y=="string"&&(t.borderRadius=en(y)??y);let g=e.shadow;g===!0?t.boxShadow="var(--ui-shadow)":g===!1?t.boxShadow="none":typeof g=="string"&&(t.boxShadow=a0[g]??en(g)??g);let v=e.border;typeof v=="string"&&(t.border=en(v)??v),typeof e.opacity=="number"&&(t.opacity=e.opacity);let b=e.clip;typeof b=="string"&&(t.overflow=b==="hidden"?"hidden":b);let I=e.align;if(typeof I=="string"){let j=Zp(I);j&&(t.alignItems=j)}let _=e.justify;if(typeof _=="string"){let j=ed(_);j&&(t.justifyContent=j)}typeof e.display=="string"&&(t.display=e.display),typeof e.gridTemplateColumns=="string"&&(t.gridTemplateColumns=e.gridTemplateColumns),typeof e.flexDirection=="string"&&(t.flexDirection=e.flexDirection),typeof e.alignItems=="string"&&(t.alignItems=e.alignItems);let R=e.borderColor;typeof R=="string"&&(t.borderColor=en(R)??R);let N=e.flex;return typeof N=="number"&&(t.flex=N),t}function Kn(e){let t=Object.entries(e);return t.length===0?"":`style={{ ${t.map(([n,i])=>typeof i=="number"?`${n}: ${i}`:`${n}: ${JSON.stringify(i)}`).join(", ")} }}`}var rd,a0,Ya=K(()=>{"use strict";td();rd={topStart:"start start",top:"center start",topEnd:"end start",start:"start center",center:"center center",end:"end center",bottomStart:"start end",bottom:"center end",bottomEnd:"end end"},a0={none:"none",sm:"var(--ui-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))",md:"var(--ui-shadow)",lg:"var(--ui-shadow-lg, 0 10px 15px rgba(0,0,0,0.1))"}});function $o(e,t){let r=e[t];if(r!=null){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="object"&&"kind"in r&&r.kind==="literal")return r.value}}function l0(e,t){if(t!=null&&!(typeof t=="string"||typeof t=="number"||typeof t=="boolean")&&!(typeof t=="object"&&"kind"in t&&t.kind==="literal"))throw new Error(`Style property "${e}" must be a compile-time literal; ViewModel bindings are not allowed on layout/visual props`)}function c0(e){let t={};for(let[r,n]of Object.entries(e)){if(!Qr.has(r))continue;l0(r,n);let i=$o(e,r);i!==void 0&&(t[r]=i)}return t}function u0(e){return e.flex?{display:"flex",flexDirection:e.flex==="column"?"column":"row"}:{}}function f0(e){return e==="horizontal"?{overflowX:"auto",overflowY:"hidden"}:e==="both"?{overflowX:"auto",overflowY:"auto"}:e==="none"?{overflowX:"hidden",overflowY:"hidden"}:{overflowX:"hidden",overflowY:"auto"}}function nd(e,t){let r=c0(t),n=Ka(r);if(n={...n,...u0(e)},e.tableCell){if("alignItems"in n){let i=String(n.alignItems);n.textAlign=i==="flex-end"?"right":i==="center"?"center":"left",delete n.alignItems}"width"in n&&!("flex"in n)&&(n.flexShrink=0,n.flexGrow=0)}if(e.scrollContainer){let i=$o(t,"scroll"),o=$o(t,"axis"),s=typeof i=="string"?i:typeof o=="string"?o==="horizontal"?"horizontal":"vertical":void 0;if(s)return n={...n,...f0(s)},Kn(n);throw new Error("ScrollArea scroll/axis must be compile-time literals")}if(e.flexGrowProp&&t[e.flexGrowProp]){let i=$o(t,e.flexGrowProp);if(typeof i=="number")return n.flexGrow=i,Kn(n);throw new Error(`"${e.flexGrowProp}" on <Spacer> must be a compile-time literal`)}return Kn(n)}var id=K(()=>{"use strict";mt();Ya();Ya()});function od(e){return`data-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`}var sd=K(()=>{"use strict"});function G(e){return" ".repeat(e)}function wr(e,t="vm"){let r=e.scope??t;return e.path?`${r}.${e.path}`:r}function fd(e){return e.parts.map(t=>typeof t=="string"?t:`\${${wr(t)}}`).join("")}function p0(e){return`\`${fd(e)}\``}function xo(e,t=!1){let r=t?" as ActionDescriptor":"";if(!e.params||Object.keys(e.params).length===0)return`{ name: ${JSON.stringify(e.name)} }${r}`;let n=Object.entries(e.params).map(([i,o])=>`${i}: ${rr(o,0)}`).join(", ");return`{ name: ${JSON.stringify(e.name)}, params: { ${n} } }${r}`}function Qa(e,t,r=!1){if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[
33
33
  ${e.map(n=>`${G(t+1)}${Qa(n,t+1,r)}`).join(`,
34
34
  `)}
35
35
  ${G(t)}]`;if(typeof e=="object"&&e!==null){let n=e;return"kind"in n&&n.kind==="action"?xo(n,r):`{