ratatui_ruby 0.8.0 → 0.9.1

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 (355) hide show
  1. checksums.yaml +4 -4
  2. data/.builds/ruby-3.2.yml +2 -2
  3. data/.builds/ruby-3.3.yml +2 -2
  4. data/.builds/ruby-3.4.yml +2 -2
  5. data/.builds/ruby-4.0.0.yml +2 -2
  6. data/.pre-commit-config.yaml +1 -1
  7. data/AGENTS.md +3 -3
  8. data/CHANGELOG.md +77 -1
  9. data/LICENSES/LGPL-3.0-or-later.txt +304 -0
  10. data/LICENSES/MIT-0.txt +16 -0
  11. data/README.md +33 -5
  12. data/Rakefile +1 -1
  13. data/doc/concepts/application_architecture.md +44 -3
  14. data/doc/concepts/application_testing.md +43 -1
  15. data/doc/concepts/async.md +32 -2
  16. data/doc/concepts/custom_widgets.md +247 -0
  17. data/doc/concepts/event_handling.md +32 -3
  18. data/doc/concepts/interactive_design.md +32 -2
  19. data/doc/contributors/auditing/parity.md +7 -1
  20. data/doc/contributors/design/ruby_frontend.md +85 -1
  21. data/doc/contributors/design/rust_backend.md +67 -1
  22. data/doc/contributors/developing_examples.md +56 -2
  23. data/doc/contributors/documentation_style.md +20 -3
  24. data/doc/contributors/future_work.md +169 -0
  25. data/doc/contributors/index.md +1 -1
  26. data/doc/contributors/v1.0.0_blockers.md +19 -185
  27. data/doc/getting_started/quickstart.md +22 -4
  28. data/doc/getting_started/why.md +1 -1
  29. data/doc/index.md +2 -1
  30. data/doc/troubleshooting/debugging.md +32 -2
  31. data/doc/troubleshooting/terminal_limitations.md +8 -2
  32. data/doc/troubleshooting/tui_output.md +42 -0
  33. data/examples/app_all_events/README.md +14 -2
  34. data/examples/app_all_events/app.rb +1 -1
  35. data/examples/app_all_events/model/app_model.rb +1 -1
  36. data/examples/app_all_events/model/event_color_cycle.rb +1 -1
  37. data/examples/app_all_events/model/event_entry.rb +1 -1
  38. data/examples/app_all_events/model/msg.rb +1 -1
  39. data/examples/app_all_events/model/timestamp.rb +1 -1
  40. data/examples/app_all_events/update.rb +1 -1
  41. data/examples/app_all_events/view/app_view.rb +1 -1
  42. data/examples/app_all_events/view/controls_view.rb +1 -1
  43. data/examples/app_all_events/view/counts_view.rb +1 -1
  44. data/examples/app_all_events/view/live_view.rb +1 -1
  45. data/examples/app_all_events/view/log_view.rb +1 -1
  46. data/examples/app_all_events/view.rb +1 -1
  47. data/examples/app_color_picker/README.md +20 -2
  48. data/examples/app_color_picker/app.rb +1 -1
  49. data/examples/app_color_picker/clipboard.rb +1 -1
  50. data/examples/app_color_picker/color.rb +1 -1
  51. data/examples/app_color_picker/controls.rb +1 -1
  52. data/examples/app_color_picker/copy_dialog.rb +1 -1
  53. data/examples/app_color_picker/export_pane.rb +1 -1
  54. data/examples/app_color_picker/harmony.rb +1 -1
  55. data/examples/app_color_picker/input.rb +1 -1
  56. data/examples/app_color_picker/main_container.rb +1 -1
  57. data/examples/app_color_picker/palette.rb +1 -1
  58. data/examples/app_login_form/README.md +8 -2
  59. data/examples/app_login_form/app.rb +1 -1
  60. data/examples/app_stateful_interaction/README.md +2 -2
  61. data/examples/app_stateful_interaction/app.rb +71 -17
  62. data/examples/timeout_demo.rb +1 -1
  63. data/examples/verify_quickstart_dsl/README.md +6 -0
  64. data/examples/verify_quickstart_dsl/app.rb +3 -3
  65. data/examples/verify_quickstart_layout/README.md +6 -0
  66. data/examples/verify_quickstart_layout/app.rb +3 -3
  67. data/examples/verify_quickstart_lifecycle/README.md +6 -0
  68. data/examples/verify_quickstart_lifecycle/app.rb +3 -3
  69. data/examples/verify_readme_usage/README.md +6 -0
  70. data/examples/verify_readme_usage/app.rb +3 -3
  71. data/examples/widget_barchart/README.md +6 -0
  72. data/examples/widget_barchart/app.rb +2 -2
  73. data/examples/widget_block/README.md +7 -1
  74. data/examples/widget_block/app.rb +2 -2
  75. data/examples/widget_box/README.md +6 -0
  76. data/examples/widget_box/app.rb +9 -6
  77. data/examples/widget_calendar/README.md +6 -0
  78. data/examples/widget_calendar/app.rb +2 -2
  79. data/examples/widget_canvas/README.md +4 -0
  80. data/examples/widget_canvas/app.rb +2 -2
  81. data/examples/widget_cell/README.md +6 -0
  82. data/examples/widget_cell/app.rb +2 -3
  83. data/examples/widget_center/README.md +4 -0
  84. data/examples/widget_center/app.rb +2 -2
  85. data/examples/widget_chart/README.md +6 -0
  86. data/examples/widget_chart/app.rb +2 -2
  87. data/examples/widget_gauge/README.md +6 -0
  88. data/examples/widget_gauge/app.rb +2 -2
  89. data/examples/widget_layout_split/README.md +6 -0
  90. data/examples/widget_layout_split/app.rb +9 -3
  91. data/examples/widget_line_gauge/README.md +6 -0
  92. data/examples/widget_line_gauge/app.rb +2 -2
  93. data/examples/widget_list/README.md +6 -0
  94. data/examples/widget_list/app.rb +2 -2
  95. data/examples/widget_map/README.md +8 -2
  96. data/examples/widget_map/app.rb +2 -2
  97. data/examples/widget_overlay/README.md +7 -1
  98. data/examples/widget_overlay/app.rb +2 -2
  99. data/examples/widget_popup/README.md +6 -0
  100. data/examples/widget_popup/app.rb +2 -2
  101. data/examples/widget_ratatui_logo/README.md +6 -0
  102. data/examples/widget_ratatui_logo/app.rb +2 -3
  103. data/examples/widget_ratatui_mascot/README.md +6 -0
  104. data/examples/widget_ratatui_mascot/app.rb +2 -2
  105. data/examples/widget_rect/README.md +12 -0
  106. data/examples/widget_rect/app.rb +40 -26
  107. data/examples/widget_render/README.md +6 -0
  108. data/examples/widget_render/app.rb +2 -2
  109. data/examples/widget_render/app.rbs +41 -0
  110. data/examples/widget_rich_text/README.md +6 -0
  111. data/examples/widget_rich_text/app.rb +2 -2
  112. data/examples/widget_scroll_text/README.md +6 -0
  113. data/examples/widget_scroll_text/app.rb +2 -2
  114. data/examples/widget_scrollbar/README.md +6 -0
  115. data/examples/widget_scrollbar/app.rb +2 -2
  116. data/examples/widget_sparkline/README.md +6 -0
  117. data/examples/widget_sparkline/app.rb +2 -2
  118. data/examples/widget_style_colors/README.md +6 -0
  119. data/examples/widget_style_colors/app.rb +2 -2
  120. data/examples/widget_table/README.md +8 -2
  121. data/examples/widget_table/app.rb +2 -2
  122. data/examples/widget_tabs/README.md +6 -0
  123. data/examples/widget_tabs/app.rb +2 -2
  124. data/examples/widget_text_width/README.md +6 -0
  125. data/examples/widget_text_width/app.rb +4 -4
  126. data/ext/ratatui_ruby/Cargo.lock +1 -1
  127. data/ext/ratatui_ruby/Cargo.toml +1 -1
  128. data/ext/ratatui_ruby/extconf.rb +2 -2
  129. data/ext/ratatui_ruby/src/events.rs +1 -0
  130. data/ext/ratatui_ruby/src/rendering.rs +1 -1
  131. data/ext/ratatui_ruby/src/style.rs +0 -8
  132. data/ext/ratatui_ruby/src/widgets/chart.rs +0 -118
  133. data/ext/ratatui_ruby/src/widgets/list_state.rs +36 -0
  134. data/lib/ratatui_ruby/buffer/cell.rb +34 -2
  135. data/lib/ratatui_ruby/buffer.rb +2 -2
  136. data/lib/ratatui_ruby/cell.rb +34 -2
  137. data/lib/ratatui_ruby/event/focus_gained.rb +26 -2
  138. data/lib/ratatui_ruby/event/focus_lost.rb +26 -2
  139. data/lib/ratatui_ruby/event/key/character.rb +18 -2
  140. data/lib/ratatui_ruby/event/key/media.rb +2 -2
  141. data/lib/ratatui_ruby/event/key/modifier.rb +10 -2
  142. data/lib/ratatui_ruby/event/key/navigation.rb +2 -2
  143. data/lib/ratatui_ruby/event/key/system.rb +2 -2
  144. data/lib/ratatui_ruby/event/key.rb +114 -2
  145. data/lib/ratatui_ruby/event/mouse.rb +42 -2
  146. data/lib/ratatui_ruby/event/none.rb +10 -2
  147. data/lib/ratatui_ruby/event/paste.rb +34 -2
  148. data/lib/ratatui_ruby/event/resize.rb +34 -2
  149. data/lib/ratatui_ruby/event/sync.rb +52 -0
  150. data/lib/ratatui_ruby/event.rb +32 -2
  151. data/lib/ratatui_ruby/frame.rb +74 -2
  152. data/lib/ratatui_ruby/layout/constraint.rb +193 -2
  153. data/lib/ratatui_ruby/layout/layout.rb +47 -2
  154. data/lib/ratatui_ruby/layout/rect.rb +403 -2
  155. data/lib/ratatui_ruby/layout.rb +2 -2
  156. data/lib/ratatui_ruby/list_state.rb +113 -2
  157. data/lib/ratatui_ruby/output_guard.rb +26 -3
  158. data/lib/ratatui_ruby/schema/bar_chart/bar.rb +2 -2
  159. data/lib/ratatui_ruby/schema/bar_chart/bar_group.rb +2 -2
  160. data/lib/ratatui_ruby/schema/bar_chart.rb +50 -2
  161. data/lib/ratatui_ruby/schema/block.rb +21 -15
  162. data/lib/ratatui_ruby/schema/calendar.rb +2 -2
  163. data/lib/ratatui_ruby/schema/canvas.rb +10 -2
  164. data/lib/ratatui_ruby/schema/center.rb +10 -2
  165. data/lib/ratatui_ruby/schema/chart.rb +2 -28
  166. data/lib/ratatui_ruby/schema/clear.rb +10 -2
  167. data/lib/ratatui_ruby/schema/constraint.rb +58 -2
  168. data/lib/ratatui_ruby/schema/cursor.rb +10 -2
  169. data/lib/ratatui_ruby/schema/draw.rb +10 -2
  170. data/lib/ratatui_ruby/schema/gauge.rb +2 -2
  171. data/lib/ratatui_ruby/schema/layout.rb +18 -2
  172. data/lib/ratatui_ruby/schema/line_gauge.rb +2 -2
  173. data/lib/ratatui_ruby/schema/list.rb +10 -2
  174. data/lib/ratatui_ruby/schema/list_item.rb +10 -2
  175. data/lib/ratatui_ruby/schema/overlay.rb +10 -2
  176. data/lib/ratatui_ruby/schema/paragraph.rb +10 -2
  177. data/lib/ratatui_ruby/schema/ratatui_logo.rb +2 -2
  178. data/lib/ratatui_ruby/schema/ratatui_mascot.rb +2 -2
  179. data/lib/ratatui_ruby/schema/rect.rb +58 -2
  180. data/lib/ratatui_ruby/schema/row.rb +10 -2
  181. data/lib/ratatui_ruby/schema/scrollbar.rb +2 -2
  182. data/lib/ratatui_ruby/schema/shape/label.rb +10 -2
  183. data/lib/ratatui_ruby/schema/sparkline.rb +10 -2
  184. data/lib/ratatui_ruby/schema/style.rb +18 -2
  185. data/lib/ratatui_ruby/schema/table.rb +2 -2
  186. data/lib/ratatui_ruby/schema/tabs.rb +2 -2
  187. data/lib/ratatui_ruby/schema/text.rb +34 -2
  188. data/lib/ratatui_ruby/scrollbar_state.rb +10 -2
  189. data/lib/ratatui_ruby/style/style.rb +18 -2
  190. data/lib/ratatui_ruby/style.rb +2 -2
  191. data/lib/ratatui_ruby/synthetic_events.rb +86 -0
  192. data/lib/ratatui_ruby/table_state.rb +10 -2
  193. data/lib/ratatui_ruby/terminal_lifecycle.rb +18 -3
  194. data/lib/ratatui_ruby/test_helper/event_injection.rb +62 -2
  195. data/lib/ratatui_ruby/test_helper/snapshot.rb +74 -9
  196. data/lib/ratatui_ruby/test_helper/style_assertions.rb +98 -2
  197. data/lib/ratatui_ruby/test_helper/terminal.rb +50 -2
  198. data/lib/ratatui_ruby/test_helper/test_doubles.rb +18 -2
  199. data/lib/ratatui_ruby/test_helper.rb +10 -2
  200. data/lib/ratatui_ruby/tui/buffer_factories.rb +2 -2
  201. data/lib/ratatui_ruby/tui/canvas_factories.rb +2 -2
  202. data/lib/ratatui_ruby/tui/core.rb +2 -2
  203. data/lib/ratatui_ruby/tui/layout_factories.rb +32 -2
  204. data/lib/ratatui_ruby/tui/state_factories.rb +2 -2
  205. data/lib/ratatui_ruby/tui/style_factories.rb +2 -2
  206. data/lib/ratatui_ruby/tui/text_factories.rb +2 -2
  207. data/lib/ratatui_ruby/tui/widget_factories.rb +2 -2
  208. data/lib/ratatui_ruby/tui.rb +11 -3
  209. data/lib/ratatui_ruby/version.rb +3 -3
  210. data/lib/ratatui_ruby/widgets/bar_chart/bar.rb +2 -2
  211. data/lib/ratatui_ruby/widgets/bar_chart/bar_group.rb +2 -2
  212. data/lib/ratatui_ruby/widgets/bar_chart.rb +58 -2
  213. data/lib/ratatui_ruby/widgets/block.rb +37 -15
  214. data/lib/ratatui_ruby/widgets/calendar.rb +2 -2
  215. data/lib/ratatui_ruby/widgets/canvas.rb +10 -2
  216. data/lib/ratatui_ruby/widgets/cell.rb +10 -2
  217. data/lib/ratatui_ruby/widgets/center.rb +10 -2
  218. data/lib/ratatui_ruby/widgets/chart.rb +2 -28
  219. data/lib/ratatui_ruby/widgets/clear.rb +10 -2
  220. data/lib/ratatui_ruby/widgets/cursor.rb +10 -2
  221. data/lib/ratatui_ruby/widgets/gauge.rb +16 -2
  222. data/lib/ratatui_ruby/widgets/line_gauge.rb +16 -2
  223. data/lib/ratatui_ruby/widgets/list.rb +41 -2
  224. data/lib/ratatui_ruby/widgets/list_item.rb +10 -2
  225. data/lib/ratatui_ruby/widgets/overlay.rb +10 -2
  226. data/lib/ratatui_ruby/widgets/paragraph.rb +10 -2
  227. data/lib/ratatui_ruby/widgets/ratatui_logo.rb +2 -2
  228. data/lib/ratatui_ruby/widgets/ratatui_mascot.rb +2 -2
  229. data/lib/ratatui_ruby/widgets/row.rb +10 -2
  230. data/lib/ratatui_ruby/widgets/scrollbar.rb +2 -2
  231. data/lib/ratatui_ruby/widgets/shape/label.rb +10 -2
  232. data/lib/ratatui_ruby/widgets/sparkline.rb +10 -2
  233. data/lib/ratatui_ruby/widgets/table.rb +62 -2
  234. data/lib/ratatui_ruby/widgets/tabs.rb +2 -2
  235. data/lib/ratatui_ruby/widgets.rb +2 -2
  236. data/lib/ratatui_ruby.rb +101 -9
  237. data/sig/examples/app_all_events/view.rbs +7 -1
  238. data/sig/examples/app_all_events/view_state.rbs +7 -1
  239. data/sig/examples/app_color_picker/app.rbs +5 -0
  240. data/sig/examples/app_stateful_interaction/app.rbs +7 -1
  241. data/sig/examples/verify_quickstart_dsl/app.rbs +7 -1
  242. data/sig/examples/verify_quickstart_lifecycle/app.rbs +7 -1
  243. data/sig/examples/verify_readme_usage/app.rbs +7 -1
  244. data/sig/examples/widget_block_demo/app.rbs +6 -0
  245. data/sig/examples/widget_box_demo/app.rbs +7 -1
  246. data/sig/examples/widget_calendar_demo/app.rbs +7 -1
  247. data/sig/examples/widget_cell_demo/app.rbs +7 -1
  248. data/sig/examples/widget_chart_demo/app.rbs +7 -1
  249. data/sig/examples/widget_gauge_demo/app.rbs +7 -1
  250. data/sig/examples/widget_layout_split/app.rbs +7 -1
  251. data/sig/examples/widget_line_gauge_demo/app.rbs +7 -1
  252. data/sig/examples/widget_list_demo/app.rbs +5 -0
  253. data/sig/examples/widget_map_demo/app.rbs +7 -1
  254. data/sig/examples/widget_popup_demo/app.rbs +7 -1
  255. data/sig/examples/widget_ratatui_logo_demo/app.rbs +7 -1
  256. data/sig/examples/widget_ratatui_mascot_demo/app.rbs +7 -1
  257. data/sig/examples/widget_rect/app.rbs +7 -1
  258. data/sig/examples/widget_render/app.rbs +7 -1
  259. data/sig/examples/widget_rich_text/app.rbs +7 -1
  260. data/sig/examples/widget_scroll_text/app.rbs +7 -1
  261. data/sig/examples/widget_scrollbar_demo/app.rbs +7 -1
  262. data/sig/examples/widget_sparkline_demo/app.rbs +7 -1
  263. data/sig/examples/widget_style_colors/app.rbs +7 -1
  264. data/sig/examples/widget_table_demo/app.rbs +7 -1
  265. data/sig/examples/widget_text_width/app.rbs +7 -1
  266. data/sig/ratatui_ruby/event.rbs +7 -1
  267. data/sig/ratatui_ruby/frame.rbs +15 -3
  268. data/sig/ratatui_ruby/list_state.rbs +11 -1
  269. data/sig/ratatui_ruby/ratatui_ruby.rbs +8 -2
  270. data/sig/ratatui_ruby/schema/bar_chart/bar.rbs +7 -1
  271. data/sig/ratatui_ruby/schema/bar_chart/bar_group.rbs +6 -0
  272. data/sig/ratatui_ruby/schema/bar_chart.rbs +6 -0
  273. data/sig/ratatui_ruby/schema/block.rbs +7 -1
  274. data/sig/ratatui_ruby/schema/calendar.rbs +6 -0
  275. data/sig/ratatui_ruby/schema/canvas.rbs +6 -0
  276. data/sig/ratatui_ruby/schema/center.rbs +6 -0
  277. data/sig/ratatui_ruby/schema/chart.rbs +6 -9
  278. data/sig/ratatui_ruby/schema/constraint.rbs +14 -0
  279. data/sig/ratatui_ruby/schema/cursor.rbs +6 -0
  280. data/sig/ratatui_ruby/schema/draw.rbs +6 -0
  281. data/sig/ratatui_ruby/schema/gauge.rbs +9 -1
  282. data/sig/ratatui_ruby/schema/layout.rbs +6 -0
  283. data/sig/ratatui_ruby/schema/line_gauge.rbs +9 -1
  284. data/sig/ratatui_ruby/schema/list.rbs +9 -1
  285. data/sig/ratatui_ruby/schema/list_item.rbs +7 -1
  286. data/sig/ratatui_ruby/schema/overlay.rbs +6 -0
  287. data/sig/ratatui_ruby/schema/paragraph.rbs +6 -0
  288. data/sig/ratatui_ruby/schema/ratatui_logo.rbs +6 -0
  289. data/sig/ratatui_ruby/schema/ratatui_mascot.rbs +5 -0
  290. data/sig/ratatui_ruby/schema/rect.rbs +30 -0
  291. data/sig/ratatui_ruby/schema/row.rbs +7 -1
  292. data/sig/ratatui_ruby/schema/scrollbar.rbs +6 -0
  293. data/sig/ratatui_ruby/schema/sparkline.rbs +6 -0
  294. data/sig/ratatui_ruby/schema/style.rbs +7 -1
  295. data/sig/ratatui_ruby/schema/table.rbs +11 -1
  296. data/sig/ratatui_ruby/schema/tabs.rbs +6 -0
  297. data/sig/ratatui_ruby/schema/text.rbs +7 -1
  298. data/sig/ratatui_ruby/scrollbar_state.rbs +7 -1
  299. data/sig/ratatui_ruby/session.rbs +7 -1
  300. data/sig/ratatui_ruby/table_state.rbs +7 -1
  301. data/sig/ratatui_ruby/test_helper/event_injection.rbs +7 -1
  302. data/sig/ratatui_ruby/test_helper/snapshot.rbs +7 -1
  303. data/sig/ratatui_ruby/test_helper/style_assertions.rbs +7 -1
  304. data/sig/ratatui_ruby/test_helper/terminal.rbs +7 -1
  305. data/sig/ratatui_ruby/test_helper/test_doubles.rbs +7 -1
  306. data/sig/ratatui_ruby/test_helper.rbs +7 -1
  307. data/sig/ratatui_ruby/tui/buffer_factories.rbs +7 -1
  308. data/sig/ratatui_ruby/tui/canvas_factories.rbs +7 -1
  309. data/sig/ratatui_ruby/tui/core.rbs +7 -1
  310. data/sig/ratatui_ruby/tui/layout_factories.rbs +7 -1
  311. data/sig/ratatui_ruby/tui/state_factories.rbs +7 -1
  312. data/sig/ratatui_ruby/tui/style_factories.rbs +7 -1
  313. data/sig/ratatui_ruby/tui/text_factories.rbs +7 -1
  314. data/sig/ratatui_ruby/tui/widget_factories.rbs +7 -1
  315. data/sig/ratatui_ruby/tui.rbs +7 -1
  316. data/sig/ratatui_ruby/version.rbs +6 -0
  317. data/tasks/autodoc/examples.rb +1 -1
  318. data/tasks/autodoc/member.rb +1 -1
  319. data/tasks/autodoc/name.rb +1 -1
  320. data/tasks/bump/cargo_lockfile.rb +1 -1
  321. data/tasks/bump/changelog.rb +1 -1
  322. data/tasks/bump/header.rb +1 -1
  323. data/tasks/bump/history.rb +1 -1
  324. data/tasks/bump/links.rb +1 -1
  325. data/tasks/bump/manifest.rb +1 -1
  326. data/tasks/bump/ruby_gem.rb +1 -1
  327. data/tasks/bump/sem_ver.rb +1 -1
  328. data/tasks/bump/unreleased_section.rb +1 -1
  329. data/tasks/license/headers_md.rb +223 -0
  330. data/tasks/license/headers_rb.rb +210 -0
  331. data/tasks/license/license_utils.rb +130 -0
  332. data/tasks/license/snippets_md.rb +315 -0
  333. data/tasks/license/snippets_rdoc.rb +150 -0
  334. data/tasks/license.rake +91 -0
  335. data/tasks/rdoc_config.rb +1 -1
  336. data/tasks/resources/build.yml.erb +13 -7
  337. data/tasks/sourcehut.rake +3 -1
  338. data/tasks/terminal_preview/app_screenshot.rb +1 -1
  339. data/tasks/terminal_preview/crash_report.rb +1 -1
  340. data/tasks/terminal_preview/example_app.rb +1 -1
  341. data/tasks/terminal_preview/launcher_script.rb +1 -1
  342. data/tasks/terminal_preview/preview_collection.rb +1 -1
  343. data/tasks/terminal_preview/preview_timing.rb +1 -1
  344. data/tasks/terminal_preview/safety_confirmation.rb +1 -1
  345. data/tasks/terminal_preview/saved_screenshot.rb +1 -1
  346. data/tasks/terminal_preview/system_appearance.rb +1 -1
  347. data/tasks/terminal_preview/terminal_window.rb +1 -1
  348. data/tasks/terminal_preview/window_id.rb +1 -1
  349. data/tasks/website/index_page.rb +1 -1
  350. data/tasks/website/version.rb +1 -1
  351. data/tasks/website/version_menu.rb +1 -1
  352. data/tasks/website/versioned_documentation.rb +1 -1
  353. data/tasks/website/website.rb +1 -1
  354. metadata +15 -3
  355. data/doc/migration/v0_7_0.md +0 -236
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  require "timeout"
@@ -23,6 +23,11 @@ module RatatuiRuby
23
23
  #
24
24
  # === Example
25
25
  #
26
+ #--
27
+ # SPDX-SnippetBegin
28
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
29
+ # SPDX-License-Identifier: MIT-0
30
+ #++
26
31
  # class MyTest < Minitest::Test
27
32
  # include RatatuiRuby::TestHelper
28
33
  #
@@ -33,6 +38,9 @@ module RatatuiRuby
33
38
  # end
34
39
  # end
35
40
  # end
41
+ #--
42
+ # SPDX-SnippetEnd
43
+ #++
36
44
  module Terminal
37
45
  ##
38
46
  # Initializes a test terminal context with specified dimensions.
@@ -44,9 +52,17 @@ module RatatuiRuby
44
52
  #
45
53
  # === Example
46
54
  #
55
+ #--
56
+ # SPDX-SnippetBegin
57
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
58
+ # SPDX-License-Identifier: MIT-0
59
+ #++
47
60
  # with_test_terminal(120, 40) do
48
61
  # # render and test your app
49
62
  # end
63
+ #--
64
+ # SPDX-SnippetEnd
65
+ #++
50
66
  def with_test_terminal(width = 80, height = 24, **opts)
51
67
  # Defensive cleanup: reset any stale session state from previous test failures
52
68
  RatatuiRuby.instance_variable_set(:@tui_session_active, false)
