nfg_ui 0.14.4.1 → 0.14.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: a7e2cf55fb368ea6025d8ec7961ce39897e2b404eccf14f026140465228b9e50
4
- data.tar.gz: f2924c85e149b639500623ecd198636ec105ae31b014174beb98333dd1e36028
3
+ metadata.gz: d4bb269c1712ed02fcc8063dac8eebb57e54bb3f146b4004734600a0a5d66570
4
+ data.tar.gz: 9415238bb521eb17244238f0e26ef121bc4bd08032b446402bdf5eeddfdedb34
5
5
  SHA512:
6
- metadata.gz: 03f00b467072b621b17379f8ffd90916049eecd733adb42854a2db48241d6eb9c34a2517a8b12c25a4b35241c87d6d6e65fc947f7e77734037afbf3518bd9c7d
7
- data.tar.gz: d8116b11d77eb4303c18a29788425a75e387a9b8a336d4be5ba128586eca3c8879176112a8322d4c49deb0195b9816668de111c56177a94ed5ff53c426de02a1
6
+ metadata.gz: 784c9cdd392204b6383b729af9f206a9bbe1bf27f05b9f4cdce1f2adac279085edd2e2bf6103b096e3c01c6f8d9f1fc3c49a973252b070f9d5bd97439744ba30
7
+ data.tar.gz: 861b6d63ce011a46e0d37f8ad10bdc5666eb4f3ee3c8b73f3dde74b184b324422b2b8fb3ea158dba61e6eb254c3fc204e97c465dec35060167ab2222fa7f6cef
@@ -12,7 +12,27 @@ module NfgUi
12
12
  remote
13
13
  submit].freeze
14
14
 
15
+ # Link trait has some customizations because it outputs
16
+ # a button without button styles (useful for spacing)
17
+ # which makes it feel like the following SHOULD work:
18
+ # = ui.nfg :button, :link, :danger, icon: 'trash-o'
19
+ # Where it generates a link themed button that also has
20
+ # a color style.
15
21
  def link_trait
22
+ colors = NfgUi::Components::Traits::Theme::COLOR_TRAITS
23
+
24
+ # Check if we've got any color themes passed through in addition to :link
25
+ if traits.collect { |t| t.in?(colors) }.any? && traits.include?(:link)
26
+ # Grab and remove the theme color from traits so it
27
+ # doesn't override the :link theme
28
+ # and so that we can apply it to the css.
29
+ theme_color = traits.delete((traits & colors).first)
30
+
31
+ # Add the text styling to the button's CSS
32
+ options[:class] += " text-#{theme_color}"
33
+ end
34
+
35
+ # And finally, set the official theme as a link
16
36
  options[:theme] = :link
17
37
  end
18
38
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '0.14.4.1'
4
+ VERSION = '0.14.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfg_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4.1
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Roehm
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-06-08 00:00:00.000000000 Z
12
+ date: 2022-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap