tuiuiu.js 0.1.1 → 0.1.4-next.2b42a16

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 (402) hide show
  1. package/README.md +100 -42
  2. package/dist/atoms/button.d.ts.map +1 -1
  3. package/dist/atoms/button.js +17 -9
  4. package/dist/atoms/button.js.map +1 -1
  5. package/dist/atoms/text-input.d.ts +2 -0
  6. package/dist/atoms/text-input.d.ts.map +1 -1
  7. package/dist/atoms/text-input.js +13 -7
  8. package/dist/atoms/text-input.js.map +1 -1
  9. package/dist/atoms/tooltip.d.ts.map +1 -1
  10. package/dist/atoms/tooltip.js +2 -1
  11. package/dist/atoms/tooltip.js.map +1 -1
  12. package/dist/cli/commands/help.d.ts +5 -0
  13. package/dist/cli/commands/help.d.ts.map +1 -0
  14. package/dist/cli/commands/help.js +31 -0
  15. package/dist/cli/commands/help.js.map +1 -0
  16. package/dist/cli/commands/mcp.d.ts +11 -0
  17. package/dist/cli/commands/mcp.d.ts.map +1 -0
  18. package/dist/cli/commands/mcp.js +21 -0
  19. package/dist/cli/commands/mcp.js.map +1 -0
  20. package/dist/cli/commands/storybook.d.ts +5 -0
  21. package/dist/cli/commands/storybook.d.ts.map +1 -0
  22. package/dist/cli/commands/storybook.js +9 -0
  23. package/dist/cli/commands/storybook.js.map +1 -0
  24. package/dist/cli/index.d.ts +14 -0
  25. package/dist/cli/index.d.ts.map +1 -0
  26. package/dist/cli/index.js +50 -0
  27. package/dist/cli/index.js.map +1 -0
  28. package/dist/core/error-boundary.d.ts.map +1 -1
  29. package/dist/core/error-boundary.js +2 -1
  30. package/dist/core/error-boundary.js.map +1 -1
  31. package/dist/core/hotkeys.d.ts +62 -0
  32. package/dist/core/hotkeys.d.ts.map +1 -0
  33. package/dist/core/hotkeys.js +0 -0
  34. package/dist/core/hotkeys.js.map +1 -0
  35. package/dist/core/index.d.ts +3 -1
  36. package/dist/core/index.d.ts.map +1 -1
  37. package/dist/core/index.js +9 -1
  38. package/dist/core/index.js.map +1 -1
  39. package/dist/core/screen.d.ts.map +1 -1
  40. package/dist/core/screen.js +2 -0
  41. package/dist/core/screen.js.map +1 -1
  42. package/dist/core/theme.d.ts +79 -0
  43. package/dist/core/theme.d.ts.map +1 -1
  44. package/dist/core/theme.js +358 -0
  45. package/dist/core/theme.js.map +1 -1
  46. package/dist/design-system/data-display/index.d.ts +9 -6
  47. package/dist/design-system/data-display/index.d.ts.map +1 -1
  48. package/dist/design-system/data-display/index.js +16 -7
  49. package/dist/design-system/data-display/index.js.map +1 -1
  50. package/dist/design-system/feedback/badge.d.ts +21 -4
  51. package/dist/design-system/feedback/badge.d.ts.map +1 -1
  52. package/dist/design-system/feedback/badge.js +15 -2
  53. package/dist/design-system/feedback/badge.js.map +1 -1
  54. package/dist/design-system/forms/index.d.ts +11 -8
  55. package/dist/design-system/forms/index.d.ts.map +1 -1
  56. package/dist/design-system/forms/index.js +19 -10
  57. package/dist/design-system/forms/index.js.map +1 -1
  58. package/dist/design-system/layout/index.d.ts +7 -4
  59. package/dist/design-system/layout/index.d.ts.map +1 -1
  60. package/dist/design-system/layout/index.js +18 -6
  61. package/dist/design-system/layout/index.js.map +1 -1
  62. package/dist/design-system/media/picture.d.ts.map +1 -1
  63. package/dist/design-system/media/picture.js +2 -1
  64. package/dist/design-system/media/picture.js.map +1 -1
  65. package/dist/design-system/overlays/index.d.ts +6 -3
  66. package/dist/design-system/overlays/index.d.ts.map +1 -1
  67. package/dist/design-system/overlays/index.js +9 -3
  68. package/dist/design-system/overlays/index.js.map +1 -1
  69. package/dist/design-system/visual/splash-screen.d.ts.map +1 -1
  70. package/dist/design-system/visual/splash-screen.js +38 -18
  71. package/dist/design-system/visual/splash-screen.js.map +1 -1
  72. package/dist/hooks/index.d.ts +2 -0
  73. package/dist/hooks/index.d.ts.map +1 -1
  74. package/dist/hooks/index.js +2 -0
  75. package/dist/hooks/index.js.map +1 -1
  76. package/dist/hooks/use-hotkeys.d.ts +153 -0
  77. package/dist/hooks/use-hotkeys.d.ts.map +1 -0
  78. package/dist/hooks/use-hotkeys.js +379 -0
  79. package/dist/hooks/use-hotkeys.js.map +1 -0
  80. package/dist/hooks/use-input.d.ts +2 -10
  81. package/dist/hooks/use-input.d.ts.map +1 -1
  82. package/dist/hooks/use-input.js +2 -287
  83. package/dist/hooks/use-input.js.map +1 -1
  84. package/dist/hooks/use-mouse.d.ts +5 -0
  85. package/dist/hooks/use-mouse.d.ts.map +1 -1
  86. package/dist/hooks/use-mouse.js +29 -11
  87. package/dist/hooks/use-mouse.js.map +1 -1
  88. package/dist/index.d.ts +6 -4
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +15 -3
  91. package/dist/index.js.map +1 -1
  92. package/dist/mcp/docs-data.d.ts +31 -0
  93. package/dist/mcp/docs-data.d.ts.map +1 -0
  94. package/dist/mcp/docs-data.js +637 -0
  95. package/dist/mcp/docs-data.js.map +1 -0
  96. package/dist/mcp/index.d.ts +14 -0
  97. package/dist/mcp/index.d.ts.map +1 -0
  98. package/dist/mcp/index.js +12 -0
  99. package/dist/mcp/index.js.map +1 -0
  100. package/dist/mcp/server.d.ts +31 -0
  101. package/dist/mcp/server.d.ts.map +1 -0
  102. package/dist/mcp/server.js +597 -0
  103. package/dist/mcp/server.js.map +1 -0
  104. package/dist/mcp/types.d.ts +114 -0
  105. package/dist/mcp/types.d.ts.map +1 -0
  106. package/dist/mcp/types.js +16 -0
  107. package/dist/mcp/types.js.map +1 -0
  108. package/dist/molecules/autocomplete.d.ts.map +1 -1
  109. package/dist/molecules/autocomplete.js +2 -1
  110. package/dist/molecules/autocomplete.js.map +1 -1
  111. package/dist/molecules/calendar.d.ts.map +1 -1
  112. package/dist/molecules/calendar.js +5 -3
  113. package/dist/molecules/calendar.js.map +1 -1
  114. package/dist/molecules/data-viz/annotations.d.ts +75 -0
  115. package/dist/molecules/data-viz/annotations.d.ts.map +1 -0
  116. package/dist/molecules/data-viz/annotations.js +40 -0
  117. package/dist/molecules/data-viz/annotations.js.map +1 -0
  118. package/dist/molecules/data-viz/gantt-chart.d.ts +66 -0
  119. package/dist/molecules/data-viz/gantt-chart.d.ts.map +1 -0
  120. package/dist/molecules/data-viz/gantt-chart.js +134 -0
  121. package/dist/molecules/data-viz/gantt-chart.js.map +1 -0
  122. package/dist/molecules/data-viz/gauge.d.ts +2 -2
  123. package/dist/molecules/data-viz/gauge.d.ts.map +1 -1
  124. package/dist/molecules/data-viz/gauge.js +24 -8
  125. package/dist/molecules/data-viz/gauge.js.map +1 -1
  126. package/dist/molecules/data-viz/heatmap.d.ts +8 -2
  127. package/dist/molecules/data-viz/heatmap.d.ts.map +1 -1
  128. package/dist/molecules/data-viz/heatmap.js +41 -9
  129. package/dist/molecules/data-viz/heatmap.js.map +1 -1
  130. package/dist/molecules/data-viz/hooks.d.ts +264 -0
  131. package/dist/molecules/data-viz/hooks.d.ts.map +1 -0
  132. package/dist/molecules/data-viz/hooks.js +373 -0
  133. package/dist/molecules/data-viz/hooks.js.map +1 -0
  134. package/dist/molecules/data-viz/index.d.ts +14 -0
  135. package/dist/molecules/data-viz/index.d.ts.map +1 -1
  136. package/dist/molecules/data-viz/index.js +14 -0
  137. package/dist/molecules/data-viz/index.js.map +1 -1
  138. package/dist/molecules/data-viz/legend.d.ts +82 -0
  139. package/dist/molecules/data-viz/legend.d.ts.map +1 -0
  140. package/dist/molecules/data-viz/legend.js +146 -0
  141. package/dist/molecules/data-viz/legend.js.map +1 -0
  142. package/dist/molecules/data-viz/line-chart.d.ts.map +1 -1
  143. package/dist/molecules/data-viz/line-chart.js +48 -12
  144. package/dist/molecules/data-viz/line-chart.js.map +1 -1
  145. package/dist/molecules/data-viz/radar-chart.d.ts +61 -0
  146. package/dist/molecules/data-viz/radar-chart.d.ts.map +1 -0
  147. package/dist/molecules/data-viz/radar-chart.js +86 -0
  148. package/dist/molecules/data-viz/radar-chart.js.map +1 -0
  149. package/dist/molecules/data-viz/scatter-plot.d.ts +97 -0
  150. package/dist/molecules/data-viz/scatter-plot.d.ts.map +1 -0
  151. package/dist/molecules/data-viz/scatter-plot.js +205 -0
  152. package/dist/molecules/data-viz/scatter-plot.js.map +1 -0
  153. package/dist/molecules/data-viz/time-heatmap.d.ts +48 -0
  154. package/dist/molecules/data-viz/time-heatmap.d.ts.map +1 -0
  155. package/dist/molecules/data-viz/time-heatmap.js +145 -0
  156. package/dist/molecules/data-viz/time-heatmap.js.map +1 -0
  157. package/dist/molecules/select.d.ts +2 -0
  158. package/dist/molecules/select.d.ts.map +1 -1
  159. package/dist/molecules/select.js +4 -3
  160. package/dist/molecules/select.js.map +1 -1
  161. package/dist/molecules/tabs.d.ts.map +1 -1
  162. package/dist/molecules/tabs.js +14 -2
  163. package/dist/molecules/tabs.js.map +1 -1
  164. package/dist/organisms/command-palette.d.ts.map +1 -1
  165. package/dist/organisms/command-palette.js +2 -1
  166. package/dist/organisms/command-palette.js.map +1 -1
  167. package/dist/storybook/app.d.ts.map +1 -1
  168. package/dist/storybook/app.js +53 -44
  169. package/dist/storybook/app.js.map +1 -1
  170. package/dist/storybook/components/compare-view.d.ts.map +1 -1
  171. package/dist/storybook/components/compare-view.js +19 -18
  172. package/dist/storybook/components/compare-view.js.map +1 -1
  173. package/dist/storybook/components/log-viewer.d.ts.map +1 -1
  174. package/dist/storybook/components/log-viewer.js +9 -8
  175. package/dist/storybook/components/log-viewer.js.map +1 -1
  176. package/dist/storybook/components/preview.d.ts.map +1 -1
  177. package/dist/storybook/components/preview.js +34 -33
  178. package/dist/storybook/components/preview.js.map +1 -1
  179. package/dist/storybook/components/sidebar.d.ts.map +1 -1
  180. package/dist/storybook/components/sidebar.js +21 -20
  181. package/dist/storybook/components/sidebar.js.map +1 -1
  182. package/dist/storybook/stories/apps/index.d.ts.map +1 -1
  183. package/dist/storybook/stories/apps/index.js +306 -209
  184. package/dist/storybook/stories/apps/index.js.map +1 -1
  185. package/dist/storybook/stories/atoms/index.d.ts.map +1 -1
  186. package/dist/storybook/stories/atoms/index.js.map +1 -1
  187. package/dist/storybook/stories/molecules/index.d.ts +25 -0
  188. package/dist/storybook/stories/molecules/index.d.ts.map +1 -1
  189. package/dist/storybook/stories/molecules/index.js +402 -20
  190. package/dist/storybook/stories/molecules/index.js.map +1 -1
  191. package/dist/storybook/stories/organisms/index.d.ts.map +1 -1
  192. package/dist/storybook/stories/organisms/index.js +1 -1
  193. package/dist/storybook/stories/organisms/index.js.map +1 -1
  194. package/dist/utils/index.d.ts +2 -0
  195. package/dist/utils/index.d.ts.map +1 -1
  196. package/dist/utils/index.js +2 -0
  197. package/dist/utils/index.js.map +1 -1
  198. package/dist/utils/system-data.d.ts +73 -0
  199. package/dist/utils/system-data.d.ts.map +1 -0
  200. package/dist/utils/system-data.js +367 -0
  201. package/dist/utils/system-data.js.map +1 -0
  202. package/dist/version.d.ts +43 -0
  203. package/dist/version.d.ts.map +1 -0
  204. package/dist/version.js +82 -0
  205. package/dist/version.js.map +1 -0
  206. package/package.json +22 -22
  207. package/dist/components/canvas.d.ts +0 -322
  208. package/dist/components/canvas.d.ts.map +0 -1
  209. package/dist/components/canvas.js +0 -833
  210. package/dist/components/canvas.js.map +0 -1
  211. package/dist/components/code-block.d.ts +0 -75
  212. package/dist/components/code-block.d.ts.map +0 -1
  213. package/dist/components/code-block.js +0 -322
  214. package/dist/components/code-block.js.map +0 -1
  215. package/dist/components/components.d.ts +0 -122
  216. package/dist/components/components.d.ts.map +0 -1
  217. package/dist/components/components.js +0 -151
  218. package/dist/components/components.js.map +0 -1
  219. package/dist/components/data-viz/bar-chart.d.ts +0 -167
  220. package/dist/components/data-viz/bar-chart.d.ts.map +0 -1
  221. package/dist/components/data-viz/bar-chart.js +0 -375
  222. package/dist/components/data-viz/bar-chart.js.map +0 -1
  223. package/dist/components/data-viz/gauge.d.ts +0 -163
  224. package/dist/components/data-viz/gauge.d.ts.map +0 -1
  225. package/dist/components/data-viz/gauge.js +0 -451
  226. package/dist/components/data-viz/gauge.js.map +0 -1
  227. package/dist/components/data-viz/heatmap.d.ts +0 -154
  228. package/dist/components/data-viz/heatmap.d.ts.map +0 -1
  229. package/dist/components/data-viz/heatmap.js +0 -458
  230. package/dist/components/data-viz/heatmap.js.map +0 -1
  231. package/dist/components/data-viz/index.d.ts +0 -16
  232. package/dist/components/data-viz/index.d.ts.map +0 -1
  233. package/dist/components/data-viz/index.js +0 -16
  234. package/dist/components/data-viz/index.js.map +0 -1
  235. package/dist/components/data-viz/line-chart.d.ts +0 -157
  236. package/dist/components/data-viz/line-chart.d.ts.map +0 -1
  237. package/dist/components/data-viz/line-chart.js +0 -578
  238. package/dist/components/data-viz/line-chart.js.map +0 -1
  239. package/dist/components/data-viz/sparkline.d.ts +0 -156
  240. package/dist/components/data-viz/sparkline.d.ts.map +0 -1
  241. package/dist/components/data-viz/sparkline.js +0 -325
  242. package/dist/components/data-viz/sparkline.js.map +0 -1
  243. package/dist/components/grid.d.ts +0 -234
  244. package/dist/components/grid.d.ts.map +0 -1
  245. package/dist/components/grid.js +0 -719
  246. package/dist/components/grid.js.map +0 -1
  247. package/dist/components/index.d.ts +0 -33
  248. package/dist/components/index.d.ts.map +0 -1
  249. package/dist/components/index.js +0 -69
  250. package/dist/components/index.js.map +0 -1
  251. package/dist/components/markdown.d.ts +0 -52
  252. package/dist/components/markdown.d.ts.map +0 -1
  253. package/dist/components/markdown.js +0 -341
  254. package/dist/components/markdown.js.map +0 -1
  255. package/dist/components/modal.d.ts +0 -237
  256. package/dist/components/modal.d.ts.map +0 -1
  257. package/dist/components/modal.js +0 -396
  258. package/dist/components/modal.js.map +0 -1
  259. package/dist/components/progress-bar.d.ts +0 -89
  260. package/dist/components/progress-bar.d.ts.map +0 -1
  261. package/dist/components/progress-bar.js +0 -288
  262. package/dist/components/progress-bar.js.map +0 -1
  263. package/dist/components/select.d.ts +0 -114
  264. package/dist/components/select.d.ts.map +0 -1
  265. package/dist/components/select.js +0 -415
  266. package/dist/components/select.js.map +0 -1
  267. package/dist/components/spinner.d.ts +0 -71
  268. package/dist/components/spinner.d.ts.map +0 -1
  269. package/dist/components/spinner.js +0 -300
  270. package/dist/components/spinner.js.map +0 -1
  271. package/dist/components/split-panel.d.ts +0 -175
  272. package/dist/components/split-panel.d.ts.map +0 -1
  273. package/dist/components/split-panel.js +0 -322
  274. package/dist/components/split-panel.js.map +0 -1
  275. package/dist/components/table.d.ts +0 -103
  276. package/dist/components/table.d.ts.map +0 -1
  277. package/dist/components/table.js +0 -359
  278. package/dist/components/table.js.map +0 -1
  279. package/dist/components/text-input.d.ts +0 -79
  280. package/dist/components/text-input.d.ts.map +0 -1
  281. package/dist/components/text-input.js +0 -332
  282. package/dist/components/text-input.js.map +0 -1
  283. package/dist/design-system/data-display/calendar.d.ts +0 -141
  284. package/dist/design-system/data-display/calendar.d.ts.map +0 -1
  285. package/dist/design-system/data-display/calendar.js +0 -524
  286. package/dist/design-system/data-display/calendar.js.map +0 -1
  287. package/dist/design-system/data-display/code-block.d.ts +0 -75
  288. package/dist/design-system/data-display/code-block.d.ts.map +0 -1
  289. package/dist/design-system/data-display/code-block.js +0 -311
  290. package/dist/design-system/data-display/code-block.js.map +0 -1
  291. package/dist/design-system/data-display/data-table.d.ts +0 -173
  292. package/dist/design-system/data-display/data-table.d.ts.map +0 -1
  293. package/dist/design-system/data-display/data-table.js +0 -428
  294. package/dist/design-system/data-display/data-table.js.map +0 -1
  295. package/dist/design-system/data-display/markdown.d.ts +0 -52
  296. package/dist/design-system/data-display/markdown.d.ts.map +0 -1
  297. package/dist/design-system/data-display/markdown.js +0 -341
  298. package/dist/design-system/data-display/markdown.js.map +0 -1
  299. package/dist/design-system/data-display/table.d.ts +0 -103
  300. package/dist/design-system/data-display/table.d.ts.map +0 -1
  301. package/dist/design-system/data-display/table.js +0 -342
  302. package/dist/design-system/data-display/table.js.map +0 -1
  303. package/dist/design-system/data-display/tree.d.ts +0 -166
  304. package/dist/design-system/data-display/tree.d.ts.map +0 -1
  305. package/dist/design-system/data-display/tree.js +0 -428
  306. package/dist/design-system/data-display/tree.js.map +0 -1
  307. package/dist/design-system/forms/autocomplete.d.ts +0 -163
  308. package/dist/design-system/forms/autocomplete.d.ts.map +0 -1
  309. package/dist/design-system/forms/autocomplete.js +0 -455
  310. package/dist/design-system/forms/autocomplete.js.map +0 -1
  311. package/dist/design-system/forms/button.d.ts +0 -106
  312. package/dist/design-system/forms/button.d.ts.map +0 -1
  313. package/dist/design-system/forms/button.js +0 -170
  314. package/dist/design-system/forms/button.js.map +0 -1
  315. package/dist/design-system/forms/multi-select.d.ts +0 -102
  316. package/dist/design-system/forms/multi-select.d.ts.map +0 -1
  317. package/dist/design-system/forms/multi-select.js +0 -309
  318. package/dist/design-system/forms/multi-select.js.map +0 -1
  319. package/dist/design-system/forms/radio-group.d.ts +0 -88
  320. package/dist/design-system/forms/radio-group.d.ts.map +0 -1
  321. package/dist/design-system/forms/radio-group.js +0 -145
  322. package/dist/design-system/forms/radio-group.js.map +0 -1
  323. package/dist/design-system/forms/select.d.ts +0 -116
  324. package/dist/design-system/forms/select.d.ts.map +0 -1
  325. package/dist/design-system/forms/select.js +0 -441
  326. package/dist/design-system/forms/select.js.map +0 -1
  327. package/dist/design-system/forms/slider.d.ts +0 -134
  328. package/dist/design-system/forms/slider.d.ts.map +0 -1
  329. package/dist/design-system/forms/slider.js +0 -314
  330. package/dist/design-system/forms/slider.js.map +0 -1
  331. package/dist/design-system/forms/switch.d.ts +0 -99
  332. package/dist/design-system/forms/switch.d.ts.map +0 -1
  333. package/dist/design-system/forms/switch.js +0 -173
  334. package/dist/design-system/forms/switch.js.map +0 -1
  335. package/dist/design-system/forms/text-input.d.ts +0 -79
  336. package/dist/design-system/forms/text-input.d.ts.map +0 -1
  337. package/dist/design-system/forms/text-input.js +0 -344
  338. package/dist/design-system/forms/text-input.js.map +0 -1
  339. package/dist/design-system/layout/collapsible.d.ts +0 -166
  340. package/dist/design-system/layout/collapsible.d.ts.map +0 -1
  341. package/dist/design-system/layout/collapsible.js +0 -286
  342. package/dist/design-system/layout/collapsible.js.map +0 -1
  343. package/dist/design-system/layout/scroll-area.d.ts +0 -188
  344. package/dist/design-system/layout/scroll-area.d.ts.map +0 -1
  345. package/dist/design-system/layout/scroll-area.js +0 -348
  346. package/dist/design-system/layout/scroll-area.js.map +0 -1
  347. package/dist/design-system/layout/split-panel.d.ts +0 -183
  348. package/dist/design-system/layout/split-panel.d.ts.map +0 -1
  349. package/dist/design-system/layout/split-panel.js +0 -323
  350. package/dist/design-system/layout/split-panel.js.map +0 -1
  351. package/dist/design-system/layout/tabs.d.ts +0 -129
  352. package/dist/design-system/layout/tabs.d.ts.map +0 -1
  353. package/dist/design-system/layout/tabs.js +0 -373
  354. package/dist/design-system/layout/tabs.js.map +0 -1
  355. package/dist/design-system/overlays/command-palette.d.ts +0 -217
  356. package/dist/design-system/overlays/command-palette.d.ts.map +0 -1
  357. package/dist/design-system/overlays/command-palette.js +0 -443
  358. package/dist/design-system/overlays/command-palette.js.map +0 -1
  359. package/dist/design-system/overlays/modal.d.ts +0 -251
  360. package/dist/design-system/overlays/modal.d.ts.map +0 -1
  361. package/dist/design-system/overlays/modal.js +0 -461
  362. package/dist/design-system/overlays/modal.js.map +0 -1
  363. package/dist/design-system/overlays/overlay-stack.d.ts +0 -200
  364. package/dist/design-system/overlays/overlay-stack.d.ts.map +0 -1
  365. package/dist/design-system/overlays/overlay-stack.js +0 -341
  366. package/dist/design-system/overlays/overlay-stack.js.map +0 -1
  367. package/dist/design-system/primitives/box.d.ts +0 -16
  368. package/dist/design-system/primitives/box.d.ts.map +0 -1
  369. package/dist/design-system/primitives/box.js +0 -23
  370. package/dist/design-system/primitives/box.js.map +0 -1
  371. package/dist/design-system/primitives/divider.d.ts +0 -52
  372. package/dist/design-system/primitives/divider.d.ts.map +0 -1
  373. package/dist/design-system/primitives/divider.js +0 -72
  374. package/dist/design-system/primitives/divider.js.map +0 -1
  375. package/dist/design-system/primitives/helpers.d.ts +0 -10
  376. package/dist/design-system/primitives/helpers.d.ts.map +0 -1
  377. package/dist/design-system/primitives/helpers.js +0 -27
  378. package/dist/design-system/primitives/helpers.js.map +0 -1
  379. package/dist/design-system/primitives/index.d.ts +0 -11
  380. package/dist/design-system/primitives/index.d.ts.map +0 -1
  381. package/dist/design-system/primitives/index.js +0 -14
  382. package/dist/design-system/primitives/index.js.map +0 -1
  383. package/dist/design-system/primitives/slot.d.ts +0 -35
  384. package/dist/design-system/primitives/slot.d.ts.map +0 -1
  385. package/dist/design-system/primitives/slot.js +0 -17
  386. package/dist/design-system/primitives/slot.js.map +0 -1
  387. package/dist/design-system/primitives/spacer.d.ts +0 -34
  388. package/dist/design-system/primitives/spacer.d.ts.map +0 -1
  389. package/dist/design-system/primitives/spacer.js +0 -53
  390. package/dist/design-system/primitives/spacer.js.map +0 -1
  391. package/dist/design-system/primitives/text.d.ts +0 -12
  392. package/dist/design-system/primitives/text.d.ts.map +0 -1
  393. package/dist/design-system/primitives/text.js +0 -25
  394. package/dist/design-system/primitives/text.js.map +0 -1
  395. package/dist/design-system/primitives/utilities.d.ts +0 -70
  396. package/dist/design-system/primitives/utilities.d.ts.map +0 -1
  397. package/dist/design-system/primitives/utilities.js +0 -56
  398. package/dist/design-system/primitives/utilities.js.map +0 -1
  399. package/dist/storybook/cli.d.ts +0 -10
  400. package/dist/storybook/cli.d.ts.map +0 -1
  401. package/dist/storybook/cli.js +0 -14
  402. package/dist/storybook/cli.js.map +0 -1
@@ -13,6 +13,9 @@
13
13
  import { Box, Text, Spacer } from '../../../primitives/nodes.js';
14
14
  import { Divider } from '../../../primitives/divider.js';
15
15
  import { story, defaultControls } from '../../core/registry.js';
16
+ import { getContrastColor } from '../../../core/theme.js';
17
+ // Helper for background + contrasting text
18
+ const bgText = (bg, text, props = {}) => Text({ color: getContrastColor(bg), backgroundColor: bg, ...props }, text);
16
19
  // ============================================================================
17
20
  // Navbars & Headers
18
21
  // ============================================================================
@@ -20,24 +23,32 @@ export const navbarStories = [
20
23
  story('Navbar - Simple')
21
24
  .category('Apps')
22
25
  .description('Simple top navigation bar')
23
- .render(() => Box({
24
- flexDirection: 'row',
25
- width: 80,
26
- backgroundColor: 'blue',
27
- paddingX: 2,
28
- paddingY: 1,
29
- }, Text({ color: 'white', bold: true }, '🚀 MyApp'), Spacer({}), Box({ flexDirection: 'row', gap: 3 }, Text({ color: 'cyan' }, 'Home'), Text({ color: 'gray' }, 'Files'), Text({ color: 'gray' }, 'Settings'), Text({ color: 'gray' }, 'Help')))),
26
+ .render(() => {
27
+ const bg = 'blue';
28
+ const fg = getContrastColor(bg);
29
+ return Box({
30
+ flexDirection: 'row',
31
+ width: 80,
32
+ backgroundColor: bg,
33
+ paddingX: 2,
34
+ paddingY: 1,
35
+ }, Text({ color: fg, backgroundColor: bg, bold: true }, '🚀 MyApp'), Spacer({}), Box({ flexDirection: 'row', gap: 3 }, Text({ color: 'cyan', backgroundColor: bg }, 'Home'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Files'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Settings'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Help')));
36
+ }),
30
37
  story('Navbar - With Search')
31
38
  .category('Apps')
32
39
  .description('Navigation bar with search input')
33
- .render(() => Box({
34
- flexDirection: 'row',
35
- width: 80,
36
- backgroundColor: 'gray',
37
- paddingX: 2,
38
- paddingY: 1,
39
- gap: 2,
40
- }, Text({ color: 'white', bold: true }, '📦 PackageManager'), Box({ borderStyle: 'single', borderColor: 'white', paddingX: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, '🔍 Search packages...')), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'cyan' }, 'Browse'), Text({ color: 'gray' }, 'Installed'), Text({ color: 'gray' }, 'Updates')))),
40
+ .render(() => {
41
+ const bg = 'gray';
42
+ const fg = getContrastColor(bg);
43
+ return Box({
44
+ flexDirection: 'row',
45
+ width: 80,
46
+ backgroundColor: bg,
47
+ paddingX: 2,
48
+ paddingY: 1,
49
+ gap: 2,
50
+ }, Text({ color: fg, backgroundColor: bg, bold: true }, '📦 PackageManager'), Box({ borderStyle: 'single', borderColor: fg, paddingX: 1, flexGrow: 1 }, Text({ color: fg, backgroundColor: bg, dim: true }, '🔍 Search packages...')), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'cyan', backgroundColor: bg }, 'Browse'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Installed'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Updates')));
51
+ }),
41
52
  story('Navbar - Breadcrumb Style')
42
53
  .category('Apps')
43
54
  .description('Navigation with breadcrumb path')
@@ -57,15 +68,24 @@ export const navbarStories = [
57
68
  })
58
69
  .render((props) => {
59
70
  const tabs = ['📄 index.ts', '📄 app.ts', '📄 utils.ts', '📄 types.ts'];
71
+ const barBg = 'gray';
72
+ const activeBg = 'blue';
73
+ const barFg = getContrastColor(barBg);
74
+ const activeFg = getContrastColor(activeBg);
60
75
  return Box({
61
76
  flexDirection: 'row',
62
77
  width: 80,
63
- backgroundColor: 'gray',
64
- }, ...tabs.map((tab, idx) => Box({
65
- paddingX: 2,
66
- paddingY: 1,
67
- backgroundColor: idx === props.activeTab ? 'blue' : undefined,
68
- }, Text({ color: idx === props.activeTab ? 'white' : 'gray' }, tab), idx === props.activeTab ? Text({ color: 'gray', dim: true }, ' ×') : null)), Spacer({}), Box({ paddingX: 2, paddingY: 1 }, Text({ color: 'gray' }, '+')));
78
+ backgroundColor: barBg,
79
+ }, ...tabs.map((tab, idx) => {
80
+ const isActive = idx === props.activeTab;
81
+ const bg = isActive ? activeBg : barBg;
82
+ const fg = isActive ? activeFg : barFg;
83
+ return Box({
84
+ paddingX: 2,
85
+ paddingY: 1,
86
+ backgroundColor: bg,
87
+ }, Text({ color: fg, backgroundColor: bg }, tab), isActive ? Text({ color: fg, backgroundColor: bg, dim: true }, ' ×') : null);
88
+ }), Spacer({}), Box({ paddingX: 2, paddingY: 1 }, Text({ color: barFg, backgroundColor: barBg }, '+')));
69
89
  }),
70
90
  ];
71
91
  // ============================================================================
@@ -75,19 +95,23 @@ export const sidebarStories = [
75
95
  story('Sidebar - File Explorer')
76
96
  .category('Apps')
77
97
  .description('File explorer sidebar')
78
- .render(() => Box({
79
- flexDirection: 'column',
80
- width: 30,
81
- height: 20,
82
- borderStyle: 'single',
83
- borderColor: 'gray',
84
- },
85
- // Header
86
- Box({ paddingX: 1, backgroundColor: 'blue' }, Text({ color: 'white', bold: true }, 'EXPLORER')),
87
- // Tree
88
- Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '▼ 📁 tuiuiu'), Text({ color: 'gray' }, ' ▼ 📁 src'), Text({ color: 'cyan' }, ' ▶ 📁 components'), Text({ color: 'cyan' }, ' ▶ 📁 core'), Text({ inverse: true }, ' 📄 index.ts'), Text({}, ' 📄 types.ts'), Text({ color: 'gray' }, ' ▼ 📁 tests'), Text({}, ' 📄 app.test.ts'), Text({}, ' 📄 package.json'), Text({}, ' 📄 README.md'), Spacer({})),
89
- // Footer
90
- Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '12 files, 4 folders')))),
98
+ .render(() => {
99
+ const headerBg = 'blue';
100
+ const headerFg = getContrastColor(headerBg);
101
+ return Box({
102
+ flexDirection: 'column',
103
+ width: 30,
104
+ height: 20,
105
+ borderStyle: 'single',
106
+ borderColor: 'gray',
107
+ },
108
+ // Header
109
+ Box({ paddingX: 1, backgroundColor: headerBg }, Text({ color: headerFg, backgroundColor: headerBg, bold: true }, 'EXPLORER')),
110
+ // Tree
111
+ Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '▼ 📁 tuiuiu'), Text({ color: 'gray' }, ' ▼ 📁 src'), Text({ color: 'cyan' }, ' ▶ 📁 components'), Text({ color: 'cyan' }, ' ▶ 📁 core'), Text({ inverse: true }, ' 📄 index.ts'), Text({}, ' 📄 types.ts'), Text({ color: 'gray' }, ' ▼ 📁 tests'), Text({}, ' 📄 app.test.ts'), Text({}, ' 📄 package.json'), Text({}, ' 📄 README.md'), Spacer({})),
112
+ // Footer
113
+ Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '12 files, 4 folders')));
114
+ }),
91
115
  story('Sidebar - Navigation Menu')
92
116
  .category('Apps')
93
117
  .description('Navigation menu sidebar')
@@ -102,6 +126,8 @@ export const sidebarStories = [
102
126
  { icon: '📁', label: 'Files' },
103
127
  { icon: '⚙️', label: 'Settings' },
104
128
  ];
129
+ const activeBg = 'cyan';
130
+ const activeFg = getContrastColor(activeBg);
105
131
  return Box({
106
132
  flexDirection: 'column',
107
133
  width: 25,
@@ -112,11 +138,16 @@ export const sidebarStories = [
112
138
  // Logo
113
139
  Box({ paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'cyan' }, Text({ color: 'cyan', bold: true }, '🚀 MyApp')),
114
140
  // Menu items
115
- Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, ...items.map((item, idx) => Box({
116
- paddingX: 1,
117
- paddingY: 0,
118
- backgroundColor: idx === props.activeItem ? 'cyan' : undefined,
119
- }, Text({ color: idx === props.activeItem ? 'white' : 'gray' }, `${item.icon} ${item.label}`))), Spacer({})),
141
+ Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, ...items.map((item, idx) => {
142
+ const isActive = idx === props.activeItem;
143
+ const bg = isActive ? activeBg : undefined;
144
+ const fg = isActive ? activeFg : 'gray';
145
+ return Box({
146
+ paddingX: 1,
147
+ paddingY: 0,
148
+ backgroundColor: bg,
149
+ }, Text({ color: fg, backgroundColor: bg }, `${item.icon} ${item.label}`));
150
+ }), Spacer({})),
120
151
  // User
121
152
  Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray' }, '👤 john@example.com')));
122
153
  }),
