sdr_view_components 0.1.13 → 0.1.14
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 +4 -4
- data/app/components/sdr_view_components/elements/icon_button_component.html.erb +3 -0
- data/app/components/sdr_view_components/elements/icon_button_component.rb +26 -0
- data/app/components/sdr_view_components/elements/icon_button_link_component.html.erb +3 -0
- data/app/components/sdr_view_components/elements/icon_button_link_component.rb +28 -0
- data/lib/sdr_view_components/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e89b11e845efdc4fa1bea907cac71a0e4165853da5233d4007e15c829709a3e
|
|
4
|
+
data.tar.gz: 486b3bf6dbf1b657cd76d93327892feec81600502c1f75e3aa9578d108478660
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9723c013dfb1a1ba6d6cc4af4c1170aec972539dbff1e6ae78065006b32233c812a66cb1b3b04b8d7a0909acd886783dc1f33d92af62ea3c290760e08be15f96
|
|
7
|
+
data.tar.gz: 4130c0034e46554ccc3e1e5fff29869a0aca37c7c718e75067fc5d1ab0763cb96ed1dd8a7cf96fd756f2641ca6e4857bdf2ff96d10093a91fbdfef0a91b614db
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SdrViewComponents
|
|
4
|
+
module Elements
|
|
5
|
+
# Component for a button which is an icon
|
|
6
|
+
class IconButtonComponent < BaseComponent
|
|
7
|
+
def initialize(icon:, label:, classes: [], **options)
|
|
8
|
+
@icon = icon
|
|
9
|
+
@label = label
|
|
10
|
+
@classes = classes
|
|
11
|
+
@options = options
|
|
12
|
+
super()
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
attr_reader :label, :options
|
|
16
|
+
|
|
17
|
+
def classes
|
|
18
|
+
merge_classes(%w[border border-0], @classes)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def button_icon
|
|
22
|
+
helpers.public_send(:"#{@icon}_icon")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SdrViewComponents
|
|
4
|
+
module Elements
|
|
5
|
+
# Component for a button which is an icon
|
|
6
|
+
class IconButtonLinkComponent < BaseComponent
|
|
7
|
+
def initialize(icon:, label:, classes: [], icon_classes: [], link: nil, **options) # rubocop:disable Metrics/ParameterLists
|
|
8
|
+
@icon = icon
|
|
9
|
+
@label = label
|
|
10
|
+
@classes = classes
|
|
11
|
+
@link = link
|
|
12
|
+
@options = options
|
|
13
|
+
@icon_classes = icon_classes
|
|
14
|
+
super()
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
attr_reader :label, :link, :options
|
|
18
|
+
|
|
19
|
+
def classes
|
|
20
|
+
merge_classes(%w[border border-0], @classes)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def button_icon
|
|
24
|
+
helpers.public_send(:"#{@icon}_icon", classes: @icon_classes)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sdr_view_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aaron Collier
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-02-
|
|
10
|
+
date: 2026-02-27 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|
|
@@ -81,6 +81,10 @@ files:
|
|
|
81
81
|
- app/components/sdr_view_components/elements/card_component.rb
|
|
82
82
|
- app/components/sdr_view_components/elements/heading_component.rb
|
|
83
83
|
- app/components/sdr_view_components/elements/horizontal_rule_component.rb
|
|
84
|
+
- app/components/sdr_view_components/elements/icon_button_component.html.erb
|
|
85
|
+
- app/components/sdr_view_components/elements/icon_button_component.rb
|
|
86
|
+
- app/components/sdr_view_components/elements/icon_button_link_component.html.erb
|
|
87
|
+
- app/components/sdr_view_components/elements/icon_button_link_component.rb
|
|
84
88
|
- app/components/sdr_view_components/elements/modal_component.html.erb
|
|
85
89
|
- app/components/sdr_view_components/elements/modal_component.rb
|
|
86
90
|
- app/components/sdr_view_components/elements/nav_link_component.html.erb
|