@@ -80,8 +96,16 @@ module RatatuiRuby
80
96
  #
81
97
  # === Example
82
98
  #
99
+ #--
100
+ # SPDX-SnippetBegin
101
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
102
+ # SPDX-License-Identifier: MIT-0
103
+ #++
83
104
  # buffer_content
84
105
  # # => ["Row 1 text", "Row 2 text", ...]
106
+ #--
107
+ # SPDX-SnippetEnd
108
+ #++
85
109
  def buffer_content
86
110
  RatatuiRuby.get_buffer_content.split("\n")
87
111
  end
@@ -91,8 +115,16 @@ module RatatuiRuby
91
115
  #
92
116
  # === Example
93
117
  #
118
+ #--
119
+ # SPDX-SnippetBegin
120
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
121
+ # SPDX-License-Identifier: MIT-0
122
+ #++
94
123
  # cursor_position
95
124
  # # => { x: 0, y: 0 }
125
+ #--
126
+ # SPDX-SnippetEnd
127
+ #++
96
128
  def cursor_position
97
129
  x, y = RatatuiRuby.get_cursor_position
98
130
  { x:, y: }
@@ -108,8 +140,16 @@ module RatatuiRuby
108
140
  #
109
141
  # === Example
110
142
  #
143
+ #--
144
+ # SPDX-SnippetBegin
145
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
146
+ # SPDX-License-Identifier: MIT-0
147
+ #++
111
148
  # get_cell(0, 0)
112
149
  # # => { "symbol" => "H", "fg" => :red, "bg" => nil }
150
+ #--
151
+ # SPDX-SnippetEnd
152
+ #++
113
153
  def get_cell(x, y)
114
154
  RatatuiRuby.get_cell_at(x, y)
115
155
  end
@@ -120,10 +160,18 @@ module RatatuiRuby
120
160
  #
121
161
  # === Example
122
162
  #
163
+ #--
164
+ # SPDX-SnippetBegin
165
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
166
+ # SPDX-License-Identifier: MIT-0
167
+ #++
123
168
  # with_test_terminal do
124
169
  # MyApp.new.render
125
170
  # print_buffer # see exactly what would display
126
171
  # end
172
+ #--
173
+ # SPDX-SnippetEnd
174
+ #++
127
175
  def print_buffer
128
176
  puts _render_buffer_with_ansi
129
177
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -21,12 +21,20 @@ module RatatuiRuby
21
21
  #
22
22
  # === Example
23
23
  #
24
+ #--
25
+ # SPDX-SnippetBegin
26
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
27
+ # SPDX-License-Identifier: MIT-0
28
+ #++
24
29
  # frame = MockFrame.new
25
30
  # area = StubRect.new(width: 60, height: 20)
26
31
  # MyView.new.call(state, tui, frame, area)
27
32
  #
28
33
  # widget = frame.rendered_widgets.first[:widget]
29
34
  # assert_equal "Dashboard", widget.block.title
35
+ #--
36
+ # SPDX-SnippetEnd
37
+ #++
30
38
  module TestDoubles
31
39
  ##
32
40
  # Mock frame for view tests.
@@ -35,10 +43,18 @@ module RatatuiRuby
35
43
  #
36
44
  # === Example
37
45
  #
46
+ #--
47
+ # SPDX-SnippetBegin
48
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
49
+ # SPDX-License-Identifier: MIT-0
50
+ #++
38
51
  # frame = MockFrame.new
39
52
  # View::Log.new.call(state, tui, frame, area)
40
53
  # widget = frame.rendered_widgets.first[:widget]
41
54
  # assert_equal "Event Log", widget.block.title
55
+ #--
56
+ # SPDX-SnippetEnd
57
+ #++
42
58
  MockFrame = Data.define(:rendered_widgets) do
43
59
  def initialize(rendered_widgets: [])
44
60
  super
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  require "fileutils"
@@ -33,6 +33,11 @@ module RatatuiRuby
33
33
  #
34
34
  # == Example
35
35
  #
36
+ #--
37
+ # SPDX-SnippetBegin
38
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
39
+ # SPDX-License-Identifier: MIT-0
40
+ #++
36
41
  # require "ratatui_ruby/test_helper"