@@ -149,25 +180,33 @@ export const statusBarStories = [
149
180
  story('StatusBar - Editor Style')
150
181
  .category('Apps')
151
182
  .description('VS Code-style status bar')
152
- .render(() => Box({
153
- flexDirection: 'row',
154
- width: 80,
155
- backgroundColor: 'blue',
156
- paddingX: 1,
157
- },
158
- // Left section
159
- Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'white' }, '⎇ main'), Text({ color: 'white' }, '↻ 0 ↓ 0'), Text({ color: 'yellow' }, '⚠ 2'), Text({ color: 'red' }, '✗ 1')), Spacer({}),
160
- // Right section
161
- Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'white' }, 'Ln 42, Col 15'), Text({ color: 'white' }, 'UTF-8'), Text({ color: 'white' }, 'LF'), Text({ color: 'white' }, 'TypeScript'), Text({ color: 'white' }, '⚡ Prettier')))),
183
+ .render(() => {
184
+ const bg = 'blue';
185
+ const fg = getContrastColor(bg);
186
+ return Box({
187
+ flexDirection: 'row',
188
+ width: 80,
189
+ backgroundColor: bg,
190
+ paddingX: 1,
191
+ },
192
+ // Left section
193
+ Box({ flexDirection: 'row', gap: 2 }, Text({ color: fg, backgroundColor: bg }, '⎇ main'), Text({ color: fg, backgroundColor: bg }, '↻ 0 ↓ 0'), Text({ color: 'yellow', backgroundColor: bg }, '⚠ 2'), Text({ color: 'red', backgroundColor: bg }, '✗ 1')), Spacer({}),
194
+ // Right section
195
+ Box({ flexDirection: 'row', gap: 2 }, Text({ color: fg, backgroundColor: bg }, 'Ln 42, Col 15'), Text({ color: fg, backgroundColor: bg }, 'UTF-8'), Text({ color: fg, backgroundColor: bg }, 'LF'), Text({ color: fg, backgroundColor: bg }, 'TypeScript'), Text({ color: fg, backgroundColor: bg }, '⚡ Prettier')));
196
+ }),
162
197
  story('StatusBar - Terminal Style')
163
198
  .category('Apps')
164
199
  .description('Terminal-style status bar')
165
- .render(() => Box({
166
- flexDirection: 'row',
167
- width: 80,
168
- backgroundColor: 'gray',
169
- paddingX: 1,
170
- }, Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'green' }, '●'), Text({ color: 'white' }, 'zsh'), Text({ color: 'cyan' }, '~/projects/tuiuiu')), Spacer({}), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'yellow' }, '⏱ 0.52s'), Text({ color: 'white' }, '🕐 14:32:15')))),
200
+ .render(() => {
201
+ const bg = 'gray';
202
+ const fg = getContrastColor(bg);
203
+ return Box({
204
+ flexDirection: 'row',
205
+ width: 80,
206
+ backgroundColor: bg,
207
+ paddingX: 1,
208
+ }, Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'green', backgroundColor: bg }, '●'), Text({ color: fg, backgroundColor: bg }, 'zsh'), Text({ color: 'cyan', backgroundColor: bg }, '~/projects/tuiuiu')), Spacer({}), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'yellow', backgroundColor: bg }, '⏱ 0.52s'), Text({ color: fg, backgroundColor: bg }, '🕐 14:32:15')));
209
+ }),
171
210
  story('StatusBar - Progress')
172
211
  .category('Apps')
173
212
  .description('Status bar with progress indicator')
@@ -181,21 +220,31 @@ export const statusBarStories = [
181
220
  story('StatusBar - Multi-Section')
182
221
  .category('Apps')
183
222
  .description('Status bar with multiple sections')
184
- .render(() => Box({
185
- flexDirection: 'row',
186
- width: 80,
187
- backgroundColor: 'gray',
188
- },
189
- // Mode indicator
190
- Box({ backgroundColor: 'green', paddingX: 1 }, Text({ color: 'white', bold: true }, 'NORMAL')),
191
- // File info
192
- Box({ paddingX: 2 }, Text({ color: 'white' }, '📄 index.ts')),
193
- // Modified indicator
194
- Box({ paddingX: 1 }, Text({ color: 'yellow' }, '[+]')), Spacer({}),
195
- // Position
196
- Box({ backgroundColor: 'blue', paddingX: 1 }, Text({ color: 'white' }, '42:15')),
197
- // Percentage
198
- Box({ backgroundColor: 'cyan', paddingX: 1 }, Text({ color: 'white' }, '68%')))),
223
+ .render(() => {
224
+ const baseBg = 'gray';
225
+ const baseFg = getContrastColor(baseBg);
226
+ const modeBg = 'green';
227
+ const modeFg = getContrastColor(modeBg);
228
+ const posBg = 'blue';
229
+ const posFg = getContrastColor(posBg);
230
+ const pctBg = 'cyan';
231
+ const pctFg = getContrastColor(pctBg);
232
+ return Box({
233
+ flexDirection: 'row',
234
+ width: 80,
235
+ backgroundColor: baseBg,
236
+ },
237
+ // Mode indicator
238
+ Box({ backgroundColor: modeBg, paddingX: 1 }, Text({ color: modeFg, backgroundColor: modeBg, bold: true }, 'NORMAL')),
239
+ // File info
240
+ Box({ paddingX: 2 }, Text({ color: baseFg, backgroundColor: baseBg }, '📄 index.ts')),
241
+ // Modified indicator
242
+ Box({ paddingX: 1 }, Text({ color: 'yellow', backgroundColor: baseBg }, '[+]')), Spacer({}),
243
+ // Position
244
+ Box({ backgroundColor: posBg, paddingX: 1 }, Text({ color: posFg, backgroundColor: posBg }, '42:15')),
245
+ // Percentage
246
+ Box({ backgroundColor: pctBg, paddingX: 1 }, Text({ color: pctFg, backgroundColor: pctBg }, '68%')));
247
+ }),
199
248
  ];
200
249
  // ============================================================================
201
250
  // Command Interfaces
@@ -246,7 +295,11 @@ export const commandStories = [
246
295
  borderStyle: 'single',
247
296
  borderColor: 'gray',
248
297
  marginTop: 0,
249
- }, Box({ backgroundColor: 'blue', paddingX: 1 }, Text({ color: 'white' }, 'checkout'), Text({ color: 'gray', dim: true }, ' Switch branches')), Box({ paddingX: 1 }, Text({ color: 'gray' }, 'cherry-pick'), Text({ color: 'gray', dim: true }, ' Apply commits')), Box({ paddingX: 1 }, Text({ color: 'gray' }, 'cherry'), Text({ color: 'gray', dim: true }, ' Find commits'))))),
298
+ }, (() => {
299
+ const selBg = 'blue';
300
+ const selFg = getContrastColor(selBg);
301
+ return Box({ backgroundColor: selBg, paddingX: 1 }, Text({ color: selFg, backgroundColor: selBg }, 'checkout'), Text({ color: selFg, backgroundColor: selBg, dim: true }, ' Switch branches'));
302
+ })(), Box({ paddingX: 1 }, Text({ color: 'gray' }, 'cherry-pick'), Text({ color: 'gray', dim: true }, ' Apply commits')), Box({ paddingX: 1 }, Text({ color: 'gray' }, 'cherry'), Text({ color: 'gray', dim: true }, ' Find commits'))))),
250
303
  story('Command - Palette')
251
304
  .category('Apps')
252
305
  .description('Command palette with keyboard shortcuts')
@@ -259,7 +312,11 @@ export const commandStories = [
259
312
  // Search
260
313
  Box({ paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray' }, '> '), Text({ color: 'white' }, 'file'), Text({ color: 'cyan' }, '▋')),
261
314
  // Results
262
- Box({ flexDirection: 'column', padding: 1 }, Box({ backgroundColor: 'blue', paddingX: 1, flexDirection: 'row' }, Text({ color: 'white' }, '📄 New File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+N')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '📂 Open File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+O')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '💾 Save File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+S')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '📋 Save All Files'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+Shift+S'))),
315
+ Box({ flexDirection: 'column', padding: 1 }, (() => {
316
+ const selBg = 'blue';
317
+ const selFg = getContrastColor(selBg);
318
+ return Box({ backgroundColor: selBg, paddingX: 1, flexDirection: 'row' }, Text({ color: selFg, backgroundColor: selBg }, '📄 New File'), Spacer({}), Text({ color: selFg, backgroundColor: selBg, dim: true }, 'Ctrl+N'));
319
+ })(), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '📂 Open File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+O')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '💾 Save File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+S')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '📋 Save All Files'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+Shift+S'))),
263
320
  // Footer
264
321
  Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '↑↓ Navigate ↵ Select Esc Close')))),
265
322
  ];
