rubicons 0.2.0 → 0.2.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: 1f7125781db91e8889428f5cc70cd8835398fa76fe23d3440cf8a64b01695532
4
- data.tar.gz: c32ebcdaa1094f6e1f0bbbc420749d25ed35ed0d1fcb48fffa24e0fb3063f12c
3
+ metadata.gz: 213e0cf7909346dfe8adea14a8b09b408f97b648c58e76cab21154ab315624fc
4
+ data.tar.gz: 0161edb1f9e9bd1aa916a32fc02cdc81adc0cae361af42ead66e6a83851839e7
5
5
  SHA512:
6
- metadata.gz: fe85aa2e09bbd3d0f824ac4775032f32016319e6ec5fc1dfa7e043878933b48cdbdff6103b60e2beaae807c0d1007c3a1edb29237a3b7f8a68557061c8b6f40a
7
- data.tar.gz: 240837b15b7ae85633f5b598c277f69c402b4ef703cc385656dfdc55e5ea1cc2820a8cdd4aed9140b9e1eb2c4d9047ff549aa9121551d91e2f38635d49b5daae
6
+ metadata.gz: c47af61e8e227c01a83369d3e544d50d305ebcbc673cc152c1527a90d900571a5505e754db0e0a9b9afd1faa5b6324ea49fcfc05c553e697ba1db4f6c6c6f15b
7
+ data.tar.gz: '0391c34c24292bba1562285268077380b8a53eaeb12cd9208448256733083b1475a6346ac577490c90d1c65ed4a557e4f4221b7fc3221ecf320bd821693ca963'
data/README.md CHANGED
@@ -20,45 +20,137 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install rubicons
22
22
 