37
42
  #
38
43
  # class TestMyApp < Minitest::Test
@@ -83,6 +88,9 @@ module RatatuiRuby
83
88
  # assert_equal "Dashboard", widget.block.title
84
89
  # end
85
90
  # end
91
+ #--
92
+ # SPDX-SnippetEnd
93
+ #++
86
94
  module TestHelper
87
95
  include Terminal
88
96
  include Snapshot
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -71,6 +71,36 @@ module RatatuiRuby
71
71
  def layout_split(area, direction: :vertical, constraints:, flex: :legacy)
72
72
  Layout::Layout.split(area, direction:, constraints:, flex:)
73
73
  end
74
+
75
+ # Alias for {#layout_split} — shorter, more ergonomic.
76
+ # @return [Array<Layout::Rect>]
77
+ def split(area, direction: :vertical, constraints:, flex: :legacy)
78
+ layout_split(area, direction:, constraints:, flex:)
79
+ end
80
+
81
+ # Alias for {#constraint_length} — CSS-inspired "fixed" sizing.
82
+ # @return [Layout::Constraint]
83
+ def fixed(n)
84
+ constraint_length(n)
85
+ end
86
+
87
+ # Alias for {#constraint_percentage} — CSS-inspired percent sizing.
88
+ # @return [Layout::Constraint]
89
+ def percent(n)
90
+ constraint_percentage(n)
91
+ end
92
+
93
+ # Alias for {#constraint_fill} — CSS Flexbox-inspired flexible sizing.
94
+ # @return [Layout::Constraint]
95
+ def flex(n = 1)
96
+ constraint_fill(n)
97
+ end
98
+
99
+ # Alias for {#constraint_fill} — CSS Grid-inspired "fr" (fraction) unit.
100
+ # @return [Layout::Constraint]
101
+ def fr(n = 1)
102
+ constraint_fill(n)
103
+ end
74
104
  end
75
105
  end
76
106
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  require_relative "tui/core"
@@ -49,6 +49,11 @@ module RatatuiRuby
49
49
  #
50
50
  # ==== Basic Usage (Recommended)
51
51
  #
52
+ #--
53
+ # SPDX-SnippetBegin
54
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
55
+ # SPDX-License-Identifier: MIT-0
56
+ #++
52
57
  # RatatuiRuby.run do |tui|
53
58
  # loop do
54
59
  # tui.draw \
@@ -58,12 +63,15 @@ module RatatuiRuby
58
63
  # block: tui.block(
59
64
  # title: "My Ruby TUI App",
60
65
  # borders: [:all],
