icons 0.6.0 → 0.8.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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +17 -14
- data/lib/icons/configuration/boxicons.rb +4 -4
- data/lib/icons/configuration/hugeicons.rb +51 -0
- data/lib/icons/icon/file_path.rb +1 -11
- data/lib/icons/icon.rb +2 -2
- data/lib/icons/libraries.rb +2 -0
- data/lib/icons/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 226e1e29edc95bdc3dc1dd0f1cac84860027265cc10d6a9c7940981952585c5f
|
|
4
|
+
data.tar.gz: 3a66512b9d8a538459f128094a65345c7c69c9a1f9bd827a21239ac90811802a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 768291f6ac6567fe9380565bfc9b01106ddeab3e9f67c71d435b349c846c43a02d7e00996b404c77eb9ce59d54aa9d6a48d7b98d7cd89ad1cb2b513bacbdc777
|
|
7
|
+
data.tar.gz: 68119f70572c663cab17a087d10a75b085a9be7155a3844f85064cd864e132065066402b5c0e5e8ce6c640eb0560484d6ad668f27202889778ebce4d7d04748e
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
icons (0.
|
|
4
|
+
icons (0.8.0)
|
|
5
5
|
nokogiri (~> 1.16, >= 1.16.4)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -119,7 +119,7 @@ CHECKSUMS
|
|
|
119
119
|
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
|
|
120
120
|
debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
|
|
121
121
|
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
|
|
122
|
-
icons (0.
|
|
122
|
+
icons (0.8.0)
|
|
123
123
|
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
|
|
124
124
|
irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806
|
|
125
125
|
json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
|
data/README.md
CHANGED
|
@@ -18,18 +18,21 @@ bundle install
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
The core gem is designed to be configured by higher-level layers but can be used directly if needed.
|
|
21
|
+
The core gem is designed to be configured by higher-level layers (as seen with [rails_icons](https://github.com/Rails-Designer/rails_icons)) but can be used directly if needed.
|
|
22
22
|
|
|
23
23
|
Example:
|
|
24
24
|
```ruby
|
|
25
25
|
Icons.configure do |config|
|
|
26
26
|
config.icons_path = "app/assets/svg/icons"
|
|
27
|
-
config.default_library = :
|
|
27
|
+
config.default_library = :lucide
|
|
28
28
|
config.default_variant = :outline
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
# Sync any library from their respective (GitHub) repository
|
|
32
|
+
Icons::Sync.new("lucide").now
|
|
33
|
+
|
|
31
34
|
# Render an icon
|
|
32
|
-
icon = Icons::Icon.new(name: "check", library: "
|
|
35
|
+
icon = Icons::Icon.new(name: "check", library: "lucide", variant: "outline", arguments: { class: "text-gray-500" })
|
|
33
36
|
svg = icon.svg
|
|
34
37
|
```
|
|
35
38
|
|
|
@@ -38,17 +41,17 @@ The resulting SVG will include the proper attributes and the SVG content from th
|
|
|
38
41
|
|
|
39
42
|
## First-party libraries
|
|
40
43
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
44
|
+
- [Boxicons](https://railsdesigner.com/open-source/rails-icons/boxicons/) (1600+ icons)
|
|
45
|
+
- [Feather](https://railsdesigner.com/open-source/rails-icons/feather/) (280+ icons)
|
|
46
|
+
- [Flags](https://railsdesigner.com/open-source/rails-icons/flags/) (540+ icons)
|
|
47
|
+
- [Heroicons](https://railsdesigner.com/open-source/rails-icons/heroicons/) (300+ icons)
|
|
48
|
+
- [Linear](https://railsdesigner.com/open-source/rails-icons/linear/) (170+ icons)
|
|
49
|
+
- [Lucide](https://railsdesigner.com/open-source/rails-icons/lucide/) (1500+ icons)
|
|
50
|
+
- [Phosphor](https://railsdesigner.com/open-source/rails-icons/phosphor/) (9000+ icons)
|
|
51
|
+
- [Radix](https://railsdesigner.com/open-source/rails-icons/radix/) (300+ icons)
|
|
52
|
+
- [SidekickIcons](https://railsdesigner.com/open-source/rails-icons/sidekickicons/) (49 icons, complementing [Heroicons](https://railsdesigner.com/open-source/rails-icons/heroicons/))
|
|
53
|
+
- [Tabler](https://railsdesigner.com/open-source/rails-icons/tabler/) (5700+ icons)
|
|
54
|
+
- [Weather](https://railsdesigner.com/open-source/rails-icons/weather/) (215+ icons)
|
|
52
55
|
|
|
53
56
|
|
|
54
57
|
## Libraries using Icons
|
|
@@ -37,11 +37,11 @@ module Icons
|
|
|
37
37
|
|
|
38
38
|
def source
|
|
39
39
|
{
|
|
40
|
-
url: "https://github.com/
|
|
40
|
+
url: "https://github.com/box-icons/boxicons-core.git",
|
|
41
41
|
variants: {
|
|
42
|
-
logos: "svg/
|
|
43
|
-
regular: "svg/
|
|
44
|
-
solid: "svg/
|
|
42
|
+
logos: "svg/brands",
|
|
43
|
+
regular: "svg/basic",
|
|
44
|
+
solid: "svg/filled"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "icons/configuration/options"
|
|
4
|
+
|
|
5
|
+
module Icons
|
|
6
|
+
class Configuration
|
|
7
|
+
module Hugeicons
|
|
8
|
+
extend self
|
|
9
|
+
|
|
10
|
+
def config
|
|
11
|
+
Options.new.tap do |options|
|
|
12
|
+
options.default_variant = nil
|
|
13
|
+
options.exclude_variants = []
|
|
14
|
+
|
|
15
|
+
options.default = default_options
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def initializer_config
|
|
20
|
+
<<~RB.indent(2)
|
|
21
|
+
# Override Hugeicons defaults
|
|
22
|
+
# config.libraries.hugeicons.default_variant = "" # Hugeicons has no variants, this is provided for backwards compatibility
|
|
23
|
+
# config.libraries.hugeicons.exclude_variants = [] # Hugeicons has no variants, this is provided for backwards compatibility
|
|
24
|
+
|
|
25
|
+
# config.libraries.hugeicons.default.css = "size-6"
|
|
26
|
+
# config.libraries.hugeicons.default.stroke_width = "1.5"
|
|
27
|
+
# config.libraries.hugeicons.default.data = {}
|
|
28
|
+
RB
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def source
|
|
32
|
+
{
|
|
33
|
+
url: "https://github.com/hugeicons/hugeicons-static.git",
|
|
34
|
+
variants: {
|
|
35
|
+
".": "icons" # Hugeicons free icons are in a single directory
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def default_options
|
|
43
|
+
Options.new.tap do |options|
|
|
44
|
+
options.stroke_width = "1.5"
|
|
45
|
+
options.css = "size-6"
|
|
46
|
+
options.data = {}
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
data/lib/icons/icon/file_path.rb
CHANGED
|
@@ -20,11 +20,7 @@ module Icons
|
|
|
20
20
|
|
|
21
21
|
return custom_library_path if custom_library?
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
raise Icons::IconNotFound if icon_path.nil?
|
|
26
|
-
|
|
27
|
-
icon_path
|
|
23
|
+
app_path
|
|
28
24
|
end
|
|
29
25
|
|
|
30
26
|
private
|
|
@@ -51,12 +47,6 @@ module Icons
|
|
|
51
47
|
Icons.config.base_path.join(library_config.custom_path, "#{@name}.svg")
|
|
52
48
|
end
|
|
53
49
|
|
|
54
|
-
def icons_path_in_app
|
|
55
|
-
path = app_path
|
|
56
|
-
|
|
57
|
-
path if File.exist?(path)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
50
|
def app_path
|
|
61
51
|
Icons.config.base_path.join(*parts)
|
|
62
52
|
end
|
data/lib/icons/icon.rb
CHANGED
|
@@ -16,12 +16,12 @@ class Icons::Icon
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def svg
|
|
19
|
-
raise Icons::IconNotFound, error_message unless File.exist?(file_path)
|
|
20
|
-
|
|
21
19
|
Nokogiri::HTML::DocumentFragment.parse(File.read(file_path))
|
|
22
20
|
.at_css("svg")
|
|
23
21
|
.tap { |svg| attach_attributes(to: svg) }
|
|
24
22
|
.to_html
|
|
23
|
+
rescue Errno::ENOENT
|
|
24
|
+
raise Icons::IconNotFound, error_message
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
private
|
data/lib/icons/libraries.rb
CHANGED
|
@@ -3,6 +3,7 @@ require "icons/configuration/boxicons"
|
|
|
3
3
|
require "icons/configuration/feather"
|
|
4
4
|
require "icons/configuration/flags"
|
|
5
5
|
require "icons/configuration/heroicons"
|
|
6
|
+
require "icons/configuration/hugeicons"
|
|
6
7
|
require "icons/configuration/linear"
|
|
7
8
|
require "icons/configuration/lucide"
|
|
8
9
|
require "icons/configuration/phosphor"
|
|
@@ -20,6 +21,7 @@ module Icons
|
|
|
20
21
|
feather: Icons::Configuration::Feather,
|
|
21
22
|
flags: Icons::Configuration::Flags,
|
|
22
23
|
heroicons: Icons::Configuration::Heroicons,
|
|
24
|
+
hugeicons: Icons::Configuration::Hugeicons,
|
|
23
25
|
linear: Icons::Configuration::Linear,
|
|
24
26
|
lucide: Icons::Configuration::Lucide,
|
|
25
27
|
phosphor: Icons::Configuration::Phosphor,
|
data/lib/icons/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: icons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rails Designer
|
|
@@ -55,6 +55,7 @@ files:
|
|
|
55
55
|
- lib/icons/configuration/feather.rb
|
|
56
56
|
- lib/icons/configuration/flags.rb
|
|
57
57
|
- lib/icons/configuration/heroicons.rb
|
|
58
|
+
- lib/icons/configuration/hugeicons.rb
|
|
58
59
|
- lib/icons/configuration/linear.rb
|
|
59
60
|
- lib/icons/configuration/lucide.rb
|
|
60
61
|
- lib/icons/configuration/options.rb
|
|
@@ -92,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
92
93
|
- !ruby/object:Gem::Version
|
|
93
94
|
version: '0'
|
|
94
95
|
requirements: []
|
|
95
|
-
rubygems_version: 4.0.
|
|
96
|
+
rubygems_version: 4.0.3
|
|
96
97
|
specification_version: 4
|
|
97
98
|
summary: Add any icon library to a Ruby app
|
|
98
99
|
test_files: []
|