23
- ## Usage
23
+ ## Icons
24
+
25
+ The `rubicons` gem provides a collection of icons from various libraries. Below is a list of the available icon libraries along with their licenses, versions, and icon counts.
26
+
27
+ | Icon Library | License | Version | Count |
28
+ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----: |
29
+ | [Lucide](https://lucide.dev/) | [ISC](https://github.com/lucide-icons/lucide/blob/main/LICENSE) | [ed733916f30f34fb7815d76e286d9d097d73aa6b](https://github.com/lucide-icons/lucide/commit/ed733916f30f34fb7815d76e286d9d097d73aa6b) | 1565 |
30
+ | [Radix Icons](https://www.radix-ui.com/icons) | [MIT](https://github.com/radix-ui/icons/blob/master/LICENSE) | [bde33b13aa5848555f5512ac12155930fb4beb7d](https://github.com/radix-ui/icons/commit/bde33b13aa5848555f5512ac12155930fb4beb7d) | 318 |
31
+
32
+ I'll create a comprehensive "How to Use" section for your README that covers both standalone and Rails Action View usage, including SVG examples for each icon library. Here's how it could look:
24
33
 
25
- ### Standalone
34
+ ## How to Use
26
35
 
27
- Once installed, you can use the `rubicons` gem in your Ruby application. Here’s a simple example of how to use it:
36
+ ### Standalone Usage
37
+
38
+ You can use Rubicons in any Ruby application without Rails. First, require the gem:
28
39
 
29
40
  ```ruby
30
41
  require 'rubicons'
42
+ ```
43
+
44
+ #### Using Lucide Icons
31
45
 
32
- Rubicons::Lucide.icon('heart')
46
+ ```ruby
47
+ # Get a simple icon with default options (medium size)
48
+ svg = Rubicons::Lucide.icon('heart')
49
+
50
+ # With custom size
51
+ svg = Rubicons::Lucide.icon('heart', size: :lg)
52
+
53
+ # With custom class
54
+ svg = Rubicons::Lucide.icon('heart', class: 'text-red-500')
55
+
56
+ # List all available icons
57
+ icon_names = Rubicons::Lucide.available_icons
33
58
  ```
34
59
 
35
- ### Rails
60
+ This generates an SVG element:
61
+
62
+ ```html
63
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></svg>
64
+ ```
36
65
 
37
- If you are using Rails, you can include the `rubicons` gem in your application by adding it to your Gemfile:
66
+ #### Using Radix Icons
38
67
 
39
68
  ```ruby
40
- gem 'rubicons'
69
+ # Get a simple icon with default options
70
+ svg = Rubicons::Radix.icon('heart')
71
+
72
+ # With custom size
73
+ svg = Rubicons::Radix.icon('heart', size: :xl)
74
+
75
+ # With custom class
76
+ svg = Rubicons::Radix.icon('heart', class: 'icon-primary')
77
+
78
+ # List all available icons
79
+ icon_names = Rubicons::Radix.available_icons
41
80
  ```
42
81
 
43
- Then, run the following command to install the gem:
82
+ This generates an SVG element:
44
83
 
45
- ```bash
46
- $ bundle install
84
+ ```html
85
+ <svg width="24" height="24" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.89346 2.35248C3.49195 2.35248 2.35248 3.49359 2.35248 4.90532C2.35248 6.38164 3.38046 7.61814 4.47057 8.5641C5.55704 9.50695 6.69248 10.1771 7.50002 10.6459C8.30757 10.1771 9.44302 9.50695 10.5295 8.5641C11.6196 7.61814 12.6476 6.38164 12.6476 4.90532C12.6476 3.49359 11.5081 2.35248 10.1066 2.35248C9.27059 2.35248 8.81894 2.64323 8.5397 2.95843C8.27877 3.25295 8.14623 3.58566 8.02501 3.88993L8.00064 3.94565C7.94202 4.09766 7.88485 4.24628 7.80625 4.36017C7.69262 4.52776 7.52197 4.70565 7.50002 4.70565C7.47807 4.70565 7.30742 4.52776 7.1938 4.36017C7.11519 4.24628 7.05802 4.09766 6.9994 3.94565L6.97504 3.88993C6.85381 3.58566 6.72127 3.25295 6.46034 2.95843C6.1811 2.64323 5.72945 2.35248 4.89346 2.35248Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>
47
86
  ```
48
- After that, you can use the `rubicons` gem in your Rails application. Here’s an example of how to use it in a Rails view:
87
+
88
+ ### Rails Integration
89
+
90
+ Rubicons comes with Rails view helpers that make it easy to use icons in your views.
91
+
92
+ #### Setup
93
+
94
+ The helpers are automatically included in your ActionView context. You don't need any additional setup beyond adding the gem to your Gemfile.
95
+
96
+ #### Using Lucide Icons in Views
49
97
 
50
98
  ```erb
99
+ <%# Basic icon %>
51
100
  <%= lucide_icon('heart') %>
101
+
102
+ <%# With size options (xs, sm, md, lg, xl, 2xl) %>
103
+ <%= lucide_icon('heart', size: :lg) %>
104
+
105
+ <%# With custom class %>
106
+ <%= lucide_icon('heart', class: 'text-red-500 inline-block') %>
52
107
  ```
53
108
 
54
- ## Icons
109
+ #### Using Radix Icons in Views
55
110
 
56
- The `rubicons` gem provides a collection of icons from various libraries. Below is a list of the available icon libraries along with their licenses, versions, and icon counts.
111
+ ```erb
112
+ <%# Basic icon %>
113
+ <%= radix_icon('heart') %>
57
114
 
58
- | Icon Library | License | Version | Count |
59
- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----: |
60
- | [Lucide](https://lucide.dev/) | [ISC](https://github.com/lucide-icons/lucide/blob/main/LICENSE) | [ed733916f30f34fb7815d76e286d9d097d73aa6b](https://github.com/lucide-icons/lucide/commit/ed733916f30f34fb7815d76e286d9d097d73aa6b) | 1565 |
61
- | [Radix Icons](https://www.radix-ui.com/icons) | [MIT](https://github.com/radix-ui/icons/blob/master/LICENSE) | [bde33b13aa5848555f5512ac12155930fb4beb7d](https://github.com/radix-ui/icons/commit/bde33b13aa5848555f5512ac12155930fb4beb7d) | 318 |
115
+ <%# With size options (xs, sm, md, lg, xl, 2xl) %>
116
+ <%= radix_icon('heart', size: :xl) %>
117
+
118
+ <%# With custom class %>
119
+ <%= radix_icon('heart', class: 'icon-primary inline-block') %>
120
+ ```
121
+
122
+ ### Available Sizes
123
+
124
+ Both icon libraries support these predefined sizes:
125
+
126
+ | Size | Dimensions (pixels) |
127
+ |------|---------------------|
128
+ | xs | 12×12 |
129
+ | sm | 16×16 |
130
+ | md | 20×20 (default) |
131
+ | lg | 24×24 |
132
+ | xl | 32×32 |
133
+ | 2xl | 40×40 |
134
+
135
+ ### Icon Usage Examples
136
+
137
+ You can use these icons anywhere HTML is supported:
138
+
139
+ ```erb
140
+ <button class="btn btn-primary">
141
+ <%= lucide_icon('save', size: :sm, class: 'mr-2') %>
142
+ Save Changes
143
+ </button>
144
+
145
+ <div class="alert alert-info">
146
+ <%= radix_icon('info', size: :lg, class: 'align-middle') %>
147
+ <span>Please review the changes before continuing.</span>
148
+ </div>
149
+ ```
150
+
151
+ For a complete list of available icons, visit:
152
+ - [Lucide Icons](https://lucide.dev/)
153
+ - [Radix Icons](https://www.radix-ui.com/icons)
62
154
 
63
155
  ## Contributing
64
156
 
@@ -4,7 +4,7 @@ module Rubicons
4
4
  module Radix
5
5
  # Rails view helper for Radix icons
6
6
  module RailsHelper
7
- def lucide_icon(name, options = {})
7
+ def radix_icon(name, options = {})
8
8
  Rubicons::Radix.icon(name, **options).html_safe
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubicons
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubicons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - insomnius