primer_view_components 0.0.74 → 0.0.77
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/beta/auto_complete/auto_complete.html.erb +19 -17
- data/app/components/primer/beta/auto_complete/item.rb +8 -4
- data/app/components/primer/beta/auto_complete.rb +109 -47
- data/app/components/primer/{flash_component.html.erb → beta/flash.html.erb} +0 -0
- data/app/components/primer/beta/flash.rb +71 -0
- data/app/components/primer/link_component.rb +6 -0
- data/lib/primer/view_components/linters/argument_mappers/flash.rb +1 -1
- data/lib/primer/view_components/linters/{flash_component_migration_counter.rb → flash_migration_counter.rb} +3 -3
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/deprecated_arguments.rb +37 -6
- data/lib/tasks/docs.rake +2 -3
- data/static/arguments.yml +51 -40
- data/static/audited_at.json +1 -1
- data/static/classes.yml +22 -7
- data/static/constants.json +21 -10
- data/static/statuses.json +1 -1
- metadata +6 -7
- data/app/components/primer/flash_component.rb +0 -69
- data/app/components/primer/link_component.erb +0 -1
data/static/classes.yml
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
---
|
2
|
+
- ".ActionList"
|
3
|
+
- ".ActionList-content"
|
4
|
+
- ".ActionList-item"
|
5
|
+
- ".ActionList-item-label"
|
2
6
|
- ".AvatarStack"
|
3
7
|
- ".AvatarStack--right"
|
4
8
|
- ".AvatarStack--three-plus"
|
@@ -19,6 +23,18 @@
|
|
19
23
|
- ".Counter"
|
20
24
|
- ".Counter--primary"
|
21
25
|
- ".Counter--secondary"
|
26
|
+
- ".FormControl"
|
27
|
+
- ".FormControl--input"
|
28
|
+
- ".FormControl--input-leadingVisual"
|
29
|
+
- ".FormControl--input-trailingAction"
|
30
|
+
- ".FormControl--medium"
|
31
|
+
- ".FormControl-fieldWrap"
|
32
|
+
- ".FormControl-fieldWrap--input"
|
33
|
+
- ".FormControl-fieldWrap--input-leadingVisual"
|
34
|
+
- ".FormControl-fieldWrap--input-trailingAction"
|
35
|
+
- ".FormControl-label"
|
36
|
+
- ".FormGroup"
|
37
|
+
- ".FormGroup--fullWidth"
|
22
38
|
- ".Label"
|
23
39
|
- ".Label--accent"
|
24
40
|
- ".Label--attention"
|
@@ -49,6 +65,12 @@
|
|
49
65
|
- ".Link--muted"
|
50
66
|
- ".Link--primary"
|
51
67
|
- ".Link--secondary"
|
68
|
+
- ".Overlay"
|
69
|
+
- ".Overlay--height-auto"
|
70
|
+
- ".Overlay--width-auto"
|
71
|
+
- ".Overlay-backdrop--anchor"
|
72
|
+
- ".Overlay-body"
|
73
|
+
- ".Overlay-body--paddingNone"
|
52
74
|
- ".Popover"
|
53
75
|
- ".Popover-message"
|
54
76
|
- ".Popover-message--large"
|
@@ -82,12 +104,6 @@
|
|
82
104
|
- ".UnderlineNav-item"
|
83
105
|
- ".UnderlineNav-octicon"
|
84
106
|
- ".anim-rotate"
|
85
|
-
- ".autocomplete-body"
|
86
|
-
- ".autocomplete-embedded-icon-wrap"
|
87
|
-
- ".autocomplete-item"
|
88
|
-
- ".autocomplete-label-inline"
|
89
|
-
- ".autocomplete-label-stacked"
|
90
|
-
- ".autocomplete-results"
|
91
107
|
- ".avatar"
|
92
108
|
- ".avatar-more"
|
93
109
|
- ".avatar-small"
|
@@ -167,7 +183,6 @@
|
|
167
183
|
- ".flex-justify-center"
|
168
184
|
- ".flex-shrink-0"
|
169
185
|
- ".float-right"
|
170
|
-
- ".form-control"
|
171
186
|
- ".gutter-condensed"
|
172
187
|
- ".gutter-lg"
|
173
188
|
- ".hidden-text-expander"
|
data/static/constants.json
CHANGED
@@ -199,7 +199,18 @@
|
|
199
199
|
]
|
200
200
|
},
|
201
201
|
"Primer::Beta::AutoComplete": {
|
202
|
-
"
|
202
|
+
"DEFAULT_SIZE": "medium",
|
203
|
+
"Item": "Primer::Beta::AutoComplete::Item",
|
204
|
+
"SIZE_MAPPINGS": {
|
205
|
+
"small": "FormControl--small",
|
206
|
+
"medium": "FormControl--medium",
|
207
|
+
"large": "FormControl--large"
|
208
|
+
},
|
209
|
+
"SIZE_OPTIONS": [
|
210
|
+
"small",
|
211
|
+
"medium",
|
212
|
+
"large"
|
213
|
+
]
|
203
214
|
},
|
204
215
|
"Primer::Beta::AutoComplete::Item": {
|
205
216
|
},
|
@@ -259,6 +270,15 @@
|
|
259
270
|
},
|
260
271
|
"Primer::Beta::Breadcrumbs::Item": {
|
261
272
|
},
|
273
|
+
"Primer::Beta::Flash": {
|
274
|
+
"DEFAULT_SCHEME": "default",
|
275
|
+
"SCHEME_MAPPINGS": {
|
276
|
+
"default": "",
|
277
|
+
"warning": "flash-warn",
|
278
|
+
"danger": "flash-error",
|
279
|
+
"success": "flash-success"
|
280
|
+
}
|
281
|
+
},
|
262
282
|
"Primer::Beta::Text": {
|
263
283
|
"DEFAULT_TAG": "span"
|
264
284
|
},
|
@@ -416,15 +436,6 @@
|
|
416
436
|
"dark": "dropdown-menu-dark"
|
417
437
|
}
|
418
438
|
},
|
419
|
-
"Primer::FlashComponent": {
|
420
|
-
"DEFAULT_SCHEME": "default",
|
421
|
-
"SCHEME_MAPPINGS": {
|
422
|
-
"default": "",
|
423
|
-
"warning": "flash-warn",
|
424
|
-
"danger": "flash-error",
|
425
|
-
"success": "flash-success"
|
426
|
-
}
|
427
|
-
},
|
428
439
|
"Primer::FlexComponent": {
|
429
440
|
"ALIGN_ITEMS_DEFAULT": null,
|
430
441
|
"ALIGN_ITEMS_MAPPINGS": {
|
data/static/statuses.json
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
"Primer::Beta::Blankslate": "beta",
|
19
19
|
"Primer::Beta::Breadcrumbs": "beta",
|
20
20
|
"Primer::Beta::Breadcrumbs::Item": "alpha",
|
21
|
+
"Primer::Beta::Flash": "beta",
|
21
22
|
"Primer::Beta::Text": "beta",
|
22
23
|
"Primer::Beta::Truncate": "beta",
|
23
24
|
"Primer::Beta::Truncate::TruncateText": "alpha",
|
@@ -35,7 +36,6 @@
|
|
35
36
|
"Primer::Dropdown::Menu": "alpha",
|
36
37
|
"Primer::Dropdown::Menu::Item": "alpha",
|
37
38
|
"Primer::DropdownMenuComponent": "deprecated",
|
38
|
-
"Primer::FlashComponent": "beta",
|
39
39
|
"Primer::FlexComponent": "deprecated",
|
40
40
|
"Primer::FlexItemComponent": "deprecated",
|
41
41
|
"Primer::HeadingComponent": "beta",
|
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.
|
4
|
+
version: 0.0.77
|
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: 2022-
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -410,6 +410,8 @@ files:
|
|
410
410
|
- app/components/primer/beta/blankslate.rb
|
411
411
|
- app/components/primer/beta/breadcrumbs.html.erb
|
412
412
|
- app/components/primer/beta/breadcrumbs.rb
|
413
|
+
- app/components/primer/beta/flash.html.erb
|
414
|
+
- app/components/primer/beta/flash.rb
|
413
415
|
- app/components/primer/beta/text.rb
|
414
416
|
- app/components/primer/beta/truncate.html.erb
|
415
417
|
- app/components/primer/beta/truncate.rb
|
@@ -445,8 +447,6 @@ files:
|
|
445
447
|
- app/components/primer/dropdown/menu.ts
|
446
448
|
- app/components/primer/dropdown_menu_component.html.erb
|
447
449
|
- app/components/primer/dropdown_menu_component.rb
|
448
|
-
- app/components/primer/flash_component.html.erb
|
449
|
-
- app/components/primer/flash_component.rb
|
450
450
|
- app/components/primer/flex_component.rb
|
451
451
|
- app/components/primer/flex_item_component.rb
|
452
452
|
- app/components/primer/heading_component.rb
|
@@ -462,7 +462,6 @@ files:
|
|
462
462
|
- app/components/primer/label_component.rb
|
463
463
|
- app/components/primer/layout_component.html.erb
|
464
464
|
- app/components/primer/layout_component.rb
|
465
|
-
- app/components/primer/link_component.erb
|
466
465
|
- app/components/primer/link_component.rb
|
467
466
|
- app/components/primer/local_time.d.ts
|
468
467
|
- app/components/primer/local_time.js
|
@@ -537,7 +536,7 @@ files:
|
|
537
536
|
- lib/primer/view_components/linters/button_component_migration_counter.rb
|
538
537
|
- lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
|
539
538
|
- lib/primer/view_components/linters/close_button_component_migration_counter.rb
|
540
|
-
- lib/primer/view_components/linters/
|
539
|
+
- lib/primer/view_components/linters/flash_migration_counter.rb
|
541
540
|
- lib/primer/view_components/linters/helpers/rubocop_helpers.rb
|
542
541
|
- lib/primer/view_components/linters/label_component_migration_counter.rb
|
543
542
|
- lib/primer/view_components/linters/subhead_component_migration_counter.rb
|
@@ -595,7 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
595
594
|
- !ruby/object:Gem::Version
|
596
595
|
version: '0'
|
597
596
|
requirements: []
|
598
|
-
rubygems_version: 3.2.
|
597
|
+
rubygems_version: 3.2.32
|
599
598
|
signing_key:
|
600
599
|
specification_version: 4
|
601
600
|
summary: ViewComponents for the Primer Design System
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# Use `Flash` to inform users of successful or pending actions.
|
5
|
-
class FlashComponent < Primer::Component
|
6
|
-
status :beta
|
7
|
-
|
8
|
-
# Optional action content showed on the right side of the component.
|
9
|
-
#
|
10
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
11
|
-
renders_one :action, lambda { |**system_arguments|
|
12
|
-
deny_tag_argument(**system_arguments)
|
13
|
-
system_arguments[:tag] = :div
|
14
|
-
system_arguments[:classes] = class_names(system_arguments[:classes], "flash-action")
|
15
|
-
|
16
|
-
Primer::BaseComponent.new(**system_arguments)
|
17
|
-
}
|
18
|
-
|
19
|
-
DEFAULT_SCHEME = :default
|
20
|
-
SCHEME_MAPPINGS = {
|
21
|
-
DEFAULT_SCHEME => "",
|
22
|
-
:warning => "flash-warn",
|
23
|
-
:danger => "flash-error",
|
24
|
-
:success => "flash-success"
|
25
|
-
}.freeze
|
26
|
-
# @example Schemes
|
27
|
-
# <%= render(Primer::FlashComponent.new) { "This is a flash message!" } %>
|
28
|
-
# <%= render(Primer::FlashComponent.new(scheme: :warning)) { "This is a warning flash message!" } %>
|
29
|
-
# <%= render(Primer::FlashComponent.new(scheme: :danger)) { "This is a danger flash message!" } %>
|
30
|
-
# <%= render(Primer::FlashComponent.new(scheme: :success)) { "This is a success flash message!" } %>
|
31
|
-
#
|
32
|
-
# @example Full width
|
33
|
-
# <%= render(Primer::FlashComponent.new(full: true)) { "This is a full width flash message!" } %>
|
34
|
-
#
|
35
|
-
# @example Dismissible
|
36
|
-
# <%= render(Primer::FlashComponent.new(dismissible: true)) { "This is a dismissible flash message!" } %>
|
37
|
-
#
|
38
|
-
# @example Icon
|
39
|
-
# <%= render(Primer::FlashComponent.new(icon: :people)) { "This is a flash message with an icon!" } %>
|
40
|
-
#
|
41
|
-
# @example With actions
|
42
|
-
# <%= render(Primer::FlashComponent.new) do |component| %>
|
43
|
-
# This is a flash message with actions!
|
44
|
-
# <% component.action do %>
|
45
|
-
# <%= render(Primer::ButtonComponent.new(size: :small)) { "Take action" } %>
|
46
|
-
# <% end %>
|
47
|
-
# <% end %>
|
48
|
-
#
|
49
|
-
# @param full [Boolean] Whether the component should take up the full width of the screen.
|
50
|
-
# @param spacious [Boolean] Whether to add margin to the bottom of the component.
|
51
|
-
# @param dismissible [Boolean] Whether the component can be dismissed with an X button.
|
52
|
-
# @param icon [Symbol] Name of Octicon icon to use.
|
53
|
-
# @param scheme [Symbol] <%= one_of(Primer::FlashComponent::SCHEME_MAPPINGS.keys) %>
|
54
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
55
|
-
def initialize(full: false, spacious: false, dismissible: false, icon: nil, scheme: DEFAULT_SCHEME, **system_arguments)
|
56
|
-
@icon = icon
|
57
|
-
@dismissible = dismissible
|
58
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
59
|
-
@system_arguments[:tag] = :div
|
60
|
-
@system_arguments[:classes] = class_names(
|
61
|
-
@system_arguments[:classes],
|
62
|
-
"flash",
|
63
|
-
SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_MAPPINGS.keys, scheme, DEFAULT_SCHEME)],
|
64
|
-
"flash-full": full
|
65
|
-
)
|
66
|
-
@system_arguments[:mb] ||= spacious ? 4 : nil
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render Primer::BaseComponent.new(**@system_arguments) do -%><%= content -%><%= tooltip -%><% end %>
|