primer_view_components 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -0
- data/app/assets/javascripts/app/components/primer/primer.d.ts +1 -1
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +2 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +2 -1
- data/app/components/primer/alpha/check_box_group.rb +2 -0
- data/app/components/primer/alpha/dialog/header.rb +12 -0
- data/app/components/primer/alpha/dialog.rb +1 -1
- data/app/components/primer/alpha/nav_list/divider.rb +2 -5
- data/app/components/primer/alpha/nav_list/group.rb +2 -98
- data/app/components/primer/alpha/nav_list/heading.rb +2 -27
- data/app/components/primer/alpha/nav_list/item.rb +2 -147
- data/app/components/primer/alpha/nav_list.rb +2 -205
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +1 -7
- data/app/components/primer/alpha/overlay.rb +6 -4
- data/app/components/primer/alpha/radio_button_group.rb +2 -0
- data/app/components/primer/alpha/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.json +4 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +18 -3
- data/app/components/primer/alpha/tooltip.rb +3 -1
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.json +2 -0
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +11 -3
- data/app/components/primer/beta/icon_button.html.erb +1 -1
- data/app/components/primer/beta/icon_button.rb +8 -1
- data/app/components/primer/beta/link.css +1 -1
- data/app/components/primer/beta/link.css.json +1 -0
- data/app/components/primer/beta/link.css.map +1 -1
- data/app/components/primer/beta/link.pcss +5 -0
- data/app/components/primer/beta/link.rb +2 -2
- data/app/components/primer/beta/nav_list/divider.rb +14 -0
- data/app/components/primer/beta/nav_list/group.rb +107 -0
- data/app/components/primer/beta/nav_list/heading.rb +36 -0
- data/app/components/primer/beta/nav_list/item.rb +156 -0
- data/app/components/primer/beta/nav_list.rb +212 -0
- data/app/components/primer/focus_group.js +2 -1
- data/app/components/primer/focus_group.ts +2 -1
- data/app/components/primer/primer.d.ts +1 -1
- data/app/components/primer/primer.js +1 -1
- data/app/components/primer/primer.ts +1 -1
- data/app/helpers/primer/form_helper.rb +10 -0
- data/lib/primer/deprecations.yml +20 -0
- data/lib/primer/forms/check_box_group.html.erb +3 -0
- data/lib/primer/forms/dsl/check_box_group_input.rb +1 -5
- data/lib/primer/forms/dsl/check_box_input.rb +5 -0
- data/lib/primer/forms/dsl/radio_button_input.rb +5 -0
- data/lib/primer/forms/form_control.html.erb +1 -4
- data/lib/primer/forms/radio_button_group.html.erb +3 -0
- data/lib/primer/forms/utils.rb +2 -0
- data/lib/primer/forms/validation_message.html.erb +4 -0
- data/lib/primer/forms/validation_message.rb +14 -0
- data/lib/primer/forms.rb +16 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/component_manifest.rb +4 -0
- data/previews/primer/alpha/check_box_group_preview.rb +13 -0
- data/previews/primer/alpha/dialog_preview/with_header.html.erb +5 -0
- data/previews/primer/alpha/dialog_preview.rb +17 -0
- data/previews/primer/alpha/overlay_preview.rb +1 -1
- data/previews/primer/alpha/radio_button_group_preview.rb +13 -0
- data/previews/primer/alpha/radio_button_preview.rb +1 -1
- data/previews/primer/alpha/text_field_preview/input_group_leading_action_menu.html.erb +21 -0
- data/previews/primer/alpha/text_field_preview/input_group_leading_button.html.erb +18 -0
- data/previews/primer/alpha/text_field_preview/input_group_trailing_button.html.erb +18 -0
- data/previews/primer/alpha/text_field_preview.rb +21 -0
- data/previews/primer/beta/button_preview.rb +1 -1
- data/previews/primer/{alpha → beta}/nav_list_preview/trailing_action.html.erb +1 -1
- data/previews/primer/{alpha → beta}/nav_list_preview.rb +5 -5
- data/static/arguments.json +182 -6
- data/static/audited_at.json +5 -0
- data/static/classes.json +3 -0
- data/static/constants.json +23 -0
- data/static/info_arch.json +978 -501
- data/static/previews.json +85 -7
- data/static/statuses.json +10 -5
- metadata +23 -11
- /data/app/assets/javascripts/app/components/primer/{alpha → beta}/nav_list.d.ts +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list/group.html.erb +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list/item.html.erb +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.d.ts +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.html.erb +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.js +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.ts +0 -0
data/lib/primer/forms/utils.rb
CHANGED
@@ -15,6 +15,8 @@ module Primer
|
|
15
15
|
# conventions, so it should work ok. Zeitwerk also has this information but lacks a
|
16
16
|
# public API to map constants to source files.
|
17
17
|
def const_source_location(class_name)
|
18
|
+
return nil unless class_name
|
19
|
+
|
18
20
|
# NOTE: underscore respects namespacing, i.e. will convert Foo::Bar to foo/bar.
|
19
21
|
class_path = "#{class_name.underscore}.rb"
|
20
22
|
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<%= content_tag(:div, **@input.validation_arguments) do %>
|
2
|
+
<span class="FormControl-inlineValidation--visual"><%= render(Primer::Beta::Octicon.new(icon: :"alert-fill", size: :xsmall, aria: { hidden: true })) %></span>
|
3
|
+
<%= content_tag(:span, @input.invalid? ? @input.validation_messages.first : "", **@input.validation_message_arguments) %>
|
4
|
+
<% end %>
|
data/lib/primer/forms.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
# :nodoc:
|
5
|
+
module Forms
|
6
|
+
def self.inline_form(builder, base = nil, &block)
|
7
|
+
base ||= defined?(ApplicationForm) ? ApplicationForm : Primer::Forms::Base
|
8
|
+
|
9
|
+
klass = Class.new(base) do
|
10
|
+
form(&block)
|
11
|
+
end
|
12
|
+
|
13
|
+
klass.new(builder)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -73,6 +73,10 @@ module Primer
|
|
73
73
|
Primer::Alpha::NavList::Item => { js: true, examples: false },
|
74
74
|
Primer::Alpha::NavList::Group => { js: true, examples: false },
|
75
75
|
|
76
|
+
Primer::Beta::NavList => { js: true },
|
77
|
+
Primer::Beta::NavList::Item => { js: true, examples: false },
|
78
|
+
Primer::Beta::NavList::Group => { js: true, examples: false },
|
79
|
+
|
76
80
|
# ActionList is a base component that should not be used by itself, and thus
|
77
81
|
# does not have examples of its own
|
78
82
|
Primer::Alpha::ActionList => { js: true, examples: false },
|
@@ -9,17 +9,20 @@ module Primer
|
|
9
9
|
# @param name text
|
10
10
|
# @param label text
|
11
11
|
# @param caption text
|
12
|
+
# @param validation_message text
|
12
13
|
# @param disabled toggle
|
13
14
|
def playground(
|
14
15
|
name: "my-check-group",
|
15
16
|
label: "I would go into battle with:",
|
16
17
|
caption: "Qa'pla!",
|
18
|
+
validation_message: nil,
|
17
19
|
disabled: false
|
18
20
|
)
|
19
21
|
system_arguments = {
|
20
22
|
name: name,
|
21
23
|
label: label,
|
22
24
|
caption: caption,
|
25
|
+
validation_message: validation_message,
|
23
26
|
disabled: disabled
|
24
27
|
}
|
25
28
|
|
@@ -41,6 +44,16 @@ module Primer
|
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
47
|
+
# @label Invalid
|
48
|
+
def invalid
|
49
|
+
render(Primer::Alpha::CheckBoxGroup.new(validation_message: "Please choose at least one", name: "my-check-group", label: "I would go into battle with:")) do |component|
|
50
|
+
component.check_box(label: "Jean-Luc Picard", value: "picard4")
|
51
|
+
component.check_box(label: "Hikaru Sulu", value: "sulu4")
|
52
|
+
component.check_box(label: "Kathryn Janeway", value: "janeway4")
|
53
|
+
component.check_box(label: "Benjamin Sisko", value: "sisko4")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
44
57
|
# @!group Options
|
45
58
|
# @snapshot
|
46
59
|
#
|
@@ -60,6 +60,23 @@ module Primer
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
# @label With Header
|
64
|
+
#
|
65
|
+
# @param title [String] text
|
66
|
+
# @param subtitle [String] text
|
67
|
+
# @param header_variant [Symbol] select [medium, large]
|
68
|
+
# @param button_text [String] text
|
69
|
+
# @param show_divider [Boolean] toggle
|
70
|
+
def with_header(title: "Test Dialog", subtitle: nil, header_variant: :medium, button_text: "Show Dialog", show_divider: true)
|
71
|
+
render_with_template(locals: {
|
72
|
+
title: title,
|
73
|
+
subtitle: subtitle,
|
74
|
+
header_variant: header_variant,
|
75
|
+
button_text: button_text,
|
76
|
+
show_divider: show_divider
|
77
|
+
})
|
78
|
+
end
|
79
|
+
|
63
80
|
# @label With Footer
|
64
81
|
#
|
65
82
|
# @param title [String] text
|
@@ -9,17 +9,20 @@ module Primer
|
|
9
9
|
# @param name text
|
10
10
|
# @param label text
|
11
11
|
# @param caption text
|
12
|
+
# @param validation_message text
|
12
13
|
# @param disabled toggle
|
13
14
|
def playground(
|
14
15
|
name: "my-radio-group",
|
15
16
|
label: "Question: what kind of bear is best?",
|
16
17
|
caption: "There are basically two schools of thought",
|
18
|
+
validation_message: nil,
|
17
19
|
disabled: false
|
18
20
|
)
|
19
21
|
system_arguments = {
|
20
22
|
name: name,
|
21
23
|
label: label,
|
22
24
|
caption: caption,
|
25
|
+
validation_message: validation_message,
|
23
26
|
disabled: disabled
|
24
27
|
}
|
25
28
|
|
@@ -40,6 +43,16 @@ module Primer
|
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
46
|
+
# @label Invalid
|
47
|
+
# @snapshot
|
48
|
+
def invalid
|
49
|
+
render(Primer::Alpha::RadioButtonGroup.new(validation_message: "Please select an option", name: "my-radio-group", label: "Question: what kind of bear is best?")) do |component|
|
50
|
+
component.radio_button(label: "Bears", value: "bears")
|
51
|
+
component.radio_button(label: "Beets", value: "beets")
|
52
|
+
component.radio_button(label: "Battlestar Galactica", value: "bsg")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
43
56
|
# @!group Options
|
44
57
|
#
|
45
58
|
# @label With caption
|
@@ -51,7 +51,7 @@ module Primer
|
|
51
51
|
# @label Checked
|
52
52
|
# @snapshot
|
53
53
|
def checked
|
54
|
-
render(Primer::Alpha::RadioButton.new(name: "my-radio-button", label: "Battlestar Galactica", value: "bsg2", checked: true
|
54
|
+
render(Primer::Alpha::RadioButton.new(name: "my-radio-button", label: "Battlestar Galactica", value: "bsg2", checked: true))
|
55
55
|
end
|
56
56
|
|
57
57
|
# @label Visually hidden label
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
<%= render(Primer::BaseComponent.new(tag: :div, flex_items: :center, display: :flex)) do %>
|
3
|
+
<%= form_with(url: action_menu_form_action_path(format: route_format)) do |f| %>
|
4
|
+
<%= render(Primer::Alpha::ActionMenu.new(select_variant: :single, form_arguments: { builder: f, name: "foo" })) do |menu| %>
|
5
|
+
<% menu.with_show_button(classes: "rounded-right-0 border-right-0") { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Filter" } %>
|
6
|
+
<% menu.with_item(label: "Fast forward", data: { value: "fast_forward" }) %>
|
7
|
+
<% menu.with_item(label: "Recursive", data: { value: "recursive" }) %>
|
8
|
+
<% menu.with_item(label: "Ours", data: { value: "ours" }) %>
|
9
|
+
<% menu.with_item(label: "Resolve") %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<%= render(Primer::Alpha::TextField.new(
|
13
|
+
name: "message",
|
14
|
+
placeholder: "What's happening?",
|
15
|
+
label: "What is your current status?",
|
16
|
+
classes: "rounded-left-0",
|
17
|
+
visually_hide_label: true,
|
18
|
+
value: "Some value",
|
19
|
+
inset: true,
|
20
|
+
)) %>
|
21
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
<%= render(Primer::BaseComponent.new(tag: :div, flex_items: :center, display: :flex)) do %>
|
3
|
+
<%= render(Primer::Beta::IconButton.new(
|
4
|
+
classes: "rounded-right-0 border-right-0",
|
5
|
+
icon: :smiley,
|
6
|
+
aria: { label: "Emoji" }
|
7
|
+
)
|
8
|
+
) %>
|
9
|
+
<%= render(Primer::Alpha::TextField.new(
|
10
|
+
name: "message",
|
11
|
+
placeholder: "What's happening?",
|
12
|
+
label: "What is your current status?",
|
13
|
+
classes: "rounded-left-0",
|
14
|
+
visually_hide_label: true,
|
15
|
+
value: "Some value",
|
16
|
+
inset: true,
|
17
|
+
)) %>
|
18
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
<%= render(Primer::BaseComponent.new(tag: :div, flex_items: :center, display: :flex)) do %>
|
3
|
+
<%= render(Primer::Alpha::TextField.new(
|
4
|
+
name: "message",
|
5
|
+
placeholder: "What's happening?",
|
6
|
+
label: "What is your current status?",
|
7
|
+
classes: "rounded-right-0",
|
8
|
+
visually_hide_label: true,
|
9
|
+
value: "Some value",
|
10
|
+
inset: true,
|
11
|
+
)) %>
|
12
|
+
<%= render(Primer::Beta::IconButton.new(
|
13
|
+
classes: "rounded-left-0 border-left-0",
|
14
|
+
icon: :smiley,
|
15
|
+
aria: { label: "Emoji" }
|
16
|
+
)
|
17
|
+
) %>
|
18
|
+
<% end %>
|
@@ -189,6 +189,27 @@ module Primer
|
|
189
189
|
end
|
190
190
|
#
|
191
191
|
# @!endgroup
|
192
|
+
|
193
|
+
# @label Input group with leading button
|
194
|
+
#
|
195
|
+
# @snapshot
|
196
|
+
def input_group_leading_button
|
197
|
+
render_with_template
|
198
|
+
end
|
199
|
+
|
200
|
+
# @label Input group with trailing button
|
201
|
+
#
|
202
|
+
# @snapshot
|
203
|
+
def input_group_trailing_button
|
204
|
+
render_with_template
|
205
|
+
end
|
206
|
+
|
207
|
+
# @label Input group with ActionMenu
|
208
|
+
#
|
209
|
+
# @snapshot
|
210
|
+
def input_group_leading_action_menu(route_format: :html)
|
211
|
+
render_with_template(locals: { route_format: route_format })
|
212
|
+
end
|
192
213
|
end
|
193
214
|
end
|
194
215
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= render(Primer::
|
1
|
+
<%= render(Primer::Beta::NavList.new(aria: { label: "Workflow results" })) do |list| %>
|
2
2
|
<% list.with_group do |group| %>
|
3
3
|
<% group.with_heading(title: "Workflows") %>
|
4
4
|
<% group.with_item(label: "Build and Test", href: "/workflows/1") do |item| %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Primer
|
4
|
-
module
|
4
|
+
module Beta
|
5
5
|
# @label NavList
|
6
6
|
class NavListPreview < ViewComponent::Preview
|
7
7
|
# @label Playground
|
8
8
|
def playground
|
9
|
-
render(Primer::
|
9
|
+
render(Primer::Beta::NavList.new(selected_item_id: :collaborators)) do |list|
|
10
10
|
list.with_heading(title: "Repository settings")
|
11
11
|
|
12
12
|
list.with_item(label: "General", href: "/general") do |item|
|
@@ -34,7 +34,7 @@ module Primer
|
|
34
34
|
# @label Default
|
35
35
|
# @snapshot
|
36
36
|
def default
|
37
|
-
render(Primer::
|
37
|
+
render(Primer::Beta::NavList.new(selected_item_id: :code_review_limits)) do |list|
|
38
38
|
list.with_heading(title: "Repository settings")
|
39
39
|
|
40
40
|
list.with_item(label: "General", href: "/general") do |item|
|
@@ -77,7 +77,7 @@ module Primer
|
|
77
77
|
# @label Top-level items
|
78
78
|
#
|
79
79
|
def top_level_items
|
80
|
-
render(Primer::
|
80
|
+
render(Primer::Beta::NavList.new) do |list|
|
81
81
|
list.with_heading(title: "Account settings")
|
82
82
|
|
83
83
|
list.with_item(label: "General", href: "/general") do |item|
|
@@ -105,7 +105,7 @@ module Primer
|
|
105
105
|
# @label Show more item
|
106
106
|
# @snapshot
|
107
107
|
def show_more_item
|
108
|
-
render(Primer::
|
108
|
+
render(Primer::Beta::NavList.new(aria: { label: "My favorite foods" })) do |list|
|
109
109
|
list.with_group do |group|
|
110
110
|
group.with_heading(title: "My favorite foods")
|
111
111
|
group.with_item(label: "Popplers", href: "/foods/popplers")
|
data/static/arguments.json
CHANGED
@@ -772,6 +772,18 @@
|
|
772
772
|
"default": "N/A",
|
773
773
|
"description": "A string describing the field and what sorts of input it expects. Displayed below the group."
|
774
774
|
},
|
775
|
+
{
|
776
|
+
"name": "invalid",
|
777
|
+
"type": "Boolean",
|
778
|
+
"default": "N/A",
|
779
|
+
"description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect."
|
780
|
+
},
|
781
|
+
{
|
782
|
+
"name": "validation_message",
|
783
|
+
"type": "String",
|
784
|
+
"default": "N/A",
|
785
|
+
"description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object."
|
786
|
+
},
|
775
787
|
{
|
776
788
|
"name": "label_arguments",
|
777
789
|
"type": "Hash",
|
@@ -884,6 +896,12 @@
|
|
884
896
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dialog/header.rb",
|
885
897
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/dialog/header/default/",
|
886
898
|
"parameters": [
|
899
|
+
{
|
900
|
+
"name": "id",
|
901
|
+
"type": "String",
|
902
|
+
"default": "N/A",
|
903
|
+
"description": "The HTML element's ID value."
|
904
|
+
},
|
887
905
|
{
|
888
906
|
"name": "title",
|
889
907
|
"type": "String",
|
@@ -908,6 +926,12 @@
|
|
908
926
|
"default": "`false`",
|
909
927
|
"description": "Visually hide the `title` while maintaining a label for assistive technologies."
|
910
928
|
},
|
929
|
+
{
|
930
|
+
"name": "variant",
|
931
|
+
"type": "Symbol",
|
932
|
+
"default": "`:medium`",
|
933
|
+
"description": "One of `:large` or `:medium`."
|
934
|
+
},
|
911
935
|
{
|
912
936
|
"name": "system_arguments",
|
913
937
|
"type": "Hash",
|
@@ -1420,7 +1444,7 @@
|
|
1420
1444
|
},
|
1421
1445
|
{
|
1422
1446
|
"component": "NavList",
|
1423
|
-
"status": "
|
1447
|
+
"status": "deprecated",
|
1424
1448
|
"a11y_reviewed": true,
|
1425
1449
|
"short_name": "NavList",
|
1426
1450
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list.rb",
|
@@ -1442,7 +1466,7 @@
|
|
1442
1466
|
},
|
1443
1467
|
{
|
1444
1468
|
"component": "NavList::Divider",
|
1445
|
-
"status": "
|
1469
|
+
"status": "deprecated",
|
1446
1470
|
"a11y_reviewed": false,
|
1447
1471
|
"short_name": "NavListDivider",
|
1448
1472
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/divider.rb",
|
@@ -1464,7 +1488,7 @@
|
|
1464
1488
|
},
|
1465
1489
|
{
|
1466
1490
|
"component": "NavList::Group",
|
1467
|
-
"status": "
|
1491
|
+
"status": "deprecated",
|
1468
1492
|
"a11y_reviewed": true,
|
1469
1493
|
"short_name": "NavListGroup",
|
1470
1494
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/group.rb",
|
@@ -1486,7 +1510,7 @@
|
|
1486
1510
|
},
|
1487
1511
|
{
|
1488
1512
|
"component": "NavList::Heading",
|
1489
|
-
"status": "
|
1513
|
+
"status": "deprecated",
|
1490
1514
|
"a11y_reviewed": false,
|
1491
1515
|
"short_name": "NavListHeading",
|
1492
1516
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/heading.rb",
|
@@ -1520,7 +1544,7 @@
|
|
1520
1544
|
},
|
1521
1545
|
{
|
1522
1546
|
"component": "NavList::Item",
|
1523
|
-
"status": "
|
1547
|
+
"status": "deprecated",
|
1524
1548
|
"a11y_reviewed": false,
|
1525
1549
|
"short_name": "NavListItem",
|
1526
1550
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/item.rb",
|
@@ -1966,6 +1990,18 @@
|
|
1966
1990
|
"default": "N/A",
|
1967
1991
|
"description": "A string describing the field and what sorts of input it expects. Displayed below the group."
|
1968
1992
|
},
|
1993
|
+
{
|
1994
|
+
"name": "invalid",
|
1995
|
+
"type": "Boolean",
|
1996
|
+
"default": "N/A",
|
1997
|
+
"description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect."
|
1998
|
+
},
|
1999
|
+
{
|
2000
|
+
"name": "validation_message",
|
2001
|
+
"type": "String",
|
2002
|
+
"default": "N/A",
|
2003
|
+
"description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object."
|
2004
|
+
},
|
1969
2005
|
{
|
1970
2006
|
"name": "label_arguments",
|
1971
2007
|
"type": "Hash",
|
@@ -3647,7 +3683,7 @@
|
|
3647
3683
|
{
|
3648
3684
|
"name": "underline",
|
3649
3685
|
"type": "Boolean",
|
3650
|
-
"default": "`
|
3686
|
+
"default": "`false`",
|
3651
3687
|
"description": "Whether or not to underline the link."
|
3652
3688
|
},
|
3653
3689
|
{
|
@@ -3680,6 +3716,146 @@
|
|
3680
3716
|
}
|
3681
3717
|
]
|
3682
3718
|
},
|
3719
|
+
{
|
3720
|
+
"component": "NavList",
|
3721
|
+
"status": "beta",
|
3722
|
+
"a11y_reviewed": true,
|
3723
|
+
"short_name": "NavList",
|
3724
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list.rb",
|
3725
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/default/",
|
3726
|
+
"parameters": [
|
3727
|
+
{
|
3728
|
+
"name": "selected_item_id",
|
3729
|
+
"type": "Symbol",
|
3730
|
+
"default": "`nil`",
|
3731
|
+
"description": "The ID of the currently selected item. The default is `nil`, meaning no item is selected."
|
3732
|
+
},
|
3733
|
+
{
|
3734
|
+
"name": "system_arguments",
|
3735
|
+
"type": "Hash",
|
3736
|
+
"default": "N/A",
|
3737
|
+
"description": "[System arguments](/system-arguments)"
|
3738
|
+
}
|
3739
|
+
]
|
3740
|
+
},
|
3741
|
+
{
|
3742
|
+
"component": "NavList::Divider",
|
3743
|
+
"status": "alpha",
|
3744
|
+
"a11y_reviewed": false,
|
3745
|
+
"short_name": "NavListDivider",
|
3746
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/divider.rb",
|
3747
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/divider/default/",
|
3748
|
+
"parameters": [
|
3749
|
+
{
|
3750
|
+
"name": "scheme",
|
3751
|
+
"type": "Symbol",
|
3752
|
+
"default": "`:subtle`",
|
3753
|
+
"description": "Display a background color if scheme is `filled`."
|
3754
|
+
},
|
3755
|
+
{
|
3756
|
+
"name": "system_arguments",
|
3757
|
+
"type": "Hash",
|
3758
|
+
"default": "N/A",
|
3759
|
+
"description": "[System arguments](/system-arguments)"
|
3760
|
+
}
|
3761
|
+
]
|
3762
|
+
},
|
3763
|
+
{
|
3764
|
+
"component": "NavList::Group",
|
3765
|
+
"status": "alpha",
|
3766
|
+
"a11y_reviewed": true,
|
3767
|
+
"short_name": "NavListGroup",
|
3768
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/group.rb",
|
3769
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/group/default/",
|
3770
|
+
"parameters": [
|
3771
|
+
{
|
3772
|
+
"name": "selected_item_id",
|
3773
|
+
"type": "Symbol",
|
3774
|
+
"default": "`nil`",
|
3775
|
+
"description": "The ID of the currently selected item. Used internally."
|
3776
|
+
},
|
3777
|
+
{
|
3778
|
+
"name": "system_arguments",
|
3779
|
+
"type": "Hash",
|
3780
|
+
"default": "N/A",
|
3781
|
+
"description": "[System arguments](/system-arguments)"
|
3782
|
+
}
|
3783
|
+
]
|
3784
|
+
},
|
3785
|
+
{
|
3786
|
+
"component": "NavList::Heading",
|
3787
|
+
"status": "alpha",
|
3788
|
+
"a11y_reviewed": false,
|
3789
|
+
"short_name": "NavListHeading",
|
3790
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/heading.rb",
|
3791
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/heading/default/",
|
3792
|
+
"parameters": [
|
3793
|
+
{
|
3794
|
+
"name": "title",
|
3795
|
+
"type": "String",
|
3796
|
+
"default": "N/A",
|
3797
|
+
"description": "The text content of the heading."
|
3798
|
+
},
|
3799
|
+
{
|
3800
|
+
"name": "id",
|
3801
|
+
"type": "String",
|
3802
|
+
"default": "`self.class.generate_id`",
|
3803
|
+
"description": "The value of the ID HTML attribute. Auto-generated by default."
|
3804
|
+
},
|
3805
|
+
{
|
3806
|
+
"name": "heading_level",
|
3807
|
+
"type": "Integer",
|
3808
|
+
"default": "`2`",
|
3809
|
+
"description": "The heading level, i.e. 2 for an `<h2>`, 3 for an `<h3>`, etc."
|
3810
|
+
},
|
3811
|
+
{
|
3812
|
+
"name": "system_arguments",
|
3813
|
+
"type": "Hash",
|
3814
|
+
"default": "N/A",
|
3815
|
+
"description": "[System arguments](/system-arguments)"
|
3816
|
+
}
|
3817
|
+
]
|
3818
|
+
},
|
3819
|
+
{
|
3820
|
+
"component": "NavList::Item",
|
3821
|
+
"status": "alpha",
|
3822
|
+
"a11y_reviewed": false,
|
3823
|
+
"short_name": "NavListItem",
|
3824
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/item.rb",
|
3825
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/item/default/",
|
3826
|
+
"parameters": [
|
3827
|
+
{
|
3828
|
+
"name": "selected_item_id",
|
3829
|
+
"type": "Symbol",
|
3830
|
+
"default": "`nil`",
|
3831
|
+
"description": "The ID of the currently selected list item. Used internally."
|
3832
|
+
},
|
3833
|
+
{
|
3834
|
+
"name": "selected_by_ids",
|
3835
|
+
"type": "Array<Symbol>",
|
3836
|
+
"default": "`[]`",
|
3837
|
+
"description": "The list of IDs that select this item. In other words, if the `selected_item_id` attribute on the parent `NavList` is set to one of these IDs, the item will appear selected."
|
3838
|
+
},
|
3839
|
+
{
|
3840
|
+
"name": "expanded",
|
3841
|
+
"type": "Boolean",
|
3842
|
+
"default": "`false`",
|
3843
|
+
"description": "Whether this item shows (expands) or hides (collapses) its list of sub items."
|
3844
|
+
},
|
3845
|
+
{
|
3846
|
+
"name": "sub_item",
|
3847
|
+
"type": "Boolean",
|
3848
|
+
"default": "`false`",
|
3849
|
+
"description": "Whether or not this item is nested under a parent item. Used internally."
|
3850
|
+
},
|
3851
|
+
{
|
3852
|
+
"name": "system_arguments",
|
3853
|
+
"type": "Hash",
|
3854
|
+
"default": "N/A",
|
3855
|
+
"description": "[System arguments](/system-arguments)"
|
3856
|
+
}
|
3857
|
+
]
|
3858
|
+
},
|
3683
3859
|
{
|
3684
3860
|
"component": "Octicon",
|
3685
3861
|
"status": "beta",
|
data/static/audited_at.json
CHANGED
@@ -82,6 +82,11 @@
|
|
82
82
|
"Primer::Beta::Label": "",
|
83
83
|
"Primer::Beta::Link": "",
|
84
84
|
"Primer::Beta::Markdown": "",
|
85
|
+
"Primer::Beta::NavList": "2023-07-10",
|
86
|
+
"Primer::Beta::NavList::Divider": "",
|
87
|
+
"Primer::Beta::NavList::Group": "2023-07-10",
|
88
|
+
"Primer::Beta::NavList::Heading": "",
|
89
|
+
"Primer::Beta::NavList::Item": "",
|
85
90
|
"Primer::Beta::Octicon": "",
|
86
91
|
"Primer::Beta::Popover": "",
|
87
92
|
"Primer::Beta::ProgressBar": "",
|