@elaraai/east-ui 0.0.1-beta.6 → 0.0.1-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/README.md +2 -2
  2. package/dist/src/buttons/button/index.d.ts +7 -5
  3. package/dist/src/buttons/button/index.d.ts.map +1 -1
  4. package/dist/src/buttons/button/index.js +9 -13
  5. package/dist/src/buttons/button/index.js.map +1 -1
  6. package/dist/src/buttons/button/types.d.ts +7 -1
  7. package/dist/src/buttons/button/types.d.ts.map +1 -1
  8. package/dist/src/buttons/button/types.js +3 -1
  9. package/dist/src/buttons/button/types.js.map +1 -1
  10. package/dist/src/buttons/icon-button/index.d.ts +13 -32
  11. package/dist/src/buttons/icon-button/index.d.ts.map +1 -1
  12. package/dist/src/buttons/icon-button/index.js +13 -33
  13. package/dist/src/buttons/icon-button/index.js.map +1 -1
  14. package/dist/src/buttons/icon-button/types.d.ts +45 -38
  15. package/dist/src/buttons/icon-button/types.d.ts.map +1 -1
  16. package/dist/src/buttons/icon-button/types.js +5 -2
  17. package/dist/src/buttons/icon-button/types.js.map +1 -1
  18. package/dist/src/charts/area/index.d.ts +16 -31
  19. package/dist/src/charts/area/index.d.ts.map +1 -1
  20. package/dist/src/charts/area/index.js +16 -31
  21. package/dist/src/charts/area/index.js.map +1 -1
  22. package/dist/src/charts/area/types.d.ts +22 -1
  23. package/dist/src/charts/area/types.d.ts.map +1 -1
  24. package/dist/src/charts/bar/index.d.ts +12 -39
  25. package/dist/src/charts/bar/index.d.ts.map +1 -1
  26. package/dist/src/charts/bar/index.js +12 -39
  27. package/dist/src/charts/bar/index.js.map +1 -1
  28. package/dist/src/charts/bar/types.d.ts +23 -1
  29. package/dist/src/charts/bar/types.d.ts.map +1 -1
  30. package/dist/src/charts/bar-list/index.d.ts +11 -14
  31. package/dist/src/charts/bar-list/index.d.ts.map +1 -1
  32. package/dist/src/charts/bar-list/index.js +11 -14
  33. package/dist/src/charts/bar-list/index.js.map +1 -1
  34. package/dist/src/charts/bar-list/types.d.ts +9 -0
  35. package/dist/src/charts/bar-list/types.d.ts.map +1 -1
  36. package/dist/src/charts/bar-segment/index.d.ts +10 -13
  37. package/dist/src/charts/bar-segment/index.d.ts.map +1 -1
  38. package/dist/src/charts/bar-segment/index.js +10 -13
  39. package/dist/src/charts/bar-segment/index.js.map +1 -1
  40. package/dist/src/charts/bar-segment/types.d.ts +7 -0
  41. package/dist/src/charts/bar-segment/types.d.ts.map +1 -1
  42. package/dist/src/charts/line/index.d.ts +18 -17
  43. package/dist/src/charts/line/index.d.ts.map +1 -1
  44. package/dist/src/charts/line/index.js +18 -17
  45. package/dist/src/charts/line/index.js.map +1 -1
  46. package/dist/src/charts/line/types.d.ts +18 -1
  47. package/dist/src/charts/line/types.d.ts.map +1 -1
  48. package/dist/src/charts/pie/index.d.ts +11 -18
  49. package/dist/src/charts/pie/index.d.ts.map +1 -1
  50. package/dist/src/charts/pie/index.js +11 -18
  51. package/dist/src/charts/pie/index.js.map +1 -1
  52. package/dist/src/charts/pie/types.d.ts +10 -0
  53. package/dist/src/charts/pie/types.d.ts.map +1 -1
  54. package/dist/src/charts/radar/index.d.ts +15 -16
  55. package/dist/src/charts/radar/index.d.ts.map +1 -1
  56. package/dist/src/charts/radar/index.js +15 -16
  57. package/dist/src/charts/radar/index.js.map +1 -1
  58. package/dist/src/charts/radar/types.d.ts +15 -1
  59. package/dist/src/charts/radar/types.d.ts.map +1 -1
  60. package/dist/src/charts/scatter/index.d.ts +12 -13
  61. package/dist/src/charts/scatter/index.d.ts.map +1 -1
  62. package/dist/src/charts/scatter/index.js +12 -13
  63. package/dist/src/charts/scatter/index.js.map +1 -1
  64. package/dist/src/charts/scatter/types.d.ts +14 -1
  65. package/dist/src/charts/scatter/types.d.ts.map +1 -1
  66. package/dist/src/collections/data-list/index.d.ts +19 -40
  67. package/dist/src/collections/data-list/index.d.ts.map +1 -1
  68. package/dist/src/collections/data-list/index.js +19 -40
  69. package/dist/src/collections/data-list/index.js.map +1 -1
  70. package/dist/src/collections/data-list/types.d.ts +10 -6
  71. package/dist/src/collections/data-list/types.d.ts.map +1 -1
  72. package/dist/src/collections/data-list/types.js +10 -6
  73. package/dist/src/collections/data-list/types.js.map +1 -1
  74. package/dist/src/collections/gantt/index.d.ts +4668 -968
  75. package/dist/src/collections/gantt/index.d.ts.map +1 -1
  76. package/dist/src/collections/gantt/index.js +133 -81
  77. package/dist/src/collections/gantt/index.js.map +1 -1
  78. package/dist/src/collections/gantt/types.d.ts +336 -56
  79. package/dist/src/collections/gantt/types.d.ts.map +1 -1
  80. package/dist/src/collections/gantt/types.js +142 -2
  81. package/dist/src/collections/gantt/types.js.map +1 -1
  82. package/dist/src/collections/table/index.d.ts +11350 -8517
  83. package/dist/src/collections/table/index.d.ts.map +1 -1
  84. package/dist/src/collections/table/index.js +64 -53
  85. package/dist/src/collections/table/index.js.map +1 -1
  86. package/dist/src/collections/table/types.d.ts +155 -17
  87. package/dist/src/collections/table/types.d.ts.map +1 -1
  88. package/dist/src/collections/table/types.js +78 -14
  89. package/dist/src/collections/table/types.js.map +1 -1
  90. package/dist/src/collections/tree-view/index.d.ts +42 -70
  91. package/dist/src/collections/tree-view/index.d.ts.map +1 -1
  92. package/dist/src/collections/tree-view/index.js +40 -71
  93. package/dist/src/collections/tree-view/index.js.map +1 -1
  94. package/dist/src/collections/tree-view/types.d.ts +24 -1
  95. package/dist/src/collections/tree-view/types.d.ts.map +1 -1
  96. package/dist/src/collections/tree-view/types.js +7 -1
  97. package/dist/src/collections/tree-view/types.js.map +1 -1
  98. package/dist/src/component.d.ts +688 -21
  99. package/dist/src/component.d.ts.map +1 -1
  100. package/dist/src/component.js +15 -23
  101. package/dist/src/component.js.map +1 -1
  102. package/dist/src/container/card/index.d.ts +1387 -64
  103. package/dist/src/container/card/index.d.ts.map +1 -1
  104. package/dist/src/container/card/index.js +11 -20
  105. package/dist/src/container/card/index.js.map +1 -1
  106. package/dist/src/container/card/types.d.ts +3 -4
  107. package/dist/src/container/card/types.d.ts.map +1 -1
  108. package/dist/src/container/card/types.js +3 -4
  109. package/dist/src/container/card/types.js.map +1 -1
  110. package/dist/src/disclosure/accordion/index.d.ts +2923 -277
  111. package/dist/src/disclosure/accordion/index.d.ts.map +1 -1
  112. package/dist/src/disclosure/accordion/index.js +35 -65
  113. package/dist/src/disclosure/accordion/index.js.map +1 -1
  114. package/dist/src/disclosure/accordion/types.d.ts +6 -1
  115. package/dist/src/disclosure/accordion/types.d.ts.map +1 -1
  116. package/dist/src/disclosure/accordion/types.js +3 -1
  117. package/dist/src/disclosure/accordion/types.js.map +1 -1
  118. package/dist/src/disclosure/carousel/index.d.ts +1391 -89
  119. package/dist/src/disclosure/carousel/index.d.ts.map +1 -1
  120. package/dist/src/disclosure/carousel/index.js +15 -46
  121. package/dist/src/disclosure/carousel/index.js.map +1 -1
  122. package/dist/src/disclosure/carousel/types.d.ts +9 -3
  123. package/dist/src/disclosure/carousel/types.d.ts.map +1 -1
  124. package/dist/src/disclosure/carousel/types.js +4 -1
  125. package/dist/src/disclosure/carousel/types.js.map +1 -1
  126. package/dist/src/disclosure/tabs/index.d.ts +2911 -283
  127. package/dist/src/disclosure/tabs/index.d.ts.map +1 -1
  128. package/dist/src/disclosure/tabs/index.js +18 -56
  129. package/dist/src/disclosure/tabs/index.js.map +1 -1
  130. package/dist/src/disclosure/tabs/types.d.ts +6 -1
  131. package/dist/src/disclosure/tabs/types.d.ts.map +1 -1
  132. package/dist/src/disclosure/tabs/types.js +3 -1
  133. package/dist/src/disclosure/tabs/types.js.map +1 -1
  134. package/dist/src/display/avatar/index.d.ts +8 -33
  135. package/dist/src/display/avatar/index.d.ts.map +1 -1
  136. package/dist/src/display/avatar/index.js +8 -33
  137. package/dist/src/display/avatar/index.js.map +1 -1
  138. package/dist/src/display/badge/index.d.ts +7 -22
  139. package/dist/src/display/badge/index.d.ts.map +1 -1
  140. package/dist/src/display/badge/index.js +7 -22
  141. package/dist/src/display/badge/index.js.map +1 -1
  142. package/dist/src/display/icon/index.d.ts +4 -36
  143. package/dist/src/display/icon/index.d.ts.map +1 -1
  144. package/dist/src/display/icon/index.js +4 -36
  145. package/dist/src/display/icon/index.js.map +1 -1
  146. package/dist/src/display/icon/types.d.ts +1 -0
  147. package/dist/src/display/icon/types.d.ts.map +1 -1
  148. package/dist/src/display/icon/types.js +1 -0
  149. package/dist/src/display/icon/types.js.map +1 -1
  150. package/dist/src/display/stat/index.d.ts +18 -40
  151. package/dist/src/display/stat/index.d.ts.map +1 -1
  152. package/dist/src/display/stat/index.js +18 -40
  153. package/dist/src/display/stat/index.js.map +1 -1
  154. package/dist/src/display/stat/types.d.ts +10 -6
  155. package/dist/src/display/stat/types.d.ts.map +1 -1
  156. package/dist/src/display/stat/types.js +10 -6
  157. package/dist/src/display/stat/types.js.map +1 -1
  158. package/dist/src/display/tag/index.d.ts +10 -30
  159. package/dist/src/display/tag/index.d.ts.map +1 -1
  160. package/dist/src/display/tag/index.js +13 -38
  161. package/dist/src/display/tag/index.js.map +1 -1
  162. package/dist/src/display/tag/types.d.ts +6 -1
  163. package/dist/src/display/tag/types.d.ts.map +1 -1
  164. package/dist/src/display/tag/types.js +3 -1
  165. package/dist/src/display/tag/types.js.map +1 -1
  166. package/dist/src/feedback/alert/index.d.ts +7 -39
  167. package/dist/src/feedback/alert/index.d.ts.map +1 -1
  168. package/dist/src/feedback/alert/index.js +7 -39
  169. package/dist/src/feedback/alert/index.js.map +1 -1
  170. package/dist/src/feedback/alert/types.d.ts +24 -13
  171. package/dist/src/feedback/alert/types.d.ts.map +1 -1
  172. package/dist/src/feedback/alert/types.js +24 -13
  173. package/dist/src/feedback/alert/types.js.map +1 -1
  174. package/dist/src/feedback/progress/index.d.ts +8 -42
  175. package/dist/src/feedback/progress/index.d.ts.map +1 -1
  176. package/dist/src/feedback/progress/index.js +8 -42
  177. package/dist/src/feedback/progress/index.js.map +1 -1
  178. package/dist/src/feedback/progress/types.d.ts +10 -5
  179. package/dist/src/feedback/progress/types.d.ts.map +1 -1
  180. package/dist/src/feedback/progress/types.js +10 -5
  181. package/dist/src/feedback/progress/types.js.map +1 -1
  182. package/dist/src/forms/checkbox/index.d.ts +13 -23
  183. package/dist/src/forms/checkbox/index.d.ts.map +1 -1
  184. package/dist/src/forms/checkbox/index.js +21 -39
  185. package/dist/src/forms/checkbox/index.js.map +1 -1
  186. package/dist/src/forms/checkbox/types.d.ts +20 -15
  187. package/dist/src/forms/checkbox/types.d.ts.map +1 -1
  188. package/dist/src/forms/checkbox/types.js +3 -1
  189. package/dist/src/forms/checkbox/types.js.map +1 -1
  190. package/dist/src/forms/field/index.d.ts +688 -7140
  191. package/dist/src/forms/field/index.d.ts.map +1 -1
  192. package/dist/src/forms/field/index.js +531 -90
  193. package/dist/src/forms/field/index.js.map +1 -1
  194. package/dist/src/forms/field/types.d.ts +730 -4
  195. package/dist/src/forms/field/types.d.ts.map +1 -1
  196. package/dist/src/forms/field/types.js +83 -1
  197. package/dist/src/forms/field/types.js.map +1 -1
  198. package/dist/src/forms/file-upload/index.d.ts +22 -52
  199. package/dist/src/forms/file-upload/index.d.ts.map +1 -1
  200. package/dist/src/forms/file-upload/index.js +15 -54
  201. package/dist/src/forms/file-upload/index.js.map +1 -1
  202. package/dist/src/forms/file-upload/types.d.ts +52 -1
  203. package/dist/src/forms/file-upload/types.d.ts.map +1 -1
  204. package/dist/src/forms/file-upload/types.js +32 -1
  205. package/dist/src/forms/file-upload/types.js.map +1 -1
  206. package/dist/src/forms/index.d.ts +1 -2
  207. package/dist/src/forms/index.d.ts.map +1 -1
  208. package/dist/src/forms/index.js +1 -2
  209. package/dist/src/forms/index.js.map +1 -1
  210. package/dist/src/forms/input/index.d.ts +70 -8
  211. package/dist/src/forms/input/index.d.ts.map +1 -1
  212. package/dist/src/forms/input/index.js +94 -93
  213. package/dist/src/forms/input/index.js.map +1 -1
  214. package/dist/src/forms/input/types.d.ts +203 -99
  215. package/dist/src/forms/input/types.d.ts.map +1 -1
  216. package/dist/src/forms/input/types.js +49 -26
  217. package/dist/src/forms/input/types.js.map +1 -1
  218. package/dist/src/forms/select/index.d.ts +22 -15
  219. package/dist/src/forms/select/index.d.ts.map +1 -1
  220. package/dist/src/forms/select/index.js +33 -34
  221. package/dist/src/forms/select/index.js.map +1 -1
  222. package/dist/src/forms/select/types.d.ts +44 -5
  223. package/dist/src/forms/select/types.d.ts.map +1 -1
  224. package/dist/src/forms/select/types.js +7 -1
  225. package/dist/src/forms/select/types.js.map +1 -1
  226. package/dist/src/forms/slider/index.d.ts +15 -31
  227. package/dist/src/forms/slider/index.d.ts.map +1 -1
  228. package/dist/src/forms/slider/index.js +26 -50
  229. package/dist/src/forms/slider/index.js.map +1 -1
  230. package/dist/src/forms/slider/types.d.ts +19 -7
  231. package/dist/src/forms/slider/types.d.ts.map +1 -1
  232. package/dist/src/forms/slider/types.js +13 -7
  233. package/dist/src/forms/slider/types.js.map +1 -1
  234. package/dist/src/forms/switch/index.d.ts +26 -23
  235. package/dist/src/forms/switch/index.d.ts.map +1 -1
  236. package/dist/src/forms/switch/index.js +33 -38
  237. package/dist/src/forms/switch/index.js.map +1 -1
  238. package/dist/src/forms/switch/types.d.ts +20 -15
  239. package/dist/src/forms/switch/types.d.ts.map +1 -1
  240. package/dist/src/forms/switch/types.js +3 -1
  241. package/dist/src/forms/switch/types.js.map +1 -1
  242. package/dist/src/forms/tags-input/index.d.ts +20 -50
  243. package/dist/src/forms/tags-input/index.d.ts.map +1 -1
  244. package/dist/src/forms/tags-input/index.js +24 -52
  245. package/dist/src/forms/tags-input/index.js.map +1 -1
  246. package/dist/src/forms/tags-input/types.d.ts +19 -1
  247. package/dist/src/forms/tags-input/types.d.ts.map +1 -1
  248. package/dist/src/forms/tags-input/types.js +10 -1
  249. package/dist/src/forms/tags-input/types.js.map +1 -1
  250. package/dist/src/forms/textarea/index.d.ts +20 -47
  251. package/dist/src/forms/textarea/index.d.ts.map +1 -1
  252. package/dist/src/forms/textarea/index.js +24 -49
  253. package/dist/src/forms/textarea/index.js.map +1 -1
  254. package/dist/src/forms/textarea/types.d.ts +25 -4
  255. package/dist/src/forms/textarea/types.d.ts.map +1 -1
  256. package/dist/src/forms/textarea/types.js +13 -4
  257. package/dist/src/forms/textarea/types.js.map +1 -1
  258. package/dist/src/index.d.ts +7 -3
  259. package/dist/src/index.d.ts.map +1 -1
  260. package/dist/src/index.js +9 -4
  261. package/dist/src/index.js.map +1 -1
  262. package/dist/src/internal.d.ts +0 -1
  263. package/dist/src/internal.d.ts.map +1 -1
  264. package/dist/src/internal.js +0 -1
  265. package/dist/src/internal.js.map +1 -1
  266. package/dist/src/layout/box/index.d.ts +1463 -71
  267. package/dist/src/layout/box/index.d.ts.map +1 -1
  268. package/dist/src/layout/box/index.js +48 -32
  269. package/dist/src/layout/box/index.js.map +1 -1
  270. package/dist/src/layout/box/types.d.ts +52 -2
  271. package/dist/src/layout/box/types.d.ts.map +1 -1
  272. package/dist/src/layout/box/types.js +15 -1
  273. package/dist/src/layout/box/types.js.map +1 -1
  274. package/dist/src/layout/flex/index.d.ts +8915 -0
  275. package/dist/src/layout/flex/index.d.ts.map +1 -0
  276. package/dist/src/layout/flex/index.js +291 -0
  277. package/dist/src/layout/flex/index.js.map +1 -0
  278. package/dist/src/layout/flex/types.d.ts +176 -0
  279. package/dist/src/layout/flex/types.d.ts.map +1 -0
  280. package/dist/src/layout/flex/types.js +56 -0
  281. package/dist/src/layout/flex/types.js.map +1 -0
  282. package/dist/src/layout/grid/index.d.ts +2907 -268
  283. package/dist/src/layout/grid/index.d.ts.map +1 -1
  284. package/dist/src/layout/grid/index.js +12 -37
  285. package/dist/src/layout/grid/index.js.map +1 -1
  286. package/dist/src/layout/grid/types.d.ts +11 -3
  287. package/dist/src/layout/grid/types.d.ts.map +1 -1
  288. package/dist/src/layout/grid/types.js +11 -3
  289. package/dist/src/layout/grid/types.js.map +1 -1
  290. package/dist/src/layout/index.d.ts +1 -0
  291. package/dist/src/layout/index.d.ts.map +1 -1
  292. package/dist/src/layout/index.js +1 -0
  293. package/dist/src/layout/index.js.map +1 -1
  294. package/dist/src/layout/separator/index.d.ts +7 -19
  295. package/dist/src/layout/separator/index.d.ts.map +1 -1
  296. package/dist/src/layout/separator/index.js +7 -19
  297. package/dist/src/layout/separator/index.js.map +1 -1
  298. package/dist/src/layout/splitter/index.d.ts +2948 -298
  299. package/dist/src/layout/splitter/index.d.ts.map +1 -1
  300. package/dist/src/layout/splitter/index.js +41 -74
  301. package/dist/src/layout/splitter/index.js.map +1 -1
  302. package/dist/src/layout/splitter/types.d.ts +31 -3
  303. package/dist/src/layout/splitter/types.d.ts.map +1 -1
  304. package/dist/src/layout/splitter/types.js +15 -1
  305. package/dist/src/layout/splitter/types.js.map +1 -1
  306. package/dist/src/layout/stack/index.d.ts +1469 -61
  307. package/dist/src/layout/stack/index.d.ts.map +1 -1
  308. package/dist/src/layout/stack/index.js +54 -22
  309. package/dist/src/layout/stack/index.js.map +1 -1
  310. package/dist/src/layout/stack/types.d.ts +52 -2
  311. package/dist/src/layout/stack/types.d.ts.map +1 -1
  312. package/dist/src/layout/stack/types.js +15 -1
  313. package/dist/src/layout/stack/types.js.map +1 -1
  314. package/dist/src/overlays/action-bar/index.d.ts +24 -43
  315. package/dist/src/overlays/action-bar/index.d.ts.map +1 -1
  316. package/dist/src/overlays/action-bar/index.js +19 -41
  317. package/dist/src/overlays/action-bar/index.js.map +1 -1
  318. package/dist/src/overlays/action-bar/types.d.ts +23 -2
  319. package/dist/src/overlays/action-bar/types.d.ts.map +1 -1
  320. package/dist/src/overlays/action-bar/types.js +8 -2
  321. package/dist/src/overlays/action-bar/types.js.map +1 -1
  322. package/dist/src/overlays/dialog/index.d.ts +2769 -118
  323. package/dist/src/overlays/dialog/index.d.ts.map +1 -1
  324. package/dist/src/overlays/dialog/index.js +17 -35
  325. package/dist/src/overlays/dialog/index.js.map +1 -1
  326. package/dist/src/overlays/dialog/types.d.ts +42 -1
  327. package/dist/src/overlays/dialog/types.d.ts.map +1 -1
  328. package/dist/src/overlays/dialog/types.js +13 -1
  329. package/dist/src/overlays/dialog/types.js.map +1 -1
  330. package/dist/src/overlays/drawer/index.d.ts +2763 -117
  331. package/dist/src/overlays/drawer/index.d.ts.map +1 -1
  332. package/dist/src/overlays/drawer/index.js +14 -34
  333. package/dist/src/overlays/drawer/index.js.map +1 -1
  334. package/dist/src/overlays/drawer/types.d.ts +25 -1
  335. package/dist/src/overlays/drawer/types.d.ts.map +1 -1
  336. package/dist/src/overlays/drawer/types.js +7 -1
  337. package/dist/src/overlays/drawer/types.js.map +1 -1
  338. package/dist/src/overlays/hover-card/index.d.ts +2763 -122
  339. package/dist/src/overlays/hover-card/index.d.ts.map +1 -1
  340. package/dist/src/overlays/hover-card/index.js +16 -39
  341. package/dist/src/overlays/hover-card/index.js.map +1 -1
  342. package/dist/src/overlays/hover-card/types.d.ts +17 -1
  343. package/dist/src/overlays/hover-card/types.d.ts.map +1 -1
  344. package/dist/src/overlays/hover-card/types.js +4 -1
  345. package/dist/src/overlays/hover-card/types.js.map +1 -1
  346. package/dist/src/overlays/menu/index.d.ts +1415 -86
  347. package/dist/src/overlays/menu/index.d.ts.map +1 -1
  348. package/dist/src/overlays/menu/index.js +39 -42
  349. package/dist/src/overlays/menu/index.js.map +1 -1
  350. package/dist/src/overlays/menu/types.d.ts +13 -1
  351. package/dist/src/overlays/menu/types.d.ts.map +1 -1
  352. package/dist/src/overlays/menu/types.js +7 -3
  353. package/dist/src/overlays/menu/types.js.map +1 -1
  354. package/dist/src/overlays/popover/index.d.ts +2760 -120
  355. package/dist/src/overlays/popover/index.d.ts.map +1 -1
  356. package/dist/src/overlays/popover/index.js +13 -37
  357. package/dist/src/overlays/popover/index.js.map +1 -1
  358. package/dist/src/overlays/popover/types.d.ts +22 -1
  359. package/dist/src/overlays/popover/types.d.ts.map +1 -1
  360. package/dist/src/overlays/popover/types.js +4 -1
  361. package/dist/src/overlays/popover/types.js.map +1 -1
  362. package/dist/src/overlays/toggle-tip/index.d.ts +1387 -72
  363. package/dist/src/overlays/toggle-tip/index.d.ts.map +1 -1
  364. package/dist/src/overlays/toggle-tip/index.js +11 -29
  365. package/dist/src/overlays/toggle-tip/index.js.map +1 -1
  366. package/dist/src/overlays/toggle-tip/types.d.ts +26 -13
  367. package/dist/src/overlays/toggle-tip/types.d.ts.map +1 -1
  368. package/dist/src/overlays/toggle-tip/types.js +4 -1
  369. package/dist/src/overlays/toggle-tip/types.js.map +1 -1
  370. package/dist/src/overlays/tooltip/index.d.ts +1384 -78
  371. package/dist/src/overlays/tooltip/index.d.ts.map +1 -1
  372. package/dist/src/overlays/tooltip/index.js +8 -34
  373. package/dist/src/overlays/tooltip/index.js.map +1 -1
  374. package/dist/src/overlays/tooltip/types.d.ts +12 -3
  375. package/dist/src/overlays/tooltip/types.d.ts.map +1 -1
  376. package/dist/src/overlays/tooltip/types.js +12 -3
  377. package/dist/src/overlays/tooltip/types.js.map +1 -1
  378. package/dist/src/platform/index.d.ts +217 -1
  379. package/dist/src/platform/index.d.ts.map +1 -1
  380. package/dist/src/platform/index.js +222 -1
  381. package/dist/src/platform/index.js.map +1 -1
  382. package/dist/src/platform/state.d.ts +170 -69
  383. package/dist/src/platform/state.d.ts.map +1 -1
  384. package/dist/src/platform/state.js +252 -67
  385. package/dist/src/platform/state.js.map +1 -1
  386. package/dist/src/platform/store.d.ts +172 -0
  387. package/dist/src/platform/store.d.ts.map +1 -0
  388. package/dist/src/platform/store.js +246 -0
  389. package/dist/src/platform/store.js.map +1 -0
  390. package/dist/src/reactive/index.d.ts +69 -0
  391. package/dist/src/reactive/index.d.ts.map +1 -0
  392. package/dist/src/reactive/index.js +93 -0
  393. package/dist/src/reactive/index.js.map +1 -0
  394. package/dist/src/typography/code-block/index.d.ts +2 -1
  395. package/dist/src/typography/code-block/index.d.ts.map +1 -1
  396. package/dist/src/typography/code-block/index.js +2 -1
  397. package/dist/src/typography/code-block/index.js.map +1 -1
  398. package/dist/src/typography/code-block/types.d.ts +4 -0
  399. package/dist/src/typography/code-block/types.d.ts.map +1 -1
  400. package/dist/src/typography/code-block/types.js +2 -0
  401. package/dist/src/typography/code-block/types.js.map +1 -1
  402. package/dist/src/typography/list/index.d.ts +2 -3
  403. package/dist/src/typography/list/index.d.ts.map +1 -1
  404. package/dist/src/typography/list/index.js +2 -3
  405. package/dist/src/typography/list/index.js.map +1 -1
  406. package/package.json +2 -2
  407. package/dist/src/forms/fieldset/index.d.ts +0 -112
  408. package/dist/src/forms/fieldset/index.d.ts.map +0 -1
  409. package/dist/src/forms/fieldset/index.js +0 -131
  410. package/dist/src/forms/fieldset/index.js.map +0 -1
  411. package/dist/src/forms/fieldset/types.d.ts +0 -53
  412. package/dist/src/forms/fieldset/types.d.ts.map +0 -1
  413. package/dist/src/forms/fieldset/types.js +0 -22
  414. package/dist/src/forms/fieldset/types.js.map +0 -1
@@ -2,101 +2,202 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
4
  */
5
- import { StringType, BlobType, NullType } from "@elaraai/east";
6
- import type { PlatformFunctionDef } from "@elaraai/east/internal";
5
+ /**
6
+ * State management platform functions for East UI.
7
+ *
8
+ * Provides reactive state operations for East UI programs.
9
+ * State is stored as Beast2-encoded blobs, allowing any East type to be stored.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ import { StringType, BlobType, NullType, type SubtypeExprOrValue, type EastType, type CallableFunctionExpr, BooleanType } from "@elaraai/east";
14
+ import { type PlatformFunction, OptionType } from "@elaraai/east/internal";
15
+ import { UIStore } from "./store.js";
16
+ /**
17
+ * Enable dependency tracking for reactive components.
18
+ *
19
+ * @remarks
20
+ * Call this before executing a reactive component's render function.
21
+ * All subsequent `state_read` calls will record their keys to the tracking set.
22
+ * Call {@link disableTracking} when done to get the collected keys.
23
+ *
24
+ * @returns The Set that will collect accessed keys
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * enableTracking();
29
+ * try {
30
+ * const result = renderFn();
31
+ * const deps = disableTracking();
32
+ * // deps contains all state keys read during renderFn()
33
+ * } catch (e) {
34
+ * disableTracking();
35
+ * throw e;
36
+ * }
37
+ * ```
38
+ */
39
+ export declare function enableTracking(): Set<string>;
40
+ /**
41
+ * Disable dependency tracking and return collected keys.
42
+ *
43
+ * @remarks
44
+ * Call this after executing a reactive component's render function.
45
+ * Returns all keys that were accessed via `state_read` since {@link enableTracking} was called.
46
+ *
47
+ * @returns Array of state keys that were read during tracking
48
+ */
49
+ export declare function disableTracking(): string[];
50
+ /**
51
+ * Check if dependency tracking is currently enabled.
52
+ *
53
+ * @returns True if tracking is active
54
+ */
55
+ export declare function isTracking(): boolean;
56
+ /**
57
+ * Record a key access during dependency tracking.
58
+ *
59
+ * @remarks
60
+ * Called internally by the `state_read` implementation.
61
+ * Only records if tracking is enabled via {@link enableTracking}.
62
+ *
63
+ * @param key - The state key being accessed
64
+ */
65
+ export declare function trackKey(key: string): void;
7
66
  /**
8
67
  * Platform function to write a Beast2-encoded value to the state store.
9
68
  *
10
- * This is a platform function for the East language, enabling state management
11
- * in East UI applications. The implementation is provided by the React store
12
- * in `@elaraai/east-ui-components`.
69
+ * @remarks
70
+ * Writes a blob to state, or deletes the key if `none` is passed.
71
+ * Triggers re-render in reactive contexts.
13
72
  *
14
73
  * @param key - The string key to write to
15
- * @param value - The Beast2-encoded blob value
74
+ * @param value - The Beast2-encoded blob value (some to write, none to delete)
16
75
  * @returns Null
76
+ */
77
+ export declare const state_write: import("@elaraai/east").PlatformDefinition<[StringType, OptionType<BlobType>], NullType>;
78
+ /**
79
+ * Platform function to read a Beast2-encoded value from the state store.
80
+ *
81
+ * @remarks
82
+ * Returns `some(blob)` if the key exists, `none` if not.
83
+ * Use `.match()` to handle both cases.
84
+ *
85
+ * @param key - The string key to read from
86
+ * @returns Option of Beast2-encoded blob (some if exists, none if not)
87
+ */
88
+ export declare const state_read: import("@elaraai/east").PlatformDefinition<[StringType], OptionType<BlobType>>;
89
+ /**
90
+ * Platform function to check if a key exists in the state store.
91
+ *
92
+ * @remarks
93
+ * Returns true if the key exists, false otherwise.
94
+ *
95
+ * @param key - The string key to check
96
+ * @returns Boolean indicating existence of the key
97
+ */
98
+ export declare const state_has: import("@elaraai/east").PlatformDefinition<[StringType], BooleanType>;
99
+ /**
100
+ * Singleton UI store instance for state management.
101
+ *
102
+ * @remarks
103
+ * This is the global store used by {@link StateImpl}. Access directly
104
+ * for React integration, subscriptions, or debugging.
105
+ */
106
+ export declare const store: UIStore;
107
+ /**
108
+ * Platform implementation for state management operations.
109
+ *
110
+ * @remarks
111
+ * Provides the runtime implementations for state read/write operations
112
+ * bound to the singleton {@link store}. Pass this to `ir.compile()` to enable
113
+ * state functionality.
114
+ */
115
+ export declare const StateImpl: PlatformFunction[];
116
+ /**
117
+ * Creates a typed state write function for a given key and type.
118
+ *
119
+ * @remarks
120
+ * Returns an East function that writes a typed value to state. The value is
121
+ * automatically Beast2-encoded before storage. Pass `some(value)` to write
122
+ * or `none` to delete the key.
123
+ *
124
+ * @typeParam T - The East type of the value to write
125
+ * @param key - The string key to write to
126
+ * @param value - The value wrapped in an option (some to write, none to delete)
127
+ * @param type - The East type descriptor for the value
128
+ * @returns A callable East function that performs the write
17
129
  *
18
130
  * @example
19
131
  * ```ts
20
- * const updateCount = East.function(
21
- * [['state', DictType(StringType, BlobType)]],
22
- * NullType,
23
- * ($, state) => {
24
- * const countBlob = state.get("count");
25
- * const count = countBlob.decodeBeast(IntegerType);
26
- * $(State.write("count", East.Blob.encodeBeast(count.add(1n))));
27
- * }
28
- * );
132
+ * import { East, IntegerType, NullType, some } from "@elaraai/east";
133
+ * import { State, UIComponentType } from "@elaraai/east-ui";
134
+ *
135
+ * const counter = East.function([], UIComponentType, $ => {
136
+ * // Write 42 to "counter" key
137
+ * $(State.writeTyped("counter", some(42n), IntegerType)());
138
+ *
139
+ * // Delete the key
140
+ * $(State.writeTyped("counter", none, IntegerType)());
141
+ * });
29
142
  * ```
30
143
  */