61
- # border_color: "cyan"
66
+ # border_style: { fg: \"cyan\" }
62
67
  # )
63
68
  # event = tui.poll_event
64
69
  # break if event == "q" || event == :ctrl_c
65
70
  # end
66
71
  # end
72
+ #--
73
+ # SPDX-SnippetEnd
74
+ #++
67
75
  class TUI
68
76
  include Core
69
77
  include LayoutFactories
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
9
9
  # The version of the ratatui_ruby gem.
10
10
  # See https://semver.org/spec/v2.0.0.html
11
- VERSION = "0.8.0"
11
+ VERSION = "0.9.1"
12
12
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -21,6 +21,11 @@ module RatatuiRuby
21
21
  #
22
22
  # Run the interactive demo from the terminal:
23
23
  #
24
+ #--
25
+ # SPDX-SnippetBegin
26
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
27
+ # SPDX-License-Identifier: MIT-0
28
+ #++
24
29
  # ruby examples/widget_barchart/app.rb
25
30
  #
26
31
  # # Grouped Bar Chart
@@ -32,6 +37,9 @@ module RatatuiRuby
32
37
  # bar_width: 5,
33
38
  # group_gap: 3
34
39
  # )
40
+ #--
41
+ # SPDX-SnippetEnd
42
+ #++
35
43
  class BarChart < Data.define(:data, :bar_width, :bar_gap, :group_gap, :max, :style, :block, :direction, :label_style, :value_style, :bar_set)
36
44
  ##
37
45
  ##
@@ -46,23 +54,55 @@ module RatatuiRuby
46
54
  # [<tt>Array</tt> of tuples]
47
55
  # Ordered list of <tt>["Label", Value]</tt> or <tt>["Label", Value, Style]</tt> pairs.
48
56
  # [<tt>Array</tt> of <tt>BarChart::BarGroup</tt>]
57
+ #--
58
+ # SPDX-SnippetBegin
59
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
60
+ # SPDX-License-Identifier: MIT-0
61
+ #++
49
62
  # List of <tt>BarChart::BarGroup</tt> objects for grouped charts.
50
63
  #
64
+ #--
65
+ # SPDX-SnippetEnd
66
+ #++
51
67
  # === Examples
52
68
  #
53
69
  # Hash (Simple):
70
+ #--
71
+ # SPDX-SnippetBegin
72
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
73
+ # SPDX-License-Identifier: MIT-0
74
+ #++
54
75
  # { "Apples" => 10, :Oranges => 15 }
55
76
  #
77
+ #--
78
+ # SPDX-SnippetEnd
79
+ #++
56
80
  # Array of Tuples (Ordered):
81
+ #--
82
+ # SPDX-SnippetBegin
83
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
84
+ # SPDX-License-Identifier: MIT-0
85
+ #++
57
86
  # [["Mon", 20], ["Tue", 30], ["Wed", 25]]
58
87
  #
88
+ #--
89
+ # SPDX-SnippetEnd
90
+ #++
59
91
  # BarGroup (Grouped):
92
+ #--
93
+ # SPDX-SnippetBegin
94
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
95
+ # SPDX-License-Identifier: MIT-0
96
+ #++
60
97
  # [
61
98
  # RatatuiRuby::BarChart::BarGroup.new(label: "Q1", bars: [
62
99
  # RatatuiRuby::BarChart::Bar.new(value: 50, label: "Rev"),
63
100
  # RatatuiRuby::BarChart::Bar.new(value: 30, label: "Cost")
64
101
  # ])
65
102
  # ]
103
+ #--
104
+ # SPDX-SnippetEnd
105
+ #++
66
106
 
67
107
  ##
68
108
  # :attr_reader: bar_width
@@ -111,6 +151,11 @@ module RatatuiRuby
111
151
  #
112
152
  # === Examples
113
153
  #
154
+ #--
155
+ # SPDX-SnippetBegin
156
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
157
+ # SPDX-License-Identifier: MIT-0
158
+ #++
114
159
  # bar_set: {
115
160
  # empty: " ",
116
161
  # one_eighth: " ",
@@ -130,6 +175,9 @@ module RatatuiRuby
130
175
  #
131
176
  # # Array (9 items)
132
177
  # bar_set: [" ", " ", "▂", "▃", "▄", "▅", "▆", "▇", "█"]
178
+ #--
179
+ # SPDX-SnippetEnd
180
+ #++
133
181
 
134
182
  BAR_KEYS = %i[empty one_eighth one_quarter three_eighths half five_eighths three_quarters seven_eighths full].freeze
135
183
 
@@ -156,8 +204,16 @@ module RatatuiRuby
156
204
  # [value_style]
157
205
  # Style object for values (optional).
158
206
  # [bar_set]
207
+ #--
208
+ # SPDX-SnippetBegin
209
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
210
+ # SPDX-License-Identifier: MIT-0
211
+ #++
159
212
  # Symbol, Hash, or Array: Custom characters for bars.
160
213
  # Symbols: <tt>:nine_levels</tt> (default gradient), <tt>:three_levels</tt> (simplified).
214
+ #--
215
+ # SPDX-SnippetEnd
216
+ #++
161
217
  def initialize(data:, bar_width: 3, bar_gap: 1, group_gap: 0, max: nil, style: nil, block: nil, direction: :vertical, label_style: nil, value_style: nil, bar_set: nil)
162
218
  if bar_set && !bar_set.is_a?(Symbol)
163
219
  if bar_set.is_a?(Array) && bar_set.size == 9
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby
@@ -22,7 +22,7 @@ module RatatuiRuby
22
22
  # Run the interactive demo from the terminal:
23
23
  #
