sdr_view_components 0.1.6 → 0.1.7

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: 961d9463dcd2c8acb582e5e97f18c31fff4aa9ec1520456351f6e7aaef232a7e
4
- data.tar.gz: 6f75438e29d6c7571cdbd54aef23966323fcc85a31b757e777489f4babd5a59c
3
+ metadata.gz: 922b619be06bc6e16085fb78c7a864f55f3de6ed487e50a8e746f3e3a5173560
4
+ data.tar.gz: 7e0a6b7edbb738707553d5bb70919372429c5b5890e943c393c1eddde2ad106f
5
5
  SHA512:
6
- metadata.gz: 8de70284a279feae9500bdeb0dabef38e67a8f0433b67d2dfeccbc34f72b78c7703061a3e3fb7ad234148d6d2c0f9738953e01554bed19bfc5f69ce6b13264ce
7
- data.tar.gz: 8be397da249a2e0871f80f78e9ae3ee65d237c5437ee3e79dc20b4db9548403bd7802f0f1b397a4d350793f8c688c4e6b08099439098c44b9874ffe924462743
6
+ metadata.gz: 499e4fab33d04108d386d9078130620d635f088f8e3d32312ad0e5f81be4744d5b33f0326090fc1e7bb1d206e6eaee454fa3bb02b81a2a65d9db68b3689e883d
7
+ data.tar.gz: 7262325a09c98dd14f89260050f1e0560272fce01ca485f6c9198767a32b11b923f875f0a97be98b2efa8ce626637f407fbe5b051717c9e248a5d0b7a4cc3fb1
@@ -5,7 +5,7 @@ module SdrViewComponents
5
5
  module Navigation
6
6
  # Component for navigation item link.
7
7
  class NavItemComponent < BaseComponent
8
- def initialize(text:, path:, data: {})
8
+ def initialize(text:, path: nil, data: {})
9
9
  @text = text
10
10
  @path = path
11
11
  @data = data
@@ -16,7 +16,11 @@ module SdrViewComponents
16
16
 
17
17
  def call
18
18
  tag.li class: 'nav-item' do
19
- link_to text, path, class: 'nav-link', data:
19
+ if path.present?
20
+ link_to text, path, class: 'nav-link', data:
21
+ else
22
+ tag.span text, class: 'nav-link'
23
+ end
20
24
  end
21
25
  end
22
26
  end
@@ -11,7 +11,9 @@
11
11
  ></div>
12
12
  <div>
13
13
  <div class="fw-semibold"><%= title %> </div>
14
- <div><%= text %></div>
14
+ <% if text.present? %>
15
+ <div><%= text %></div>
16
+ <% end %>
15
17
  </div>
16
18
  <div class="me-2 m-auto">
17
19
  <% if close_text.present? %>
@@ -4,7 +4,7 @@ module SdrViewComponents
4
4
  module Elements
5
5
  # Component for rendering a toast element.
6
6
  class ToastComponent < BaseComponent
7
- def initialize(title:, text:, close_text: nil, variant: :black)
7
+ def initialize(title:, text: nil, close_text: nil, variant: :black)
8
8
  @title = title
9
9
  @text = text
10
10
  @close_text = close_text
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrViewComponents
4
- VERSION = '0.1.6'
4
+ VERSION = '0.1.7'
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collier
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-12-15 00:00:00.000000000 Z
10
+ date: 2025-12-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails