primer_view_components 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- 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 +3 -3
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/divider.rb +1 -1
- data/app/components/primer/alpha/action_list/form_wrapper.html.erb +10 -0
- data/app/components/primer/alpha/action_list/form_wrapper.rb +61 -0
- data/app/components/primer/alpha/action_list/heading.html.erb +2 -2
- data/app/components/primer/alpha/action_list/heading.rb +9 -5
- data/app/components/primer/alpha/action_list/item.html.erb +41 -36
- data/app/components/primer/alpha/action_list/item.rb +16 -2
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.json +1 -0
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.html.erb +6 -0
- data/app/components/primer/alpha/action_list.pcss +42 -37
- data/app/components/primer/alpha/action_list.rb +31 -11
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +7 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +55 -3
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +70 -2
- data/app/components/primer/alpha/action_menu/list.rb +9 -11
- data/app/components/primer/alpha/action_menu.rb +50 -12
- data/app/components/primer/alpha/auto_complete.css +1 -1
- data/app/components/primer/alpha/auto_complete.css.map +1 -1
- data/app/components/primer/alpha/auto_complete.pcss +2 -2
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/banner.pcss +7 -7
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +33 -32
- data/app/components/primer/alpha/dialog.rb +4 -0
- data/app/components/primer/alpha/dropdown.css +1 -1
- data/app/components/primer/alpha/dropdown.css.map +1 -1
- data/app/components/primer/alpha/dropdown.pcss +12 -11
- data/app/components/primer/alpha/layout.css +1 -1
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/layout.pcss +4 -4
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/menu.pcss +20 -20
- data/app/components/primer/alpha/nav_list/divider.rb +14 -0
- data/app/components/primer/alpha/nav_list/group.html.erb +7 -0
- data/app/components/primer/alpha/nav_list/group.rb +24 -11
- data/app/components/primer/alpha/nav_list/item.rb +4 -0
- data/app/components/primer/alpha/nav_list.d.ts +0 -1
- data/app/components/primer/alpha/nav_list.html.erb +9 -4
- data/app/components/primer/alpha/nav_list.js +3 -4
- data/app/components/primer/alpha/nav_list.rb +87 -10
- data/app/components/primer/alpha/nav_list.ts +3 -2
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.json +2 -2
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +34 -43
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.pcss +12 -12
- data/app/components/primer/alpha/text_field.css +3 -3
- data/app/components/primer/alpha/text_field.css.json +11 -11
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +76 -90
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.pcss +9 -9
- data/app/components/primer/alpha/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +1 -1
- data/app/components/primer/alpha/underline_nav.pcss +7 -7
- data/app/components/primer/beta/auto_complete/item.html.erb +9 -9
- data/app/components/primer/beta/auto_complete/item.rb +17 -13
- data/app/components/primer/beta/auto_complete.rb +1 -1
- data/app/components/primer/beta/avatar.css +1 -1
- data/app/components/primer/beta/avatar.css.map +1 -1
- data/app/components/primer/beta/avatar.pcss +2 -2
- data/app/components/primer/beta/avatar_stack.css +1 -1
- data/app/components/primer/beta/avatar_stack.css.map +1 -1
- data/app/components/primer/beta/avatar_stack.pcss +5 -5
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.pcss +13 -13
- data/app/components/primer/beta/border_box.css +1 -1
- data/app/components/primer/beta/border_box.css.json +1 -1
- data/app/components/primer/beta/border_box.css.map +1 -1
- data/app/components/primer/beta/border_box.pcss +41 -39
- 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 +34 -25
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/counter.pcss +3 -3
- data/app/components/primer/beta/flash.css +1 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/flash.pcss +10 -11
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/label.pcss +2 -2
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/popover.pcss +4 -4
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/state.pcss +5 -5
- data/app/components/primer/beta/subhead.css +1 -1
- data/app/components/primer/beta/subhead.css.map +1 -1
- data/app/components/primer/beta/subhead.pcss +4 -4
- data/app/components/primer/beta/timeline_item.css +1 -1
- data/app/components/primer/beta/timeline_item.css.map +1 -1
- data/app/components/primer/beta/timeline_item.pcss +13 -13
- data/app/components/primer/beta/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/beta/truncate.pcss +1 -1
- data/app/components/primer/component.rb +3 -96
- data/app/lib/primer/attributes_helper.rb +105 -0
- data/lib/postcss_mixins/activeIndicatorLine.pcss +1 -1
- data/lib/primer/forms/text_field.rb +6 -0
- data/lib/primer/view_components/linters/disallow_component_css_counter.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/component_manifest.rb +1 -0
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/single_select_form.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/submitting_forms.html.erb +15 -0
- data/previews/primer/alpha/action_menu_preview.rb +46 -2
- data/previews/primer/alpha/nav_list_preview/trailing_action.html.erb +10 -10
- data/previews/primer/alpha/nav_list_preview.rb +37 -16
- data/previews/primer/beta/button_preview/trailing_counter.html.erb +11 -0
- data/previews/primer/beta/button_preview.rb +15 -0
- data/previews/primer/box_preview.rb +28 -0
- data/static/arguments.json +59 -14
- data/static/audited_at.json +2 -0
- data/static/classes.json +3 -0
- data/static/constants.json +21 -1
- data/static/info_arch.json +238 -36
- data/static/previews.json +58 -0
- data/static/statuses.json +2 -0
- metadata +12 -2
@@ -9,10 +9,12 @@ module Primer
|
|
9
9
|
# @param select_variant [Symbol] select [single, multiple, none]
|
10
10
|
# @param anchor_align [Symbol] select [start, center, end]
|
11
11
|
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
12
|
+
# @param size [Symbol] select [auto, small, medium, large, xlarge]
|
12
13
|
def playground(
|
13
|
-
select_variant: Primer::Alpha::ActionMenu::DEFAULT_SELECT_VARIANT, anchor_align: Primer::Alpha::Overlay::DEFAULT_ANCHOR_ALIGN, anchor_side: Primer::Alpha::Overlay::DEFAULT_ANCHOR_SIDE
|
14
|
+
select_variant: Primer::Alpha::ActionMenu::DEFAULT_SELECT_VARIANT, anchor_align: Primer::Alpha::Overlay::DEFAULT_ANCHOR_ALIGN, anchor_side: Primer::Alpha::Overlay::DEFAULT_ANCHOR_SIDE,
|
15
|
+
size: Primer::Alpha::Overlay::DEFAULT_SIZE
|
14
16
|
)
|
15
|
-
render(Primer::Alpha::ActionMenu.new(select_variant: select_variant, anchor_align: anchor_align, anchor_side: anchor_side)) do |menu|
|
17
|
+
render(Primer::Alpha::ActionMenu.new(select_variant: select_variant, anchor_align: anchor_align, anchor_side: anchor_side, size: size)) do |menu|
|
16
18
|
menu.with_show_button { "Menu" }
|
17
19
|
menu.with_item(label: "Copy link")
|
18
20
|
menu.with_item(label: "Quote reply")
|
@@ -46,6 +48,23 @@ module Primer
|
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
51
|
+
# @label Wide
|
52
|
+
#
|
53
|
+
def wide
|
54
|
+
render(Primer::Alpha::ActionMenu.new(select_variant: :single, size: :medium)) do |menu|
|
55
|
+
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "A wider menu" }
|
56
|
+
|
57
|
+
menu.with_item(label: "Default", active: true, value: "default") do |item|
|
58
|
+
item.with_trailing_visual_label(scheme: :accent, inline: true).with_content("Recommended")
|
59
|
+
item.with_description { "This is an example for wide ActionMenus" }
|
60
|
+
end
|
61
|
+
|
62
|
+
menu.with_item(label: "Extended", active: false, value: "extended") do |item|
|
63
|
+
item.with_description { "It allows for extended descriptions with extra afforance for additional visuals" }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
49
68
|
# @label With icon button
|
50
69
|
#
|
51
70
|
def with_icon_button
|
@@ -166,9 +185,28 @@ module Primer
|
|
166
185
|
component.with_item(label: "Alert", tag: :button, content_arguments: { onclick: "alert('Foo')", onkeydown: "if (event.key === 'Enter') { alert(event.key) }" })
|
167
186
|
component.with_item(label: "Navigate", tag: :a, content_arguments: { href: UrlHelpers.action_menu_landing_path })
|
168
187
|
component.with_item(label: "Copy text", tag: :"clipboard-copy", content_arguments: { value: "Text to copy" })
|
188
|
+
component.with_item(
|
189
|
+
label: "Submit form",
|
190
|
+
href: UrlHelpers.action_menu_form_action_path,
|
191
|
+
form_arguments: {
|
192
|
+
name: "foo", value: "bar", method: :post
|
193
|
+
}
|
194
|
+
)
|
169
195
|
end
|
170
196
|
end
|
171
197
|
|
198
|
+
# @label Single select form
|
199
|
+
#
|
200
|
+
def single_select_form(route_format: :html)
|
201
|
+
render_with_template(locals: { route_format: route_format })
|
202
|
+
end
|
203
|
+
|
204
|
+
# @label Multiple select form
|
205
|
+
#
|
206
|
+
def multiple_select_form(route_format: :html)
|
207
|
+
render_with_template(locals: { route_format: route_format })
|
208
|
+
end
|
209
|
+
|
172
210
|
# @label With disabled items
|
173
211
|
#
|
174
212
|
def with_disabled_items
|
@@ -206,6 +244,12 @@ module Primer
|
|
206
244
|
end
|
207
245
|
end
|
208
246
|
|
247
|
+
# @label [Item] Submitting Forms
|
248
|
+
#
|
249
|
+
def submitting_forms
|
250
|
+
render_with_template(locals: {})
|
251
|
+
end
|
252
|
+
|
209
253
|
# @label [Item] Inline description
|
210
254
|
#
|
211
255
|
def inline_description
|
@@ -1,19 +1,19 @@
|
|
1
|
-
<%= render(Primer::Alpha::NavList.new) do |list| %>
|
1
|
+
<%= render(Primer::Alpha::NavList.new(aria: { label: "Workflow results" })) do |list| %>
|
2
2
|
<% list.with_group do |group| %>
|
3
|
-
|
4
|
-
<% group.with_item(label: "
|
5
|
-
<%= item.with_trailing_action(icon: :
|
3
|
+
<% group.with_heading(title: "Workflows") %>
|
4
|
+
<% group.with_item(label: "Build and Test", href: "/workflows/1") do |item| %>
|
5
|
+
<%= item.with_trailing_action(icon: :sync, aria: { label: "Build and test: re-run workflow" }, name: "build_and_test_button") %>
|
6
6
|
<% end %>
|
7
|
-
<% group.with_item(label: "
|
8
|
-
<%= item.with_trailing_action(icon: :
|
7
|
+
<% group.with_item(label: "Publish", href: "/workflows/2") do |item| %>
|
8
|
+
<%= item.with_trailing_action(icon: :sync, aria: { label: "Publish: re-run workflow" }, name: "publish_button") %>
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<script type="text/javascript" data-eval="true">
|
14
|
-
const breadButton = document.querySelector("[name=
|
15
|
-
breadButton.addEventListener("click", () => alert("
|
14
|
+
const breadButton = document.querySelector("[name=build_and_test_button]")
|
15
|
+
breadButton.addEventListener("click", () => alert("The 'Build and Test' workflow will be re-run."))
|
16
16
|
|
17
|
-
const cheeseButton = document.querySelector("[name=
|
18
|
-
cheeseButton.addEventListener("click", () => alert("
|
17
|
+
const cheeseButton = document.querySelector("[name=publish_button]")
|
18
|
+
cheeseButton.addEventListener("click", () => alert("The 'Publish' workflow will be re-run."))
|
19
19
|
</script>
|
@@ -6,13 +6,11 @@ module Primer
|
|
6
6
|
class NavListPreview < ViewComponent::Preview
|
7
7
|
# @label Playground
|
8
8
|
def playground
|
9
|
-
render(Primer::Alpha::NavList.new(selected_item_id: :code_review_limits)) do |list|
|
10
|
-
list.
|
11
|
-
group.with_heading(title: "Repository settings")
|
9
|
+
render(Primer::Alpha::NavList.new(aria: { label: "Repository settings" }, selected_item_id: :code_review_limits)) do |list|
|
10
|
+
list.with_heading(title: "Repository settings")
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
end
|
12
|
+
list.with_item(label: "General", href: "/general") do |item|
|
13
|
+
item.with_leading_visual_icon(icon: :gear)
|
16
14
|
end
|
17
15
|
|
18
16
|
list.with_group do |group|
|
@@ -35,13 +33,17 @@ module Primer
|
|
35
33
|
|
36
34
|
# @label Default
|
37
35
|
def default
|
38
|
-
render(Primer::Alpha::NavList.new(selected_item_id: :code_review_limits)) do |list|
|
39
|
-
list.
|
40
|
-
group.with_heading(title: "Repository settings")
|
36
|
+
render(Primer::Alpha::NavList.new(aria: { label: "Repository settings" }, selected_item_id: :code_review_limits)) do |list|
|
37
|
+
list.with_heading(title: "Repository settings")
|
41
38
|
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
list.with_item(label: "General", href: "/general") do |item|
|
40
|
+
item.with_leading_visual_icon(icon: :gear)
|
41
|
+
end
|
42
|
+
|
43
|
+
list.with_divider
|
44
|
+
|
45
|
+
list.with_item(label: "Settings", href: "/settings") do |item|
|
46
|
+
item.with_leading_visual_icon(icon: :beaker)
|
45
47
|
end
|
46
48
|
|
47
49
|
list.with_group do |group|
|
@@ -62,21 +64,40 @@ module Primer
|
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
67
|
+
# @label Top-level items
|
68
|
+
#
|
69
|
+
def top_level_items
|
70
|
+
render(Primer::Alpha::NavList.new(aria: { label: "Account settings" })) do |list|
|
71
|
+
list.with_heading(title: "Account settings")
|
72
|
+
|
73
|
+
list.with_item(label: "General", href: "/general") do |item|
|
74
|
+
item.with_leading_visual_icon(icon: :gear)
|
75
|
+
end
|
76
|
+
|
77
|
+
list.with_item(label: "Billing", href: "/billing") do |item|
|
78
|
+
item.with_leading_visual_icon(icon: :"credit-card")
|
79
|
+
end
|
80
|
+
|
81
|
+
list.with_item(label: "Change password", href: "/change_password") do |item|
|
82
|
+
item.with_leading_visual_icon(icon: :key)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
65
87
|
# @label Show more item
|
66
88
|
def show_more_item
|
67
|
-
render(Primer::Alpha::NavList.new) do |list|
|
89
|
+
render(Primer::Alpha::NavList.new(aria: { label: "My favorite foods" })) do |list|
|
68
90
|
list.with_group do |group|
|
69
91
|
group.with_heading(title: "My favorite foods")
|
70
92
|
group.with_item(label: "Popplers", href: "/foods/popplers")
|
71
93
|
group.with_item(label: "Slurm", href: "/foods/slurm")
|
72
|
-
group.with_show_more_item(label: "Show more", src:
|
94
|
+
group.with_show_more_item(label: "Show more foods", src: UrlHelpers.nav_list_items_path, pages: 2)
|
73
95
|
end
|
74
96
|
end
|
75
97
|
end
|
76
98
|
|
77
99
|
# @label Trailing action
|
78
|
-
def trailing_action
|
79
|
-
end
|
100
|
+
def trailing_action; end
|
80
101
|
end
|
81
102
|
end
|
82
103
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= render(Primer::Beta::Button.new(
|
2
|
+
scheme: :primary,
|
3
|
+
size: :medium,
|
4
|
+
block: block,
|
5
|
+
id: id,
|
6
|
+
align_content: align_content
|
7
|
+
)) do |component| %>
|
8
|
+
<% component.with_leading_visual_icon(icon: :star) %>
|
9
|
+
<% component.with_trailing_visual_counter(count: 15) %>
|
10
|
+
Button
|
11
|
+
<% end %>
|
@@ -266,6 +266,21 @@ module Primer
|
|
266
266
|
})
|
267
267
|
end
|
268
268
|
|
269
|
+
# @label Trailing Counter
|
270
|
+
# @param block toggle
|
271
|
+
# @param align_content select [center, start]
|
272
|
+
def trailing_counter(
|
273
|
+
block: false,
|
274
|
+
id: "button-preview",
|
275
|
+
align_content: :center
|
276
|
+
)
|
277
|
+
render_with_template(locals: {
|
278
|
+
block: block,
|
279
|
+
id: id,
|
280
|
+
align_content: align_content
|
281
|
+
})
|
282
|
+
end
|
283
|
+
|
269
284
|
# @label With tooltip
|
270
285
|
# @param scheme select [default, primary, danger, invisible, link]
|
271
286
|
# @param size select [small, medium]
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
# @label Box
|
5
|
+
class BoxPreview < ViewComponent::Preview
|
6
|
+
# @label Playground
|
7
|
+
#
|
8
|
+
# @param content [String] text
|
9
|
+
def playground(content: "Playground")
|
10
|
+
render(Primer::Box.new) { content }
|
11
|
+
end
|
12
|
+
|
13
|
+
# @label Default
|
14
|
+
def default(content: "Default")
|
15
|
+
render(Primer::Box.new) { content }
|
16
|
+
end
|
17
|
+
|
18
|
+
# @label Border
|
19
|
+
def border(content: "Box with border")
|
20
|
+
render(Primer::Box.new(border: true, p: 3)) { content }
|
21
|
+
end
|
22
|
+
|
23
|
+
# @label Border Bottom
|
24
|
+
def border_bottom(content: "Box with bottom border")
|
25
|
+
render(Primer::Box.new(border: :bottom, p: 3)) { content }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/static/arguments.json
CHANGED
@@ -43,6 +43,12 @@
|
|
43
43
|
"default": "`:none`",
|
44
44
|
"description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
|
45
45
|
},
|
46
|
+
{
|
47
|
+
"name": "form_arguments",
|
48
|
+
"type": "Hash",
|
49
|
+
"default": "`{}`",
|
50
|
+
"description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an [ActionMenu](/components/alpha/actionmenu) instead of using this feature directly."
|
51
|
+
},
|
46
52
|
{
|
47
53
|
"name": "system_arguments",
|
48
54
|
"type": "Hash",
|
@@ -73,6 +79,17 @@
|
|
73
79
|
}
|
74
80
|
]
|
75
81
|
},
|
82
|
+
{
|
83
|
+
"component": "ActionList::FormWrapper",
|
84
|
+
"status": "alpha",
|
85
|
+
"a11y_reviewed": false,
|
86
|
+
"short_name": "ActionListFormWrapper",
|
87
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb",
|
88
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/",
|
89
|
+
"parameters": [
|
90
|
+
|
91
|
+
]
|
92
|
+
},
|
76
93
|
{
|
77
94
|
"component": "ActionList::Heading",
|
78
95
|
"status": "alpha",
|
@@ -81,12 +98,6 @@
|
|
81
98
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/heading.rb",
|
82
99
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/heading/default/",
|
83
100
|
"parameters": [
|
84
|
-
{
|
85
|
-
"name": "id",
|
86
|
-
"type": "String",
|
87
|
-
"default": "`self.class.generate_id`",
|
88
|
-
"description": "The group's identifier (ID attribute in HTML)."
|
89
|
-
},
|
90
101
|
{
|
91
102
|
"name": "title",
|
92
103
|
"type": "String",
|
@@ -111,12 +122,6 @@
|
|
111
122
|
"default": "`:subtle`",
|
112
123
|
"description": "Display a background color if scheme is `filled`."
|
113
124
|
},
|
114
|
-
{
|
115
|
-
"name": "tag",
|
116
|
-
"type": "Integer",
|
117
|
-
"default": "N/A",
|
118
|
-
"description": "Semantic tag for the heading."
|
119
|
-
},
|
120
125
|
{
|
121
126
|
"name": "system_arguments",
|
122
127
|
"type": "Hash",
|
@@ -169,6 +174,12 @@
|
|
169
174
|
"default": "`{}`",
|
170
175
|
"description": "[System arguments](/system-arguments) used to construct the item's anchor or button tag."
|
171
176
|
},
|
177
|
+
{
|
178
|
+
"name": "form_arguments",
|
179
|
+
"type": "Hash",
|
180
|
+
"default": "`{}`",
|
181
|
+
"description": "Allows the item to submit a form on click. The URL passed in the `href:` option will be used as the form action. Pass the `method:` option to this hash to control what kind of request is made, One of `:delete`, `:get`, `:head`, `:patch`, `:post`, or `:put`. The `name:` option is required and specifies the desired name of the field that will be included in the params sent to the server on form submission. Specify the `value:` option to send a custom value to the server; otherwise the value of `name:` is sent."
|
182
|
+
},
|
172
183
|
{
|
173
184
|
"name": "truncate_label",
|
174
185
|
"type": "Boolean",
|
@@ -263,6 +274,12 @@
|
|
263
274
|
"default": "`:outside_bottom`",
|
264
275
|
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`.."
|
265
276
|
},
|
277
|
+
{
|
278
|
+
"name": "size",
|
279
|
+
"type": "Symbol",
|
280
|
+
"default": "`:auto`",
|
281
|
+
"description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.."
|
282
|
+
},
|
266
283
|
{
|
267
284
|
"name": "src",
|
268
285
|
"type": "String",
|
@@ -291,7 +308,13 @@
|
|
291
308
|
"name": "select_variant",
|
292
309
|
"type": "Symbol",
|
293
310
|
"default": "`:none`",
|
294
|
-
"description": "
|
311
|
+
"description": "One of `:multiple`, `:none`, or `:single`."
|
312
|
+
},
|
313
|
+
{
|
314
|
+
"name": "form_arguments",
|
315
|
+
"type": "Hash",
|
316
|
+
"default": "`{}`",
|
317
|
+
"description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
|
295
318
|
},
|
296
319
|
{
|
297
320
|
"name": "system_arguments",
|
@@ -319,7 +342,7 @@
|
|
319
342
|
"name": "system_arguments",
|
320
343
|
"type": "Hash",
|
321
344
|
"default": "N/A",
|
322
|
-
"description": "
|
345
|
+
"description": "The arguments accepted by [ActionList](/components/alpha/actionlist)"
|
323
346
|
}
|
324
347
|
]
|
325
348
|
},
|
@@ -1361,6 +1384,28 @@
|
|
1361
1384
|
}
|
1362
1385
|
]
|
1363
1386
|
},
|
1387
|
+
{
|
1388
|
+
"component": "NavList::Divider",
|
1389
|
+
"status": "alpha",
|
1390
|
+
"a11y_reviewed": false,
|
1391
|
+
"short_name": "NavListDivider",
|
1392
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/divider.rb",
|
1393
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/divider/default/",
|
1394
|
+
"parameters": [
|
1395
|
+
{
|
1396
|
+
"name": "scheme",
|
1397
|
+
"type": "Symbol",
|
1398
|
+
"default": "`:subtle`",
|
1399
|
+
"description": "Display a background color if scheme is `filled`."
|
1400
|
+
},
|
1401
|
+
{
|
1402
|
+
"name": "system_arguments",
|
1403
|
+
"type": "Hash",
|
1404
|
+
"default": "N/A",
|
1405
|
+
"description": "[System arguments](/system-arguments)"
|
1406
|
+
}
|
1407
|
+
]
|
1408
|
+
},
|
1364
1409
|
{
|
1365
1410
|
"component": "NavList::Group",
|
1366
1411
|
"status": "alpha",
|
data/static/audited_at.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"Primer::Alpha::ActionList": "",
|
3
3
|
"Primer::Alpha::ActionList::Divider": "",
|
4
|
+
"Primer::Alpha::ActionList::FormWrapper": "",
|
4
5
|
"Primer::Alpha::ActionList::Heading": "",
|
5
6
|
"Primer::Alpha::ActionList::Item": "",
|
6
7
|
"Primer::Alpha::ActionMenu": "",
|
@@ -30,6 +31,7 @@
|
|
30
31
|
"Primer::Alpha::Menu": "",
|
31
32
|
"Primer::Alpha::MultiInput": "",
|
32
33
|
"Primer::Alpha::NavList": "",
|
34
|
+
"Primer::Alpha::NavList::Divider": "",
|
33
35
|
"Primer::Alpha::NavList::Group": "",
|
34
36
|
"Primer::Alpha::NavList::Item": "",
|
35
37
|
"Primer::Alpha::Navigation::Tab": "",
|
data/static/classes.json
CHANGED
data/static/constants.json
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
"DEFAULT_SCHEME": "full",
|
6
6
|
"DEFAULT_SELECT_VARIANT": "none",
|
7
7
|
"Divider": "Primer::Alpha::ActionList::Divider",
|
8
|
+
"FormWrapper": "Primer::Alpha::ActionList::FormWrapper",
|
8
9
|
"Heading": "Primer::Alpha::ActionList::Heading",
|
9
10
|
"Item": "Primer::Alpha::ActionList::Item",
|
10
11
|
"MENU_ROLE": "menu",
|
@@ -39,6 +40,17 @@
|
|
39
40
|
"filled"
|
40
41
|
]
|
41
42
|
},
|
43
|
+
"Primer::Alpha::ActionList::FormWrapper": {
|
44
|
+
"DEFAULT_HTTP_METHOD": "get",
|
45
|
+
"HTTP_METHOD_OPTIONS": [
|
46
|
+
"get",
|
47
|
+
"post",
|
48
|
+
"patch",
|
49
|
+
"put",
|
50
|
+
"delete",
|
51
|
+
"head"
|
52
|
+
]
|
53
|
+
},
|
42
54
|
"Primer::Alpha::ActionList::Heading": {
|
43
55
|
"DEFAULT_SCHEME": "subtle",
|
44
56
|
"HEADING_LEVELS": [
|
@@ -369,9 +381,12 @@
|
|
369
381
|
"Primer::Alpha::MultiInput": {
|
370
382
|
},
|
371
383
|
"Primer::Alpha::NavList": {
|
384
|
+
"Divider": "Primer::Alpha::NavList::Divider",
|
372
385
|
"Group": "Primer::Alpha::NavList::Group",
|
373
386
|
"Item": "Primer::Alpha::NavList::Item"
|
374
387
|
},
|
388
|
+
"Primer::Alpha::NavList::Divider": {
|
389
|
+
},
|
375
390
|
"Primer::Alpha::NavList::Group": {
|
376
391
|
},
|
377
392
|
"Primer::Alpha::NavList::Item": {
|
@@ -623,7 +638,12 @@
|
|
623
638
|
]
|
624
639
|
},
|
625
640
|
"Primer::Beta::AutoComplete::Item": {
|
626
|
-
"
|
641
|
+
"DEFAULT_DESCRIPTION_VARIANT": "block",
|
642
|
+
"DESCRIPTION_VARIANT_MAPPINGS": {
|
643
|
+
"inline": "ActionListItem-descriptionWrap--inline",
|
644
|
+
"block": "ActionListItem-descriptionWrap"
|
645
|
+
},
|
646
|
+
"DESCRIPTION_VARIANT_OPTIONS": [
|
627
647
|
"inline",
|
628
648
|
"block"
|
629
649
|
]
|