primer_view_components 0.0.59 → 0.0.60
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 +4 -4
- data/CHANGELOG.md +52 -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/alpha/border_box/header.html.erb +4 -0
- data/app/components/primer/alpha/border_box/header.rb +51 -0
- data/app/components/primer/alpha/tab_nav.rb +1 -2
- data/app/components/primer/base_component.rb +2 -2
- data/app/components/primer/beta/avatar.rb +18 -11
- data/app/components/primer/beta/breadcrumbs.rb +7 -0
- data/app/components/primer/border_box_component.rb +8 -12
- data/app/components/primer/clipboard_copy.html.erb +1 -1
- data/app/components/primer/component.rb +1 -0
- data/app/components/primer/label_component.rb +7 -7
- data/app/components/primer/markdown.rb +0 -10
- data/app/components/primer/spinner_component.html.erb +7 -4
- data/app/components/primer/timeline_item_component.rb +2 -2
- data/app/lib/primer/audited/dsl.rb +32 -0
- data/lib/primer/classify/cache.rb +0 -16
- data/lib/primer/classify/utilities.rb +13 -6
- data/lib/primer/classify/utilities.yml +199 -22
- data/lib/primer/classify.rb +2 -9
- data/lib/primer/view_components/engine.rb +6 -0
- data/lib/primer/view_components/linters/blankslate_component_migration_counter.rb +14 -0
- data/lib/primer/view_components/linters/subhead_component_migration_counter.rb +14 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/view_components.rb +17 -29
- data/lib/rubocop/cop/primer/deprecated_arguments.rb +35 -1
- data/lib/rubocop/cop/primer/primer_octicon.rb +25 -4
- data/lib/tasks/docs.rake +2 -0
- data/lib/tasks/helpers/ast_processor.rb +44 -0
- data/lib/tasks/helpers/ast_traverser.rb +77 -0
- data/lib/tasks/primer_view_components.rake +47 -0
- data/lib/tasks/{constants.rake → static.rake} +5 -2
- data/lib/tasks/utilities.rake +40 -26
- data/static/arguments.yml +36 -5
- data/static/audited_at.json +61 -0
- data/static/classes.yml +3 -0
- data/static/constants.json +26 -0
- data/static/statuses.json +1 -0
- metadata +14 -7
- data/lib/primer/classify/grid.rb +0 -45
- data/lib/tasks/statuses.rake +0 -12
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "primer/view_components/statuses"
|
|
4
|
+
require_relative "../../../app/lib/primer/view_helper"
|
|
5
|
+
|
|
6
|
+
# :nodoc:
|
|
7
|
+
class AstTraverser
|
|
8
|
+
include RuboCop::AST::Traversal
|
|
9
|
+
|
|
10
|
+
attr_reader :stats
|
|
11
|
+
|
|
12
|
+
def initialize
|
|
13
|
+
@stats = {}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def on_send(node)
|
|
17
|
+
return super(node) unless component_node?(node)
|
|
18
|
+
|
|
19
|
+
name = component_name(node)
|
|
20
|
+
args = extract_arguments(node, name)
|
|
21
|
+
|
|
22
|
+
@stats[name] = { path: node.loc.expression.source_buffer.name }
|
|
23
|
+
@stats[name][:arguments] = args unless args.empty?
|
|
24
|
+
|
|
25
|
+
super(node) # recursively iterate over children
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def view_helpers
|
|
29
|
+
@view_helpers ||= ::Primer::ViewHelper::HELPERS.keys.map { |key| "primer_#{key}".to_sym }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def component_node?(node)
|
|
33
|
+
view_helpers.include?(node.method_name) || (node.method_name == :new && !node.receiver.nil? && ::Primer::ViewComponents::STATUSES.key?(node.receiver.const_name))
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def component_name(node)
|
|
37
|
+
return node.receiver.const_name if node.method_name == :new
|
|
38
|
+
|
|
39
|
+
helper_key = node.method_name.to_s.gsub("primer_", "").to_sym
|
|
40
|
+
Primer::ViewHelper::HELPERS[helper_key]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def extract_arguments(node, name)
|
|
44
|
+
args = node.arguments
|
|
45
|
+
res = {}
|
|
46
|
+
|
|
47
|
+
return res if args.empty?
|
|
48
|
+
|
|
49
|
+
kwargs = args.last
|
|
50
|
+
if kwargs.respond_to?(:pairs)
|
|
51
|
+
res = kwargs.pairs.each_with_object({}) do |pair, h|
|
|
52
|
+
h.merge!(extract_values(pair))
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Octicon is the only component that accepts positional arguments.
|
|
57
|
+
res[:icon] = args.first.source if name == "Primer::OcticonComponent" && args.size > 1
|
|
58
|
+
|
|
59
|
+
res
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def extract_values(pair)
|
|
63
|
+
return { pair.key.value => pair.value.source } unless pair.value.type == :hash
|
|
64
|
+
|
|
65
|
+
flatten_pairs(pair, prefix: "#{pair.key.value}-")
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def flatten_pairs(pair, prefix: "")
|
|
69
|
+
pair.value.pairs.each_with_object({}) do |value_pair, h|
|
|
70
|
+
if value_pair.value.type == :hash
|
|
71
|
+
h.merge!(flatten_pairs(value_pair, prefix: "#{prefix}#{value_pair.key.value}-"))
|
|
72
|
+
else
|
|
73
|
+
h.merge!("#{prefix}#{value_pair.key.value}" => value_pair.value.source)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
ERB_GLOB = "**/*.html{+*,}.erb"
|
|
4
|
+
RB_GLOB = "**/*.rb"
|
|
5
|
+
BLOCK_EXPR = /\s*((\s+|\))do|\{)(\s*\|[^|]*\|)?\s*\Z/.freeze # copied from Rails: action_view/template/handlers/erb/erubi.rb
|
|
6
|
+
|
|
7
|
+
namespace :primer_view_components do
|
|
8
|
+
desc "Report arguments used in each component"
|
|
9
|
+
task :report, [:paths] do |_, args|
|
|
10
|
+
require "rubocop"
|
|
11
|
+
require "better_html"
|
|
12
|
+
require "better_html/parser"
|
|
13
|
+
require "erb_lint/processed_source"
|
|
14
|
+
require_relative "helpers/ast_processor"
|
|
15
|
+
|
|
16
|
+
paths = args[:paths].split
|
|
17
|
+
stats = {}
|
|
18
|
+
|
|
19
|
+
rb_files = paths.reduce([]) { |mem, path| mem + Dir[File.join(path, RB_GLOB)] }
|
|
20
|
+
|
|
21
|
+
rb_files.each do |f|
|
|
22
|
+
ast = RuboCop::AST::ProcessedSource.from_file(f, RUBY_VERSION.to_f).ast
|
|
23
|
+
AstProcessor.process_ast(ast, stats)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
erb_files = paths.reduce([]) { |mem, path| mem + Dir[File.join(path, ERB_GLOB)] }
|
|
27
|
+
|
|
28
|
+
erb_files.each do |f|
|
|
29
|
+
erb_ast = ERBLint::ProcessedSource.new(f, File.read(f)).ast
|
|
30
|
+
|
|
31
|
+
erb_ast.descendants(:erb).each do |erb_node|
|
|
32
|
+
indicator, _, code_node, = *erb_node
|
|
33
|
+
|
|
34
|
+
next if indicator&.children&.first == "#" # don't analyze comments
|
|
35
|
+
|
|
36
|
+
trimmed_source = code_node.loc.source.sub(BLOCK_EXPR, "").strip
|
|
37
|
+
ast = RuboCop::AST::ProcessedSource.new(trimmed_source, RUBY_VERSION.to_f).ast
|
|
38
|
+
AstProcessor.process_ast(ast, stats)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
File.open(".primer-view-components-report.json", "w") do |f|
|
|
43
|
+
f.write(JSON.pretty_generate(stats))
|
|
44
|
+
f.write($INPUT_RECORD_SEPARATOR)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
namespace :
|
|
3
|
+
namespace :static do
|
|
4
4
|
task :dump do
|
|
5
|
+
ENV["SKIP_STORYBOOK_PRELOAD"] = "1"
|
|
5
6
|
require File.expand_path("./../../demo/config/environment.rb", __dir__)
|
|
6
7
|
require "primer/view_components"
|
|
7
8
|
# Loads all components for `.descendants` to work properly
|
|
8
9
|
Dir["./app/components/primer/**/*.rb"].sort.each { |file| require file }
|
|
9
10
|
|
|
10
|
-
Primer::ViewComponents.
|
|
11
|
+
Primer::ViewComponents.dump(:statuses)
|
|
12
|
+
Primer::ViewComponents.dump(:constants)
|
|
13
|
+
Primer::ViewComponents.dump(:audited_at)
|
|
11
14
|
end
|
|
12
15
|
end
|
data/lib/tasks/utilities.rake
CHANGED
|
@@ -9,43 +9,56 @@ namespace :utilities do
|
|
|
9
9
|
|
|
10
10
|
# Keys that are looked for to be included in the utilities.yml file
|
|
11
11
|
# rubocop:disable Lint/ConstantDefinitionInBlock
|
|
12
|
-
SUPPORTED_KEYS =
|
|
13
|
-
anim
|
|
14
|
-
color-bg
|
|
15
|
-
color-border
|
|
16
|
-
color-icon
|
|
17
|
-
color-text
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
SUPPORTED_KEYS = [
|
|
13
|
+
/^anim\b/,
|
|
14
|
+
/^color-bg\b/,
|
|
15
|
+
/^color-border\b/,
|
|
16
|
+
/^color-icon\b/,
|
|
17
|
+
/^color-text\b/,
|
|
18
|
+
/^color-fg\b/,
|
|
19
|
+
/^col\b/,
|
|
20
|
+
/^container\b/,
|
|
21
|
+
/^clearfix\b/,
|
|
22
|
+
/^d\b/,
|
|
23
|
+
/^float\b/,
|
|
24
|
+
/^height\b/,
|
|
25
|
+
/^hide\b/,
|
|
26
|
+
/^m[trblxy]?\b/,
|
|
27
|
+
/^p[trblxy]?\b/,
|
|
28
|
+
/^position\b/,
|
|
29
|
+
/^wb\b/,
|
|
30
|
+
/^width\b/,
|
|
31
|
+
/^v\b/
|
|
28
32
|
].freeze
|
|
29
33
|
|
|
30
34
|
BREAKPOINTS = [nil, "sm", "md", "lg", "xl"].freeze
|
|
31
35
|
# rubocop:enable Lint/ConstantDefinitionInBlock
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
utility_data =
|
|
34
38
|
JSON.parse(
|
|
35
39
|
File.read(
|
|
36
|
-
File.join(
|
|
37
|
-
__FILE__.split("lib/tasks/utilities.rake")[0], "/node_modules/@primer/css/dist/stats/utilities.json"
|
|
38
|
-
)
|
|
40
|
+
File.expand_path(File.join(*%w[.. .. node_modules @primer css dist stats utilities.json]), __dir__)
|
|
39
41
|
)
|
|
40
42
|
)["selectors"]["values"]
|
|
41
43
|
|
|
44
|
+
layout_data =
|
|
45
|
+
JSON.parse(
|
|
46
|
+
File.read(
|
|
47
|
+
File.expand_path(File.join(*%w[.. .. node_modules @primer css dist stats layout.json]), __dir__)
|
|
48
|
+
)
|
|
49
|
+
)["selectors"]["values"]
|
|
50
|
+
|
|
51
|
+
css_data = utility_data + layout_data
|
|
52
|
+
|
|
42
53
|
output = {}
|
|
43
54
|
|
|
44
55
|
css_data.each do |selector|
|
|
45
56
|
selector.sub!(/^./, "")
|
|
57
|
+
selector.sub!(/:[^\s]*$/, "")
|
|
58
|
+
|
|
46
59
|
# Next if selector has ancestors or sibling selectors
|
|
47
60
|
next if selector.match?(/[:><~\[.]/)
|
|
48
|
-
next unless SUPPORTED_KEYS.any? { |key| selector
|
|
61
|
+
next unless SUPPORTED_KEYS.any? { |key| selector =~ key }
|
|
49
62
|
|
|
50
63
|
# Dupe so we still have the selector at the end of slicing it up
|
|
51
64
|
classname = selector.dup
|
|
@@ -77,13 +90,14 @@ namespace :utilities do
|
|
|
77
90
|
# convert padding/margin negative values ie n7 to -7
|
|
78
91
|
classname.sub!(/^n/, "-") if classname.match?(/^n[0-9]/)
|
|
79
92
|
|
|
93
|
+
# If key and classname are equal, then classname is boolean
|
|
94
|
+
classname = true if key == classname
|
|
95
|
+
|
|
80
96
|
key = key.to_sym
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
classname.to_sym
|
|
86
|
-
end
|
|
98
|
+
if classname.is_a?(String)
|
|
99
|
+
classname = classname.match?(/\A[-+]?[0-9]+\z/) ? classname.to_i : classname.to_sym
|
|
100
|
+
end
|
|
87
101
|
|
|
88
102
|
if output[key].nil?
|
|
89
103
|
output[key] = { classname => Array.new(5, nil) }
|
data/static/arguments.yml
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
+
- component: BorderBoxHeader
|
|
3
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/border_box/header.rb
|
|
4
|
+
parameters:
|
|
5
|
+
- name: system_arguments
|
|
6
|
+
type: Hash
|
|
7
|
+
default: N/A
|
|
8
|
+
description: "[System arguments](/system-arguments)"
|
|
2
9
|
- component: ButtonMarketing
|
|
3
10
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/button_marketing.rb
|
|
4
11
|
parameters:
|
|
@@ -90,6 +97,30 @@
|
|
|
90
97
|
type: Hash
|
|
91
98
|
default: N/A
|
|
92
99
|
description: "[System arguments](/system-arguments)"
|
|
100
|
+
- component: UnderlinePanels
|
|
101
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/underline_panels.rb
|
|
102
|
+
parameters:
|
|
103
|
+
- name: label
|
|
104
|
+
type: String
|
|
105
|
+
default: N/A
|
|
106
|
+
description: Sets an `aria-label` that helps assistive technology users understand
|
|
107
|
+
the purpose of the tabs.
|
|
108
|
+
- name: align
|
|
109
|
+
type: Symbol
|
|
110
|
+
default: "`:left`"
|
|
111
|
+
description: One of `:left` and `:right`. - Defaults to left
|
|
112
|
+
- name: body_arguments
|
|
113
|
+
type: Hash
|
|
114
|
+
default: "`{}`"
|
|
115
|
+
description: "[System arguments](/system-arguments) for the body wrapper."
|
|
116
|
+
- name: wrapper_arguments
|
|
117
|
+
type: Hash
|
|
118
|
+
default: "`{}`"
|
|
119
|
+
description: "[System arguments](/system-arguments) for the `TabContainer` wrapper."
|
|
120
|
+
- name: system_arguments
|
|
121
|
+
type: Hash
|
|
122
|
+
default: N/A
|
|
123
|
+
description: "[System arguments](/system-arguments)"
|
|
93
124
|
- component: BaseButton
|
|
94
125
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/base_button.rb
|
|
95
126
|
parameters:
|
|
@@ -161,11 +192,11 @@
|
|
|
161
192
|
- name: size
|
|
162
193
|
type: Integer
|
|
163
194
|
default: "`20`"
|
|
164
|
-
description:
|
|
165
|
-
- name:
|
|
166
|
-
type:
|
|
167
|
-
default: "`
|
|
168
|
-
description:
|
|
195
|
+
description: One of `16`, `20`, `24`, `32`, `40`, `48`, or `80`.
|
|
196
|
+
- name: shape
|
|
197
|
+
type: Symbol
|
|
198
|
+
default: "`:circle`"
|
|
199
|
+
description: Shape of the avatar. One of `:circle` and `:square`.
|
|
169
200
|
- name: href
|
|
170
201
|
type: String
|
|
171
202
|
default: "`nil`"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Primer::Alpha::BorderBox::Header": "",
|
|
3
|
+
"Primer::Alpha::ButtonMarketing": "",
|
|
4
|
+
"Primer::Alpha::TabNav": "",
|
|
5
|
+
"Primer::Alpha::TabPanels": "",
|
|
6
|
+
"Primer::Alpha::UnderlineNav": "",
|
|
7
|
+
"Primer::Alpha::UnderlinePanels": "",
|
|
8
|
+
"Primer::BaseButton": "",
|
|
9
|
+
"Primer::BaseComponent": "",
|
|
10
|
+
"Primer::Beta::AutoComplete": "",
|
|
11
|
+
"Primer::Beta::AutoComplete::Input": "",
|
|
12
|
+
"Primer::Beta::AutoComplete::Item": "",
|
|
13
|
+
"Primer::Beta::Avatar": "",
|
|
14
|
+
"Primer::Beta::AvatarStack": "",
|
|
15
|
+
"Primer::Beta::Breadcrumbs": "",
|
|
16
|
+
"Primer::Beta::Breadcrumbs::Item": "",
|
|
17
|
+
"Primer::Beta::Text": "",
|
|
18
|
+
"Primer::Beta::Truncate": "",
|
|
19
|
+
"Primer::Beta::Truncate::TruncateText": "",
|
|
20
|
+
"Primer::BlankslateComponent": "",
|
|
21
|
+
"Primer::BorderBoxComponent": "",
|
|
22
|
+
"Primer::BoxComponent": "",
|
|
23
|
+
"Primer::ButtonComponent": "",
|
|
24
|
+
"Primer::ButtonGroup": "",
|
|
25
|
+
"Primer::ClipboardCopy": "",
|
|
26
|
+
"Primer::CloseButton": "",
|
|
27
|
+
"Primer::CounterComponent": "",
|
|
28
|
+
"Primer::DetailsComponent": "",
|
|
29
|
+
"Primer::Dropdown": "",
|
|
30
|
+
"Primer::Dropdown::Menu": "",
|
|
31
|
+
"Primer::Dropdown::Menu::Item": "",
|
|
32
|
+
"Primer::DropdownMenuComponent": "",
|
|
33
|
+
"Primer::FlashComponent": "",
|
|
34
|
+
"Primer::FlexComponent": "",
|
|
35
|
+
"Primer::FlexItemComponent": "",
|
|
36
|
+
"Primer::HeadingComponent": "",
|
|
37
|
+
"Primer::HiddenTextExpander": "",
|
|
38
|
+
"Primer::IconButton": "",
|
|
39
|
+
"Primer::Image": "",
|
|
40
|
+
"Primer::ImageCrop": "",
|
|
41
|
+
"Primer::LabelComponent": "",
|
|
42
|
+
"Primer::LayoutComponent": "",
|
|
43
|
+
"Primer::LinkComponent": "",
|
|
44
|
+
"Primer::LocalTime": "",
|
|
45
|
+
"Primer::Markdown": "",
|
|
46
|
+
"Primer::MenuComponent": "",
|
|
47
|
+
"Primer::Navigation::TabComponent": "",
|
|
48
|
+
"Primer::OcticonComponent": "",
|
|
49
|
+
"Primer::OcticonSymbolsComponent": "",
|
|
50
|
+
"Primer::PopoverComponent": "",
|
|
51
|
+
"Primer::ProgressBarComponent": "",
|
|
52
|
+
"Primer::SpinnerComponent": "",
|
|
53
|
+
"Primer::StateComponent": "",
|
|
54
|
+
"Primer::SubheadComponent": "",
|
|
55
|
+
"Primer::TabContainerComponent": "",
|
|
56
|
+
"Primer::TimeAgoComponent": "",
|
|
57
|
+
"Primer::TimelineItemComponent": "",
|
|
58
|
+
"Primer::TimelineItemComponent::BadgeComponent": "",
|
|
59
|
+
"Primer::Tooltip": "",
|
|
60
|
+
"Primer::Truncate": ""
|
|
61
|
+
}
|
data/static/classes.yml
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- ".Box-row--blue"
|
|
14
14
|
- ".Box-row--gray"
|
|
15
15
|
- ".Box-row--yellow"
|
|
16
|
+
- ".Box-title"
|
|
16
17
|
- ".BtnGroup"
|
|
17
18
|
- ".BtnGroup-item"
|
|
18
19
|
- ".Counter"
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
- ".color-bg-success-inverse"
|
|
106
107
|
- ".color-bg-tertiary"
|
|
107
108
|
- ".color-border-info"
|
|
109
|
+
- ".color-fg-success"
|
|
108
110
|
- ".color-icon-success"
|
|
109
111
|
- ".color-shadow-large"
|
|
110
112
|
- ".color-text-danger"
|
|
@@ -172,6 +174,7 @@
|
|
|
172
174
|
- ".pr-2"
|
|
173
175
|
- ".pt-5"
|
|
174
176
|
- ".right-0"
|
|
177
|
+
- ".sr-only"
|
|
175
178
|
- ".tabnav"
|
|
176
179
|
- ".tabnav-tab"
|
|
177
180
|
- ".tabnav-tabs"
|
data/static/constants.json
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Primer::Alpha::BorderBox::Header": {
|
|
3
|
+
"TITLE_TAG_FALLBACK": "h2",
|
|
4
|
+
"TITLE_TAG_OPTIONS": [
|
|
5
|
+
"h1",
|
|
6
|
+
"h2",
|
|
7
|
+
"h3",
|
|
8
|
+
"h4",
|
|
9
|
+
"h5",
|
|
10
|
+
"h6"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
2
13
|
"Primer::Alpha::ButtonMarketing": {
|
|
3
14
|
"DEFAULT_SCHEME": "default",
|
|
4
15
|
"DEFAULT_TAG": "button",
|
|
@@ -89,6 +100,21 @@
|
|
|
89
100
|
"Primer::Beta::AutoComplete::Item": {
|
|
90
101
|
},
|
|
91
102
|
"Primer::Beta::Avatar": {
|
|
103
|
+
"DEFAULT_SHAPE": "circle",
|
|
104
|
+
"DEFAULT_SIZE": 20,
|
|
105
|
+
"SHAPE_OPTIONS": [
|
|
106
|
+
"circle",
|
|
107
|
+
"square"
|
|
108
|
+
],
|
|
109
|
+
"SIZE_OPTIONS": [
|
|
110
|
+
16,
|
|
111
|
+
20,
|
|
112
|
+
24,
|
|
113
|
+
32,
|
|
114
|
+
40,
|
|
115
|
+
48,
|
|
116
|
+
80
|
|
117
|
+
],
|
|
92
118
|
"SMALL_THRESHOLD": 24
|
|
93
119
|
},
|
|
94
120
|
"Primer::Beta::AvatarStack": {
|
data/static/statuses.json
CHANGED
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.60
|
|
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-
|
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -106,14 +106,14 @@ dependencies:
|
|
|
106
106
|
requirements:
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version:
|
|
109
|
+
version: 4.2.0
|
|
110
110
|
type: :development
|
|
111
111
|
prerelease: false
|
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
113
|
requirements:
|
|
114
114
|
- - "~>"
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version:
|
|
116
|
+
version: 4.2.0
|
|
117
117
|
- !ruby/object:Gem::Dependency
|
|
118
118
|
name: benchmark-ips
|
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -378,6 +378,8 @@ files:
|
|
|
378
378
|
- README.md
|
|
379
379
|
- app/assets/javascripts/primer_view_components.js
|
|
380
380
|
- app/assets/javascripts/primer_view_components.js.map
|
|
381
|
+
- app/components/primer/alpha/border_box/header.html.erb
|
|
382
|
+
- app/components/primer/alpha/border_box/header.rb
|
|
381
383
|
- app/components/primer/alpha/button_marketing.rb
|
|
382
384
|
- app/components/primer/alpha/tab_nav.html.erb
|
|
383
385
|
- app/components/primer/alpha/tab_nav.rb
|
|
@@ -492,6 +494,7 @@ files:
|
|
|
492
494
|
- app/components/primer/timeline_item_component.rb
|
|
493
495
|
- app/components/primer/tooltip.rb
|
|
494
496
|
- app/components/primer/truncate.rb
|
|
497
|
+
- app/lib/primer/audited/dsl.rb
|
|
495
498
|
- app/lib/primer/class_name_helper.rb
|
|
496
499
|
- app/lib/primer/fetch_or_fallback_helper.rb
|
|
497
500
|
- app/lib/primer/join_style_arguments_helper.rb
|
|
@@ -505,7 +508,6 @@ files:
|
|
|
505
508
|
- lib/primer/classify.rb
|
|
506
509
|
- lib/primer/classify/cache.rb
|
|
507
510
|
- lib/primer/classify/flex.rb
|
|
508
|
-
- lib/primer/classify/grid.rb
|
|
509
511
|
- lib/primer/classify/utilities.rb
|
|
510
512
|
- lib/primer/classify/utilities.yml
|
|
511
513
|
- lib/primer/classify/validation.rb
|
|
@@ -524,12 +526,14 @@ files:
|
|
|
524
526
|
- lib/primer/view_components/linters/argument_mappers/system_arguments.rb
|
|
525
527
|
- lib/primer/view_components/linters/autocorrectable.rb
|
|
526
528
|
- lib/primer/view_components/linters/base_linter.rb
|
|
529
|
+
- lib/primer/view_components/linters/blankslate_component_migration_counter.rb
|
|
527
530
|
- lib/primer/view_components/linters/breadcrumbs_component_migration_counter.rb
|
|
528
531
|
- lib/primer/view_components/linters/button_component_migration_counter.rb
|
|
529
532
|
- lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
|
|
530
533
|
- lib/primer/view_components/linters/close_button_component_migration_counter.rb
|
|
531
534
|
- lib/primer/view_components/linters/flash_component_migration_counter.rb
|
|
532
535
|
- lib/primer/view_components/linters/label_component_migration_counter.rb
|
|
536
|
+
- lib/primer/view_components/linters/subhead_component_migration_counter.rb
|
|
533
537
|
- lib/primer/view_components/statuses.rb
|
|
534
538
|
- lib/primer/view_components/version.rb
|
|
535
539
|
- lib/rubocop/config/default.yml
|
|
@@ -539,16 +543,19 @@ files:
|
|
|
539
543
|
- lib/rubocop/cop/primer/no_tag_memoize.rb
|
|
540
544
|
- lib/rubocop/cop/primer/primer_octicon.rb
|
|
541
545
|
- lib/rubocop/cop/primer/system_argument_instead_of_class.rb
|
|
542
|
-
- lib/tasks/constants.rake
|
|
543
546
|
- lib/tasks/coverage.rake
|
|
544
547
|
- lib/tasks/docs.rake
|
|
545
|
-
- lib/tasks/
|
|
548
|
+
- lib/tasks/helpers/ast_processor.rb
|
|
549
|
+
- lib/tasks/helpers/ast_traverser.rb
|
|
550
|
+
- lib/tasks/primer_view_components.rake
|
|
551
|
+
- lib/tasks/static.rake
|
|
546
552
|
- lib/tasks/utilities.rake
|
|
547
553
|
- lib/yard/docs_helper.rb
|
|
548
554
|
- lib/yard/renders_many_handler.rb
|
|
549
555
|
- lib/yard/renders_one_handler.rb
|
|
550
556
|
- static/arguments.yml
|
|
551
557
|
- static/assets/view-components.svg
|
|
558
|
+
- static/audited_at.json
|
|
552
559
|
- static/classes.yml
|
|
553
560
|
- static/constants.json
|
|
554
561
|
- static/statuses.json
|
data/lib/primer/classify/grid.rb
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Primer
|
|
4
|
-
class Classify
|
|
5
|
-
# Handler for PrimerCSS grid classes.
|
|
6
|
-
class Grid
|
|
7
|
-
extend Primer::FetchOrFallbackHelper
|
|
8
|
-
|
|
9
|
-
CONTAINER_KEY = :container
|
|
10
|
-
CONTAINER_VALUES = [:xl, :lg, :md, :sm].freeze
|
|
11
|
-
|
|
12
|
-
CLEARFIX_KEY = :clearfix
|
|
13
|
-
CLEARFIX_VALUES = [true, false].freeze
|
|
14
|
-
|
|
15
|
-
COL_KEY = :col
|
|
16
|
-
COL_VALUES = (1..12).to_a.freeze
|
|
17
|
-
|
|
18
|
-
KEYS = [CONTAINER_KEY, CLEARFIX_KEY, COL_KEY].freeze
|
|
19
|
-
|
|
20
|
-
class << self
|
|
21
|
-
def classes(key, value, breakpoint)
|
|
22
|
-
send(key, value, breakpoint)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
private
|
|
26
|
-
|
|
27
|
-
def container(value, _breakpoint)
|
|
28
|
-
val = fetch_or_fallback(CONTAINER_VALUES, value)
|
|
29
|
-
|
|
30
|
-
"container-#{val}"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def clearfix(value, _breakpoint)
|
|
34
|
-
"clearfix" if fetch_or_fallback(CLEARFIX_VALUES, value)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def col(value, breakpoint)
|
|
38
|
-
val = fetch_or_fallback(COL_VALUES, value.to_i)
|
|
39
|
-
|
|
40
|
-
"col#{breakpoint}-#{val}"
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
data/lib/tasks/statuses.rake
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
namespace :statuses do
|
|
4
|
-
task :dump do
|
|
5
|
-
require File.expand_path("./../../demo/config/environment.rb", __dir__)
|
|
6
|
-
require "primer/view_components"
|
|
7
|
-
# Loads all components for `.descendants` to work properly
|
|
8
|
-
Dir["./app/components/primer/**/*.rb"].sort.each { |file| require file }
|
|
9
|
-
|
|
10
|
-
Primer::ViewComponents.dump_statuses
|
|
11
|
-
end
|
|
12
|
-
end
|