primer_view_components 0.0.13 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/app/components/primer/base_component.rb +63 -15
  4. data/app/components/primer/blankslate_component.html.erb +4 -4
  5. data/app/components/primer/blankslate_component.rb +28 -2
  6. data/app/components/primer/border_box_component.rb +4 -0
  7. data/app/components/primer/box_component.rb +10 -0
  8. data/app/components/primer/breadcrumb_component.rb +2 -1
  9. data/app/components/primer/button_component.rb +1 -1
  10. data/app/components/primer/button_group_component.html.erb +5 -0
  11. data/app/components/primer/button_group_component.rb +34 -0
  12. data/app/components/primer/button_marketing_component.rb +73 -0
  13. data/app/components/primer/component.rb +14 -0
  14. data/app/components/primer/counter_component.rb +16 -12
  15. data/app/components/primer/details_component.rb +10 -6
  16. data/app/components/primer/dropdown_menu_component.rb +31 -3
  17. data/app/components/primer/flash_component.rb +2 -3
  18. data/app/components/primer/flex_component.rb +10 -9
  19. data/app/components/primer/flex_item_component.rb +2 -1
  20. data/app/components/primer/heading_component.rb +7 -0
  21. data/app/components/primer/label_component.rb +15 -9
  22. data/app/components/primer/link_component.rb +1 -1
  23. data/app/components/primer/octicon_component.rb +4 -3
  24. data/app/components/primer/popover_component.rb +3 -1
  25. data/app/components/primer/progress_bar_component.rb +5 -5
  26. data/app/components/primer/slot.rb +1 -0
  27. data/app/components/primer/spinner_component.rb +3 -4
  28. data/app/components/primer/state_component.rb +3 -3
  29. data/app/components/primer/subhead_component.rb +3 -0
  30. data/app/components/primer/timeline_item_component.rb +3 -0
  31. data/app/components/primer/tooltip_component.rb +88 -0
  32. data/app/components/primer/truncate_component.rb +41 -0
  33. data/app/components/primer/underline_nav_component.rb +26 -1
  34. data/app/components/primer/view_components.rb +5 -0
  35. data/lib/primer/class_name_helper.rb +1 -0
  36. data/lib/primer/classify.rb +129 -107
  37. data/lib/primer/fetch_or_fallback_helper.rb +9 -0
  38. data/lib/primer/join_style_arguments_helper.rb +14 -0
  39. data/lib/primer/view_components.rb +1 -0
  40. data/lib/primer/view_components/engine.rb +1 -0
  41. data/lib/primer/view_components/version.rb +1 -1
  42. metadata +42 -22
@@ -14,6 +14,7 @@
14
14
  # fetch_or_fallback([1,2,3], 1, 2) => 1
15
15
  # fetch_or_fallback([1,2,3], nil, 2) => 2
16
16
  module Primer
17
+ # :nodoc
17
18
  module FetchOrFallbackHelper
18
19
  mattr_accessor :fallback_raises, default: true
19
20
 
@@ -37,5 +38,13 @@ module Primer
37
38
  fallback
38
39
  end
39
40
  end
41
+
42
+ def fetch_or_fallback_boolean(given_value, fallback = false)
43
+ if [true, false].include?(given_value)
44
+ given_value
45
+ else
46
+ fallback
47
+ end
48
+ end
40
49
  end
41
50
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ # :nodoc
5
+ module JoinStyleArgumentsHelper
6
+ # Join two `style` arguments
7
+ #
8
+ # join_style_arguments("width: 100%", "height: 100%") =>
9
+ # "width: 100%;height: 100%"
10
+ def join_style_arguments(*args)
11
+ args.compact.join(";")
12
+ end
13
+ end
14
+ end
@@ -4,6 +4,7 @@ require "primer/view_components/version"
4
4
  require "primer/view_components/engine"
5
5
 
6
6
  module Primer
7
+ # :nodoc
7
8
  module ViewComponents
8
9
  end
9
10
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Primer
4
4
  module ViewComponents
5
+ # :nodoc
5
6
  class Engine < ::Rails::Engine
6
7
  isolate_namespace Primer::ViewComponents
7
8
  end
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 13
8
+ PATCH = 18
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
metadata CHANGED
@@ -1,75 +1,75 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.18
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: 2020-11-10 00:00:00.000000000 Z
11
+ date: 2021-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: octicons_helper
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: 9.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.0'
22
+ version: 12.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 5.0.0
29
+ version: 9.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.0'
32
+ version: 12.0.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: view_component
34
+ name: rails
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 2.0.0
39
+ version: 5.0.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '3.0'
42
+ version: '7.0'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 2.0.0
49
+ version: 5.0.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '3.0'
52
+ version: '7.0'
53
53
  - !ruby/object:Gem::Dependency
54
- name: octicons_helper
54
+ name: view_component
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 9.0.0
59
+ version: 2.0.0
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: 12.0.0
62
+ version: '3.0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 9.0.0
69
+ version: 2.0.0
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: 12.0.0
72
+ version: '3.0'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: listen
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -118,28 +118,42 @@ dependencies:
118
118
  requirements:
119
119
  - - '='
120
120
  - !ruby/object:Gem::Version
121
- version: '0.74'
121
+ version: '0.82'
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - '='
127
127
  - !ruby/object:Gem::Version
128
- version: '0.74'
128
+ version: '0.82'
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rubocop-github
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - "~>"
134
134
  - !ruby/object:Gem::Version
135
- version: 0.13.0
135
+ version: 0.16.0
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: 0.16.0
143
+ - !ruby/object:Gem::Dependency
144
+ name: rubocop-performance
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '1.7'
136
150
  type: :development
137
151
  prerelease: false
138
152
  version_requirements: !ruby/object:Gem::Requirement
139
153
  requirements:
140
154
  - - "~>"
141
155
  - !ruby/object:Gem::Version
142
- version: 0.13.0
156
+ version: '1.7'
143
157
  - !ruby/object:Gem::Dependency
144
158
  name: simplecov
145
159
  requirement: !ruby/object:Gem::Requirement
@@ -202,6 +216,9 @@ files:
202
216
  - app/components/primer/breadcrumb_component.html.erb
203
217
  - app/components/primer/breadcrumb_component.rb
204
218
  - app/components/primer/button_component.rb
219
+ - app/components/primer/button_group_component.html.erb
220
+ - app/components/primer/button_group_component.rb
221
+ - app/components/primer/button_marketing_component.rb
205
222
  - app/components/primer/component.rb
206
223
  - app/components/primer/counter_component.rb
207
224
  - app/components/primer/details_component.html.erb
@@ -231,12 +248,15 @@ files:
231
248
  - app/components/primer/text_component.rb
232
249
  - app/components/primer/timeline_item_component.html.erb
233
250
  - app/components/primer/timeline_item_component.rb
251
+ - app/components/primer/tooltip_component.rb
252
+ - app/components/primer/truncate_component.rb
234
253
  - app/components/primer/underline_nav_component.html.erb
235
254
  - app/components/primer/underline_nav_component.rb
236
255
  - app/components/primer/view_components.rb
237
256
  - lib/primer/class_name_helper.rb
238
257
  - lib/primer/classify.rb
239
258
  - lib/primer/fetch_or_fallback_helper.rb
259
+ - lib/primer/join_style_arguments_helper.rb
240
260
  - lib/primer/view_components.rb
241
261
  - lib/primer/view_components/engine.rb
242
262
  - lib/primer/view_components/version.rb
@@ -260,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
280
  - !ruby/object:Gem::Version
261
281
  version: '0'
262
282
  requirements: []
263
- rubygems_version: 3.1.2
283
+ rubygems_version: 3.0.3
264
284
  signing_key:
265
285
  specification_version: 4
266
286
  summary: ViewComponents for the Primer Design System