31
- export declare const state_write: PlatformFunctionDef<[typeof StringType, typeof BlobType], typeof NullType>;
144
+ export declare const state_write_typed: <T extends EastType>(key: SubtypeExprOrValue<StringType>, value: SubtypeExprOrValue<OptionType<T>>, type: T) => CallableFunctionExpr<[], NullType>;
32
145
  /**
33
- * Platform function to read a Beast2-encoded value from the state store.
34
- * Returns an empty blob if the key doesn't exist.
146
+ * Creates a typed state read function for a given key and type.
35
147
  *
36
- * This is a platform function for the East language, enabling state management
37
- * in East UI applications. The implementation is provided by the React store
38
- * in `@elaraai/east-ui-components`.
148
+ * @remarks
149
+ * Returns an East function that reads a typed value from state. The value is
150
+ * automatically Beast2-decoded after retrieval. Returns `some(value)` if the
151
+ * key exists, `none` if not.
39
152
  *
153
+ * @typeParam T - The East type of the value to read
40
154
  * @param key - The string key to read from
41
- * @returns The Beast2-encoded blob value
155
+ * @param type - The East type descriptor for the value
156
+ * @returns A callable East function that returns an option of the typed value
42
157
  *
43
158
  * @example
44
159
  * ```ts
45
- * const readCount = East.function([], IntegerType, ($) => {
46
- * const blob = State.read("count");
47
- * return blob.decodeBeast(IntegerType);
160
+ * import { East, IntegerType, NullType } from "@elaraai/east";
161
+ * import { State, UIComponentType, Text } from "@elaraai/east-ui";
162
+ *
163
+ * const display = East.function([], UIComponentType, $ => {
164
+ * // Read typed value from state
165
+ * const count = $.let(State.readTyped("counter", IntegerType)());
166
+ *
167
+ * // Use the value (unwrap if you know it exists)
168
+ * return Text.Root(East.str`Count: ${count.unwrap("some")}`);
48
169
  * });
49
170
  * ```
50
171
  */
