heroicon-rails 0.1.6 → 0.1.7

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: d0214bfedc0c7488301225dcc5db5ee1fc4b18c6d9c8527e37f8a9cfc7ab4a5c
4
- data.tar.gz: 6c0750926dcfd9de8fb09e170fdeda5d1838f01363f179f598763b672867f094
3
+ metadata.gz: 6658c1b5b6bd0730860672bc4e9c66be23f644bf76e7a20498124274f80f9589
4
+ data.tar.gz: b7b9e370fa0e73c9723c308caa72bfc0e356ec83f85abdf351121fb2bbf72613
5
5
  SHA512:
6
- metadata.gz: c694424cf64b65d23e5561aadaa590e726df4ce4a22f6dedc9ed53e5f30348c1a1ee2f68cdbc151b7df147a654273e733950be5827af7737efab5759f1764e96
7
- data.tar.gz: 8db9fd21bdb5a4fad0cc7c36bd004994b2e443070b756d2697a216c0431b14c027fb08a1ea11ddc8b4fb986fb1c997e1ed5b3ea01d52133aa166bc7b1f547933
6
+ metadata.gz: 6a6fb724a88ecd3567a4a1452724e1aa66201a0ba44c256d7a9e59043faa413f1b16512966c4cbbfa2856002acec1e46413624897d54bf4415f57d36179c6e90
7
+ data.tar.gz: cffc219d6d4674e5dcee21c336ac829723f6fa611b6814c4499ff5cb64b82665e50a5b995d1977bdd70281c95a669c2f38038a7c79ab6a2894925741a568af38
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2023-11-26
4
-
3
+ ## [0.1.6] - Initial stable release
5
4
  - Initial release
5
+ ## [0.1.7] - Updates for accessibility
6
+ - Update all svg elements to have a role="img"
7
+ - Update all svg elements to have a descriptive <title> element
8
+ - Update all svg elements to have an aria-labelledby attribute referencing the <title> element
9
+
@@ -15,6 +15,14 @@ module HeroiconHelper
15
15
  css_classes = "#{default_css} #{css_classes}".strip
16
16
  svg[:class] = css_classes unless css_classes.empty?
17
17
 
18
+ # Set accessibility attributes
19
+ svg[:role] = "img"
20
+ svg["aria-labelledby"] = "#{name}-icon"
21
+ title = Nokogiri::XML::Node.new("title", doc)
22
+ title.content = name.humanize
23
+ title[:id] = "#{name}-icon"
24
+ svg.prepend_child(title)
25
+
18
26
  doc.to_html.html_safe
19
27
  rescue StandardError
20
28
  "heroicon '#{name}' not found"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Heroicon
4
4
  module Rails
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.7"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroicon-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Weis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-26 00:00:00.000000000 Z
11
+ date: 2023-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -969,7 +969,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
969
969
  - !ruby/object:Gem::Version
970
970
  version: '0'
971
971
  requirements: []
972
- rubygems_version: 3.2.33
972
+ rubygems_version: 3.4.10
973
973
  signing_key:
974
974
  specification_version: 4
975
975
  summary: A Ruby gem providing a helper for easily embedding Heroicons SVG icons in