icons 0.0.2 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7ed67d1455846d5b5cafcc40c62491b8cae953bf4f9fff50f565386a556758b
4
- data.tar.gz: 130dbd282e27c99e64e9541d8f25a5c13a11067bcca96ab3f32ead34e1b04179
3
+ metadata.gz: 51e3e16d162ac808ec00a952e454e2abf791b46271104dd8358903b1b024afe9
4
+ data.tar.gz: eed4b6e42ab224d3536df61ddea19655306db57abfe65f5d4900faf0255217f8
5
5
  SHA512:
6
- metadata.gz: b94ebd58cbbe3f797fb65c7e63f87f4a5951c17214c57424380842024934b7f4358847cfdb53215a97ad5ff1d5ee7da2a505a3ff4f21c9c268c1894aafba8b78
7
- data.tar.gz: 3013166b89c9cdf79fe5a2c5a50df538c9ed0b54f1805194a6be99bcfc00fcd94e79c9cca90a2400a73ae9981378a99b88d10b51a78bfc874fefcaa66b2b1690
6
+ metadata.gz: b9a8dd5fb810c3e42f3b1adb9ff8e15742fc3fc231aa34d95629b6d81305ea82da49709bd1ed1e1027c2cd346a186e529ddfa8a42e74e81bde9a165f7901c735
7
+ data.tar.gz: 48403f58263e32d07a966ee02bd2027d5c6d85f89bcfd46b795dcdb9a92055c4c2bfc532b4244ad73bc67e0fe31d3d39c4f4bb4943dcef3eb25aac20193dc403
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ group :development do
8
+ gem "standard"
9
+ end
10
+
11
+ group :development, :test do
12
+ gem "rake"
13
+ gem "minitest"
14
+ gem "debug", "~> 1.9", ">= 1.9.2"
15
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,162 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ icons (0.6.0)
5
+ nokogiri (~> 1.16, >= 1.16.4)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.3)
11
+ date (3.5.1)
12
+ debug (1.11.1)
13
+ irb (~> 1.10)
14
+ reline (>= 0.3.8)
15
+ erb (6.0.1)
16
+ io-console (0.8.2)
17
+ irb (1.16.0)
18
+ pp (>= 0.6.0)
19
+ rdoc (>= 4.0.0)
20
+ reline (>= 0.4.2)
21
+ json (2.18.0)
22
+ language_server-protocol (3.17.0.5)
23
+ lint_roller (1.1.0)
24
+ minitest (6.0.1)
25
+ prism (~> 1.5)
26
+ nokogiri (1.19.0-aarch64-linux-gnu)
27
+ racc (~> 1.4)
28
+ nokogiri (1.19.0-aarch64-linux-musl)
29
+ racc (~> 1.4)
30
+ nokogiri (1.19.0-arm-linux-gnu)
31
+ racc (~> 1.4)
32
+ nokogiri (1.19.0-arm-linux-musl)
33
+ racc (~> 1.4)
34
+ nokogiri (1.19.0-arm64-darwin)
35
+ racc (~> 1.4)
36
+ nokogiri (1.19.0-x86_64-darwin)
37
+ racc (~> 1.4)
38
+ nokogiri (1.19.0-x86_64-linux-gnu)
39
+ racc (~> 1.4)
40
+ nokogiri (1.19.0-x86_64-linux-musl)
41
+ racc (~> 1.4)
42
+ parallel (1.27.0)
43
+ parser (3.3.10.1)
44
+ ast (~> 2.4.1)
45
+ racc
46
+ pp (0.6.3)
47
+ prettyprint
48
+ prettyprint (0.2.0)
49
+ prism (1.9.0)
50
+ psych (5.3.1)
51
+ date
52
+ stringio
53
+ racc (1.8.1)
54
+ rainbow (3.1.1)
55
+ rake (13.3.1)
56
+ rdoc (7.1.0)
57
+ erb
58
+ psych (>= 4.0.0)
59
+ tsort
60
+ regexp_parser (2.11.3)
61
+ reline (0.6.3)
62
+ io-console (~> 0.5)
63
+ rubocop (1.82.1)
64
+ json (~> 2.3)
65
+ language_server-protocol (~> 3.17.0.2)
66
+ lint_roller (~> 1.1.0)
67
+ parallel (~> 1.10)
68
+ parser (>= 3.3.0.2)
69
+ rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 2.9.3, < 3.0)
71
+ rubocop-ast (>= 1.48.0, < 2.0)
72
+ ruby-progressbar (~> 1.7)
73
+ unicode-display_width (>= 2.4.0, < 4.0)
74
+ rubocop-ast (1.49.0)
75
+ parser (>= 3.3.7.2)
76
+ prism (~> 1.7)
77
+ rubocop-performance (1.26.1)
78
+ lint_roller (~> 1.1)
79
+ rubocop (>= 1.75.0, < 2.0)
80
+ rubocop-ast (>= 1.47.1, < 2.0)
81
+ ruby-progressbar (1.13.0)
82
+ standard (1.53.0)
83
+ language_server-protocol (~> 3.17.0.2)
84
+ lint_roller (~> 1.0)
85
+ rubocop (~> 1.82.0)
86
+ standard-custom (~> 1.0.0)
87
+ standard-performance (~> 1.8)
88
+ standard-custom (1.0.2)
89
+ lint_roller (~> 1.0)
90
+ rubocop (~> 1.50)
91
+ standard-performance (1.9.0)
92
+ lint_roller (~> 1.1)
93
+ rubocop-performance (~> 1.26.0)
94
+ stringio (3.2.0)
95
+ tsort (0.2.0)
96
+ unicode-display_width (3.2.0)
97
+ unicode-emoji (~> 4.1)
98
+ unicode-emoji (4.2.0)
99
+
100
+ PLATFORMS
101
+ aarch64-linux-gnu
102
+ aarch64-linux-musl
103
+ arm-linux-gnu
104
+ arm-linux-musl
105
+ arm64-darwin
106
+ x86_64-darwin
107
+ x86_64-linux-gnu
108
+ x86_64-linux-musl
109
+
110
+ DEPENDENCIES
111
+ debug (~> 1.9, >= 1.9.2)
112
+ icons!
113
+ minitest
114
+ rake
115
+ standard
116
+
117
+ CHECKSUMS
118
+ ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
119
+ date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
120
+ debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
121
+ erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
122
+ icons (0.6.0)
123
+ io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
124
+ irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806
125
+ json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
126
+ language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
127
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
128
+ minitest (6.0.1) sha256=7854c74f48e2e975969062833adc4013f249a4b212f5e7b9d5c040bf838d54bb
129
+ nokogiri (1.19.0-aarch64-linux-gnu) sha256=11a97ecc3c0e7e5edcf395720b10860ef493b768f6aa80c539573530bc933767
130
+ nokogiri (1.19.0-aarch64-linux-musl) sha256=eb70507f5e01bc23dad9b8dbec2b36ad0e61d227b42d292835020ff754fb7ba9
131
+ nokogiri (1.19.0-arm-linux-gnu) sha256=572a259026b2c8b7c161fdb6469fa2d0edd2b61cd599db4bbda93289abefbfe5
132
+ nokogiri (1.19.0-arm-linux-musl) sha256=23ed90922f1a38aed555d3de4d058e90850c731c5b756d191b3dc8055948e73c
133
+ nokogiri (1.19.0-arm64-darwin) sha256=0811dfd936d5f6dd3f6d32ef790568bf29b2b7bead9ba68866847b33c9cf5810
134
+ nokogiri (1.19.0-x86_64-darwin) sha256=1dad56220b603a8edb9750cd95798bffa2b8dd9dd9aa47f664009ee5b43e3067
135
+ nokogiri (1.19.0-x86_64-linux-gnu) sha256=f482b95c713d60031d48c44ce14562f8d2ce31e3a9e8dd0ccb131e9e5a68b58c
136
+ nokogiri (1.19.0-x86_64-linux-musl) sha256=1c4ca6b381622420073ce6043443af1d321e8ed93cc18b08e2666e5bd02ffae4
137
+ parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
138
+ parser (3.3.10.1) sha256=06f6a725d2cd91e5e7f2b7c32ba143631e1f7c8ae2fb918fc4cebec187e6a688
139
+ pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
140
+ prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
141
+ prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
142
+ psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974
143
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
144
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
145
+ rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
146
+ rdoc (7.1.0) sha256=494899df0706c178596ca6e1d50f1b7eb285a9b2aae715be5abd742734f17363
147
+ regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
148
+ reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
149
+ rubocop (1.82.1) sha256=09f1a6a654a960eda767aebea33e47603080f8e9c9a3f019bf9b94c9cab5e273
150
+ rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
151
+ rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
152
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
153
+ standard (1.53.0) sha256=f3c9493385db7079d0abce6f7582f553122156997b81258cd361d3480eeacf9c
154
+ standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
155
+ standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
156
+ stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
157
+ tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
158
+ unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
159
+ unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
160
+
161
+ BUNDLED WITH
162
+ 4.0.4
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Icons
2
+
3
+ Add any icon library to a Ruby app. Icons has first-party support for a [dozen of libraries](#first-party-libraries). It is library agnostic so it can be used with any icon library using the same interface.
4
+
5
+
6
+ ## Installation
7
+
8
+ Add the core gem to your Gemfile:
9
+ ```ruby
10
+ gem "icons"
11
+ ```
12
+
13
+ Then run:
14
+ ```bash
15
+ bundle install
16
+ ```
17
+
18
+
19
+ ## Usage
20
+
21
+ The core gem is designed to be configured by higher-level layers but can be used directly if needed.
22
+
23
+ Example:
24
+ ```ruby
25
+ Icons.configure do |config|
26
+ config.icons_path = "app/assets/svg/icons"
27
+ config.default_library = :feather
28
+ config.default_variant = :outline
29
+ end
30
+
31
+ # Render an icon
32
+ icon = Icons::Icon.new(name: "check", library: "feather", arguments: { class: "text-gray-500" }, variant: "outline")
33
+ svg = icon.svg
34
+ ```
35
+
36
+ The resulting SVG will include the proper attributes and the SVG content from the library’s asset path.
37
+
38
+
39
+ ## First-party libraries
40
+
41
+ - boxicons
42
+ - feather
43
+ - flags
44
+ - heroicons
45
+ - linear
46
+ - lucide
47
+ - phosphor
48
+ - radix
49
+ - sidekickicons
50
+ - tabler
51
+ - weather
52
+
53
+
54
+ ## Libraries using Icons
55
+
56
+ - [rails_icons](https://github.com/rails-designer/rails_icons)
57
+
58
+
59
+ ## Contributing
60
+
61
+ This project uses [Standard](https://github.com/testdouble/standard) for formatting Ruby code. Please make sure to run `rake` before submitting pull requests.
62
+
63
+
64
+ ## License
65
+
66
+ Icons is released under the MIT License.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[test standard]
data/bin/release ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+
3
+ VERSION=$1
4
+
5
+ if [ -z "$VERSION" ]; then
6
+ echo "Error: Version number or bump type is required."
7
+ echo "Usage: $0 <major|minor|patch|version-number>"
8
+
9
+ exit 1
10
+ fi
11
+
12
+ if [[ "$VERSION" =~ ^(major|minor|patch)$ ]]; then
13
+ CURRENT=$(grep -o '"[^"]*"' ./lib/icons/version.rb | tr -d '"')
14
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
15
+
16
+ case $VERSION in
17
+ major) VERSION="$((MAJOR + 1)).0.0" ;;
18
+ minor) VERSION="$MAJOR.$((MINOR + 1)).0" ;;
19
+ patch) VERSION="$MAJOR.$MINOR.$((PATCH + 1))" ;;
20
+ esac
21
+ fi
22
+
23
+ printf "module Icons\n VERSION = \"$VERSION\"\nend\n" > ./lib/icons/version.rb
24
+
25
+ bundle
26
+
27
+ git add Gemfile.lock lib/icons/version.rb
28
+ git commit -m "Bump version for $VERSION"
29
+ git push
30
+ git tag v$VERSION
31
+ git push --tags
32
+
33
+ bundle exec rake build
34
+ gem push "pkg/icons-$VERSION.gem"
data/icons.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/icons/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "icons"
7
+ spec.version = Icons::VERSION
8
+ spec.authors = ["Rails Designer"]
9
+ spec.email = ["devs@railsdesigner.com"]
10
+
11
+ spec.summary = "Add any icon library to a Ruby app"
12
+ spec.description = "Add any icon library to a Ruby app, from Heroicons, to Lucide to Phosphor (and others). Icons is library-agnostic, so you can add any library while using the same interface."
13
+ spec.homepage = "https://railsdesigner.com/icons/"
14
+ spec.license = "MIT"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/Rails-Designer/icons/"
18
+
19
+ spec.files = Dir["{bin,config,lib}/**/*", "Rakefile", "README.md", "icons.gemspec", "Gemfile", "Gemfile.lock"]
20
+
21
+ spec.add_runtime_dependency "nokogiri", "~> 1.16", ">= 1.16.4"
22
+ end
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="4" cy="12" r="2.5" fill="currentColor"><animateTransform attributeName="transform" begin=".1" dur="1s" repeatCount="indefinite" type="translate" values="0 3.6 ; 0 -3.6; 0 3.6"/></circle><circle cx="12" cy="12" r="2.5" fill="currentColor"><animateTransform attributeName="transform" begin=".2" dur="1s" repeatCount="indefinite" type="translate" values="0 2.4 ; 0 -2.4; 0 2.4"/></circle><circle cx="20" cy="12" r="2.5" fill="currentColor"><animateTransform attributeName="transform" begin=".3" dur="1s" repeatCount="indefinite" type="translate" values="0 1.2 ; 0 -1.2; 0 1.2"/></circle></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" stroke-width="4" viewBox="0 0 24 24"><style>@keyframes spin{to{transform:rotate(360deg)}}</style><g style="transform-origin:center;animation:spin 1s linear infinite"><circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" style="opacity:.25"/><path fill="none" stroke="currentColor" stroke-linecap="round" d="M12 2a10 10 0 0 1 10 10" style="opacity:.75"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="4" cy="12" r="2.5" fill="currentColor"><animate attributeName="opacity" begin=".1" dur="1s" repeatCount="indefinite" values="0;1;0"/></circle><circle cx="12" cy="12" r="2.5" fill="currentColor"><animate attributeName="opacity" begin=".2" dur="1s" repeatCount="indefinite" values="0;1;0"/></circle><circle cx="20" cy="12" r="2.5" fill="currentColor"><animate attributeName="opacity" begin=".3" dur="1s" repeatCount="indefinite" values="0;1;0"/></circle></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" stroke-width="4" viewBox="0 0 24 24"><style>@keyframes spinner_outside{to{transform:rotate(360deg)}}@keyframes spinner_inside{0%{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%{stroke-dasharray:42 150;stroke-dashoffset:-16}95%,to{stroke-dasharray:42 150;stroke-dashoffset:-59}}</style><g class="spinner" style="transform-origin:center;animation:spinner_outside 2s linear infinite"><circle cx="12" cy="12" r="9.5" fill="none" style="stroke-linecap:round;animation:spinner_inside 1.5s ease-in-out infinite"/></g></svg>
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "icons/configuration/options"
4
+
5
+ module Icons
6
+ class Configuration
7
+ module Animated
8
+ extend self
9
+
10
+ def config
11
+ Options.new.tap do |options|
12
+ options.default = default_options
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ def default_options
19
+ Options.new.tap do |options|
20
+ options.css = "size-6"
21
+ options.data = {}
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "icons/configuration/options"
4
+
5
+ module Icons
6
+ class Configuration
7
+ module Boxicons
8
+ extend self
9
+
10
+ def config
11
+ Options.new.tap do |options|
12
+ options.default_variant = :regular
13
+ options.exclude_variants = []
14
+
15
+ setup_regular_config(options)
16
+ setup_solid_config(options)
17
+ setup_logos_config(options)
18
+ end
19
+ end
20
+
21
+ def initializer_config
22
+ <<~RB.indent(2)
23
+ # Override Boxicons defaults
24
+ # config.libraries.boxicons.default_variant = "" # Set a default variant for Boxicons
25
+ # config.libraries.boxicons.exclude_variants = [] # Exclude specific variants
26
+
27
+ # config.libraries.boxicons.solid.css = "size-6"
28
+ # config.libraries.boxicons.solid.data = {}
29
+
30
+ # config.libraries.boxicons.regular.css = "size-6"
31
+ # config.libraries.boxicons.regular.data = {}
32
+
33
+ # config.libraries.boxicons.logos.css = "size-6"
34
+ # config.libraries.boxicons.logos.data = {}
35
+ RB
36
+ end
37
+
38
+ def source
39
+ {
40
+ url: "https://github.com/atisawd/boxicons.git",
41
+ variants: {
42
+ logos: "svg/logos",
43
+ regular: "svg/regular",
44
+ solid: "svg/solid"
45
+ }
46
+ }
47
+ end
48
+
49
+ def transformations
50
+ {
51
+ filenames: {
52
+ delete_prefix: ["bxl-", "bx-", "bxs-"]
53
+ }
54
+ }
55
+ end
56
+
57
+ def setup_regular_config(options)
58
+ options.regular = Options.new
59
+ options.regular.default = default_options
60
+ end
61
+
62
+ def setup_solid_config(options)
63
+ options.solid = Options.new
64
+ options.solid.default = default_options
65
+ end
66
+
67
+ def setup_logos_config(options)
68
+ options.logos = Options.new
69
+ options.logos.default = default_options
70
+ end
71
+
72
+ def default_options
73
+ Options.new.tap do |options|
74
+ options.css = "size-6"
75
+ options.data = {}
76
+ end
77
+ end
78
+ end
79
+ end
80
+ 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 Feather
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 Feather defaults
22
+ # config.libraries.feather.default_variant = "" # Feather has no variants, this is provided for backwards compatibility
23
+ # config.libraries.feather.exclude_variants = [] # Feather has no variants, this is provided for backwards compatibility
24
+
25
+ # config.libraries.feather.default.css = "size-6"
26
+ # config.libraries.feather.default.stroke_width = "2"
27
+ # config.libraries.feather.default.data = {}
28
+ RB
29
+ end
30
+
31
+ def source
32
+ {
33
+ url: "https://github.com/feathericons/feather.git",
34
+ variants: {
35
+ ".": "icons" # Feather has no variants, store in the top directory
36
+ }
37
+ }
38
+ end
39
+
40
+ private
41
+
42
+ def default_options
43
+ Options.new.tap do |options|
44
+ options.stroke_width = "2"
45
+ options.css = "size-6"
46
+ options.data = {}
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "icons/configuration/options"
4
+
5
+ module Icons
6
+ class Configuration
7
+ module Flags
8
+ extend self
9
+
10
+ def config
11
+ Options.new.tap do |options|
12
+ options.default_variant = "landscape"
13
+ options.exclude_variants = []
14
+
15
+ setup_square_config(options)
16
+ setup_landscape_config(options)
17
+ end
18
+ end
19
+
20
+ def initializer_config
21
+ <<~RB.indent(2)
22
+ # Override Flags defaults
23
+ # config.libraries.flags.default_variant = "" # Set a default variant for Flags
24
+ # config.libraries.flags.exclude_variants = [:square, :landscape]
25
+
26
+ # config.libraries.flags.square.default.css = "size-6"
27
+ # config.libraries.flags.square.default.data = {}
28
+
29
+ # config.libraries.flags.landscape.default.css = "size-6"
30
+ # config.libraries.flags.landscape.default.data = {}
31
+ RB
32
+ end
33
+
34
+ def source
35
+ {
36
+ url: "https://github.com/lipis/flag-icons.git",
37
+ variants: {
38
+ square: "flags/1x1",
39
+ landscape: "flags/4x3"
40
+ }
41
+ }
42
+ end
43
+
44
+ private
45
+
46
+ def setup_square_config(options)
47
+ options.square = Options.new
48
+ options.square.default = default_square_options
49
+ end
50
+
51
+ def setup_landscape_config(options)
52
+ options.landscape = Options.new
53
+ options.landscape.default = default_landscape_options
54
+ end
55
+
56
+ def default_square_options
57
+ Options.new.tap do |options|
58
+ options.css = "size-6"
59
+ options.data = {}
60
+ end
61
+ end
62
+
63
+ def default_landscape_options
64
+ Options.new.tap do |options|
65
+ options.css = "size-6"
66
+ options.data = {}
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "icons/configuration/options"
4
+
5
+ module Icons
6
+ class Configuration
7
+ module Heroicons
8
+ extend self
9
+
10
+ def config
11
+ Options.new.tap do |options|
12
+ options.default_variant = :outline
13
+ options.exclude_variants = []
14
+
15
+ setup_outline_config(options)
16
+ setup_solid_config(options)
17
+ setup_mini_config(options)
18
+ setup_micro_config(options)
19
+ end
20
+ end
21
+
22
+ def initializer_config
23
+ <<~RB.indent(2)
24
+ # Override Heroicon defaults
25
+ # config.libraries.heroicons.default_variant = "" # Set a default variant for Heroicons
26
+ # config.libraries.heroicons.exclude_variants = [:mini, :micro] # Exclude specific variants
27
+
28
+ # config.libraries.heroicons.outline.default.css = "size-6"
29
+ # config.libraries.heroicons.outline.default.stroke_width = "1.5"
30
+ # config.libraries.heroicons.outline.default.data = {}
31
+
32
+ # config.libraries.heroicons.solid.default.css = "size-6"
33
+ # config.libraries.heroicons.solid.default.data = {}
34
+
35
+ # config.libraries.heroicons.mini.default.css = "size-5"
36
+ # config.libraries.heroicons.mini.default.data = {}
37
+
38
+ # config.libraries.heroicons.micro.default.css = "size-4"
39
+ # config.libraries.heroicons.micro.default.data = {}
40
+ RB
41
+ end
42
+
43
+ def source
44
+ {
45
+ url: "https://github.com/tailwindlabs/heroicons.git",
46
+ variants: {
47
+ outline: "optimized/24/outline",
48
+ solid: "optimized/24/solid",
49
+ mini: "optimized/20/solid",
50
+ micro: "optimized/16/solid"
51
+ }
52
+ }
53
+ end
54
+
55
+ private
56
+
57
+ def setup_outline_config(options)
58
+ options.outline = Options.new
59
+ options.outline.default = default_outline_options
60
+ end
61
+
62
+ def setup_solid_config(options)
63
+ options.solid = Options.new
64
+ options.solid.default = default_solid_options
65
+ end
66
+
67
+ def setup_mini_config(options)
68
+ options.mini = Options.new
69
+ options.mini.default = default_mini_options
70
+ end
71
+
72
+ def setup_micro_config(options)
73
+ options.micro = Options.new
74
+ options.micro.default = default_micro_options
75
+ end
76
+
77
+ def default_outline_options
78
+ Options.new.tap do |options|
79
+ options.stroke_width = 1.5
80
+ options.css = "size-6"
81
+ options.data = {}
82
+ end
83
+ end
84
+
85
+ def default_solid_options
86
+ Options.new.tap do |options|
87
+ options.css = "size-6"
88
+ options.data = {}
89
+ end
90
+ end
91
+
92
+ def default_mini_options
93
+ Options.new.tap do |options|
94
+ options.css = "size-5"
95
+ options.data = {}
96
+ end
97
+ end
98
+
99
+ def default_micro_options
100
+ Options.new.tap do |options|
101
+ options.css = "size-4"
102
+ options.data = {}
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end