Skip to content

Commit cb4bae2

Browse files
committed
add text input, textarea
1 parent b91ff4e commit cb4bae2

File tree

5 files changed

+489
-7
lines changed

5 files changed

+489
-7
lines changed

.formatter.exs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Used by "mix format"
22
[
3-
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
3+
import_deps: [:phoenix],
4+
plugins: [Phoenix.LiveView.HTMLFormatter],
5+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{heex,ex,exs}"]
46
]

lib/assets.ex

+70-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,76 @@ defmodule Tremorx.Assets do
88
"""
99
def loading_spinner(assigns) do
1010
~H"""
11-
<svg {@rest} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
12-
<path fill="none" d="M0 0h24v24H0z" />
13-
<path d="M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z" />
14-
</svg>
11+
<svg {@rest} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
12+
<path fill="none" d="M0 0h24v24H0z" />
13+
<path d="M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z" />
14+
</svg>
15+
"""
16+
end
17+
18+
attr(:rest, :global)
19+
20+
@doc """
21+
Renders a eye icon
22+
"""
23+
def eye_icon(assigns) do
24+
~H"""
25+
<svg
26+
{@rest}
27+
xmlns="http://www.w3.org/2000/svg"
28+
fill="none"
29+
viewBox="0 0 24 24"
30+
stroke-width="1.5"
31+
stroke="currentColor"
32+
>
33+
<path
34+
stroke-linecap="round"
35+
stroke-linejoin="round"
36+
d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
37+
/>
38+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
39+
</svg>
40+
"""
41+
end
42+
43+
attr(:rest, :global)
44+
45+
@doc """
46+
Renders a eye_off icon
47+
"""
48+
def eye_off_icon(assigns) do
49+
~H"""
50+
<svg
51+
{@rest}
52+
xmlns="http://www.w3.org/2000/svg"
53+
fill="none"
54+
viewBox="0 0 24 24"
55+
stroke-width="1.5"
56+
stroke="currentColor"
57+
>
58+
<path
59+
stroke-linecap="round"
60+
stroke-linejoin="round"
61+
d="M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"
62+
/>
63+
</svg>
64+
"""
65+
end
66+
67+
attr(:rest, :global)
68+
69+
@doc """
70+
Renders a exclamation icon
71+
"""
72+
def exclamation_icon(assigns) do
73+
~H"""
74+
<svg {@rest} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
75+
<path
76+
fill-rule="evenodd"
77+
d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z"
78+
clip-rule="evenodd"
79+
/>
80+
</svg>
1581
"""
1682
end
1783
end

0 commit comments

Comments
 (0)