@@ -270,155 +327,195 @@ export const appShellStories = [
270
327
  story('Shell - Editor')
271
328
  .category('Apps')
272
329
  .description('Complete code editor layout')
273
- .render(() => Box({
274
- flexDirection: 'column',
275
- width: 80,
276
- height: 24,
277
- },
278
- // Top bar (tabs)
279
- Box({ flexDirection: 'row', backgroundColor: 'gray' }, Box({ paddingX: 2, backgroundColor: 'blue' }, Text({ color: 'white' }, '📄 index.ts ×')), Box({ paddingX: 2 }, Text({ color: 'gray' }, '📄 app.ts')), Box({ paddingX: 2 }, Text({ color: 'gray' }, '📄 utils.ts')), Spacer({})),
280
- // Main content
281
- Box({ flexDirection: 'row', flexGrow: 1 },
282
- // Sidebar
283
- Box({
284
- width: 25,
285
- flexDirection: 'column',
286
- borderStyle: 'single',
287
- borderColor: 'gray',
288
- }, Box({ paddingX: 1, backgroundColor: 'gray' }, Text({ color: 'white' }, 'EXPLORER')), Box({ padding: 1, flexDirection: 'column', flexGrow: 1 }, Text({ color: 'yellow' }, ' 📁 src'), Text({ inverse: true }, ' 📄 index.ts'), Text({}, ' 📄 app.ts'), Text({}, ' 📄 utils.ts'), Text({ color: 'cyan' }, ' 📁 tests'), Spacer({}))),
289
- // Editor area
290
- Box({
291
- flexGrow: 1,
292
- flexDirection: 'column',
293
- borderStyle: 'single',
294
- borderColor: 'gray',
295
- }, Box({ padding: 1, flexGrow: 1, flexDirection: 'column' }, Text({ color: 'gray' }, ' 1 '), Text({}, ''), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 2 '), Text({ color: 'magenta' }, 'import '), Text({ color: 'cyan' }, '{ App }'), Text({ color: 'magenta' }, ' from '), Text({ color: 'green' }, "'./app'")), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 3 '), Text({})), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 4 '), Text({ color: 'magenta' }, 'export '), Text({ color: 'cyan' }, 'function '), Text({ color: 'yellow' }, 'main'), Text({}, '() {')), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 5 '), Text({}, ' '), Text({ color: 'cyan' }, 'const '), Text({}, 'app = '), Text({ color: 'magenta' }, 'new '), Text({ color: 'yellow' }, 'App'), Text({}, '()▋')), Spacer({})))),
296
- // Status bar
297
- Box({ flexDirection: 'row', backgroundColor: 'blue', paddingX: 1 }, Text({ color: 'white' }, ' main'), Text({ color: 'white' }, ' 0 ⚠ 0'), Spacer({}), Text({ color: 'white' }, 'Ln 5, Col 28'), Text({ color: 'white' }, ' TypeScript')))),
330
+ .render(() => {
331
+ const tabBarBg = 'gray';
332
+ const tabBarFg = getContrastColor(tabBarBg);
333
+ const activeTabBg = 'blue';
334
+ const activeTabFg = getContrastColor(activeTabBg);
335
+ const sidebarHeaderBg = 'gray';
336
+ const sidebarHeaderFg = getContrastColor(sidebarHeaderBg);
337
+ const statusBg = 'blue';
338
+ const statusFg = getContrastColor(statusBg);
339
+ return Box({
340
+ flexDirection: 'column',
341
+ width: 80,
342
+ height: 24,
343
+ },
344
+ // Top bar (tabs)
345
+ Box({ flexDirection: 'row', backgroundColor: tabBarBg }, Box({ paddingX: 2, backgroundColor: activeTabBg }, Text({ color: activeTabFg, backgroundColor: activeTabBg }, '📄 index.ts ×')), Box({ paddingX: 2 }, Text({ color: tabBarFg, backgroundColor: tabBarBg }, '📄 app.ts')), Box({ paddingX: 2 }, Text({ color: tabBarFg, backgroundColor: tabBarBg }, '📄 utils.ts')), Spacer({})),
346
+ // Main content
347
+ Box({ flexDirection: 'row', flexGrow: 1 },
348
+ // Sidebar
349
+ Box({
350
+ width: 25,
351
+ flexDirection: 'column',
352
+ borderStyle: 'single',
353
+ borderColor: 'gray',
354
+ }, Box({ paddingX: 1, backgroundColor: sidebarHeaderBg }, Text({ color: sidebarHeaderFg, backgroundColor: sidebarHeaderBg }, 'EXPLORER')), Box({ padding: 1, flexDirection: 'column', flexGrow: 1 }, Text({ color: 'yellow' }, ' 📁 src'), Text({ inverse: true }, ' 📄 index.ts'), Text({}, ' 📄 app.ts'), Text({}, ' 📄 utils.ts'), Text({ color: 'cyan' }, '▶ 📁 tests'), Spacer({}))),
355
+ // Editor area
356
+ Box({
357
+ flexGrow: 1,
358
+ flexDirection: 'column',
359
+ borderStyle: 'single',
360
+ borderColor: 'gray',
361
+ }, Box({ padding: 1, flexGrow: 1, flexDirection: 'column' }, Text({ color: 'gray' }, ' 1 '), Text({}, ''), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 2 '), Text({ color: 'magenta' }, 'import '), Text({ color: 'cyan' }, '{ App }'), Text({ color: 'magenta' }, ' from '), Text({ color: 'green' }, "'./app'")), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 3 '), Text({})), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 4 '), Text({ color: 'magenta' }, 'export '), Text({ color: 'cyan' }, 'function '), Text({ color: 'yellow' }, 'main'), Text({}, '() {')), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 5 '), Text({}, ' '), Text({ color: 'cyan' }, 'const '), Text({}, 'app = '), Text({ color: 'magenta' }, 'new '), Text({ color: 'yellow' }, 'App'), Text({}, '()▋')), Spacer({})))),
362
+ // Status bar
363
+ Box({ flexDirection: 'row', backgroundColor: statusBg, paddingX: 1 }, Text({ color: statusFg, backgroundColor: statusBg }, '⎇ main'), Text({ color: statusFg, backgroundColor: statusBg }, ' ✓ 0 ⚠ 0'), Spacer({}), Text({ color: statusFg, backgroundColor: statusBg }, 'Ln 5, Col 28'), Text({ color: statusFg, backgroundColor: statusBg }, ' TypeScript')));
364
+ }),
298
365
  story('Shell - Dashboard')
299
366
  .category('Apps')
300
367
  .description('Dashboard application layout')
