sdr_view_components 0.1.0 → 0.1.1

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: 20f53928d5e6a766683fd1b7a819ab74c6e84f4de231645236f46be3b44c322b
4
- data.tar.gz: 4d49980807bbe8b136182652220ddffa9d43eb001704a5f3deb81bd70c432069
3
+ metadata.gz: 4ac91a62d7a33a057d3a621746ccee8adaab77874f94b7b62935ab4c5488842c
4
+ data.tar.gz: 7172541d5716edfcceff221b76e7e1c8a18242aca71e29c0a79bec66e1a9af4e
5
5
  SHA512:
6
- metadata.gz: 836ba100594784e315565657e624e65cfceb433bb1af721628d2edaad0787cbab55c765b3e275b9f206eeec1adf79a2e89f74b619024abcd5486147c654a875c
7
- data.tar.gz: 72c4838ad811a8ef3f5a7d4f16c33884b7699c31e11d0bc7d3c05ee4c6b5e6ecfb365f36ebaccb1c6f725853cf19948b41fcb173606d57dee348fb00e0f5d7ee
6
+ metadata.gz: 3917b95574028622292e422422c4d04a21377f53e7dfd9449b6a0776642a971e335b767c6e43873a1807c2b9764d2127ad522a14c6d4d3ef42e8a568dbbde308
7
+ data.tar.gz: 8ef66752e994fee74e81a05ac2798058f18d1efbfb13b4855ec611a1655b28755181d9ac5fb73427984d551dc76466ca24c938f33e133e65bd31c7e910420c15
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  [![CircleCI](https://dl.circleci.com/status-badge/img/gh/sul-dlss/sdr_view_components/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/sul-dlss/sdr_view_components/tree/main)
2
2
  [![codecov](https://codecov.io/github/sul-dlss/sdr_view_components/graph/badge.svg?token=VGFL92KY3E)](https://codecov.io/github/sul-dlss/sdr_view_components)
3
+ [![Gem Version](https://badge.fury.io/rb/sdr_view_components.svg)](https://badge.fury.io/rb/sdr_view_components)
3
4
 
4
5
  # SdrViewComponents
5
6
 
@@ -8,7 +8,7 @@
8
8
  </div>
9
9
  <%= tag.nav class: navbar_classes do %>
10
10
  <div class="container">
11
- <a class="mb-0 navbar-brand navbar-logo" href="https://library.stanford.edu">Stanford University Libraries</a>
11
+ <%= sul_logo %>
12
12
  <button
13
13
  class="navbar-toggler navbar-toggler-right collapsed"
14
14
  type="button"
@@ -23,11 +23,13 @@ module SdrViewComponents
23
23
  # param variant [Symbol] One of :light, :dark, :white - determines color scheme.
24
24
  # param background_color [String, nil] Optional RGB color value for background (i.e. '1, 104, 149').
25
25
  # Used only when variant is :dark.
26
- def initialize(title:, subtitle: nil, variant: :light, background_color: nil)
26
+ # param sul_logo [String, nil] Optional URL for SUL logo image. (polychrome, stacked-lg, stacked-mobile)
27
+ def initialize(title:, subtitle: nil, variant: :light, background_color: nil, sul_logo: nil)
27
28
  @title = title
28
29
  @subtitle = subtitle
29
30
  @variant = variant
30
31
  @background_color = background_color
32
+ @sul_logo = sul_logo
31
33
  super()
32
34
  end
33
35
 
@@ -53,6 +55,12 @@ module SdrViewComponents
53
55
  tag.span @subtitle, class: 'h4 d-block my-1'
54
56
  end
55
57
 
58
+ def sul_logo
59
+ logo_classes = merge_classes('mb-0 navbar-brand navbar-logo', @sul_logo)
60
+
61
+ link_to 'Stanford University Libraries', 'https://library.stanford.edu', class: logo_classes
62
+ end
63
+
56
64
  def title
57
65
  tag.div(class: 'h1 my-0') do
58
66
  link_to @title, '/'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrViewComponents
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collier