rails_heroicon 1.0.0 → 1.0.1

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: 7962d49162a4a2e11eb96158d6363ed6f45ce5fb5ee6e29a8bfe08c518a2c6c2
4
- data.tar.gz: 6f912e56bb2ee5fe3efb51cb1dbc9abe0ea811a39e3d37501b7c2af00a07ee43
3
+ metadata.gz: f5e0f72c562dcbd500cdb50251dcf61ec36ee26bed0008f00a4cd553dc8aa4ec
4
+ data.tar.gz: 4317fb7b258de8d052ffb8f324a624c5ab4c087556923b1110c4275018c90f4c
5
5
  SHA512:
6
- metadata.gz: 6a5a85703660c00ad56a0f653ca3264dd9b7b34ad213dbad2b2752513f04af757f10cf2e820f385548d8c73e419fb9e7c0f63d89a8a8d5f1058ec921495aa2b5
7
- data.tar.gz: 355dd0bc2a6b3abaea93c0660ea16947db5e39e051a29025604730a031e12016b9efa02b921bf71a47b3984559bb2be87354fb351c5b3ae956d38d907dbef940
6
+ metadata.gz: 051710b0b52d03faea89b00372227a1fdddc2bd8b30e176ec067c1c7ee13d6f83369e6f6661e9718942e69da8458b20d93e74054c6199e64baf4003fe11b788e
7
+ data.tar.gz: b14ef4a431a485f73df7e9d9c7410d055def37c9c217d836aea7def8eca10cea23f2df0f56662ba5b01fed027ad6d3d220d5219ae946d107a4bc17ec841dc3ec
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Rails Heroicon ![ci](https://github.com/abeidahmed/rails-heroicon/actions/workflows/ci.yml/badge.svg)
2
2
 
3
- Ruby on Rails `view helpers` for the awesome heroicons by Steve Schoger. To view
3
+ Ruby on Rails views helper for the awesome heroicons by Steve Schoger. To see
4
4
  all the icons visit [heroicons](https://heroicons.com/).
5
5
 
6
+ All icons are included upto heroicons v0.4.2
7
+
6
8
  > This gem has no official affiliation with [Tailwind Labs](https://github.com/tailwindlabs),
7
9
  > yet.
8
10
 
@@ -16,19 +18,20 @@ gem "rails_heroicon"
16
18
 
17
19
  And then execute:
18
20
 
19
- $ bundle install
21
+ ```bash
22
+ bundle install
23
+ ```
20
24
 
21
25
  Or install it yourself as:
22
26
 
23
- $ gem install rails_heroicon
27
+ ```bash
28
+ gem install rails_heroicon
29
+ ```
24
30
 
25
31
  ## Usage
26
32
 
27
- After installing the gem, using it is as simple as
28
-
29
- ```erb
30
- <%= heroicon "user" %>
31
- ```
33
+ After installing the gem, call `<%= heroicon "user" %>` on your `erb` template.
34
+ The first argument is the icon name. All the icons are listed [here](https://heroicons.com/).
32
35
 
33
36
  This will generate the following html:
34
37
 
@@ -39,6 +42,7 @@ This will generate the following html:
39
42
  viewBox="0 0 24 24"
40
43
  fill="none"
41
44
  stroke="currentColor"
45
+ version="1.1"
42
46
  >
43
47
  <path
44
48
  d="M16 7C16 9.20914 14.2091 11 12 11C9.79086 11 8 9.20914 8 7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7Z"
@@ -62,17 +66,12 @@ the default.
62
66
 
63
67
  To change the variant `<%= heroicon "user", variant: "solid" %>`.
64
68
 
65
- ### Accessibility
66
-
67
- `rails_heroicon` automatically sets `aria-hidden="true"` if `aria-label` is not
68
- set, and if `aria-label` is set, then `role="img"` is set.
69
-
70
69
  ### HTML attributes
71
70
 
72
- Any `html` attribute is supported, for eg:
71
+ Any `html` and `eruby` attribute is supported, for eg:
73
72
 
74
73
  ```erb
75
- <%= heroicon "user", class: "text-gray-500", data: { controller: "icon" } %>
74
+ <%= heroicon "user", class: "text-gray-500", aria: { label: "user-icon" } %>
76
75
  ```
77
76
 
78
77
  ### Handling the size of the icon
@@ -89,6 +88,11 @@ If the `variant` is set as `outline`, `size` automatically defaults to `24`,
89
88
  and if the `variant` is set as `solid`, `size` automatically defaults to `20`.
90
89
  However, this can be over-written with the `size` attribute.
91
90
 
91
+ ### Accessibility
92
+
93
+ `rails_heroicon` automatically sets `aria-hidden="true"` if `aria-label` is not
94
+ set, and if `aria-label` is set, then `role="img"` is set.
95
+
92
96
  ## Development
93
97
 
94
98
  - Clone the repo
@@ -3,18 +3,14 @@ require "action_view"
3
3
  module RailsHeroicon
4
4
  module Helper
5
5
  # To add a heroicon, call <tt><%= heroicon "icon_name" %></tt> on your erb template.
6
- # Head over to https://heroicons.com/ to view all the icons.
6
+ # Head over to https://heroicons.com to view all the icons.
7
7
  #
8
8
  # == Options
9
9
  # The helper method accepts mutiple arguments such as:
10
10
  #
11
11
  # === Variant
12
12
  # There are two types of variants: 'outline' and 'solid', the default being the 'outline'.
13
- # To specify the solid variant, call <tt><%= heroicon "icon_name", variant: :solid %></tt>
14
- #
15
- # === Accessibility
16
- # The helper method automatically sets <tt>aria-hidden=true</tt> if <tt>aria-label</tt> is not set, and
17
- # if <tt>aria-label</tt> is set, then <tt>role=img</tt> is set automatically.
13
+ # To specify the solid variant, call <tt><%= heroicon "icon_name", variant: "solid" %></tt>
18
14
  #
19
15
  # === HTML attributes
20
16
  # Any <tt>html</tt> attribute is supported, for eg:
@@ -32,6 +28,10 @@ module RailsHeroicon
32
28
  # If the variant is set as <tt>outline</tt>, size automatically defaults to 24, and if the variant is set as
33
29
  # <tt>solid</tt>, size automatically defaults to 20. However, this can be over-written with the <tt>size</tt>
34
30
  # attribute.
31
+ #
32
+ # == Accessibility
33
+ # The helper method automatically sets <tt>aria-hidden=true</tt> if <tt>aria-label</tt> is not set, and
34
+ # if <tt>aria-label</tt> is set, then <tt>role=img</tt> is set automatically.
35
35
  def heroicon(symbol, **options)
36
36
  icon = RailsHeroicon.new(symbol, **options)
37
37
  content_tag(:svg, icon.svg_path.html_safe, icon.options)
@@ -1,3 +1,3 @@
1
1
  module RailsHeroicon
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.1".freeze
3
3
  end
metadata CHANGED
@@ -1,91 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_heroicon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - abeidahmed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: byebug
14
+ name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '11.1'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 11.1.3
23
- type: :development
19
+ version: '0'
20
+ type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '11.1'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 11.1.3
33
- - !ruby/object:Gem::Dependency
34
- name: nokogiri
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: 1.11.1
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: 1.11.1
47
- - !ruby/object:Gem::Dependency
48
- name: rake
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '13.0'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '13.0'
61
- - !ruby/object:Gem::Dependency
62
- name: rspec
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '3.0'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '3.0'
75
- - !ruby/object:Gem::Dependency
76
- name: rubocop
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.7'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.7'
26
+ version: '0'
89
27
  description:
90
28
  email:
91
29
  - abeidahmed92@gmail.com
@@ -93,7 +31,6 @@ executables: []
93
31
  extensions: []
94
32
  extra_rdoc_files: []
95
33
  files:
96
- - CHANGELOG.md
97
34
  - LICENSE.txt
98
35
  - README.md
99
36
  - compressed/outline/academic-cap.svg
@@ -576,7 +513,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
576
513
  - !ruby/object:Gem::Version
577
514
  version: '0'
578
515
  requirements: []
579
- rubygems_version: 3.1.4
516
+ rubygems_version: 3.2.3
580
517
  signing_key:
581
518
  specification_version: 4
582
519
  summary: Ruby on Rails view helpers for the awesome Heroicons by Steve Schoger.
data/CHANGELOG.md DELETED
@@ -1,19 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.0.0
4
-
5
- - Compress svg icons for performance
6
- - Make lib production ready
7
-
8
- ## 0.2.0
9
-
10
- - Support ruby >= 2.6.6
11
-
12
- ## 0.1.1
13
-
14
- - Add `rdoc` documentation
15
- - Add documentation for core methods
16
-
17
- ## 0.1.0
18
-
19
- - Release gem