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 +4 -4
- data/lib/nfg_ui/components/traits/button.rb +20 -0
- data/lib/nfg_ui/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4bb269c1712ed02fcc8063dac8eebb57e54bb3f146b4004734600a0a5d66570
|
4
|
+
data.tar.gz: 9415238bb521eb17244238f0e26ef121bc4bd08032b446402bdf5eeddfdedb34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/nfg_ui/version.rb
CHANGED
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
|
+
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-
|
12
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bootstrap
|