phlex-tabler_icons 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25208c4eff094e4513e3d4a4560d7e0ac9c218b163e9930762ff2771cfb48571
4
- data.tar.gz: e8f5d8f72a95f789d1932795f3fffdc8b0ec0081ee5cc0c9ee10637d77c0d7bb
3
+ metadata.gz: af9e945bf47999791327bcd24ace00ebea77c004c2c824ff4f4c31b4936f14f7
4
+ data.tar.gz: f1f920fdc30078b3bf85b6a7ae6d467cc987333b1b651582ec7e7f2987e41757
5
5
  SHA512:
6
- metadata.gz: f378c9e860300d9ba097a1f831cd24dd71456cc4b1989090b6307ba7f2e186bd38526dc50219a19b330df89e3faf31739128d389c87c66d98f1527cc3c002b09
7
- data.tar.gz: f6d66e458ab0a5cbecbbdcb875a3e81daa09b395191f167576d36fa2c0a0fc5b5610240d3ea325aec7a1c6a00ce64095cbd765f9da06cc6c3e540f5a2b1d6aae
6
+ metadata.gz: df71bb628344a11eef9f69a4bbfedc91f96d9c10da4113974f72e2a65eaa4aff4d9f5b80a546dc298402bd5afc009fd0f8b32f41580dc8f77cfa64c50fdb1ef3
7
+ data.tar.gz: 88021612916256c0ee25de5fe8e44f229bc114adff3bc14961bf6f6b41fa11ca225221ccde91c7fac43641e5d0249d33a9092aa99b0a7ca47821745337a5511c
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,14 @@ require "phlex"
3
3
  module Phlex
4
4
  module TablerIcons
5
5
  class Icon < Phlex::SVG
6
- attr_reader :classes, :height, :width, :stroke_width
6
+ attr_reader :class, :height, :width, :stroke_width
7
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
8
+ # TODO Remove options[:classes] in future versions
9
+ def initialize(**options)
10
+ @class = options[:class] || options[:classes] || Phlex::TablerIcons.configuration.default_class # :classes are for backward compatibility - will be removed in future versions
11
+ @width = options[:width] || Phlex::TablerIcons.configuration.default_width
12
+ @height = options[:height] || Phlex::TablerIcons.configuration.default_height
13
+ @stroke_width = options[:stroke_width] || Phlex::TablerIcons.configuration.default_stroke_width
18
14
  end
19
15
  end
20
16
  end
@@ -1,5 +1,5 @@
1
1
  module Phlex
2
2
  module TablerIcons
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
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.1
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