51
- export declare const state_read: PlatformFunctionDef<[typeof StringType], typeof BlobType>;
172
+ export declare const state_read_typed: <T extends EastType>(key: SubtypeExprOrValue<StringType>, type: T) => CallableFunctionExpr<[], OptionType<T>>;
52
173
  /**
53
- * Grouped state management platform functions.
174
+ * Creates a typed state initialization function that only writes if the key doesn't exist.
54
175
  *
55
- * Provides reactive state operations for East UI programs.
56
- * The implementation is created by the EastStore in `@elaraai/east-ui-components`.
176
+ * @remarks
177
+ * Returns an East function that initializes a state key with a default value.
178
+ * The write only occurs if the key is not already set, preventing overwrites
179
+ * on re-renders. Use this for setting up initial state in components.
180
+ *
181
+ * @typeParam T - The East type of the value to initialize
182
+ * @param key - The string key to initialize
183
+ * @param value - The default value to write (not wrapped in option)
184
+ * @param type - The East type descriptor for the value
185
+ * @returns A callable East function that performs the conditional initialization
57
186
  *
58
187
  * @example
59
188
  * ```ts
60
- * import { East, DictType, StringType, BlobType, IntegerType } from "@elaraai/east";
61
- * import { State } from "@elaraai/east-ui";
62
- * import { createEastStore } from "@elaraai/east-ui-components";
63
- *
64
- * const counter = East.function(
65
- * [['state', DictType(StringType, BlobType)]],
66
- * UIComponentType,
67
- * ($, state) => {
68
- * // Read current count
69
- * const countBlob = state.get("count");
70
- * const count = countBlob.decodeBeast(IntegerType);
71
- *
72
- * // Write incremented count
73
- * $(State.write("count", East.Blob.encodeBeast(count.add(1n))));
74
- *
75
- * return Text.Root(East.str`Count: ${count}`);
76
- * }
77
- * );
78
- *
79
- * // Create store and register function
80
- * const store = createEastStore();
81
- * store.register("counter", counter.toIR());
189
+ * import { East, IntegerType } from "@elaraai/east";
190
+ * import { State, UIComponentType, Button } from "@elaraai/east-ui";
191
+ *
192
+ * const counter = East.function([], UIComponentType, $ => {
193
+ * // Initialize to 0 only if not already set
194
+ * $(State.initTyped("counter", 0n, IntegerType)());
195
+ *
196
+ * // Read and display
197
+ * const count = $.let(State.readTyped("counter", IntegerType)());
198
+ * // ...
199
+ * });
82
200
  * ```
83
201
  */
