defmodule PrimerLive.UIIcons do @moduledoc """ Interface icons that are not part of the Octicons set. """ use Phoenix.Component require PrimerLive.Helpers.DeclarationHelpers @common_svg_attrs [ viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false" ] def common_svg_attrs, do: @common_svg_attrs @doc """ Internal use: generates a map of SVG's. To use the `PrimerLive.Component.ui_icon/1` component, write: ``` <.ui_icon name="icon-name" /> ``` ## All UI icons ``` <.ui_icon name="single-select-16" /> <.ui_icon name="multiple-select-16" /> <.ui_icon name="collapse-16" /> ``` """ attr(:rest, :global, doc: """ Additional HTML attributes added to the svg element. """ ) def ui_icons(assigns) do assigns = assigns |> assign(:common_attrs, @common_svg_attrs) %{ "single-select-16" => ~H""" """, "multiple-select-16" => ~H""" """, "collapse-16" => ~H""" """, "toggle-switch-on-16" => ~H""" """, "toggle-switch-off-16" => ~H""" """ } end end