openproject-primer_view_components 0.95.0 → 0.97.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 +32 -0
- data/app/assets/javascripts/primer_view_components.js +11 -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_bar.css +1 -1
- data/app/components/primer/alpha/action_bar.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +7 -2
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.json +16 -27
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.html.erb +1 -5
- data/app/components/primer/alpha/action_list.pcss +55 -81
- data/app/components/primer/alpha/action_list.rb +9 -7
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +6 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.js +239 -84
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +261 -81
- data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +4 -1
- data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.js +38 -14
- data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.ts +42 -13
- data/app/components/primer/alpha/action_menu/menu.html.erb +27 -19
- data/app/components/primer/alpha/action_menu/menu.rb +7 -0
- data/app/components/primer/alpha/action_menu/menu_loader.d.ts +21 -0
- data/app/components/primer/alpha/action_menu/menu_loader.js +221 -0
- data/app/components/primer/alpha/action_menu/menu_loader.ts +269 -0
- data/app/components/primer/alpha/action_menu/primary_menu.rb +15 -0
- data/app/components/primer/alpha/action_menu.rb +55 -0
- 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/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/button_marketing.css +1 -1
- data/app/components/primer/alpha/button_marketing.css.map +1 -1
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dropdown/menu.rb +1 -1
- data/app/components/primer/alpha/dropdown.css +1 -1
- data/app/components/primer/alpha/dropdown.css.json +1 -1
- data/app/components/primer/alpha/dropdown.css.map +1 -1
- data/app/components/primer/alpha/layout.css +1 -1
- data/app/components/primer/alpha/layout.css.json +3 -3
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.json +3 -3
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.json +1 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/select_panel.css +1 -1
- data/app/components/primer/alpha/select_panel.css.map +1 -1
- data/app/components/primer/alpha/skeleton_box.css +1 -1
- data/app/components/primer/alpha/skeleton_box.css.map +1 -1
- data/app/components/primer/alpha/stack.css +1 -1
- data/app/components/primer/alpha/stack.css.map +1 -1
- data/app/components/primer/alpha/stack_item.css +1 -1
- data/app/components/primer/alpha/stack_item.css.map +1 -1
- 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/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- 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/tree_view.css +1 -1
- data/app/components/primer/alpha/tree_view.css.json +3 -3
- data/app/components/primer/alpha/tree_view.css.map +1 -1
- 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/beta/border_box.css +1 -1
- data/app/components/primer/beta/border_box.css.json +5 -5
- data/app/components/primer/beta/border_box.css.map +1 -1
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +97 -0
- data/app/components/primer/beta/button.rb +15 -3
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/flash.css +1 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/link.css +1 -1
- data/app/components/primer/beta/link.css.json +1 -1
- data/app/components/primer/beta/link.css.map +1 -1
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/progress_bar.css +1 -1
- data/app/components/primer/beta/progress_bar.css.map +1 -1
- data/app/components/primer/beta/relative_time.rb +7 -1
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.json +2 -2
- data/app/components/primer/beta/state.css.map +1 -1
- 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/open_project/border_grid.css +1 -1
- data/app/components/primer/open_project/border_grid.css.map +1 -1
- data/app/components/primer/open_project/color_field.css +1 -1
- data/app/components/primer/open_project/color_field.css.map +1 -1
- data/app/components/primer/open_project/inline_message.css +1 -1
- data/app/components/primer/open_project/inline_message.css.map +1 -1
- data/app/components/primer/open_project/input_group.css +1 -1
- data/app/components/primer/open_project/input_group.css.map +1 -1
- data/app/components/primer/open_project/keybinding_hint/chords.d.ts +5 -0
- data/app/components/primer/open_project/keybinding_hint/chords.js +29 -0
- data/app/components/primer/open_project/keybinding_hint/chords.ts +38 -0
- data/app/components/primer/open_project/keybinding_hint/key_names.d.ts +16 -0
- data/app/components/primer/open_project/keybinding_hint/key_names.js +107 -0
- data/app/components/primer/open_project/keybinding_hint/key_names.ts +116 -0
- data/app/components/primer/open_project/keybinding_hint/localized_names.d.ts +22 -0
- data/app/components/primer/open_project/keybinding_hint/localized_names.js +47 -0
- data/app/components/primer/open_project/keybinding_hint/localized_names.ts +71 -0
- data/app/components/primer/open_project/keybinding_hint/names.rb +92 -0
- data/app/components/primer/open_project/keybinding_hint/names_from_scope.d.ts +21 -0
- data/app/components/primer/open_project/keybinding_hint/names_from_scope.js +81 -0
- data/app/components/primer/open_project/keybinding_hint/names_from_scope.ts +96 -0
- data/app/components/primer/open_project/keybinding_hint/platform.d.ts +10 -0
- data/app/components/primer/open_project/keybinding_hint/platform.js +24 -0
- data/app/components/primer/open_project/keybinding_hint/platform.ts +34 -0
- data/app/components/primer/open_project/keybinding_hint/platform_override.d.ts +2 -0
- data/app/components/primer/open_project/keybinding_hint/platform_override.js +4 -0
- data/app/components/primer/open_project/keybinding_hint/platform_override.ts +7 -0
- data/app/components/primer/open_project/keybinding_hint.css +1 -0
- data/app/components/primer/open_project/keybinding_hint.css.json +10 -0
- data/app/components/primer/open_project/keybinding_hint.css.map +1 -0
- data/app/components/primer/open_project/keybinding_hint.html.erb +4 -0
- data/app/components/primer/open_project/keybinding_hint.pcss +65 -0
- data/app/components/primer/open_project/keybinding_hint.rb +112 -0
- data/app/components/primer/open_project/keybinding_hint_element.d.ts +31 -0
- data/app/components/primer/open_project/keybinding_hint_element.js +183 -0
- data/app/components/primer/open_project/keybinding_hint_element.ts +152 -0
- data/app/components/primer/open_project/page_header.css +1 -1
- data/app/components/primer/open_project/page_header.css.json +2 -2
- data/app/components/primer/open_project/page_header.css.map +1 -1
- data/app/components/primer/open_project/pagination.css +1 -1
- data/app/components/primer/open_project/pagination.css.json +1 -1
- data/app/components/primer/open_project/pagination.css.map +1 -1
- data/app/components/primer/open_project/sub_header.css +1 -1
- data/app/components/primer/open_project/sub_header.css.map +1 -1
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.pcss +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/app/components/primer/truncate.css +1 -1
- data/app/components/primer/truncate.css.json +3 -4
- data/app/components/primer/truncate.css.map +1 -1
- data/app/controllers/primer/view_components/action_menu_controller.rb +35 -0
- data/app/views/primer/view_components/action_menu/deferred.html.erb +25 -11
- data/app/views/primer/view_components/action_menu/deferred_form.html.erb +10 -0
- data/app/views/primer/view_components/action_menu/deferred_preload.html.erb +7 -1
- data/config/locales/en.yml +179 -0
- data/config/routes.rb +1 -0
- data/lib/primer/accessibility.rb +1 -2
- data/lib/primer/classify.rb +1 -2
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/action_list_preview.rb +46 -1
- data/previews/primer/alpha/action_menu_preview/deferred_refresh.html.erb +34 -0
- data/previews/primer/alpha/action_menu_preview/deferred_refresh_form.html.erb +9 -0
- data/previews/primer/alpha/action_menu_preview/sub_menus.html.erb +1 -1
- data/previews/primer/alpha/action_menu_preview.rb +19 -2
- data/previews/primer/open_project/keybinding_hint_preview/full_format.html.erb +3 -0
- data/previews/primer/open_project/keybinding_hint_preview/in_action_list.html.erb +12 -0
- data/previews/primer/open_project/keybinding_hint_preview/in_button.html.erb +24 -0
- data/previews/primer/open_project/keybinding_hint_preview/platforms.html.erb +8 -0
- data/previews/primer/open_project/keybinding_hint_preview/playground.html.erb +4 -0
- data/previews/primer/open_project/keybinding_hint_preview/prose.html.erb +3 -0
- data/previews/primer/open_project/keybinding_hint_preview/schemes.html.erb +6 -0
- data/previews/primer/open_project/keybinding_hint_preview/sequence.html.erb +1 -0
- data/previews/primer/open_project/keybinding_hint_preview/sizes.html.erb +4 -0
- data/previews/primer/open_project/keybinding_hint_preview.rb +71 -0
- data/static/arguments.json +55 -3
- data/static/audited_at.json +1 -0
- data/static/classes.json +15 -3
- data/static/classnames.cjs +5 -1
- data/static/classnames.js +5 -1
- data/static/constants.json +35 -0
- data/static/info_arch.json +255 -10
- data/static/previews.json +177 -0
- data/static/statuses.json +1 -0
- metadata +45 -5
- data/app/components/primer/alpha/text_field.css.json +0 -134
- data/app/components/primer/alpha/toggle_switch.css.json +0 -40
- data/app/components/primer/alpha/underline_nav.css.json +0 -26
- data/app/components/primer/beta/button.css.json +0 -86
data/static/info_arch.json
CHANGED
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"name": "show_dividers",
|
|
217
217
|
"type": "Boolean",
|
|
218
218
|
"default": "`false`",
|
|
219
|
-
"description": "Display a
|
|
219
|
+
"description": "Display a dividing line above each item in the list when it does not follow a header or divider. These are more subtle than manually inserted dividers. Only supported by `ActionList` itself so far. Menus have too many special cases. Hidden items are not supported, whether they are rendered with `hidden: true` or hidden later, eg. by filtering: the lines are placed with CSS sibling selectors. To leave items out, don't render them, or remove them from the DOM rather than setting `hidden`."
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
222
|
"name": "select_variant",
|
|
@@ -374,6 +374,12 @@
|
|
|
374
374
|
"parameters": [],
|
|
375
375
|
"return_types": []
|
|
376
376
|
},
|
|
377
|
+
{
|
|
378
|
+
"name": "show_dividers",
|
|
379
|
+
"description": "Returns the value of attribute show_dividers.",
|
|
380
|
+
"parameters": [],
|
|
381
|
+
"return_types": []
|
|
382
|
+
},
|
|
377
383
|
{
|
|
378
384
|
"name": "build_item",
|
|
379
385
|
"description": "Builds a new item but does not add it to the list. Use this method\ninstead of the `#with_item` slot if you need to render an item outside\nthe context of a list, eg. if rendering additional items to append to\nan existing list, perhaps via a separate HTTP request.",
|
|
@@ -502,6 +508,19 @@
|
|
|
502
508
|
]
|
|
503
509
|
}
|
|
504
510
|
},
|
|
511
|
+
{
|
|
512
|
+
"preview_path": "primer/alpha/action_list/with_dividers",
|
|
513
|
+
"name": "with_dividers",
|
|
514
|
+
"snapshot": "true",
|
|
515
|
+
"skip_rules": {
|
|
516
|
+
"wont_fix": [
|
|
517
|
+
"region"
|
|
518
|
+
],
|
|
519
|
+
"will_fix": [
|
|
520
|
+
"color-contrast"
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
},
|
|
505
524
|
{
|
|
506
525
|
"preview_path": "primer/alpha/action_list/divider",
|
|
507
526
|
"name": "divider",
|
|
@@ -958,7 +977,7 @@
|
|
|
958
977
|
},
|
|
959
978
|
{
|
|
960
979
|
"name": "trailing_visual",
|
|
961
|
-
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n
|
|
980
|
+
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n```\n\nTo render a keyboard shortcut hint, call the `with_trailing_visual_keybinding_hint` method, e.g. `with_trailing_visual_keybinding_hint(keys: \"Mod+Enter\")`. It accepts the arguments accepted by {{#link_to_component}}Primer::OpenProject::KeybindingHint{{/link_to_component}}.",
|
|
962
981
|
"parameters": []
|
|
963
982
|
},
|
|
964
983
|
{
|
|
@@ -1173,7 +1192,7 @@
|
|
|
1173
1192
|
},
|
|
1174
1193
|
{
|
|
1175
1194
|
"fully_qualified_name": "Primer::Alpha::ActionMenu",
|
|
1176
|
-
"description": "ActionMenu is used for actions, navigation, to display secondary options, or single/multi select lists. They appear when\nusers interact with buttons, actions, or other controls.\n\nThe only allowed elements for the `Item` components are: `:a`, `:button`, and `:clipboard-copy`. The default is `:button`.\n\n### Select variants\n\nWhile `ActionMenu`s default to a list of buttons that can link to other pages, copy text to the clipboard, etc, they also support\n`single` and `multiple` select variants. The single select variant allows a single item to be \"selected\" (i.e. marked \"active\")\nwhen clicked, which will cause a check mark to appear to the left of the item text. When the `multiple` select variant is chosen,\nmultiple items may be selected and check marks will appear next to each selected item.\n\nUse the `select_variant:` option to control which variant the `ActionMenu` uses. For more information, see the documentation on\nsupported arguments below.\n\n### Dynamic labels\n\nWhen using the `single` select variant, an optional label indicating the selected item can be displayed inside the menu button.\nDynamic labels can also be prefixed with custom text.\n\nPass `dynamic_label: true` to enable dynamic label behavior, and pass `dynamic_label_prefix: \"<string>\"` to set a custom prefix.\nFor more information, see the documentation on supported arguments below.\n\n### `ActionMenu`s as form inputs\n\nWhen using either the `single` or `multiple` select variants, `ActionMenu`s can be used as form inputs. They behave very\nsimilarly to how HTML `<select>` boxes behave, and play nicely with Rails' built-in form mechanisms. Pass arguments via the\n`form_arguments:` argument, including the Rails form builder object and the name of the field:\n\n```erb\n<% form_with(url: update_merge_strategy_path) do |f| %>\n <%= render(Primer::Alpha::ActionMenu.new(form_arguments: { builder: f, name: \"merge_strategy\" })) do |menu| %>\n <% menu.with_item(label: \"Fast forward\", data: { value: \"fast_forward\" }) %>\n <% menu.with_item(label: \"Recursive\", data: { value: \"recursive\" }) %>\n <% menu.with_item(label: \"Ours\", data: { value: \"ours\" }) %>\n <% menu.with_item(label: \"Theirs\", data: { value: \"theirs\" }) %>\n <% end %>\n<% end %>\n```\n\nThe value of the `data: { value: ... }` argument is sent to the server on submit, keyed using the name provided above\n(eg. `\"merge_strategy\"`). If no value is provided for an item, the value of that item is the item's label. Here's the\ncorresponding `MergeStrategyController` that might be written to handle the form above:\n\n```ruby\nclass MergeStrategyController < ApplicationController\n def update\n puts \"You chose #{merge_strategy_params[:merge_strategy]}\"\n end\n\n private\n\n def merge_strategy_params\n params.permit(:merge_strategy)\n end\nend\n```\n\n### `ActionMenu` items that submit forms\n\nWhereas `ActionMenu` items normally permit navigation via `<a>` tags which make HTTP `get` requests, `ActionMenu` items\nalso permit navigation via `POST` requests. To enable this behavior, include the `href:` argument as normal, but also pass\nthe `form_arguments:` argument to the appropriate item:\n\n```erb\n<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>\n <% menu.with_item(\n label: \"Repository\",\n href: update_repo_grouping_path,\n form_arguments: {\n method: :post,\n name: \"group_by\",\n value: \"repository\"\n }\n ) %>\n<% end %>\n```\n\nMake sure to specify `method: :post`, as the default is `:get`. When clicked, the list item will submit a POST request to\nthe URL passed in the `href:` argument, including a parameter named `\"group_by\"` with a value of `\"repository\"`. If no value\nis given, the name, eg. `\"group_by\"`, will be used as the value.\n\nIt is possible to include multiple fields on submit. Instead of passing the `name:` and `value:` arguments, pass an array via\nthe `inputs:` argument:\n\n```erb\n<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>\n <% menu.with_show_button { \"Group By\" } %>\n <% menu.with_item(\n label: \"Repository\",\n href: update_repo_grouping_path,\n form_arguments: {\n method: :post,\n inputs: [{\n name: \"group_by\",\n value: \"repository\"\n }, {\n name: \"some_other_field\",\n value: \"some value\",\n }],\n }\n ) %>\n<% end %>\n```\n\n### Form arguments\n\nThe following table summarizes the arguments allowed in the `form_arguments:` hash mentioned above.\n\n|Name |Type |Default|Description|\n|:----------------|:-------------|:------|:----------|\n|`method` |`Symbol` |`:get` |The HTTP request method to use to submit the form. One of `:get`, `:post`, `:patch`, `:put`, `:delete`, or `:head`|\n|`name` |`String` |`nil` |The name of the field that will be sent to the server on submit.|\n|`value` |`String` |`nil` |The value of the field that will be sent to the server on submit.|\n|`input_arguments`|`Hash` |`{}` |Additional key/value pairs to emit as HTML attributes on the `<input type=\"hidden\">` element.|\n|`inputs` |`Array<Hash>` |`[]` |An array of hashes representing HTML `<input type=\"hidden\">` elements. Must contain at least `name:` and `value:` keys. If additional key/value pairs are provided, they are emitted as HTML attributes on the `<input>` element. This argument supercedes the `name:`, `value:`, and `:input_arguments` arguments listed above.|\n\nThe elements of the `inputs:` array will be emitted as HTML `<input type=\"hidden\">` elements.\n\n### JavaScript API\n\n`ActionMenu`s render an `<action-menu>` custom element that exposes behavior to the client.\n\n#### Query methods\n\n* `getItemById(itemId: string): Element`: Returns the item's HTML `<li>` element. The return value can be passed as the `item` argument to the other methods listed below.\n* `isItemChecked(item: Element): boolean`: Returns `true` if the item is checked, `false` otherwise.\n* `isItemHidden(item: Element): boolean`: Returns `true` if the item is hidden, `false` otherwise.\n* `isItemDisabled(item: Element): boolean`: Returns `true` if the item is disabled, `false` otherwise.\n\nNOTE: Item IDs are special values provided by the user that are attached to `ActionMenu` items as the `data-item-id`\nHTML attribute. Item IDs can be provided by passing an `item_id:` attribute when adding items to the list, eg:\n\n```erb\n<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>\n <% menu.with_item(item_id: \"my-id\") %>\n<% end %>\n```\n\n#### State methods\n\n* `showItem(item: Element)`: Shows the item, i.e. makes it visible.\n* `hideItem(item: Element)`: Hides the item, i.e. makes it invisible.\n* `enableItem(item: Element)`: Enables the item, i.e. makes it clickable by the mouse and keyboard.\n* `disableItem(item: Element)`: Disables the item, i.e. makes it unclickable by the mouse and keyboard.\n* `checkItem(item: Element)`: Checks the item. Only has an effect in single- and multi-select modes.\n* `uncheckItem(item: Element)`: Unchecks the item. Only has an effect in multi-select mode, since items cannot be unchecked in single-select mode.\n\n#### Events\n\nThe `<action-menu>` element fires an `itemActivated` event whenever an item is activated (eg. clicked) via the mouse or keyboard.\n\n```typescript\ndocument.querySelector(\"action-menu\").addEventListener(\"itemActivated\", (event: CustomEvent<ItemActivatedEvent>) => {\n event.detail.item // Element: the <li> item that was activated\n event.detail.checked // boolean: whether or not the result of the activation checked the item\n})\n```",
|
|
1195
|
+
"description": "ActionMenu is used for actions, navigation, to display secondary options, or single/multi select lists. They appear when\nusers interact with buttons, actions, or other controls.\n\nThe only allowed elements for the `Item` components are: `:a`, `:button`, and `:clipboard-copy`. The default is `:button`.\n\n### Select variants\n\nWhile `ActionMenu`s default to a list of buttons that can link to other pages, copy text to the clipboard, etc, they also support\n`single` and `multiple` select variants. The single select variant allows a single item to be \"selected\" (i.e. marked \"active\")\nwhen clicked, which will cause a check mark to appear to the left of the item text. When the `multiple` select variant is chosen,\nmultiple items may be selected and check marks will appear next to each selected item.\n\nUse the `select_variant:` option to control which variant the `ActionMenu` uses. For more information, see the documentation on\nsupported arguments below.\n\n### Dynamic labels\n\nWhen using the `single` select variant, an optional label indicating the selected item can be displayed inside the menu button.\nDynamic labels can also be prefixed with custom text.\n\nPass `dynamic_label: true` to enable dynamic label behavior, and pass `dynamic_label_prefix: \"<string>\"` to set a custom prefix.\nFor more information, see the documentation on supported arguments below.\n\n### `ActionMenu`s as form inputs\n\nWhen using either the `single` or `multiple` select variants, `ActionMenu`s can be used as form inputs. They behave very\nsimilarly to how HTML `<select>` boxes behave, and play nicely with Rails' built-in form mechanisms. Pass arguments via the\n`form_arguments:` argument, including the Rails form builder object and the name of the field:\n\n```erb\n<% form_with(url: update_merge_strategy_path) do |f| %>\n <%= render(Primer::Alpha::ActionMenu.new(form_arguments: { builder: f, name: \"merge_strategy\" })) do |menu| %>\n <% menu.with_item(label: \"Fast forward\", data: { value: \"fast_forward\" }) %>\n <% menu.with_item(label: \"Recursive\", data: { value: \"recursive\" }) %>\n <% menu.with_item(label: \"Ours\", data: { value: \"ours\" }) %>\n <% menu.with_item(label: \"Theirs\", data: { value: \"theirs\" }) %>\n <% end %>\n<% end %>\n```\n\nThe value of the `data: { value: ... }` argument is sent to the server on submit, keyed using the name provided above\n(eg. `\"merge_strategy\"`). If no value is provided for an item, the value of that item is the item's label. Here's the\ncorresponding `MergeStrategyController` that might be written to handle the form above:\n\n```ruby\nclass MergeStrategyController < ApplicationController\n def update\n puts \"You chose #{merge_strategy_params[:merge_strategy]}\"\n end\n\n private\n\n def merge_strategy_params\n params.permit(:merge_strategy)\n end\nend\n```\n\n### `ActionMenu` items that submit forms\n\nWhereas `ActionMenu` items normally permit navigation via `<a>` tags which make HTTP `get` requests, `ActionMenu` items\nalso permit navigation via `POST` requests. To enable this behavior, include the `href:` argument as normal, but also pass\nthe `form_arguments:` argument to the appropriate item:\n\n```erb\n<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>\n <% menu.with_item(\n label: \"Repository\",\n href: update_repo_grouping_path,\n form_arguments: {\n method: :post,\n name: \"group_by\",\n value: \"repository\"\n }\n ) %>\n<% end %>\n```\n\nMake sure to specify `method: :post`, as the default is `:get`. When clicked, the list item will submit a POST request to\nthe URL passed in the `href:` argument, including a parameter named `\"group_by\"` with a value of `\"repository\"`. If no value\nis given, the name, eg. `\"group_by\"`, will be used as the value.\n\nIt is possible to include multiple fields on submit. Instead of passing the `name:` and `value:` arguments, pass an array via\nthe `inputs:` argument:\n\n```erb\n<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>\n <% menu.with_show_button { \"Group By\" } %>\n <% menu.with_item(\n label: \"Repository\",\n href: update_repo_grouping_path,\n form_arguments: {\n method: :post,\n inputs: [{\n name: \"group_by\",\n value: \"repository\"\n }, {\n name: \"some_other_field\",\n value: \"some value\",\n }],\n }\n ) %>\n<% end %>\n```\n\n### Form arguments\n\nThe following table summarizes the arguments allowed in the `form_arguments:` hash mentioned above.\n\n|Name |Type |Default|Description|\n|:----------------|:-------------|:------|:----------|\n|`method` |`Symbol` |`:get` |The HTTP request method to use to submit the form. One of `:get`, `:post`, `:patch`, `:put`, `:delete`, or `:head`|\n|`name` |`String` |`nil` |The name of the field that will be sent to the server on submit.|\n|`value` |`String` |`nil` |The value of the field that will be sent to the server on submit.|\n|`input_arguments`|`Hash` |`{}` |Additional key/value pairs to emit as HTML attributes on the `<input type=\"hidden\">` element.|\n|`inputs` |`Array<Hash>` |`[]` |An array of hashes representing HTML `<input type=\"hidden\">` elements. Must contain at least `name:` and `value:` keys. If additional key/value pairs are provided, they are emitted as HTML attributes on the `<input>` element. This argument supercedes the `name:`, `value:`, and `:input_arguments` arguments listed above.|\n\nThe elements of the `inputs:` array will be emitted as HTML `<input type=\"hidden\">` elements.\n\n### JavaScript API\n\n`ActionMenu`s render an `<action-menu>` custom element that exposes behavior to the client.\n\n#### Query methods\n\n* `getItemById(itemId: string): Element`: Returns the item's HTML `<li>` element. The return value can be passed as the `item` argument to the other methods listed below.\n* `isItemChecked(item: Element): boolean`: Returns `true` if the item is checked, `false` otherwise.\n* `isItemHidden(item: Element): boolean`: Returns `true` if the item is hidden, `false` otherwise.\n* `isItemDisabled(item: Element): boolean`: Returns `true` if the item is disabled, `false` otherwise.\n\nNOTE: Item IDs are special values provided by the user that are attached to `ActionMenu` items as the `data-item-id`\nHTML attribute. Item IDs can be provided by passing an `item_id:` attribute when adding items to the list, eg:\n\n```erb\n<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>\n <% menu.with_item(item_id: \"my-id\") %>\n<% end %>\n```\n\n#### State methods\n\n* `showItem(item: Element)`: Shows the item, i.e. makes it visible.\n* `hideItem(item: Element)`: Hides the item, i.e. makes it invisible.\n* `enableItem(item: Element)`: Enables the item, i.e. makes it clickable by the mouse and keyboard.\n* `disableItem(item: Element)`: Disables the item, i.e. makes it unclickable by the mouse and keyboard.\n* `checkItem(item: Element)`: Checks the item. Only has an effect in single- and multi-select modes.\n* `uncheckItem(item: Element)`: Unchecks the item. Only has an effect in multi-select mode, since items cannot be unchecked in single-select mode.\n\n#### Events\n\nThe `<action-menu>` element fires an `itemActivated` event whenever an item is activated (eg. clicked) via the mouse or keyboard.\n\n```typescript\ndocument.querySelector(\"action-menu\").addEventListener(\"itemActivated\", (event: CustomEvent<ItemActivatedEvent>) => {\n event.detail.item // Element: the <li> item that was activated\n event.detail.checked // boolean: whether or not the result of the activation checked the item\n})\n```\n\n#### Refreshing deferred content\n\nA primary menu rendered with `src:` renders its loader as a `<template>` and leaves the menu body empty. The first load starts\nwhen the menu first opens, or immediately when rendered with `preload: true`. Deferred sub-menus render their loader in place\nand are not refreshed.\n\nThe `src` attribute on the `<action-menu>` element is the state: setting it to a different URL reloads the items, eg:\n\n```typescript\ndocument.querySelector(\"action-menu\").setAttribute(\"src\", \"/items?filter=open\")\n```\n\nAn open menu reloads its items in place. A closed lazy menu applies the change when it next opens and keeps its previous\nitems, dynamic label and form inputs until then; a preloaded menu reloads at once. Setting `src` to the URL already loaded\ndoes nothing unless the last load failed or returned no menu items, in which case an open or preloaded menu loads again, so\n`src` can be set on every open. A blank `src` is ignored.\n\nIf the response contains no menu items, it is discarded and the menu body stays empty: an open menu closes and focus returns\nto its button, and the menu is fetched again on its next open. Any other markup in such a response is not shown. To keep the\nmenu open, render a disabled item such as \"No actions available\".\n\nA failed load retries the next time the menu opens. To reload at the current `src`, call `refresh()`:\n\n```typescript\ndocument.querySelector(\"action-menu\").refresh()\n```\n\nAn open or preloaded menu reloads at once; a closed lazy one reloads when it next opens. The server response replaces any\nclient-side selection. While a load is pending, and after it fails, the menu keeps submitting its previous form inputs until a\nresponse replaces them.\n\nAn `<include-fragment>` that other code places directly into the menu body (for example a Turbo morph) is picked up and its\n`src` is copied to the `<action-menu>` element. An open or preloaded menu fetches it at once; in a closed lazy menu a lazy\nfragment loads when the menu opens, and an eager one as soon as it is inserted; a fragment that had no `src` yet when it was\ninserted is replaced with a load at the host `src`. If several are inserted together, the last one in the body wins. A menu\nthat is open when the fragment is inserted stays open while it loads, provided the fragment contains a focusable menu item, as\nthe rendered loader does. When a consumer sets a different `src` and other code inserts a fragment in the same synchronous\nblock (before the menu's mutation observer runs), the fragment wins on a closed lazy menu; on an open or preloaded menu the\nlater of the two wins. A response must not itself start with an `<include-fragment>`, which would be picked up the same way.\n\nThe `data-ready` attribute means no load is pending, not that the current `src` has been applied: a closed lazy menu keeps it\nwhen `src` changes, and drops it only when the new load starts.\n\nA loader whose `include-fragment-replace` event a consumer cancelled stays in the body and is fetched again on every open.\n\nA cloned `<action-menu>` that connects to the document loads like any other: a clone of a preloaded menu fetches at once, a\nlazy one when it opens. Consumers that clone a menu for display only (eg. a drag preview) should remove its `src` and any\n`<include-fragment>` inside it before connecting it, since a loader that was pending when the menu was cloned fetches on its\nown.\n\nOnly menus rendered with `src:` can refresh. A menu restored from a Turbo snapshot loads its items again when it next opens\n(at once when preloaded). A menu whose body other code emptied or replaced, for example a Turbo morph that re-rendered the\nserver's empty body, loads again at once when open or preloaded, otherwise when it next opens.",
|
|
1177
1196
|
"accessibility_docs": "The action for the menu item needs to be on the element with `role=\"menuitem\"`. Semantics are removed for everything\nnested inside of it. When a menu item is selected, the menu will close immediately.\n\nAdditional information around the keyboard functionality and implementation can be found on the\n[WAI-ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices-1.2/#menu).",
|
|
1178
1197
|
"is_form_component": false,
|
|
1179
1198
|
"is_published": true,
|
|
@@ -1438,6 +1457,32 @@
|
|
|
1438
1457
|
]
|
|
1439
1458
|
}
|
|
1440
1459
|
},
|
|
1460
|
+
{
|
|
1461
|
+
"preview_path": "primer/alpha/action_menu/deferred_refresh",
|
|
1462
|
+
"name": "deferred_refresh",
|
|
1463
|
+
"snapshot": "false",
|
|
1464
|
+
"skip_rules": {
|
|
1465
|
+
"wont_fix": [
|
|
1466
|
+
"region"
|
|
1467
|
+
],
|
|
1468
|
+
"will_fix": [
|
|
1469
|
+
"color-contrast"
|
|
1470
|
+
]
|
|
1471
|
+
}
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
"preview_path": "primer/alpha/action_menu/deferred_refresh_form",
|
|
1475
|
+
"name": "deferred_refresh_form",
|
|
1476
|
+
"snapshot": "false",
|
|
1477
|
+
"skip_rules": {
|
|
1478
|
+
"wont_fix": [
|
|
1479
|
+
"region"
|
|
1480
|
+
],
|
|
1481
|
+
"will_fix": [
|
|
1482
|
+
"color-contrast"
|
|
1483
|
+
]
|
|
1484
|
+
}
|
|
1485
|
+
},
|
|
1441
1486
|
{
|
|
1442
1487
|
"preview_path": "primer/alpha/action_menu/with_deferred_content_near_bottom_of_viewport",
|
|
1443
1488
|
"name": "with_deferred_content_near_bottom_of_viewport",
|
|
@@ -1754,6 +1799,12 @@
|
|
|
1754
1799
|
"default": "`{}`",
|
|
1755
1800
|
"description": "Arguments to pass to the underlying {{#link_to_component}}Primer::Alpha::ActionMenu::List{{/link_to_component}}"
|
|
1756
1801
|
},
|
|
1802
|
+
{
|
|
1803
|
+
"name": "body_arguments",
|
|
1804
|
+
"type": "Hash",
|
|
1805
|
+
"default": "`{}`",
|
|
1806
|
+
"description": "Arguments to pass to the underlying overlay's `body` slot."
|
|
1807
|
+
},
|
|
1757
1808
|
{
|
|
1758
1809
|
"name": "system_arguments",
|
|
1759
1810
|
"type": "Hash",
|
|
@@ -2245,7 +2296,7 @@
|
|
|
2245
2296
|
},
|
|
2246
2297
|
{
|
|
2247
2298
|
"name": "trailing_visual",
|
|
2248
|
-
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n
|
|
2299
|
+
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n```\n\nTo render a keyboard shortcut hint, call the `with_trailing_visual_keybinding_hint` method, e.g. `with_trailing_visual_keybinding_hint(keys: \"Mod+Enter\")`. It accepts the arguments accepted by {{#link_to_component}}Primer::OpenProject::KeybindingHint{{/link_to_component}}.",
|
|
2249
2300
|
"parameters": []
|
|
2250
2301
|
},
|
|
2251
2302
|
{
|
|
@@ -2456,7 +2507,7 @@
|
|
|
2456
2507
|
"name": "show_dividers",
|
|
2457
2508
|
"type": "Boolean",
|
|
2458
2509
|
"default": "`false`",
|
|
2459
|
-
"description": "Display a
|
|
2510
|
+
"description": "Display a dividing line above each item in the list when it does not follow a header or divider. These are more subtle than manually inserted dividers. Only supported by `ActionList` itself so far. Menus have too many special cases. Hidden items are not supported, whether they are rendered with `hidden: true` or hidden later, eg. by filtering: the lines are placed with CSS sibling selectors. To leave items out, don't render them, or remove them from the DOM rather than setting `hidden`."
|
|
2460
2511
|
},
|
|
2461
2512
|
{
|
|
2462
2513
|
"name": "select_variant",
|
|
@@ -6037,7 +6088,7 @@
|
|
|
6037
6088
|
},
|
|
6038
6089
|
{
|
|
6039
6090
|
"name": "trailing_visual",
|
|
6040
|
-
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n
|
|
6091
|
+
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n```\n\nTo render a keyboard shortcut hint, call the `with_trailing_visual_keybinding_hint` method, e.g. `with_trailing_visual_keybinding_hint(keys: \"Mod+Enter\")`. It accepts the arguments accepted by {{#link_to_component}}Primer::OpenProject::KeybindingHint{{/link_to_component}}.",
|
|
6041
6092
|
"parameters": []
|
|
6042
6093
|
},
|
|
6043
6094
|
{
|
|
@@ -14077,7 +14128,7 @@
|
|
|
14077
14128
|
},
|
|
14078
14129
|
{
|
|
14079
14130
|
"name": "trailing_visual",
|
|
14080
|
-
"description": "Trailing visuals appear to the right of the button text.\n\nUse:\n\n- `trailing_visual_counter` for a {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.",
|
|
14131
|
+
"description": "Trailing visuals appear to the right of the button text.\n\nUse:\n\n- `trailing_visual_counter` for a {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n- `trailing_visual_keybinding_hint` for a {{#link_to_component}}Primer::OpenProject::KeybindingHint{{/link_to_component}}.\n The hint follows the button's size unless `size:` is given.",
|
|
14081
14132
|
"parameters": [
|
|
14082
14133
|
{
|
|
14083
14134
|
"name": "system_arguments",
|
|
@@ -14800,7 +14851,7 @@
|
|
|
14800
14851
|
},
|
|
14801
14852
|
{
|
|
14802
14853
|
"name": "trailing_visual",
|
|
14803
|
-
"description": "Trailing visuals appear to the right of the button text.\n\nUse:\n\n- `trailing_visual_counter` for a {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.",
|
|
14854
|
+
"description": "Trailing visuals appear to the right of the button text.\n\nUse:\n\n- `trailing_visual_counter` for a {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n- `trailing_visual_keybinding_hint` for a {{#link_to_component}}Primer::OpenProject::KeybindingHint{{/link_to_component}}.\n The hint follows the button's size unless `size:` is given.",
|
|
14804
14855
|
"parameters": [
|
|
14805
14856
|
{
|
|
14806
14857
|
"name": "system_arguments",
|
|
@@ -16788,7 +16839,7 @@
|
|
|
16788
16839
|
},
|
|
16789
16840
|
{
|
|
16790
16841
|
"name": "trailing_visual",
|
|
16791
|
-
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n
|
|
16842
|
+
"description": "An icon, label, counter, or text to render to the right of the label.\n\nTo render an icon, call the `with_leading_visual_icon` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\nTo render a label, call the `with_leading_visual_label` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}.\n\nTo render a counter, call the `with_leading_visual_counter` method, which accepts the arguments accepted by {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}.\n\nTo render text, call the `with_leading_visual_text` method and pass a block that returns a string. Eg:\n```ruby\nwith_leading_visual_text { \"Text here\" }\n```\n\nTo render a keyboard shortcut hint, call the `with_trailing_visual_keybinding_hint` method, e.g. `with_trailing_visual_keybinding_hint(keys: \"Mod+Enter\")`. It accepts the arguments accepted by {{#link_to_component}}Primer::OpenProject::KeybindingHint{{/link_to_component}}.",
|
|
16792
16843
|
"parameters": []
|
|
16793
16844
|
},
|
|
16794
16845
|
{
|
|
@@ -17398,7 +17449,7 @@
|
|
|
17398
17449
|
"name": "minute",
|
|
17399
17450
|
"type": "Symbol",
|
|
17400
17451
|
"default": "`MINUTE_DEFAULT`",
|
|
17401
|
-
"description": "What format
|
|
17452
|
+
"description": "What format minutes should take. One of `nil`, `:numeric`, or `:two_digit`."
|
|
17402
17453
|
},
|
|
17403
17454
|
{
|
|
17404
17455
|
"name": "hour",
|
|
@@ -17406,6 +17457,12 @@
|
|
|
17406
17457
|
"default": "`HOUR_DEFAULT`",
|
|
17407
17458
|
"description": "What format hours should take. One of `nil`, `:numeric`, or `:two_digit`."
|
|
17408
17459
|
},
|
|
17460
|
+
{
|
|
17461
|
+
"name": "hour_cycle",
|
|
17462
|
+
"type": "Symbol",
|
|
17463
|
+
"default": "`HOUR_CYCLE_DEFAULT`",
|
|
17464
|
+
"description": "What hour cycle should be used. One of `nil`, `:h11`, `:h12`, `:h23`, or `:h24`."
|
|
17465
|
+
},
|
|
17409
17466
|
{
|
|
17410
17467
|
"name": "weekday",
|
|
17411
17468
|
"type": "Symbol",
|
|
@@ -21822,6 +21879,194 @@
|
|
|
21822
21879
|
],
|
|
21823
21880
|
"subcomponents": []
|
|
21824
21881
|
},
|
|
21882
|
+
{
|
|
21883
|
+
"fully_qualified_name": "Primer::OpenProject::KeybindingHint",
|
|
21884
|
+
"description": "Displays a keyboard shortcut as a visible, screen-reader-friendly hint.\nPort of Primer React's `KeybindingHint`.\n\nThe server renders a plain-text fallback inside the styled chord box.\nThe `<keybinding-hint>` custom element replaces it with platform-specific\nnames (for example ⌘ on Apple platforms, Ctrl elsewhere) and visually\nhidden accessible key names (\"command\", \"shift\", …).\n\n## Translation\n\nKey names follow the current locale: visible condensed and full names,\naccessible names and the \"then\" spoken between chords of a sequence.\nThe component looks them up in the `keybinding_hint` locale scope\n(English defaults in PVC's `config/locales/en.yml`) and passes the names\nfor its keys to the element as JSON in `data-names`. Each name is looked\nup for the exact platform, then `other`, then Primer React's English\ntables. Glyphs such as ↑, ⇧ and ⏎ are not translated.\n\n## Key syntax\n\nUse the key names `KeyboardEvent.key` reports (\"Control\", \"Shift\",\n\"ArrowUp\", \"a\", …), matching the github/hotkey format:\n\n- Join keys with `+` to form a chord pressed together: `\"Mod+Shift+p\"`.\n- Join chords with a space to form a sequence pressed one after the\n other: `\"g i\"` (g, then i).\n- Use `Plus` for the `+` key and `Space` for the space bar.\n- `Mod` means Command on Apple platforms and Control everywhere else.\n\nComma-separated alternatives (`\"s,/\"`) are not supported. The component only\ndisplays hints; it does not register the shortcut.\n\n## Terminology\n\nPrimer React's `variant` is `scheme:` here (`normal` → `:default`,\n`onEmphasis` → `:emphasis`) and its `size=\"normal\"` is `size: :medium`.",
|
|
21885
|
+
"accessibility_docs": null,
|
|
21886
|
+
"is_form_component": false,
|
|
21887
|
+
"is_published": true,
|
|
21888
|
+
"requires_js": false,
|
|
21889
|
+
"component": "OpenProject::KeybindingHint",
|
|
21890
|
+
"status": "open_project",
|
|
21891
|
+
"a11y_reviewed": false,
|
|
21892
|
+
"short_name": "OpenProjectKeybindingHint",
|
|
21893
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/keybinding_hint.rb",
|
|
21894
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/keybinding_hint/default/",
|
|
21895
|
+
"parameters": [
|
|
21896
|
+
{
|
|
21897
|
+
"name": "keys",
|
|
21898
|
+
"type": "String",
|
|
21899
|
+
"default": "N/A",
|
|
21900
|
+
"description": "The keys of the shortcut, e.g. `\"Mod+Shift+p\"` or `\"g i\"`. See the class documentation for the syntax."
|
|
21901
|
+
},
|
|
21902
|
+
{
|
|
21903
|
+
"name": "format",
|
|
21904
|
+
"type": "Symbol",
|
|
21905
|
+
"default": "`:condensed`",
|
|
21906
|
+
"description": "One of `:condensed` or `:full`. `:condensed` shows symbols (⌘⇧P) and suits menus and buttons; `:full` spells keys out (Command + Shift + P) and suits prose."
|
|
21907
|
+
},
|
|
21908
|
+
{
|
|
21909
|
+
"name": "scheme",
|
|
21910
|
+
"type": "Symbol",
|
|
21911
|
+
"default": "`:default`",
|
|
21912
|
+
"description": "One of `:default` or `:emphasis`. Use `:emphasis` on emphasis-coloured backgrounds."
|
|
21913
|
+
},
|
|
21914
|
+
{
|
|
21915
|
+
"name": "size",
|
|
21916
|
+
"type": "Symbol",
|
|
21917
|
+
"default": "`:medium`",
|
|
21918
|
+
"description": "One of `:medium` or `:small`."
|
|
21919
|
+
},
|
|
21920
|
+
{
|
|
21921
|
+
"name": "system_arguments",
|
|
21922
|
+
"type": "Hash",
|
|
21923
|
+
"default": "N/A",
|
|
21924
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
21925
|
+
}
|
|
21926
|
+
],
|
|
21927
|
+
"slots": [],
|
|
21928
|
+
"methods": [
|
|
21929
|
+
{
|
|
21930
|
+
"name": "fallback_chords",
|
|
21931
|
+
"description": "Readable degraded output for no-JS and the pre-upgrade frame. Uses the\ntranslated condensed name for non-Apple platforms where one exists\n(`Mod` as Control); other keys keep their spelling with the first\nletter upcased, so `ArrowUp` stays `ArrowUp` and `p` becomes `P`.",
|
|
21932
|
+
"parameters": [],
|
|
21933
|
+
"return_types": []
|
|
21934
|
+
}
|
|
21935
|
+
],
|
|
21936
|
+
"previews": [
|
|
21937
|
+
{
|
|
21938
|
+
"preview_path": "primer/open_project/keybinding_hint/default",
|
|
21939
|
+
"name": "default",
|
|
21940
|
+
"snapshot": "true",
|
|
21941
|
+
"skip_rules": {
|
|
21942
|
+
"wont_fix": [
|
|
21943
|
+
"region"
|
|
21944
|
+
],
|
|
21945
|
+
"will_fix": [
|
|
21946
|
+
"color-contrast"
|
|
21947
|
+
]
|
|
21948
|
+
}
|
|
21949
|
+
},
|
|
21950
|
+
{
|
|
21951
|
+
"preview_path": "primer/open_project/keybinding_hint/playground",
|
|
21952
|
+
"name": "playground",
|
|
21953
|
+
"snapshot": "false",
|
|
21954
|
+
"skip_rules": {
|
|
21955
|
+
"wont_fix": [
|
|
21956
|
+
"region"
|
|
21957
|
+
],
|
|
21958
|
+
"will_fix": [
|
|
21959
|
+
"color-contrast"
|
|
21960
|
+
]
|
|
21961
|
+
}
|
|
21962
|
+
},
|
|
21963
|
+
{
|
|
21964
|
+
"preview_path": "primer/open_project/keybinding_hint/full_format",
|
|
21965
|
+
"name": "full_format",
|
|
21966
|
+
"snapshot": "false",
|
|
21967
|
+
"skip_rules": {
|
|
21968
|
+
"wont_fix": [
|
|
21969
|
+
"region"
|
|
21970
|
+
],
|
|
21971
|
+
"will_fix": [
|
|
21972
|
+
"color-contrast"
|
|
21973
|
+
]
|
|
21974
|
+
}
|
|
21975
|
+
},
|
|
21976
|
+
{
|
|
21977
|
+
"preview_path": "primer/open_project/keybinding_hint/sequence",
|
|
21978
|
+
"name": "sequence",
|
|
21979
|
+
"snapshot": "false",
|
|
21980
|
+
"skip_rules": {
|
|
21981
|
+
"wont_fix": [
|
|
21982
|
+
"region"
|
|
21983
|
+
],
|
|
21984
|
+
"will_fix": [
|
|
21985
|
+
"color-contrast"
|
|
21986
|
+
]
|
|
21987
|
+
}
|
|
21988
|
+
},
|
|
21989
|
+
{
|
|
21990
|
+
"preview_path": "primer/open_project/keybinding_hint/sizes",
|
|
21991
|
+
"name": "sizes",
|
|
21992
|
+
"snapshot": "false",
|
|
21993
|
+
"skip_rules": {
|
|
21994
|
+
"wont_fix": [
|
|
21995
|
+
"region"
|
|
21996
|
+
],
|
|
21997
|
+
"will_fix": [
|
|
21998
|
+
"color-contrast"
|
|
21999
|
+
]
|
|
22000
|
+
}
|
|
22001
|
+
},
|
|
22002
|
+
{
|
|
22003
|
+
"preview_path": "primer/open_project/keybinding_hint/schemes",
|
|
22004
|
+
"name": "schemes",
|
|
22005
|
+
"snapshot": "false",
|
|
22006
|
+
"skip_rules": {
|
|
22007
|
+
"wont_fix": [
|
|
22008
|
+
"region"
|
|
22009
|
+
],
|
|
22010
|
+
"will_fix": [
|
|
22011
|
+
"color-contrast"
|
|
22012
|
+
]
|
|
22013
|
+
}
|
|
22014
|
+
},
|
|
22015
|
+
{
|
|
22016
|
+
"preview_path": "primer/open_project/keybinding_hint/platforms",
|
|
22017
|
+
"name": "platforms",
|
|
22018
|
+
"snapshot": "true",
|
|
22019
|
+
"skip_rules": {
|
|
22020
|
+
"wont_fix": [
|
|
22021
|
+
"region"
|
|
22022
|
+
],
|
|
22023
|
+
"will_fix": [
|
|
22024
|
+
"color-contrast"
|
|
22025
|
+
]
|
|
22026
|
+
}
|
|
22027
|
+
},
|
|
22028
|
+
{
|
|
22029
|
+
"preview_path": "primer/open_project/keybinding_hint/prose",
|
|
22030
|
+
"name": "prose",
|
|
22031
|
+
"snapshot": "false",
|
|
22032
|
+
"skip_rules": {
|
|
22033
|
+
"wont_fix": [
|
|
22034
|
+
"region"
|
|
22035
|
+
],
|
|
22036
|
+
"will_fix": [
|
|
22037
|
+
"color-contrast"
|
|
22038
|
+
]
|
|
22039
|
+
}
|
|
22040
|
+
},
|
|
22041
|
+
{
|
|
22042
|
+
"preview_path": "primer/open_project/keybinding_hint/in_button",
|
|
22043
|
+
"name": "in_button",
|
|
22044
|
+
"snapshot": "true",
|
|
22045
|
+
"skip_rules": {
|
|
22046
|
+
"wont_fix": [
|
|
22047
|
+
"region"
|
|
22048
|
+
],
|
|
22049
|
+
"will_fix": [
|
|
22050
|
+
"color-contrast"
|
|
22051
|
+
]
|
|
22052
|
+
}
|
|
22053
|
+
},
|
|
22054
|
+
{
|
|
22055
|
+
"preview_path": "primer/open_project/keybinding_hint/in_action_list",
|
|
22056
|
+
"name": "in_action_list",
|
|
22057
|
+
"snapshot": "true",
|
|
22058
|
+
"skip_rules": {
|
|
22059
|
+
"wont_fix": [
|
|
22060
|
+
"region"
|
|
22061
|
+
],
|
|
22062
|
+
"will_fix": [
|
|
22063
|
+
"color-contrast"
|
|
22064
|
+
]
|
|
22065
|
+
}
|
|
22066
|
+
}
|
|
22067
|
+
],
|
|
22068
|
+
"subcomponents": []
|
|
22069
|
+
},
|
|
21825
22070
|
{
|
|
21826
22071
|
"fully_qualified_name": "Primer::OpenProject::PageHeader",
|
|
21827
22072
|
"description": "A ViewComponent PageHeader inspired by the primer react variant",
|
data/static/previews.json
CHANGED
|
@@ -143,6 +143,19 @@
|
|
|
143
143
|
]
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
+
{
|
|
147
|
+
"preview_path": "primer/alpha/action_list/with_dividers",
|
|
148
|
+
"name": "with_dividers",
|
|
149
|
+
"snapshot": "true",
|
|
150
|
+
"skip_rules": {
|
|
151
|
+
"wont_fix": [
|
|
152
|
+
"region"
|
|
153
|
+
],
|
|
154
|
+
"will_fix": [
|
|
155
|
+
"color-contrast"
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
},
|
|
146
159
|
{
|
|
147
160
|
"preview_path": "primer/alpha/action_list/divider",
|
|
148
161
|
"name": "divider",
|
|
@@ -632,6 +645,32 @@
|
|
|
632
645
|
]
|
|
633
646
|
}
|
|
634
647
|
},
|
|
648
|
+
{
|
|
649
|
+
"preview_path": "primer/alpha/action_menu/deferred_refresh",
|
|
650
|
+
"name": "deferred_refresh",
|
|
651
|
+
"snapshot": "false",
|
|
652
|
+
"skip_rules": {
|
|
653
|
+
"wont_fix": [
|
|
654
|
+
"region"
|
|
655
|
+
],
|
|
656
|
+
"will_fix": [
|
|
657
|
+
"color-contrast"
|
|
658
|
+
]
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"preview_path": "primer/alpha/action_menu/deferred_refresh_form",
|
|
663
|
+
"name": "deferred_refresh_form",
|
|
664
|
+
"snapshot": "false",
|
|
665
|
+
"skip_rules": {
|
|
666
|
+
"wont_fix": [
|
|
667
|
+
"region"
|
|
668
|
+
],
|
|
669
|
+
"will_fix": [
|
|
670
|
+
"color-contrast"
|
|
671
|
+
]
|
|
672
|
+
}
|
|
673
|
+
},
|
|
635
674
|
{
|
|
636
675
|
"preview_path": "primer/alpha/action_menu/with_deferred_content_near_bottom_of_viewport",
|
|
637
676
|
"name": "with_deferred_content_near_bottom_of_viewport",
|
|
@@ -9905,6 +9944,144 @@
|
|
|
9905
9944
|
}
|
|
9906
9945
|
]
|
|
9907
9946
|
},
|
|
9947
|
+
{
|
|
9948
|
+
"name": "keybinding_hint",
|
|
9949
|
+
"component": "OpenProject::KeybindingHint",
|
|
9950
|
+
"status": "open_project",
|
|
9951
|
+
"lookup_path": "primer/open_project/keybinding_hint",
|
|
9952
|
+
"examples": [
|
|
9953
|
+
{
|
|
9954
|
+
"preview_path": "primer/open_project/keybinding_hint/default",
|
|
9955
|
+
"name": "default",
|
|
9956
|
+
"snapshot": "true",
|
|
9957
|
+
"skip_rules": {
|
|
9958
|
+
"wont_fix": [
|
|
9959
|
+
"region"
|
|
9960
|
+
],
|
|
9961
|
+
"will_fix": [
|
|
9962
|
+
"color-contrast"
|
|
9963
|
+
]
|
|
9964
|
+
}
|
|
9965
|
+
},
|
|
9966
|
+
{
|
|
9967
|
+
"preview_path": "primer/open_project/keybinding_hint/playground",
|
|
9968
|
+
"name": "playground",
|
|
9969
|
+
"snapshot": "false",
|
|
9970
|
+
"skip_rules": {
|
|
9971
|
+
"wont_fix": [
|
|
9972
|
+
"region"
|
|
9973
|
+
],
|
|
9974
|
+
"will_fix": [
|
|
9975
|
+
"color-contrast"
|
|
9976
|
+
]
|
|
9977
|
+
}
|
|
9978
|
+
},
|
|
9979
|
+
{
|
|
9980
|
+
"preview_path": "primer/open_project/keybinding_hint/full_format",
|
|
9981
|
+
"name": "full_format",
|
|
9982
|
+
"snapshot": "false",
|
|
9983
|
+
"skip_rules": {
|
|
9984
|
+
"wont_fix": [
|
|
9985
|
+
"region"
|
|
9986
|
+
],
|
|
9987
|
+
"will_fix": [
|
|
9988
|
+
"color-contrast"
|
|
9989
|
+
]
|
|
9990
|
+
}
|
|
9991
|
+
},
|
|
9992
|
+
{
|
|
9993
|
+
"preview_path": "primer/open_project/keybinding_hint/sequence",
|
|
9994
|
+
"name": "sequence",
|
|
9995
|
+
"snapshot": "false",
|
|
9996
|
+
"skip_rules": {
|
|
9997
|
+
"wont_fix": [
|
|
9998
|
+
"region"
|
|
9999
|
+
],
|
|
10000
|
+
"will_fix": [
|
|
10001
|
+
"color-contrast"
|
|
10002
|
+
]
|
|
10003
|
+
}
|
|
10004
|
+
},
|
|
10005
|
+
{
|
|
10006
|
+
"preview_path": "primer/open_project/keybinding_hint/sizes",
|
|
10007
|
+
"name": "sizes",
|
|
10008
|
+
"snapshot": "false",
|
|
10009
|
+
"skip_rules": {
|
|
10010
|
+
"wont_fix": [
|
|
10011
|
+
"region"
|
|
10012
|
+
],
|
|
10013
|
+
"will_fix": [
|
|
10014
|
+
"color-contrast"
|
|
10015
|
+
]
|
|
10016
|
+
}
|
|
10017
|
+
},
|
|
10018
|
+
{
|
|
10019
|
+
"preview_path": "primer/open_project/keybinding_hint/schemes",
|
|
10020
|
+
"name": "schemes",
|
|
10021
|
+
"snapshot": "false",
|
|
10022
|
+
"skip_rules": {
|
|
10023
|
+
"wont_fix": [
|
|
10024
|
+
"region"
|
|
10025
|
+
],
|
|
10026
|
+
"will_fix": [
|
|
10027
|
+
"color-contrast"
|
|
10028
|
+
]
|
|
10029
|
+
}
|
|
10030
|
+
},
|
|
10031
|
+
{
|
|
10032
|
+
"preview_path": "primer/open_project/keybinding_hint/platforms",
|
|
10033
|
+
"name": "platforms",
|
|
10034
|
+
"snapshot": "true",
|
|
10035
|
+
"skip_rules": {
|
|
10036
|
+
"wont_fix": [
|
|
10037
|
+
"region"
|
|
10038
|
+
],
|
|
10039
|
+
"will_fix": [
|
|
10040
|
+
"color-contrast"
|
|
10041
|
+
]
|
|
10042
|
+
}
|
|
10043
|
+
},
|
|
10044
|
+
{
|
|
10045
|
+
"preview_path": "primer/open_project/keybinding_hint/prose",
|
|
10046
|
+
"name": "prose",
|
|
10047
|
+
"snapshot": "false",
|
|
10048
|
+
"skip_rules": {
|
|
10049
|
+
"wont_fix": [
|
|
10050
|
+
"region"
|
|
10051
|
+
],
|
|
10052
|
+
"will_fix": [
|
|
10053
|
+
"color-contrast"
|
|
10054
|
+
]
|
|
10055
|
+
}
|
|
10056
|
+
},
|
|
10057
|
+
{
|
|
10058
|
+
"preview_path": "primer/open_project/keybinding_hint/in_button",
|
|
10059
|
+
"name": "in_button",
|
|
10060
|
+
"snapshot": "true",
|
|
10061
|
+
"skip_rules": {
|
|
10062
|
+
"wont_fix": [
|
|
10063
|
+
"region"
|
|
10064
|
+
],
|
|
10065
|
+
"will_fix": [
|
|
10066
|
+
"color-contrast"
|
|
10067
|
+
]
|
|
10068
|
+
}
|
|
10069
|
+
},
|
|
10070
|
+
{
|
|
10071
|
+
"preview_path": "primer/open_project/keybinding_hint/in_action_list",
|
|
10072
|
+
"name": "in_action_list",
|
|
10073
|
+
"snapshot": "true",
|
|
10074
|
+
"skip_rules": {
|
|
10075
|
+
"wont_fix": [
|
|
10076
|
+
"region"
|
|
10077
|
+
],
|
|
10078
|
+
"will_fix": [
|
|
10079
|
+
"color-contrast"
|
|
10080
|
+
]
|
|
10081
|
+
}
|
|
10082
|
+
}
|
|
10083
|
+
]
|
|
10084
|
+
},
|
|
9908
10085
|
{
|
|
9909
10086
|
"name": "page_header",
|
|
9910
10087
|
"component": "OpenProject::PageHeader",
|
data/static/statuses.json
CHANGED
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
"Primer::OpenProject::InlineMessage": "open_project",
|
|
166
166
|
"Primer::OpenProject::InputGroup": "open_project",
|
|
167
167
|
"Primer::OpenProject::InsetBox": "open_project",
|
|
168
|
+
"Primer::OpenProject::KeybindingHint": "open_project",
|
|
168
169
|
"Primer::OpenProject::PageHeader": "open_project",
|
|
169
170
|
"Primer::OpenProject::PageHeader::Dialog": "open_project",
|
|
170
171
|
"Primer::OpenProject::PageHeader::Menu": "open_project",
|