nfg_ui 0.9.22 → 0.9.23

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: 25a27ad9e036828091979c536b6a35934201fc0ee7e950c2a06c0c65a82357b7
4
- data.tar.gz: c1e07b2bd81581d450c3734f00d065b4acc573b30c9492fc5ec10dd8c93bd1d3
3
+ metadata.gz: 040ebc8aba557a02d99f3e608b542cf5df490f94b6124417da6ddd9b01f8957b
4
+ data.tar.gz: '0943ceecff8e1c95a6080eb3dde4c862184563da3f7158d880187bd53cb17b1b'
5
5
  SHA512:
6
- metadata.gz: e2744e53200870105de580fde6f47f23611abdb8c8a9d9a9ffbd1a25e642368a519f11b1f8b4b5c6944e70d7b4461df24983eb4c6fc06586845611975326ca1d
7
- data.tar.gz: d41e231ad870d99804f5ea7abd74accdd2a43943456fe722a7273ebbe558248a0fc2722788dc02688f5191f06c004713ebda61d6633bac0e45909f13e32b236b
6
+ metadata.gz: 23532de2392e293538dabdeaecbe0caa287fac6aa208198a6bb4ea9e845d4e70888afd0e2fd80c54a7fe508f5b7dd92ae2b2156265bcddaf7d270848f68c95c9
7
+ data.tar.gz: af061b7ea374efb9e4d814b569290fa5249378496f9c60e15ea24d8411a2ce2e1ae2e28c82edb956ad58d700982c8548423ea5cb492e7609cfc3094e68672b32
@@ -62,12 +62,14 @@ module NfgUi
62
62
  # Adds the left css spacer class when :right is false
63
63
  # and when text is present
64
64
  def add_left_icon_css_spacer_class?
65
+ return false if reject_spacer_css_class?
65
66
  !right && text.present?
66
67
  end
67
68
 
68
69
  # Adds the left css spacer class when :right is true
69
70
  # and when text is present
70
71
  def add_right_icon_css_spacer_class?
72
+ return false if reject_spacer_css_class?
71
73
  right && text.present?
72
74
  end
73
75
 
@@ -109,6 +111,17 @@ module NfgUi
109
111
  def outlineable?
110
112
  false
111
113
  end
114
+
115
+ # List of unique conditions that will result in
116
+ # full rejection of left/right spacer classes
117
+ #
118
+ # This is needed for specific traits / design system approaches
119
+ # Where icons get unique css classes based on
120
+ # their context, such as a :tip icon which is
121
+ # placed in the sentence flow and doesn't need left/right css spacers.
122
+ def reject_spacer_css_class?
123
+ traits.include?(:tip)
124
+ end
112
125
  end
113
126
  end
114
127
  end
@@ -17,6 +17,11 @@ module NfgUi
17
17
  def tip_trait
18
18
  options[:icon] = NfgUi::DEFAULT_TIP_ICON
19
19
  options[:theme] = NfgUi::DEFAULT_TIP_THEME
20
+
21
+ if options[:text].present?
22
+ options[:right] = true
23
+ options[:class] += ' fa-fw'
24
+ end
20
25
  end
21
26
  end
22
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NfgUi
4
- VERSION = '0.9.22'
4
+ VERSION = '0.9.23'
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.9.22
4
+ version: 0.9.23
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: 2019-10-25 00:00:00.000000000 Z
12
+ date: 2019-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap