Reads Hugeicons Stroke Rounded SVGs and converts them to the kit's stroke format.
Upstream files hard-code stroke="#141B34", stroke-width="1.5" and the line caps on every
shape. The kit's dictionary (priv/icons.json) keeps only the shapes and lets the .lu-i rule of
ledger.css supply stroke: currentColor, the 1.5 width and the round caps, so convert/1 does
the same: it keeps the geometry, drops the stroke attributes and the fill="none", and turns a
solid fill into fill="currentColor" stroke="none". Only shape elements and a fixed list of
attributes survive, so a vendored file can never inject script or styles.
names_in/1 finds the icon names a source file uses, for mix ledger_ui.icons sync.
Summary
Functions
Converts an upstream SVG to the kit's format: the inner shapes only, as a string.
Sorted, unique icon names (without huge-) used by <.icon name="..."> or written as huge-*.
Names in every source file under roots.
"huge-x", "hugeicons:x" and "x" all become "x".
Whether name looks like an upstream file name (search-01).
Wraps converted inner shapes in a standalone <svg> (what the task vendors).
Functions
Converts an upstream SVG to the kit's format: the inner shapes only, as a string.
Returns {:ok, inner} or {:error, :no_shapes}.
iex> svg = ~s(<svg viewBox="0 0 24 24" fill="none"><path d="M1 1L2 2" stroke="#141B34" stroke-width="1.5"/></svg>)
iex> LedgerUI.Icons.Hugeicons.convert(svg)
{:ok, ~s(<path d="M1 1L2 2"/>)}
The inner shapes of a vendored file (what wrap/1 wrote), or :error when it is not an SVG.
Run through convert/1 again, so a hand-edited file is sanitized the same way.
Sorted, unique icon names (without huge-) used by <.icon name="..."> or written as huge-*.
Names in every source file under roots.
"huge-x", "hugeicons:x" and "x" all become "x".
Whether name looks like an upstream file name (search-01).
Wraps converted inner shapes in a standalone <svg> (what the task vendors).