flexium 0.9.1 → 0.10.4

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 (142) hide show
  1. package/README.md +14 -0
  2. package/dist/{DrawText-CJikXQjL.d.cts → DrawText-ccZrs3Xs.d.cts} +1 -1
  3. package/dist/{DrawText-Bvzl40Vi.d.ts → DrawText-ngwNNh8O.d.ts} +1 -1
  4. package/dist/advanced.d.cts +1 -1
  5. package/dist/advanced.d.ts +1 -1
  6. package/dist/advanced.js +1 -1
  7. package/dist/advanced.js.map +1 -1
  8. package/dist/advanced.mjs +1 -1
  9. package/dist/advanced.mjs.map +1 -1
  10. package/dist/canvas.d.cts +4 -4
  11. package/dist/canvas.d.ts +4 -4
  12. package/dist/canvas.js +1 -1
  13. package/dist/canvas.mjs +1 -1
  14. package/dist/chunk-3AWR7IKE.js +2 -0
  15. package/dist/chunk-3AWR7IKE.js.map +1 -0
  16. package/dist/chunk-3BQXIHYI.mjs +3 -0
  17. package/dist/chunk-3BQXIHYI.mjs.map +1 -0
  18. package/dist/chunk-5236IK5I.js +2 -0
  19. package/dist/chunk-5236IK5I.js.map +1 -0
  20. package/dist/{chunk-JHJHIMWD.js → chunk-63AW5ZOC.js} +2 -2
  21. package/dist/{chunk-JHJHIMWD.js.map → chunk-63AW5ZOC.js.map} +1 -1
  22. package/dist/chunk-6K44QCMT.mjs +3 -0
  23. package/dist/chunk-6K44QCMT.mjs.map +1 -0
  24. package/dist/chunk-7Q4UE442.mjs +2 -0
  25. package/dist/chunk-7Q4UE442.mjs.map +1 -0
  26. package/dist/chunk-AJT35P3Z.js +3 -0
  27. package/dist/chunk-AJT35P3Z.js.map +1 -0
  28. package/dist/chunk-AYQMU7XC.js +3 -0
  29. package/dist/chunk-AYQMU7XC.js.map +1 -0
  30. package/dist/chunk-B7VP6HBY.mjs +2 -0
  31. package/dist/chunk-B7VP6HBY.mjs.map +1 -0
  32. package/dist/{chunk-R5CS7UZG.mjs → chunk-BYHIHYRR.mjs} +2 -2
  33. package/dist/{chunk-R5CS7UZG.mjs.map → chunk-BYHIHYRR.mjs.map} +1 -1
  34. package/dist/chunk-HLPVL6EK.mjs +2 -0
  35. package/dist/{chunk-RUXAK74B.mjs.map → chunk-HLPVL6EK.mjs.map} +1 -1
  36. package/dist/{chunk-HDCPA76O.mjs → chunk-KJPIJNFH.mjs} +2 -2
  37. package/dist/chunk-KJPIJNFH.mjs.map +1 -0
  38. package/dist/chunk-PVPY55Z7.mjs +2 -0
  39. package/dist/{chunk-TRIEKNVZ.mjs.map → chunk-PVPY55Z7.mjs.map} +1 -1
  40. package/dist/chunk-Q7WT5IIF.mjs +3 -0
  41. package/dist/chunk-Q7WT5IIF.mjs.map +1 -0
  42. package/dist/chunk-S3EDPCYT.js +3 -0
  43. package/dist/chunk-S3EDPCYT.js.map +1 -0
  44. package/dist/{chunk-L4C5UBOX.js → chunk-WOHSSPKD.js} +2 -2
  45. package/dist/chunk-WOHSSPKD.js.map +1 -0
  46. package/dist/{chunk-DFG62GKW.js → chunk-WXEHDEIH.js} +2 -2
  47. package/dist/{chunk-DFG62GKW.js.map → chunk-WXEHDEIH.js.map} +1 -1
  48. package/dist/{chunk-3P6DMEGB.js → chunk-YDZ37ZZ4.js} +2 -2
  49. package/dist/{chunk-3P6DMEGB.js.map → chunk-YDZ37ZZ4.js.map} +1 -1
  50. package/dist/{components-D4WeooPi.d.ts → components-B7KQ8C-i.d.ts} +2 -2
  51. package/dist/{components-DZy2r6m5.d.cts → components-CxnAnbpI.d.cts} +2 -2
  52. package/dist/core.d.cts +48 -136
  53. package/dist/core.d.ts +48 -136
  54. package/dist/core.js +1 -1
  55. package/dist/core.mjs +1 -1
  56. package/dist/dom.d.cts +2 -2
  57. package/dist/dom.d.ts +2 -2
  58. package/dist/dom.js +1 -1
  59. package/dist/dom.js.map +1 -1
  60. package/dist/dom.mjs +1 -1
  61. package/dist/dom.mjs.map +1 -1
  62. package/dist/{effect-BlnnM1t5.d.cts → effect-14CxUU8r.d.cts} +8 -4
  63. package/dist/{effect-BlnnM1t5.d.ts → effect-14CxUU8r.d.ts} +8 -4
  64. package/dist/effect-3LUCHSAZ.mjs +2 -0
  65. package/dist/effect-3LUCHSAZ.mjs.map +1 -0
  66. package/dist/effect-K45UU3N4.js +2 -0
  67. package/dist/effect-K45UU3N4.js.map +1 -0
  68. package/dist/index.d.cts +1 -1
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +1 -1
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/interactive.d.cts +15 -10
  75. package/dist/interactive.d.ts +15 -10
  76. package/dist/interactive.js +1 -1
  77. package/dist/interactive.js.map +1 -1
  78. package/dist/interactive.mjs +1 -1
  79. package/dist/interactive.mjs.map +1 -1
  80. package/dist/metafile-cjs.json +1 -1
  81. package/dist/metafile-esm.json +1 -1
  82. package/dist/{portal-C3ESJhlv.d.ts → portal-CVqrpmHd.d.ts} +2 -2
  83. package/dist/{portal-CAEbiMUZ.d.cts → portal-NLlE-fNZ.d.cts} +2 -2
  84. package/dist/primitives/layout.js +1 -1
  85. package/dist/primitives/layout.mjs +1 -1
  86. package/dist/primitives/motion.js +1 -1
  87. package/dist/primitives/motion.mjs +1 -1
  88. package/dist/primitives/ui.d.cts +3 -3
  89. package/dist/primitives/ui.d.ts +3 -3
  90. package/dist/primitives/ui.js +1 -1
  91. package/dist/primitives/ui.js.map +1 -1
  92. package/dist/primitives/ui.mjs +1 -1
  93. package/dist/primitives/ui.mjs.map +1 -1
  94. package/dist/primitives.d.cts +4 -4
  95. package/dist/primitives.d.ts +4 -4
  96. package/dist/primitives.js +1 -1
  97. package/dist/primitives.js.map +1 -1
  98. package/dist/primitives.mjs +1 -1
  99. package/dist/primitives.mjs.map +1 -1
  100. package/dist/router.d.cts +3 -3
  101. package/dist/router.d.ts +3 -3
  102. package/dist/router.js +1 -1
  103. package/dist/router.mjs +1 -1
  104. package/dist/server.js +1 -1
  105. package/dist/server.js.map +1 -1
  106. package/dist/server.mjs +1 -1
  107. package/dist/server.mjs.map +1 -1
  108. package/dist/signal-2QUI7H7B.js +2 -0
  109. package/dist/{signal-3YZHUCLL.js.map → signal-2QUI7H7B.js.map} +1 -1
  110. package/dist/signal-C6936A3J.d.cts +175 -0
  111. package/dist/signal-C6936A3J.d.ts +175 -0
  112. package/dist/signal-L3ZWGOVT.mjs +2 -0
  113. package/dist/{signal-F2HEYB6F.mjs.map → signal-L3ZWGOVT.mjs.map} +1 -1
  114. package/dist/test-exports.d.cts +6 -6
  115. package/dist/test-exports.d.ts +6 -6
  116. package/dist/test-exports.js +1 -1
  117. package/dist/test-exports.mjs +1 -1
  118. package/package.json +2 -1
  119. package/dist/chunk-2ZHUQBNI.mjs +0 -2
  120. package/dist/chunk-2ZHUQBNI.mjs.map +0 -1
  121. package/dist/chunk-HDCPA76O.mjs.map +0 -1
  122. package/dist/chunk-J4CK5NRW.mjs +0 -3
  123. package/dist/chunk-J4CK5NRW.mjs.map +0 -1
  124. package/dist/chunk-JEDCNAAI.mjs +0 -3
  125. package/dist/chunk-JEDCNAAI.mjs.map +0 -1
  126. package/dist/chunk-L4C5UBOX.js.map +0 -1
  127. package/dist/chunk-M4ANLZ6P.js +0 -3
  128. package/dist/chunk-M4ANLZ6P.js.map +0 -1
  129. package/dist/chunk-RDA77IE6.js +0 -2
  130. package/dist/chunk-RDA77IE6.js.map +0 -1
  131. package/dist/chunk-RUXAK74B.mjs +0 -2
  132. package/dist/chunk-TRIEKNVZ.mjs +0 -2
  133. package/dist/chunk-VIVO4FHN.js +0 -3
  134. package/dist/chunk-VIVO4FHN.js.map +0 -1
  135. package/dist/chunk-XLE6SMWX.mjs +0 -3
  136. package/dist/chunk-XLE6SMWX.mjs.map +0 -1
  137. package/dist/chunk-YGMMJWAA.js +0 -3
  138. package/dist/chunk-YGMMJWAA.js.map +0 -1
  139. package/dist/signal-3YZHUCLL.js +0 -2
  140. package/dist/signal-Dxh9PsKr.d.cts +0 -69
  141. package/dist/signal-Dxh9PsKr.d.ts +0 -69
  142. package/dist/signal-F2HEYB6F.mjs +0 -2
@@ -1,5 +1,5 @@
1
1
  import { R as Renderer, E as EventHandler, F as FNode } from './renderer-DSLb-FGg.cjs';
2
- import { S as Signal, C as Computed } from './signal-Dxh9PsKr.cjs';
2
+ import { S as SignalNode, C as ComputedNode } from './signal-C6936A3J.cjs';
3
3
 
4
4
  /**
5
5
  * DOM Renderer implementation
@@ -182,7 +182,7 @@ interface ListComponent<T> {
182
182
  * mountReactive(() => <span>{count.value}</span>, container)
183
183
  * ```
184
184
  */
185
- declare function mountReactive(node: FNode | string | number | boolean | Signal<any> | Computed<any> | null | undefined | Function | any[] | ListComponent<any>, container?: Node): Node | null;
185
+ declare function mountReactive(node: FNode | string | number | boolean | SignalNode<any> | ComputedNode<any> | null | undefined | Function | any[] | ListComponent<any>, container?: Node): Node | null;
186
186
  declare function createReactiveRoot(container: HTMLElement): {
187
187
  render(node: FNode): void;
188
188
  unmount(): void;
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk3P6DMEGB_js=require('../chunk-3P6DMEGB.js');require('../chunk-Q7IWDVJ4.js'),require('../chunk-WQFQO5LK.js');Object.defineProperty(exports,"Column",{enumerable:true,get:function(){return chunk3P6DMEGB_js.h}});Object.defineProperty(exports,"Grid",{enumerable:true,get:function(){return chunk3P6DMEGB_js.j}});Object.defineProperty(exports,"Row",{enumerable:true,get:function(){return chunk3P6DMEGB_js.g}});Object.defineProperty(exports,"Spacer",{enumerable:true,get:function(){return chunk3P6DMEGB_js.i}});Object.defineProperty(exports,"Stack",{enumerable:true,get:function(){return chunk3P6DMEGB_js.k}});Object.defineProperty(exports,"getBaseValue",{enumerable:true,get:function(){return chunk3P6DMEGB_js.c}});Object.defineProperty(exports,"mapAlignItems",{enumerable:true,get:function(){return chunk3P6DMEGB_js.f}});Object.defineProperty(exports,"mapJustifyContent",{enumerable:true,get:function(){return chunk3P6DMEGB_js.e}});Object.defineProperty(exports,"mergeStyles",{enumerable:true,get:function(){return chunk3P6DMEGB_js.b}});Object.defineProperty(exports,"stylePropsToCSS",{enumerable:true,get:function(){return chunk3P6DMEGB_js.a}});Object.defineProperty(exports,"toCSSValue",{enumerable:true,get:function(){return chunk3P6DMEGB_js.d}});//# sourceMappingURL=layout.js.map
1
+ 'use strict';var chunkYDZ37ZZ4_js=require('../chunk-YDZ37ZZ4.js');require('../chunk-Q7IWDVJ4.js'),require('../chunk-WQFQO5LK.js');Object.defineProperty(exports,"Column",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.h}});Object.defineProperty(exports,"Grid",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.j}});Object.defineProperty(exports,"Row",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.g}});Object.defineProperty(exports,"Spacer",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.i}});Object.defineProperty(exports,"Stack",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.k}});Object.defineProperty(exports,"getBaseValue",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.c}});Object.defineProperty(exports,"mapAlignItems",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.f}});Object.defineProperty(exports,"mapJustifyContent",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.e}});Object.defineProperty(exports,"mergeStyles",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.b}});Object.defineProperty(exports,"stylePropsToCSS",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.a}});Object.defineProperty(exports,"toCSSValue",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.d}});//# sourceMappingURL=layout.js.map
2
2
  //# sourceMappingURL=layout.js.map
@@ -1,2 +1,2 @@
1
- export{h as Column,j as Grid,g as Row,i as Spacer,k as Stack,c as getBaseValue,f as mapAlignItems,e as mapJustifyContent,b as mergeStyles,a as stylePropsToCSS,d as toCSSValue}from'../chunk-R5CS7UZG.mjs';import'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';//# sourceMappingURL=layout.mjs.map
1
+ export{h as Column,j as Grid,g as Row,i as Spacer,k as Stack,c as getBaseValue,f as mapAlignItems,e as mapJustifyContent,b as mergeStyles,a as stylePropsToCSS,d as toCSSValue}from'../chunk-BYHIHYRR.mjs';import'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';//# sourceMappingURL=layout.mjs.map
2
2
  //# sourceMappingURL=layout.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkJHJHIMWD_js=require('../chunk-JHJHIMWD.js');require('../chunk-Q7IWDVJ4.js'),require('../chunk-WQFQO5LK.js'),require('../chunk-YGMMJWAA.js');Object.defineProperty(exports,"MotionController",{enumerable:true,get:function(){return chunkJHJHIMWD_js.b}});Object.defineProperty(exports,"Transition",{enumerable:true,get:function(){return chunkJHJHIMWD_js.c}});Object.defineProperty(exports,"TransitionGroup",{enumerable:true,get:function(){return chunkJHJHIMWD_js.d}});Object.defineProperty(exports,"cleanupMotionState",{enumerable:true,get:function(){return chunkJHJHIMWD_js.a}});Object.defineProperty(exports,"transitions",{enumerable:true,get:function(){return chunkJHJHIMWD_js.e}});//# sourceMappingURL=motion.js.map
1
+ 'use strict';var chunk63AW5ZOC_js=require('../chunk-63AW5ZOC.js');require('../chunk-Q7IWDVJ4.js'),require('../chunk-WQFQO5LK.js'),require('../chunk-5236IK5I.js'),require('../chunk-AJT35P3Z.js');Object.defineProperty(exports,"MotionController",{enumerable:true,get:function(){return chunk63AW5ZOC_js.b}});Object.defineProperty(exports,"Transition",{enumerable:true,get:function(){return chunk63AW5ZOC_js.c}});Object.defineProperty(exports,"TransitionGroup",{enumerable:true,get:function(){return chunk63AW5ZOC_js.d}});Object.defineProperty(exports,"cleanupMotionState",{enumerable:true,get:function(){return chunk63AW5ZOC_js.a}});Object.defineProperty(exports,"transitions",{enumerable:true,get:function(){return chunk63AW5ZOC_js.e}});//# sourceMappingURL=motion.js.map
2
2
  //# sourceMappingURL=motion.js.map
