icon_kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4f2751c8d0f1b4f19045d203e482eff7b67c8a1dc508f1e9dfc19f47c8600bd8
4
+ data.tar.gz: b0be09999214f467dd2b9035880ebf15443df1f39a397a245cdbd916f38d098d
5
+ SHA512:
6
+ metadata.gz: b0c01432b3e47414c4c0ce1e126937b8ad60184aff725b89bb6600190450d96adea374dd2eaa897fa39c71260323bfc97df5ea347cb7394627c28473ad68f420
7
+ data.tar.gz: 7e40f7c6cbd05806c541b71d436ed07f515347eb0debdebff80be93bdfa9e59ca1c352c7e696799f8770ae7cd4300bd05ffaa65a16587df78d83d91871954338
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Phani Bhusan Mohanty
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # IconKit
2
+
3
+ A comprehensive SVG icon system for Rails applications.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'icon_kit'
11
+
12
+ $ bundle install
13
+ ```
@@ -0,0 +1,214 @@
1
+ module IconKit
2
+ module IconsHelper
3
+ def icon_tag(name, options = {})
4
+ classes = "#{options[:class] || ''}"
5
+ size = options[:size] || IconKit.default_size
6
+ color = options[:color] || IconKit.default_color
7
+
8
+ case name
9
+ when :building
10
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg") do
11
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4")
12
+ end
13
+ when :plus
14
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
15
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 4v16m8-8H4")
16
+ end
17
+ when :money
18
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
19
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z")
20
+ end
21
+ when :print
22
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
23
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z")
24
+ end
25
+ when :box
26
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
27
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10")
28
+ end
29
+ when :chart
30
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
31
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z")
32
+ end
33
+ when :clipboard
34
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
35
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2")
36
+ end
37
+ when :check
38
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
39
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M5 13l4 4L19 7")
40
+ end
41
+ when :edit
42
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
43
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z")
44
+ end
45
+ when :trash
46
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
47
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16")
48
+ end
49
+ when :view
50
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
51
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z")
52
+ end
53
+ when :calendar
54
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
55
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z")
56
+ end
57
+ when :hub
58
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
59
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z")
60
+ end
61
+ when :back
62
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg") do
63
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M10 19l-7-7m0 0l7-7m-7 7h18")
64
+ end
65
+ when :pencil
66
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg") do
67
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z")
68
+ end
69
+ when :document
70
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg") do
71
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M9 12h6m-6 1h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H7a2 2 0 01-2-2z")
72
+ end
73
+ when :success_check
74
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
75
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z")
76
+ end
77
+ when :document_stack
78
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
79
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2")
80
+ end
81
+ when :hashtag
82
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
83
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14")
84
+ end
85
+ when :clock
86
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
87
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z")
88
+ end
89
+ when :error_circle
90
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
91
+ content_tag(:path, "", fill_rule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clip_rule: "evenodd")
92
+ end
93
+ when :eye
94
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
95
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z") +
96
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z")
97
+ end
98
+ when :x
99
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
100
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M6 18L18 6M6 6l12 12")
101
+ end
102
+ when :home
103
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
104
+ content_tag(:path, "", d: "M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z")
105
+ end
106
+ when :filter
107
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
108
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z")
109
+ end
110
+ when :info
111
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
112
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z")
113
+ end
114
+ when :wave
115
+ content_tag(:svg, class: "#{size} #{classes}", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1440 160") do
116
+ content_tag(:path, "", fill: "#ffffff", fill_opacity: "1", d: "M0,128L80,117.3C160,107,320,85,480,90.7C640,96,800,128,960,133.3C1120,139,1280,117,1360,106.7L1440,96L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z")
117
+ end
118
+ when :quote
119
+ content_tag(:svg, class: "#{size} #{classes}", fill: color, viewBox: "0 0 32 32") do
120
+ content_tag(:path, "", d: "M9.352 4C4.456 7.456 1 13.12 1 19.36c0 5.088 3.072 8.064 6.624 8.064 3.36 0 5.856-2.688 5.856-5.856 0-3.168-2.208-5.472-5.088-5.472-.576 0-1.344.096-1.536.192.48-3.264 3.552-7.104 6.624-9.024L9.352 4zm16.512 0c-4.8 3.456-8.256 9.12-8.256 15.36 0 5.088 3.072 8.064 6.624 8.064 3.264 0 5.856-2.688 5.856-5.856 0-3.168-2.304-5.472-5.184-5.472-.576 0-1.248.096-1.44.192.48-3.264 3.456-7.104 6.528-9.024L25.864 4z")
121
+ end
122
+ when :location
123
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
124
+ content_tag(:path, "", fill_rule: "evenodd", d: "M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z", clip_rule: "evenodd")
125
+ end
126
+ when :project_document
127
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
128
+ content_tag(:path, "", d: "M9 2a1 1 0 000 2h2a1 1 0 100-2H9z") +
129
+ content_tag(:path, "", fill_rule: "evenodd", d: "M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm3 4a1 1 0 000 2h.01a1 1 0 100-2H7zm3 0a1 1 0 000 2h3a1 1 0 100-2h-3zm-3 4a1 1 0 100 2h.01a1 1 0 100-2H7zm3 0a1 1 0 100 2h3a1 1 0 100-2h-3z", clip_rule: "evenodd")
130
+ end
131
+ when :add_circle
132
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
133
+ content_tag(:path, "", fill_rule: "evenodd", d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z", clip_rule: "evenodd")
134
+ end
135
+ when :trash_bin
136
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
137
+ content_tag(:path, "", fill_rule: "evenodd", d: "M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z", clip_rule: "evenodd")
138
+ end
139
+ when :info_circle
140
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
141
+ content_tag(:path, "", d: "M10 2a8 8 0 100 16 8 8 0 000-16zm1 11H9v-2h2v2zm0-4H9V5h2v4z")
142
+ end
143
+ when :layers
144
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
145
+ content_tag(:path, "", d: "M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z")
146
+ end
147
+ when :add_circle
148
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
149
+ content_tag(:path, "", fill_rule: "evenodd", d: "M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z", clip_rule: "evenodd")
150
+ end
151
+ when :printer_document
152
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
153
+ content_tag(:path, "", fill_rule: "evenodd", d: "M4 4a2 2 0 012-2h8a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm3 1h6v4H7V5zm8 8v2h1v1H4v-1h1v-2a1 1 0 011-1h8a1 1 0 011 1z", clip_rule: "evenodd")
154
+ end
155
+ when :description_document
156
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
157
+ content_tag(:path, "", fill_rule: "evenodd", d: "M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z", clip_rule: "evenodd")
158
+ end
159
+ when :warning
160
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
161
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z")
162
+ end
163
+ when :download_document
164
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
165
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z")
166
+ end
167
+ when :arrow_left
168
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
169
+ content_tag(:path, "", fill_rule: "evenodd", d: "M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z", clip_rule: "evenodd")
170
+ end
171
+ when :phone
172
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
173
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z")
174
+ end
175
+ when :email
176
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
177
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z")
178
+ end
179
+ when :user
180
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
181
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z")
182
+ end
183
+ when :menu
184
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
185
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M4 6h16M4 12h16M4 18h16")
186
+ end
187
+ when :dot_ring
188
+ content_tag(:svg, class: "#{size} #{classes}", fill: "none", stroke: color, viewBox: "0 0 24 24") do
189
+ content_tag(:path, "", stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M8 12h.01M12 12h.01M16 12h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z")
190
+ end
191
+ when :chevron_slash
192
+ content_tag(:svg, class: "#{size} #{classes}", fill: color, viewBox: "0 0 20 20") do
193
+ content_tag(:path, "", d: "M5.555 17.776l8-16 .894.448-8 16-.894-.448z")
194
+ end
195
+ when :lock
196
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
197
+ content_tag(:path, "", fill_rule: "evenodd", d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z", clip_rule: "evenodd")
198
+ end
199
+ when :eye_open
200
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
201
+ content_tag(:path, "", d: "M10 12a2 2 0 100-4 2 2 0 000 4z") +
202
+ content_tag(:path, "", fill_rule: "evenodd", d: "M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z", clip_rule: "evenodd")
203
+ end
204
+ when :eye_closed
205
+ content_tag(:svg, class: "#{size} #{classes}", viewBox: "0 0 20 20", fill: color) do
206
+ content_tag(:path, "", fill_rule: "evenodd", d: "M3.707 2.293a1 1 0 00-1.414 1.414l14 14a1 1 0 001.414-1.414l-1.473-1.473A10.014 10.014 0 0019.542 10C18.268 5.943 14.478 3 10 3a9.958 9.958 0 00-4.512 1.074l-1.78-1.781zm4.261 4.26l1.514 1.515a2.003 2.003 0 012.45 2.45l1.514 1.514a4 4 0 00-5.478-5.478z", clip_rule: "evenodd") +
207
+ content_tag(:path, "", d: "M12.454 16.697L9.75 13.992a4 4 0 01-3.742-3.741L2.335 6.578A9.98 9.98 0 00.458 10c1.274 4.057 5.065 7 9.542 7 .847 0 1.669-.105 2.454-.303z")
208
+ end
209
+ else
210
+ ""
211
+ end
212
+ end
213
+ end
214
+ end
@@ -0,0 +1,11 @@
1
+ module IconKit
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace IconKit
4
+
5
+ initializer "icon_kit.helpers" do
6
+ ActiveSupport.on_load(:action_controller) do
7
+ helper IconKit::IconsHelper
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ module IconKit
2
+ module IconsHelper
3
+ def icon_tag(name, size: IconKit.default_size, color: IconKit.default_color)
4
+ file_path = IconKit::Engine.root.join("app/assets/images/icons/#{name}.svg")
5
+
6
+ unless File.exist?(file_path)
7
+ Rails.logger.warn "[IconKit] SVG icon '#{name}' not found at #{file_path}"
8
+ return ""
9
+ end
10
+
11
+ svg_content = File.read(file_path)
12
+ svg_content = svg_content.gsub(/<svg/, "<svg class=\"#{size} #{color}\"")
13
+
14
+ svg_content.html_safe
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module IconKit
2
+ VERSION = "0.1.0"
3
+ end
data/lib/icon_kit.rb ADDED
@@ -0,0 +1,14 @@
1
+ # lib/icon_kit.rb
2
+
3
+ require "icon_kit/engine"
4
+ require "icon_kit/version"
5
+
6
+ module IconKit
7
+ # Global default config options
8
+ mattr_accessor :default_size, default: "w-5 h-5"
9
+ mattr_accessor :default_color, default: "currentColor"
10
+
11
+ def self.configure
12
+ yield self if block_given?
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: icon_kit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Phani Bhusan Mohanty
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-04-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 6.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '6.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 6.0.0
33
+ description: An extensive SVG icon system for Rails applications
34
+ email:
35
+ - mohantyphanibhusan@gmail.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - MIT-LICENSE
41
+ - README.md
42
+ - app/helpers/icons_helper.rb
43
+ - lib/icon_kit.rb
44
+ - lib/icon_kit/engine.rb
45
+ - lib/icon_kit/icons_helper.rb
46
+ - lib/icon_kit/version.rb
47
+ homepage: https://github.com/Phani2425/icon_kit
48
+ licenses:
49
+ - MIT
50
+ metadata: {}
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 3.0.0
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubygems_version: 3.5.22
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: A Rails engine for SVG icons
70
+ test_files: []