phlex-icons-tabler 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: c2a950b0bf045e406bf515a1bea880b00ba887963b9ed6869dc6155f4900cf38
4
- data.tar.gz: afa8e11f68e8d8d2dc4192b0a3c9db925bc14a666686bfbf85b98f106c3c543a
3
+ metadata.gz: 3b59c0d2e9bc1565b0cf57e188f862be54f1048fc7c9f6650e3f4f27a8129386
4
+ data.tar.gz: feb2d597ecd50a92fecebb764745e1248f14006846e98f81045db1f77e68f95a
5
5
  SHA512:
6
- metadata.gz: 2407ae5515bf509425e0c54232d8c6435b20de989246e6fe66abafff40520283ac67bb871629b2b5b396b60e6a93f512e0a02d0b2b6d4cb6faeed38040169892
7
- data.tar.gz: 3b9d27c79829e0e96e60a480e248c15bf6378b92c22e5b171df4340052a0a155eb714a98e18459313200c0c5a2c4260f098f5614f3bcfa9de2e5047ec4113aa7
6
+ metadata.gz: 34d8904798d0521becdf67f9236f2cd14ab12511338b32af6737fe7a78f8cdd1b19bea98015e39f5f6c9c504cfebaa04d3da7dc45cdaeb2f854d6b6c1d5a6783
7
+ data.tar.gz: 1ee704f4e76ba761298df7df119ecc2934cebcf4ae0076d9f58cc6f0d606d6fa8de9f2d42b994d13c4a48137f9890c363d9ea435499c6d9ac46b40dd239656ce
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 Tabler
@@ -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-tabler
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-tabler.rb
52
53
  - lib/phlex/icons/base.rb
53
54
  - lib/phlex/icons/configuration.rb
54
55
  - lib/phlex/icons/tabler.rb
@@ -4905,7 +4906,6 @@ files:
4905
4906
  - lib/phlex/icons/tabler/zzz.rb
4906
4907
  - lib/phlex/icons/tabler/zzz_off.rb
4907
4908
  - lib/phlex/icons/version.rb
4908
- - lib/phlex_icons_tabler.rb
4909
4909
  - phlex-icons.png
4910
4910
  - sig/phlex/icons.rbs
4911
4911
  homepage: https://github.com/AliOsm/phlex-icons