solar_icons 2.0.0 → 2.1.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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolarIcons
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolarIcons
4
+ # Canonical weight names accepted by solar_icon(weight:). The constants keep
5
+ # the six styles discoverable from the editor and safe from typos.
6
+ module Weights
7
+ LINEAR = "linear"
8
+ BROKEN = "broken"
9
+ LINE_DUOTONE = "line-duotone"
10
+ OUTLINE = "outline"
11
+ BOLD = "bold"
12
+ BOLD_DUOTONE = "bold-duotone"
13
+
14
+ # Canonical order, as documented.
15
+ ALL = [LINEAR, BROKEN, LINE_DUOTONE, OUTLINE, BOLD, BOLD_DUOTONE].freeze
16
+
17
+ # Weights that render with strokes, where stroke_width applies.
18
+ STROKE = [LINEAR, BROKEN, LINE_DUOTONE].freeze
19
+ end
20
+ end
data/lib/solar_icons.rb CHANGED
@@ -2,10 +2,15 @@
2
2
 
3
3
  require "solar_icons/version"
4
4
  require "solar_icons/configuration"
5
+ require "solar_icons/weights"
5
6
  require "solar_icons/helpers"
6
7
  require "solar_icons/railtie" if defined?(::Rails)
7
8
 
8
9
  module SolarIcons
10
+ # One frozen constant per canonical icon name (SolarIcons::Icons::ARROW_UP).
11
+ # Autoloaded, so applications that only pass strings never parse the file.
12
+ autoload :Icons, "solar_icons/icons"
13
+
9
14
  class << self
10
15
  def icons_root
11
16
  @icons_root ||= File.expand_path("solar_icons/icons", __dir__)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solar_icons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakim Saoudi
@@ -63,6 +63,7 @@ files:
63
63
  - lib/solar_icons.rb
64
64
  - lib/solar_icons/configuration.rb
65
65
  - lib/solar_icons/helpers.rb
66
+ - lib/solar_icons/icons.rb
66
67
  - lib/solar_icons/icons/bold-duotone/accessibility.svg
67
68
  - lib/solar_icons/icons/bold-duotone/add-circle.svg
68
69
  - lib/solar_icons/icons/bold-duotone/add-folder.svg
@@ -8771,6 +8772,7 @@ files:
8771
8772
  - lib/solar_icons/icons/outline/xxx.svg
8772
8773
  - lib/solar_icons/railtie.rb
8773
8774
  - lib/solar_icons/version.rb
8775
+ - lib/solar_icons/weights.rb
8774
8776
  homepage: https://solar-icons.vercel.app/docs/v2/packages/rails
8775
8777
  licenses:
8776
8778
  - MIT