primer_view_components 0.0.29 → 0.0.30

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: 2551f777382449acbc64d2035d8b906d1590257cbb1914e7d5fb0255d413259f
4
- data.tar.gz: 2a61871e5659d9a0f43a61e23281fa0ff2148ebc93dd55a4402d932a23757fbe
3
+ metadata.gz: 6a17e4735cb2057fb6c76458ff5cfdd4b833aeb4f6a7de14c4e6fbc3a556e010
4
+ data.tar.gz: 7677caa7f8f052b51d983eb8581e198f7daff976c3793015b811c9edf48ed891
5
5
  SHA512:
6
- metadata.gz: 2ad8995514cd8922ee4b71265ab098a2bbb1f8f46f6b146b5d8a735a98b1bdfa1ccd2d934a5c0b0916a9857a6cf4e26c0adbefae17bebe9dd61cd0e8e9a35f87
7
- data.tar.gz: 0f53a20697d391add39c71a06d219568c6104ba5e9e72e0638b10fa581fe7b305f645a9b3db4898cdee427efbc6d06a5faa59b05608a21b7b9b188972a2cd728
6
+ metadata.gz: 600e505c9cdcc74243127140de5b5f5a6ff634ba6946d653f3473982b2affc2f343c78bc9f9d8913165b15f2986a9ffe16b174c694e8943f041c9b58814a04ae
7
+ data.tar.gz: 25828e4691fed95aa5b9eb8401ecdbea09d6248f5ee7521402fbf9c84bb81f542df5108c785270496604ce48f0d086d964271ff2f12662aebbbced19fa364509
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## main
4
4
 
5
+ ## 0.0.30
6
+
7
+ * Make `color:`, `bg:` and `border_color:` accept string values.
8
+
9
+ *Manuel Puyol*
10
+
5
11
  ## 0.0.29
6
12
 
7
13
  * Add `primer_time_ago` helper.
@@ -29,16 +29,18 @@ module Primer
29
29
  functional_options:,
30
30
  options_without_mappigs: []
31
31
  )
32
+ sym_value = value.to_sym
33
+ dasherized_value = value.to_s.dasherize
32
34
  # the value is a functional color
33
- return "#{number_prefix}-#{value.to_s.dasherize}" if ends_with_number?(value)
34
- return "#{functional_prefix}-#{value.to_s.dasherize}" if functional_options.include?(value)
35
+ return "#{number_prefix}-#{dasherized_value}" if ends_with_number?(sym_value)
36
+ return "#{functional_prefix}-#{dasherized_value}" if functional_options.include?(sym_value)
35
37
  # if the app still allows non functional colors
36
- return "#{non_functional_prefix}-#{value.to_s.dasherize}" unless force_functional_colors?
38
+ return "#{non_functional_prefix}-#{dasherized_value}" unless force_functional_colors?
37
39
 
38
- if mappings.key?(value) || options_without_mappigs.include?(value)
39
- functional_color = mappings[value]
40
+ if mappings.key?(sym_value) || options_without_mappigs.include?(sym_value)
41
+ functional_color = mappings[sym_value]
40
42
  # colors without functional mapping stay the same
41
- return "#{non_functional_prefix}-#{value.to_s.dasherize}" if functional_color.blank?
43
+ return "#{non_functional_prefix}-#{dasherized_value}" if functional_color.blank?
42
44
 
43
45
  ActiveSupport::Deprecation.warn("#{key} #{value} is deprecated. Please use #{functional_color} instead.") unless Rails.env.production? || silence_deprecations?
44
46
 
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 29
8
+ PATCH = 30
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2021-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octicons_helper