primer_view_components 0.0.67 → 0.0.68
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 +45 -1
- data/README.md +1 -1
- data/app/components/primer/beta/auto_complete/auto_complete.html.erb +11 -3
- data/app/components/primer/beta/auto_complete.rb +20 -95
- data/app/components/primer/beta/blankslate.html.erb +6 -2
- data/app/components/primer/beta/blankslate.rb +4 -9
- data/app/components/primer/popover_component.rb +5 -9
- data/app/components/primer/tooltip.rb +1 -1
- data/app/lib/primer/test_selector_helper.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +35 -0
- data/lib/tasks/docs.rake +3 -2
- data/static/arguments.yml +9 -0
- data/static/audited_at.json +0 -1
- data/static/classes.yml +4 -4
- data/static/constants.json +0 -8
- data/static/statuses.json +1 -2
- metadata +4 -5
- data/app/components/primer/auto_complete/auto_complete.d.ts +0 -1
- data/app/components/primer/auto_complete/auto_complete.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 537c5d2b6d37e3cfc2493426db201a7ea7268a00b3e5b06536d49956ad25658f
|
|
4
|
+
data.tar.gz: a8aa51d217947855498867c2e18e0ad8d34ee5c9dd565170544e3deeec63a25f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5965f3012b7407029185f7698020c0207d9541dcc8fe78e93fabf207de062eba38358f00c3c270189ee2811ace542f97941e2b6e4f96d77f05c33da23af9098
|
|
7
|
+
data.tar.gz: 63b806a174ea5f35c89d2e5568781c010e307680b8bee36bb4de835b77cea5cc82c816bbfdd03d2b0ec283f47b23c8c351c9ef552a691dcd42097964bc88fa88
|
data/CHANGELOG.md
CHANGED
|
@@ -30,7 +30,51 @@ The category for changes related to documentation, testing and tooling. Also, fo
|
|
|
30
30
|
|
|
31
31
|
## main
|
|
32
32
|
|
|
33
|
-
## 0.0.
|
|
33
|
+
## 0.0.68
|
|
34
|
+
|
|
35
|
+
### Updates
|
|
36
|
+
|
|
37
|
+
- Add accessible labels to Search AutoComplete when provided with an icon.
|
|
38
|
+
|
|
39
|
+
_Andri Alexandrou_
|
|
40
|
+
|
|
41
|
+
- Restricts children for AutoComplete API to prevent accessibility violations and misuse
|
|
42
|
+
|
|
43
|
+
_Lindsey Wild_
|
|
44
|
+
|
|
45
|
+
- Migrate from Heroku to Azure for the Rails storybook server.
|
|
46
|
+
|
|
47
|
+
_Cameron Dutro_
|
|
48
|
+
|
|
49
|
+
- Remove CSS utilities from Blankslate
|
|
50
|
+
|
|
51
|
+
_Hector Garcia_
|
|
52
|
+
|
|
53
|
+
- Improve last example on the PopoverComponent docs
|
|
54
|
+
|
|
55
|
+
_Hector Garcia_
|
|
56
|
+
|
|
57
|
+
### Bug Fixes
|
|
58
|
+
|
|
59
|
+
- Fix live reloading during local docs development.
|
|
60
|
+
|
|
61
|
+
_Cameron Dutro_
|
|
62
|
+
|
|
63
|
+
### Deprecations
|
|
64
|
+
|
|
65
|
+
- Deprecate `Tooltip` component.
|
|
66
|
+
|
|
67
|
+
_Kate Higa_
|
|
68
|
+
|
|
69
|
+
### Misc
|
|
70
|
+
|
|
71
|
+
- Updates README with missing `alt` attribute on image
|
|
72
|
+
|
|
73
|
+
_Kate Higa_
|
|
74
|
+
|
|
75
|
+
- Updates contributing docs
|
|
76
|
+
|
|
77
|
+
_Lindsey Wild_
|
|
34
78
|
|
|
35
79
|
## 0.0.67
|
|
36
80
|
|
data/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
<%= label %>
|
|
2
1
|
<%= render Primer::BaseComponent.new(**@system_arguments) do %>
|
|
3
|
-
<%=
|
|
4
|
-
|
|
2
|
+
<label for="<%= @input_id %>">
|
|
3
|
+
<% if @is_label_visible %>
|
|
4
|
+
<%= @label_text %>
|
|
5
|
+
<% else %>
|
|
6
|
+
<span class="sr-only"><%= @label_text %></span>
|
|
7
|
+
<% end %>
|
|
8
|
+
<% if icon.present? %>
|
|
9
|
+
<%= icon %>
|
|
10
|
+
<% end %>
|
|
11
|
+
</label>
|
|
12
|
+
<input id="<%= @input_id %>" name="<%= @input_id %>" type="text" class="form-control" autocomplete="off">
|
|
5
13
|
<%= results %>
|
|
6
14
|
<% end %>
|
|
@@ -7,41 +7,14 @@ module Primer
|
|
|
7
7
|
# @accessibility
|
|
8
8
|
# Always set an accessible label to help the user interact with the component.
|
|
9
9
|
#
|
|
10
|
-
# *
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
# always be used unless there is compelling reason not to. A placeholder is not a label.
|
|
10
|
+
# * `label_text` is required and visible by default.
|
|
11
|
+
# * If you must use a non-visible label, set `is_label_visible` to `false`.
|
|
12
|
+
# However, please note that a visible label should almost always
|
|
13
|
+
# be used unless there is compelling reason not to. A placeholder is not a label.
|
|
15
14
|
class AutoComplete < Primer::Component
|
|
16
15
|
status :beta
|
|
17
16
|
|
|
18
|
-
# Optionally render a visible label. See <%= link_to_accessibility %>
|
|
19
|
-
#
|
|
20
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
21
|
-
renders_one :label, lambda { |**system_arguments|
|
|
22
|
-
deny_tag_argument(**system_arguments)
|
|
23
|
-
system_arguments[:for] = @input_id
|
|
24
|
-
system_arguments[:tag] = :label
|
|
25
|
-
Primer::BaseComponent.new(**system_arguments)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
# Required input used to search for results
|
|
29
|
-
#
|
|
30
|
-
# @param type [Symbol] <%= one_of(Primer::Beta::AutoComplete::Input::TYPE_OPTIONS) %>
|
|
31
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
32
|
-
renders_one :input, lambda { |**system_arguments|
|
|
33
|
-
aria_label = aria("label", system_arguments) || @aria_label
|
|
34
|
-
if aria_label.present?
|
|
35
|
-
system_arguments[:"aria-label"] = aria_label
|
|
36
|
-
system_arguments[:aria]&.delete(:label)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
name = system_arguments[:name] || @input_id
|
|
40
|
-
Input.new(id: @input_id, name: name, **system_arguments)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
17
|
# Optional icon to be rendered before the input. Has the same arguments as <%= link_to_component(Primer::OcticonComponent) %>.
|
|
44
|
-
#
|
|
45
18
|
renders_one :icon, Primer::OcticonComponent
|
|
46
19
|
|
|
47
20
|
# Customizable results list.
|
|
@@ -56,34 +29,17 @@ module Primer
|
|
|
56
29
|
system_arguments[:classes]
|
|
57
30
|
)
|
|
58
31
|
|
|
59
|
-
aria_label = system_arguments[:"aria-label"] || system_arguments.dig(:aria, :label) || @aria_label
|
|
60
|
-
system_arguments[:"aria-label"] = aria_label if aria_label.present?
|
|
61
|
-
system_arguments[:aria]&.delete(:label)
|
|
62
|
-
|
|
63
32
|
Primer::BaseComponent.new(**system_arguments)
|
|
64
33
|
}
|
|
65
34
|
|
|
66
35
|
# @example Default
|
|
67
|
-
# <%= render(Primer::Beta::AutoComplete.new(src: "/auto_complete", input_id: "fruits-input-1", list_id: "fruits-popup-1", position: :relative))
|
|
68
|
-
# <% c.label(classes:"").with_content("Fruits") %>
|
|
69
|
-
# <% c.input(type: :text) %>
|
|
70
|
-
# <% end %>
|
|
36
|
+
# <%= render(Primer::Beta::AutoComplete.new(label_text: "Fruits", src: "/auto_complete", input_id: "fruits-input-1", list_id: "fruits-popup-1", position: :relative)) %>
|
|
71
37
|
#
|
|
72
|
-
# @example With
|
|
73
|
-
# <%= render(Primer::Beta::AutoComplete.new(
|
|
74
|
-
# <% c.input(type: :text) %>
|
|
75
|
-
# <% end %>
|
|
76
|
-
#
|
|
77
|
-
# @example With `aria-labelledby`
|
|
78
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h2, id: "search-1")) { "Search" } %>
|
|
79
|
-
# <%= render(Primer::Beta::AutoComplete.new(src: "/auto_complete", input_id: "fruits-input-3", list_id: "fruits-popup-2", position: :relative)) do |c| %>
|
|
80
|
-
# <% c.input("aria-labelledby": "search-1") %>
|
|
81
|
-
# <% end %>
|
|
38
|
+
# @example With Non-Visible Label
|
|
39
|
+
# <%= render(Primer::Beta::AutoComplete.new(label_text: "Fruits", src: "/auto_complete", input_id: "fruits-input-2", list_id: "fruits-popup-2", is_label_visible: false, position: :relative)) %>
|
|
82
40
|
#
|
|
83
|
-
# @example With
|
|
84
|
-
# <%= render(Primer::Beta::AutoComplete.new(src: "/auto_complete", input_id: "fruits-input-
|
|
85
|
-
# <% c.label(classes:"").with_content("Fruits") %>
|
|
86
|
-
# <% c.input(type: :text) %>
|
|
41
|
+
# @example With Custom Classes for the Results
|
|
42
|
+
# <%= render(Primer::Beta::AutoComplete.new(label_text: "Fruits", src: "/auto_complete", input_id: "fruits-input-3", list_id: "fruits-popup-3", position: :relative)) do |c| %>
|
|
87
43
|
# <% c.results(classes: "custom-class") do %>
|
|
88
44
|
# <%= render(Primer::Beta::AutoComplete::Item.new(selected: true, value: "apple")) do |c| %>
|
|
89
45
|
# Apple
|
|
@@ -95,22 +51,25 @@ module Primer
|
|
|
95
51
|
# <% end %>
|
|
96
52
|
#
|
|
97
53
|
# @example With Icon
|
|
98
|
-
# <%= render(Primer::Beta::AutoComplete.new(src: "/auto_complete", list_id: "fruits-popup-4", input_id: "fruits-input-4", position: :relative)) do |c| %>
|
|
99
|
-
# <% c.label(classes:"").with_content("Fruits") %>
|
|
100
|
-
# <% c.input(type: :text) %>
|
|
54
|
+
# <%= render(Primer::Beta::AutoComplete.new(label_text: "Fruits", src: "/auto_complete", list_id: "fruits-popup-4", input_id: "fruits-input-4", position: :relative)) do |c| %>
|
|
101
55
|
# <% c.icon(icon: :search) %>
|
|
102
56
|
# <% end %>
|
|
103
57
|
#
|
|
58
|
+
# @example With Icon and Non-Visible Label
|
|
59
|
+
# <%= render(Primer::Beta::AutoComplete.new(label_text: "Fruits", src: "/auto_complete", list_id: "fruits-popup-5", input_id: "fruits-input-5", is_label_visible: false, position: :relative)) do |c| %>
|
|
60
|
+
# <% c.icon(icon: :search) %>
|
|
61
|
+
# <% end %>
|
|
62
|
+
# @param label_text [String] The label of the input.
|
|
104
63
|
# @param src [String] The route to query.
|
|
105
64
|
# @param input_id [String] Id of the input element.
|
|
106
65
|
# @param list_id [String] Id of the list element.
|
|
66
|
+
# @param is_label_visible [Boolean] Controls if the label is visible. If `false`, screen reader only text will be added.
|
|
107
67
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
108
|
-
def initialize(src:, list_id:, input_id:, **system_arguments)
|
|
68
|
+
def initialize(label_text:, src:, list_id:, input_id:, is_label_visible: true, **system_arguments)
|
|
69
|
+
@label_text = label_text
|
|
109
70
|
@list_id = list_id
|
|
110
71
|
@input_id = input_id
|
|
111
|
-
@
|
|
112
|
-
|
|
113
|
-
system_arguments.delete(:"aria-label") && system_arguments[:aria]&.delete(:label)
|
|
72
|
+
@is_label_visible = is_label_visible
|
|
114
73
|
|
|
115
74
|
@system_arguments = deny_tag_argument(**system_arguments)
|
|
116
75
|
@system_arguments[:tag] = "auto-complete"
|
|
@@ -118,44 +77,10 @@ module Primer
|
|
|
118
77
|
@system_arguments[:for] = list_id
|
|
119
78
|
end
|
|
120
79
|
|
|
121
|
-
# add `results` without needing to explicitly call
|
|
80
|
+
# add `results` without needing to explicitly call them in the view
|
|
122
81
|
def before_render
|
|
123
|
-
raise ArgumentError, "Missing `input` slot" if input.blank?
|
|
124
|
-
raise ArgumentError, "Accessible label is required." if label.blank? && input.missing_label?
|
|
125
|
-
|
|
126
82
|
results(classes: "") unless results
|
|
127
83
|
end
|
|
128
|
-
|
|
129
|
-
# This component is part of `Primer::Beta::AutoCompleteComponent` and should not be
|
|
130
|
-
# used as a standalone component.
|
|
131
|
-
class Input < Primer::Component
|
|
132
|
-
DEFAULT_TYPE = :text
|
|
133
|
-
TYPE_OPTIONS = [DEFAULT_TYPE, :search].freeze
|
|
134
|
-
|
|
135
|
-
# @param type [Symbol] <%= one_of(Primer::Beta::AutoComplete::Input::TYPE_OPTIONS) %>
|
|
136
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
137
|
-
def initialize(type: DEFAULT_TYPE, **system_arguments)
|
|
138
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
|
139
|
-
@system_arguments[:tag] = :input
|
|
140
|
-
|
|
141
|
-
@aria_label = system_arguments[:"aria-label"]
|
|
142
|
-
@aria_labelledby = system_arguments[:"aria-labelledby"] || system_arguments.dig(:aria, :labelledby)
|
|
143
|
-
|
|
144
|
-
@system_arguments[:type] = fetch_or_fallback(TYPE_OPTIONS, type, DEFAULT_TYPE)
|
|
145
|
-
@system_arguments[:classes] = class_names(
|
|
146
|
-
"form-control",
|
|
147
|
-
system_arguments[:classes]
|
|
148
|
-
)
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
def missing_label?
|
|
152
|
-
@aria_label.blank? && @aria_labelledby.blank?
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
def call
|
|
156
|
-
render(Primer::BaseComponent.new(**@system_arguments))
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
84
|
end
|
|
160
85
|
end
|
|
161
86
|
end
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
<%= heading %>
|
|
6
6
|
<%= description %>
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
<% if primary_action.present? %>
|
|
9
|
+
<div class="blankslate-action">
|
|
10
|
+
<%= primary_action %>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
9
13
|
<% if secondary_action.present? %>
|
|
10
|
-
<div class="
|
|
14
|
+
<div class="blankslate-action">
|
|
11
15
|
<%= secondary_action %>
|
|
12
16
|
</div>
|
|
13
17
|
<% end %>
|
|
@@ -26,20 +26,19 @@ module Primer
|
|
|
26
26
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
27
27
|
renders_one :visual, types: {
|
|
28
28
|
icon: lambda { |**system_arguments|
|
|
29
|
-
system_arguments[:mb] = 3
|
|
30
29
|
system_arguments[:size] ||= :medium
|
|
31
30
|
system_arguments[:classes] = class_names("blankslate-icon", system_arguments[:classes])
|
|
32
31
|
|
|
33
32
|
Primer::OcticonComponent.new(**system_arguments)
|
|
34
33
|
},
|
|
35
34
|
spinner: lambda { |**system_arguments|
|
|
36
|
-
system_arguments[:
|
|
35
|
+
system_arguments[:classes] = class_names("blankslate-image", system_arguments[:classes])
|
|
37
36
|
|
|
38
37
|
Primer::SpinnerComponent.new(**system_arguments)
|
|
39
38
|
},
|
|
40
39
|
image: lambda { |**system_arguments|
|
|
41
|
-
system_arguments[:mb] = 3
|
|
42
40
|
system_arguments[:size] = "56x56"
|
|
41
|
+
system_arguments[:classes] = class_names("blankslate-image", system_arguments[:classes])
|
|
43
42
|
|
|
44
43
|
Primer::Image.new(**system_arguments)
|
|
45
44
|
}
|
|
@@ -52,8 +51,7 @@ module Primer
|
|
|
52
51
|
renders_one :heading, lambda { |tag:, **system_arguments|
|
|
53
52
|
deny_tag_argument(**system_arguments)
|
|
54
53
|
system_arguments[:tag] = tag
|
|
55
|
-
system_arguments[:
|
|
56
|
-
system_arguments[:classes] = class_names("h2", system_arguments[:classes])
|
|
54
|
+
system_arguments[:classes] = class_names("blankslate-heading", system_arguments[:classes])
|
|
57
55
|
|
|
58
56
|
Primer::HeadingComponent.new(**system_arguments)
|
|
59
57
|
}
|
|
@@ -66,7 +64,7 @@ module Primer
|
|
|
66
64
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
67
65
|
renders_one :description, lambda { |**system_arguments|
|
|
68
66
|
deny_tag_argument(**system_arguments)
|
|
69
|
-
system_arguments[:tag] = :
|
|
67
|
+
system_arguments[:tag] = :p
|
|
70
68
|
|
|
71
69
|
Primer::BaseComponent.new(**system_arguments)
|
|
72
70
|
}
|
|
@@ -82,7 +80,6 @@ module Primer
|
|
|
82
80
|
deny_tag_argument(**system_arguments)
|
|
83
81
|
system_arguments[:tag] = :a
|
|
84
82
|
system_arguments[:href] = href
|
|
85
|
-
system_arguments[:mt] = 5
|
|
86
83
|
system_arguments[:size] = :medium
|
|
87
84
|
system_arguments[:scheme] ||= :primary
|
|
88
85
|
|
|
@@ -98,8 +95,6 @@ module Primer
|
|
|
98
95
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
99
96
|
renders_one :secondary_action, lambda { |href:, **system_arguments|
|
|
100
97
|
system_arguments[:href] = href
|
|
101
|
-
# Padding is needed to increase touch area.
|
|
102
|
-
system_arguments[:p] = 3
|
|
103
98
|
|
|
104
99
|
Primer::LinkComponent.new(**system_arguments)
|
|
105
100
|
}
|
|
@@ -88,20 +88,16 @@ module Primer
|
|
|
88
88
|
# <% end %>
|
|
89
89
|
# <% end %>
|
|
90
90
|
#
|
|
91
|
-
# @example With
|
|
91
|
+
# @example With multiple elements in the body
|
|
92
92
|
# <%= render Primer::PopoverComponent.new do |component| %>
|
|
93
93
|
# <% component.heading do %>
|
|
94
94
|
# Activity feed
|
|
95
95
|
# <% end %>
|
|
96
96
|
# <% component.body(caret: :left) do %>
|
|
97
|
-
# <p>
|
|
98
|
-
#
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
# <li>Thing #1</li>
|
|
102
|
-
# <li>Thing #2</li>
|
|
103
|
-
# </ul>
|
|
104
|
-
# </div>
|
|
97
|
+
# <p>This is the Popover body.</p>
|
|
98
|
+
# <%= render Primer::ButtonComponent.new(type: :submit) do %>
|
|
99
|
+
# Got it!
|
|
100
|
+
# <% end %>
|
|
105
101
|
# <% end %>
|
|
106
102
|
# <% end %>
|
|
107
103
|
#
|
|
@@ -4,7 +4,7 @@ module Primer
|
|
|
4
4
|
# Module to allow components to deal with the `test_selector` argument.
|
|
5
5
|
# It will only add the selector if env is not Production.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# test_selector: "foo" => data-test-selector="foo"
|
|
8
8
|
module TestSelectorHelper
|
|
9
9
|
TEST_SELECTOR_TAG = :test_selector
|
|
10
10
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rubocop"
|
|
4
|
+
|
|
5
|
+
# :nocov:
|
|
6
|
+
module RuboCop
|
|
7
|
+
module Cop
|
|
8
|
+
module Primer
|
|
9
|
+
# This cop ensures that components don't use deprecated component names
|
|
10
|
+
#
|
|
11
|
+
# bad
|
|
12
|
+
# Primer::ComponentNameComponent.new()
|
|
13
|
+
#
|
|
14
|
+
# good
|
|
15
|
+
# Primer::Beta::ComponentName.new()
|
|
16
|
+
class ComponentNameMigration < BaseCop
|
|
17
|
+
DEPRECATIONS = {
|
|
18
|
+
"Primer::TestComponent" => "Primer::Beta::Test"
|
|
19
|
+
}.freeze
|
|
20
|
+
|
|
21
|
+
def on_send(node)
|
|
22
|
+
return unless node.method_name == :new && !node.receiver.nil? && DEPRECATIONS.key?(node.receiver.const_name)
|
|
23
|
+
|
|
24
|
+
add_offense(node.receiver, message: "Don't use deprecated names")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def autocorrect(node)
|
|
28
|
+
lambda do |corrector|
|
|
29
|
+
corrector.replace(node, DEPRECATIONS[node.const_name])
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/tasks/docs.rake
CHANGED
|
@@ -106,7 +106,8 @@ namespace :docs do
|
|
|
106
106
|
errors = []
|
|
107
107
|
|
|
108
108
|
# Deletes docs before regenerating them, guaranteeing that we don't keep stale docs.
|
|
109
|
-
|
|
109
|
+
components_content_glob = File.join(*%w[docs content components ** *.md])
|
|
110
|
+
FileUtils.rm_rf(components_content_glob)
|
|
110
111
|
|
|
111
112
|
components.sort_by(&:name).each do |component|
|
|
112
113
|
documentation = registry.get(component.name)
|
|
@@ -114,7 +115,7 @@ namespace :docs do
|
|
|
114
115
|
data = docs_metadata(component)
|
|
115
116
|
|
|
116
117
|
path = Pathname.new(data[:path])
|
|
117
|
-
path.dirname.
|
|
118
|
+
path.dirname.mkpath unless path.dirname.exist?
|
|
118
119
|
File.open(path, "w") do |f|
|
|
119
120
|
f.puts("---")
|
|
120
121
|
f.puts("title: #{data[:title]}")
|
data/static/arguments.yml
CHANGED
|
@@ -165,6 +165,10 @@
|
|
|
165
165
|
- component: AutoComplete
|
|
166
166
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete.rb
|
|
167
167
|
parameters:
|
|
168
|
+
- name: label_text
|
|
169
|
+
type: String
|
|
170
|
+
default: N/A
|
|
171
|
+
description: The label of the input.
|
|
168
172
|
- name: src
|
|
169
173
|
type: String
|
|
170
174
|
default: N/A
|
|
@@ -177,6 +181,11 @@
|
|
|
177
181
|
type: String
|
|
178
182
|
default: N/A
|
|
179
183
|
description: Id of the list element.
|
|
184
|
+
- name: is_label_visible
|
|
185
|
+
type: Boolean
|
|
186
|
+
default: "`true`"
|
|
187
|
+
description: Controls if the label is visible. If `false`, screen reader only
|
|
188
|
+
text will be added.
|
|
180
189
|
- name: system_arguments
|
|
181
190
|
type: Hash
|
|
182
191
|
default: N/A
|
data/static/audited_at.json
CHANGED
data/static/classes.yml
CHANGED
|
@@ -88,7 +88,10 @@
|
|
|
88
88
|
- ".avatar-more"
|
|
89
89
|
- ".avatar-small"
|
|
90
90
|
- ".blankslate"
|
|
91
|
+
- ".blankslate-action"
|
|
92
|
+
- ".blankslate-heading"
|
|
91
93
|
- ".blankslate-icon"
|
|
94
|
+
- ".blankslate-image"
|
|
92
95
|
- ".blankslate-narrow"
|
|
93
96
|
- ".blankslate-spacious"
|
|
94
97
|
- ".border"
|
|
@@ -163,7 +166,6 @@
|
|
|
163
166
|
- ".form-control"
|
|
164
167
|
- ".gutter-condensed"
|
|
165
168
|
- ".gutter-lg"
|
|
166
|
-
- ".h2"
|
|
167
169
|
- ".hidden-text-expander"
|
|
168
170
|
- ".inline"
|
|
169
171
|
- ".left-0"
|
|
@@ -171,9 +173,7 @@
|
|
|
171
173
|
- ".list-style-none"
|
|
172
174
|
- ".markdown-body"
|
|
173
175
|
- ".mb-0"
|
|
174
|
-
- ".mb-1"
|
|
175
176
|
- ".mb-2"
|
|
176
|
-
- ".mb-3"
|
|
177
177
|
- ".menu"
|
|
178
178
|
- ".menu-heading"
|
|
179
179
|
- ".menu-item"
|
|
@@ -181,7 +181,6 @@
|
|
|
181
181
|
- ".mr-2"
|
|
182
182
|
- ".mr-n1"
|
|
183
183
|
- ".mt-2"
|
|
184
|
-
- ".mt-3"
|
|
185
184
|
- ".mt-5"
|
|
186
185
|
- ".mx-auto"
|
|
187
186
|
- ".no-underline"
|
|
@@ -194,6 +193,7 @@
|
|
|
194
193
|
- ".pr-2"
|
|
195
194
|
- ".pt-5"
|
|
196
195
|
- ".right-0"
|
|
196
|
+
- ".sr-only"
|
|
197
197
|
- ".tabnav"
|
|
198
198
|
- ".tabnav-tab"
|
|
199
199
|
- ".tabnav-tabs"
|
data/static/constants.json
CHANGED
|
@@ -181,16 +181,8 @@
|
|
|
181
181
|
]
|
|
182
182
|
},
|
|
183
183
|
"Primer::Beta::AutoComplete": {
|
|
184
|
-
"Input": "Primer::Beta::AutoComplete::Input",
|
|
185
184
|
"Item": "Primer::Beta::AutoComplete::Item"
|
|
186
185
|
},
|
|
187
|
-
"Primer::Beta::AutoComplete::Input": {
|
|
188
|
-
"DEFAULT_TYPE": "text",
|
|
189
|
-
"TYPE_OPTIONS": [
|
|
190
|
-
"text",
|
|
191
|
-
"search"
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
186
|
"Primer::Beta::AutoComplete::Item": {
|
|
195
187
|
},
|
|
196
188
|
"Primer::Beta::Avatar": {
|
data/static/statuses.json
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"Primer::BaseButton": "beta",
|
|
12
12
|
"Primer::BaseComponent": "beta",
|
|
13
13
|
"Primer::Beta::AutoComplete": "beta",
|
|
14
|
-
"Primer::Beta::AutoComplete::Input": "alpha",
|
|
15
14
|
"Primer::Beta::AutoComplete::Item": "beta",
|
|
16
15
|
"Primer::Beta::Avatar": "beta",
|
|
17
16
|
"Primer::Beta::AvatarStack": "beta",
|
|
@@ -62,6 +61,6 @@
|
|
|
62
61
|
"Primer::TimeAgoComponent": "beta",
|
|
63
62
|
"Primer::TimelineItemComponent": "beta",
|
|
64
63
|
"Primer::TimelineItemComponent::BadgeComponent": "alpha",
|
|
65
|
-
"Primer::Tooltip": "
|
|
64
|
+
"Primer::Tooltip": "deprecated",
|
|
66
65
|
"Primer::Truncate": "beta"
|
|
67
66
|
}
|
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.68
|
|
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-02-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -391,8 +391,6 @@ files:
|
|
|
391
391
|
- app/components/primer/alpha/underline_nav.rb
|
|
392
392
|
- app/components/primer/alpha/underline_panels.html.erb
|
|
393
393
|
- app/components/primer/alpha/underline_panels.rb
|
|
394
|
-
- app/components/primer/auto_complete/auto_complete.d.ts
|
|
395
|
-
- app/components/primer/auto_complete/auto_complete.js
|
|
396
394
|
- app/components/primer/base_button.rb
|
|
397
395
|
- app/components/primer/base_component.rb
|
|
398
396
|
- app/components/primer/beta/auto_complete.rb
|
|
@@ -545,6 +543,7 @@ files:
|
|
|
545
543
|
- lib/rubocop/config/default.yml
|
|
546
544
|
- lib/rubocop/cop/primer.rb
|
|
547
545
|
- lib/rubocop/cop/primer/base_cop.rb
|
|
546
|
+
- lib/rubocop/cop/primer/component_name_migration.rb
|
|
548
547
|
- lib/rubocop/cop/primer/deprecated_arguments.rb
|
|
549
548
|
- lib/rubocop/cop/primer/deprecated_button_arguments.rb
|
|
550
549
|
- lib/rubocop/cop/primer/deprecated_label_schemes.rb
|
|
@@ -589,7 +588,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
589
588
|
- !ruby/object:Gem::Version
|
|
590
589
|
version: '0'
|
|
591
590
|
requirements: []
|
|
592
|
-
rubygems_version: 3.1.
|
|
591
|
+
rubygems_version: 3.1.6
|
|
593
592
|
signing_key:
|
|
594
593
|
specification_version: 4
|
|
595
594
|
summary: ViewComponents for the Primer Design System
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@github/auto-complete-element';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@github/auto-complete-element';
|