primer_view_components 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 842de1db349eaaf6956078181ab990b4cb9e7162da56b2736743b828a71ab981
4
- data.tar.gz: 17ea0d2942a359a138cee586627b270bf9e4ba33925923a13462b928e51e749b
3
+ metadata.gz: 2551f777382449acbc64d2035d8b906d1590257cbb1914e7d5fb0255d413259f
4
+ data.tar.gz: 2a61871e5659d9a0f43a61e23281fa0ff2148ebc93dd55a4402d932a23757fbe
5
5
  SHA512:
6
- metadata.gz: 79c7733109048742731ae0d1f9ba137ecd9aa4818d1287784d289d6ae09e7ee5a34f3a3c5bdde533aba12427f236ce49cedb2730e6f4d8bd9354d958c6a6e24e
7
- data.tar.gz: d8c547b9476ed43e7a586e884e795ea5f4ba11f70867c211db9a7ddf528b4bd81e7b65fa4bacb74fbb79816233083ccf5ebea91d04d0dd6b47dd6358e3d5ccac
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.
@@ -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
- "box-shadow"
255
+ "color-shadow-small"
256
+ elsif val == :none || val.blank?
257
+ "box-shadow-none"
256
258
  else
257
- "box-shadow-#{val.to_s.dasherize}"
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}"
@@ -101,7 +101,7 @@ module Primer
101
101
 
102
102
  preload(
103
103
  keys: Primer::Classify::BOX_SHADOW_KEY,
104
- values: [true, :medium, :large, :extra_large, :none]
104
+ values: [true, :small, :medium, :large, :extra_large, :none]
105
105
  )
106
106
 
107
107
  preload(
@@ -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? || silence_color_deprecations?
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 silence_color_deprecations?
61
- Rails.application.config.primer_view_components.silence_color_deprecations
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
@@ -7,7 +7,8 @@ module Primer
7
7
 
8
8
  HELPERS = {
9
9
  octicon: "Primer::OcticonComponent",
10
- heading: "Primer::HeadingComponent"
10
+ heading: "Primer::HeadingComponent",
11
+ time_ago: "Primer::TimeAgoComponent"
11
12
  }.freeze
12
13
 
13
14
  HELPERS.each do |name, component|
@@ -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.silence_color_deprecations = false
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)
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 28
8
+ PATCH = 29
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source