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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60a20823d04f59a7614d58215150393b7ea17bab6811f1c9c4329b202c86d12e
4
- data.tar.gz: 867533c5c18dac94f0ebdc288f4c2de9142abd2df571366773506ad0e973e2c7
3
+ metadata.gz: 7e89b11e845efdc4fa1bea907cac71a0e4165853da5233d4007e15c829709a3e
4
+ data.tar.gz: 486b3bf6dbf1b657cd76d93327892feec81600502c1f75e3aa9578d108478660
5
5
  SHA512:
6
- metadata.gz: b8885a16e88968ff63938c353e0f51f4e49620501243dc7f6865cdc556e97b19c2664c8e61190657ec015524dc2fa73a8bbce3b630911089744af946acf6967b
7
- data.tar.gz: d49ca182e1626d940cb0e32b04aec41d1b2a4a9b8700be37adb07aae16e2922c6163ac679a3b4b5277771f754da57a86095f639818e16c9c40aae12906764d8e
6
+ metadata.gz: 9723c013dfb1a1ba6d6cc4af4c1170aec972539dbff1e6ae78065006b32233c812a66cb1b3b04b8d7a0909acd886783dc1f33d92af62ea3c290760e08be15f96
7
+ data.tar.gz: 4130c0034e46554ccc3e1e5fff29869a0aca37c7c718e75067fc5d1ab0763cb96ed1dd8a7cf96fd756f2641ca6e4857bdf2ff96d10093a91fbdfef0a91b614db
@@ -0,0 +1,3 @@
1
+ <%= render SdrViewComponents::Elements::ButtonComponent.new(classes:, variant: :'outline-primary', **options) do %>
2
+ <%= button_icon %><span class="visually-hidden"><%= label %></span>
3
+ <% end %>
@@ -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,3 @@
1
+ <%= render SdrViewComponents::Elements::ButtonLinkComponent.new(classes:, variant: :'outline-primary', link:, **options) do %>
2
+ <%= button_icon %><span class="visually-hidden"><%= label %></span>
3
+ <% 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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrViewComponents
4
- VERSION = '0.1.13'
4
+ VERSION = '0.1.14'
5
5
  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.13
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-25 00:00:00.000000000 Z
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