phlex-icons-remix 0.13.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +77 -12
- data/lib/phlex/icons/remix/base.rb +2 -0
- data/lib/phlex/icons/version.rb +1 -1
- data/lib/{phlex_icons_remix.rb → phlex-icons-remix.rb} +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 145649f881c1c518d275b84f1d6e6851b67161551267fa23516d99fd56b458ff
|
4
|
+
data.tar.gz: 1b46c3366238af6758be4673b8714e50f4ff2cbd3fd2588dca599bedfe084b67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ba56169b4d9a8f7bf56e86ff7e73b4c1abd47c1ebf5c1368a5a1cb59cd7362eaea42919ebf3203c9910d3e09f11f203f34ad0b5ed9dfc45b48c9c45e3b4ce0d
|
7
|
+
data.tar.gz: 2151577b49601a4088c7a677cf6a0a6c0a5b4f0447f0a0fefeff77368050ae6518e206c8a4cf115b41e61f44edc89b61b07af69e449265f093466ec8ccb7fed4
|
data/README.md
CHANGED
@@ -21,6 +21,16 @@ General icons extension for [Phlex](https://phlex.fun). Includes more than 🎨
|
|
21
21
|
|
22
22
|
And happy to extend to other icon packs!
|
23
23
|
|
24
|
+
If you don't want to add all icon packs to your application, you can add a specific icon pack by using one (or multiple) of the following gems:
|
25
|
+
|
26
|
+
- [phlex-icons-bootstrap](https://rubygems.org/gems/phlex-icons-bootstrap)
|
27
|
+
- [phlex-icons-flag](https://rubygems.org/gems/phlex-icons-flag)
|
28
|
+
- [phlex-icons-hero](https://rubygems.org/gems/phlex-icons-hero)
|
29
|
+
- [phlex-icons-lucide](https://rubygems.org/gems/phlex-icons-lucide)
|
30
|
+
- [phlex-icons-radix](https://rubygems.org/gems/phlex-icons-radix)
|
31
|
+
- [phlex-icons-remix](https://rubygems.org/gems/phlex-icons-remix)
|
32
|
+
- [phlex-icons-tabler](https://rubygems.org/gems/phlex-icons-tabler)
|
33
|
+
|
24
34
|
Thanks [nejdetkadir](https://github.com/nejdetkadir) for creating [Phlex::Heroicons](https://github.com/nejdetkadir/phlex-heroicons) as it was the base for this gem.
|
25
35
|
|
26
36
|
Other Phlex icon gems:
|
@@ -41,16 +51,6 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
41
51
|
gem install phlex-icons
|
42
52
|
```
|
43
53
|
|
44
|
-
If you don't want to add all icon packs to your application, you can add a specific icon pack by using one (or multiple) of the following gems:
|
45
|
-
|
46
|
-
- [phlex-icons-bootstrap](https://rubygems.org/gems/phlex-icons-bootstrap)
|
47
|
-
- [phlex-icons-flag](https://rubygems.org/gems/phlex-icons-flag)
|
48
|
-
- [phlex-icons-hero](https://rubygems.org/gems/phlex-icons-hero)
|
49
|
-
- [phlex-icons-lucide](https://rubygems.org/gems/phlex-icons-lucide)
|
50
|
-
- [phlex-icons-radix](https://rubygems.org/gems/phlex-icons-radix)
|
51
|
-
- [phlex-icons-remix](https://rubygems.org/gems/phlex-icons-remix)
|
52
|
-
- [phlex-icons-tabler](https://rubygems.org/gems/phlex-icons-tabler)
|
53
|
-
|
54
54
|
## Configuration
|
55
55
|
|
56
56
|
The gem provides global configuration options, and per icons pack configuration options.
|
@@ -124,7 +124,7 @@ Phlex::Icons::Tabler.configuration.default_variant = :outline # or :filled
|
|
124
124
|
### With `Phlex::Kit`
|
125
125
|
|
126
126
|
```ruby
|
127
|
-
require '
|
127
|
+
require 'phlex-icons'
|
128
128
|
|
129
129
|
class PhlexIcons < Phlex::HTML
|
130
130
|
include Phlex::Icons
|
@@ -146,7 +146,7 @@ end
|
|
146
146
|
### Without `Phlex::Kit`
|
147
147
|
|
148
148
|
```ruby
|
149
|
-
require '
|
149
|
+
require 'phlex-icons'
|
150
150
|
|
151
151
|
class PhlexIcons < Phlex::HTML
|
152
152
|
def view_template
|
@@ -163,6 +163,71 @@ class PhlexIcons < Phlex::HTML
|
|
163
163
|
end
|
164
164
|
```
|
165
165
|
|
166
|
+
### Specific icon pack(s)
|
167
|
+
|
168
|
+
Let's say you want to use only Heroicons and Flag Icons, you can use the following gems:
|
169
|
+
- [phlex-icons-flag](https://rubygems.org/gems/phlex-icons-flag)
|
170
|
+
- [phlex-icons-hero](https://rubygems.org/gems/phlex-icons-hero)
|
171
|
+
|
172
|
+
Then, in your application, you can use the icons like this:
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
require 'phlex-icons-flag'
|
176
|
+
require 'phlex-icons-hero'
|
177
|
+
|
178
|
+
class PhlexIcons < Phlex::HTML
|
179
|
+
include Phlex::Icons # If you want to use Phlex::Kit.
|
180
|
+
|
181
|
+
def view_template
|
182
|
+
div do
|
183
|
+
# With Phlex::Kit.
|
184
|
+
Flag::Sa(variant: :rectangle, classes: 'size-4')
|
185
|
+
Hero::Home(variant: :solid, classes: 'size-4')
|
186
|
+
|
187
|
+
# Without Phlex::Kit.
|
188
|
+
render Phlex::Icons::Flag::Sa.new(variant: :rectangle, classes: 'size-4')
|
189
|
+
render Phlex::Icons::Hero::Home.new(variant: :solid, classes: 'size-4')
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
```
|
194
|
+
|
195
|
+
### Add custom icons to your Rails application
|
196
|
+
|
197
|
+
You can extend the gem in your Rails application to add new icons by creating a `phlex/icons/custom` directory inside `views/components` directory. Then, you can create a new component for each icon you want to add. For example:
|
198
|
+
|
199
|
+
```ruby
|
200
|
+
# app/views/components/phlex/icons/custom/icon_class_name.rb
|
201
|
+
|
202
|
+
module Phlex
|
203
|
+
module Icons
|
204
|
+
module Custom
|
205
|
+
class IconClassName < Phlex::Icons::Base
|
206
|
+
def view_template
|
207
|
+
# SVG code here.
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
```
|
214
|
+
|
215
|
+
Finally, you will need to create a `Phlex::Icons::Custom` module in `phlex/icons/custom.rb` file to include your custom icons and make them a `Phlex::Kit`:
|
216
|
+
|
217
|
+
```ruby
|
218
|
+
# app/views/components/phlex/icons/custom.rb
|
219
|
+
|
220
|
+
module Phlex
|
221
|
+
module Icons
|
222
|
+
module Custom
|
223
|
+
extend Phlex::Kit
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
```
|
228
|
+
|
229
|
+
Now, you can use your custom icons like any other icon pack as described above.
|
230
|
+
|
166
231
|
## Update icon packs
|
167
232
|
|
168
233
|
All icon packs provided in this gem are auto-generated by their generator under [`generators`](/generators) directory. You just need to clone the repo and run the generator for the icon pack you want to update. In future, I'm planning to add GitHub Actions to automatically generate the icon packs and update the gem.
|
data/lib/phlex/icons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex-icons-remix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ali Hamdi Ali Fadel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- generators/radix.rb
|
50
50
|
- generators/remix.rb
|
51
51
|
- generators/tabler.rb
|
52
|
+
- lib/phlex-icons-remix.rb
|
52
53
|
- lib/phlex/icons/base.rb
|
53
54
|
- lib/phlex/icons/configuration.rb
|
54
55
|
- lib/phlex/icons/remix.rb
|
@@ -2946,7 +2947,6 @@ files:
|
|
2946
2947
|
- lib/phlex/icons/remix/zzz_fill.rb
|
2947
2948
|
- lib/phlex/icons/remix/zzz_line.rb
|
2948
2949
|
- lib/phlex/icons/version.rb
|
2949
|
-
- lib/phlex_icons_remix.rb
|
2950
2950
|
- phlex-icons.png
|
2951
2951
|
- sig/phlex/icons.rbs
|
2952
2952
|
homepage: https://github.com/AliOsm/phlex-icons
|