new primitives

This commit is contained in:
2026-04-29 17:50:45 +02:00
parent d9232eabb4
commit 272e75bd6f
2 changed files with 101 additions and 1 deletions

View File

@@ -75,6 +75,30 @@ module BBS
def call(&block)
@steps << { type: :call, block: block }
end
def line(color: :muted)
@steps << { type: :line, color: color }
end
def section(title, color: :confirm)
@steps << { type: :section, title: title, color: color }
end
def text(content = nil, style: :muted, &block)
@steps << { type: :text, text: content, block: block, style: style }
end
def rows(empty: 'No items.', &block)
@steps << { type: :rows, block: block, empty: empty }
end
def table(&block)
@steps << { type: :table, block: block }
end
def wait_enter(prompt: 'Press ENTER to continue...')
@steps << { type: :wait_enter, prompt: prompt }
end
end
class MenuBuilder