kozenet_ui 0.1.4 → 0.1.5
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 630f1277f958277505d69a7087f698c54772615ce49b5e461127f252a18d532f
|
|
4
|
+
data.tar.gz: 826562e84fcc99ae538683cbdf7685dd0065908eed308c6a58ec0ed9261a1371
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c06c46de9012183f644f314cfc60f58099369696a30b25b83ab5a10aff6fdb5f62f9d6f27c988002a7c36ad44d796b83fa9a721b63d36a727bf85fba0bc6910
|
|
7
|
+
data.tar.gz: 356c12469d4f01569fc86ea4e46b036fd78f3c051c60daa0a1cc26e70761039f59f414bf60cde3fb9a215b7f8ee2a261fd9f833bb0d6a4e3a841c5aca485a843
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.5] - 2025-10-31
|
|
4
|
+
|
|
5
|
+
- Feature: Robust icon helper now supports both heroicon and asset-based SVGs, with automatic fallback and variant/class support
|
|
6
|
+
- Fix: Header/action button icon rendering is now more flexible and compatible with heroicon
|
|
7
|
+
- Chore: Improved test coverage for icon rendering
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [0.1.4] - 2025-01-01
|
|
11
|
+
|
|
12
|
+
- Fix: better stylesheet management
|
|
13
|
+
|
|
3
14
|
## [0.1.1] - 2025-10-31
|
|
4
15
|
|
|
5
16
|
- Fix: Ensure all Kozenet UI CSS files are available in the asset pipeline for all Rails setups (improved asset paths and precompile logic in engine).
|
|
@@ -22,7 +22,10 @@ module KozenetUi
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def render_icon(icon)
|
|
25
|
-
|
|
25
|
+
return unless icon
|
|
26
|
+
|
|
27
|
+
icon_name = icon.to_s.tr("_", "-").to_sym
|
|
28
|
+
ApplicationController.helpers.kozenet_ui_icon(icon_name, class: "kz-action-btn-icon")
|
|
26
29
|
end
|
|
27
30
|
end
|
|
28
31
|
end
|
|
@@ -3,9 +3,26 @@
|
|
|
3
3
|
module KozenetUi
|
|
4
4
|
# Helper methods for rendering SVG icons in Kozenet UI
|
|
5
5
|
module IconHelper
|
|
6
|
-
# Renders a Heroicon SVG from the gem's assets
|
|
7
|
-
# Usage: kozenet_ui_icon(:cart, class: "w-5 h-5 text-gray-500")
|
|
8
6
|
def kozenet_ui_icon(name, options = {})
|
|
7
|
+
heroicon_name = normalize_icon_name(name)
|
|
8
|
+
return render_heroicon(heroicon_name, options) if defined?(heroicon)
|
|
9
|
+
|
|
10
|
+
render_fallback_icon(name, options)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def normalize_icon_name(name)
|
|
16
|
+
name.to_s.tr("_", "-").to_sym
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def render_heroicon(name, options)
|
|
20
|
+
heroicon(name, **options)
|
|
21
|
+
rescue StandardError
|
|
22
|
+
render_fallback_icon(name, options)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def render_fallback_icon(name, options)
|
|
9
26
|
app_path = "icons/#{name}.svg"
|
|
10
27
|
gem_path = "kozenet_ui/icons/#{name}.svg"
|
|
11
28
|
app_full_path = Rails.root.join("app/assets/images", app_path)
|
data/lib/kozenet_ui/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kozenet_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kozenet Pro
|
|
@@ -38,6 +38,20 @@ dependencies:
|
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '1.9'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rails_heroicon
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 2.3.0
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 2.3.0
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: railties
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|