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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/app/components/primer/base_component.rb +63 -15
- data/app/components/primer/blankslate_component.html.erb +4 -4
- data/app/components/primer/blankslate_component.rb +28 -2
- data/app/components/primer/border_box_component.rb +4 -0
- data/app/components/primer/box_component.rb +10 -0
- data/app/components/primer/breadcrumb_component.rb +2 -1
- data/app/components/primer/button_component.rb +1 -1
- data/app/components/primer/button_group_component.html.erb +5 -0
- data/app/components/primer/button_group_component.rb +34 -0
- data/app/components/primer/button_marketing_component.rb +73 -0
- data/app/components/primer/component.rb +14 -0
- data/app/components/primer/counter_component.rb +16 -12
- data/app/components/primer/details_component.rb +10 -6
- data/app/components/primer/dropdown_menu_component.rb +31 -3
- data/app/components/primer/flash_component.rb +2 -3
- data/app/components/primer/flex_component.rb +10 -9
- data/app/components/primer/flex_item_component.rb +2 -1
- data/app/components/primer/heading_component.rb +7 -0
- data/app/components/primer/label_component.rb +15 -9
- data/app/components/primer/link_component.rb +1 -1
- data/app/components/primer/octicon_component.rb +4 -3
- data/app/components/primer/popover_component.rb +3 -1
- data/app/components/primer/progress_bar_component.rb +5 -5
- data/app/components/primer/slot.rb +1 -0
- data/app/components/primer/spinner_component.rb +3 -4
- data/app/components/primer/state_component.rb +3 -3
- data/app/components/primer/subhead_component.rb +3 -0
- data/app/components/primer/timeline_item_component.rb +3 -0
- data/app/components/primer/tooltip_component.rb +88 -0
- data/app/components/primer/truncate_component.rb +41 -0
- data/app/components/primer/underline_nav_component.rb +26 -1
- data/app/components/primer/view_components.rb +5 -0
- data/lib/primer/class_name_helper.rb +1 -0
- data/lib/primer/classify.rb +129 -107
- data/lib/primer/fetch_or_fallback_helper.rb +9 -0
- data/lib/primer/join_style_arguments_helper.rb +14 -0
- data/lib/primer/view_components.rb +1 -0
- data/lib/primer/view_components/engine.rb +1 -0
- data/lib/primer/view_components/version.rb +1 -1
- 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
|
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.
|
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:
|
11
|
+
date: 2021-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: octicons_helper
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 9.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
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:
|
29
|
+
version: 9.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 12.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: rails
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 5.0.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
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:
|
49
|
+
version: 5.0.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '7.0'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: view_component
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
59
|
+
version: 2.0.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
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:
|
69
|
+
version: 2.0.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
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.
|
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.
|
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.
|
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:
|
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.
|
283
|
+
rubygems_version: 3.0.3
|
264
284
|
signing_key:
|
265
285
|
specification_version: 4
|
266
286
|
summary: ViewComponents for the Primer Design System
|