vendor heroicons SVGs, remove GitHub dependency
Only the 7 SVGs actually used are vendored into priv/heroicons/. Also fixes the icon component path resolution (was missing the 24/ size directory) and corrects hero-x-mark/hero-map-pin icon names that included an erroneous hero- prefix.
|
|
@ -18,7 +18,7 @@
|
|||
/* Vendor CSS files are imported via JavaScript/ESBuild */
|
||||
|
||||
/* A Tailwind plugin that makes "hero-#{ICON}" classes available.
|
||||
The heroicons installation itself is managed by your mix.exs */
|
||||
Icons are vendored in priv/heroicons/ */
|
||||
@plugin "../vendor/heroicons";
|
||||
|
||||
/* Dark mode uses data-theme="dark" attribute on <html>, set via localStorage */
|
||||
|
|
|
|||
2
assets/vendor/heroicons.js
vendored
|
|
@ -3,7 +3,7 @@ const fs = require("fs")
|
|||
const path = require("path")
|
||||
|
||||
module.exports = plugin(function({matchComponents, theme}) {
|
||||
let iconsDir = path.join(__dirname, "../../deps/heroicons/optimized")
|
||||
let iconsDir = path.join(__dirname, "../../priv/heroicons")
|
||||
let values = {}
|
||||
let icons = [
|
||||
["", "/24/outline"],
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ defmodule AprsmeWeb.CoreComponents do
|
|||
See the [Tailwind CSS documentation](https://tailwindcss.com) to learn how to
|
||||
customize the generated components in this module.
|
||||
|
||||
Icons are provided by [heroicons](https://heroicons.com), using the
|
||||
[heroicons_elixir](https://github.com/mveytsman/heroicons_elixir) project.
|
||||
Icons are provided by [heroicons](https://heroicons.com), vendored in priv/heroicons/.
|
||||
"""
|
||||
use Phoenix.Component
|
||||
use Gettext, backend: AprsmeWeb.Gettext
|
||||
|
|
@ -16,7 +15,7 @@ defmodule AprsmeWeb.CoreComponents do
|
|||
alias Phoenix.LiveView.JS
|
||||
|
||||
@doc """
|
||||
Renders a Heroicon SVG inline from deps/heroicons/optimized.
|
||||
Renders a Heroicon SVG inline from priv/heroicons/.
|
||||
Usage: <.icon name="arrow-left" outline={true} class="h-5 w-5" />
|
||||
"""
|
||||
attr :name, :string, required: true
|
||||
|
|
@ -28,7 +27,8 @@ defmodule AprsmeWeb.CoreComponents do
|
|||
|
||||
path =
|
||||
Path.join([
|
||||
:aprsme |> :code.priv_dir() |> to_string() |> Path.dirname() |> Path.join("deps/heroicons/optimized"),
|
||||
:aprsme |> :code.priv_dir() |> to_string(),
|
||||
"heroicons/24",
|
||||
style,
|
||||
name <> ".svg"
|
||||
])
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ defmodule AprsmeWeb.MapLive.Components do
|
|||
phx-click="toggle_slideover"
|
||||
class="p-2 text-gray-400 hover:text-gray-600 transition-colors"
|
||||
>
|
||||
<.icon name="hero-x-mark" class="w-5 h-5" />
|
||||
<.icon name="x-mark" class="w-5 h-5" />
|
||||
</button>
|
||||
</div>
|
||||
"""
|
||||
|
|
@ -190,7 +190,7 @@ defmodule AprsmeWeb.MapLive.Components do
|
|||
phx-click="clear_callsign_filter"
|
||||
class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600"
|
||||
>
|
||||
<.icon name="hero-x-mark" class="w-4 h-4" />
|
||||
<.icon name="x-mark" class="w-4 h-4" />
|
||||
</button>
|
||||
<% end %>
|
||||
</form>
|
||||
|
|
@ -249,7 +249,7 @@ defmodule AprsmeWeb.MapLive.Components do
|
|||
class="ml-2 p-2 text-blue-600 hover:bg-blue-50 rounded transition-colors"
|
||||
title="Center map on this location"
|
||||
>
|
||||
<.icon name="hero-map-pin" class="w-5 h-5" />
|
||||
<.icon name="map-pin" class="w-5 h-5" />
|
||||
</button>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
2
mix.exs
|
|
@ -83,8 +83,6 @@ defmodule Aprsme.MixProject do
|
|||
aprs_dep(),
|
||||
{:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
|
||||
{:tailwind, "~> 0.4.0", runtime: Mix.env() == :dev},
|
||||
{:heroicons,
|
||||
github: "tailwindlabs/heroicons", tag: "v2.1.1", sparse: "optimized", app: false, compile: false, depth: 1},
|
||||
{:bandit, "~> 1.5"},
|
||||
{:req, "~> 0.5"},
|
||||
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
|
||||
|
|
|
|||
1
mix.lock
|
|
@ -36,7 +36,6 @@
|
|||
"gridsquare": {:hex, :gridsquare, "0.3.1", "819cc1c1739ad60362311207adb885b9c500c548b71e7a8affb9fb78ba22460c", [:mix], [], "hexpm", "b461a5743121564394b1b837e6d1e6af24099e1b3218b30bf9fe869bd66d450c"},
|
||||
"hackney": {:hex, :hackney, "1.17.1", "08463f93d2cc1a03817bf28d8dae6021543f773bd436c9377047224856c4422c", [:rebar3], [{:certifi, "~> 2.5", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "~> 3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "d2cba9e3c8103ad0320623e9f1c33e8d378a15eaabe2ee8ae441898f3d35a18c"},
|
||||
"hammer": {:hex, :hammer, "7.2.0", "73113eca87f0fd20a6d3679c1182e8c4c1778266f61de4e9dc8c589dee156c30", [:mix], [], "hexpm", "c50fa865ddfe7b3d4f8a6941f56940679e02a9a1465b00668a95d140b101d828"},
|
||||
"heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "88ab3a0d790e6a47404cba02800a6b25d2afae50", [tag: "v2.1.1", sparse: "optimized", depth: 1]},
|
||||
"hpax": {:hex, :hpax, "1.0.3", "ed67ef51ad4df91e75cc6a1494f851850c0bd98ebc0be6e81b026e765ee535aa", [:mix], [], "hexpm", "8eab6e1cfa8d5918c2ce4ba43588e894af35dbd8e91e6e55c817bca5847df34a"},
|
||||
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
|
||||
"igniter": {:hex, :igniter, "0.7.2", "81c132c0df95963c7a228f74a32d3348773743ed9651f24183bfce0fe6ff16d1", [:mix], [{:glob_ex, "~> 0.1.7", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:owl, "~> 0.11", [hex: :owl, repo: "hexpm", optional: false]}, {:phx_new, "~> 1.7", [hex: :phx_new, repo: "hexpm", optional: true]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}, {:rewrite, ">= 1.1.1 and < 2.0.0-0", [hex: :rewrite, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.4", [hex: :sourceror, repo: "hexpm", optional: false]}, {:spitfire, ">= 0.1.3 and < 1.0.0-0", [hex: :spitfire, repo: "hexpm", optional: false]}], "hexpm", "f4cab73ec31f4fb452de1a17037f8a08826105265aa2d76486fcb848189bef9b"},
|
||||
|
|
|
|||
3
priv/heroicons/24/outline/arrow-path.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 386 B |
3
priv/heroicons/24/outline/exclamation-circle.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 294 B |
3
priv/heroicons/24/outline/information-circle.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 371 B |
4
priv/heroicons/24/outline/map-pin.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 396 B |
3
priv/heroicons/24/outline/x-mark.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 239 B |
3
priv/heroicons/24/solid/arrow-left.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path fill-rule="evenodd" d="M11.03 3.97a.75.75 0 0 1 0 1.06l-6.22 6.22H21a.75.75 0 0 1 0 1.5H4.81l6.22 6.22a.75.75 0 1 1-1.06 1.06l-7.5-7.5a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 339 B |
3
priv/heroicons/24/solid/x-mark.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" data-slot="icon">
|
||||
<path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 376 B |