84
- export declare const State: {
85
- /**
86
- * Writes a Beast2-encoded value to the state store.
87
- *
88
- * @param key - The string key to write to
89
- * @param value - The Beast2-encoded blob value
90
- * @returns Null
91
- */
92
- readonly write: PlatformFunctionDef<[StringType, BlobType], NullType>;
93
- /**
94
- * Reads a Beast2-encoded value from the state store.
95
- * Returns an empty blob if the key doesn't exist.
96
- *
97
- * @param key - The string key to read from
98
- * @returns The Beast2-encoded blob value
99
- */
100
- readonly read: PlatformFunctionDef<[StringType], BlobType>;
101
- };
202
+ export declare const state_init_typed: <T extends EastType>(key: SubtypeExprOrValue<StringType>, value: SubtypeExprOrValue<T>, type: T) => CallableFunctionExpr<[], NullType>;
102
203
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/platform/state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW,EAAE,mBAAmB,CAAC,CAAC,OAAO,UAAU,EAAE,OAAO,QAAQ,CAAC,EAAE,OAAO,QAAQ,CACjC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,EAAE,mBAAmB,CAAC,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,QAAQ,CAC1B,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,KAAK;IACd;;;;;;OAMG;;IAGH;;;;;;OAMG;;CAEG,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/platform/state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAEH,UAAU,EACV,QAAQ,EACR,QAAQ,EAGR,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,WAAW,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYrC;;;;;;;;;;;;;;;;;;;;;;GAsBG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CAAC,KACR,oBAAoB,CAAC,EAAE,EAAE,QAAQ,CAWnC,CAAC"}
@@ -2,100 +2,285 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
4
  */
5
- import { East, StringType, BlobType, NullType } from "@elaraai/east";
5
+ /**
6
+ * State management platform functions for East UI.
7
+ *
8
+ * Provides reactive state operations for East UI programs.
9
+ * State is stored as Beast2-encoded blobs, allowing any East type to be stored.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ import { East, StringType, BlobType, NullType, none, some, BooleanType, } from "@elaraai/east";
14
+ import { OptionType } from "@elaraai/east/internal";
15
+ import { UIStore } from "./store.js";
16
+ // =============================================================================
17
+ // Reactive Dependency Tracking
18
+ // =============================================================================
19
+ /**
20
+ * Tracking context for reactive dependency collection.
21
+ * When set, state_read calls will record their keys here.
22
+ */
23
+ let trackingContext = null;
24
+ /**
25
+ * Enable dependency tracking for reactive components.
26
+ *
27
+ * @remarks
28
+ * Call this before executing a reactive component's render function.
29
+ * All subsequent `state_read` calls will record their keys to the tracking set.
30
+ * Call {@link disableTracking} when done to get the collected keys.
31
+ *
32
+ * @returns The Set that will collect accessed keys
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * enableTracking();
37
+ * try {
38
+ * const result = renderFn();
39
+ * const deps = disableTracking();
40
+ * // deps contains all state keys read during renderFn()
41
+ * } catch (e) {
42
+ * disableTracking();
43
+ * throw e;
44
+ * }
45
+ * ```
46
+ */
47
+ export function enableTracking() {
48
+ trackingContext = new Set();
49
+ return trackingContext;
50
+ }
51
+ /**
52
+ * Disable dependency tracking and return collected keys.
53
+ *
54
+ * @remarks
55
+ * Call this after executing a reactive component's render function.
56
+ * Returns all keys that were accessed via `state_read` since {@link enableTracking} was called.
57
+ *
58
+ * @returns Array of state keys that were read during tracking
59
+ */
60
+ export function disableTracking() {
61
+ const keys = trackingContext ? [...trackingContext] : [];
62
+ trackingContext = null;
63
+ return keys;
64
+ }
65
+ /**
66
+ * Check if dependency tracking is currently enabled.
67
+ *
68
+ * @returns True if tracking is active
69
+ */
70
+ export function isTracking() {
71
+ return trackingContext !== null;
72
+ }
73
+ /**
74
+ * Record a key access during dependency tracking.
75
+ *
76
+ * @remarks
77
+ * Called internally by the `state_read` implementation.
78
+ * Only records if tracking is enabled via {@link enableTracking}.
79
+ *
80
+ * @param key - The state key being accessed
81
+ */
82
+ export function trackKey(key) {
83
+ if (trackingContext) {
84
+ trackingContext.add(key);
85
+ }
86
+ }
87
+ // =============================================================================
88
+ // Platform Functions
89
+ // =============================================================================
6
90
  /**
7
91
  * Platform function to write a Beast2-encoded value to the state store.
8
92
  *
9
- * This is a platform function for the East language, enabling state management
10
- * in East UI applications. The implementation is provided by the React store
11
- * in `@elaraai/east-ui-components`.
93
+ * @remarks
94
+ * Writes a blob to state, or deletes the key if `none` is passed.
95
+ * Triggers re-render in reactive contexts.
12
96
  *
13
97
  * @param key - The string key to write to
14
- * @param value - The Beast2-encoded blob value
98
+ * @param value - The Beast2-encoded blob value (some to write, none to delete)
15
99
  * @returns Null
100
+ */
101
+ export const state_write = East.platform("state_write", [StringType, OptionType(BlobType)], NullType);
102
+ /**
103
+ * Platform function to read a Beast2-encoded value from the state store.
104
+ *
105
+ * @remarks
106
+ * Returns `some(blob)` if the key exists, `none` if not.
107
+ * Use `.match()` to handle both cases.
108
+ *
109
+ * @param key - The string key to read from
110
+ * @returns Option of Beast2-encoded blob (some if exists, none if not)
111
+ */
112
+ export const state_read = East.platform("state_read", [StringType], OptionType(BlobType));
113
+ /**
114
+ * Platform function to check if a key exists in the state store.
115
+ *
116
+ * @remarks
117
+ * Returns true if the key exists, false otherwise.
118
+ *
119
+ * @param key - The string key to check
120
+ * @returns Boolean indicating existence of the key
121
+ */
122
+ export const state_has = East.platform("state_has", [StringType], BooleanType);
123
+ /**
124
+ * Singleton UI store instance for state management.
125
+ *
126
+ * @remarks
127
+ * This is the global store used by {@link StateImpl}. Access directly
128
+ * for React integration, subscriptions, or debugging.
129
+ */
130
+ export const store = new UIStore();
131
+ /**
132
+ * Platform implementation for state management operations.
133
+ *
134
+ * @remarks
135
+ * Provides the runtime implementations for state read/write operations
136
+ * bound to the singleton {@link store}. Pass this to `ir.compile()` to enable
137
+ * state functionality.
138
+ */
139
+ export const StateImpl = [
140
+ state_write.implement((key, value) => {
141
+ if (value.type === 'none') {
142
+ store.write(key, undefined);
143
+ }
144
+ else {
145
+ store.write(key, value.value);
146
+ }
147
+ }),
148
+ state_read.implement((key) => {
149
+ // Track the key if in tracking mode (for reactive dependency collection)
150
+ trackKey(key);
151
+ const ret = store.read(key);
152
+ if (ret === undefined) {
153
+ return none;
154
+ }
155
+ else {
156
+ return some(ret);
157
+ }
158
+ }),
159
+ state_has.implement((key) => {
160
+ return store.has(key);
161
+ }),
162
+ ];
163
+ /**
164
+ * Creates a typed state write function for a given key and type.
165
+ *
166
+ * @remarks
167
+ * Returns an East function that writes a typed value to state. The value is
168
+ * automatically Beast2-encoded before storage. Pass `some(value)` to write
169
+ * or `none` to delete the key.
170
+ *
171
+ * @typeParam T - The East type of the value to write
172
+ * @param key - The string key to write to
173
+ * @param value - The value wrapped in an option (some to write, none to delete)
174
+ * @param type - The East type descriptor for the value
175
+ * @returns A callable East function that performs the write
16
176
  *
17
177
  * @example
18
178
  * ```ts
19
- * const updateCount = East.function(
20
- * [['state', DictType(StringType, BlobType)]],
21
- * NullType,
22
- * ($, state) => {
23
- * const countBlob = state.get("count");
24
- * const count = countBlob.decodeBeast(IntegerType);
25
- * $(State.write("count", East.Blob.encodeBeast(count.add(1n))));
26
- * }
27
- * );
179
+ * import { East, IntegerType, NullType, some } from "@elaraai/east";
180
+ * import { State, UIComponentType } from "@elaraai/east-ui";
181
+ *
182
+ * const counter = East.function([], UIComponentType, $ => {
183
+ * // Write 42 to "counter" key
184
+ * $(State.writeTyped("counter", some(42n), IntegerType)());
185
+ *
186
+ * // Delete the key
187
+ * $(State.writeTyped("counter", none, IntegerType)());
188
+ * });
28
189
  * ```
29
190
  */
30
- export const state_write = East.platform("state_write", [StringType, BlobType], NullType);
191
+ export const state_write_typed = (key, value, type) => {
192
+ return East.function([], NullType, $ => {
193
+ const key_expr = East.value(key);
194
+ const value_expr = East.value(value, OptionType(type));
195
+ $.match(value_expr, {
196
+ some: ($, v) => {
197
+ $(state_write(key_expr, some(East.Blob.encodeBeast(v, "v2"))));
198
+ },
199
+ none: ($) => {
200
+ $(state_write(key_expr, none));
201
+ }
202
+ });
203
+ return null;
204
+ });
205
+ };
31
206
  /**
32
- * Platform function to read a Beast2-encoded value from the state store.
33
- * Returns an empty blob if the key doesn't exist.
207
+ * Creates a typed state read function for a given key and type.
34
208
  *
35
- * This is a platform function for the East language, enabling state management
36
- * in East UI applications. The implementation is provided by the React store
37
- * in `@elaraai/east-ui-components`.
209
+ * @remarks
210
+ * Returns an East function that reads a typed value from state. The value is
211
+ * automatically Beast2-decoded after retrieval. Returns `some(value)` if the
212
+ * key exists, `none` if not.
38
213
  *
214
+ * @typeParam T - The East type of the value to read
39
215
  * @param key - The string key to read from
40
- * @returns The Beast2-encoded blob value
216
+ * @param type - The East type descriptor for the value
217
+ * @returns A callable East function that returns an option of the typed value
41
218
  *
42
219
  * @example
43
220
  * ```ts
44
- * const readCount = East.function([], IntegerType, ($) => {
45
- * const blob = State.read("count");
46
- * return blob.decodeBeast(IntegerType);
221
+ * import { East, IntegerType, NullType } from "@elaraai/east";
222
+ * import { State, UIComponentType, Text } from "@elaraai/east-ui";
223
+ *
224
+ * const display = East.function([], UIComponentType, $ => {
225
+ * // Read typed value from state
226
+ * const count = $.let(State.readTyped("counter", IntegerType)());
227
+ *
228
+ * // Use the value (unwrap if you know it exists)
229
+ * return Text.Root(East.str`Count: ${count.unwrap("some")}`);
47
230
  * });
48
231
  * ```
49
232
  */