@@ -1,2 +1,2 @@
1
- export{b as MotionController,c as Transition,d as TransitionGroup,a as cleanupMotionState,e as transitions}from'../chunk-TRIEKNVZ.mjs';import'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';import'../chunk-J4CK5NRW.mjs';//# sourceMappingURL=motion.mjs.map
1
+ export{b as MotionController,c as Transition,d as TransitionGroup,a as cleanupMotionState,e as transitions}from'../chunk-PVPY55Z7.mjs';import'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';import'../chunk-B7VP6HBY.mjs';import'../chunk-Q7WT5IIF.mjs';//# sourceMappingURL=motion.mjs.map
2
2
  //# sourceMappingURL=motion.mjs.map
@@ -1,4 +1,4 @@
1
- import { S as Signal } from '../signal-Dxh9PsKr.cjs';
1
+ import { a as Signal, S as SignalNode } from '../signal-C6936A3J.cjs';
2
2
  import { F as FNode } from '../renderer-DSLb-FGg.cjs';
3
3
 
4
4
  /**
@@ -27,8 +27,8 @@ interface ButtonProps {
27
27
  type?: ButtonType;
28
28
  variant?: ButtonVariant;
29
29
  size?: ButtonSize;
30
- disabled?: Signal<boolean> | boolean;
31
- loading?: Signal<boolean> | boolean;
30
+ disabled?: Signal<boolean> | SignalNode<boolean> | boolean;
31
+ loading?: Signal<boolean> | SignalNode<boolean> | boolean;
32
32
  fullWidth?: boolean;
33
33
  children?: any;
34
34
  leftIcon?: any;
@@ -1,4 +1,4 @@
1
- import { S as Signal } from '../signal-Dxh9PsKr.js';
1
+ import { a as Signal, S as SignalNode } from '../signal-C6936A3J.js';
2
2
  import { F as FNode } from '../renderer-DSLb-FGg.js';
3
3
 
4
4
  /**
@@ -27,8 +27,8 @@ interface ButtonProps {
27
27
  type?: ButtonType;
28
28
  variant?: ButtonVariant;
29
29
  size?: ButtonSize;
30
- disabled?: Signal<boolean> | boolean;
31
- loading?: Signal<boolean> | boolean;
30
+ disabled?: Signal<boolean> | SignalNode<boolean> | boolean;
31
+ loading?: Signal<boolean> | SignalNode<boolean> | boolean;
32
32
  fullWidth?: boolean;
33
33
  children?: any;
34
34
  leftIcon?: any;
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkQ7IWDVJ4_js=require('../chunk-Q7IWDVJ4.js');require('../chunk-WQFQO5LK.js');var chunkYGMMJWAA_js=require('../chunk-YGMMJWAA.js');function O(u){let{type:y="button",variant:s="primary",size:v="md",disabled:o=false,loading:E=false,fullWidth:j=false,children:b,leftIcon:x,rightIcon:T,loadingText:k="Loading...",className:D="",style:G,id:C,role:N,ariaLabel:w,ariaDescribedby:I,ariaExpanded:A,ariaPressed:F,ariaControls:K,onPress:z,onPressStart:a,onPressEnd:l,onFocus:m,onBlur:L,onKeyDown:H}=u,g=["button",`button-${s}`,`button-${v}`];j&&g.push("button-full-width"),D&&g.push(D);let t={type:y,class:g.join(" "),style:G};C&&(t.id=C),N&&(t.role=N),w&&(t["aria-label"]=w),I&&(t["aria-describedby"]=I),A!==void 0&&(t["aria-expanded"]=A),F!==void 0&&(t["aria-pressed"]=F),K&&(t["aria-controls"]=K),t.ref=e=>{if(!e)return;let M=typeof o=="boolean"?chunkYGMMJWAA_js.j(o):o,Q=typeof E=="boolean"?chunkYGMMJWAA_js.j(E):E,d=e.querySelector(".button-content"),c=e.querySelector(".button-spinner"),p=e.querySelector(".button-text");if(chunkYGMMJWAA_js.h(()=>{e.disabled=M.value,M.value?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled");}),chunkYGMMJWAA_js.h(()=>{Q.value?(c&&(c.style.display="inline-block"),d&&(d.style.visibility="hidden"),k&&p&&(p.textContent=k),e.disabled=true,e.setAttribute("aria-busy","true")):(c&&(c.style.display="none"),d&&(d.style.visibility="visible"),typeof b=="string"&&p&&(p.textContent=b),e.removeAttribute("aria-busy"));}),z){let i=false,_=n=>{e.disabled||(i=true,e.classList.add("button-pressed"),a&&a(n));},U=n=>{i&&(i=false,e.classList.remove("button-pressed"),l&&l(n));},B=async n=>{if(e.disabled){n.preventDefault();return}try{await z(n);}catch(X){chunkYGMMJWAA_js.b(chunkYGMMJWAA_js.a.BUTTON_HANDLER_FAILED,void 0,X);}},W=n=>{e.disabled||((n.key==="Enter"||n.key===" ")&&(n.preventDefault(),i=true,e.classList.add("button-pressed"),a&&a(n)),H&&H(n));},q=n=>{e.disabled||(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),i=false,e.classList.remove("button-pressed"),l&&l(n),B(n));},R=()=>{i=false,e.classList.remove("button-pressed");};e.addEventListener("pointerdown",_),e.addEventListener("pointerup",U),e.addEventListener("click",B),e.addEventListener("keydown",W),e.addEventListener("keyup",q),e.addEventListener("pointercancel",R),chunkYGMMJWAA_js.m(()=>{e.removeEventListener("pointerdown",_),e.removeEventListener("pointerup",U),e.removeEventListener("click",B),e.removeEventListener("keydown",W),e.removeEventListener("keyup",q),e.removeEventListener("pointercancel",R);});}m&&(e.addEventListener("focus",m),chunkYGMMJWAA_js.m(()=>e.removeEventListener("focus",m))),L&&(e.addEventListener("blur",L),chunkYGMMJWAA_js.m(()=>e.removeEventListener("blur",L)));};let J=[chunkQ7IWDVJ4_js.a("span",{class:"button-spinner","aria-hidden":"true",style:{display:"none"}}),chunkQ7IWDVJ4_js.a("span",{class:"button-content"},[x&&chunkQ7IWDVJ4_js.a("span",{class:"button-icon button-icon-left"},x),chunkQ7IWDVJ4_js.a("span",{class:"button-text"},b),T&&chunkQ7IWDVJ4_js.a("span",{class:"button-icon button-icon-right"},T)].filter(Boolean))];return chunkQ7IWDVJ4_js.a("button",t,J)}function Y(u){let{icon:y,ariaLabel:s,className:v,...o}=u;return s||chunkYGMMJWAA_js.c(chunkYGMMJWAA_js.a.BUTTON_MISSING_ARIA_LABEL),O({...o,children:y,ariaLabel:s,className:`icon-button ${v||""}`})}exports.Button=O;exports.IconButton=Y;//# sourceMappingURL=ui.js.map
1
+ 'use strict';var chunkQ7IWDVJ4_js=require('../chunk-Q7IWDVJ4.js');require('../chunk-WQFQO5LK.js');var chunk5236IK5I_js=require('../chunk-5236IK5I.js'),chunkAJT35P3Z_js=require('../chunk-AJT35P3Z.js');function $(u){let{type:y="button",variant:s="primary",size:v="md",disabled:o=false,loading:E=false,fullWidth:O=false,children:b,leftIcon:x,rightIcon:N,loadingText:T="Loading...",className:k="",style:j,id:w,role:D,ariaLabel:C,ariaDescribedby:I,ariaExpanded:A,ariaPressed:F,ariaControls:K,onPress:z,onPressStart:a,onPressEnd:l,onFocus:m,onBlur:g,onKeyDown:H}=u,L=["button",`button-${s}`,`button-${v}`];O&&L.push("button-full-width"),k&&L.push(k);let i={type:y,class:L.join(" "),style:j};w&&(i.id=w),D&&(i.role=D),C&&(i["aria-label"]=C),I&&(i["aria-describedby"]=I),A!==void 0&&(i["aria-expanded"]=A),F!==void 0&&(i["aria-pressed"]=F),K&&(i["aria-controls"]=K),i.ref=e=>{if(!e)return;let J=typeof o=="boolean"?new chunk5236IK5I_js.d(o):o,Q=typeof E=="boolean"?new chunk5236IK5I_js.d(E):E,d=e.querySelector(".button-content"),c=e.querySelector(".button-spinner"),p=e.querySelector(".button-text");if(chunkAJT35P3Z_js.k(()=>{let t=J.value;e.disabled=t,t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled");}),chunkAJT35P3Z_js.k(()=>{Q.value?(c&&(c.style.display="inline-block"),d&&(d.style.visibility="hidden"),T&&p&&(p.textContent=T),e.disabled=true,e.setAttribute("aria-busy","true")):(c&&(c.style.display="none"),d&&(d.style.visibility="visible"),typeof b=="string"&&p&&(p.textContent=b),e.removeAttribute("aria-busy"));}),z){let t=false,M=n=>{e.disabled||(t=true,e.classList.add("button-pressed"),a&&a(n));},_=n=>{t&&(t=false,e.classList.remove("button-pressed"),l&&l(n));},B=async n=>{if(e.disabled){n.preventDefault();return}try{await z(n);}catch(X){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.BUTTON_HANDLER_FAILED,void 0,X);}},U=n=>{e.disabled||((n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t=true,e.classList.add("button-pressed"),a&&a(n)),H&&H(n));},W=n=>{e.disabled||(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t=false,e.classList.remove("button-pressed"),l&&l(n),B(n));},q=()=>{t=false,e.classList.remove("button-pressed");};e.addEventListener("pointerdown",M),e.addEventListener("pointerup",_),e.addEventListener("click",B),e.addEventListener("keydown",U),e.addEventListener("keyup",W),e.addEventListener("pointercancel",q),chunk5236IK5I_js.g(()=>{e.removeEventListener("pointerdown",M),e.removeEventListener("pointerup",_),e.removeEventListener("click",B),e.removeEventListener("keydown",U),e.removeEventListener("keyup",W),e.removeEventListener("pointercancel",q);});}m&&(e.addEventListener("focus",m),chunk5236IK5I_js.g(()=>e.removeEventListener("focus",m))),g&&(e.addEventListener("blur",g),chunk5236IK5I_js.g(()=>e.removeEventListener("blur",g)));};let G=[chunkQ7IWDVJ4_js.a("span",{class:"button-spinner","aria-hidden":"true",style:{display:"none"}}),chunkQ7IWDVJ4_js.a("span",{class:"button-content"},[x&&chunkQ7IWDVJ4_js.a("span",{class:"button-icon button-icon-left"},x),chunkQ7IWDVJ4_js.a("span",{class:"button-text"},b),N&&chunkQ7IWDVJ4_js.a("span",{class:"button-icon button-icon-right"},N)].filter(Boolean))];return chunkQ7IWDVJ4_js.a("button",i,G)}function Y(u){let{icon:y,ariaLabel:s,className:v,...o}=u;return s||chunkAJT35P3Z_js.c(chunkAJT35P3Z_js.a.BUTTON_MISSING_ARIA_LABEL),$({...o,children:y,ariaLabel:s,className:`icon-button ${v||""}`})}exports.Button=$;exports.IconButton=Y;//# sourceMappingURL=ui.js.map
2
2
  //# sourceMappingURL=ui.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/primitives/ui/Button.ts"],"names":["Button","props","type","variant","size","disabled","loading","fullWidth","children","leftIcon","rightIcon","loadingText","className","style","id","role","ariaLabel","ariaDescribedby","ariaExpanded","ariaPressed","ariaControls","onPress","onPressStart","onPressEnd","onFocus","onBlur","onKeyDown","classes","buttonProps","button","disabledSignal","signal","loadingSignal","contentWrapper","loadingSpinner","textContent","effect","isPressing","handlePointerDown","e","handlePointerUp","handleClick","error","logError","ErrorCodes","handleKeyDown","handleKeyUp","handlePointerCancel","onCleanup","buttonChildren","f","IconButton","icon","logWarning"],"mappings":"uJAsFO,SAASA,CAAAA,CAAOC,CAAAA,CAA2B,CAChD,GAAM,CACJ,IAAA,CAAAC,CAAAA,CAAO,QAAA,CACP,OAAA,CAAAC,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,KACP,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,KAAA,CACV,SAAA,CAAAC,CAAAA,CAAY,MACZ,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,aACd,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,KAAA,CAAAC,CAAAA,CACA,EAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,aAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,MAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CACF,CAAA,CAAIzB,CAAAA,CAGE0B,CAAAA,CAAU,CAAC,SAAU,CAAA,OAAA,EAAUxB,CAAO,CAAA,CAAA,CAAI,CAAA,OAAA,EAAUC,CAAI,CAAA,CAAE,CAAA,CAC5DG,CAAAA,EAAWoB,EAAQ,IAAA,CAAK,mBAAmB,CAAA,CAC3Cf,CAAAA,EAAWe,CAAAA,CAAQ,IAAA,CAAKf,CAAS,CAAA,CAGrC,IAAMgB,CAAAA,CAAmC,CACvC,IAAA,CAAA1B,CAAAA,C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kBAAAA,CAAE,OAAQ,CAAE,KAAA,CAAO,+BAAgC,CAAA,CAAGxC,CAAS,CACnE,CAAA,CAAE,MAAA,CAAO,OAAO,CAClB,CACF,CAAA,CAEA,OAAOwC,kBAAAA,CAAE,QAAA,CAAUtB,CAAAA,CAAaqB,CAAc,CAChD,CAUO,SAASE,CAAAA,CAAWlD,CAAAA,CAA2C,CACpE,GAAM,CAAE,IAAA,CAAAmD,EAAM,SAAA,CAAApC,CAAAA,CAAW,SAAA,CAAAJ,CAAAA,CAAW,GAAGgB,CAAY,CAAA,CAAI3B,CAAAA,CAEvD,OAAKe,CAAAA,EACHqC,kBAAAA,CAAWT,kBAAAA,CAAW,yBAAyB,CAAA,CAG1C5C,CAAAA,CAAO,CACZ,GAAG4B,EACH,QAAA,CAAUwB,CAAAA,CACV,SAAA,CAAApC,CAAAA,CACA,UAAW,CAAA,YAAA,EAAeJ,CAAAA,EAAa,EAAE,CAAA,CAC3C,CAAC,CACH","file":"ui.js","sourcesContent":["/**\n * Button Component - Accessible button with unified touch/click handler\n *\n * Provides onPress handler that works consistently across mouse, touch, and keyboard\n * Includes full ARIA support and style props\n */\n\nimport { signal, effect, onCleanup, type Signal } from '../../core/signal'\nimport { ErrorCodes, logError, logWarning } from '../../core/errors'\nimport { f } from '../../renderers/dom/f'\nimport type { FNode } from '../../core/renderer'\n\n/**\n * Button variants\n */\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'danger'\n\n/**\n * Button sizes\n */\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset'\n\n/**\n * Button component props\n */\nexport interface ButtonProps {\n type?: ButtonType\n variant?: ButtonVariant\n size?: ButtonSize\n disabled?: Signal<boolean> | boolean\n loading?: Signal<boolean> | boolean\n fullWidth?: boolean\n\n // Content\n children?: any\n leftIcon?: any\n rightIcon?: any\n loadingText?: string\n\n // Styling\n className?: string\n style?: Partial<CSSStyleDeclaration>\n\n // Accessibility\n id?: string\n role?: string\n ariaLabel?: string\n ariaDescribedby?: string\n ariaExpanded?: boolean\n ariaPressed?: boolean\n ariaControls?: string\n\n // Event handlers\n onPress?: (event: Event) => void | Promise<void>\n onPressStart?: (event: PointerEvent) => void\n onPressEnd?: (event: PointerEvent) => void\n onFocus?: (event: FocusEvent) => void\n onBlur?: (event: FocusEvent) => void\n onKeyDown?: (event: KeyboardEvent) => void\n}\n\n/**\n * Button component - Accessible button with unified touch/click handler\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" onPress={() => console.log('clicked')}>\n * Click me\n * </Button>\n *\n * const loading = signal(false)\n * <Button loading={loading} loadingText=\"Saving...\">\n * Save\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): FNode {\n const {\n type = 'button',\n variant = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n fullWidth = false,\n children,\n leftIcon,\n rightIcon,\n loadingText = 'Loading...',\n className = '',\n style,\n id,\n role,\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaPressed,\n ariaControls,\n onPress,\n onPressStart,\n onPressEnd,\n onFocus,\n onBlur,\n onKeyDown,\n } = props\n\n // Build class names\n const classes = ['button', `button-${variant}`, `button-${size}`]\n if (fullWidth) classes.push('button-full-width')\n if (className) classes.push(className)\n\n // Build props for the button element\n const buttonProps: Record<string, any> = {\n type,\n class: classes.join(' '),\n style,\n }\n\n if (id) buttonProps.id = id\n if (role) buttonProps.role = role\n if (ariaLabel) buttonProps['aria-label'] = ariaLabel\n if (ariaDescribedby) buttonProps['aria-describedby'] = ariaDescribedby\n if (ariaExpanded !== undefined) buttonProps['aria-expanded'] = ariaExpanded\n if (ariaPressed !== undefined) buttonProps['aria-pressed'] = ariaPressed\n if (ariaControls) buttonProps['aria-controls'] = ariaControls\n\n // Add ref callback to set up reactive behavior\n buttonProps.ref = (button: HTMLButtonElement | null) => {\n if (!button) return\n\n // Convert disabled/loading to signals if needed\n const disabledSignal =\n typeof disabled === 'boolean' ? signal(disabled) : disabled\n const loadingSignal = typeof loading === 'boolean' ? signal(loading) : loading\n\n // Find content elements after mount\n const contentWrapper = button.querySelector('.button-content') as HTMLElement\n const loadingSpinner = button.querySelector('.button-spinner') as HTMLElement\n const textContent = button.querySelector('.button-text') as HTMLElement\n\n // Handle disabled state\n effect(() => {\n button.disabled = disabledSignal.value\n if (disabledSignal.value) {\n button.setAttribute('aria-disabled', 'true')\n } else {\n button.removeAttribute('aria-disabled')\n }\n })\n\n // Handle loading state\n effect(() => {\n const isLoading = loadingSignal.value\n\n if (isLoading) {\n // Show spinner\n if (loadingSpinner) loadingSpinner.style.display = 'inline-block'\n if (contentWrapper) contentWrapper.style.visibility = 'hidden'\n\n // Update text for screen readers\n if (loadingText && textContent) {\n textContent.textContent = loadingText\n }\n\n // Disable button during loading\n button.disabled = true\n button.setAttribute('aria-busy', 'true')\n } else {\n // Hide spinner\n if (loadingSpinner) loadingSpinner.style.display = 'none'\n if (contentWrapper) contentWrapper.style.visibility = 'visible'\n\n // Restore original text\n if (typeof children === 'string' && textContent) {\n textContent.textContent = children\n }\n\n button.removeAttribute('aria-busy')\n }\n })\n\n // Unified press handler (works for mouse, touch, and keyboard)\n if (onPress) {\n let isPressing = false\n\n // Pointer down (mouse/touch start)\n const handlePointerDown = (e: PointerEvent) => {\n if (button.disabled) return\n\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n onPressStart(e)\n }\n }\n\n // Pointer up (mouse/touch end)\n const handlePointerUp = (e: PointerEvent) => {\n if (!isPressing) return\n\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n onPressEnd(e)\n }\n }\n\n // Click (fires after pointer up)\n const handleClick = async (e: Event) => {\n if (button.disabled) {\n e.preventDefault()\n return\n }\n\n try {\n await onPress(e)\n } catch (error) {\n logError(ErrorCodes.BUTTON_HANDLER_FAILED, undefined, error)\n }\n }\n\n // Keyboard (Enter/Space)\n const handleKeyDown = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n // Enter or Space triggers press\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressStart(e as any)\n }\n }\n\n // Custom keydown handler\n if (onKeyDown) {\n onKeyDown(e)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressEnd(e as any)\n }\n\n // Trigger press\n handleClick(e)\n }\n }\n\n // Pointer cancel (touch interrupted)\n const handlePointerCancel = () => {\n isPressing = false\n button.classList.remove('button-pressed')\n }\n\n button.addEventListener('pointerdown', handlePointerDown)\n button.addEventListener('pointerup', handlePointerUp)\n button.addEventListener('click', handleClick)\n button.addEventListener('keydown', handleKeyDown)\n button.addEventListener('keyup', handleKeyUp)\n button.addEventListener('pointercancel', handlePointerCancel)\n\n onCleanup(() => {\n button.removeEventListener('pointerdown', handlePointerDown)\n button.removeEventListener('pointerup', handlePointerUp)\n button.removeEventListener('click', handleClick)\n button.removeEventListener('keydown', handleKeyDown)\n button.removeEventListener('keyup', handleKeyUp)\n button.removeEventListener('pointercancel', handlePointerCancel)\n })\n }\n\n // Focus/blur handlers\n if (onFocus) {\n button.addEventListener('focus', onFocus)\n onCleanup(() => button.removeEventListener('focus', onFocus))\n }\n\n if (onBlur) {\n button.addEventListener('blur', onBlur)\n onCleanup(() => button.removeEventListener('blur', onBlur))\n }\n }\n\n // Build button content structure\n const buttonChildren = [\n // Loading spinner\n f('span', {\n class: 'button-spinner',\n 'aria-hidden': 'true',\n style: { display: 'none' },\n }),\n // Content wrapper with icons and text\n f(\n 'span',\n { class: 'button-content' },\n [\n leftIcon && f('span', { class: 'button-icon button-icon-left' }, leftIcon),\n f('span', { class: 'button-text' }, children),\n rightIcon &&\n f('span', { class: 'button-icon button-icon-right' }, rightIcon),\n ].filter(Boolean)\n ),\n ]\n\n return f('button', buttonProps, buttonChildren)\n}\n\n/**\n * IconButton component - Button with only an icon\n *\n * @example\n * ```tsx\n * <IconButton icon={<i class=\"icon-close\" />} ariaLabel=\"Close\" onPress={handleClose} />\n * ```\n */\nexport function IconButton(props: ButtonProps & { icon: any }): FNode {\n const { icon, ariaLabel, className, ...buttonProps } = props\n\n if (!ariaLabel) {\n logWarning(ErrorCodes.BUTTON_MISSING_ARIA_LABEL)\n }\n\n return Button({\n ...buttonProps,\n children: icon,\n ariaLabel,\n className: `icon-button ${className || ''}`,\n })\n}\n"]}