301
- .render(() => Box({
302
- flexDirection: 'column',
303
- width: 80,
304
- height: 24,
305
- },
306
- // Header
307
- Box({ flexDirection: 'row', backgroundColor: 'blue', paddingX: 2, paddingY: 1 }, Text({ color: 'white', bold: true }, '📊 Analytics Dashboard'), Spacer({}), Text({ color: 'cyan' }, '🔔 3'), Text({ color: 'white' }, ' 👤 Admin')),
308
- // Main content
309
- Box({ flexDirection: 'row', flexGrow: 1 },
310
- // Sidebar
311
- Box({
312
- width: 20,
313
- flexDirection: 'column',
314
- borderStyle: 'single',
315
- borderColor: 'gray',
316
- padding: 1,
317
- }, Box({ backgroundColor: 'cyan', paddingX: 1 }, Text({ color: 'white' }, '🏠 Overview')), Text({ color: 'gray' }, '📈 Analytics'), Text({ color: 'gray' }, '👥 Users'), Text({ color: 'gray' }, '💰 Revenue'), Text({ color: 'gray' }, '📦 Products'), Spacer({}), Divider({ color: 'gray' }), Text({ color: 'gray' }, '⚙️ Settings')),
318
- // Content area
319
- Box({
320
- flexGrow: 1,
321
- flexDirection: 'column',
322
- padding: 1,
323
- gap: 1,
324
- },
325
- // Stats row
326
- Box({ flexDirection: 'row', gap: 1 }, Box({ borderStyle: 'round', borderColor: 'cyan', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Users'), Text({}, ''), Text({ color: 'cyan', bold: true }, '12,543')), Box({ borderStyle: 'round', borderColor: 'green', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Revenue'), Text({}, ''), Text({ color: 'green', bold: true }, '$45.2k')), Box({ borderStyle: 'round', borderColor: 'yellow', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Orders'), Text({}, ''), Text({ color: 'yellow', bold: true }, '892'))),
327
- // Chart area
328
- Box({
329
- borderStyle: 'single',
330
- borderColor: 'gray',
331
- padding: 1,
332
- flexGrow: 1,
333
- }, Box({ flexDirection: 'column' }, Text({ color: 'white', bold: true }, 'Traffic Overview'), Text({}), Text({ color: 'cyan' }, ' ▂▃▅▇█▇▅▃▂▃▅▇█▇▅▃▂'), Text({ color: 'gray' }, ' 0 ─┼─────────────────────'), Text({ color: 'gray', dim: true }, ' Mon Tue Wed Thu Fri'))))),
334
- // Footer
335
- Box({ flexDirection: 'row', backgroundColor: 'gray', paddingX: 1 }, Text({ color: 'white' }, '● Connected'), Spacer({}), Text({ color: 'gray' }, 'Last updated: 2 min ago')))),
368
+ .render(() => {
369
+ const headerBg = 'blue';
370
+ const headerFg = getContrastColor(headerBg);
371
+ const activeBg = 'cyan';
372
+ const activeFg = getContrastColor(activeBg);
373
+ const footerBg = 'gray';
374
+ const footerFg = getContrastColor(footerBg);
375
+ return Box({
376
+ flexDirection: 'column',
377
+ width: 80,
378
+ height: 24,
379
+ },
380
+ // Header
381
+ Box({ flexDirection: 'row', backgroundColor: headerBg, paddingX: 2, paddingY: 1 }, Text({ color: headerFg, backgroundColor: headerBg, bold: true }, '📊 Analytics Dashboard'), Spacer({}), Text({ color: 'cyan', backgroundColor: headerBg }, '🔔 3'), Text({ color: headerFg, backgroundColor: headerBg }, ' 👤 Admin')),
382
+ // Main content
383
+ Box({ flexDirection: 'row', flexGrow: 1 },
384
+ // Sidebar
385
+ Box({
386
+ width: 20,
387
+ flexDirection: 'column',
388
+ borderStyle: 'single',
389
+ borderColor: 'gray',
390
+ padding: 1,
391
+ }, Box({ backgroundColor: activeBg, paddingX: 1 }, Text({ color: activeFg, backgroundColor: activeBg }, '🏠 Overview')), Text({ color: 'gray' }, '📈 Analytics'), Text({ color: 'gray' }, '👥 Users'), Text({ color: 'gray' }, '💰 Revenue'), Text({ color: 'gray' }, '📦 Products'), Spacer({}), Divider({ color: 'gray' }), Text({ color: 'gray' }, '⚙️ Settings')),
392
+ // Content area
393
+ Box({
394
+ flexGrow: 1,
395
+ flexDirection: 'column',
396
+ padding: 1,
397
+ gap: 1,
398
+ },
399
+ // Stats row
400
+ Box({ flexDirection: 'row', gap: 1 }, Box({ borderStyle: 'round', borderColor: 'cyan', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Users'), Text({}, ''), Text({ color: 'cyan', bold: true }, '12,543')), Box({ borderStyle: 'round', borderColor: 'green', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Revenue'), Text({}, ''), Text({ color: 'green', bold: true }, '$45.2k')), Box({ borderStyle: 'round', borderColor: 'yellow', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Orders'), Text({}, ''), Text({ color: 'yellow', bold: true }, '892'))),
401
+ // Chart area
402
+ Box({
403
+ borderStyle: 'single',
404
+ borderColor: 'gray',
405
+ padding: 1,
406
+ flexGrow: 1,
407
+ }, Box({ flexDirection: 'column' }, Text({ color: 'white', bold: true }, 'Traffic Overview'), Text({}), Text({ color: 'cyan' }, ' ▂▃▅▇█▇▅▃▂▃▅▇█▇▅▃▂'), Text({ color: 'gray' }, ' 0 ─┼─────────────────────'), Text({ color: 'gray', dim: true }, ' Mon Tue Wed Thu Fri'))))),
408
+ // Footer
409
+ Box({ flexDirection: 'row', backgroundColor: footerBg, paddingX: 1 }, Text({ color: footerFg, backgroundColor: footerBg }, '● Connected'), Spacer({}), Text({ color: footerFg, backgroundColor: footerBg, dim: true }, 'Last updated: 2 min ago')));
410
+ }),
336
411
  story('Shell - Terminal')
337
412
  .category('Apps')
338
413
  .description('Terminal emulator layout')
339
- .render(() => Box({
340
- flexDirection: 'column',
341
- width: 80,
342
- height: 20,
343
- borderStyle: 'single',
344
- borderColor: 'gray',
345
- },
346
- // Title bar
347
- Box({ flexDirection: 'row', backgroundColor: 'gray', paddingX: 1 }, Text({ color: 'red' }, '● '), Text({ color: 'yellow' }, '● '), Text({ color: 'green' }, '● '), Spacer({}), Text({ color: 'white' }, 'Terminal — zsh'), Spacer({}), Text({ color: 'gray' }, ' ')),
348
- // Terminal content
349
- Box({ flexDirection: 'column', padding: 1, flexGrow: 1, backgroundColor: 'black' }, Box({ flexDirection: 'row' }, Text({ color: 'green' }, '➜ '), Text({ color: 'cyan' }, '~/projects/tuiuiu '), Text({ color: 'blue' }, 'git:('), Text({ color: 'red' }, 'main'), Text({ color: 'blue' }, ') '), Text({ color: 'yellow' }, '✗ ')), Box({ flexDirection: 'row' }, Text({ color: 'white' }, 'npm test')), Text({}), Text({ color: 'gray' }, '> tuiuiu@0.1.0 test'), Text({ color: 'gray' }, '> vitest'), Text({}), Text({ color: 'green' }, ' ✓ tests/core/signal.test.ts (24 tests) 3ms'), Text({ color: 'green' }, ' ✓ tests/core/layout.test.ts (18 tests) 5ms'), Text({ color: 'green' }, ' ✓ tests/hooks/hooks.test.ts (12 tests) 4ms'), Text({}), Text({ color: 'green', bold: true }, ' Test Files 3 passed (3)'), Text({ color: 'green', bold: true }, ' Tests 54 passed (54)'), Spacer({}), Box({ flexDirection: 'row' }, Text({ color: 'green' }, '➜ '), Text({ color: 'cyan' }, '~/projects/tuiuiu '), Text({ color: 'white' }, '▋'))))),
414
+ .render(() => {
415
+ const titleBg = 'gray';
416
+ const titleFg = getContrastColor(titleBg);
417
+ const terminalBg = 'black';
418
+ const terminalFg = getContrastColor(terminalBg);
419
+ return Box({
420
+ flexDirection: 'column',
421
+ width: 80,
422
+ height: 20,
423
+ borderStyle: 'single',
424
+ borderColor: 'gray',
425
+ },
426
+ // Title bar
427
+ Box({ flexDirection: 'row', backgroundColor: titleBg, paddingX: 1 }, Text({ color: 'red', backgroundColor: titleBg }, '● '), Text({ color: 'yellow', backgroundColor: titleBg }, '● '), Text({ color: 'green', backgroundColor: titleBg }, '● '), Spacer({}), Text({ color: titleFg, backgroundColor: titleBg }, 'Terminal — zsh'), Spacer({}), Text({ color: 'gray' }, ' ')),
428
+ // Terminal content
429
+ Box({ flexDirection: 'column', padding: 1, flexGrow: 1, backgroundColor: 'black' }, Box({ flexDirection: 'row' }, Text({ color: 'green' }, '➜ '), Text({ color: 'cyan' }, '~/projects/tuiuiu '), Text({ color: 'blue' }, 'git:('), Text({ color: 'red' }, 'main'), Text({ color: 'blue' }, ') '), Text({ color: 'yellow' }, '✗ ')), Box({ flexDirection: 'row' }, Text({ color: 'white' }, 'npm test')), Text({}), Text({ color: 'gray' }, '> tuiuiu@0.1.0 test'), Text({ color: 'gray' }, '> vitest'), Text({}), Text({ color: 'green' }, ' ✓ tests/core/signal.test.ts (24 tests) 3ms'), Text({ color: 'green' }, ' ✓ tests/core/layout.test.ts (18 tests) 5ms'), Text({ color: 'green' }, ' ✓ tests/hooks/hooks.test.ts (12 tests) 4ms'), Text({}), Text({ color: 'green', bold: true }, ' Test Files 3 passed (3)'), Text({ color: 'green', bold: true }, ' Tests 54 passed (54)'), Spacer({}), Box({ flexDirection: 'row' }, Text({ color: 'green', backgroundColor: terminalBg }, '➜ '), Text({ color: 'cyan', backgroundColor: terminalBg }, '~/projects/tuiuiu '), Text({ color: terminalFg, backgroundColor: terminalBg }, '▋'))));
430
+ }),
350
431
  story('Shell - File Manager')
351
432
  .category('Apps')
352
433
  .description('Dual-pane file manager layout')
353
- .render(() => Box({
354
- flexDirection: 'column',
355
- width: 80,
356
- height: 20,
357
- },
358
- // Menu bar
359
- Box({ flexDirection: 'row', backgroundColor: 'cyan', paddingX: 1 }, Text({ color: 'white' }, 'File'), Text({ color: 'white' }, ' Edit'), Text({ color: 'white' }, ' View'), Text({ color: 'white' }, ' Go'), Text({ color: 'white' }, ' Help'), Spacer({})),
360
- // Dual pane
361
- Box({ flexDirection: 'row', flexGrow: 1 },
362
- // Left pane
363
- Box({
364
- width: 40,
365
- flexDirection: 'column',
366
- borderStyle: 'single',
367
- borderColor: 'cyan',
368
- }, Box({ paddingX: 1, backgroundColor: 'blue' }, Text({ color: 'white' }, '~/Documents')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '.. <DIR>'), Text({ color: 'yellow' }, 'projects <DIR>'), Text({ inverse: true }, 'notes.txt 4.2K'), Text({}, 'budget.xlsx 12.8K'), Text({}, 'resume.pdf 89.3K'), Spacer({})), Box({ paddingX: 1, backgroundColor: 'gray' }, Text({ color: 'white' }, '5 files, 106.3K'))),
369
- // Right pane
370
- Box({
371
- width: 40,
372
- flexDirection: 'column',
373
- borderStyle: 'single',
374
- borderColor: 'gray',
375
- }, Box({ paddingX: 1, backgroundColor: 'gray' }, Text({ color: 'white' }, '~/Downloads')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '.. <DIR>'), Text({}, 'image.png 256.4K'), Text({}, 'setup.exe 1.2M'), Text({}, 'data.json 34.1K'), Spacer({})), Box({ paddingX: 1, backgroundColor: 'gray' }, Text({ color: 'white' }, '3 files, 1.5M')))),
376
- // Function key bar
377
- Box({ flexDirection: 'row', backgroundColor: 'blue' }, Text({ color: 'black', backgroundColor: 'cyan' }, ' 1'), Text({ color: 'white' }, 'Help '), Text({ color: 'black', backgroundColor: 'cyan' }, '2'), Text({ color: 'white' }, 'Menu '), Text({ color: 'black', backgroundColor: 'cyan' }, '3'), Text({ color: 'white' }, 'View '), Text({ color: 'black', backgroundColor: 'cyan' }, '4'), Text({ color: 'white' }, 'Edit '), Text({ color: 'black', backgroundColor: 'cyan' }, '5'), Text({ color: 'white' }, 'Copy '), Text({ color: 'black', backgroundColor: 'cyan' }, '6'), Text({ color: 'white' }, 'Move '), Text({ color: 'black', backgroundColor: 'cyan' }, '7'), Text({ color: 'white' }, 'Mkdir'), Text({ color: 'black', backgroundColor: 'cyan' }, '8'), Text({ color: 'white' }, 'Del '), Text({ color: 'black', backgroundColor: 'cyan' }, '10'), Text({ color: 'white' }, 'Quit')))),
434
+ .render(() => {
435
+ const menuBg = 'cyan';
436
+ const menuFg = getContrastColor(menuBg);
437
+ const activePaneBg = 'blue';
438
+ const activePaneFg = getContrastColor(activePaneBg);
439
+ const inactivePaneBg = 'gray';
440
+ const inactivePaneFg = getContrastColor(inactivePaneBg);
441
+ const fnKeyBg = 'blue';
442
+ const fnKeyFg = getContrastColor(fnKeyBg);
443
+ const fnKeyHighBg = 'cyan';
444
+ const fnKeyHighFg = getContrastColor(fnKeyHighBg);
445
+ return Box({
446
+ flexDirection: 'column',
447
+ width: 80,
448
+ height: 20,
449
+ },
450
+ // Menu bar
451
+ Box({ flexDirection: 'row', backgroundColor: menuBg, paddingX: 1 }, Text({ color: menuFg, backgroundColor: menuBg }, 'File'), Text({ color: menuFg, backgroundColor: menuBg }, ' Edit'), Text({ color: menuFg, backgroundColor: menuBg }, ' View'), Text({ color: menuFg, backgroundColor: menuBg }, ' Go'), Text({ color: menuFg, backgroundColor: menuBg }, ' Help'), Spacer({})),
452
+ // Dual pane
453
+ Box({ flexDirection: 'row', flexGrow: 1 },
454
+ // Left pane (active)
455
+ Box({
456
+ width: 40,
457
+ flexDirection: 'column',
458
+ borderStyle: 'single',
459
+ borderColor: 'cyan',
460
+ }, Box({ paddingX: 1, backgroundColor: activePaneBg }, Text({ color: activePaneFg, backgroundColor: activePaneBg }, '~/Documents')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '.. <DIR>'), Text({ color: 'yellow' }, 'projects <DIR>'), Text({ inverse: true }, 'notes.txt 4.2K'), Text({}, 'budget.xlsx 12.8K'), Text({}, 'resume.pdf 89.3K'), Spacer({})), Box({ paddingX: 1, backgroundColor: inactivePaneBg }, Text({ color: inactivePaneFg, backgroundColor: inactivePaneBg }, '5 files, 106.3K'))),
461
+ // Right pane (inactive)
462
+ Box({
463
+ width: 40,
464
+ flexDirection: 'column',
465
+ borderStyle: 'single',
466
+ borderColor: 'gray',
467
+ }, Box({ paddingX: 1, backgroundColor: inactivePaneBg }, Text({ color: inactivePaneFg, backgroundColor: inactivePaneBg }, '~/Downloads')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '.. <DIR>'), Text({}, 'image.png 256.4K'), Text({}, 'setup.exe 1.2M'), Text({}, 'data.json 34.1K'), Spacer({})), Box({ paddingX: 1, backgroundColor: inactivePaneBg }, Text({ color: inactivePaneFg, backgroundColor: inactivePaneBg }, '3 files, 1.5M')))),
468
+ // Function key bar
469
+ Box({ flexDirection: 'row', backgroundColor: fnKeyBg }, Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, ' 1'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Help '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '2'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Menu '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '3'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'View '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '4'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Edit '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '5'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Copy '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '6'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Move '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '7'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Mkdir'), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '8'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Del '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '10'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Quit')));
470
+ }),
378
471
  story('Shell - Chat App')
379
472
  .category('Apps')
380
473
  .description('Chat application layout')
381
- .render(() => Box({
382
- flexDirection: 'column',
383
- width: 70,
384
- height: 20,
385
- borderStyle: 'round',
386
- borderColor: 'cyan',
387
- },
388
- // Header
389
- Box({ flexDirection: 'row', paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'green' }, '● '), Text({ color: 'white', bold: true }, 'Alice'), Text({ color: 'gray', dim: true }, ' Online'), Spacer({}), Text({ color: 'gray' }, '📞 📹 ⋮')),
390
- // Messages
391
- Box({ flexDirection: 'column', padding: 1, flexGrow: 1 },
392
- // Received message
393
- Box({ flexDirection: 'column', marginBottom: 1 }, Box({
394
- borderStyle: 'round',
395
- borderColor: 'gray',
396
- paddingX: 1,
397
- alignSelf: 'flex-start',
398
- }, Text({}, 'Hey! How is the TUI coming along?')), Text({ color: 'gray', dim: true }, '10:30 AM')),
399
- // Sent message
400
- Box({ flexDirection: 'column', alignItems: 'flex-end', marginBottom: 1 }, Box({
401
- borderStyle: 'round',
402
- borderColor: 'cyan',
403
- backgroundColor: 'cyan',
404
- paddingX: 1,
405
- }, Text({ color: 'white' }, "It's going great! Almost done 🎉")), Text({ color: 'gray', dim: true }, '10:32 AM ✓✓')),
406
- // Received
407
- Box({ flexDirection: 'column' }, Box({
408
- borderStyle: 'round',
409
- borderColor: 'gray',
410
- paddingX: 1,
411
- alignSelf: 'flex-start',
412
- }, Text({}, "Awesome! Can't wait to try it!")), Text({ color: 'gray', dim: true }, '10:33 AM')), Spacer({})),
413
- // Input
414
- Box({
415
- flexDirection: 'row',
416
- paddingX: 1,
417
- paddingY: 1,
418
- borderStyle: 'single',
419
- borderColor: 'gray',
420
- gap: 1,
421
- }, Text({ color: 'gray' }, '📎'), Box({ flexGrow: 1, borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({ color: 'gray', dim: true }, 'Type a message...')), Text({ color: 'gray' }, '😊'), Text({ color: 'cyan' }, '➤')))),
474
+ .render(() => {
475
+ const sentBg = 'cyan';
476
+ const sentFg = getContrastColor(sentBg);
477
+ return Box({
478
+ flexDirection: 'column',
479
+ width: 70,
480
+ height: 20,
481
+ borderStyle: 'round',
482
+ borderColor: 'cyan',
483
+ },
484
+ // Header
485
+ Box({ flexDirection: 'row', paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'green' }, '● '), Text({ color: 'white', bold: true }, 'Alice'), Text({ color: 'gray', dim: true }, ' Online'), Spacer({}), Text({ color: 'gray' }, '📞 📹 ⋮')),
486
+ // Messages
487
+ Box({ flexDirection: 'column', padding: 1, flexGrow: 1 },
488
+ // Received message
489
+ Box({ flexDirection: 'column', marginBottom: 1 }, Box({
490
+ borderStyle: 'round',
491
+ borderColor: 'gray',
492
+ paddingX: 1,
493
+ alignSelf: 'flex-start',
494
+ }, Text({}, 'Hey! How is the TUI coming along?')), Text({ color: 'gray', dim: true }, '10:30 AM')),
495
+ // Sent message
496
+ Box({ flexDirection: 'column', alignItems: 'flex-end', marginBottom: 1 }, Box({
497
+ borderStyle: 'round',
498
+ borderColor: sentBg,
499
+ backgroundColor: sentBg,
500
+ paddingX: 1,
501
+ }, Text({ color: sentFg, backgroundColor: sentBg }, "It's going great! Almost done 🎉")), Text({ color: 'gray', dim: true }, '10:32 AM ✓✓')),
502
+ // Received
503
+ Box({ flexDirection: 'column' }, Box({
504
+ borderStyle: 'round',
505
+ borderColor: 'gray',
506
+ paddingX: 1,
507
+ alignSelf: 'flex-start',
508
+ }, Text({}, "Awesome! Can't wait to try it!")), Text({ color: 'gray', dim: true }, '10:33 AM')), Spacer({})),
509
+ // Input
510
+ Box({
511
+ flexDirection: 'row',
512
+ paddingX: 1,
513
+ paddingY: 1,
514
+ borderStyle: 'single',
515
+ borderColor: 'gray',
516
+ gap: 1,
517
+ }, Text({ color: 'gray' }, '📎'), Box({ flexGrow: 1, borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({ color: 'gray', dim: true }, 'Type a message...')), Text({ color: 'gray' }, '😊'), Text({ color: 'cyan' }, '➤')));
518
+ }),
422
519
  ];
423
520
  /**
424
521
  * All app stories