Skip to content

Commit ab24eec

Browse files
committed
Icon component
1 parent 4cd56fc commit ab24eec

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

lib/error_tracker/web/components/core_components.ex

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,41 @@ defmodule ErrorTracker.Web.CoreComponents do
130130
</div>
131131
"""
132132
end
133+
134+
attr :name, :string, values: ~w[bell bell-slash]
135+
136+
def icon(assigns = %{name: "bell"}) do
137+
~H"""
138+
<svg
139+
xmlns="http://www.w3.org/2000/svg"
140+
viewBox="0 0 16 16"
141+
fill="currentColor"
142+
class="!h-4 !w-4 inline-block"
143+
>
144+
<path
145+
fill-rule="evenodd"
146+
d="M12 5a4 4 0 0 0-8 0v2.379a1.5 1.5 0 0 1-.44 1.06L2.294 9.707a1 1 0 0 0-.293.707V11a1 1 0 0 0 1 1h2a3 3 0 1 0 6 0h2a1 1 0 0 0 1-1v-.586a1 1 0 0 0-.293-.707L12.44 8.44A1.5 1.5 0 0 1 12 7.38V5Zm-5.5 7a1.5 1.5 0 0 0 3 0h-3Z"
147+
clip-rule="evenodd"
148+
/>
149+
</svg>
150+
"""
151+
end
152+
153+
def icon(assigns = %{name: "bell-slash"}) do
154+
~H"""
155+
<svg
156+
xmlns="http://www.w3.org/2000/svg"
157+
viewBox="0 0 16 16"
158+
fill="currentColor"
159+
class="!h-4 !w-4 inline-block"
160+
>
161+
<path
162+
fill-rule="evenodd"
163+
d="M4 7.379v-.904l6.743 6.742A3 3 0 0 1 5 12H3a1 1 0 0 1-1-1v-.586a1 1 0 0 1 .293-.707L3.56 8.44A1.5 1.5 0 0 0 4 7.38ZM6.5 12a1.5 1.5 0 0 0 3 0h-3Z"
164+
clip-rule="evenodd"
165+
/>
166+
<path d="M14 11a.997.997 0 0 1-.096.429L4.92 2.446A4 4 0 0 1 12 5v2.379c0 .398.158.779.44 1.06l1.267 1.268a1 1 0 0 1 .293.707V11ZM2.22 2.22a.75.75 0 0 1 1.06 0l10.5 10.5a.75.75 0 1 1-1.06 1.06L2.22 3.28a.75.75 0 0 1 0-1.06Z" />
167+
</svg>
168+
"""
169+
end
133170
end

priv/static/app.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,10 @@ select {
873873
display: none;
874874
}
875875

876+
.\!h-4 {
877+
height: 1rem !important;
878+
}
879+
876880
.h-10 {
877881
height: 2.5rem;
878882
}
@@ -881,6 +885,10 @@ select {
881885
height: 1.25rem;
882886
}
883887

888+
.\!w-4 {
889+
width: 1rem !important;
890+
}
891+
884892
.w-10 {
885893
width: 2.5rem;
886894
}
@@ -945,6 +953,10 @@ select {
945953
gap: 0.5rem;
946954
}
947955

956+
.gap-y-4 {
957+
row-gap: 1rem;
958+
}
959+
948960
.space-y-8 > :not([hidden]) ~ :not([hidden]) {
949961
--tw-space-y-reverse: 0;
950962
margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));

0 commit comments

Comments
 (0)