1
+ {"version":3,"sources":["../../src/primitives/ui/Button.ts"],"names":["Button","props","type","variant","size","disabled","loading","fullWidth","children","leftIcon","rightIcon","loadingText","className","style","id","role","ariaLabel","ariaDescribedby","ariaExpanded","ariaPressed","ariaControls","onPress","onPressStart","onPressEnd","onFocus","onBlur","onKeyDown","classes","buttonProps","button","disabledSignal","SignalNode","loadingSignal","contentWrapper","loadingSpinner","textContent","effect","val","isPressing","handlePointerDown","e","handlePointerUp","handleClick","error","logError","ErrorCodes","handleKeyDown","handleKeyUp","handlePointerCancel","onCleanup","buttonChildren","f","IconButton","icon","logWarning"],"mappings":"wMAuFO,SAASA,CAAAA,CAAOC,CAAAA,CAA2B,CAChD,GAAM,CACJ,IAAA,CAAAC,CAAAA,CAAO,QAAA,CACP,OAAA,CAAAC,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,KACP,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,KAAA,CACV,SAAA,CAAAC,CAAAA,CAAY,MACZ,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,aACd,SAAA,CAAAC,CAAAA,CA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SAAA,CAAArC,CAAAA,CACA,UAAW,CAAA,YAAA,EAAeJ,CAAAA,EAAa,EAAE,CAAA,CAC3C,CAAC,CACH","file":"ui.js","sourcesContent":["/**\n * Button Component - Accessible button with unified touch/click handler\n *\n * Provides onPress handler that works consistently across mouse, touch, and keyboard\n * Includes full ARIA support and style props\n */\n\nimport { SignalNode, onCleanup, type Signal } from '../../core/signal'\nimport { effect } from '../../core/effect'\nimport { ErrorCodes, logError, logWarning } from '../../core/errors'\nimport { f } from '../../renderers/dom/f'\nimport type { FNode } from '../../core/renderer'\n\n/**\n * Button variants\n */\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'danger'\n\n/**\n * Button sizes\n */\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset'\n\n/**\n * Button component props\n */\nexport interface ButtonProps {\n type?: ButtonType\n variant?: ButtonVariant\n size?: ButtonSize\n disabled?: Signal<boolean> | SignalNode<boolean> | boolean\n loading?: Signal<boolean> | SignalNode<boolean> | boolean\n fullWidth?: boolean\n\n // Content\n children?: any\n leftIcon?: any\n rightIcon?: any\n loadingText?: string\n\n // Styling\n className?: string\n style?: Partial<CSSStyleDeclaration>\n\n // Accessibility\n id?: string\n role?: string\n ariaLabel?: string\n ariaDescribedby?: string\n ariaExpanded?: boolean\n ariaPressed?: boolean\n ariaControls?: string\n\n // Event handlers\n onPress?: (event: Event) => void | Promise<void>\n onPressStart?: (event: PointerEvent) => void\n onPressEnd?: (event: PointerEvent) => void\n onFocus?: (event: FocusEvent) => void\n onBlur?: (event: FocusEvent) => void\n onKeyDown?: (event: KeyboardEvent) => void\n}\n\n/**\n * Button component - Accessible button with unified touch/click handler\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" onPress={() => console.log('clicked')}>\n * Click me\n * </Button>\n *\n * const loading = signal(false)\n * <Button loading={loading} loadingText=\"Saving...\">\n * Save\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): FNode {\n const {\n type = 'button',\n variant = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n fullWidth = false,\n children,\n leftIcon,\n rightIcon,\n loadingText = 'Loading...',\n className = '',\n style,\n id,\n role,\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaPressed,\n ariaControls,\n onPress,\n onPressStart,\n onPressEnd,\n onFocus,\n onBlur,\n onKeyDown,\n } = props\n\n // Build class names\n const classes = ['button', `button-${variant}`, `button-${size}`]\n if (fullWidth) classes.push('button-full-width')\n if (className) classes.push(className)\n\n // Build props for the button element\n const buttonProps: Record<string, any> = {\n type,\n class: classes.join(' '),\n style,\n }\n\n if (id) buttonProps.id = id\n if (role) buttonProps.role = role\n if (ariaLabel) buttonProps['aria-label'] = ariaLabel\n if (ariaDescribedby) buttonProps['aria-describedby'] = ariaDescribedby\n if (ariaExpanded !== undefined) buttonProps['aria-expanded'] = ariaExpanded\n if (ariaPressed !== undefined) buttonProps['aria-pressed'] = ariaPressed\n if (ariaControls) buttonProps['aria-controls'] = ariaControls\n\n // Add ref callback to set up reactive behavior\n buttonProps.ref = (button: HTMLButtonElement | null) => {\n if (!button) return\n\n // Convert disabled/loading to signals if needed\n // Safety: we normalize to an object with .value property (both Signal and SignalNode have it now)\n const disabledSignal =\n typeof disabled === 'boolean' ? new SignalNode(disabled) : disabled\n const loadingSignal = typeof loading === 'boolean' ? new SignalNode(loading) : loading\n\n // Find content elements after mount\n const contentWrapper = button.querySelector('.button-content') as HTMLElement\n const loadingSpinner = button.querySelector('.button-spinner') as HTMLElement\n const textContent = button.querySelector('.button-text') as HTMLElement\n\n // Handle disabled state\n effect(() => {\n const val = disabledSignal.value // Works for SignalNode and Signal(Proxy)\n button.disabled = val\n if (val) {\n button.setAttribute('aria-disabled', 'true')\n } else {\n button.removeAttribute('aria-disabled')\n }\n })\n\n // Handle loading state\n effect(() => {\n const isLoading = loadingSignal.value\n\n if (isLoading) {\n // Show spinner\n if (loadingSpinner) loadingSpinner.style.display = 'inline-block'\n if (contentWrapper) contentWrapper.style.visibility = 'hidden'\n\n // Update text for screen readers\n if (loadingText && textContent) {\n textContent.textContent = loadingText\n }\n\n // Disable button during loading\n button.disabled = true\n button.setAttribute('aria-busy', 'true')\n } else {\n // Hide spinner\n if (loadingSpinner) loadingSpinner.style.display = 'none'\n if (contentWrapper) contentWrapper.style.visibility = 'visible'\n\n // Restore original text\n if (typeof children === 'string' && textContent) {\n textContent.textContent = children\n }\n\n button.removeAttribute('aria-busy')\n }\n })\n\n // Unified press handler (works for mouse, touch, and keyboard)\n if (onPress) {\n let isPressing = false\n\n // Pointer down (mouse/touch start)\n const handlePointerDown = (e: PointerEvent) => {\n if (button.disabled) return\n\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n onPressStart(e)\n }\n }\n\n // Pointer up (mouse/touch end)\n const handlePointerUp = (e: PointerEvent) => {\n if (!isPressing) return\n\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n onPressEnd(e)\n }\n }\n\n // Click (fires after pointer up)\n const handleClick = async (e: Event) => {\n if (button.disabled) {\n e.preventDefault()\n return\n }\n\n try {\n await onPress(e)\n } catch (error) {\n logError(ErrorCodes.BUTTON_HANDLER_FAILED, undefined, error)\n }\n }\n\n // Keyboard (Enter/Space)\n const handleKeyDown = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n // Enter or Space triggers press\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressStart(e as any)\n }\n }\n\n // Custom keydown handler\n if (onKeyDown) {\n onKeyDown(e)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressEnd(e as any)\n }\n\n // Trigger press\n handleClick(e)\n }\n }\n\n // Pointer cancel (touch interrupted)\n const handlePointerCancel = () => {\n isPressing = false\n button.classList.remove('button-pressed')\n }\n\n button.addEventListener('pointerdown', handlePointerDown)\n button.addEventListener('pointerup', handlePointerUp)\n button.addEventListener('click', handleClick)\n button.addEventListener('keydown', handleKeyDown)\n button.addEventListener('keyup', handleKeyUp)\n button.addEventListener('pointercancel', handlePointerCancel)\n\n onCleanup(() => {\n button.removeEventListener('pointerdown', handlePointerDown)\n button.removeEventListener('pointerup', handlePointerUp)\n button.removeEventListener('click', handleClick)\n button.removeEventListener('keydown', handleKeyDown)\n button.removeEventListener('keyup', handleKeyUp)\n button.removeEventListener('pointercancel', handlePointerCancel)\n })\n }\n\n // Focus/blur handlers\n if (onFocus) {\n button.addEventListener('focus', onFocus)\n onCleanup(() => button.removeEventListener('focus', onFocus))\n }\n\n if (onBlur) {\n button.addEventListener('blur', onBlur)\n onCleanup(() => button.removeEventListener('blur', onBlur))\n }\n }\n\n // Build button content structure\n const buttonChildren = [\n // Loading spinner\n f('span', {\n class: 'button-spinner',\n 'aria-hidden': 'true',\n style: { display: 'none' },\n }),\n // Content wrapper with icons and text\n f(\n 'span',\n { class: 'button-content' },\n [\n leftIcon && f('span', { class: 'button-icon button-icon-left' }, leftIcon),\n f('span', { class: 'button-text' }, children),\n rightIcon &&\n f('span', { class: 'button-icon button-icon-right' }, rightIcon),\n ].filter(Boolean)\n ),\n ]\n\n return f('button', buttonProps, buttonChildren)\n}\n\n/**\n * IconButton component - Button with only an icon\n *\n * @example\n * ```tsx\n * <IconButton icon={<i class=\"icon-close\" />} ariaLabel=\"Close\" onPress={handleClose} />\n * ```\n */\nexport function IconButton(props: ButtonProps & { icon: any }): FNode {\n const { icon, ariaLabel, className, ...buttonProps } = props\n\n if (!ariaLabel) {\n logWarning(ErrorCodes.BUTTON_MISSING_ARIA_LABEL)\n }\n\n return Button({\n ...buttonProps,\n children: icon,\n ariaLabel,\n className: `icon-button ${className || ''}`,\n })\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {a}from'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';import {c,a as a$1,j,h,m,b}from'../chunk-J4CK5NRW.mjs';function O(u){let{type:y="button",variant:s="primary",size:v="md",disabled:o=false,loading:E=false,fullWidth:j$1=false,children:b$1,leftIcon:x,rightIcon:T,loadingText:k="Loading...",className:D="",style:G,id:C,role:N,ariaLabel:w,ariaDescribedby:I,ariaExpanded:A,ariaPressed:F,ariaControls:K,onPress:z,onPressStart:a$2,onPressEnd:l,onFocus:m$1,onBlur:L,onKeyDown:H}=u,g=["button",`button-${s}`,`button-${v}`];j$1&&g.push("button-full-width"),D&&g.push(D);let t={type:y,class:g.join(" "),style:G};C&&(t.id=C),N&&(t.role=N),w&&(t["aria-label"]=w),I&&(t["aria-describedby"]=I),A!==void 0&&(t["aria-expanded"]=A),F!==void 0&&(t["aria-pressed"]=F),K&&(t["aria-controls"]=K),t.ref=e=>{if(!e)return;let M=typeof o=="boolean"?j(o):o,Q=typeof E=="boolean"?j(E):E,d=e.querySelector(".button-content"),c=e.querySelector(".button-spinner"),p=e.querySelector(".button-text");if(h(()=>{e.disabled=M.value,M.value?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled");}),h(()=>{Q.value?(c&&(c.style.display="inline-block"),d&&(d.style.visibility="hidden"),k&&p&&(p.textContent=k),e.disabled=true,e.setAttribute("aria-busy","true")):(c&&(c.style.display="none"),d&&(d.style.visibility="visible"),typeof b$1=="string"&&p&&(p.textContent=b$1),e.removeAttribute("aria-busy"));}),z){let i=false,_=n=>{e.disabled||(i=true,e.classList.add("button-pressed"),a$2&&a$2(n));},U=n=>{i&&(i=false,e.classList.remove("button-pressed"),l&&l(n));},B=async n=>{if(e.disabled){n.preventDefault();return}try{await z(n);}catch(X){b(a$1.BUTTON_HANDLER_FAILED,void 0,X);}},W=n=>{e.disabled||((n.key==="Enter"||n.key===" ")&&(n.preventDefault(),i=true,e.classList.add("button-pressed"),a$2&&a$2(n)),H&&H(n));},q=n=>{e.disabled||(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),i=false,e.classList.remove("button-pressed"),l&&l(n),B(n));},R=()=>{i=false,e.classList.remove("button-pressed");};e.addEventListener("pointerdown",_),e.addEventListener("pointerup",U),e.addEventListener("click",B),e.addEventListener("keydown",W),e.addEventListener("keyup",q),e.addEventListener("pointercancel",R),m(()=>{e.removeEventListener("pointerdown",_),e.removeEventListener("pointerup",U),e.removeEventListener("click",B),e.removeEventListener("keydown",W),e.removeEventListener("keyup",q),e.removeEventListener("pointercancel",R);});}m$1&&(e.addEventListener("focus",m$1),m(()=>e.removeEventListener("focus",m$1))),L&&(e.addEventListener("blur",L),m(()=>e.removeEventListener("blur",L)));};let J=[a("span",{class:"button-spinner","aria-hidden":"true",style:{display:"none"}}),a("span",{class:"button-content"},[x&&a("span",{class:"button-icon button-icon-left"},x),a("span",{class:"button-text"},b$1),T&&a("span",{class:"button-icon button-icon-right"},T)].filter(Boolean))];return a("button",t,J)}function Y(u){let{icon:y,ariaLabel:s,className:v,...o}=u;return s||c(a$1.BUTTON_MISSING_ARIA_LABEL),O({...o,children:y,ariaLabel:s,className:`icon-button ${v||""}`})}export{O as Button,Y as IconButton};//# sourceMappingURL=ui.mjs.map
1
+ import {a}from'../chunk-WVEJT7HD.mjs';import'../chunk-KNF5ERPK.mjs';import {d,g}from'../chunk-B7VP6HBY.mjs';import {c,a as a$1,k,b}from'../chunk-Q7WT5IIF.mjs';function $(u){let{type:y="button",variant:s="primary",size:v="md",disabled:o=false,loading:E=false,fullWidth:O=false,children:b$1,leftIcon:x,rightIcon:N,loadingText:T="Loading...",className:k$1="",style:j,id:w,role:D,ariaLabel:C,ariaDescribedby:I,ariaExpanded:A,ariaPressed:F,ariaControls:K,onPress:z,onPressStart:a$2,onPressEnd:l,onFocus:m,onBlur:g$1,onKeyDown:H}=u,L=["button",`button-${s}`,`button-${v}`];O&&L.push("button-full-width"),k$1&&L.push(k$1);let i={type:y,class:L.join(" "),style:j};w&&(i.id=w),D&&(i.role=D),C&&(i["aria-label"]=C),I&&(i["aria-describedby"]=I),A!==void 0&&(i["aria-expanded"]=A),F!==void 0&&(i["aria-pressed"]=F),K&&(i["aria-controls"]=K),i.ref=e=>{if(!e)return;let J=typeof o=="boolean"?new d(o):o,Q=typeof E=="boolean"?new d(E):E,d$1=e.querySelector(".button-content"),c=e.querySelector(".button-spinner"),p=e.querySelector(".button-text");if(k(()=>{let t=J.value;e.disabled=t,t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled");}),k(()=>{Q.value?(c&&(c.style.display="inline-block"),d$1&&(d$1.style.visibility="hidden"),T&&p&&(p.textContent=T),e.disabled=true,e.setAttribute("aria-busy","true")):(c&&(c.style.display="none"),d$1&&(d$1.style.visibility="visible"),typeof b$1=="string"&&p&&(p.textContent=b$1),e.removeAttribute("aria-busy"));}),z){let t=false,M=n=>{e.disabled||(t=true,e.classList.add("button-pressed"),a$2&&a$2(n));},_=n=>{t&&(t=false,e.classList.remove("button-pressed"),l&&l(n));},B=async n=>{if(e.disabled){n.preventDefault();return}try{await z(n);}catch(X){b(a$1.BUTTON_HANDLER_FAILED,void 0,X);}},U=n=>{e.disabled||((n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t=true,e.classList.add("button-pressed"),a$2&&a$2(n)),H&&H(n));},W=n=>{e.disabled||(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t=false,e.classList.remove("button-pressed"),l&&l(n),B(n));},q=()=>{t=false,e.classList.remove("button-pressed");};e.addEventListener("pointerdown",M),e.addEventListener("pointerup",_),e.addEventListener("click",B),e.addEventListener("keydown",U),e.addEventListener("keyup",W),e.addEventListener("pointercancel",q),g(()=>{e.removeEventListener("pointerdown",M),e.removeEventListener("pointerup",_),e.removeEventListener("click",B),e.removeEventListener("keydown",U),e.removeEventListener("keyup",W),e.removeEventListener("pointercancel",q);});}m&&(e.addEventListener("focus",m),g(()=>e.removeEventListener("focus",m))),g$1&&(e.addEventListener("blur",g$1),g(()=>e.removeEventListener("blur",g$1)));};let G=[a("span",{class:"button-spinner","aria-hidden":"true",style:{display:"none"}}),a("span",{class:"button-content"},[x&&a("span",{class:"button-icon button-icon-left"},x),a("span",{class:"button-text"},b$1),N&&a("span",{class:"button-icon button-icon-right"},N)].filter(Boolean))];return a("button",i,G)}function Y(u){let{icon:y,ariaLabel:s,className:v,...o}=u;return s||c(a$1.BUTTON_MISSING_ARIA_LABEL),$({...o,children:y,ariaLabel:s,className:`icon-button ${v||""}`})}export{$ as Button,Y as IconButton};//# sourceMappingURL=ui.mjs.map
2
2
  //# sourceMappingURL=ui.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/primitives/ui/Button.ts"],"names":["Button","props","type","variant","size","disabled","loading","fullWidth","children","leftIcon","rightIcon","loadingText","className","style","id","role","ariaLabel","ariaDescribedby","ariaExpanded","ariaPressed","ariaControls","onPress","onPressStart","onPressEnd","onFocus","onBlur","onKeyDown","classes","buttonProps","button","disabledSignal","signal","loadingSignal","contentWrapper","loadingSpinner","textContent","effect","isPressing","handlePointerDown","e","handlePointerUp","handleClick","error","logError","ErrorCodes","handleKeyDown","handleKeyUp","handlePointerCancel","onCleanup","buttonChildren","f","IconButton","icon","logWarning"],"mappings":"2HAsFO,SAASA,CAAAA,CAAOC,CAAAA,CAA2B,CAChD,GAAM,CACJ,IAAA,CAAAC,CAAAA,CAAO,QAAA,CACP,OAAA,CAAAC,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,KACP,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,KAAA,CACV,SAAA,CAAAC,GAAAA,CAAY,MACZ,QAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,aACd,SA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Aa,EAAE,CAAA,CAC3C,CAAC,CACH","file":"ui.mjs","sourcesContent":["/**\n * Button Component - Accessible button with unified touch/click handler\n *\n * Provides onPress handler that works consistently across mouse, touch, and keyboard\n * Includes full ARIA support and style props\n */\n\nimport { signal, effect, onCleanup, type Signal } from '../../core/signal'\nimport { ErrorCodes, logError, logWarning } from '../../core/errors'\nimport { f } from '../../renderers/dom/f'\nimport type { FNode } from '../../core/renderer'\n\n/**\n * Button variants\n */\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'danger'\n\n/**\n * Button sizes\n */\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset'\n\n/**\n * Button component props\n */\nexport interface ButtonProps {\n type?: ButtonType\n variant?: ButtonVariant\n size?: ButtonSize\n disabled?: Signal<boolean> | boolean\n loading?: Signal<boolean> | boolean\n fullWidth?: boolean\n\n // Content\n children?: any\n leftIcon?: any\n rightIcon?: any\n loadingText?: string\n\n // Styling\n className?: string\n style?: Partial<CSSStyleDeclaration>\n\n // Accessibility\n id?: string\n role?: string\n ariaLabel?: string\n ariaDescribedby?: string\n ariaExpanded?: boolean\n ariaPressed?: boolean\n ariaControls?: string\n\n // Event handlers\n onPress?: (event: Event) => void | Promise<void>\n onPressStart?: (event: PointerEvent) => void\n onPressEnd?: (event: PointerEvent) => void\n onFocus?: (event: FocusEvent) => void\n onBlur?: (event: FocusEvent) => void\n onKeyDown?: (event: KeyboardEvent) => void\n}\n\n/**\n * Button component - Accessible button with unified touch/click handler\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" onPress={() => console.log('clicked')}>\n * Click me\n * </Button>\n *\n * const loading = signal(false)\n * <Button loading={loading} loadingText=\"Saving...\">\n * Save\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): FNode {\n const {\n type = 'button',\n variant = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n fullWidth = false,\n children,\n leftIcon,\n rightIcon,\n loadingText = 'Loading...',\n className = '',\n style,\n id,\n role,\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaPressed,\n ariaControls,\n onPress,\n onPressStart,\n onPressEnd,\n onFocus,\n onBlur,\n onKeyDown,\n } = props\n\n // Build class names\n const classes = ['button', `button-${variant}`, `button-${size}`]\n if (fullWidth) classes.push('button-full-width')\n if (className) classes.push(className)\n\n // Build props for the button element\n const buttonProps: Record<string, any> = {\n type,\n class: classes.join(' '),\n style,\n }\n\n if (id) buttonProps.id = id\n if (role) buttonProps.role = role\n if (ariaLabel) buttonProps['aria-label'] = ariaLabel\n if (ariaDescribedby) buttonProps['aria-describedby'] = ariaDescribedby\n if (ariaExpanded !== undefined) buttonProps['aria-expanded'] = ariaExpanded\n if (ariaPressed !== undefined) buttonProps['aria-pressed'] = ariaPressed\n if (ariaControls) buttonProps['aria-controls'] = ariaControls\n\n // Add ref callback to set up reactive behavior\n buttonProps.ref = (button: HTMLButtonElement | null) => {\n if (!button) return\n\n // Convert disabled/loading to signals if needed\n const disabledSignal =\n typeof disabled === 'boolean' ? signal(disabled) : disabled\n const loadingSignal = typeof loading === 'boolean' ? signal(loading) : loading\n\n // Find content elements after mount\n const contentWrapper = button.querySelector('.button-content') as HTMLElement\n const loadingSpinner = button.querySelector('.button-spinner') as HTMLElement\n const textContent = button.querySelector('.button-text') as HTMLElement\n\n // Handle disabled state\n effect(() => {\n button.disabled = disabledSignal.value\n if (disabledSignal.value) {\n button.setAttribute('aria-disabled', 'true')\n } else {\n button.removeAttribute('aria-disabled')\n }\n })\n\n // Handle loading state\n effect(() => {\n const isLoading = loadingSignal.value\n\n if (isLoading) {\n // Show spinner\n if (loadingSpinner) loadingSpinner.style.display = 'inline-block'\n if (contentWrapper) contentWrapper.style.visibility = 'hidden'\n\n // Update text for screen readers\n if (loadingText && textContent) {\n textContent.textContent = loadingText\n }\n\n // Disable button during loading\n button.disabled = true\n button.setAttribute('aria-busy', 'true')\n } else {\n // Hide spinner\n if (loadingSpinner) loadingSpinner.style.display = 'none'\n if (contentWrapper) contentWrapper.style.visibility = 'visible'\n\n // Restore original text\n if (typeof children === 'string' && textContent) {\n textContent.textContent = children\n }\n\n button.removeAttribute('aria-busy')\n }\n })\n\n // Unified press handler (works for mouse, touch, and keyboard)\n if (onPress) {\n let isPressing = false\n\n // Pointer down (mouse/touch start)\n const handlePointerDown = (e: PointerEvent) => {\n if (button.disabled) return\n\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n onPressStart(e)\n }\n }\n\n // Pointer up (mouse/touch end)\n const handlePointerUp = (e: PointerEvent) => {\n if (!isPressing) return\n\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n onPressEnd(e)\n }\n }\n\n // Click (fires after pointer up)\n const handleClick = async (e: Event) => {\n if (button.disabled) {\n e.preventDefault()\n return\n }\n\n try {\n await onPress(e)\n } catch (error) {\n logError(ErrorCodes.BUTTON_HANDLER_FAILED, undefined, error)\n }\n }\n\n // Keyboard (Enter/Space)\n const handleKeyDown = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n // Enter or Space triggers press\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressStart(e as any)\n }\n }\n\n // Custom keydown handler\n if (onKeyDown) {\n onKeyDown(e)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressEnd(e as any)\n }\n\n // Trigger press\n handleClick(e)\n }\n }\n\n // Pointer cancel (touch interrupted)\n const handlePointerCancel = () => {\n isPressing = false\n button.classList.remove('button-pressed')\n }\n\n button.addEventListener('pointerdown', handlePointerDown)\n button.addEventListener('pointerup', handlePointerUp)\n button.addEventListener('click', handleClick)\n button.addEventListener('keydown', handleKeyDown)\n button.addEventListener('keyup', handleKeyUp)\n button.addEventListener('pointercancel', handlePointerCancel)\n\n onCleanup(() => {\n button.removeEventListener('pointerdown', handlePointerDown)\n button.removeEventListener('pointerup', handlePointerUp)\n button.removeEventListener('click', handleClick)\n button.removeEventListener('keydown', handleKeyDown)\n button.removeEventListener('keyup', handleKeyUp)\n button.removeEventListener('pointercancel', handlePointerCancel)\n })\n }\n\n // Focus/blur handlers\n if (onFocus) {\n button.addEventListener('focus', onFocus)\n onCleanup(() => button.removeEventListener('focus', onFocus))\n }\n\n if (onBlur) {\n button.addEventListener('blur', onBlur)\n onCleanup(() => button.removeEventListener('blur', onBlur))\n }\n }\n\n // Build button content structure\n const buttonChildren = [\n // Loading spinner\n f('span', {\n class: 'button-spinner',\n 'aria-hidden': 'true',\n style: { display: 'none' },\n }),\n // Content wrapper with icons and text\n f(\n 'span',\n { class: 'button-content' },\n [\n leftIcon && f('span', { class: 'button-icon button-icon-left' }, leftIcon),\n f('span', { class: 'button-text' }, children),\n rightIcon &&\n f('span', { class: 'button-icon button-icon-right' }, rightIcon),\n ].filter(Boolean)\n ),\n ]\n\n return f('button', buttonProps, buttonChildren)\n}\n\n/**\n * IconButton component - Button with only an icon\n *\n * @example\n * ```tsx\n * <IconButton icon={<i class=\"icon-close\" />} ariaLabel=\"Close\" onPress={handleClose} />\n * ```\n */\nexport function IconButton(props: ButtonProps & { icon: any }): FNode {\n const { icon, ariaLabel, className, ...buttonProps } = props\n\n if (!ariaLabel) {\n logWarning(ErrorCodes.BUTTON_MISSING_ARIA_LABEL)\n }\n\n return Button({\n ...buttonProps,\n children: icon,\n ariaLabel,\n className: `icon-button ${className || ''}`,\n })\n}\n"]}
1
+ {"version":3,"sources":["../../src/primitives/ui/Button.ts"],"names":["Button","props","type","variant","size","disabled","loading","fullWidth","children","leftIcon","rightIcon","loadingText","className","style","id","role","ariaLabel","ariaDescribedby","ariaExpanded","ariaPressed","ariaControls","onPress","onPressStart","onPressEnd","onFocus","onBlur","onKeyDown","classes","buttonProps","button","disabledSignal","SignalNode","loadingSignal","contentWrapper","loadingSpinner","textContent","effect","val","isPressing","handlePointerDown","e","handlePointerUp","handleClick","error","logError","ErrorCodes","handleKeyDown","handleKeyUp","handlePointerCancel","onCleanup","buttonChildren","f","IconButton","icon","logWarning"],"mappings":"+JAuFO,SAASA,CAAAA,CAAOC,CAAAA,CAA2B,CAChD,GAAM,CACJ,IAAA,CAAAC,CAAAA,CAAO,QAAA,CACP,OAAA,CAAAC,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,KACP,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,OAAA,CAAAC,CAAAA,CAAU,KAAA,CACV,SAAA,CAAAC,CAAAA,CAAY,MACZ,QAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,aACd,SAAA,CAAAC,GAAAA,CAAY,EAAA,CACZ,KAAA,CAAAC,CAAAA,CACA,EAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,aAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,GAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,MAAA,CAAAC,GAAAA,CACA,SAAA,CAAAC,CACF,EAAIzB,CAAAA,CAGE0B,CAAAA,CAAU,CAAC,QAAA,CAAU,UAAUxB,CAAO,CAAA,CAAA,CAAI,CAAA,OAAA,EAAUC,CAAI,CAAA,CAAE,CAAA,CAC5DG,CAAAA,EAAWoB,CAAAA,CAAQ,KAAK,mBAAmB,CAAA,CAC3Cf,GAAAA,EAAWe,CAAAA,C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AAE,KAAA,CAAO,8BAA+B,CAAA,CAAG1C,CAAQ,CAAA,CACzE0C,EAAE,MAAA,CAAQ,CAAE,KAAA,CAAO,aAAc,CAAA,CAAG3C,GAAQ,CAAA,CAC5CE,CAAAA,EACAyC,EAAE,MAAA,CAAQ,CAAE,KAAA,CAAO,+BAAgC,CAAA,CAAGzC,CAAS,CACjE,CAAA,CAAE,OAAO,OAAO,CAClB,CACF,CAAA,CAEA,OAAOyC,CAAAA,CAAE,QAAA,CAAUvB,CAAAA,CAAasB,CAAc,CAChD,CAUO,SAASE,CAAAA,CAAWnD,CAAAA,CAA2C,CACpE,GAAM,CAAE,IAAA,CAAAoD,EAAM,SAAA,CAAArC,CAAAA,CAAW,SAAA,CAAAJ,CAAAA,CAAW,GAAGgB,CAAY,CAAA,CAAI3B,CAAAA,CAEvD,OAAKe,CAAAA,EACHsC,CAAAA,CAAWT,GAAAA,CAAW,yBAAyB,CAAA,CAG1C7C,CAAAA,CAAO,CACZ,GAAG4B,EACH,QAAA,CAAUyB,CAAAA,CACV,SAAA,CAAArC,CAAAA,CACA,UAAW,CAAA,YAAA,EAAeJ,CAAAA,EAAa,EAAE,CAAA,CAC3C,CAAC,CACH","file":"ui.mjs","sourcesContent":["/**\n * Button Component - Accessible button with unified touch/click handler\n *\n * Provides onPress handler that works consistently across mouse, touch, and keyboard\n * Includes full ARIA support and style props\n */\n\nimport { SignalNode, onCleanup, type Signal } from '../../core/signal'\nimport { effect } from '../../core/effect'\nimport { ErrorCodes, logError, logWarning } from '../../core/errors'\nimport { f } from '../../renderers/dom/f'\nimport type { FNode } from '../../core/renderer'\n\n/**\n * Button variants\n */\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'danger'\n\n/**\n * Button sizes\n */\nexport type ButtonSize = 'sm' | 'md' | 'lg'\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset'\n\n/**\n * Button component props\n */\nexport interface ButtonProps {\n type?: ButtonType\n variant?: ButtonVariant\n size?: ButtonSize\n disabled?: Signal<boolean> | SignalNode<boolean> | boolean\n loading?: Signal<boolean> | SignalNode<boolean> | boolean\n fullWidth?: boolean\n\n // Content\n children?: any\n leftIcon?: any\n rightIcon?: any\n loadingText?: string\n\n // Styling\n className?: string\n style?: Partial<CSSStyleDeclaration>\n\n // Accessibility\n id?: string\n role?: string\n ariaLabel?: string\n ariaDescribedby?: string\n ariaExpanded?: boolean\n ariaPressed?: boolean\n ariaControls?: string\n\n // Event handlers\n onPress?: (event: Event) => void | Promise<void>\n onPressStart?: (event: PointerEvent) => void\n onPressEnd?: (event: PointerEvent) => void\n onFocus?: (event: FocusEvent) => void\n onBlur?: (event: FocusEvent) => void\n onKeyDown?: (event: KeyboardEvent) => void\n}\n\n/**\n * Button component - Accessible button with unified touch/click handler\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" onPress={() => console.log('clicked')}>\n * Click me\n * </Button>\n *\n * const loading = signal(false)\n * <Button loading={loading} loadingText=\"Saving...\">\n * Save\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps): FNode {\n const {\n type = 'button',\n variant = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n fullWidth = false,\n children,\n leftIcon,\n rightIcon,\n loadingText = 'Loading...',\n className = '',\n style,\n id,\n role,\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaPressed,\n ariaControls,\n onPress,\n onPressStart,\n onPressEnd,\n onFocus,\n onBlur,\n onKeyDown,\n } = props\n\n // Build class names\n const classes = ['button', `button-${variant}`, `button-${size}`]\n if (fullWidth) classes.push('button-full-width')\n if (className) classes.push(className)\n\n // Build props for the button element\n const buttonProps: Record<string, any> = {\n type,\n class: classes.join(' '),\n style,\n }\n\n if (id) buttonProps.id = id\n if (role) buttonProps.role = role\n if (ariaLabel) buttonProps['aria-label'] = ariaLabel\n if (ariaDescribedby) buttonProps['aria-describedby'] = ariaDescribedby\n if (ariaExpanded !== undefined) buttonProps['aria-expanded'] = ariaExpanded\n if (ariaPressed !== undefined) buttonProps['aria-pressed'] = ariaPressed\n if (ariaControls) buttonProps['aria-controls'] = ariaControls\n\n // Add ref callback to set up reactive behavior\n buttonProps.ref = (button: HTMLButtonElement | null) => {\n if (!button) return\n\n // Convert disabled/loading to signals if needed\n // Safety: we normalize to an object with .value property (both Signal and SignalNode have it now)\n const disabledSignal =\n typeof disabled === 'boolean' ? new SignalNode(disabled) : disabled\n const loadingSignal = typeof loading === 'boolean' ? new SignalNode(loading) : loading\n\n // Find content elements after mount\n const contentWrapper = button.querySelector('.button-content') as HTMLElement\n const loadingSpinner = button.querySelector('.button-spinner') as HTMLElement\n const textContent = button.querySelector('.button-text') as HTMLElement\n\n // Handle disabled state\n effect(() => {\n const val = disabledSignal.value // Works for SignalNode and Signal(Proxy)\n button.disabled = val\n if (val) {\n button.setAttribute('aria-disabled', 'true')\n } else {\n button.removeAttribute('aria-disabled')\n }\n })\n\n // Handle loading state\n effect(() => {\n const isLoading = loadingSignal.value\n\n if (isLoading) {\n // Show spinner\n if (loadingSpinner) loadingSpinner.style.display = 'inline-block'\n if (contentWrapper) contentWrapper.style.visibility = 'hidden'\n\n // Update text for screen readers\n if (loadingText && textContent) {\n textContent.textContent = loadingText\n }\n\n // Disable button during loading\n button.disabled = true\n button.setAttribute('aria-busy', 'true')\n } else {\n // Hide spinner\n if (loadingSpinner) loadingSpinner.style.display = 'none'\n if (contentWrapper) contentWrapper.style.visibility = 'visible'\n\n // Restore original text\n if (typeof children === 'string' && textContent) {\n textContent.textContent = children\n }\n\n button.removeAttribute('aria-busy')\n }\n })\n\n // Unified press handler (works for mouse, touch, and keyboard)\n if (onPress) {\n let isPressing = false\n\n // Pointer down (mouse/touch start)\n const handlePointerDown = (e: PointerEvent) => {\n if (button.disabled) return\n\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n onPressStart(e)\n }\n }\n\n // Pointer up (mouse/touch end)\n const handlePointerUp = (e: PointerEvent) => {\n if (!isPressing) return\n\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n onPressEnd(e)\n }\n }\n\n // Click (fires after pointer up)\n const handleClick = async (e: Event) => {\n if (button.disabled) {\n e.preventDefault()\n return\n }\n\n try {\n await onPress(e)\n } catch (error) {\n logError(ErrorCodes.BUTTON_HANDLER_FAILED, undefined, error)\n }\n }\n\n // Keyboard (Enter/Space)\n const handleKeyDown = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n // Enter or Space triggers press\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = true\n button.classList.add('button-pressed')\n\n if (onPressStart) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressStart(e as any)\n }\n }\n\n // Custom keydown handler\n if (onKeyDown) {\n onKeyDown(e)\n }\n }\n\n const handleKeyUp = (e: KeyboardEvent) => {\n if (button.disabled) return\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n isPressing = false\n button.classList.remove('button-pressed')\n\n if (onPressEnd) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onPressEnd(e as any)\n }\n\n // Trigger press\n handleClick(e)\n }\n }\n\n // Pointer cancel (touch interrupted)\n const handlePointerCancel = () => {\n isPressing = false\n button.classList.remove('button-pressed')\n }\n\n button.addEventListener('pointerdown', handlePointerDown)\n button.addEventListener('pointerup', handlePointerUp)\n button.addEventListener('click', handleClick)\n button.addEventListener('keydown', handleKeyDown)\n button.addEventListener('keyup', handleKeyUp)\n button.addEventListener('pointercancel', handlePointerCancel)\n\n onCleanup(() => {\n button.removeEventListener('pointerdown', handlePointerDown)\n button.removeEventListener('pointerup', handlePointerUp)\n button.removeEventListener('click', handleClick)\n button.removeEventListener('keydown', handleKeyDown)\n button.removeEventListener('keyup', handleKeyUp)\n button.removeEventListener('pointercancel', handlePointerCancel)\n })\n }\n\n // Focus/blur handlers\n if (onFocus) {\n button.addEventListener('focus', onFocus)\n onCleanup(() => button.removeEventListener('focus', onFocus))\n }\n\n if (onBlur) {\n button.addEventListener('blur', onBlur)\n onCleanup(() => button.removeEventListener('blur', onBlur))\n }\n }\n\n // Build button content structure\n const buttonChildren = [\n // Loading spinner\n f('span', {\n class: 'button-spinner',\n 'aria-hidden': 'true',\n style: { display: 'none' },\n }),\n // Content wrapper with icons and text\n f(\n 'span',\n { class: 'button-content' },\n [\n leftIcon && f('span', { class: 'button-icon button-icon-left' }, leftIcon),\n f('span', { class: 'button-text' }, children),\n rightIcon &&\n f('span', { class: 'button-icon button-icon-right' }, rightIcon),\n ].filter(Boolean)\n ),\n ]\n\n return f('button', buttonProps, buttonChildren)\n}\n\n/**\n * IconButton component - Button with only an icon\n *\n * @example\n * ```tsx\n * <IconButton icon={<i class=\"icon-close\" />} ariaLabel=\"Close\" onPress={handleClose} />\n * ```\n */\nexport function IconButton(props: ButtonProps & { icon: any }): FNode {\n const { icon, ariaLabel, className, ...buttonProps } = props\n\n if (!ariaLabel) {\n logWarning(ErrorCodes.BUTTON_MISSING_ARIA_LABEL)\n }\n\n return Button({\n ...buttonProps,\n children: icon,\n ariaLabel,\n className: `icon-button ${className || ''}`,\n })\n}\n"]}
@@ -1,11 +1,11 @@
1
- export { e as effect } from './effect-BlnnM1t5.cjs';
1
+ export { e as effect } from './effect-14CxUU8r.cjs';
2
2
  export { r as root } from './owner-QS9tPwPr.cjs';
3
3
  export { state } from './core.cjs';
4
4
  export { CommonStyle as BaseStyleProps, Column, ColumnProps, CommonStyle, Grid, GridProps, Row, RowProps, Spacer, SpacerProps, Stack, StackProps } from './primitives/layout.cjs';
5
- import { T as TextProps, F as FNode, I as ImageProps, P as PressableProps, S as ScrollViewProps, m as CommonStyle, n as TextStyle } from './DrawText-CJikXQjL.cjs';
6
- export { C as Canvas, f as CanvasProps, b as DrawArc, i as DrawArcProps, a as DrawCircle, h as DrawCircleProps, c as DrawLine, j as DrawLineProps, d as DrawPath, k as DrawPathProps, D as DrawRect, g as DrawRectProps, e as DrawText, l as DrawTextProps } from './DrawText-CJikXQjL.cjs';
5
+ import { T as TextProps, F as FNode, I as ImageProps, P as PressableProps, S as ScrollViewProps, m as CommonStyle, n as TextStyle } from './DrawText-ccZrs3Xs.cjs';
6
+ export { C as Canvas, f as CanvasProps, b as DrawArc, i as DrawArcProps, a as DrawCircle, h as DrawCircleProps, c as DrawLine, j as DrawLineProps, d as DrawPath, k as DrawPathProps, D as DrawRect, g as DrawRectProps, e as DrawText, l as DrawTextProps } from './DrawText-ccZrs3Xs.cjs';
7
7
  import './renderer-DSLb-FGg.cjs';
8
- import './signal-Dxh9PsKr.cjs';
8
+ import './signal-C6936A3J.cjs';
9
9
 
10
10
  /**
11
11
  * Text - Universal text display component
@@ -1,11 +1,11 @@
1
- export { e as effect } from './effect-BlnnM1t5.js';
1
+ export { e as effect } from './effect-14CxUU8r.js';
2
2
  export { r as root } from './owner-QS9tPwPr.js';
3
3
  export { state } from './core.js';
4
4
  export { CommonStyle as BaseStyleProps, Column, ColumnProps, CommonStyle, Grid, GridProps, Row, RowProps, Spacer, SpacerProps, Stack, StackProps } from './primitives/layout.js';
5
- import { T as TextProps, F as FNode, I as ImageProps, P as PressableProps, S as ScrollViewProps, m as CommonStyle, n as TextStyle } from './DrawText-Bvzl40Vi.js';
6
- export { C as Canvas, f as CanvasProps, b as DrawArc, i as DrawArcProps, a as DrawCircle, h as DrawCircleProps, c as DrawLine, j as DrawLineProps, d as DrawPath, k as DrawPathProps, D as DrawRect, g as DrawRectProps, e as DrawText, l as DrawTextProps } from './DrawText-Bvzl40Vi.js';
5
+ import { T as TextProps, F as FNode, I as ImageProps, P as PressableProps, S as ScrollViewProps, m as CommonStyle, n as TextStyle } from './DrawText-ngwNNh8O.js';
6
+ export { C as Canvas, f as CanvasProps, b as DrawArc, i as DrawArcProps, a as DrawCircle, h as DrawCircleProps, c as DrawLine, j as DrawLineProps, d as DrawPath, k as DrawPathProps, D as DrawRect, g as DrawRectProps, e as DrawText, l as DrawTextProps } from './DrawText-ngwNNh8O.js';
7
7
  import './renderer-DSLb-FGg.js';
8
- import './signal-Dxh9PsKr.js';
8
+ import './signal-C6936A3J.js';
9
9
 
10
10
  /**
11
11
  * Text - Universal text display component
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk3P6DMEGB_js=require('./chunk-3P6DMEGB.js'),chunkRDA77IE6_js=require('./chunk-RDA77IE6.js'),chunkL4C5UBOX_js=require('./chunk-L4C5UBOX.js');require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js');var chunkYGMMJWAA_js=require('./chunk-YGMMJWAA.js');function A(p){let{children:r,style:a,onPress:e,class:s,...o}=p;return {type:"span",props:{...o,class:s,style:chunkL4C5UBOX_js.a(a),onclick:e},children:Array.isArray(r)?r:r?[r]:[]}}function N(p){let{src:r,alt:a,width:e,height:s,style:o,onLoad:n,onError:i,...l}=p,m={...o,width:e||o?.width,height:s||o?.height};return {type:"img",props:{...l,src:r,alt:a||"",style:chunkL4C5UBOX_js.a(m),onload:n,onerror:i},children:[]}}function T(p){let{children:r,onPress:a,onPressIn:e,onPressOut:s,disabled:o,style:n,activeOpacity:i=.7,...l}=p,m={...n,cursor:o?"not-allowed":"pointer",opacity:o?.5:n?.opacity,border:"none",background:"none",padding:0};return {type:"button",props:{...l,disabled:o,style:chunkL4C5UBOX_js.a(m),onclick:o?void 0:a,onmousedown:e,onmouseup:s,ontouchstart:e,ontouchend:s},children:Array.isArray(r)?r:r?[r]:[]}}function F(p){let{children:r,style:a,horizontal:e=false,showScrollbarX:s=true,showScrollbarY:o=true,...n}=p,i={...a,overflowX:e?"auto":"hidden",overflowY:e?"hidden":"auto",display:"flex",flexDirection:e?"row":"column"};return (!s||!o)&&(i.scrollbarWidth="none"),{type:"div",props:{...n,style:chunkL4C5UBOX_js.a(i)},children:Array.isArray(r)?r:r?[r]:[]}}Object.defineProperty(exports,"Column",{enumerable:true,get:function(){return chunk3P6DMEGB_js.h}});Object.defineProperty(exports,"Grid",{enumerable:true,get:function(){return chunk3P6DMEGB_js.j}});Object.defineProperty(exports,"Row",{enumerable:true,get:function(){return chunk3P6DMEGB_js.g}});Object.defineProperty(exports,"Spacer",{enumerable:true,get:function(){return chunk3P6DMEGB_js.i}});Object.defineProperty(exports,"Stack",{enumerable:true,get:function(){return chunk3P6DMEGB_js.k}});Object.defineProperty(exports,"state",{enumerable:true,get:function(){return chunkRDA77IE6_js.h}});Object.defineProperty(exports,"Canvas",{enumerable:true,get:function(){return chunkL4C5UBOX_js.d}});Object.defineProperty(exports,"DrawArc",{enumerable:true,get:function(){return chunkL4C5UBOX_js.g}});Object.defineProperty(exports,"DrawCircle",{enumerable:true,get:function(){return chunkL4C5UBOX_js.f}});Object.defineProperty(exports,"DrawLine",{enumerable:true,get:function(){return chunkL4C5UBOX_js.h}});Object.defineProperty(exports,"DrawPath",{enumerable:true,get:function(){return chunkL4C5UBOX_js.i}});Object.defineProperty(exports,"DrawRect",{enumerable:true,get:function(){return chunkL4C5UBOX_js.e}});Object.defineProperty(exports,"DrawText",{enumerable:true,get:function(){return chunkL4C5UBOX_js.j}});Object.defineProperty(exports,"normalizeStyle",{enumerable:true,get:function(){return chunkL4C5UBOX_js.a}});Object.defineProperty(exports,"effect",{enumerable:true,get:function(){return chunkYGMMJWAA_js.h}});Object.defineProperty(exports,"root",{enumerable:true,get:function(){return chunkYGMMJWAA_js.f}});exports.Image=N;exports.Pressable=T;exports.ScrollView=F;exports.Text=A;//# sourceMappingURL=primitives.js.map
1
+ 'use strict';var chunkYDZ37ZZ4_js=require('./chunk-YDZ37ZZ4.js'),chunk3AWR7IKE_js=require('./chunk-3AWR7IKE.js'),chunkWOHSSPKD_js=require('./chunk-WOHSSPKD.js');require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js'),require('./chunk-5236IK5I.js');var chunkAJT35P3Z_js=require('./chunk-AJT35P3Z.js');function A(s){let{children:r,style:a,onPress:e,class:p,...o}=s;return {type:"span",props:{...o,class:p,style:chunkWOHSSPKD_js.a(a),onclick:e},children:Array.isArray(r)?r:r?[r]:[]}}function N(s){let{src:r,alt:a,width:e,height:p,style:o,onLoad:n,onError:i,...l}=s,m={...o,width:e||o?.width,height:p||o?.height};return {type:"img",props:{...l,src:r,alt:a||"",style:chunkWOHSSPKD_js.a(m),onload:n,onerror:i},children:[]}}function T(s){let{children:r,onPress:a,onPressIn:e,onPressOut:p,disabled:o,style:n,activeOpacity:i=.7,...l}=s,m={...n,cursor:o?"not-allowed":"pointer",opacity:o?.5:n?.opacity,border:"none",background:"none",padding:0};return {type:"button",props:{...l,disabled:o,style:chunkWOHSSPKD_js.a(m),onclick:o?void 0:a,onmousedown:e,onmouseup:p,ontouchstart:e,ontouchend:p},children:Array.isArray(r)?r:r?[r]:[]}}function F(s){let{children:r,style:a,horizontal:e=false,showScrollbarX:p=true,showScrollbarY:o=true,...n}=s,i={...a,overflowX:e?"auto":"hidden",overflowY:e?"hidden":"auto",display:"flex",flexDirection:e?"row":"column"};return (!p||!o)&&(i.scrollbarWidth="none"),{type:"div",props:{...n,style:chunkWOHSSPKD_js.a(i)},children:Array.isArray(r)?r:r?[r]:[]}}Object.defineProperty(exports,"Column",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.h}});Object.defineProperty(exports,"Grid",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.j}});Object.defineProperty(exports,"Row",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.g}});Object.defineProperty(exports,"Spacer",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.i}});Object.defineProperty(exports,"Stack",{enumerable:true,get:function(){return chunkYDZ37ZZ4_js.k}});Object.defineProperty(exports,"state",{enumerable:true,get:function(){return chunk3AWR7IKE_js.h}});Object.defineProperty(exports,"Canvas",{enumerable:true,get:function(){return chunkWOHSSPKD_js.d}});Object.defineProperty(exports,"DrawArc",{enumerable:true,get:function(){return chunkWOHSSPKD_js.g}});Object.defineProperty(exports,"DrawCircle",{enumerable:true,get:function(){return chunkWOHSSPKD_js.f}});Object.defineProperty(exports,"DrawLine",{enumerable:true,get:function(){return chunkWOHSSPKD_js.h}});Object.defineProperty(exports,"DrawPath",{enumerable:true,get:function(){return chunkWOHSSPKD_js.i}});Object.defineProperty(exports,"DrawRect",{enumerable:true,get:function(){return chunkWOHSSPKD_js.e}});Object.defineProperty(exports,"DrawText",{enumerable:true,get:function(){return chunkWOHSSPKD_js.j}});Object.defineProperty(exports,"normalizeStyle",{enumerable:true,get:function(){return chunkWOHSSPKD_js.a}});Object.defineProperty(exports,"effect",{enumerable:true,get:function(){return chunkAJT35P3Z_js.k}});Object.defineProperty(exports,"root",{enumerable:true,get:function(){return chunkAJT35P3Z_js.i}});exports.Image=N;exports.Pressable=T;exports.ScrollView=F;exports.Text=A;//# sourceMappingURL=primitives.js.map
2
2
  //# sourceMappingURL=primitives.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/primitives/Text.ts","../src/primitives/Image.ts","../src/primitives/Pressable.ts","../src/primitives/ScrollView.ts"],"names":["Text","props","children","style","onPress","className","rest","normalizeStyle","Image","src","alt","width","height","onLoad","onError","imageStyle","Pressable","onPressIn","onPressOut","disabled","_activeOpacity","buttonStyle","ScrollView","horizontal","showScrollbarX","showScrollbarY","scrollStyle"],"mappings":"mRAmBO,SAASA,CAAAA,CAAKC,CAAAA,CAAyB,CAC5C,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAC,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAOC,EAAW,GAAGC,CAAK,CAAA,CAAIL,CAAAA,CAEhE,OAAO,CACL,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,CACL,GAAGK,CAAAA,CACH,KAAA,CAAOD,CAAAA,CACP,KAAA,CAAOE,kBAAAA,CAAeJ,CAAK,CAAA,CAC3B,OAAA,CAASC,CACX,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQF,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,E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n *\n * Maps to:\n * - Web: <span>\n * - React Native: <Text>\n *\n * @example\n * ```tsx\n * <Text style={{ color: 'blue', fontSize: 16 }}>\n * Hello World\n * </Text>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { TextProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Text(props: TextProps): FNode {\n const { children, style, onPress, class: className, ...rest } = props\n\n return {\n type: 'span',\n props: {\n ...rest,\n class: className,\n style: normalizeStyle(style),\n onclick: onPress,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * Image - Universal image component\n *\n * Maps to:\n * - Web: <img>\n * - React Native: <Image>\n *\n * @example\n * ```tsx\n * <Image\n * src=\"/logo.png\"\n * alt=\"Logo\"\n * width={100}\n * height={100}\n * />\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ImageProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Image(props: ImageProps): FNode {\n const { src, alt, width, height, style, onLoad, onError, ...rest } = props\n\n const imageStyle = {\n ...style,\n width: width || style?.width,\n height: height || style?.height,\n }\n\n return {\n type: 'img',\n props: {\n ...rest,\n src,\n alt: alt || '',\n style: normalizeStyle(imageStyle),\n onload: onLoad,\n onerror: onError,\n },\n children: [],\n }\n}\n","/**\n * Pressable - Universal touchable/clickable component\n *\n * Maps to:\n * - Web: <button>\n * - React Native: <Pressable>\n *\n * @example\n * ```tsx\n * <Pressable\n * onPress={() => console.log('pressed')}\n * style={{ padding: 10 }}\n * >\n * <Text>Click Me</Text>\n * </Pressable>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { PressableProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Pressable(props: PressableProps): FNode {\n const {\n children,\n onPress,\n onPressIn,\n onPressOut,\n disabled,\n style,\n activeOpacity: _activeOpacity = 0.7,\n ...rest\n } = props\n\n const buttonStyle = {\n ...style,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : style?.opacity,\n border: 'none',\n background: 'none',\n padding: 0,\n }\n\n return {\n type: 'button',\n props: {\n ...rest,\n disabled,\n style: normalizeStyle(buttonStyle),\n onclick: disabled ? undefined : onPress,\n onmousedown: onPressIn,\n onmouseup: onPressOut,\n ontouchstart: onPressIn,\n ontouchend: onPressOut,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * ScrollView - Universal scrollable container\n *\n * Maps to:\n * - Web: <div style=\"overflow: scroll\">\n * - React Native: <ScrollView>\n *\n * @example\n * ```tsx\n * <ScrollView style={{ height: 300 }}>\n * <Column>...</Column>\n * <Column>...</Column>\n * </ScrollView>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ScrollViewProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function ScrollView(props: ScrollViewProps): FNode {\n const {\n children,\n style,\n horizontal = false,\n showScrollbarX = true,\n showScrollbarY = true,\n ...rest\n } = props\n\n const scrollStyle: Record<string, unknown> = {\n ...style,\n overflowX: horizontal ? 'auto' : 'hidden',\n overflowY: horizontal ? 'hidden' : 'auto',\n display: 'flex',\n flexDirection: horizontal ? 'row' : 'column',\n }\n\n // Hide scrollbars if requested (CSS scrollbar-width for Firefox/modern browsers)\n if (!showScrollbarX || !showScrollbarY) {\n scrollStyle.scrollbarWidth = 'none'\n }\n\n return {\n type: 'div',\n props: {\n ...rest,\n style: normalizeStyle(scrollStyle as Parameters<typeof normalizeStyle>[0]),\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/primitives/Text.ts","../src/primitives/Image.ts","../src/primitives/Pressable.ts","../src/primitives/ScrollView.ts"],"names":["Text","props","children","style","onPress","className","rest","normalizeStyle","Image","src","alt","width","height","onLoad","onError","imageStyle","Pressable","onPressIn","onPressOut","disabled","_activeOpacity","buttonStyle","ScrollView","horizontal","showScrollbarX","showScrollbarY","scrollStyle"],"mappings":"kTAmBO,SAASA,CAAAA,CAAKC,CAAAA,CAAyB,CAC5C,GAA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AA,CACT,aAAA,CAAeA,EAAa,KAAA,CAAQ,QACtC,CAAA,CAGA,OAAA,CAAI,CAACC,CAAAA,EAAkB,CAACC,CAAAA,IACtBC,CAAAA,CAAY,cAAA,CAAiB,MAAA,CAAA,CAGxB,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,KAAA,CAAOC,kBAAAA,CAAemB,CAAmD,CAC3E,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,QAAQxB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF","file":"primitives.js","sourcesContent":["/**\n * Text - Universal text display component\n *\n * Maps to:\n * - Web: <span>\n * - React Native: <Text>\n *\n * @example\n * ```tsx\n * <Text style={{ color: 'blue', fontSize: 16 }}>\n * Hello World\n * </Text>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { TextProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Text(props: TextProps): FNode {\n const { children, style, onPress, class: className, ...rest } = props\n\n return {\n type: 'span',\n props: {\n ...rest,\n class: className,\n style: normalizeStyle(style),\n onclick: onPress,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * Image - Universal image component\n *\n * Maps to:\n * - Web: <img>\n * - React Native: <Image>\n *\n * @example\n * ```tsx\n * <Image\n * src=\"/logo.png\"\n * alt=\"Logo\"\n * width={100}\n * height={100}\n * />\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ImageProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Image(props: ImageProps): FNode {\n const { src, alt, width, height, style, onLoad, onError, ...rest } = props\n\n const imageStyle = {\n ...style,\n width: width || style?.width,\n height: height || style?.height,\n }\n\n return {\n type: 'img',\n props: {\n ...rest,\n src,\n alt: alt || '',\n style: normalizeStyle(imageStyle),\n onload: onLoad,\n onerror: onError,\n },\n children: [],\n }\n}\n","/**\n * Pressable - Universal touchable/clickable component\n *\n * Maps to:\n * - Web: <button>\n * - React Native: <Pressable>\n *\n * @example\n * ```tsx\n * <Pressable\n * onPress={() => console.log('pressed')}\n * style={{ padding: 10 }}\n * >\n * <Text>Click Me</Text>\n * </Pressable>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { PressableProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Pressable(props: PressableProps): FNode {\n const {\n children,\n onPress,\n onPressIn,\n onPressOut,\n disabled,\n style,\n activeOpacity: _activeOpacity = 0.7,\n ...rest\n } = props\n\n const buttonStyle = {\n ...style,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : style?.opacity,\n border: 'none',\n background: 'none',\n padding: 0,\n }\n\n return {\n type: 'button',\n props: {\n ...rest,\n disabled,\n style: normalizeStyle(buttonStyle),\n onclick: disabled ? undefined : onPress,\n onmousedown: onPressIn,\n onmouseup: onPressOut,\n ontouchstart: onPressIn,\n ontouchend: onPressOut,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * ScrollView - Universal scrollable container\n *\n * Maps to:\n * - Web: <div style=\"overflow: scroll\">\n * - React Native: <ScrollView>\n *\n * @example\n * ```tsx\n * <ScrollView style={{ height: 300 }}>\n * <Column>...</Column>\n * <Column>...</Column>\n * </ScrollView>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ScrollViewProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function ScrollView(props: ScrollViewProps): FNode {\n const {\n children,\n style,\n horizontal = false,\n showScrollbarX = true,\n showScrollbarY = true,\n ...rest\n } = props\n\n const scrollStyle: Record<string, unknown> = {\n ...style,\n overflowX: horizontal ? 'auto' : 'hidden',\n overflowY: horizontal ? 'hidden' : 'auto',\n display: 'flex',\n flexDirection: horizontal ? 'row' : 'column',\n }\n\n // Hide scrollbars if requested (CSS scrollbar-width for Firefox/modern browsers)\n if (!showScrollbarX || !showScrollbarY) {\n scrollStyle.scrollbarWidth = 'none'\n }\n\n return {\n type: 'div',\n props: {\n ...rest,\n style: normalizeStyle(scrollStyle as Parameters<typeof normalizeStyle>[0]),\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export{h as Column,j as Grid,g as Row,i as Spacer,k as Stack}from'./chunk-R5CS7UZG.mjs';export{h as state}from'./chunk-2ZHUQBNI.mjs';import {a}from'./chunk-HDCPA76O.mjs';export{d as Canvas,g as DrawArc,f as DrawCircle,h as DrawLine,i as DrawPath,e as DrawRect,j as DrawText,a as normalizeStyle}from'./chunk-HDCPA76O.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';export{h as effect,f as root}from'./chunk-J4CK5NRW.mjs';function A(p){let{children:r,style:a$1,onPress:e,class:s,...o}=p;return {type:"span",props:{...o,class:s,style:a(a$1),onclick:e},children:Array.isArray(r)?r:r?[r]:[]}}function N(p){let{src:r,alt:a$1,width:e,height:s,style:o,onLoad:n,onError:i,...l}=p,m={...o,width:e||o?.width,height:s||o?.height};return {type:"img",props:{...l,src:r,alt:a$1||"",style:a(m),onload:n,onerror:i},children:[]}}function T(p){let{children:r,onPress:a$1,onPressIn:e,onPressOut:s,disabled:o,style:n,activeOpacity:i=.7,...l}=p,m={...n,cursor:o?"not-allowed":"pointer",opacity:o?.5:n?.opacity,border:"none",background:"none",padding:0};return {type:"button",props:{...l,disabled:o,style:a(m),onclick:o?void 0:a$1,onmousedown:e,onmouseup:s,ontouchstart:e,ontouchend:s},children:Array.isArray(r)?r:r?[r]:[]}}function F(p){let{children:r,style:a$1,horizontal:e=false,showScrollbarX:s=true,showScrollbarY:o=true,...n}=p,i={...a$1,overflowX:e?"auto":"hidden",overflowY:e?"hidden":"auto",display:"flex",flexDirection:e?"row":"column"};return (!s||!o)&&(i.scrollbarWidth="none"),{type:"div",props:{...n,style:a(i)},children:Array.isArray(r)?r:r?[r]:[]}}export{N as Image,T as Pressable,F as ScrollView,A as Text};//# sourceMappingURL=primitives.mjs.map
1
+ export{h as Column,j as Grid,g as Row,i as Spacer,k as Stack}from'./chunk-BYHIHYRR.mjs';export{h as state}from'./chunk-7Q4UE442.mjs';import {a}from'./chunk-KJPIJNFH.mjs';export{d as Canvas,g as DrawArc,f as DrawCircle,h as DrawLine,i as DrawPath,e as DrawRect,j as DrawText,a as normalizeStyle}from'./chunk-KJPIJNFH.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';import'./chunk-B7VP6HBY.mjs';export{k as effect,i as root}from'./chunk-Q7WT5IIF.mjs';function A(s){let{children:r,style:a$1,onPress:e,class:p,...o}=s;return {type:"span",props:{...o,class:p,style:a(a$1),onclick:e},children:Array.isArray(r)?r:r?[r]:[]}}function N(s){let{src:r,alt:a$1,width:e,height:p,style:o,onLoad:n,onError:i,...l}=s,m={...o,width:e||o?.width,height:p||o?.height};return {type:"img",props:{...l,src:r,alt:a$1||"",style:a(m),onload:n,onerror:i},children:[]}}function T(s){let{children:r,onPress:a$1,onPressIn:e,onPressOut:p,disabled:o,style:n,activeOpacity:i=.7,...l}=s,m={...n,cursor:o?"not-allowed":"pointer",opacity:o?.5:n?.opacity,border:"none",background:"none",padding:0};return {type:"button",props:{...l,disabled:o,style:a(m),onclick:o?void 0:a$1,onmousedown:e,onmouseup:p,ontouchstart:e,ontouchend:p},children:Array.isArray(r)?r:r?[r]:[]}}function F(s){let{children:r,style:a$1,horizontal:e=false,showScrollbarX:p=true,showScrollbarY:o=true,...n}=s,i={...a$1,overflowX:e?"auto":"hidden",overflowY:e?"hidden":"auto",display:"flex",flexDirection:e?"row":"column"};return (!p||!o)&&(i.scrollbarWidth="none"),{type:"div",props:{...n,style:a(i)},children:Array.isArray(r)?r:r?[r]:[]}}export{N as Image,T as Pressable,F as ScrollView,A as Text};//# sourceMappingURL=primitives.mjs.map
2
2
  //# sourceMappingURL=primitives.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/primitives/Text.ts","../src/primitives/Image.ts","../src/primitives/Pressable.ts","../src/primitives/ScrollView.ts"],"names":["Text","props","children","style","onPress","className","rest","normalizeStyle","Image","src","alt","width","height","onLoad","onError","imageStyle","Pressable","onPressIn","onPressOut","disabled","_activeOpacity","buttonStyle","ScrollView","horizontal","showScrollbarX","showScrollbarY","scrollStyle"],"mappings":"mbAmBO,SAASA,CAAAA,CAAKC,CAAAA,CAAyB,CAC5C,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAC,GAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAOC,EAAW,GAAGC,CAAK,CAAA,CAAIL,CAAAA,CAEhE,OAAO,CACL,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,CACL,GAAGK,CAAAA,CACH,KAAA,CAAOD,CAAAA,CACP,KAAA,CAAOE,CAAAA,CAAeJ,GAAK,CAAA,CAC3B,OAAA,CAASC,CACX,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQF,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF,CCVO,SAASM,CAAAA,CAAMP,CAAAA,CAA0B,CAC9C,GAAM,CAAE,GAAA,CAAAQ,EAAK,GAAA,CAAAC,GAAAA,CAAK,KAAA,CAAAC,CAAAA,CAAO,MAAA,CAAAC,CAAAA,CAAQ,KAAA,CAAAT,CAAAA,CAAO,OAAAU,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,GAAGR,CAAK,CAAA,CAAIL,CAAAA,CAE/Dc,CAAAA,CAAa,CACjB,GAAGZ,CAAAA,CACH,KAAA,CAAOQ,CAAAA,EAASR,CAAAA,EAAO,KAAA,CACvB,MAAA,CAAQS,GAAUT,CAAAA,EAAO,MAC3B,CAAA,CAEA,OAAO,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGG,CAAAA,CACH,GAAA,CAAAG,CAAAA,CACA,GAAA,CAAKC,G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CAAiB,IAAA,CACjB,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,GAAGnB,CACL,EAAIL,CAAAA,CAEEyB,CAAAA,CAAuC,CAC3C,GAAGvB,GAAAA,CACH,SAAA,CAAWoB,CAAAA,CAAa,MAAA,CAAS,QAAA,CACjC,SAAA,CAAWA,CAAAA,CAAa,QAAA,CAAW,MAAA,CACnC,OAAA,CAAS,MAAA,CACT,aAAA,CAAeA,EAAa,KAAA,CAAQ,QACtC,CAAA,CAGA,OAAA,CAAI,CAACC,CAAAA,EAAkB,CAACC,CAAAA,IACtBC,CAAAA,CAAY,cAAA,CAAiB,MAAA,CAAA,CAGxB,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,KAAA,CAAOC,CAAAA,CAAemB,CAAmD,CAC3E,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,QAAQxB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF","file":"primitives.mjs","sourcesContent":["/**\n * Text - Universal text display component\n *\n * Maps to:\n * - Web: <span>\n * - React Native: <Text>\n *\n * @example\n * ```tsx\n * <Text style={{ color: 'blue', fontSize: 16 }}>\n * Hello World\n * </Text>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { TextProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Text(props: TextProps): FNode {\n const { children, style, onPress, class: className, ...rest } = props\n\n return {\n type: 'span',\n props: {\n ...rest,\n class: className,\n style: normalizeStyle(style),\n onclick: onPress,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * Image - Universal image component\n *\n * Maps to:\n * - Web: <img>\n * - React Native: <Image>\n *\n * @example\n * ```tsx\n * <Image\n * src=\"/logo.png\"\n * alt=\"Logo\"\n * width={100}\n * height={100}\n * />\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ImageProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Image(props: ImageProps): FNode {\n const { src, alt, width, height, style, onLoad, onError, ...rest } = props\n\n const imageStyle = {\n ...style,\n width: width || style?.width,\n height: height || style?.height,\n }\n\n return {\n type: 'img',\n props: {\n ...rest,\n src,\n alt: alt || '',\n style: normalizeStyle(imageStyle),\n onload: onLoad,\n onerror: onError,\n },\n children: [],\n }\n}\n","/**\n * Pressable - Universal touchable/clickable component\n *\n * Maps to:\n * - Web: <button>\n * - React Native: <Pressable>\n *\n * @example\n * ```tsx\n * <Pressable\n * onPress={() => console.log('pressed')}\n * style={{ padding: 10 }}\n * >\n * <Text>Click Me</Text>\n * </Pressable>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { PressableProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Pressable(props: PressableProps): FNode {\n const {\n children,\n onPress,\n onPressIn,\n onPressOut,\n disabled,\n style,\n activeOpacity: _activeOpacity = 0.7,\n ...rest\n } = props\n\n const buttonStyle = {\n ...style,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : style?.opacity,\n border: 'none',\n background: 'none',\n padding: 0,\n }\n\n return {\n type: 'button',\n props: {\n ...rest,\n disabled,\n style: normalizeStyle(buttonStyle),\n onclick: disabled ? undefined : onPress,\n onmousedown: onPressIn,\n onmouseup: onPressOut,\n ontouchstart: onPressIn,\n ontouchend: onPressOut,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * ScrollView - Universal scrollable container\n *\n * Maps to:\n * - Web: <div style=\"overflow: scroll\">\n * - React Native: <ScrollView>\n *\n * @example\n * ```tsx\n * <ScrollView style={{ height: 300 }}>\n * <Column>...</Column>\n * <Column>...</Column>\n * </ScrollView>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ScrollViewProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function ScrollView(props: ScrollViewProps): FNode {\n const {\n children,\n style,\n horizontal = false,\n showScrollbarX = true,\n showScrollbarY = true,\n ...rest\n } = props\n\n const scrollStyle: Record<string, unknown> = {\n ...style,\n overflowX: horizontal ? 'auto' : 'hidden',\n overflowY: horizontal ? 'hidden' : 'auto',\n display: 'flex',\n flexDirection: horizontal ? 'row' : 'column',\n }\n\n // Hide scrollbars if requested (CSS scrollbar-width for Firefox/modern browsers)\n if (!showScrollbarX || !showScrollbarY) {\n scrollStyle.scrollbarWidth = 'none'\n }\n\n return {\n type: 'div',\n props: {\n ...rest,\n style: normalizeStyle(scrollStyle as Parameters<typeof normalizeStyle>[0]),\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/primitives/Text.ts","../src/primitives/Image.ts","../src/primitives/Pressable.ts","../src/primitives/ScrollView.ts"],"names":["Text","props","children","style","onPress","className","rest","normalizeStyle","Image","src","alt","width","height","onLoad","onError","imageStyle","Pressable","onPressIn","onPressOut","disabled","_activeOpacity","buttonStyle","ScrollView","horizontal","showScrollbarX","showScrollbarY","scrollStyle"],"mappings":"gdAmBO,SAASA,CAAAA,CAAKC,CAAAA,CAAyB,CAC5C,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAC,GAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAOC,EAAW,GAAGC,CAAK,CAAA,CAAIL,CAAAA,CAEhE,OAAO,CACL,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,CACL,GAAGK,CAAAA,CACH,KAAA,CAAOD,CAAAA,CACP,KAAA,CAAOE,CAAAA,CAAeJ,GAAK,CAAA,CAC3B,OAAA,CAASC,CACX,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,OAAA,CAAQF,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF,CCVO,SAASM,CAAAA,CAAMP,CAAAA,CAA0B,CAC9C,GAAM,CAAE,GAAA,CAAAQ,EAAK,GAAA,CAAAC,GAAAA,CAA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F,CAAAA,CAAW,MAAA,CAAYf,GAAAA,CAChC,WAAA,CAAaa,CAAAA,CACb,SAAA,CAAWC,CAAAA,CACX,YAAA,CAAcD,CAAAA,CACd,UAAA,CAAYC,CACd,CAAA,CACA,SAAU,KAAA,CAAM,OAAA,CAAQhB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,EAAI,EACzE,CACF,CCrCO,SAASoB,CAAAA,CAAWrB,CAAAA,CAA+B,CACxD,GAAM,CACJ,QAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,UAAA,CAAAoB,CAAAA,CAAa,KAAA,CACb,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,cAAA,CAAAC,CAAAA,CAAiB,IAAA,CACjB,GAAGnB,CACL,EAAIL,CAAAA,CAEEyB,CAAAA,CAAuC,CAC3C,GAAGvB,GAAAA,CACH,SAAA,CAAWoB,CAAAA,CAAa,MAAA,CAAS,QAAA,CACjC,SAAA,CAAWA,CAAAA,CAAa,QAAA,CAAW,MAAA,CACnC,OAAA,CAAS,MAAA,CACT,aAAA,CAAeA,EAAa,KAAA,CAAQ,QACtC,CAAA,CAGA,OAAA,CAAI,CAACC,CAAAA,EAAkB,CAACC,CAAAA,IACtBC,CAAAA,CAAY,cAAA,CAAiB,MAAA,CAAA,CAGxB,CACL,IAAA,CAAM,KAAA,CACN,KAAA,CAAO,CACL,GAAGpB,CAAAA,CACH,KAAA,CAAOC,CAAAA,CAAemB,CAAmD,CAC3E,CAAA,CACA,QAAA,CAAU,KAAA,CAAM,QAAQxB,CAAQ,CAAA,CAAIA,CAAAA,CAAWA,CAAAA,CAAW,CAACA,CAAQ,CAAA,CAAI,EACzE,CACF","file":"primitives.mjs","sourcesContent":["/**\n * Text - Universal text display component\n *\n * Maps to:\n * - Web: <span>\n * - React Native: <Text>\n *\n * @example\n * ```tsx\n * <Text style={{ color: 'blue', fontSize: 16 }}>\n * Hello World\n * </Text>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { TextProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Text(props: TextProps): FNode {\n const { children, style, onPress, class: className, ...rest } = props\n\n return {\n type: 'span',\n props: {\n ...rest,\n class: className,\n style: normalizeStyle(style),\n onclick: onPress,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * Image - Universal image component\n *\n * Maps to:\n * - Web: <img>\n * - React Native: <Image>\n *\n * @example\n * ```tsx\n * <Image\n * src=\"/logo.png\"\n * alt=\"Logo\"\n * width={100}\n * height={100}\n * />\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ImageProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Image(props: ImageProps): FNode {\n const { src, alt, width, height, style, onLoad, onError, ...rest } = props\n\n const imageStyle = {\n ...style,\n width: width || style?.width,\n height: height || style?.height,\n }\n\n return {\n type: 'img',\n props: {\n ...rest,\n src,\n alt: alt || '',\n style: normalizeStyle(imageStyle),\n onload: onLoad,\n onerror: onError,\n },\n children: [],\n }\n}\n","/**\n * Pressable - Universal touchable/clickable component\n *\n * Maps to:\n * - Web: <button>\n * - React Native: <Pressable>\n *\n * @example\n * ```tsx\n * <Pressable\n * onPress={() => console.log('pressed')}\n * style={{ padding: 10 }}\n * >\n * <Text>Click Me</Text>\n * </Pressable>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { PressableProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function Pressable(props: PressableProps): FNode {\n const {\n children,\n onPress,\n onPressIn,\n onPressOut,\n disabled,\n style,\n activeOpacity: _activeOpacity = 0.7,\n ...rest\n } = props\n\n const buttonStyle = {\n ...style,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : style?.opacity,\n border: 'none',\n background: 'none',\n padding: 0,\n }\n\n return {\n type: 'button',\n props: {\n ...rest,\n disabled,\n style: normalizeStyle(buttonStyle),\n onclick: disabled ? undefined : onPress,\n onmousedown: onPressIn,\n onmouseup: onPressOut,\n ontouchstart: onPressIn,\n ontouchend: onPressOut,\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n","/**\n * ScrollView - Universal scrollable container\n *\n * Maps to:\n * - Web: <div style=\"overflow: scroll\">\n * - React Native: <ScrollView>\n *\n * @example\n * ```tsx\n * <ScrollView style={{ height: 300 }}>\n * <Column>...</Column>\n * <Column>...</Column>\n * </ScrollView>\n * ```\n */\n\nimport type { FNode } from '../types'\nimport type { ScrollViewProps } from './types'\nimport { normalizeStyle } from './utils'\n\nexport function ScrollView(props: ScrollViewProps): FNode {\n const {\n children,\n style,\n horizontal = false,\n showScrollbarX = true,\n showScrollbarY = true,\n ...rest\n } = props\n\n const scrollStyle: Record<string, unknown> = {\n ...style,\n overflowX: horizontal ? 'auto' : 'hidden',\n overflowY: horizontal ? 'hidden' : 'auto',\n display: 'flex',\n flexDirection: horizontal ? 'row' : 'column',\n }\n\n // Hide scrollbars if requested (CSS scrollbar-width for Firefox/modern browsers)\n if (!showScrollbarX || !showScrollbarY) {\n scrollStyle.scrollbarWidth = 'none'\n }\n\n return {\n type: 'div',\n props: {\n ...rest,\n style: normalizeStyle(scrollStyle as Parameters<typeof normalizeStyle>[0]),\n },\n children: Array.isArray(children) ? children : children ? [children] : [],\n }\n}\n"]}
package/dist/router.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { R as RouteDef, a as RouteMatch } from './components-DZy2r6m5.cjs';
2
- export { h as Link, d as LinkProps, L as Location, O as Outlet, g as Route, c as RouteProps, f as Router, b as RouterContext, e as createLocation, i as isUnsafePath, m as matchPath, r as router, s as sanitizeQueryValue } from './components-DZy2r6m5.cjs';
1
+ import { R as RouteDef, a as RouteMatch } from './components-CxnAnbpI.cjs';
2
+ export { h as Link, d as LinkProps, L as Location, O as Outlet, g as Route, c as RouteProps, f as Router, b as RouterContext, e as createLocation, i as isUnsafePath, m as matchPath, r as router, s as sanitizeQueryValue } from './components-CxnAnbpI.cjs';
3
3
  import { a as FNodeChild } from './renderer-DSLb-FGg.cjs';
4
- import './signal-Dxh9PsKr.cjs';
4
+ import './signal-C6936A3J.cjs';
5
5
 
6
6
  /**
7
7
  * Flatten the children of <Router> or <Route> into a route configuration tree.
package/dist/router.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { R as RouteDef, a as RouteMatch } from './components-D4WeooPi.js';
2
- export { h as Link, d as LinkProps, L as Location, O as Outlet, g as Route, c as RouteProps, f as Router, b as RouterContext, e as createLocation, i as isUnsafePath, m as matchPath, r as router, s as sanitizeQueryValue } from './components-D4WeooPi.js';
1
+ import { R as RouteDef, a as RouteMatch } from './components-B7KQ8C-i.js';
2
+ export { h as Link, d as LinkProps, L as Location, O as Outlet, g as Route, c as RouteProps, f as Router, b as RouterContext, e as createLocation, i as isUnsafePath, m as matchPath, r as router, s as sanitizeQueryValue } from './components-B7KQ8C-i.js';
3
3
  import { a as FNodeChild } from './renderer-DSLb-FGg.js';
4
- import './signal-Dxh9PsKr.js';
4
+ import './signal-C6936A3J.js';
5
5
 
6
6
  /**
7
7
  * Flatten the children of <Router> or <Route> into a route configuration tree.
package/dist/router.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkM4ANLZ6P_js=require('./chunk-M4ANLZ6P.js');require('./chunk-DFG62GKW.js'),require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js'),require('./chunk-YGMMJWAA.js');Object.defineProperty(exports,"Link",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.k}});Object.defineProperty(exports,"Outlet",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.j}});Object.defineProperty(exports,"Route",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.i}});Object.defineProperty(exports,"Router",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.h}});Object.defineProperty(exports,"createLocation",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.a}});Object.defineProperty(exports,"createRoutesFromChildren",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.e}});Object.defineProperty(exports,"isUnsafePath",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.b}});Object.defineProperty(exports,"matchPath",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.d}});Object.defineProperty(exports,"matchRoutes",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.f}});Object.defineProperty(exports,"router",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.g}});Object.defineProperty(exports,"sanitizeQueryValue",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.c}});//# sourceMappingURL=router.js.map
1
+ 'use strict';var chunkAYQMU7XC_js=require('./chunk-AYQMU7XC.js');require('./chunk-WXEHDEIH.js'),require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js'),require('./chunk-5236IK5I.js'),require('./chunk-AJT35P3Z.js');Object.defineProperty(exports,"Link",{enumerable:true,get:function(){return chunkAYQMU7XC_js.k}});Object.defineProperty(exports,"Outlet",{enumerable:true,get:function(){return chunkAYQMU7XC_js.j}});Object.defineProperty(exports,"Route",{enumerable:true,get:function(){return chunkAYQMU7XC_js.i}});Object.defineProperty(exports,"Router",{enumerable:true,get:function(){return chunkAYQMU7XC_js.h}});Object.defineProperty(exports,"createLocation",{enumerable:true,get:function(){return chunkAYQMU7XC_js.a}});Object.defineProperty(exports,"createRoutesFromChildren",{enumerable:true,get:function(){return chunkAYQMU7XC_js.e}});Object.defineProperty(exports,"isUnsafePath",{enumerable:true,get:function(){return chunkAYQMU7XC_js.b}});Object.defineProperty(exports,"matchPath",{enumerable:true,get:function(){return chunkAYQMU7XC_js.d}});Object.defineProperty(exports,"matchRoutes",{enumerable:true,get:function(){return chunkAYQMU7XC_js.f}});Object.defineProperty(exports,"router",{enumerable:true,get:function(){return chunkAYQMU7XC_js.g}});Object.defineProperty(exports,"sanitizeQueryValue",{enumerable:true,get:function(){return chunkAYQMU7XC_js.c}});//# sourceMappingURL=router.js.map
2
2
  //# sourceMappingURL=router.js.map
package/dist/router.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{k as Link,j as Outlet,i as Route,h as Router,a as createLocation,e as createRoutesFromChildren,b as isUnsafePath,d as matchPath,f as matchRoutes,g as router,c as sanitizeQueryValue}from'./chunk-XLE6SMWX.mjs';import'./chunk-RUXAK74B.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';import'./chunk-J4CK5NRW.mjs';//# sourceMappingURL=router.mjs.map
1
+ export{k as Link,j as Outlet,i as Route,h as Router,a as createLocation,e as createRoutesFromChildren,b as isUnsafePath,d as matchPath,f as matchRoutes,g as router,c as sanitizeQueryValue}from'./chunk-3BQXIHYI.mjs';import'./chunk-HLPVL6EK.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';import'./chunk-B7VP6HBY.mjs';import'./chunk-Q7WT5IIF.mjs';//# sourceMappingURL=router.mjs.map
2
2
  //# sourceMappingURL=router.mjs.map
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkYGMMJWAA_js=require('./chunk-YGMMJWAA.js');var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(chunkYGMMJWAA_js.l(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}exports.renderToString=s;//# sourceMappingURL=server.js.map
1
+ 'use strict';var chunk5236IK5I_js=require('./chunk-5236IK5I.js');require('./chunk-AJT35P3Z.js');var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(chunk5236IK5I_js.f(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}exports.renderToString=s;//# sourceMappingURL=server.js.map
2
2
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/index.ts"],"names":["VOID_ELEMENTS","renderToString","node","escapeHtml","isSignal","children","result","type","props","html","key","value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Ac,GAAA,CAAIO,CAAI,CAAA,CACxBE,CAAAA,EAAQ,IAAA,EAERA,CAAAA,EAAQ,GAAA,CACJJ,CAAAA,GACFI,GAAQ,KAAA,CAAM,OAAA,CAAQJ,CAAQ,CAAA,CAC1BA,EAAS,GAAA,CAAIJ,CAAc,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CACpCA,CAAAA,CAAeI,CAAQ,CAAA,CAAA,CAE7BI,CAAAA,EAAQ,CAAA,EAAA,EAAKF,CAAI,CAAA,CAAA,CAAA,CAAA,CAGZE,CACT,CAEA,OAAO,EACT,CAEA,SAASN,CAAAA,CAAWY,CAAAA,CAAqB,CACvC,OAAOA,EACJ,OAAA,CAAQ,IAAA,CAAM,OAAO,CAAA,CACrB,OAAA,CAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,QAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,OAAA,CAAQ,KAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B","file":"server.js","sourcesContent":["import { isSignal } from '../core/signal'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function renderToString(node: any): string {\n if (node === null || node === undefined || node === false) {\n return ''\n }\n\n if (typeof node === 'string' || typeof node === 'number') {\n return escapeHtml(String(node))\n }\n\n if (Array.isArray(node)) {\n return node.map(renderToString).join('')\n }\n\n if (isSignal(node)) {\n return renderToString(node.value)\n }\n\n // Handle fragments (type === null or type === 'fragment')\n if (node.type === null || node.type === 'fragment') {\n const children = node.children || node.props?.children\n if (children) {\n return Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n return ''\n }\n\n if (typeof node.type === 'function') {\n const result = node.type({ ...node.props, children: node.children })\n return renderToString(result)\n }\n\n if (typeof node.type === 'string') {\n const { type, props, children } = node\n let html = `<${type}`\n\n if (props) {\n for (const key in props) {\n const value = props[key]\n if (\n key === 'children' ||\n key.startsWith('on') ||\n value === null ||\n value === undefined ||\n value === false\n ) {\n continue\n }\n\n // Security: Validate attribute name to prevent injection\n // Only allow alphanumeric, hyphens, and colons\n if (!/^[a-zA-Z0-9-:]+$/.test(key)) {\n continue\n }\n\n if (key === 'className' || key === 'class') {\n html += ` class=\"${escapeHtml(value)}\"`\n } else if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .map(\n ([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}:${v}`\n )\n .join(';')\n html += ` style=\"${escapeHtml(styleStr)}\"`\n } else {\n html += ` ${key}=\"${escapeHtml(String(value))}\"`\n }\n }\n }\n\n if (VOID_ELEMENTS.has(type)) {\n html += '/>'\n } else {\n html += '>'\n if (children) {\n html += Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n html += `</${type}>`\n }\n\n return html\n }\n\n return ''\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;')\n}\n"]}
1
+ {"version":3,"sources":["../src/server/index.ts"],"names":["VOID_ELEMENTS","renderToString","node","escapeHtml","isSignal","children","result","type","props","html","key","value","styleStr","k","v","str"],"mappings":"gGAEA,IAAMA,CAAAA,CAAgB,IAAI,GAAA,CAAI,CAC5B,OACA,MAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,MAAA,CACA,OACA,OAAA,CACA,QAAA,CACA,OAAA,CACA,KACF,CAAC,CAAA,CAGM,SAASC,CAAAA,CAAeC,EAAmB,CAChD,GAAIA,CAAAA,EAAS,IAAA,EAA8BA,IAAS,KAAA,CAClD,OAAO,EAAA,CAGT,GAAI,OAAOA,CAAA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,OAAO,EACT,CAEA,SAASN,CAAAA,CAAWY,CAAAA,CAAqB,CACvC,OAAOA,EACJ,OAAA,CAAQ,IAAA,CAAM,OAAO,CAAA,CACrB,OAAA,CAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,QAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,OAAA,CAAQ,KAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B","file":"server.js","sourcesContent":["import { isSignal } from '../core/signal'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function renderToString(node: any): string {\n if (node === null || node === undefined || node === false) {\n return ''\n }\n\n if (typeof node === 'string' || typeof node === 'number') {\n return escapeHtml(String(node))\n }\n\n if (Array.isArray(node)) {\n return node.map(renderToString).join('')\n }\n\n if (isSignal(node)) {\n return renderToString(node.value)\n }\n\n // Handle fragments (type === null or type === 'fragment')\n if (node.type === null || node.type === 'fragment') {\n const children = node.children || node.props?.children\n if (children) {\n return Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n return ''\n }\n\n if (typeof node.type === 'function') {\n const result = node.type({ ...node.props, children: node.children })\n return renderToString(result)\n }\n\n if (typeof node.type === 'string') {\n const { type, props, children } = node\n let html = `<${type}`\n\n if (props) {\n for (const key in props) {\n const value = props[key]\n if (\n key === 'children' ||\n key.startsWith('on') ||\n value === null ||\n value === undefined ||\n value === false\n ) {\n continue\n }\n\n // Security: Validate attribute name to prevent injection\n // Only allow alphanumeric, hyphens, and colons\n if (!/^[a-zA-Z0-9-:]+$/.test(key)) {\n continue\n }\n\n if (key === 'className' || key === 'class') {\n html += ` class=\"${escapeHtml(value)}\"`\n } else if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .map(\n ([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}:${v}`\n )\n .join(';')\n html += ` style=\"${escapeHtml(styleStr)}\"`\n } else {\n html += ` ${key}=\"${escapeHtml(String(value))}\"`\n }\n }\n }\n\n if (VOID_ELEMENTS.has(type)) {\n html += '/>'\n } else {\n html += '>'\n if (children) {\n html += Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n html += `</${type}>`\n }\n\n return html\n }\n\n return ''\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;')\n}\n"]}
package/dist/server.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {l as l$1}from'./chunk-J4CK5NRW.mjs';var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(l$1(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}export{s as renderToString};//# sourceMappingURL=server.mjs.map
1
+ import {f}from'./chunk-B7VP6HBY.mjs';import'./chunk-Q7WT5IIF.mjs';var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(f(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}export{s as renderToString};//# sourceMappingURL=server.mjs.map
2
2
  //# sourceMappingURL=server.mjs.map