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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +10 -0
- data/lib/solar_icons/helpers.rb +3 -2
- data/lib/solar_icons/icons.rb +1459 -0
- data/lib/solar_icons/version.rb +1 -1
- data/lib/solar_icons/weights.rb +20 -0
- data/lib/solar_icons.rb +5 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71e65a0dce664f391e3c3818d77f370a919a05882269cbae66ea6b1c24fa0658
|
|
4
|
+
data.tar.gz: f320f65727071431ebf0b4d68c446b17cf87b6da6c6ab9a04596240ac3186812
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/solar_icons/helpers.rb
CHANGED
|
@@ -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 =
|
|
9
|
-
STROKE_STYLES =
|
|
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
|