phlex-icons-remix 0.14.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a34766334e728258d7f723fe5d8c53481f738d993583af034bb9b448223592c0
4
- data.tar.gz: d76cc9c2e522b4f0104ba351c0a965ceb4df77f20df4dc17a296b808f7cdd8cb
3
+ metadata.gz: 11e947ab9a130e2a2fe18c0cabc50c0e9565d37e733595c809eb208744b6eece
4
+ data.tar.gz: 6912e1f1a95e7df0700d9575f70957f62bbbe1b282c8d7d4684fa29874c6bdc6
5
5
  SHA512:
6
- metadata.gz: 4e10fa32709b8f7887d511767f767db0fbf2c574481d4003906b17fe0dcfd7933713201f8a6e9e99398e1f7c32efff66046cab917b1d5237a0df965490fd3011
7
- data.tar.gz: eda47010424d01ca2c9f6068fed3dea5f33dae7e5574e9263cbb53e56775c6234c7a30b7b360ff11ec584504a057e2ec7745b86cec00aa692f40cf8cfe48bd3d
6
+ metadata.gz: 493d354f350d41b702f90c9ba1a1cb79326243bb20b33d433d18f0cd8498aa95590a7c5785e8079c9b1be3eb01bbb6792f1a908cfae70aad6da37456d006a138
7
+ data.tar.gz: 013ae763f1ffc8ce88b004e6dd2b20eb5b7b916bb56707d1bb00ed2f1965d79039c6b3d5c2ee6cd2bfab7e88d73bc0ecf53ca2fab34d08b9cee590d86fba20ce
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 'phlex_icons'
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 'phlex_icons'
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.
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../base'
4
-
5
3
  module Phlex
6
4
  module Icons
7
5
  module Remix
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlex
4
4
  module Icons
5
- VERSION = '0.14.0'
5
+ VERSION = '0.16.0'
6
6
  end
7
7
  end
@@ -1,3 +1,6 @@
1
+ # rubocop:disable Naming/FileName
2
+ # rubocop:enable Naming/FileName
3
+
1
4
  # frozen_string_literal: true
2
5
 
3
6
  require 'phlex'
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.14.0
4
+ version: 0.16.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-02 00:00:00.000000000 Z
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