ratatui_ruby 0.3.1 → 0.5.0

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 (350) hide show
  1. checksums.yaml +4 -4
  2. data/.builds/ruby-3.2.yml +14 -12
  3. data/.builds/ruby-3.3.yml +14 -12
  4. data/.builds/ruby-3.4.yml +14 -12
  5. data/.builds/ruby-4.0.0.yml +14 -12
  6. data/AGENTS.md +89 -132
  7. data/CHANGELOG.md +223 -1
  8. data/README.md +23 -16
  9. data/REUSE.toml +20 -0
  10. data/doc/application_architecture.md +176 -0
  11. data/doc/application_testing.md +17 -10
  12. data/doc/contributors/design/ruby_frontend.md +11 -7
  13. data/doc/contributors/developing_examples.md +261 -0
  14. data/doc/contributors/documentation_style.md +104 -0
  15. data/doc/contributors/dwim_dx.md +366 -0
  16. data/doc/contributors/index.md +2 -0
  17. data/doc/custom.css +14 -0
  18. data/doc/event_handling.md +125 -0
  19. data/doc/images/app_all_events.png +0 -0
  20. data/doc/images/app_analytics.png +0 -0
  21. data/doc/images/app_color_picker.png +0 -0
  22. data/doc/images/app_custom_widget.png +0 -0
  23. data/doc/images/app_login_form.png +0 -0
  24. data/doc/images/app_map_demo.png +0 -0
  25. data/doc/images/app_mouse_events.png +0 -0
  26. data/doc/images/app_table_select.png +0 -0
  27. data/doc/images/verify_quickstart_dsl.png +0 -0
  28. data/doc/images/verify_quickstart_layout.png +0 -0
  29. data/doc/images/verify_quickstart_lifecycle.png +0 -0
  30. data/doc/images/verify_readme_usage.png +0 -0
  31. data/doc/images/widget_barchart_demo.png +0 -0
  32. data/doc/images/widget_block_padding.png +0 -0
  33. data/doc/images/widget_block_titles.png +0 -0
  34. data/doc/images/widget_box_demo.png +0 -0
  35. data/doc/images/widget_calendar_demo.png +0 -0
  36. data/doc/images/widget_cell_demo.png +0 -0
  37. data/doc/images/widget_chart_demo.png +0 -0
  38. data/doc/images/widget_gauge_demo.png +0 -0
  39. data/doc/images/widget_layout_split.png +0 -0
  40. data/doc/images/widget_line_gauge_demo.png +0 -0
  41. data/doc/images/widget_list_demo.png +0 -0
  42. data/doc/images/widget_list_styles.png +0 -0
  43. data/doc/images/widget_popup_demo.png +0 -0
  44. data/doc/images/widget_ratatui_logo_demo.png +0 -0
  45. data/doc/images/widget_ratatui_mascot_demo.png +0 -0
  46. data/doc/images/widget_rect.png +0 -0
  47. data/doc/images/widget_render.png +0 -0
  48. data/doc/images/widget_rich_text.png +0 -0
  49. data/doc/images/widget_scroll_text.png +0 -0
  50. data/doc/images/widget_scrollbar_demo.png +0 -0
  51. data/doc/images/widget_sparkline_demo.png +0 -0
  52. data/doc/images/widget_style_colors.png +0 -0
  53. data/doc/images/widget_table_flex.png +0 -0
  54. data/doc/images/widget_tabs_demo.png +0 -0
  55. data/doc/index.md +1 -0
  56. data/doc/interactive_design.md +116 -0
  57. data/doc/quickstart.md +186 -84
  58. data/examples/app_all_events/README.md +81 -0
  59. data/examples/app_all_events/app.rb +93 -0
  60. data/examples/app_all_events/model/event_color_cycle.rb +41 -0
  61. data/examples/app_all_events/model/event_entry.rb +75 -0
  62. data/examples/app_all_events/model/events.rb +180 -0
  63. data/examples/app_all_events/model/highlight.rb +57 -0
  64. data/examples/app_all_events/model/timestamp.rb +54 -0
  65. data/examples/app_all_events/test/snapshots/after_focus_lost.txt +24 -0
  66. data/examples/app_all_events/test/snapshots/after_focus_regained.txt +24 -0
  67. data/examples/app_all_events/test/snapshots/after_horizontal_resize.txt +24 -0
  68. data/examples/app_all_events/test/snapshots/after_key_a.txt +24 -0
  69. data/examples/app_all_events/test/snapshots/after_key_ctrl_x.txt +24 -0
  70. data/examples/app_all_events/test/snapshots/after_mouse_click.txt +24 -0
  71. data/examples/app_all_events/test/snapshots/after_mouse_drag.txt +24 -0
  72. data/examples/app_all_events/test/snapshots/after_multiple_events.txt +24 -0
  73. data/examples/app_all_events/test/snapshots/after_paste.txt +24 -0
  74. data/examples/app_all_events/test/snapshots/after_resize.txt +24 -0
  75. data/examples/app_all_events/test/snapshots/after_right_click.txt +24 -0
  76. data/examples/app_all_events/test/snapshots/after_vertical_resize.txt +24 -0
  77. data/examples/app_all_events/test/snapshots/initial_state.txt +24 -0
  78. data/examples/app_all_events/view/app_view.rb +78 -0
  79. data/examples/app_all_events/view/controls_view.rb +50 -0
  80. data/examples/app_all_events/view/counts_view.rb +55 -0
  81. data/examples/app_all_events/view/live_view.rb +69 -0
  82. data/examples/app_all_events/view/log_view.rb +60 -0
  83. data/{lib/ratatui_ruby/output.rb → examples/app_all_events/view.rb} +1 -1
  84. data/examples/app_all_events/view_state.rb +42 -0
  85. data/examples/app_color_picker/README.md +94 -0
  86. data/examples/app_color_picker/app.rb +112 -0
  87. data/examples/app_color_picker/clipboard.rb +84 -0
  88. data/examples/app_color_picker/color.rb +191 -0
  89. data/examples/app_color_picker/copy_dialog.rb +170 -0
  90. data/examples/app_color_picker/harmony.rb +56 -0
  91. data/examples/app_color_picker/input.rb +142 -0
  92. data/examples/app_color_picker/palette.rb +80 -0
  93. data/examples/app_color_picker/scene.rb +201 -0
  94. data/examples/app_login_form/app.rb +108 -0
  95. data/examples/app_map_demo/app.rb +93 -0
  96. data/examples/app_table_select/app.rb +201 -0
  97. data/examples/verify_quickstart_dsl/app.rb +45 -0
  98. data/examples/verify_quickstart_layout/app.rb +69 -0
  99. data/examples/verify_quickstart_lifecycle/app.rb +48 -0
  100. data/examples/verify_readme_usage/app.rb +34 -0
  101. data/examples/widget_barchart_demo/app.rb +238 -0
  102. data/examples/widget_block_padding/app.rb +67 -0
  103. data/examples/widget_block_titles/app.rb +69 -0
  104. data/examples/widget_box_demo/app.rb +250 -0
  105. data/examples/widget_calendar_demo/app.rb +109 -0
  106. data/examples/widget_cell_demo/app.rb +104 -0
  107. data/examples/widget_chart_demo/app.rb +213 -0
  108. data/examples/widget_gauge_demo/app.rb +212 -0
  109. data/examples/widget_layout_split/app.rb +246 -0
  110. data/examples/widget_line_gauge_demo/app.rb +217 -0
  111. data/examples/widget_list_demo/app.rb +382 -0
  112. data/examples/widget_list_styles/app.rb +141 -0
  113. data/examples/widget_popup_demo/app.rb +104 -0
  114. data/examples/widget_ratatui_logo_demo/app.rb +103 -0
  115. data/examples/widget_ratatui_mascot_demo/app.rb +93 -0
  116. data/examples/widget_rect/app.rb +205 -0
  117. data/examples/widget_render/app.rb +184 -0
  118. data/examples/widget_rich_text/app.rb +137 -0
  119. data/examples/widget_scroll_text/app.rb +108 -0
  120. data/examples/widget_scrollbar_demo/app.rb +153 -0
  121. data/examples/widget_sparkline_demo/app.rb +274 -0
  122. data/examples/widget_style_colors/app.rb +102 -0
  123. data/examples/widget_table_flex/app.rb +95 -0
  124. data/examples/widget_tabs_demo/app.rb +167 -0
  125. data/ext/ratatui_ruby/Cargo.lock +889 -115
  126. data/ext/ratatui_ruby/Cargo.toml +4 -3
  127. data/ext/ratatui_ruby/clippy.toml +7 -0
  128. data/ext/ratatui_ruby/extconf.rb +7 -0
  129. data/ext/ratatui_ruby/src/events.rs +293 -219
  130. data/ext/ratatui_ruby/src/frame.rs +115 -0
  131. data/ext/ratatui_ruby/src/lib.rs +105 -24
  132. data/ext/ratatui_ruby/src/rendering.rs +94 -10
  133. data/ext/ratatui_ruby/src/style.rs +357 -93
  134. data/ext/ratatui_ruby/src/terminal.rs +121 -31
  135. data/ext/ratatui_ruby/src/text.rs +178 -0
  136. data/ext/ratatui_ruby/src/widgets/barchart.rs +99 -24
  137. data/ext/ratatui_ruby/src/widgets/block.rs +32 -3
  138. data/ext/ratatui_ruby/src/widgets/calendar.rs +45 -44
  139. data/ext/ratatui_ruby/src/widgets/canvas.rs +44 -9
  140. data/ext/ratatui_ruby/src/widgets/chart.rs +79 -27
  141. data/ext/ratatui_ruby/src/widgets/clear.rs +3 -1
  142. data/ext/ratatui_ruby/src/widgets/gauge.rs +11 -4
  143. data/ext/ratatui_ruby/src/widgets/layout.rs +223 -15
  144. data/ext/ratatui_ruby/src/widgets/line_gauge.rs +92 -0
  145. data/ext/ratatui_ruby/src/widgets/list.rs +114 -11
  146. data/ext/ratatui_ruby/src/widgets/mod.rs +3 -0
  147. data/ext/ratatui_ruby/src/widgets/overlay.rs +4 -2
  148. data/ext/ratatui_ruby/src/widgets/paragraph.rs +35 -13
  149. data/ext/ratatui_ruby/src/widgets/ratatui_logo.rs +40 -0
  150. data/ext/ratatui_ruby/src/widgets/ratatui_mascot.rs +51 -0
  151. data/ext/ratatui_ruby/src/widgets/scrollbar.rs +61 -7
  152. data/ext/ratatui_ruby/src/widgets/sparkline.rs +73 -6
  153. data/ext/ratatui_ruby/src/widgets/table.rs +177 -64
  154. data/ext/ratatui_ruby/src/widgets/tabs.rs +105 -5
  155. data/lib/ratatui_ruby/cell.rb +166 -0
  156. data/lib/ratatui_ruby/event/focus_gained.rb +49 -0
  157. data/lib/ratatui_ruby/event/focus_lost.rb +50 -0
  158. data/lib/ratatui_ruby/event/key.rb +211 -0
  159. data/lib/ratatui_ruby/event/mouse.rb +124 -0
  160. data/lib/ratatui_ruby/event/none.rb +43 -0
  161. data/lib/ratatui_ruby/event/paste.rb +71 -0
  162. data/lib/ratatui_ruby/event/resize.rb +80 -0
  163. data/lib/ratatui_ruby/event.rb +131 -0
  164. data/lib/ratatui_ruby/frame.rb +87 -0
  165. data/lib/ratatui_ruby/schema/bar_chart/bar.rb +45 -0
  166. data/lib/ratatui_ruby/schema/bar_chart/bar_group.rb +23 -0
  167. data/lib/ratatui_ruby/schema/bar_chart.rb +226 -17
  168. data/lib/ratatui_ruby/schema/block.rb +178 -11
  169. data/lib/ratatui_ruby/schema/calendar.rb +70 -14
  170. data/lib/ratatui_ruby/schema/canvas.rb +213 -46
  171. data/lib/ratatui_ruby/schema/center.rb +46 -8
  172. data/lib/ratatui_ruby/schema/chart.rb +134 -32
  173. data/lib/ratatui_ruby/schema/clear.rb +22 -53
  174. data/lib/ratatui_ruby/schema/constraint.rb +72 -12
  175. data/lib/ratatui_ruby/schema/cursor.rb +23 -5
  176. data/lib/ratatui_ruby/schema/draw.rb +53 -0
  177. data/lib/ratatui_ruby/schema/gauge.rb +56 -12
  178. data/lib/ratatui_ruby/schema/layout.rb +91 -9
  179. data/lib/ratatui_ruby/schema/line_gauge.rb +78 -0
  180. data/lib/ratatui_ruby/schema/list.rb +92 -16
  181. data/lib/ratatui_ruby/schema/overlay.rb +29 -3
  182. data/lib/ratatui_ruby/schema/paragraph.rb +82 -25
  183. data/lib/ratatui_ruby/schema/ratatui_logo.rb +29 -0
  184. data/lib/ratatui_ruby/schema/ratatui_mascot.rb +34 -0
  185. data/lib/ratatui_ruby/schema/rect.rb +59 -10
  186. data/lib/ratatui_ruby/schema/scrollbar.rb +127 -19
  187. data/lib/ratatui_ruby/schema/shape/label.rb +66 -0
  188. data/lib/ratatui_ruby/schema/sparkline.rb +120 -12
  189. data/lib/ratatui_ruby/schema/style.rb +39 -11
  190. data/lib/ratatui_ruby/schema/table.rb +109 -18
  191. data/lib/ratatui_ruby/schema/tabs.rb +71 -10
  192. data/lib/ratatui_ruby/schema/text.rb +90 -0
  193. data/lib/ratatui_ruby/session/autodoc.rb +417 -0
  194. data/lib/ratatui_ruby/session.rb +163 -0
  195. data/lib/ratatui_ruby/test_helper.rb +322 -13
  196. data/lib/ratatui_ruby/version.rb +1 -1
  197. data/lib/ratatui_ruby.rb +184 -38
  198. data/sig/examples/app_all_events/app.rbs +11 -0
  199. data/sig/examples/app_all_events/model/event_entry.rbs +16 -0
  200. data/sig/examples/app_all_events/model/events.rbs +15 -0
  201. data/sig/examples/app_all_events/model/timestamp.rbs +11 -0
  202. data/sig/examples/app_all_events/view/app_view.rbs +8 -0
  203. data/sig/examples/app_all_events/view/controls_view.rbs +6 -0
  204. data/sig/examples/app_all_events/view/counts_view.rbs +6 -0
  205. data/sig/examples/app_all_events/view/live_view.rbs +6 -0
  206. data/sig/examples/app_all_events/view/log_view.rbs +6 -0
  207. data/sig/examples/app_all_events/view.rbs +8 -0
  208. data/sig/examples/app_all_events/view_state.rbs +15 -0
  209. data/sig/examples/app_color_picker/app.rbs +12 -0
  210. data/sig/examples/app_login_form/app.rbs +11 -0
  211. data/sig/examples/app_map_demo/app.rbs +11 -0
  212. data/sig/examples/app_table_select/app.rbs +11 -0
  213. data/sig/examples/verify_quickstart_dsl/app.rbs +11 -0
  214. data/sig/examples/verify_quickstart_lifecycle/app.rbs +11 -0
  215. data/sig/examples/verify_readme_usage/app.rbs +11 -0
  216. data/sig/examples/widget_block_padding/app.rbs +11 -0
  217. data/sig/examples/widget_block_titles/app.rbs +11 -0
  218. data/sig/examples/widget_box_demo/app.rbs +11 -0
  219. data/sig/examples/widget_calendar_demo/app.rbs +11 -0
  220. data/sig/examples/widget_cell_demo/app.rbs +11 -0
  221. data/sig/examples/widget_chart_demo/app.rbs +11 -0
  222. data/sig/examples/widget_gauge_demo/app.rbs +11 -0
  223. data/sig/examples/widget_layout_split/app.rbs +10 -0
  224. data/sig/examples/widget_line_gauge_demo/app.rbs +11 -0
  225. data/sig/examples/widget_list_demo/app.rbs +12 -0
  226. data/sig/examples/widget_list_styles/app.rbs +11 -0
  227. data/sig/examples/widget_popup_demo/app.rbs +11 -0
  228. data/sig/examples/widget_ratatui_logo_demo/app.rbs +11 -0
  229. data/sig/examples/widget_ratatui_mascot_demo/app.rbs +11 -0
  230. data/sig/examples/widget_rect/app.rbs +12 -0
  231. data/sig/examples/widget_render/app.rbs +10 -0
  232. data/sig/examples/widget_rich_text/app.rbs +11 -0
  233. data/sig/examples/widget_scroll_text/app.rbs +11 -0
  234. data/sig/examples/widget_scrollbar_demo/app.rbs +11 -0
  235. data/sig/examples/widget_sparkline_demo/app.rbs +10 -0
  236. data/sig/examples/widget_style_colors/app.rbs +14 -0
  237. data/sig/examples/widget_table_flex/app.rbs +11 -0
  238. data/sig/ratatui_ruby/event.rbs +69 -0
  239. data/sig/ratatui_ruby/frame.rbs +9 -0
  240. data/sig/ratatui_ruby/ratatui_ruby.rbs +5 -3
  241. data/sig/ratatui_ruby/schema/bar_chart/bar.rbs +16 -0
  242. data/sig/ratatui_ruby/schema/bar_chart/bar_group.rbs +13 -0
  243. data/sig/ratatui_ruby/schema/bar_chart.rbs +20 -2
  244. data/sig/ratatui_ruby/schema/block.rbs +5 -4
  245. data/sig/ratatui_ruby/schema/calendar.rbs +6 -2
  246. data/sig/ratatui_ruby/schema/canvas.rbs +52 -39
  247. data/sig/ratatui_ruby/schema/center.rbs +3 -3
  248. data/sig/ratatui_ruby/schema/chart.rbs +8 -5
  249. data/sig/ratatui_ruby/schema/constraint.rbs +8 -5
  250. data/sig/ratatui_ruby/schema/cursor.rbs +1 -1
  251. data/sig/ratatui_ruby/schema/draw.rbs +27 -0
  252. data/sig/ratatui_ruby/schema/gauge.rbs +4 -2
  253. data/sig/ratatui_ruby/schema/layout.rbs +11 -1
  254. data/sig/ratatui_ruby/schema/line_gauge.rbs +16 -0
  255. data/sig/ratatui_ruby/schema/list.rbs +5 -1
  256. data/sig/ratatui_ruby/schema/paragraph.rbs +4 -1
  257. data/sig/ratatui_ruby/schema/ratatui_logo.rbs +8 -0
  258. data/sig/ratatui_ruby/{buffer.rbs → schema/ratatui_mascot.rbs} +4 -3
  259. data/sig/ratatui_ruby/schema/rect.rbs +2 -1
  260. data/sig/ratatui_ruby/schema/scrollbar.rbs +18 -2
  261. data/sig/ratatui_ruby/schema/sparkline.rbs +6 -2
  262. data/sig/ratatui_ruby/schema/table.rbs +8 -1
  263. data/sig/ratatui_ruby/schema/tabs.rbs +5 -1
  264. data/sig/ratatui_ruby/schema/text.rbs +22 -0
  265. data/sig/ratatui_ruby/session.rbs +94 -0
  266. data/tasks/autodoc/inventory.rb +61 -0
  267. data/tasks/autodoc/member.rb +56 -0
  268. data/tasks/autodoc/name.rb +19 -0
  269. data/tasks/autodoc/notice.rb +26 -0
  270. data/tasks/autodoc/rbs.rb +38 -0
  271. data/tasks/autodoc/rdoc.rb +45 -0
  272. data/tasks/autodoc.rake +47 -0
  273. data/tasks/bump/history.rb +2 -2
  274. data/tasks/doc.rake +600 -6
  275. data/tasks/example_viewer.html.erb +172 -0
  276. data/tasks/lint.rake +8 -4
  277. data/tasks/resources/build.yml.erb +13 -11
  278. data/tasks/resources/index.html.erb +6 -0
  279. data/tasks/sourcehut.rake +4 -4
  280. data/tasks/terminal_preview/app_screenshot.rb +33 -0
  281. data/tasks/terminal_preview/crash_report.rb +52 -0
  282. data/tasks/terminal_preview/example_app.rb +25 -0
  283. data/tasks/terminal_preview/launcher_script.rb +46 -0
  284. data/tasks/terminal_preview/preview_collection.rb +58 -0
  285. data/tasks/terminal_preview/preview_timing.rb +22 -0
  286. data/tasks/terminal_preview/safety_confirmation.rb +56 -0
  287. data/tasks/terminal_preview/saved_screenshot.rb +53 -0
  288. data/tasks/terminal_preview/system_appearance.rb +11 -0
  289. data/tasks/terminal_preview/terminal_window.rb +136 -0
  290. data/tasks/terminal_preview/window_id.rb +14 -0
  291. data/tasks/terminal_preview.rake +28 -0
  292. data/tasks/test.rake +2 -2
  293. data/tasks/website/index_page.rb +3 -3
  294. data/tasks/website/version.rb +10 -10
  295. data/tasks/website/version_menu.rb +10 -12
  296. data/tasks/website/versioned_documentation.rb +49 -17
  297. data/tasks/website/website.rb +6 -8
  298. data/tasks/website.rake +4 -4
  299. metadata +206 -54
  300. data/LICENSES/BSD-2-Clause.txt +0 -9
  301. data/doc/images/examples-analytics.rb.png +0 -0
  302. data/doc/images/examples-box_demo.rb.png +0 -0
  303. data/doc/images/examples-calendar_demo.rb.png +0 -0
  304. data/doc/images/examples-chart_demo.rb.png +0 -0
  305. data/doc/images/examples-custom_widget.rb.png +0 -0
  306. data/doc/images/examples-dashboard.rb.png +0 -0
  307. data/doc/images/examples-list_styles.rb.png +0 -0
  308. data/doc/images/examples-login_form.rb.png +0 -0
  309. data/doc/images/examples-map_demo.rb.png +0 -0
  310. data/doc/images/examples-mouse_events.rb.png +0 -0
  311. data/doc/images/examples-popup_demo.rb.gif +0 -0
  312. data/doc/images/examples-quickstart_lifecycle.rb.png +0 -0
  313. data/doc/images/examples-scroll_text.rb.png +0 -0
  314. data/doc/images/examples-scrollbar_demo.rb.png +0 -0
  315. data/doc/images/examples-stock_ticker.rb.png +0 -0
  316. data/doc/images/examples-system_monitor.rb.png +0 -0
  317. data/doc/images/examples-table_select.rb.png +0 -0
  318. data/examples/analytics.rb +0 -88
  319. data/examples/box_demo.rb +0 -71
  320. data/examples/calendar_demo.rb +0 -55
  321. data/examples/chart_demo.rb +0 -84
  322. data/examples/custom_widget.rb +0 -43
  323. data/examples/dashboard.rb +0 -72
  324. data/examples/list_styles.rb +0 -66
  325. data/examples/login_form.rb +0 -115
  326. data/examples/map_demo.rb +0 -58
  327. data/examples/mouse_events.rb +0 -95
  328. data/examples/popup_demo.rb +0 -105
  329. data/examples/quickstart_dsl.rb +0 -30
  330. data/examples/quickstart_lifecycle.rb +0 -40
  331. data/examples/readme_usage.rb +0 -21
  332. data/examples/scroll_text.rb +0 -74
  333. data/examples/scrollbar_demo.rb +0 -75
  334. data/examples/stock_ticker.rb +0 -93
  335. data/examples/system_monitor.rb +0 -94
  336. data/examples/table_select.rb +0 -70
  337. data/examples/test_analytics.rb +0 -65
  338. data/examples/test_box_demo.rb +0 -38
  339. data/examples/test_calendar_demo.rb +0 -66
  340. data/examples/test_dashboard.rb +0 -38
  341. data/examples/test_list_styles.rb +0 -61
  342. data/examples/test_login_form.rb +0 -63
  343. data/examples/test_map_demo.rb +0 -100
  344. data/examples/test_popup_demo.rb +0 -62
  345. data/examples/test_scroll_text.rb +0 -130
  346. data/examples/test_stock_ticker.rb +0 -39
  347. data/examples/test_system_monitor.rb +0 -40
  348. data/examples/test_table_select.rb +0 -37
  349. data/ext/ratatui_ruby/src/buffer.rs +0 -54
  350. data/lib/ratatui_ruby/dsl.rb +0 -64
@@ -4,37 +4,94 @@
4
4
  # SPDX-License-Identifier: AGPL-3.0-or-later
5
5
 
6
6
  module RatatuiRuby
7
- # A widget that displays a block of text.
7
+ # Displays a block of text.
8
8
  #
9
- # [text] the text to display.
10
- # [style] the style to apply (Style object).
11
- # [block] an optional Block widget to wrap the paragraph.
12
- # [scroll] scroll offset as (y, x) array matching ratatui convention.
13
- class Paragraph < Data.define(:text, :style, :block, :wrap, :align, :scroll)
9
+ # Raw strings are insufficient for UIs. They overflow constraints. They don't respect alignment (left, center, right).
10
+ #
11
+ # This widget creates a smart text container. It wraps content to fit the area. It aligns text as requested. It supports scrolling.
12
+ #
13
+ # Use it for everything from simple labels to complex, multi-paragraph documents.
14
+ #
15
+ # === Examples
16
+ #
17
+ # # Basic Text
18
+ # Paragraph.new(text: "Hello, World!")
19
+ #
20
+ # # Styled container with wrapping
21
+ # Paragraph.new(
22
+ # text: "This is a long line that will wrap automatically.",
23
+ # style: Style.new(fg: :green),
24
+ # wrap: true,
25
+ # block: Block.new(title: "Output", borders: [:all])
26
+ # )
27
+ #
28
+ # # Scrolling mechanism
29
+ # Paragraph.new(text: large_text, scroll: [scroll_y, 0])
30
+ class Paragraph < Data.define(:text, :style, :block, :wrap, :alignment, :scroll)
31
+ ##
32
+ # :attr_reader: text
33
+ # The content to display.
34
+
35
+ ##
36
+ # :attr_reader: style
37
+ # Base style for the text.
38
+
39
+ ##
40
+ # :attr_reader: block
41
+ # Optional wrapping block.
42
+
43
+ ##
44
+ # :attr_reader: wrap
45
+ # Whether to wrap text at the edge of the container (Boolean).
46
+
47
+ ##
48
+ # :attr_reader: alignment
49
+ # Text alignment.
50
+ #
51
+ # <tt>:left</tt>, <tt>:center</tt>, or <tt>:right</tt>.
52
+
53
+ ##
54
+ # :attr_reader: scroll
55
+ # Scroll offset [y, x].
56
+
14
57
  # Creates a new Paragraph.
15
58
  #
16
- # [text] the text to display.
17
- # [style] the style to apply.
18
- # [block] the block to wrap the paragraph.
19
- # [wrap] whether to wrap text at width.
20
- # [align] alignment (:left, :center, :right).
21
- # [scroll] scroll offset as (y, x) array (default: [0, 0]).
22
- def initialize(text:, style: Style.default, block: nil, wrap: false, align: :left, scroll: [0, 0])
23
- super
59
+ # [text] String or Text::Line array.
60
+ # [style] Style object.
61
+ # [block] Block object.
62
+ # [wrap] Boolean (default: false).
63
+ # [alignment] Symbol (default: <tt>:left</tt>).
64
+ # [scroll] Array of [y, x] integers (duck-typed via +to_int+).
65
+ def initialize(text:, style: Style.default, block: nil, wrap: false, alignment: :left, scroll: [0, 0])
66
+ super(
67
+ text:,
68
+ style:,
69
+ block:,
70
+ wrap:,
71
+ alignment:,
72
+ scroll: [Integer(scroll[0]), Integer(scroll[1])]
73
+ )
24
74
  end
25
75
 
26
- # Support for legacy fg/bg arguments.
27
- # [text] the text to display.
28
- # [style] the style to apply.
29
- # [fg] legacy foreground color.
30
- # [bg] legacy background color.
31
- # [block] the block to wrap the paragraph.
32
- # [wrap] whether to wrap text at width.
33
- # [align] alignment (:left, :center, :right).
34
- # [scroll] scroll offset as (y, x) array (default: [0, 0]).
35
- def self.new(text:, style: nil, fg: nil, bg: nil, block: nil, wrap: false, align: :left, scroll: [0, 0])
76
+ # Legacy constructor support.
77
+ def self.new(text:, style: nil, fg: nil, bg: nil, block: nil, wrap: false, alignment: :left, scroll: [0, 0])
36
78
  style ||= Style.new(fg:, bg:)
37
- super(text:, style:, block:, wrap:, align:, scroll:)
79
+ coerced_scroll = [Integer(scroll[0]), Integer(scroll[1])]
80
+ super(text:, style:, block:, wrap:, alignment:, scroll: coerced_scroll)
81
+ end
82
+
83
+ # Returns the number of lines the paragraph would take up if rendered with the given width.
84
+ #
85
+ # [width] Integer (max width).
86
+ def line_count(width)
87
+ RatatuiRuby.warn_experimental_feature("Paragraph#line_count")
88
+ RatatuiRuby._paragraph_line_count(self, Integer(width))
89
+ end
90
+
91
+ # Returns the minimum width needed to not wrap any text.
92
+ def line_width
93
+ RatatuiRuby.warn_experimental_feature("Paragraph#line_width")
94
+ RatatuiRuby._paragraph_line_width(self)
38
95
  end
39
96
  end
40
97
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
4
+ # SPDX-License-Identifier: AGPL-3.0-or-later
5
+
6
+ module RatatuiRuby
7
+ # Displays the Ratatui logo.
8
+ #
9
+ # Branding is important for identity. Users need to recognize the tools they use.
10
+ #
11
+ # This widget renders the official Ratatui logo.
12
+ #
13
+ # Use it for splash screens, about sections, or terminal dashboards.
14
+ #
15
+ # {rdoc-image:/doc/images/widget_ratatui_logo_demo.png}[link:/examples/widget_ratatui_logo_demo/app_rb.html]
16
+ #
17
+ # === Example
18
+ #
19
+ # Run the interactive demo from the terminal:
20
+ #
21
+ # ruby examples/widget_ratatui_logo_demo/app.rb
22
+ class RatatuiLogo < Data.define
23
+ ##
24
+ # :method: new
25
+ # :call-seq: new -> RatatuiLogo
26
+ #
27
+ # Creates a new RatatuiLogo.
28
+ end
29
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
4
+ # SPDX-License-Identifier: AGPL-3.0-or-later
5
+
6
+ module RatatuiRuby
7
+ # Displays the Ratatui mascot.
8
+ #
9
+ # Interfaces without personality feel clinical and dry. Users appreciate a friendly face in their terminal.
10
+ #
11
+ # This widget renders the Ratatui mascot (a mouse).
12
+ #
13
+ # Use it to add charm to your application, greet users on startup, or as a decorative element in sidebars.
14
+ #
15
+ # {rdoc-image:/doc/images/widget_ratatui_mascot_demo.png}[link:/examples/widget_ratatui_mascot_demo/app_rb.html]
16
+ #
17
+ # === Example
18
+ #
19
+ # Run the interactive demo from the terminal:
20
+ #
21
+ # ruby examples/widget_ratatui_mascot_demo/app.rb
22
+ class RatatuiMascot < Data.define(:block)
23
+ ##
24
+ # :method: new
25
+ # :call-seq: new(block: nil) -> RatatuiMascot
26
+ #
27
+ # Creates a new RatatuiMascot.
28
+ #
29
+ # @param block [Block, nil] A block to wrap the widget in.
30
+ def initialize(block: nil)
31
+ super
32
+ end
33
+ end
34
+ end
@@ -4,21 +4,70 @@
4
4
  # SPDX-License-Identifier: AGPL-3.0-or-later
