@@ -317,9 +317,15 @@ defmodule LiveDebugger.Components do
317317 assigns
318318 |> assign ( :button_class , button_class )
319319 |> assign ( :icon_class , icon_class )
320+ |> assign ( :aria_label , assigns [ :"aria-label" ] || icon_label ( assigns . icon ) )
320321
321322 ~H"""
322- < . button class = { [ @ button_class | List . wrap ( @ class ) ] } variant = { @ variant } { @ rest } >
323+ < . button
324+ aria-label = { @ aria_label }
325+ class = { [ @ button_class | List . wrap ( @ class ) ] }
326+ variant = { @ variant }
327+ { @ rest }
328+ >
323329 < . icon name = { @ icon } class = { @ icon_class } />
324330 </ . button >
325331 """
@@ -333,6 +339,7 @@ defmodule LiveDebugger.Components do
333339 def nav_icon ( assigns ) do
334340 ~H"""
335341 < button
342+ aria-label = { icon_label ( @ icon ) }
336343 class = { [
337344 "w-8! h-8! px-[0.25rem] py-[0.25rem] w-max h-max rounded text-xs font-semibold text-navbar-icon hover:text-navbar-icon-hover hover:bg-navbar-icon-bg-hover"
338345 | List . wrap ( @ class )
@@ -546,7 +553,7 @@ defmodule LiveDebugger.Components do
546553
547554 def navbar ( assigns ) do
548555 ~H"""
549- < div class = "w-full h-12 shrink-0 py-auto px-4 flex items-center gap-2 bg-navbar-bg text-navbar-logo border-b border-navbar-border " >
556+ < navbar class = "w-full h-12 shrink-0 py-auto px-4 flex items-center gap-2 bg-navbar-bg text-navbar-logo border-b border-navbar-border " >
550557 < . link :if = { @ return_link? } patch = { Routes . live_views_dashboard ( ) } >
551558 < . nav_icon icon = "icon-arrow-left " />
552559 </ . link >
@@ -573,7 +580,7 @@ defmodule LiveDebugger.Components do
573580 <%= @ inner_block && render_slot ( @ inner_block ) %>
574581 </ div >
575582 </ div >
576- </ div >
583+ </ navbar >
577584 """
578585 end
579586
@@ -651,4 +658,10 @@ defmodule LiveDebugger.Components do
651658
652659 defp button_size_classes ( "md" ) , do: "py-2 px-3"
653660 defp button_size_classes ( "sm" ) , do: "py-1.5 px-2"
661+
662+ defp icon_label ( "icon-" <> icon_name ) do
663+ icon_name
664+ |> String . capitalize ( )
665+ |> String . replace ( "-" , " " )
666+ end
654667end
0 commit comments