File size: 5,076 Bytes
8da2481 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | defmodule PlausibleWeb.Components.Icons do
@moduledoc """
Reusable icon components
"""
use Phoenix.Component
attr(:rest, :global)
attr(:filled, :boolean, default: false)
def pin_icon(assigns) do
~H"""
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill={if @filled, do: "currentColor", else: "none"}
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
{@rest}
>
<path d="m4 20 4.5-4.5-.196.196M14.314 21.005l-5.657-5.657L3 9.69l1.228-1.228a3 3 0 0 1 3.579-.501l.58.322 7.34-5.664 5.658 5.657-5.665 7.34.323.581a3 3 0 0 1-.501 3.578l-1.228 1.229Z" />
</svg>
"""
end
attr :class, :any, default: []
def external_link_icon(assigns) do
~H"""
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class={@class}
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M9 5H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4M12 12l9-9-.303.303M14 3h7v7"
/>
</svg>
"""
end
attr :class, :any, default: []
def tag_icon(assigns) do
~H"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class={@class}>
<circle fill="currentColor" cx="7.25" cy="7.25" r="1.25" />
<path
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M4 3h5.172a2 2 0 0 1 1.414.586l5.536 5.536a3 3 0 0 1 0 4.243l-2.757 2.757a3 3 0 0 1-4.243 0l-5.536-5.536A2 2 0 0 1 3 9.172V4a1 1 0 0 1 1-1Z"
/>
</svg>
"""
end
attr :class, :any, default: []
def diamond_icon(assigns) do
~H"""
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class={@class}>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M2.734 9h18.531M3.023 8.164l3.205-3.408c.255-.27.61-.424.984-.424h9.57c.374 0 .73.153.985.424l3.205 3.408c.44.468.48 1.18.093 1.693l-7.99 10.608a1.352 1.352 0 0 1-2.155 0L2.93 9.857a1.31 1.31 0 0 1 .093-1.693"
/>
</svg>
"""
end
attr :class, :any, default: []
def subscription_icon(assigns) do
~H"""
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class={@class}>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="m21.667 4.333-.72 4a9.669 9.669 0 0 0-18.61 3.399m-.004 7.934.72-4a9.67 9.67 0 0 0 18.61-3.4"
/>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M14.333 8.333h-3.166a1.835 1.835 0 0 0-1.834 1.827c0 1.013.82 1.84 1.834 1.84h1.666c1.012 0 1.834.827 1.834 1.827 0 1.013-.822 1.84-1.834 1.84H9.667M12 7v1.333M12 17v-1.333"
/>
</svg>
"""
end
attr :class, :any, default: []
def key_icon(assigns) do
~H"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class={@class}>
<g
fill="currentColor"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
transform="translate(.25 .25)"
>
<circle cx="8" cy="16" r="1" />
<path
fill="none"
d="M17 2 9.856 9.144A6.5 6.5 0 1 0 15 15.5a6.47 6.47 0 0 0-.366-2.134L17 11V8h3l2-2V2h-5Z"
/>
</g>
</svg>
"""
end
attr :class, :any, default: []
def exclamation_triangle_icon(assigns) do
~H"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class={@class}>
<g fill="currentColor" stroke-linecap="round" stroke-linejoin="round">
<circle
cx="12"
cy="12"
r="10"
fill="none"
stroke="currentColor"
stroke-miterlimit="10"
stroke-width="1.5"
/>
<path
fill="none"
stroke="currentColor"
stroke-miterlimit="10"
stroke-width="1.5"
d="M12 7v6"
/>
<circle cx="12" cy="16.75" r="1.25" />
</g>
</svg>
"""
end
attr :class, :any, default: []
def envelope_icon(assigns) do
~H"""
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class={@class}>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M2.333 9c0-.97.528-1.814 1.38-2.284L11.355 2.5a1.332 1.332 0 0 1 1.288 0l7.644 4.217c.85.47 1.379 1.312 1.379 2.284"
/>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M21.667 9.005v8.662A2.666 2.666 0 0 1 19 20.333H5a2.666 2.666 0 0 1-2.667-2.666V9l9.087 4.387c.367.177.793.177 1.159 0L21.666 9v.005Z"
/>
</svg>
"""
end
end
|