5
5
 
6
6
  module RatatuiRuby
7
- # A rectangle in the terminal grid.
7
+ # Defines a rectangular area in the terminal grid.
8
8
  #
9
- # [x] The x-coordinate of the top-left corner.
10
- # [y] The y-coordinate of the top-left corner.
11
- # [width] The width of the rectangle.
12
- # [height] The height of the rectangle.
9
+ # Geometry management involves passing groups of four integers (`x, y, width, height`) repeatedly.
10
+ # This is verbose and prone to parameter mismatch errors.
11
+ #
12
+ # This class encapsulates the geometry. It provides a standard primitive for passing area definitions
13
+ # between layout engines and rendering functions.
14
+ #
15
+ # Use it when manual positioning is required or when querying layout results.
16
+ #
17
+ # === Examples
18
+ #
19
+ # area = Rect.new(x: 0, y: 0, width: 80, height: 24)
20
+ # puts area.width # => 80
13
21
  class Rect < Data.define(:x, :y, :width, :height)
22
+ ##
23
+ # :attr_reader: x
24
+ # X coordinate (column) of the top-left corner (Integer, coerced via +to_int+ or +to_i+).
25
+
26
+ ##
27
+ # :attr_reader: y
28
+ # Y coordinate (row) of the top-left corner (Integer, coerced via +to_int+ or +to_i+).
29
+
30
+ ##
31
+ # :attr_reader: width
32
+ # Width in characters (Integer, coerced via +to_int+ or +to_i+).
33
+
34
+ ##
35
+ # :attr_reader: height
36
+ # Height in characters (Integer, coerced via +to_int+ or +to_i+).
37
+
14
38
  # Creates a new Rect.
15
39
  #
16
- # [x] The x-coordinate of the top-left corner.
17
- # [y] The y-coordinate of the top-left corner.
18
- # [width] The width of the rectangle.
19
- # [height] The height of the rectangle.
40
+ # All parameters accept any object responding to +to_int+ or +to_i+ (duck-typed).
41
+ #
42
+ # [x] Column index (Numeric).
43
+ # [y] Row index (Numeric).
44
+ # [width] Width in columns (Numeric).
45
+ # [height] Height in rows (Numeric).
20
46
  def initialize(x: 0, y: 0, width: 0, height: 0)
21
- super
47
+ super(
48
+ x: Integer(x),
49
+ y: Integer(y),
50
+ width: Integer(width),
51
+ height: Integer(height)
52
+ )
53
+ end
54
+
55
+ # Tests whether a point is inside this rectangle.
56
+ #
57
+ # Essential for hit testing mouse clicks against layout regions.
58
+ #
59
+ # area = Rect.new(x: 10, y: 5, width: 20, height: 10)
60
+ # area.contains?(15, 8) # => true
61
+ # area.contains?(5, 8) # => false
62
+ #
63
+ # [px]
64
+ # X coordinate to test (column).
65
+ # [py]
66
+ # Y coordinate to test (row).
67
+ #
68
+ # Returns true if the point (px, py) is within the rectangle bounds.
69
+ def contains?(px, py)
70
+ px >= x && px < x + width && py >= y && py < y + height
22
71
  end
23
72
  end
24
73
  end
@@ -4,30 +4,138 @@
4
4
  # SPDX-License-Identifier: AGPL-3.0-or-later
5
5
 
6
6
  module RatatuiRuby
7
- ##
8
- # Visual scroll indicator.
7
+ # Visualizes the scroll state of a viewport.
9
8
  #
10
- # A Scrollbar widget that can be oriented vertically or horizontally.
11
- # It displays a track and a thumb to indicate the current scroll position
12
- # relative to the total content length.
9
+ # Content overflows. Users get lost in long lists without landmarks. They need to know where they are and how much is left.
13
10
  #
14
- # == Fields
11
+ # This widget maps your context. It draws a track and a thumb, representing your current position relative to the total length.
15
12
  #