50
- export const state_read = East.platform("state_read", [StringType], BlobType);
233
+ export const state_read_typed = (key, type) => {
234
+ return East.function([], OptionType(type), $ => {
235
+ const key_expr = East.value(key);
236
+ const ret = $.let(none, OptionType(type));
237
+ $.match(state_read(key_expr), {
238
+ some: ($, v) => {
239
+ $.assign(ret, East.value(some(v.decodeBeast(type, "v2")), OptionType(type)));
240
+ },
241
+ });
242
+ return ret;
243
+ });
244
+ };
51
245
  /**
52
- * Grouped state management platform functions.
246
+ * Creates a typed state initialization function that only writes if the key doesn't exist.
53
247
  *
54
- * Provides reactive state operations for East UI programs.
55
- * The implementation is created by the EastStore in `@elaraai/east-ui-components`.
248
+ * @remarks
249
+ * Returns an East function that initializes a state key with a default value.
250
+ * The write only occurs if the key is not already set, preventing overwrites
251
+ * on re-renders. Use this for setting up initial state in components.
252
+ *
253
+ * @typeParam T - The East type of the value to initialize
254
+ * @param key - The string key to initialize
255
+ * @param value - The default value to write (not wrapped in option)
256
+ * @param type - The East type descriptor for the value
257
+ * @returns A callable East function that performs the conditional initialization
56
258
  *
57
259
  * @example
58
260
  * ```ts
59
- * import { East, DictType, StringType, BlobType, IntegerType } from "@elaraai/east";
60
- * import { State } from "@elaraai/east-ui";
61
- * import { createEastStore } from "@elaraai/east-ui-components";
62
- *
63
- * const counter = East.function(
64
- * [['state', DictType(StringType, BlobType)]],
65
- * UIComponentType,
66
- * ($, state) => {
67
- * // Read current count
68
- * const countBlob = state.get("count");
69
- * const count = countBlob.decodeBeast(IntegerType);
70
- *
71
- * // Write incremented count
72
- * $(State.write("count", East.Blob.encodeBeast(count.add(1n))));
73
- *
74
- * return Text.Root(East.str`Count: ${count}`);
75
- * }
76
- * );
77
- *
78
- * // Create store and register function
79
- * const store = createEastStore();
80
- * store.register("counter", counter.toIR());
261
+ * import { East, IntegerType } from "@elaraai/east";
262
+ * import { State, UIComponentType, Button } from "@elaraai/east-ui";
263
+ *
264
+ * const counter = East.function([], UIComponentType, $ => {
265
+ * // Initialize to 0 only if not already set
266
+ * $(State.initTyped("counter", 0n, IntegerType)());
267
+ *
268
+ * // Read and display
269
+ * const count = $.let(State.readTyped("counter", IntegerType)());
270
+ * // ...
271
+ * });
81
272
  * ```
82
273
  */
83
- export const State = {
84
- /**
85
- * Writes a Beast2-encoded value to the state store.
86
- *
87
- * @param key - The string key to write to
88
- * @param value - The Beast2-encoded blob value
89
- * @returns Null
90
- */
91
- write: state_write,
92
- /**
93
- * Reads a Beast2-encoded value from the state store.
94
- * Returns an empty blob if the key doesn't exist.
95
- *
96
- * @param key - The string key to read from
97
- * @returns The Beast2-encoded blob value
98
- */
99
- read: state_read,
274
+ export const state_init_typed = (key, value, type) => {
275
+ return East.function([], NullType, $ => {
276
+ const key_expr = East.value(key);
277
+ const value_expr = East.value(value, type);
278
+ $.match(state_read(key_expr), {
279
+ none: ($) => {
280
+ $(state_write(key_expr, some(East.Blob.encodeBeast(value_expr, "v2"))));
281
+ },
282
+ });
283
+ return null;
284
+ });
100
285
  };
101
286
  //# sourceMappingURL=state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/platform/state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGrE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,WAAW,GACpB,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,UAAU,GACnB,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB;;;;;;OAMG;IACH,KAAK,EAAE,WAAW;IAElB;;;;;;OAMG;IACH,IAAI,EAAE,UAAU;CACV,CAAC"}
1
+ {"version":3,"file":"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