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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae5ee6f6e9cb40801390eef12c1401d72ed1df24ca24e4d9928bd2d5a08c853a
4
- data.tar.gz: 9d84ae8e0179c6ecb722d3d918feb47882240917b91daca0c5482dffc255f7eb
3
+ metadata.gz: 71e65a0dce664f391e3c3818d77f370a919a05882269cbae66ea6b1c24fa0658
4
+ data.tar.gz: f320f65727071431ebf0b4d68c446b17cf87b6da6c6ab9a04596240ac3186812
5
5
  SHA512:
6
- metadata.gz: f05fcd843fa7e6fb1bb403c67163f21289f3945dc8ff134f5ea1f77b175a4b6c782d283042ab89786891001337db4a95b8e5184efdffbf5f826217f336e77524
7
- data.tar.gz: ee589d681a15a1294504ec32fc8509ce0fc5d093040f91f34a4cdc2418ae748f069ee82479b9fc3a2c36f05db5a54a3b7cbf08c17ccb3b8d108dcad0e4a988bb
6
+ metadata.gz: 7ba769c6880d733bfae3f14dc51fb53c44c32f80e840293ac5d65cafbd656a2ac08e39d21e57b05be7879b2962b6c5e528a3407c7ff1da400708d8d5082aebaf
7
+ data.tar.gz: 9d66b087ca2ce25cf4e3bd12348d33c9db76993d69c56828e16b2a8b011380c554e232ffb68ab8bbddf35b22c7028f1855683b0b54ce394b4d685153a35f94e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0
4
+
5
+ - `SolarIcons::Icons::*` constants (one frozen constant per icon, autoloaded) and `SolarIcons::Weights::*` for the six styles; `solar_icon` accepts both anywhere it accepts strings.
6
+
3
7
  ## 2.0.0
4
8
 
5
9
  Initial Rails release, aligned with the 2.x line of the other packages: `solar_icon` view helper with the six styles, size, stroke-width, duotone secondary color and opacity, accessible `alt` labels, class merging, configuration defaults, and 8,706 canonical SVGs generated from `@solar-icons/static`.
data/README.md CHANGED
@@ -40,6 +40,16 @@ Options:
40
40
 
41
41
  Unknown names and weights raise `SolarIcons::Helpers::UnknownIcon` and `SolarIcons::Helpers::UnknownStyle` so typos surface immediately.
42
42
 
43
+ ## Lookup constants
44
+
45
+ Generated constants cover the whole catalogue and the six weights, so editors can complete them and typos surface as `NameError`:
46
+
47
+ ```erb
48
+ <%= solar_icon(SolarIcons::Icons::ARROW_UP, weight: SolarIcons::Weights::BOLD_DUOTONE) %>
49
+ ```
50
+
51
+ `Icons::ARROW_UP` is a frozen string, so `solar_icon` accepts it anywhere a name string is expected, and `Weights::*` anywhere a weight is. The icon constants are autoloaded: applications that only pass strings never parse the generated file. For runtime enumeration keep using `SolarIcons.icon_names(style)`.
52
+
43
53
  ## Configuration
44
54
 
45
55
  ```ruby
@@ -2,11 +2,12 @@
2
2
 
3
3
  require "active_support/core_ext/string/output_safety"
4
4
  require "erb"
5
+ require "solar_icons/weights"
5
6
 
6
7
  module SolarIcons
7
8
  module Helpers
8
- STYLES = %w[linear broken line-duotone outline bold bold-duotone].freeze
9
- STROKE_STYLES = %w[linear broken line-duotone].freeze
9
+ STYLES = Weights::ALL
10
+ STROKE_STYLES = Weights::STROKE
10
11
  A11Y_ATTRIBUTES = %w[aria-label aria-labelledby role title].freeze
11
12
 
12
13
  class UnknownIcon < ArgumentError; end