Raxol.UI.BorderRenderer (Raxol v2.6.0)

View Source

Handles border rendering logic and border character definitions.

Summary

Functions

Gets border characters for a given border style.

Returns border chars in the 8-key format used by FocusRing and wrap_with_border.

Returns border characters, falling back to ASCII if the terminal does not support Unicode box-drawing characters.

Renders box borders with proper styling.

Renders empty box with no borders.

Types

border_chars()

@type border_chars() :: %{
  top_left: String.t(),
  top_right: String.t(),
  bottom_left: String.t(),
  bottom_right: String.t(),
  horizontal: String.t(),
  vertical: String.t()
}

border_chars_8key()

@type border_chars_8key() :: %{
  top_left: String.t(),
  top: String.t(),
  top_right: String.t(),
  left: String.t(),
  right: String.t(),
  bottom_left: String.t(),
  bottom: String.t(),
  bottom_right: String.t()
}

border_style()

@type border_style() :: :single | :double | :rounded | :ascii | :none

cell()

@type cell() :: {integer(), integer(), String.t(), atom(), atom(), list()}

Functions

get_border_chars(arg1)

@spec get_border_chars(border_style()) :: border_chars()

Gets border characters for a given border style.

get_border_chars_8key(style)

@spec get_border_chars_8key(border_style()) :: border_chars_8key()

Returns border chars in the 8-key format used by FocusRing and wrap_with_border.

Keys: top_left, top, top_right, left, right, bottom_left, bottom, bottom_right

get_border_chars_adaptive(style)

@spec get_border_chars_adaptive(border_style()) :: border_chars()

Returns border characters, falling back to ASCII if the terminal does not support Unicode box-drawing characters.

render_box_borders(x, y, width, height, border_chars, style)

@spec render_box_borders(
  integer(),
  integer(),
  pos_integer(),
  pos_integer(),
  border_chars(),
  map()
) :: [cell()]

Renders box borders with proper styling.

render_empty_box(x, y, width, height, style)

@spec render_empty_box(
  integer(),
  integer(),
  pos_integer(),
  pos_integer(),
  map()
) :: [cell()]

Renders empty box with no borders.

render_horizontal_line(x, y, width, char, style, theme)

@spec render_horizontal_line(
  integer(),
  integer(),
  pos_integer(),
  String.t(),
  map(),
  term()
) :: [cell()]

Renders horizontal line.

render_vertical_line(x, y, height, char, style, theme)

@spec render_vertical_line(
  integer(),
  integer(),
  pos_integer(),
  String.t(),
  map(),
  term()
) :: [cell()]

Renders vertical line.