phlex-tabler_icons 0.2.0 → 0.2.2

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: 25208c4eff094e4513e3d4a4560d7e0ac9c218b163e9930762ff2771cfb48571
4
- data.tar.gz: e8f5d8f72a95f789d1932795f3fffdc8b0ec0081ee5cc0c9ee10637d77c0d7bb
3
+ metadata.gz: ee19e92dadbd63344e0c143f5ca1b88baf2d0a073741b7f01defc435637c079a
4
+ data.tar.gz: 2e99fafd9e41628a950465c6ec8716f08b4339b2c553d674bd6fdc9ce1970a95
5
5
  SHA512:
6
- metadata.gz: f378c9e860300d9ba097a1f831cd24dd71456cc4b1989090b6307ba7f2e186bd38526dc50219a19b330df89e3faf31739128d389c87c66d98f1527cc3c002b09
7
- data.tar.gz: f6d66e458ab0a5cbecbbdcb875a3e81daa09b395191f167576d36fa2c0a0fc5b5610240d3ea325aec7a1c6a00ce64095cbd765f9da06cc6c3e540f5a2b1d6aae
6
+ metadata.gz: 27762634b5036b663da38f01f0c12b55243b4f3afa6e20394bf9bb247efe63f35d7f444b3386ba0e1fae33308b85eef7dddbf1e8d1560a636310b5252ce9adfd
7
+ data.tar.gz: 7484d3722956c5a8b0e9151265a7769d3f0ded71d5958996858f861aa74ef3926236157ab1a272598e7390f45ecf2392c1e55ea7a924e65a84a565ed95b6b4d7
data/README.md CHANGED
@@ -1,17 +1,32 @@
1
1
  # Phlex Tabler Icons
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/phlex-tabler_icons.svg)](https://badge.fury.io/rb/phlex-tabler_icons)
4
+
3
5
  This is a port of [Tabler Icons](https://tabler.io/icons) to [Phlex](https://www.phlex.fun/)
4
6
 
5
- NOTE: Currently it only supports outlined icons. Will add filled icons soon.
7
+ > [!NOTE]
8
+ > Currently the gem only supports outlined icons. Filled icon variants will be introduced soon.
6
9
 
7
10
  ## Instructions
8
11
 
9
- Add the gem to your application
12
+ ### Installation
13
+
14
+ Add the gem to your application:
10
15
 
11
16
  ```bash
12
17
  bundle add phlex-tabler_icons
13
18
  ```
14
19
 
20
+ That's it!
21
+
22
+ ### Usage
23
+
24
+ Simply render the desired icon in your views. The name of the icon is the same as in the Tabler Icons library, just in pascal case.
25
+
26
+ ```ruby
27
+ render Phlex::TablerIcons::Rocket.new(class: "h-8 w-8", stroke_width: 1.5)
28
+ ```
29
+
15
30
  ## Configuration
16
31
 
17
32
  Add the following to your initializers
@@ -3,18 +3,12 @@ require "phlex"
3
3
  module Phlex
4
4
  module TablerIcons
5
5
  class Icon < Phlex::SVG
6
- attr_reader :classes, :height, :width, :stroke_width
7
-
8
- def initialize(
9
- classes: Phlex::TablerIcons.configuration.default_class,
10
- height: Phlex::TablerIcons.configuration.default_height,
11
- width: Phlex::TablerIcons.configuration.default_width,
12
- stroke_width: Phlex::TablerIcons.configuration.default_stroke_width
13
- )
14
- @class = classes
15
- @height = height
16
- @width = width
17
- @stroke_width = stroke_width
6
+ # TODO Remove options[:classes] in future versions
7
+ def initialize(**options)
8
+ @class = options[:class] || options[:classes] || Phlex::TablerIcons.configuration.default_class # :classes are for backward compatibility - will be removed in future versions
9
+ @width = options[:width] || Phlex::TablerIcons.configuration.default_width
10
+ @height = options[:height] || Phlex::TablerIcons.configuration.default_height
11
+ @stroke_width = options[:stroke_width] || Phlex::TablerIcons.configuration.default_stroke_width
18
12
  end
19
13
  end
20
14
  end
@@ -1,5 +1,5 @@
1
1
  module Phlex
2
2
  module TablerIcons
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlex-tabler_icons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elvinas Predkelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
11
+ date: 2024-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex