primer_view_components 0.0.28 → 0.0.29
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/CHANGELOG.md +10 -0
- data/app/lib/primer/classify.rb +4 -2
- data/app/lib/primer/classify/cache.rb +1 -1
- data/app/lib/primer/classify/functional_colors.rb +3 -3
- data/app/lib/primer/fetch_or_fallback_helper.rb +5 -1
- data/app/lib/primer/view_helper.rb +2 -1
- data/lib/primer/view_components/engine.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2551f777382449acbc64d2035d8b906d1590257cbb1914e7d5fb0255d413259f
|
4
|
+
data.tar.gz: 2a61871e5659d9a0f43a61e23281fa0ff2148ebc93dd55a4402d932a23757fbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ad8995514cd8922ee4b71265ab098a2bbb1f8f46f6b146b5d8a735a98b1bdfa1ccd2d934a5c0b0916a9857a6cf4e26c0adbefae17bebe9dd61cd0e8e9a35f87
|
7
|
+
data.tar.gz: 0f53a20697d391add39c71a06d219568c6104ba5e9e72e0638b10fa581fe7b305f645a9b3db4898cdee427efbc6d06a5faa59b05608a21b7b9b188972a2cd728
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
## main
|
4
4
|
|
5
|
+
## 0.0.29
|
6
|
+
|
7
|
+
* Add `primer_time_ago` helper.
|
8
|
+
|
9
|
+
*Simon Taranto*
|
10
|
+
|
11
|
+
* Add `silence_deprecations` config to supress deprecation warnings.
|
12
|
+
|
13
|
+
*Manuel Puyol*
|
14
|
+
|
5
15
|
## 0.0.28
|
6
16
|
|
7
17
|
* Update `CounterComponent` to accept functional schemes `primary` and `secondary`. Deprecate `gray` and `light_gray` schemes.
|
data/app/lib/primer/classify.rb
CHANGED
@@ -252,9 +252,11 @@ module Primer
|
|
252
252
|
memo[:classes] << "#{key.to_s.dasherize}#{breakpoint}-n#{val.abs}"
|
253
253
|
elsif key == BOX_SHADOW_KEY
|
254
254
|
memo[:classes] << if val == true
|
255
|
-
"
|
255
|
+
"color-shadow-small"
|
256
|
+
elsif val == :none || val.blank?
|
257
|
+
"box-shadow-none"
|
256
258
|
else
|
257
|
-
"
|
259
|
+
"color-shadow-#{val.to_s.dasherize}"
|
258
260
|
end
|
259
261
|
elsif key == VISIBILITY_KEY
|
260
262
|
memo[:classes] << "v-#{val.to_s.dasherize}"
|
@@ -40,7 +40,7 @@ module Primer
|
|
40
40
|
# colors without functional mapping stay the same
|
41
41
|
return "#{non_functional_prefix}-#{value.to_s.dasherize}" if functional_color.blank?
|
42
42
|
|
43
|
-
ActiveSupport::Deprecation.warn("#{key} #{value} is deprecated. Please use #{functional_color} instead.") unless Rails.env.production? ||
|
43
|
+
ActiveSupport::Deprecation.warn("#{key} #{value} is deprecated. Please use #{functional_color} instead.") unless Rails.env.production? || silence_deprecations?
|
44
44
|
|
45
45
|
return "#{functional_prefix}-#{functional_color.to_s.dasherize}"
|
46
46
|
end
|
@@ -57,8 +57,8 @@ module Primer
|
|
57
57
|
Rails.application.config.primer_view_components.force_functional_colors
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
61
|
-
Rails.application.config.primer_view_components.
|
60
|
+
def silence_deprecations?
|
61
|
+
Rails.application.config.primer_view_components.silence_deprecations
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -29,7 +29,7 @@ module Primer
|
|
29
29
|
if allowed_values.include?(given_value)
|
30
30
|
given_value
|
31
31
|
elsif deprecated_values.include?(given_value)
|
32
|
-
ActiveSupport::Deprecation.warn("#{given_value} is deprecated and will be removed in a future version.") unless Rails.env.production?
|
32
|
+
ActiveSupport::Deprecation.warn("#{given_value} is deprecated and will be removed in a future version.") unless Rails.env.production? || silence_deprecations?
|
33
33
|
|
34
34
|
given_value
|
35
35
|
else
|
@@ -55,5 +55,9 @@ module Primer
|
|
55
55
|
fallback
|
56
56
|
end
|
57
57
|
end
|
58
|
+
|
59
|
+
def silence_deprecations?
|
60
|
+
Rails.application.config.primer_view_components.silence_deprecations
|
61
|
+
end
|
58
62
|
end
|
59
63
|
end
|
@@ -14,7 +14,7 @@ module Primer
|
|
14
14
|
|
15
15
|
config.primer_view_components = ActiveSupport::OrderedOptions.new
|
16
16
|
config.primer_view_components.force_functional_colors = true
|
17
|
-
config.primer_view_components.
|
17
|
+
config.primer_view_components.silence_deprecations = false
|
18
18
|
|
19
19
|
initializer "primer_view_components.assets" do |app|
|
20
20
|
app.config.assets.precompile += %w[primer_view_components] if app.config.respond_to?(:assets)
|