16
- # [+content_length+] Total length of the content (Integer).
17
- # [+position+] Current scroll position (Integer).
18
- # [+orientation+] +:vertical+ or +:horizontal+ (Symbol, default: +:vertical+).
19
- # [+thumb_symbol+] The character used for the scrollbar thumb (String, default: "█").
20
- # [+block+] An optional Block to wrap the scrollbar.
21
- class Scrollbar < Data.define(:content_length, :position, :orientation, :thumb_symbol, :block)
13
+ # Overlay it on top of lists, paragraphs, or tables to provide spatial awareness.
14
+ #
15
+ # {rdoc-image:/doc/images/widget_scrollbar_demo.png}[link:/examples/widget_scrollbar_demo/app_rb.html]
16
+ #
17
+ # === Example
18
+ #
19
+ # Run the interactive demo from the terminal:
20
+ #
21
+ # ruby examples/widget_scrollbar_demo/app.rb
22
+ class Scrollbar < Data.define(
23
+ :content_length,
24
+ :position,
25
+ :orientation,
26
+ :thumb_symbol,
27
+ :thumb_style,
28
+ :track_symbol,
29
+ :track_style,
30
+ :begin_symbol,
31
+ :begin_style,
32
+ :end_symbol,
33
+ :end_style,
34
+ :style,
35
+ :block
36
+ )
37
+ ##
38
+ # :attr_reader: content_length
39
+ # Total items or lines in the content.
40
+
41
+ ##
42
+ # :attr_reader: position
43
+ # Current scroll offset (index).
44
+ #
45
+ # Maps to Ratatui's <tt>ScrollbarState::get_position()</tt> (new in 0.30.0).
46
+
47
+ ##
48
+ # :attr_reader: orientation
49
+ # Direction of the scrollbar.
50
+ #
51
+ # <tt>:vertical</tt> (default, alias for <tt>:vertical_right</tt>), <tt>:horizontal</tt> (alias for <tt>:horizontal_bottom</tt>),
52
+ # <tt>:vertical_left</tt>, <tt>:vertical_right</tt>, <tt>:horizontal_top</tt>, or <tt>:horizontal_bottom</tt>.
53
+
54
+ ##
55
+ # :attr_reader: thumb_symbol
56
+ # Symbol used to represent the current position indicator.
57
+
58
+ ##
59
+ # :attr_reader: thumb_style
60
+ # Style of the position indicator (thumb).
61
+
62
+ ##
63
+ # :attr_reader: track_symbol
64
+ # Symbol used to represent the empty space of the scrollbar.
65
+
66
+ ##
67
+ # :attr_reader: track_style
68
+ # Style of the filled track area.
69
+
70
+ ##
71
+ # :attr_reader: begin_symbol
72
+ # Symbol rendered at the start of the track (e.g., arrow).
73
+
74
+ ##
75
+ # :attr_reader: begin_style
76
+ # Style of the start symbol.
77
+
78
+ ##
79
+ # :attr_reader: end_symbol
80
+ # Symbol rendered at the end of the track (e.g., arrow).
81
+
82
+ ##
83
+ # :attr_reader: end_style
84
+ # Style of the end symbol.
85
+
86
+ ##
87
+ # :attr_reader: style
88
+ # Base style applied to the entire widget.
89
+
90
+ ##
91
+ # :attr_reader: block
92
+ # Optional wrapping block.
93
+
22
94
  # Creates a new Scrollbar.
23
95
  #
24
- # [+content_length+] Total length of the content (Integer).
25
- # [+position+] Current scroll position (Integer).
26
- # [+orientation+] +:vertical+ or +:horizontal+ (Symbol, default: +:vertical+).
27
- # [+thumb_symbol+] The character used for the scrollbar thumb (String, default: "█").
28
- # [+block+] An optional Block to wrap the scrollbar.
29
- def initialize(content_length:, position:, orientation: :vertical, thumb_symbol: "█", block: nil)
30
- super
96
+ # [content_length] Integer.
97
+ # [position] Integer.
98
+ # [orientation] Symbol (default: <tt>:vertical</tt>).
99
+ # [thumb_symbol] String (default: <tt>"█"</tt>).
100
+ # [thumb_style] Style (optional).
101
+ # [track_symbol] String (optional).
102
+ # [track_style] Style (optional).
103
+ # [begin_symbol] String (optional).
104
+ # [begin_style] Style (optional).
105
+ # [end_symbol] String (optional).
106
+ # [end_style] Style (optional).
107
+ # [style] Style (optional).
108
+ # [block] Block (optional).
109
+ def initialize(
110
+ content_length:,
111
+ position:,
112
+ orientation: :vertical,
113
+ thumb_symbol: "█",
114
+ thumb_style: nil,
115
+ track_symbol: nil,
116
+ track_style: nil,
117
+ begin_symbol: nil,
118
+ begin_style: nil,
119
+ end_symbol: nil,
120
+ end_style: nil,
121
+ style: nil,
122
+ block: nil
123
+ )
124
+ super(
125
+ content_length: Integer(content_length),
126
+ position: Integer(position),
127
+ orientation:,
128
+ thumb_symbol:,
129
+ thumb_style:,
130
+ track_symbol:,
131
+ track_style:,
132
+ begin_symbol:,
133
+ begin_style:,
134
+ end_symbol:,
135
+ end_style:,
136
+ style:,
137
+ block:
138
+ )
31
139
  end
32
140
  end
33
141
  end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
4
+ # SPDX-License-Identifier: AGPL-3.0-or-later
5
+
6
+ module RatatuiRuby
7
+ module Shape
8
+ # A text label on a canvas.
9
+ #
10
+ # Labels render text at specific coordinates in canvas space.
11
+ # Unlike shapes, labels are always rendered on top of all other canvas elements.
12
+ #
13
+ # [x] The x-coordinate in canvas space (Numeric).
14
+ # [y] The y-coordinate in canvas space (Numeric).
15
+ # [text] The text content (String or Text::Line).
16
+ # [style] Optional style for the text.
17
+ #
18
+ # === Examples
19
+ #
20
+ # # Simple label
21
+ # Shape::Label.new(x: 0, y: 0, text: "Origin")
22
+ #
23
+ # # Styled label
24
+ # Shape::Label.new(
25
+ # x: -122.4, y: 37.8,
26
+ # text: "San Francisco",
27
+ # style: Style.new(fg: :cyan, add_modifier: :bold)
28
+ # )
29
+ #
30
+ # # Label with Text::Line for rich formatting
31
+ # Shape::Label.new(
32
+ # x: 0.0, y: 0.0,
33
+ # text: Text::Line.new(spans: [
34
+ # Text::Span.new(content: "Hello ", style: Style.new(fg: :red)),
35
+ # Text::Span.new(content: "World", style: Style.new(fg: :blue))
36
+ # ])
37
+ # )
38
+ class Label < Data.define(:x, :y, :text, :style)
39
+ ##
40
+ # :attr_reader: x
41
+ # X coordinate in canvas space (Float, duck-typed via +to_f+).
42
+
43
+ ##
44
+ # :attr_reader: y
45
+ # Y coordinate in canvas space (Float, duck-typed via +to_f+).
46
+
47
+ ##
48
+ # :attr_reader: text
49
+ # Text content (String or Text::Line).
50
+
51
+ ##
52
+ # :attr_reader: style
53
+ # Optional style for the text.
54
+
55
+ # Creates a new Label.
56
+ #
57
+ # [x] X coordinate (Numeric).
58
+ # [y] Y coordinate (Numeric).
59
+ # [text] Text content (String or Text::Line).
60
+ # [style] Style (optional).
61
+ def initialize(x:, y:, text:, style: nil)
62
+ super(x: Float(x), y: Float(y), text:, style:)
63
+ end
64
+ end
65
+ end
66
+ end
@@ -4,21 +4,129 @@
4
4
  # SPDX-License-Identifier: AGPL-3.0-or-later
5
5
 
6
6
  module RatatuiRuby
7
- # A widget that displays a compact data row.
7
+ # Displays high-density data in a compact row.
8
8
  #
9
- # [data] Array of Integers.
10
- # [max] Optional maximum value.
11
- # [style] Optional style for the sparkline.
12
- # [block] Optional block widget to wrap the sparkline.
13
- class Sparkline < Data.define(:data, :max, :style, :block)
9
+ # Users need context. A single value ("90% CPU") tells you current status, but not the trend.
10
+ # Full charts take up too much room.
11
+ #
12
+ # This widget solves the density problem. It condenses history into a single line of variable-height blocks.
13
+ #
14
+ # Use it in dashboards, headers, or list items to providing trending data at a glance.
15
+ #
16
+ # {rdoc-image:/doc/images/widget_sparkline_demo.png}[link:/examples/widget_sparkline_demo/app_rb.html]
17
+ #
18
+ # === Example
19
+ #
20
+ # Run the interactive demo from the terminal:
21
+ #
22
+ # ruby examples/widget_sparkline_demo/app.rb
23
+ class Sparkline < Data.define(:data, :max, :style, :block, :direction, :absent_value_symbol, :absent_value_style, :bar_set)
24
+ ##
25
+ # :attr_reader: data
26
+ # Array of integer values to plot.
27
+
28
+ ##
29
+ # :attr_reader: max
30
+ # Maximum value for scaling (optional).
31
+ #
32
+ # If nil, derived from data max.
33
+
34
+ ##
35
+ # :attr_reader: style
36
+ # Style for the bars.
37
+
38
+ ##
39
+ # :attr_reader: block
40
+ # Optional wrapping block.
41
+
42
+ ##
43
+ # :attr_reader: direction
44
+ # Direction to render data.
45
+ #
46
+ # Accepts +:left_to_right+ (default) or +:right_to_left+.
47
+ # Use +:right_to_left+ when new data should appear on the left.
48
+
49
+ ##
50
+ # :attr_reader: absent_value_symbol
51
+ # Character to render for absent (nil) values (optional).
52
+ #
53
+ # If nil, absent values are rendered with a space.
54
+
55
+ ##
56
+ # :attr_reader: absent_value_style
57
+ # Style for absent (nil) values (optional).
58
+
59
+ ##
60
+ # :attr_reader: bar_set
61
+ # Custom characters for the bars (optional).
62
+ #
63
+ # A Hash with keys defining the characters for the bars.
64
+ # Keys: <tt>:empty</tt>, <tt>:one_eighth</tt>, <tt>:one_quarter</tt>, <tt>:three_eighths</tt>, <tt>:half</tt>, <tt>:five_eighths</tt>, <tt>:three_quarters</tt>, <tt>:seven_eighths</tt>, <tt>:full</tt>.
65
+ #
66
+ # You can also use integers (0-8) as keys, where 0 is empty, 4 is half, and 8 is full.
67
+ #
68
+ # Alternatively, you can pass an Array of 9 strings, where index 0 is empty and index 8 is full.
69
+ #
70
+ # === Examples
71
+ #
72
+ # bar_set: {
73
+ # empty: " ",
74
+ # one_eighth: " ",
75
+ # one_quarter: "▂",
76
+ # three_eighths: "▃",
77
+ # half: "▄",
78
+ # five_eighths: "▅",
79
+ # three_quarters: "▆",
80
+ # seven_eighths: "▇",
81
+ # full: "█"
82
+ # }
83
+ #
84
+ # # Numeric keys (0-8)
85
+ # bar_set: {
86
+ # 0 => " ", 1 => " ", 2 => "▂", 3 => "▃", 4 => "▄", 5 => "▅", 6 => "▆", 7 => "▇", 8 => "█"
87
+ # }
88
+ #
89
+ # # Array (9 items)
90
+ # bar_set: [" ", " ", "▂", "▃", "▄", "▅", "▆", "▇", "█"]
91
+
92
+ BAR_KEYS = %i[empty one_eighth one_quarter three_eighths half five_eighths three_quarters seven_eighths full].freeze
93
+
14
94
  # Creates a new Sparkline widget.
15
95
  #
16
- # [data] Array of Integers.
17
- # [max] Optional maximum value.
18
- # [style] Optional style for the sparkline.
19
- # [block] Optional block widget to wrap the sparkline.
20
- def initialize(data:, max: nil, style: nil, block: nil)
21
- super
96
+ # [data] Array of Integers or nil. nil marks an absent value (distinct from 0).
97
+ # [max] Max value (optional).
98
+ # [style] Style (optional).
99
+ # [block] Block (optional).
100
+ # [direction] +:left_to_right+ or +:right_to_left+ (default: +:left_to_right+).
101
+ # [absent_value_symbol] Character for absent (nil) values (optional).
102
+ # [absent_value_style] Style for absent (nil) values (optional).
103
+ # [bar_set] Hash or Array of custom characters (optional).
104
+ def initialize(data:, max: nil, style: nil, block: nil, direction: :left_to_right, absent_value_symbol: nil, absent_value_style: nil, bar_set: nil)
105
+ if bar_set
106
+ if bar_set.is_a?(Array) && bar_set.size == 9
107
+ # Convert Array to Hash using BAR_KEYS order
108
+ bar_set = BAR_KEYS.zip(bar_set).to_h
109
+ else
110
+ bar_set = bar_set.dup
111
+ # Normalize numeric keys (0-8) to symbolic keys
112
+ BAR_KEYS.each_with_index do |key, i|
113
+ if (val = bar_set.delete(i) || bar_set.delete(i.to_s))
114
+ bar_set[key] = val
115
+ end
116
+ end
117
+ end
118
+ end
119
+ coerced_data = data.map { |v| v.nil? ? nil : Integer(v) }
120
+ super(
121
+ data: coerced_data,
122
+ max: max.nil? ? nil : Integer(max),
123
+ style:,
124
+ block:,
125
+ direction:,
126
+ absent_value_symbol:,
127
+ absent_value_style:,
128
+ bar_set:
129
+ )
22
130
  end
23
131
  end
24
132
  end