24
24
  # ruby examples/widget_box/app.rb
25
- class Block < Data.define(:title, :titles, :title_alignment, :title_style, :borders, :border_color, :border_style, :border_type, :border_set, :style, :padding, :children)
25
+ class Block < Data.define(:title, :titles, :title_alignment, :title_style, :borders, :border_style, :border_type, :border_set, :style, :padding, :children)
26
26
  ##
27
27
  # :attr_reader: title
28
28
  # The main title displayed on the top border.
@@ -69,19 +69,12 @@ module RatatuiRuby
69
69
  #
70
70
  # Block.new(borders: [:left, :right]).borders # => [:left, :right]
71
71
 
72
- ##
73
- # :attr_reader: border_color
74
- # Color of the border lines.
75
- #
76
- # Deprecated: Use <tt>border_style:</tt> instead for full style support.
77
-
78
72
  ##
79
73
  # :attr_reader: border_style
80
74
  # Full style (colors/modifiers) for the border lines.
81
75
  #
82
76
  # A Style object or Hash with <tt>:fg</tt>, <tt>:bg</tt>, and <tt>:modifiers</tt>.
83
- # This allows borders to be bold, italic, colored, etc. If both <tt>border_color</tt>
84
- # and <tt>border_style</tt> are provided, <tt>border_style</tt> takes precedence.
77
+ # This allows borders to be bold, italic, colored, etc.
85
78
 
86
79
  ##
87
80
  # :attr_reader: border_type
@@ -116,8 +109,16 @@ module RatatuiRuby
116
109
  #
117
110
  # === Example
118
111
  #
112
+ #--
113
+ # SPDX-SnippetBegin
114
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
115
+ # SPDX-License-Identifier: MIT-0
116
+ #++
119
117
  # Block.new(padding: 2).padding # => 2
120
118
  # Block.new(padding: [1, 1, 0, 0]).padding # => [1, 1, 0, 0]
119
+ #--
120
+ # SPDX-SnippetEnd
121
+ #++
121
122
 
122
123
  ##
123
124
  # :attr_reader: children
@@ -127,11 +128,19 @@ module RatatuiRuby
127
128
  #
128
129
  # === Example
129
130
  #
131
+ #--
132
+ # SPDX-SnippetBegin
133
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
134
+ # SPDX-License-Identifier: MIT-0
135
+ #++
130
136
  # Block.new(
131
137
  # title: "Content",
132
138
  # borders: [:all],
133
139
  # children: [Paragraph.new(text: "Hello")]
134
140
  # )
141
+ #--
142
+ # SPDX-SnippetEnd
143
+ #++
135
144
 
136
145
  # Creates a new Block.
137
146
  #
@@ -145,8 +154,6 @@ module RatatuiRuby
145
154
  # Base style for all titles (optional).
146
155
  # [borders]
147
156
  # Array of borders to show: <tt>:top</tt>, <tt>:bottom</tt>, <tt>:left</tt>, <tt>:right</tt>, or <tt>:all</tt> (default).
148
- # [border_color]
149
- # Color string or symbol (e.g., <tt>:red</tt>). Deprecated: use <tt>border_style</tt> instead.
150
157
  # [border_style]
151
158
  # Style object or Hash for the border lines.
152
159
  # [border_type]
@@ -159,7 +166,7 @@ module RatatuiRuby
159
166
  # Integer (uniform) or Array[4] (left, right, top, bottom).
160
167
  # [children]
161
168
  # Array of widgets to render inside the block (optional).
162
- def initialize(title: nil, titles: [], title_alignment: nil, title_style: nil, borders: [:all], border_color: nil, border_style: nil, border_type: nil, border_set: nil, style: nil, padding: 0, children: [])
169
+ def initialize(title: nil, titles: [], title_alignment: nil, title_style: nil, borders: [:all], border_style: nil, border_type: nil, border_set: nil, style: nil, padding: 0, children: [])
163
170
  if border_set
164
171
  border_set = border_set.dup
165
172
  %i[top_left top_right bottom_left bottom_right vertical_left vertical_right horizontal_top horizontal_bottom].each do |long_key|
@@ -180,7 +187,6 @@ module RatatuiRuby
180
187
  title_alignment:,
181
188
  title_style:,
182
189
  borders:,
183
- border_color:,
184
190
  border_style:,
185
191
  border_type:,
186
192
  border_set:,
@@ -198,14 +204,30 @@ module RatatuiRuby
198
204
  #
199
205
  # === Example
200
206
  #
207
+ #--
208
+ # SPDX-SnippetBegin
209
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
210
+ # SPDX-License-Identifier: MIT-0
211
+ #++
201
212
  # block = Block.new(borders: [:all], padding: 1)
202
213
  # outer = Layout::Rect.new(x: 0, y: 0, width: 20, height: 10)
203
214
  # inner = block.inner(outer)
204
215
  # # => Rect(x: 2, y: 2, width: 16, height: 6)
205
216
  #
217
+ #--
218
+ # SPDX-SnippetEnd
219
+ #++
206
220
  # [area]
221
+ #--
222
+ # SPDX-SnippetBegin
223
+ # SPDX-FileCopyrightText: 2026 Kerrick Long
224
+ # SPDX-License-Identifier: MIT-0
225
+ #++
207
226
  # The outer Rect to compute the inner area for.
208
227
  #
228
+ #--
229
+ # SPDX-SnippetEnd
230
+ #++
209
231
  # Returns a new Rect representing the inner content area.
210
232
  def inner(area)
211
233
  # Calculate border offsets
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
+ # SPDX-License-Identifier: LGPL-3.0-or-later
6
6
  #++
7
7
 
8
8
  module RatatuiRuby