openproject-primer_view_components 0.67.0 → 0.69.0
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 +18 -0
- data/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_element.d.ts +5 -0
- data/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +17 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view.d.ts +1 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.d.ts +1 -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/action_menu/action_menu_element.d.ts +5 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.js +111 -16
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +136 -23
- data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +17 -0
- data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.js +62 -0
- data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.ts +67 -0
- data/app/components/primer/alpha/action_menu/list.rb +3 -1
- data/app/components/primer/alpha/action_menu/list_wrapper.rb +31 -0
- data/app/components/primer/alpha/action_menu/menu.html.erb +24 -0
- data/app/components/primer/alpha/action_menu/menu.rb +136 -0
- data/app/components/primer/alpha/action_menu/primary_menu.rb +86 -0
- data/app/components/primer/alpha/action_menu/sub_menu.rb +74 -0
- data/app/components/primer/alpha/action_menu/sub_menu_item.html.erb +5 -0
- data/app/components/primer/alpha/action_menu/sub_menu_item.rb +54 -0
- data/app/components/primer/alpha/action_menu.html.erb +1 -26
- data/app/components/primer/alpha/action_menu.rb +44 -118
- data/app/components/primer/alpha/select_panel.rb +3 -3
- data/app/components/primer/open_project/border_box/collapsible_header.rb +0 -3
- data/app/components/primer/open_project/collapsible_section.rb +1 -7
- data/app/components/primer/open_project/page_header/title.rb +1 -1
- data/app/components/primer/open_project/tree_view/tree_view.d.ts +1 -0
- data/app/components/primer/open_project/tree_view/tree_view.js +34 -1
- data/app/components/primer/open_project/tree_view/tree_view.ts +37 -0
- data/app/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.d.ts +1 -0
- data/app/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.js +14 -0
- data/app/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.ts +18 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +13 -4
- data/previews/primer/alpha/action_menu_preview/opens_dialog.html.erb +20 -11
- data/previews/primer/alpha/action_menu_preview/single_select_form_items.html.erb +13 -2
- data/previews/primer/alpha/action_menu_preview/sub_menus.html.erb +19 -0
- data/previews/primer/alpha/action_menu_preview/with_actions.html.erb +20 -11
- data/previews/primer/alpha/action_menu_preview/with_deferred_content.html.erb +24 -0
- data/previews/primer/alpha/action_menu_preview.rb +93 -29
- data/previews/primer/open_project/border_box/collapsible_header_preview/playground.html.erb +1 -1
- data/previews/primer/open_project/tree_view_preview/async_alpha.html.erb +12 -0
- data/previews/primer/open_project/tree_view_preview.rb +24 -0
- data/static/arguments.json +169 -68
- data/static/audited_at.json +4 -0
- data/static/constants.json +28 -8
- data/static/info_arch.json +794 -170
- data/static/previews.json +39 -0
- data/static/statuses.json +4 -0
- metadata +15 -2
@@ -0,0 +1,24 @@
|
|
1
|
+
<% if nest_in_sub_menu %>
|
2
|
+
<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>
|
3
|
+
<% menu.with_show_button { "Menu with deferred content" } %>
|
4
|
+
<% menu.with_sub_menu_item(label: "Sub-menu", menu_id: "deferred", src: action_menu_deferred_path) %>
|
5
|
+
<% end %>
|
6
|
+
<% else %>
|
7
|
+
<%= render(Primer::Alpha::ActionMenu.new(menu_id: "deferred", src: action_menu_deferred_path)) do |menu| %>
|
8
|
+
<% menu.with_show_button { "Menu with deferred content" } %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%# This is used by the items rendered by ActionMenuController#deferred. It needs to be rendered %>
|
13
|
+
<%# here and not returned alongside async-rendered menu items in case of sub-menu nesting. Any %>
|
14
|
+
<%# additional HTML like this will end up being wrapped in a <ul> that's invisible when the menu is %>
|
15
|
+
<%# closed, and appear to never open. %>
|
16
|
+
<%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: "Confirm deletion")) do |d| %>
|
17
|
+
<%= render(Primer::Alpha::Dialog::Body.new()) do %>
|
18
|
+
Are you sure you want to delete this?
|
19
|
+
<% end %>
|
20
|
+
<%= render(Primer::Alpha::Dialog::Footer.new()) do %>
|
21
|
+
<%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
|
22
|
+
<%= render(Primer::Beta::Button.new(scheme: :danger)) { "Delete" } %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
@@ -11,7 +11,9 @@ module Primer
|
|
11
11
|
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
12
12
|
# @param size [Symbol] select [auto, small, medium, large, xlarge]
|
13
13
|
def playground(
|
14
|
-
select_variant: Primer::Alpha::ActionMenu::DEFAULT_SELECT_VARIANT,
|
14
|
+
select_variant: Primer::Alpha::ActionMenu::PrimaryMenu::DEFAULT_SELECT_VARIANT,
|
15
|
+
anchor_align: Primer::Alpha::Overlay::DEFAULT_ANCHOR_ALIGN,
|
16
|
+
anchor_side: Primer::Alpha::Overlay::DEFAULT_ANCHOR_SIDE,
|
15
17
|
size: Primer::Alpha::Overlay::DEFAULT_SIZE
|
16
18
|
)
|
17
19
|
render(Primer::Alpha::ActionMenu.new(select_variant: select_variant, anchor_align: anchor_align, anchor_side: anchor_side, size: size)) do |menu|
|
@@ -55,13 +57,9 @@ module Primer
|
|
55
57
|
# @label With groups
|
56
58
|
#
|
57
59
|
# @snapshot interactive
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
button.with_trailing_action_icon(icon: :"triangle-down")
|
62
|
-
"Favorite character"
|
63
|
-
end
|
64
|
-
|
60
|
+
# @param nest_in_sub_menu toggle
|
61
|
+
def with_groups(nest_in_sub_menu: false)
|
62
|
+
contents = -> (menu) {
|
65
63
|
menu.with_group do |group|
|
66
64
|
group.with_heading(title: "Battlestar Galactica")
|
67
65
|
group.with_item(label: "William Adama")
|
@@ -85,6 +83,21 @@ module Primer
|
|
85
83
|
group.with_item(label: "Han Solo")
|
86
84
|
group.with_item(label: "Chewbacca")
|
87
85
|
end
|
86
|
+
}
|
87
|
+
|
88
|
+
render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1")) do |menu|
|
89
|
+
menu.with_show_button do |button|
|
90
|
+
button.with_trailing_action_icon(icon: :"triangle-down")
|
91
|
+
"Favorite character"
|
92
|
+
end
|
93
|
+
|
94
|
+
if nest_in_sub_menu
|
95
|
+
menu.with_sub_menu_item(label: "Sub-menu") do |sub_menu_item|
|
96
|
+
contents.call(sub_menu_item)
|
97
|
+
end
|
98
|
+
else
|
99
|
+
contents.call(menu)
|
100
|
+
end
|
88
101
|
end
|
89
102
|
end
|
90
103
|
|
@@ -159,10 +172,9 @@ module Primer
|
|
159
172
|
|
160
173
|
# @label Multiple select
|
161
174
|
#
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
175
|
+
# @param nest_in_sub_menu toggle
|
176
|
+
def multiple_select(nest_in_sub_menu: false)
|
177
|
+
content = -> (menu) {
|
166
178
|
menu.with_avatar_item(
|
167
179
|
src: "https://avatars.githubusercontent.com/u/18661030?v=4",
|
168
180
|
username: "langermank",
|
@@ -189,6 +201,18 @@ module Primer
|
|
189
201
|
avatar_arguments: { shape: :square },
|
190
202
|
item_id: :armagan
|
191
203
|
)
|
204
|
+
}
|
205
|
+
|
206
|
+
render(Primer::Alpha::ActionMenu.new(select_variant: :multiple)) do |menu|
|
207
|
+
menu.with_show_button { "Menu" }
|
208
|
+
|
209
|
+
if nest_in_sub_menu
|
210
|
+
menu.with_sub_menu_item(label: "Sub-menu") do |sub_menu|
|
211
|
+
content.call(sub_menu)
|
212
|
+
end
|
213
|
+
else
|
214
|
+
content.call(menu)
|
215
|
+
end
|
192
216
|
end
|
193
217
|
end
|
194
218
|
|
@@ -218,17 +242,29 @@ module Primer
|
|
218
242
|
# @label Single Select with Internal Label
|
219
243
|
#
|
220
244
|
# @snapshot interactive
|
221
|
-
|
245
|
+
# @param nest_in_sub_menu toggle
|
246
|
+
def single_select_with_internal_label(nest_in_sub_menu: false)
|
247
|
+
contents = -> (menu) {
|
248
|
+
menu.with_item(label: "Copy link") do |item|
|
249
|
+
item.with_trailing_visual_label(scheme: :accent, inline: true).with_content("Recommended")
|
250
|
+
end
|
251
|
+
menu.with_item(label: "Quote reply", active: true)
|
252
|
+
menu.with_item(label: "Reference in new issue")
|
253
|
+
}
|
254
|
+
|
222
255
|
render(Primer::Alpha::ActionMenu.new(select_variant: :single, dynamic_label: true, dynamic_label_prefix: "Menu")) do |menu|
|
223
256
|
menu.with_show_button do |button|
|
224
257
|
button.with_trailing_action_icon(icon: :"triangle-down")
|
225
258
|
"Menu"
|
226
259
|
end
|
227
|
-
|
228
|
-
|
260
|
+
|
261
|
+
if nest_in_sub_menu
|
262
|
+
menu.with_sub_menu_item(label: "Sub-menu") do |sub_menu_item|
|
263
|
+
contents.call(sub_menu_item)
|
264
|
+
end
|
265
|
+
else
|
266
|
+
contents.call(menu)
|
229
267
|
end
|
230
|
-
menu.with_item(label: "Quote reply", active: true)
|
231
|
-
menu.with_item(label: "Reference in new issue")
|
232
268
|
end
|
233
269
|
end
|
234
270
|
|
@@ -266,10 +302,9 @@ module Primer
|
|
266
302
|
|
267
303
|
# @label With deferred content
|
268
304
|
#
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
end
|
305
|
+
# @param nest_in_sub_menu toggle
|
306
|
+
def with_deferred_content(nest_in_sub_menu: false)
|
307
|
+
render_with_template(locals: { nest_in_sub_menu: nest_in_sub_menu })
|
273
308
|
end
|
274
309
|
|
275
310
|
# @label With deferred preloaded content
|
@@ -283,8 +318,13 @@ module Primer
|
|
283
318
|
# @label With actions
|
284
319
|
#
|
285
320
|
# @param disable_items toggle
|
286
|
-
|
287
|
-
|
321
|
+
# @param nest_in_sub_menu toggle
|
322
|
+
def with_actions(disable_items: false, nest_in_sub_menu: false, route_format: :html)
|
323
|
+
render_with_template(locals: {
|
324
|
+
disable_items: disable_items,
|
325
|
+
nest_in_sub_menu: nest_in_sub_menu,
|
326
|
+
route_format: route_format
|
327
|
+
})
|
288
328
|
end
|
289
329
|
|
290
330
|
# @label Single select form
|
@@ -295,14 +335,16 @@ module Primer
|
|
295
335
|
|
296
336
|
# @label Single select form items
|
297
337
|
#
|
298
|
-
|
299
|
-
|
338
|
+
# @param nest_in_sub_menu toggle
|
339
|
+
def single_select_form_items(route_format: :html, nest_in_sub_menu: false)
|
340
|
+
render_with_template(locals: { route_format: route_format, nest_in_sub_menu: nest_in_sub_menu })
|
300
341
|
end
|
301
342
|
|
302
343
|
# @label Multiple select form
|
303
344
|
#
|
304
|
-
|
305
|
-
|
345
|
+
# @param nest_in_sub_menu toggle
|
346
|
+
def multiple_select_form(route_format: :html, nest_in_sub_menu: false)
|
347
|
+
render_with_template(locals: { route_format: route_format, nest_in_sub_menu: nest_in_sub_menu })
|
306
348
|
end
|
307
349
|
|
308
350
|
# @label With disabled items
|
@@ -317,9 +359,11 @@ module Primer
|
|
317
359
|
|
318
360
|
# @label Opens a dialog
|
319
361
|
#
|
320
|
-
|
362
|
+
# @param nest_in_sub_menu toggle
|
363
|
+
def opens_dialog(menu_id: "menu-1", nest_in_sub_menu: false)
|
321
364
|
render_with_template(locals: {
|
322
|
-
menu_id: menu_id
|
365
|
+
menu_id: menu_id,
|
366
|
+
nest_in_sub_menu: nest_in_sub_menu
|
323
367
|
})
|
324
368
|
end
|
325
369
|
|
@@ -405,6 +449,26 @@ module Primer
|
|
405
449
|
# @label Two menus
|
406
450
|
#
|
407
451
|
def two_menus; end
|
452
|
+
|
453
|
+
# @label Sub-menus
|
454
|
+
#
|
455
|
+
# @param anchor_align [Symbol] select [start, center, end]
|
456
|
+
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
457
|
+
# @param sub_menu_anchor_align [Symbol] select [start, center, end]
|
458
|
+
# @param sub_menu_anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
459
|
+
def sub_menus(
|
460
|
+
anchor_align: Primer::Alpha::ActionMenu::PrimaryMenu::DEFAULT_ANCHOR_ALIGN,
|
461
|
+
anchor_side: Primer::Alpha::ActionMenu::PrimaryMenu::DEFAULT_ANCHOR_SIDE,
|
462
|
+
sub_menu_anchor_align: Primer::Alpha::ActionMenu::SubMenu::DEFAULT_ANCHOR_ALIGN,
|
463
|
+
sub_menu_anchor_side: Primer::Alpha::ActionMenu::SubMenu::DEFAULT_ANCHOR_SIDE
|
464
|
+
)
|
465
|
+
render_with_template(locals: {
|
466
|
+
anchor_align: anchor_align.to_sym,
|
467
|
+
anchor_side: anchor_side.to_sym,
|
468
|
+
sub_menu_anchor_align: sub_menu_anchor_align,
|
469
|
+
sub_menu_anchor_side: sub_menu_anchor_side
|
470
|
+
})
|
471
|
+
end
|
408
472
|
end
|
409
473
|
end
|
410
474
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
collapsed: collapsed)) do |header| %>
|
5
5
|
<% header.with_title { title } %>
|
6
6
|
<% header.with_count(count: count) %>
|
7
|
-
<% header.with_description { description }
|
7
|
+
<% header.with_description { description } %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
10
10
|
<% component.with_body { "Body" } %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div style="max-width: 400px">
|
2
|
+
<%= render(Primer::OpenProject::TreeView.new) do |tree_view| %>
|
3
|
+
<% tree_view.with_sub_tree(label: "primer") do |sub_tree| %>
|
4
|
+
<% sub_tree.with_leading_visual_icons do |icons| %>
|
5
|
+
<% icons.with_expanded_icon(icon: :"file-directory-open-fill", color: :accent) %>
|
6
|
+
<% icons.with_collapsed_icon(icon: :"file-directory-fill", color: :accent) %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% sub_tree.with_loading_skeleton(src: tree_view_items_async_alpha_path(action_menu_expanded: action_menu_expanded)) %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
@@ -76,6 +76,15 @@ module Primer
|
|
76
76
|
})
|
77
77
|
end
|
78
78
|
|
79
|
+
# @label Async alpha
|
80
|
+
#
|
81
|
+
# @param action_menu_expanded [Boolean] toggle
|
82
|
+
def async_alpha(action_menu_expanded: false)
|
83
|
+
render_with_template(locals: {
|
84
|
+
action_menu_expanded: coerce_bool(action_menu_expanded)
|
85
|
+
})
|
86
|
+
end
|
87
|
+
|
79
88
|
# @label Leaf node playground
|
80
89
|
#
|
81
90
|
# @param label [String] text
|
@@ -117,6 +126,21 @@ module Primer
|
|
117
126
|
})
|
118
127
|
end
|
119
128
|
|
129
|
+
# @label Auto expansion
|
130
|
+
#
|
131
|
+
def auto_expansion
|
132
|
+
render(Primer::OpenProject::TreeView.new) do |tree|
|
133
|
+
tree.with_sub_tree(label: "Level 1") do |level1|
|
134
|
+
level1.with_sub_tree(label: "Level 2") do |level2|
|
135
|
+
# marking this node as expanded should automatically expand all ancestors
|
136
|
+
level2.with_sub_tree(label: "Level 3", expanded: true) do |level3|
|
137
|
+
level3.with_leaf(label: "Level 4")
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
120
144
|
private
|
121
145
|
|
122
146
|
def coerce_bool(value)
|
data/static/arguments.json
CHANGED
@@ -329,77 +329,11 @@
|
|
329
329
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu.rb",
|
330
330
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/default/",
|
331
331
|
"parameters": [
|
332
|
-
{
|
333
|
-
"name": "menu_id",
|
334
|
-
"type": "String",
|
335
|
-
"default": "`self.class.generate_id`",
|
336
|
-
"description": "Id of the menu."
|
337
|
-
},
|
338
|
-
{
|
339
|
-
"name": "anchor_align",
|
340
|
-
"type": "Symbol",
|
341
|
-
"default": "`:start`",
|
342
|
-
"description": "One of `:center`, `:end`, or `:start`.."
|
343
|
-
},
|
344
|
-
{
|
345
|
-
"name": "anchor_side",
|
346
|
-
"type": "Symbol",
|
347
|
-
"default": "`:outside_bottom`",
|
348
|
-
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`.."
|
349
|
-
},
|
350
|
-
{
|
351
|
-
"name": "size",
|
352
|
-
"type": "Symbol",
|
353
|
-
"default": "`:auto`",
|
354
|
-
"description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.."
|
355
|
-
},
|
356
|
-
{
|
357
|
-
"name": "src",
|
358
|
-
"type": "String",
|
359
|
-
"default": "`nil`",
|
360
|
-
"description": "Used with an `include-fragment` element to load menu content from the given source URL."
|
361
|
-
},
|
362
|
-
{
|
363
|
-
"name": "preload",
|
364
|
-
"type": "Boolean",
|
365
|
-
"default": "`false`",
|
366
|
-
"description": "When true, and src is present, loads the `include-fragment` on trigger hover."
|
367
|
-
},
|
368
|
-
{
|
369
|
-
"name": "dynamic_label",
|
370
|
-
"type": "Boolean",
|
371
|
-
"default": "`false`",
|
372
|
-
"description": "Whether or not to display the text of the currently selected item in the show button."
|
373
|
-
},
|
374
|
-
{
|
375
|
-
"name": "dynamic_label_prefix",
|
376
|
-
"type": "String",
|
377
|
-
"default": "`nil`",
|
378
|
-
"description": "If provided, the prefix is prepended to the dynamic label and displayed in the show button."
|
379
|
-
},
|
380
|
-
{
|
381
|
-
"name": "select_variant",
|
382
|
-
"type": "Symbol",
|
383
|
-
"default": "`:none`",
|
384
|
-
"description": "One of `:multiple`, `:none`, or `:single`."
|
385
|
-
},
|
386
|
-
{
|
387
|
-
"name": "form_arguments",
|
388
|
-
"type": "Hash",
|
389
|
-
"default": "`{}`",
|
390
|
-
"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."
|
391
|
-
},
|
392
|
-
{
|
393
|
-
"name": "overlay_arguments",
|
394
|
-
"type": "Hash",
|
395
|
-
"default": "`{}`",
|
396
|
-
"description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
|
397
|
-
},
|
398
332
|
{
|
399
333
|
"name": "system_arguments",
|
400
334
|
"type": "Hash",
|
401
335
|
"default": "N/A",
|
402
|
-
"description": "
|
336
|
+
"description": "The arguments accepted by [ActionMenu::PrimaryMenu](/components/alpha/actionmenuprimarymenu)."
|
403
337
|
}
|
404
338
|
]
|
405
339
|
},
|
@@ -490,7 +424,7 @@
|
|
490
424
|
"name": "system_arguments",
|
491
425
|
"type": "Hash",
|
492
426
|
"default": "N/A",
|
493
|
-
"description": "The arguments accepted by [
|
427
|
+
"description": "The arguments accepted by [ActionMenu::ListWrapper](/components/alpha/actionmenulistwrapper)"
|
494
428
|
}
|
495
429
|
]
|
496
430
|
},
|
@@ -516,6 +450,173 @@
|
|
516
450
|
}
|
517
451
|
]
|
518
452
|
},
|
453
|
+
{
|
454
|
+
"component": "ActionMenu::Menu",
|
455
|
+
"status": "alpha",
|
456
|
+
"a11y_reviewed": false,
|
457
|
+
"short_name": "ActionMenuMenu",
|
458
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/menu.rb",
|
459
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/menu/default/",
|
460
|
+
"parameters": [
|
461
|
+
{
|
462
|
+
"name": "anchor_align",
|
463
|
+
"type": "Symbol",
|
464
|
+
"default": "N/A",
|
465
|
+
"description": "One of `:center`, `:end`, or `:start`."
|
466
|
+
},
|
467
|
+
{
|
468
|
+
"name": "anchor_side",
|
469
|
+
"type": "Symbol",
|
470
|
+
"default": "N/A",
|
471
|
+
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
|
472
|
+
},
|
473
|
+
{
|
474
|
+
"name": "menu_id",
|
475
|
+
"type": "String",
|
476
|
+
"default": "`self.class.generate_id`",
|
477
|
+
"description": "Id of the menu."
|
478
|
+
},
|
479
|
+
{
|
480
|
+
"name": "size",
|
481
|
+
"type": "Symbol",
|
482
|
+
"default": "`:auto`",
|
483
|
+
"description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`."
|
484
|
+
},
|
485
|
+
{
|
486
|
+
"name": "src",
|
487
|
+
"type": "String",
|
488
|
+
"default": "`nil`",
|
489
|
+
"description": "Used with an `include-fragment` element to load menu content from the given source URL."
|
490
|
+
},
|
491
|
+
{
|
492
|
+
"name": "preload",
|
493
|
+
"type": "Boolean",
|
494
|
+
"default": "`false`",
|
495
|
+
"description": "When true, and src is present, loads the `include-fragment` on trigger hover."
|
496
|
+
},
|
497
|
+
{
|
498
|
+
"name": "select_variant",
|
499
|
+
"type": "Symbol",
|
500
|
+
"default": "`:none`",
|
501
|
+
"description": "One of `:multiple`, `:none`, or `:single`."
|
502
|
+
},
|
503
|
+
{
|
504
|
+
"name": "form_arguments",
|
505
|
+
"type": "Hash",
|
506
|
+
"default": "`{}`",
|
507
|
+
"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."
|
508
|
+
},
|
509
|
+
{
|
510
|
+
"name": "overlay_arguments",
|
511
|
+
"type": "Hash",
|
512
|
+
"default": "`{}`",
|
513
|
+
"description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
|
514
|
+
},
|
515
|
+
{
|
516
|
+
"name": "list_arguments",
|
517
|
+
"type": "Hash",
|
518
|
+
"default": "`{}`",
|
519
|
+
"description": "Arguments to pass to the underlying [ActionMenu::List](/components/alpha/actionmenulist)"
|
520
|
+
},
|
521
|
+
{
|
522
|
+
"name": "system_arguments",
|
523
|
+
"type": "Hash",
|
524
|
+
"default": "N/A",
|
525
|
+
"description": "[System arguments](/system-arguments)."
|
526
|
+
}
|
527
|
+
]
|
528
|
+
},
|
529
|
+
{
|
530
|
+
"component": "ActionMenu::PrimaryMenu",
|
531
|
+
"status": "alpha",
|
532
|
+
"a11y_reviewed": false,
|
533
|
+
"short_name": "ActionMenuPrimaryMenu",
|
534
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/primary_menu.rb",
|
535
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/primary_menu/default/",
|
536
|
+
"parameters": [
|
537
|
+
{
|
538
|
+
"name": "anchor_align",
|
539
|
+
"type": "Symbol",
|
540
|
+
"default": "`:start`",
|
541
|
+
"description": "One of `:center`, `:end`, or `:start`."
|
542
|
+
},
|
543
|
+
{
|
544
|
+
"name": "anchor_side",
|
545
|
+
"type": "Symbol",
|
546
|
+
"default": "`:outside_bottom`",
|
547
|
+
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
|
548
|
+
},
|
549
|
+
{
|
550
|
+
"name": "dynamic_label",
|
551
|
+
"type": "Boolean",
|
552
|
+
"default": "`false`",
|
553
|
+
"description": "Whether or not to display the text of the currently selected item in the show button."
|
554
|
+
},
|
555
|
+
{
|
556
|
+
"name": "dynamic_label_prefix",
|
557
|
+
"type": "String",
|
558
|
+
"default": "`nil`",
|
559
|
+
"description": "If provided, the prefix is prepended to the dynamic label and displayed in the show button."
|
560
|
+
},
|
561
|
+
{
|
562
|
+
"name": "system_arguments",
|
563
|
+
"type": "Hash",
|
564
|
+
"default": "N/A",
|
565
|
+
"description": "[System arguments](/system-arguments)."
|
566
|
+
}
|
567
|
+
]
|
568
|
+
},
|
569
|
+
{
|
570
|
+
"component": "ActionMenu::SubMenu",
|
571
|
+
"status": "alpha",
|
572
|
+
"a11y_reviewed": false,
|
573
|
+
"short_name": "ActionMenuSubMenu",
|
574
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/sub_menu.rb",
|
575
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/sub_menu/default/",
|
576
|
+
"parameters": [
|
577
|
+
{
|
578
|
+
"name": "menu_id",
|
579
|
+
"type": "String",
|
580
|
+
"default": "N/A",
|
581
|
+
"description": "Id of the menu."
|
582
|
+
},
|
583
|
+
{
|
584
|
+
"name": "anchor_align",
|
585
|
+
"type": "Symbol",
|
586
|
+
"default": "`:start`",
|
587
|
+
"description": "One of `:center`, `:end`, or `:start`."
|
588
|
+
},
|
589
|
+
{
|
590
|
+
"name": "anchor_side",
|
591
|
+
"type": "Symbol",
|
592
|
+
"default": "`:outside_right`",
|
593
|
+
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
|
594
|
+
},
|
595
|
+
{
|
596
|
+
"name": "overlay_arguments",
|
597
|
+
"type": "Hash",
|
598
|
+
"default": "`{}`",
|
599
|
+
"description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
|
600
|
+
},
|
601
|
+
{
|
602
|
+
"name": "system_arguments",
|
603
|
+
"type": "Hash",
|
604
|
+
"default": "N/A",
|
605
|
+
"description": "[System arguments](/system-arguments)."
|
606
|
+
}
|
607
|
+
]
|
608
|
+
},
|
609
|
+
{
|
610
|
+
"component": "ActionMenu::SubMenuItem",
|
611
|
+
"status": "alpha",
|
612
|
+
"a11y_reviewed": false,
|
613
|
+
"short_name": "ActionMenuSubMenuItem",
|
614
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/sub_menu_item.rb",
|
615
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/sub_menu_item/default/",
|
616
|
+
"parameters": [
|
617
|
+
|
618
|
+
]
|
619
|
+
},
|
519
620
|
{
|
520
621
|
"component": "AutoComplete",
|
521
622
|
"status": "deprecated",
|
data/static/audited_at.json
CHANGED
@@ -12,6 +12,10 @@
|
|
12
12
|
"Primer::Alpha::ActionMenu::Heading": "",
|
13
13
|
"Primer::Alpha::ActionMenu::List": "",
|
14
14
|
"Primer::Alpha::ActionMenu::ListWrapper": "2023-07-10",
|
15
|
+
"Primer::Alpha::ActionMenu::Menu": "",
|
16
|
+
"Primer::Alpha::ActionMenu::PrimaryMenu": "",
|
17
|
+
"Primer::Alpha::ActionMenu::SubMenu": "",
|
18
|
+
"Primer::Alpha::ActionMenu::SubMenuItem": "",
|
15
19
|
"Primer::Alpha::AutoComplete": "",
|
16
20
|
"Primer::Alpha::AutoComplete::Item": "",
|
17
21
|
"Primer::Alpha::Banner": "",
|
data/static/constants.json
CHANGED
@@ -152,18 +152,15 @@
|
|
152
152
|
]
|
153
153
|
},
|
154
154
|
"Primer::Alpha::ActionMenu": {
|
155
|
-
"DEFAULT_PRELOAD": false,
|
156
|
-
"DEFAULT_SELECT_VARIANT": "none",
|
157
155
|
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::GeneratedSlotMethods",
|
158
156
|
"Group": "Primer::Alpha::ActionMenu::Group",
|
159
157
|
"Heading": "Primer::Alpha::ActionMenu::Heading",
|
160
158
|
"List": "Primer::Alpha::ActionMenu::List",
|
161
159
|
"ListWrapper": "Primer::Alpha::ActionMenu::ListWrapper",
|
162
|
-
"
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
]
|
160
|
+
"Menu": "Primer::Alpha::ActionMenu::Menu",
|
161
|
+
"PrimaryMenu": "Primer::Alpha::ActionMenu::PrimaryMenu",
|
162
|
+
"SubMenu": "Primer::Alpha::ActionMenu::SubMenu",
|
163
|
+
"SubMenuItem": "Primer::Alpha::ActionMenu::SubMenuItem"
|
167
164
|
},
|
168
165
|
"Primer::Alpha::ActionMenu::Group": {
|
169
166
|
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::Group::GeneratedSlotMethods"
|
@@ -183,6 +180,29 @@
|
|
183
180
|
"Primer::Alpha::ActionMenu::ListWrapper": {
|
184
181
|
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::ListWrapper::GeneratedSlotMethods"
|
185
182
|
},
|
183
|
+
"Primer::Alpha::ActionMenu::Menu": {
|
184
|
+
"DEFAULT_PRELOAD": false,
|
185
|
+
"DEFAULT_SELECT_VARIANT": "none",
|
186
|
+
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::Menu::GeneratedSlotMethods",
|
187
|
+
"SELECT_VARIANT_OPTIONS": [
|
188
|
+
"single",
|
189
|
+
"multiple",
|
190
|
+
"none"
|
191
|
+
]
|
192
|
+
},
|
193
|
+
"Primer::Alpha::ActionMenu::PrimaryMenu": {
|
194
|
+
"DEFAULT_ANCHOR_ALIGN": "start",
|
195
|
+
"DEFAULT_ANCHOR_SIDE": "outside_bottom",
|
196
|
+
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::PrimaryMenu::GeneratedSlotMethods"
|
197
|
+
},
|
198
|
+
"Primer::Alpha::ActionMenu::SubMenu": {
|
199
|
+
"DEFAULT_ANCHOR_ALIGN": "start",
|
200
|
+
"DEFAULT_ANCHOR_SIDE": "outside_right",
|
201
|
+
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::SubMenu::GeneratedSlotMethods"
|
202
|
+
},
|
203
|
+
"Primer::Alpha::ActionMenu::SubMenuItem": {
|
204
|
+
"GeneratedSlotMethods": "Primer::Alpha::ActionMenu::SubMenuItem::GeneratedSlotMethods"
|
205
|
+
},
|
186
206
|
"Primer::Alpha::AutoComplete": {
|
187
207
|
"GeneratedSlotMethods": "Primer::Alpha::AutoComplete::GeneratedSlotMethods",
|
188
208
|
"Item": "Primer::Alpha::AutoComplete::Item"
|
@@ -1721,7 +1741,7 @@
|
|
1721
1741
|
},
|
1722
1742
|
"Primer::OpenProject::PageHeader::Title": {
|
1723
1743
|
"GeneratedSlotMethods": "Primer::OpenProject::PageHeader::Title::GeneratedSlotMethods",
|
1724
|
-
"HEADING_TAG_FALLBACK": "
|
1744
|
+
"HEADING_TAG_FALLBACK": "h2",
|
1725
1745
|
"HEADING_TAG_OPTIONS": [
|
1726
1746
|
"h1",
|
1727
1747
|
"h2",
|