phlex-icons-bootstrap 0.14.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/version.rb +1 -1
- data/lib/{phlex_icons_bootstrap.rb → phlex-icons-bootstrap.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: 65f2a34ec60f3f1131a3eeea0113b62fdc306f414d336c72920c8ab94aa86290
|
4
|
+
data.tar.gz: 981994a6bb17777baf92a257ec9bf994b6a6d3c0a66eddab60babc84d10058f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54345d4be5b8ede6217016396bb092348d5cae5d85dc4e73743ad4118ba037e96b25cd191dbcfe00f8753225d7573b0d0c8b5dec07a8a8bfc8ae3702a3c3e3e1
|
7
|
+
data.tar.gz: 469fce25bc84992b1a5583cb94740ac6500aefdb2910c2fb917299fb5ce1d58d24101eb0cbf58a5cba291aa0d921f47f159a638b347626b7da29bd181ea54f88
|
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-bootstrap
|
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-bootstrap.rb
|
52
53
|
- lib/phlex/icons/base.rb
|
53
54
|
- lib/phlex/icons/bootstrap.rb
|
54
55
|
- lib/phlex/icons/bootstrap/activity.rb
|
@@ -2104,7 +2105,6 @@ files:
|
|
2104
2105
|
- lib/phlex/icons/bootstrap/zoom_out.rb
|
2105
2106
|
- lib/phlex/icons/configuration.rb
|
2106
2107
|
- lib/phlex/icons/version.rb
|
2107
|
-
- lib/phlex_icons_bootstrap.rb
|
2108
2108
|
- phlex-icons.png
|
2109
2109
|
- sig/phlex/icons.rbs
|
2110
2110
|
homepage: https://github.com/AliOsm/phlex-icons
|