primer_view_components 0.13.2 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +63 -0
- data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +20 -0
- data/app/assets/javascripts/app/components/primer/beta/nav_list.d.ts +0 -11
- data/app/assets/javascripts/app/components/primer/beta/nav_list_group_element.d.ts +19 -0
- data/app/assets/javascripts/app/components/primer/primer.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/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.json +1 -4
- data/app/components/primer/alpha/action_bar.css.map +1 -1
- data/app/components/primer/alpha/action_bar.pcss +1 -17
- data/app/components/primer/alpha/action_bar_element.js +21 -9
- data/app/components/primer/alpha/action_list/item.rb +13 -3
- 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.pcss +3 -1
- data/app/components/primer/alpha/action_list.rb +5 -5
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +20 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.js +126 -28
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +110 -12
- data/app/components/primer/alpha/action_menu/group.rb +23 -0
- data/app/components/primer/alpha/action_menu/heading.rb +17 -0
- data/app/components/primer/alpha/action_menu/list.html.erb +1 -0
- data/app/components/primer/alpha/action_menu/list.rb +62 -60
- data/app/components/primer/alpha/action_menu/list_wrapper.rb +40 -0
- data/app/components/primer/alpha/action_menu.html.erb +20 -18
- data/app/components/primer/alpha/action_menu.rb +38 -1
- 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/button_marketing.css +1 -1
- data/app/components/primer/alpha/button_marketing.css.map +1 -1
- data/app/components/primer/alpha/dialog/header.rb +1 -1
- data/app/components/primer/alpha/dropdown.css +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.map +1 -1
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/nav_list/divider.rb +1 -0
- data/app/components/primer/alpha/nav_list/group.rb +1 -0
- data/app/components/primer/alpha/nav_list/heading.rb +1 -0
- data/app/components/primer/alpha/nav_list/item.rb +1 -0
- data/app/components/primer/alpha/nav_list.rb +1 -0
- data/app/components/primer/alpha/octicon_symbols.html.erb +1 -1
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.json +2 -2
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +6 -2
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.json +0 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.js +2 -1
- data/app/components/primer/alpha/segmented_control.pcss +0 -4
- 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.json +11 -5
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +10 -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/tool_tip.js +8 -4
- data/app/components/primer/alpha/tool_tip.ts +9 -4
- 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/x_banner.js +2 -1
- data/app/components/primer/anchored_position.js +2 -1
- data/app/components/primer/beta/auto_complete/auto_complete.html.erb +1 -7
- data/app/components/primer/beta/auto_complete/item.rb +2 -2
- data/app/components/primer/beta/auto_complete.rb +6 -1
- data/app/components/primer/beta/avatar.rb +1 -1
- data/app/components/primer/beta/base_button.rb +3 -4
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.json +1 -0
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.html.erb +16 -14
- data/app/components/primer/beta/blankslate.pcss +52 -2
- data/app/components/primer/beta/border_box.css +1 -1
- 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.json +9 -9
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.html.erb +18 -20
- data/app/components/primer/beta/button.pcss +15 -16
- data/app/components/primer/beta/button.rb +3 -0
- data/app/components/primer/beta/button_group.css +1 -1
- data/app/components/primer/beta/button_group.css.json +2 -4
- data/app/components/primer/beta/button_group.css.map +1 -1
- data/app/components/primer/beta/button_group.html.erb +3 -1
- data/app/components/primer/beta/button_group.pcss +2 -4
- data/app/components/primer/beta/button_group.rb +41 -12
- data/app/components/primer/beta/clipboard_copy.rb +4 -0
- data/app/components/primer/beta/clipboard_copy_button.rb +25 -0
- data/app/components/primer/beta/counter.rb +1 -1
- data/app/components/primer/beta/flash.html.erb +1 -1
- data/app/components/primer/beta/icon_button.html.erb +4 -6
- data/app/components/primer/beta/icon_button.rb +1 -3
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/link.css +1 -1
- data/app/components/primer/beta/link.css.map +1 -1
- data/app/components/primer/beta/nav_list/group.html.erb +7 -5
- data/app/components/primer/beta/nav_list/group.rb +2 -2
- data/app/components/primer/beta/nav_list.d.ts +0 -11
- data/app/components/primer/beta/nav_list.js +14 -90
- data/app/components/primer/beta/nav_list.ts +1 -85
- data/app/components/primer/beta/nav_list_group_element.d.ts +19 -0
- data/app/components/primer/beta/nav_list_group_element.js +108 -0
- data/app/components/primer/beta/nav_list_group_element.ts +97 -0
- data/app/components/primer/beta/relative_time.rb +4 -4
- data/app/components/primer/beta/subhead.css +1 -1
- data/app/components/primer/beta/subhead.css.json +2 -0
- data/app/components/primer/beta/subhead.css.map +1 -1
- data/app/components/primer/beta/subhead.pcss +8 -1
- data/app/components/primer/beta/subhead.rb +9 -1
- data/app/components/primer/component.rb +3 -0
- data/app/components/primer/focus_group.js +2 -1
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/app/forms/action_menu_form.rb +20 -0
- data/app/forms/immediate_validation_form.rb +2 -2
- data/app/lib/primer/experimental_render_helpers.rb +32 -0
- data/app/lib/primer/experimental_slot_helpers.rb +30 -0
- data/app/lib/primer/fetch_or_fallback_helper.rb +0 -1
- data/app/lib/primer/octicon/cache.rb +1 -1
- data/lib/primer/classify.rb +0 -2
- data/lib/primer/forms/action_menu.html.erb +6 -0
- data/lib/primer/forms/action_menu.rb +25 -0
- data/lib/primer/forms/acts_as_component.rb +0 -3
- data/lib/primer/forms/base.rb +0 -1
- data/lib/primer/forms/base_component.rb +0 -2
- data/lib/primer/forms/dsl/action_menu_input.rb +36 -0
- data/lib/primer/forms/dsl/input.rb +8 -1
- data/lib/primer/forms/dsl/input_methods.rb +9 -0
- data/lib/primer/forms/dsl/text_field_input.rb +8 -0
- data/lib/primer/forms/primer_base_component_wrapper.rb +0 -2
- data/lib/primer/forms/primer_text_field.js +40 -5
- data/lib/primer/forms/primer_text_field.ts +39 -7
- data/lib/primer/forms/validation_message.html.erb +2 -1
- data/lib/primer/static/generate_info_arch.rb +1 -2
- data/lib/primer/static/generate_previews.rb +0 -2
- data/lib/primer/view_components/engine.rb +5 -1
- data/lib/primer/view_components/linters/base_linter.rb +3 -2
- data/lib/primer/view_components/linters/deprecated_components_counter.rb +1 -1
- data/lib/primer/view_components/linters/disallow_action_list.rb +1 -0
- data/lib/primer/view_components/linters/severity_schema.rb +1 -0
- data/lib/primer/view_components/version.rb +2 -3
- data/lib/primer/yard/lookbook_pages_backend.rb +2 -4
- data/lib/rubocop/cop/primer/base_cop.rb +1 -1
- data/lib/rubocop/cop/primer/deprecated_arguments.rb +0 -2
- data/lib/rubocop/cop/primer/deprecated_components.rb +1 -1
- data/lib/rubocop/cop/primer/deprecated_label_schemes.rb +1 -1
- data/lib/rubocop/cop/primer/deprecated_label_variants.rb +1 -1
- data/previews/primer/alpha/action_menu_preview.rb +73 -7
- data/previews/primer/alpha/dialog_preview/with_auto_complete.html.erb +8 -0
- data/previews/primer/alpha/dialog_preview.rb +17 -0
- data/previews/primer/alpha/octicon_symbols_preview/default.html.erb +6 -0
- data/previews/primer/alpha/octicon_symbols_preview/playground.html.erb +13 -0
- data/previews/primer/alpha/octicon_symbols_preview.rb +21 -0
- data/previews/primer/alpha/text_field_preview.rb +5 -0
- data/previews/primer/beta/avatar_preview.rb +6 -0
- data/previews/primer/beta/blankslate_preview/inside_flex_container.html.erb +6 -0
- data/previews/primer/beta/blankslate_preview.rb +3 -0
- data/previews/primer/beta/button_group_preview.rb +11 -0
- data/previews/primer/beta/clipboard_copy_button_preview.rb +29 -0
- data/previews/primer/beta/nav_list_preview.rb +10 -1
- data/previews/primer/beta/subhead_preview.rb +32 -4
- data/previews/primer/forms_preview/action_menu_form.html.erb +3 -0
- data/previews/primer/forms_preview.rb +4 -0
- data/static/arguments.json +167 -14
- data/static/audited_at.json +6 -1
- data/static/classes.json +12 -3
- data/static/constants.json +25 -1
- data/static/info_arch.json +585 -78
- data/static/previews.json +198 -0
- data/static/statuses.json +5 -0
- metadata +24 -2
data/static/info_arch.json
CHANGED
@@ -264,11 +264,17 @@
|
|
264
264
|
"name": "heading",
|
265
265
|
"description": "Heading text rendered above the list of items.",
|
266
266
|
"parameters": [
|
267
|
+
{
|
268
|
+
"name": "component_klass",
|
269
|
+
"type": "Class",
|
270
|
+
"default": "N/A",
|
271
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
272
|
+
},
|
267
273
|
{
|
268
274
|
"name": "system_arguments",
|
269
275
|
"type": "Hash",
|
270
276
|
"default": "N/A",
|
271
|
-
"description": "The arguments accepted by
|
277
|
+
"description": "The arguments accepted by `component_klass`."
|
272
278
|
}
|
273
279
|
]
|
274
280
|
},
|
@@ -775,6 +781,12 @@
|
|
775
781
|
"default": "`nil`",
|
776
782
|
"description": "Item label. If no label is provided, content is used."
|
777
783
|
},
|
784
|
+
{
|
785
|
+
"name": "item_id",
|
786
|
+
"type": "String",
|
787
|
+
"default": "`nil`",
|
788
|
+
"description": "An ID that will be attached to the item's `<li>` element as `data-item-id` for distinguishing between items, perhaps in JavaScript."
|
789
|
+
},
|
778
790
|
{
|
779
791
|
"name": "label_classes",
|
780
792
|
"type": "String",
|
@@ -927,6 +939,13 @@
|
|
927
939
|
|
928
940
|
]
|
929
941
|
},
|
942
|
+
{
|
943
|
+
"name": "item_id",
|
944
|
+
"description": "Returns the value of attribute item_id.",
|
945
|
+
"parameters": [
|
946
|
+
|
947
|
+
]
|
948
|
+
},
|
930
949
|
{
|
931
950
|
"name": "list",
|
932
951
|
"description": "Returns the value of attribute list.",
|
@@ -1128,7 +1147,7 @@
|
|
1128
1147
|
},
|
1129
1148
|
{
|
1130
1149
|
"fully_qualified_name": "Primer::Alpha::ActionMenu",
|
1131
|
-
"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.",
|
1150
|
+
"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`ActionList`s render an `<action-list>` custom element that exposes behavior to the client. For all these methods,\n`itemId` refers to the value of the `item_id:` argument (see below) that is used to populate the `data-item-id` HTML\nattribute.\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\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: ItemActivatedEvent) => {\n event.item // Element: the <li> item that was activated\n event.checked // boolean: whether or not the result of the activation checked the item\n})\n```",
|
1132
1151
|
"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).",
|
1133
1152
|
"is_form_component": false,
|
1134
1153
|
"is_published": true,
|
@@ -1374,6 +1393,32 @@
|
|
1374
1393
|
]
|
1375
1394
|
}
|
1376
1395
|
},
|
1396
|
+
{
|
1397
|
+
"preview_path": "primer/alpha/action_menu/with_groups",
|
1398
|
+
"name": "with_groups",
|
1399
|
+
"snapshot": "interactive",
|
1400
|
+
"skip_rules": {
|
1401
|
+
"wont_fix": [
|
1402
|
+
"region"
|
1403
|
+
],
|
1404
|
+
"will_fix": [
|
1405
|
+
"color-contrast"
|
1406
|
+
]
|
1407
|
+
}
|
1408
|
+
},
|
1409
|
+
{
|
1410
|
+
"preview_path": "primer/alpha/action_menu/with_items_and_groups",
|
1411
|
+
"name": "with_items_and_groups",
|
1412
|
+
"snapshot": "interactive",
|
1413
|
+
"skip_rules": {
|
1414
|
+
"wont_fix": [
|
1415
|
+
"region"
|
1416
|
+
],
|
1417
|
+
"will_fix": [
|
1418
|
+
"color-contrast"
|
1419
|
+
]
|
1420
|
+
}
|
1421
|
+
},
|
1377
1422
|
{
|
1378
1423
|
"preview_path": "primer/alpha/action_menu/wide",
|
1379
1424
|
"name": "wide",
|
@@ -1684,10 +1729,79 @@
|
|
1684
1729
|
"requires_js": false,
|
1685
1730
|
"component": "ActionMenu::List",
|
1686
1731
|
"status": "alpha",
|
1687
|
-
"a11y_reviewed":
|
1732
|
+
"a11y_reviewed": false,
|
1688
1733
|
"short_name": "ActionMenuList",
|
1689
1734
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/list.rb",
|
1690
1735
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/list/default/",
|
1736
|
+
"parameters": [
|
1737
|
+
{
|
1738
|
+
"name": "system_arguments",
|
1739
|
+
"type": "Hash",
|
1740
|
+
"default": "N/A",
|
1741
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList{{/link_to_component}}"
|
1742
|
+
}
|
1743
|
+
],
|
1744
|
+
"slots": [
|
1745
|
+
|
1746
|
+
],
|
1747
|
+
"methods": [
|
1748
|
+
{
|
1749
|
+
"name": "items",
|
1750
|
+
"description": "Returns the value of attribute items.",
|
1751
|
+
"parameters": [
|
1752
|
+
|
1753
|
+
]
|
1754
|
+
}
|
1755
|
+
],
|
1756
|
+
"previews": [
|
1757
|
+
|
1758
|
+
],
|
1759
|
+
"subcomponents": [
|
1760
|
+
|
1761
|
+
]
|
1762
|
+
},
|
1763
|
+
{
|
1764
|
+
"fully_qualified_name": "Primer::Alpha::ActionMenu::Heading",
|
1765
|
+
"description": "Heading used to describe groups within an action menu.",
|
1766
|
+
"accessibility_docs": null,
|
1767
|
+
"is_form_component": false,
|
1768
|
+
"is_published": true,
|
1769
|
+
"requires_js": false,
|
1770
|
+
"component": "ActionMenu::Heading",
|
1771
|
+
"status": "alpha",
|
1772
|
+
"a11y_reviewed": false,
|
1773
|
+
"short_name": "ActionMenuHeading",
|
1774
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/heading.rb",
|
1775
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/heading/default/",
|
1776
|
+
"parameters": [
|
1777
|
+
|
1778
|
+
],
|
1779
|
+
"slots": [
|
1780
|
+
|
1781
|
+
],
|
1782
|
+
"methods": [
|
1783
|
+
|
1784
|
+
],
|
1785
|
+
"previews": [
|
1786
|
+
|
1787
|
+
],
|
1788
|
+
"subcomponents": [
|
1789
|
+
|
1790
|
+
]
|
1791
|
+
},
|
1792
|
+
{
|
1793
|
+
"fully_qualified_name": "Primer::Alpha::ActionMenu::ListWrapper",
|
1794
|
+
"description": "This component is part of {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} and should not be\nused as a standalone component.",
|
1795
|
+
"accessibility_docs": null,
|
1796
|
+
"is_form_component": false,
|
1797
|
+
"is_published": true,
|
1798
|
+
"requires_js": false,
|
1799
|
+
"component": "ActionMenu::ListWrapper",
|
1800
|
+
"status": "alpha",
|
1801
|
+
"a11y_reviewed": true,
|
1802
|
+
"short_name": "ActionMenuListWrapper",
|
1803
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/list_wrapper.rb",
|
1804
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/list_wrapper/default/",
|
1691
1805
|
"parameters": [
|
1692
1806
|
{
|
1693
1807
|
"name": "menu_id",
|
@@ -1707,11 +1821,17 @@
|
|
1707
1821
|
"name": "heading",
|
1708
1822
|
"description": "Heading text rendered above the list of items.",
|
1709
1823
|
"parameters": [
|
1824
|
+
{
|
1825
|
+
"name": "component_klass",
|
1826
|
+
"type": "Class",
|
1827
|
+
"default": "N/A",
|
1828
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
1829
|
+
},
|
1710
1830
|
{
|
1711
1831
|
"name": "system_arguments",
|
1712
1832
|
"type": "Hash",
|
1713
1833
|
"default": "N/A",
|
1714
|
-
"description": "The arguments accepted by
|
1834
|
+
"description": "The arguments accepted by `component_klass`."
|
1715
1835
|
}
|
1716
1836
|
]
|
1717
1837
|
},
|
@@ -1724,69 +1844,115 @@
|
|
1724
1844
|
}
|
1725
1845
|
],
|
1726
1846
|
"methods": [
|
1847
|
+
|
1848
|
+
],
|
1849
|
+
"previews": [
|
1850
|
+
|
1851
|
+
],
|
1852
|
+
"subcomponents": [
|
1853
|
+
|
1854
|
+
]
|
1855
|
+
},
|
1856
|
+
{
|
1857
|
+
"fully_qualified_name": "Primer::Alpha::ActionMenu::Group",
|
1858
|
+
"description": "This component is part of {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} and should not be\nused as a standalone component.",
|
1859
|
+
"accessibility_docs": null,
|
1860
|
+
"is_form_component": false,
|
1861
|
+
"is_published": true,
|
1862
|
+
"requires_js": false,
|
1863
|
+
"component": "ActionMenu::Group",
|
1864
|
+
"status": "alpha",
|
1865
|
+
"a11y_reviewed": true,
|
1866
|
+
"short_name": "ActionMenuGroup",
|
1867
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/group.rb",
|
1868
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/group/default/",
|
1869
|
+
"parameters": [
|
1870
|
+
{
|
1871
|
+
"name": "id",
|
1872
|
+
"type": "String",
|
1873
|
+
"default": "`self.class.generate_id`",
|
1874
|
+
"description": "HTML ID value."
|
1875
|
+
},
|
1876
|
+
{
|
1877
|
+
"name": "role",
|
1878
|
+
"type": "Boolean",
|
1879
|
+
"default": "`nil`",
|
1880
|
+
"description": "ARIA role describing the function of the list. listbox and menu are a common values."
|
1881
|
+
},
|
1727
1882
|
{
|
1728
|
-
"name": "
|
1729
|
-
"
|
1883
|
+
"name": "item_classes",
|
1884
|
+
"type": "String",
|
1885
|
+
"default": "`nil`",
|
1886
|
+
"description": "Additional CSS classes to attach to items."
|
1887
|
+
},
|
1888
|
+
{
|
1889
|
+
"name": "scheme",
|
1890
|
+
"type": "Symbol",
|
1891
|
+
"default": "`:full`",
|
1892
|
+
"description": "One of `:full` or `:inset`. `inset` children are offset (vertically and horizontally) from list edges. `full` (default) children are flush (vertically and horizontally) with list edges."
|
1893
|
+
},
|
1894
|
+
{
|
1895
|
+
"name": "show_dividers",
|
1896
|
+
"type": "Boolean",
|
1897
|
+
"default": "`false`",
|
1898
|
+
"description": "Display a divider above each item in the list when it does not follow a header or divider."
|
1899
|
+
},
|
1900
|
+
{
|
1901
|
+
"name": "select_variant",
|
1902
|
+
"type": "Symbol",
|
1903
|
+
"default": "`:none`",
|
1904
|
+
"description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
|
1905
|
+
},
|
1906
|
+
{
|
1907
|
+
"name": "form_arguments",
|
1908
|
+
"type": "Hash",
|
1909
|
+
"default": "`{}`",
|
1910
|
+
"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 {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} instead of using this feature directly."
|
1911
|
+
},
|
1912
|
+
{
|
1913
|
+
"name": "system_arguments",
|
1914
|
+
"type": "Hash",
|
1915
|
+
"default": "N/A",
|
1916
|
+
"description": "{{link_to_system_arguments_docs}}"
|
1917
|
+
}
|
1918
|
+
],
|
1919
|
+
"slots": [
|
1920
|
+
{
|
1921
|
+
"name": "heading",
|
1922
|
+
"description": "Heading text rendered above the list of items.",
|
1730
1923
|
"parameters": [
|
1731
1924
|
{
|
1732
|
-
"name": "
|
1733
|
-
"type": "
|
1734
|
-
"default": "
|
1735
|
-
"description": "
|
1925
|
+
"name": "component_klass",
|
1926
|
+
"type": "Class",
|
1927
|
+
"default": "N/A",
|
1928
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
1736
1929
|
},
|
1737
1930
|
{
|
1738
1931
|
"name": "system_arguments",
|
1739
1932
|
"type": "Hash",
|
1740
1933
|
"default": "N/A",
|
1741
|
-
"description": "
|
1934
|
+
"description": "The arguments accepted by `component_klass`."
|
1742
1935
|
}
|
1743
1936
|
]
|
1744
1937
|
},
|
1745
1938
|
{
|
1746
|
-
"name": "
|
1747
|
-
"description": "
|
1939
|
+
"name": "items",
|
1940
|
+
"description": "Items. Items can be individual items, avatar items, or dividers. See the documentation for `#with_item`, `#with_divider`, and `#with_avatar_item` respectively for more information.",
|
1941
|
+
"parameters": [
|
1942
|
+
|
1943
|
+
]
|
1944
|
+
}
|
1945
|
+
],
|
1946
|
+
"methods": [
|
1947
|
+
{
|
1948
|
+
"name": "with_heading",
|
1949
|
+
"description": "Heading text rendered above the list of items.",
|
1748
1950
|
"parameters": [
|
1749
|
-
{
|
1750
|
-
"name": "src",
|
1751
|
-
"type": "String",
|
1752
|
-
"default": "N/A",
|
1753
|
-
"description": "The source url of the avatar image."
|
1754
|
-
},
|
1755
|
-
{
|
1756
|
-
"name": "username",
|
1757
|
-
"type": "String",
|
1758
|
-
"default": "N/A",
|
1759
|
-
"description": "The username associated with the avatar."
|
1760
|
-
},
|
1761
|
-
{
|
1762
|
-
"name": "full_name",
|
1763
|
-
"type": "String",
|
1764
|
-
"default": "`nil`",
|
1765
|
-
"description": "Optional. The user's full name."
|
1766
|
-
},
|
1767
|
-
{
|
1768
|
-
"name": "full_name_scheme",
|
1769
|
-
"type": "Symbol",
|
1770
|
-
"default": "`:block`",
|
1771
|
-
"description": "Optional. How to display the user's full name. One of `:block` or `:inline`."
|
1772
|
-
},
|
1773
|
-
{
|
1774
|
-
"name": "data",
|
1775
|
-
"type": "Hash",
|
1776
|
-
"default": "`{}`",
|
1777
|
-
"description": "When the menu is used as a form input (see the {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} docs), the label is submitted to the server by default. However, if the `data: { value: }` or `\"data-value\":` attribute is provided, it will be sent to the server instead."
|
1778
|
-
},
|
1779
|
-
{
|
1780
|
-
"name": "avatar_arguments",
|
1781
|
-
"type": "Hash",
|
1782
|
-
"default": "`{}`",
|
1783
|
-
"description": "Optional. The arguments accepted by {{#link_to_component}}Primer::Beta::Avatar{{/link_to_component}}."
|
1784
|
-
},
|
1785
1951
|
{
|
1786
1952
|
"name": "system_arguments",
|
1787
1953
|
"type": "Hash",
|
1788
1954
|
"default": "N/A",
|
1789
|
-
"description": "
|
1955
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionMenu::Heading{{/link_to_component}}."
|
1790
1956
|
}
|
1791
1957
|
]
|
1792
1958
|
}
|
@@ -3107,6 +3273,19 @@
|
|
3107
3273
|
]
|
3108
3274
|
}
|
3109
3275
|
},
|
3276
|
+
{
|
3277
|
+
"preview_path": "primer/alpha/dialog/with_auto_complete",
|
3278
|
+
"name": "with_auto_complete",
|
3279
|
+
"snapshot": "interactive",
|
3280
|
+
"skip_rules": {
|
3281
|
+
"wont_fix": [
|
3282
|
+
"region"
|
3283
|
+
],
|
3284
|
+
"will_fix": [
|
3285
|
+
"color-contrast"
|
3286
|
+
]
|
3287
|
+
}
|
3288
|
+
},
|
3110
3289
|
{
|
3111
3290
|
"preview_path": "primer/alpha/dialog/body_has_scrollbar_overflow",
|
3112
3291
|
"name": "body_has_scrollbar_overflow",
|
@@ -3165,7 +3344,7 @@
|
|
3165
3344
|
"name": "subtitle",
|
3166
3345
|
"type": "String",
|
3167
3346
|
"default": "`nil`",
|
3168
|
-
"description": "Provides
|
3347
|
+
"description": "Provides additional context for the dialog, also setting the `aria-describedby` attribute."
|
3169
3348
|
},
|
3170
3349
|
{
|
3171
3350
|
"name": "show_divider",
|
@@ -4932,7 +5111,7 @@
|
|
4932
5111
|
},
|
4933
5112
|
{
|
4934
5113
|
"fully_qualified_name": "Primer::Alpha::NavList",
|
4935
|
-
"description": "",
|
5114
|
+
"description": ":nodoc:",
|
4936
5115
|
"accessibility_docs": null,
|
4937
5116
|
"is_form_component": false,
|
4938
5117
|
"is_published": true,
|
@@ -4982,7 +5161,7 @@
|
|
4982
5161
|
"subcomponents": [
|
4983
5162
|
{
|
4984
5163
|
"fully_qualified_name": "Primer::Alpha::NavList::Item",
|
4985
|
-
"description": "",
|
5164
|
+
"description": ":nodoc:",
|
4986
5165
|
"accessibility_docs": null,
|
4987
5166
|
"is_form_component": false,
|
4988
5167
|
"is_published": true,
|
@@ -5102,7 +5281,7 @@
|
|
5102
5281
|
},
|
5103
5282
|
{
|
5104
5283
|
"fully_qualified_name": "Primer::Alpha::NavList::Heading",
|
5105
|
-
"description": "",
|
5284
|
+
"description": ":nodoc:",
|
5106
5285
|
"accessibility_docs": null,
|
5107
5286
|
"is_form_component": false,
|
5108
5287
|
"is_published": true,
|
@@ -5154,7 +5333,7 @@
|
|
5154
5333
|
},
|
5155
5334
|
{
|
5156
5335
|
"fully_qualified_name": "Primer::Alpha::NavList::Divider",
|
5157
|
-
"description": "",
|
5336
|
+
"description": ":nodoc:",
|
5158
5337
|
"accessibility_docs": null,
|
5159
5338
|
"is_form_component": false,
|
5160
5339
|
"is_published": true,
|
@@ -5194,7 +5373,7 @@
|
|
5194
5373
|
},
|
5195
5374
|
{
|
5196
5375
|
"fully_qualified_name": "Primer::Alpha::NavList::Group",
|
5197
|
-
"description": "",
|
5376
|
+
"description": ":nodoc:",
|
5198
5377
|
"accessibility_docs": null,
|
5199
5378
|
"is_form_component": false,
|
5200
5379
|
"is_published": true,
|
@@ -5266,11 +5445,17 @@
|
|
5266
5445
|
"name": "heading",
|
5267
5446
|
"description": "Heading text rendered above the list of items.",
|
5268
5447
|
"parameters": [
|
5448
|
+
{
|
5449
|
+
"name": "component_klass",
|
5450
|
+
"type": "Class",
|
5451
|
+
"default": "N/A",
|
5452
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
5453
|
+
},
|
5269
5454
|
{
|
5270
5455
|
"name": "system_arguments",
|
5271
5456
|
"type": "Hash",
|
5272
5457
|
"default": "N/A",
|
5273
|
-
"description": "The arguments accepted by
|
5458
|
+
"description": "The arguments accepted by `component_klass`."
|
5274
5459
|
}
|
5275
5460
|
]
|
5276
5461
|
}
|
@@ -5438,7 +5623,32 @@
|
|
5438
5623
|
|
5439
5624
|
],
|
5440
5625
|
"previews": [
|
5441
|
-
|
5626
|
+
{
|
5627
|
+
"preview_path": "primer/alpha/octicon_symbols/playground",
|
5628
|
+
"name": "playground",
|
5629
|
+
"snapshot": "false",
|
5630
|
+
"skip_rules": {
|
5631
|
+
"wont_fix": [
|
5632
|
+
"region"
|
5633
|
+
],
|
5634
|
+
"will_fix": [
|
5635
|
+
"color-contrast"
|
5636
|
+
]
|
5637
|
+
}
|
5638
|
+
},
|
5639
|
+
{
|
5640
|
+
"preview_path": "primer/alpha/octicon_symbols/default",
|
5641
|
+
"name": "default",
|
5642
|
+
"snapshot": "true",
|
5643
|
+
"skip_rules": {
|
5644
|
+
"wont_fix": [
|
5645
|
+
"region"
|
5646
|
+
],
|
5647
|
+
"will_fix": [
|
5648
|
+
"color-contrast"
|
5649
|
+
]
|
5650
|
+
}
|
5651
|
+
}
|
5442
5652
|
],
|
5443
5653
|
"subcomponents": [
|
5444
5654
|
|
@@ -7972,6 +8182,19 @@
|
|
7972
8182
|
]
|
7973
8183
|
}
|
7974
8184
|
},
|
8185
|
+
{
|
8186
|
+
"preview_path": "primer/alpha/text_field/with_auto_check_accepted",
|
8187
|
+
"name": "with_auto_check_accepted",
|
8188
|
+
"snapshot": "false",
|
8189
|
+
"skip_rules": {
|
8190
|
+
"wont_fix": [
|
8191
|
+
"region"
|
8192
|
+
],
|
8193
|
+
"will_fix": [
|
8194
|
+
"color-contrast"
|
8195
|
+
]
|
8196
|
+
}
|
8197
|
+
},
|
7975
8198
|
{
|
7976
8199
|
"preview_path": "primer/alpha/text_field/with_auto_check_error",
|
7977
8200
|
"name": "with_auto_check_error",
|
@@ -9233,7 +9456,7 @@
|
|
9233
9456
|
"name": "size",
|
9234
9457
|
"type": "Integer",
|
9235
9458
|
"default": "`20`",
|
9236
|
-
"description": "One of `16`, `20`, `24`, `32`, `40`, `48`, or `80`."
|
9459
|
+
"description": "One of `16`, `20`, `24`, `32`, `40`, `48`, `64`, or `80`."
|
9237
9460
|
},
|
9238
9461
|
{
|
9239
9462
|
"name": "shape",
|
@@ -9378,6 +9601,19 @@
|
|
9378
9601
|
]
|
9379
9602
|
}
|
9380
9603
|
},
|
9604
|
+
{
|
9605
|
+
"preview_path": "primer/beta/avatar/size_64",
|
9606
|
+
"name": "size_64",
|
9607
|
+
"snapshot": "true",
|
9608
|
+
"skip_rules": {
|
9609
|
+
"wont_fix": [
|
9610
|
+
"region"
|
9611
|
+
],
|
9612
|
+
"will_fix": [
|
9613
|
+
"color-contrast"
|
9614
|
+
]
|
9615
|
+
}
|
9616
|
+
},
|
9381
9617
|
{
|
9382
9618
|
"preview_path": "primer/beta/avatar/size_80",
|
9383
9619
|
"name": "size_80",
|
@@ -9625,7 +9861,7 @@
|
|
9625
9861
|
"name": "tag",
|
9626
9862
|
"type": "Symbol",
|
9627
9863
|
"default": "`:button`",
|
9628
|
-
"description": "One of `:a`, `:button`, or `:summary`."
|
9864
|
+
"description": "One of `:a`, `:button`, `:clipboard-copy`, or `:summary`."
|
9629
9865
|
},
|
9630
9866
|
{
|
9631
9867
|
"name": "type",
|
@@ -10000,6 +10236,19 @@
|
|
10000
10236
|
"color-contrast"
|
10001
10237
|
]
|
10002
10238
|
}
|
10239
|
+
},
|
10240
|
+
{
|
10241
|
+
"preview_path": "primer/beta/blankslate/inside_flex_container",
|
10242
|
+
"name": "inside_flex_container",
|
10243
|
+
"snapshot": "false",
|
10244
|
+
"skip_rules": {
|
10245
|
+
"wont_fix": [
|
10246
|
+
"region"
|
10247
|
+
],
|
10248
|
+
"will_fix": [
|
10249
|
+
"color-contrast"
|
10250
|
+
]
|
10251
|
+
}
|
10003
10252
|
}
|
10004
10253
|
],
|
10005
10254
|
"subcomponents": [
|
@@ -10400,6 +10649,12 @@
|
|
10400
10649
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/button.rb",
|
10401
10650
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button/default/",
|
10402
10651
|
"parameters": [
|
10652
|
+
{
|
10653
|
+
"name": "base_button_class",
|
10654
|
+
"type": "Class",
|
10655
|
+
"default": "`Primer::Beta::BaseButton`",
|
10656
|
+
"description": "The button class to render."
|
10657
|
+
},
|
10403
10658
|
{
|
10404
10659
|
"name": "scheme",
|
10405
10660
|
"type": "Symbol",
|
@@ -10428,7 +10683,7 @@
|
|
10428
10683
|
"name": "tag",
|
10429
10684
|
"type": "Symbol",
|
10430
10685
|
"default": "`:button`",
|
10431
|
-
"description": "One of `:a`, `:button`, or `:summary`."
|
10686
|
+
"description": "One of `:a`, `:button`, `:clipboard-copy`, or `:summary`."
|
10432
10687
|
},
|
10433
10688
|
{
|
10434
10689
|
"name": "type",
|
@@ -10771,19 +11026,43 @@
|
|
10771
11026
|
"slots": [
|
10772
11027
|
{
|
10773
11028
|
"name": "buttons",
|
10774
|
-
"description": "
|
11029
|
+
"description": "List of buttons to be rendered. Add buttons via the `#with_button` and `#with_clipboard_copy_button` methods (see below).",
|
11030
|
+
"parameters": [
|
11031
|
+
|
11032
|
+
]
|
11033
|
+
}
|
11034
|
+
],
|
11035
|
+
"methods": [
|
11036
|
+
{
|
11037
|
+
"name": "with_button",
|
11038
|
+
"description": "Adds a button.",
|
10775
11039
|
"parameters": [
|
10776
11040
|
{
|
10777
|
-
"name": "
|
11041
|
+
"name": "icon",
|
11042
|
+
"type": "Symbol",
|
11043
|
+
"default": "`nil`",
|
11044
|
+
"description": "If included, adds a {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}} with the given {{link_to_octicons}}. Otherwise, a {{#link_to_component}}Primer::Beta::Button{{/link_to_component}} is added instead."
|
11045
|
+
},
|
11046
|
+
{
|
11047
|
+
"name": "system_arguments",
|
11048
|
+
"type": "Hash",
|
11049
|
+
"default": "N/A",
|
11050
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Button{{/link_to_component}} or {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}, depending on the value of the `icon:` argument."
|
11051
|
+
}
|
11052
|
+
]
|
11053
|
+
},
|
11054
|
+
{
|
11055
|
+
"name": "with_clipboard_copy_button",
|
11056
|
+
"description": "Adds a {{#link_to_component}}Primer::Beta::ClipboardCopyButton{{/link_to_component}}.",
|
11057
|
+
"parameters": [
|
11058
|
+
{
|
11059
|
+
"name": "system_arguments",
|
10778
11060
|
"type": "Hash",
|
10779
11061
|
"default": "N/A",
|
10780
|
-
"description": "The
|
11062
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::ClipboardCopyButton{{/link_to_component}}."
|
10781
11063
|
}
|
10782
11064
|
]
|
10783
11065
|
}
|
10784
|
-
],
|
10785
|
-
"methods": [
|
10786
|
-
|
10787
11066
|
],
|
10788
11067
|
"previews": [
|
10789
11068
|
{
|
@@ -10850,6 +11129,19 @@
|
|
10850
11129
|
"color-contrast"
|
10851
11130
|
]
|
10852
11131
|
}
|
11132
|
+
},
|
11133
|
+
{
|
11134
|
+
"preview_path": "primer/beta/button_group/with_clipboard_copy_button",
|
11135
|
+
"name": "with_clipboard_copy_button",
|
11136
|
+
"snapshot": "true",
|
11137
|
+
"skip_rules": {
|
11138
|
+
"wont_fix": [
|
11139
|
+
"region"
|
11140
|
+
],
|
11141
|
+
"will_fix": [
|
11142
|
+
"color-contrast"
|
11143
|
+
]
|
11144
|
+
}
|
10853
11145
|
}
|
10854
11146
|
],
|
10855
11147
|
"subcomponents": [
|
@@ -10858,7 +11150,7 @@
|
|
10858
11150
|
},
|
10859
11151
|
{
|
10860
11152
|
"fully_qualified_name": "Primer::Beta::ClipboardCopy",
|
10861
|
-
"description": "Use `ClipboardCopy` to copy element text content or input values to the clipboard.",
|
11153
|
+
"description": "Use `ClipboardCopy` to copy element text content or input values to the clipboard.\n\nThis component by itself is not styled as a button, and can therefore only be used in limited circumstances.\nIf you're looking for a button, consider using {{#link_to_component}}Primer::Beta::ClipboardCopyButton{{/link_to_component}}\ninstead.",
|
10862
11154
|
"accessibility_docs": "Always set an accessible label to help the user interact with the component.",
|
10863
11155
|
"is_form_component": false,
|
10864
11156
|
"is_published": true,
|
@@ -10959,6 +11251,195 @@
|
|
10959
11251
|
|
10960
11252
|
]
|
10961
11253
|
},
|
11254
|
+
{
|
11255
|
+
"fully_qualified_name": "Primer::Beta::ClipboardCopyBaseButton",
|
11256
|
+
"description": "Internal\n\n:nodoc:",
|
11257
|
+
"accessibility_docs": null,
|
11258
|
+
"is_form_component": false,
|
11259
|
+
"is_published": true,
|
11260
|
+
"requires_js": false,
|
11261
|
+
"component": "ClipboardCopyBaseButton",
|
11262
|
+
"status": "beta",
|
11263
|
+
"a11y_reviewed": false,
|
11264
|
+
"short_name": "ClipboardCopyBaseButton",
|
11265
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/clipboard_copy_base_button.rb",
|
11266
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/clipboard_copy_base_button/default/",
|
11267
|
+
"parameters": [
|
11268
|
+
{
|
11269
|
+
"name": "tag",
|
11270
|
+
"type": "Symbol",
|
11271
|
+
"default": "`:button`",
|
11272
|
+
"description": "One of `:a`, `:button`, `:clipboard-copy`, or `:summary`."
|
11273
|
+
},
|
11274
|
+
{
|
11275
|
+
"name": "type",
|
11276
|
+
"type": "Symbol",
|
11277
|
+
"default": "`:button`",
|
11278
|
+
"description": "One of `:button`, `:reset`, or `:submit`."
|
11279
|
+
},
|
11280
|
+
{
|
11281
|
+
"name": "block",
|
11282
|
+
"type": "Boolean",
|
11283
|
+
"default": "`false`",
|
11284
|
+
"description": "Whether button is full-width with `display: block`."
|
11285
|
+
},
|
11286
|
+
{
|
11287
|
+
"name": "disabled",
|
11288
|
+
"type": "Boolean",
|
11289
|
+
"default": "`false`",
|
11290
|
+
"description": "Whether or not the button is disabled. If true, this option forces `tag:` to `:button`."
|
11291
|
+
},
|
11292
|
+
{
|
11293
|
+
"name": "inactive",
|
11294
|
+
"type": "Boolean",
|
11295
|
+
"default": "`false`",
|
11296
|
+
"description": "Whether the button looks visually disabled, but can still accept all the same interactions as an enabled button."
|
11297
|
+
},
|
11298
|
+
{
|
11299
|
+
"name": "system_arguments",
|
11300
|
+
"type": "Hash",
|
11301
|
+
"default": "N/A",
|
11302
|
+
"description": "{{link_to_system_arguments_docs}}"
|
11303
|
+
}
|
11304
|
+
],
|
11305
|
+
"slots": [
|
11306
|
+
|
11307
|
+
],
|
11308
|
+
"methods": [
|
11309
|
+
|
11310
|
+
],
|
11311
|
+
"previews": [
|
11312
|
+
|
11313
|
+
],
|
11314
|
+
"subcomponents": [
|
11315
|
+
|
11316
|
+
]
|
11317
|
+
},
|
11318
|
+
{
|
11319
|
+
"fully_qualified_name": "Primer::Beta::ClipboardCopyButton",
|
11320
|
+
"description": "`ClipboardCopyButton` uses the `ClipboardCopy` component to copy text to the clipboard,\nstyled as a Primer button. It can be used wherever a button is desired, and works well\nwith components like `ButtonGroup`.",
|
11321
|
+
"accessibility_docs": null,
|
11322
|
+
"is_form_component": false,
|
11323
|
+
"is_published": true,
|
11324
|
+
"requires_js": false,
|
11325
|
+
"component": "ClipboardCopyButton",
|
11326
|
+
"status": "beta",
|
11327
|
+
"a11y_reviewed": false,
|
11328
|
+
"short_name": "ClipboardCopyButton",
|
11329
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/clipboard_copy_button.rb",
|
11330
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/clipboard_copy_button/default/",
|
11331
|
+
"parameters": [
|
11332
|
+
{
|
11333
|
+
"name": "system_arguments",
|
11334
|
+
"type": "Hash",
|
11335
|
+
"default": "N/A",
|
11336
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Button{{/link_to_component}} and {{#link_to_component}}Primer::Beta::ClipboardCopy{{/link_to_component}}."
|
11337
|
+
}
|
11338
|
+
],
|
11339
|
+
"slots": [
|
11340
|
+
{
|
11341
|
+
"name": "leading_visual",
|
11342
|
+
"description": "Leading visuals appear to the left of the button text.\n\nUse:\n\n- `leading_visual_icon` for a {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.\n\n- `leading_visual_svg` to render a SVG.",
|
11343
|
+
"parameters": [
|
11344
|
+
{
|
11345
|
+
"name": "system_arguments",
|
11346
|
+
"type": "Hash",
|
11347
|
+
"default": "N/A",
|
11348
|
+
"description": "Same arguments as {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}."
|
11349
|
+
}
|
11350
|
+
]
|
11351
|
+
},
|
11352
|
+
{
|
11353
|
+
"name": "trailing_visual",
|
11354
|
+
"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}}.",
|
11355
|
+
"parameters": [
|
11356
|
+
{
|
11357
|
+
"name": "system_arguments",
|
11358
|
+
"type": "Hash",
|
11359
|
+
"default": "N/A",
|
11360
|
+
"description": "Same arguments as {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}."
|
11361
|
+
}
|
11362
|
+
]
|
11363
|
+
},
|
11364
|
+
{
|
11365
|
+
"name": "trailing_action",
|
11366
|
+
"description": "Trailing action appears to the right of the trailing visual.\n\nUse:\n\n- `trailing_action_icon` for a {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}.",
|
11367
|
+
"parameters": [
|
11368
|
+
{
|
11369
|
+
"name": "system_arguments",
|
11370
|
+
"type": "Hash",
|
11371
|
+
"default": "N/A",
|
11372
|
+
"description": "Same arguments as {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}."
|
11373
|
+
}
|
11374
|
+
]
|
11375
|
+
},
|
11376
|
+
{
|
11377
|
+
"name": "tooltip",
|
11378
|
+
"description": "`Tooltip` that appears on mouse hover or keyboard focus over the button. Use tooltips sparingly and as a last resort.\n**Important:** This tooltip defaults to `type: :description`. In a few scenarios, `type: :label` may be more appropriate.\nConsult the {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}} documentation for more information.",
|
11379
|
+
"parameters": [
|
11380
|
+
{
|
11381
|
+
"name": "type",
|
11382
|
+
"type": "Symbol",
|
11383
|
+
"default": "`:description`",
|
11384
|
+
"description": "One of `:description` or `:label`."
|
11385
|
+
},
|
11386
|
+
{
|
11387
|
+
"name": "system_arguments",
|
11388
|
+
"type": "Hash",
|
11389
|
+
"default": "N/A",
|
11390
|
+
"description": "Same arguments as {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}}."
|
11391
|
+
}
|
11392
|
+
]
|
11393
|
+
}
|
11394
|
+
],
|
11395
|
+
"methods": [
|
11396
|
+
|
11397
|
+
],
|
11398
|
+
"previews": [
|
11399
|
+
{
|
11400
|
+
"preview_path": "primer/beta/clipboard_copy_button/playground",
|
11401
|
+
"name": "playground",
|
11402
|
+
"snapshot": "false",
|
11403
|
+
"skip_rules": {
|
11404
|
+
"wont_fix": [
|
11405
|
+
"region"
|
11406
|
+
],
|
11407
|
+
"will_fix": [
|
11408
|
+
"color-contrast"
|
11409
|
+
]
|
11410
|
+
}
|
11411
|
+
},
|
11412
|
+
{
|
11413
|
+
"preview_path": "primer/beta/clipboard_copy_button/default",
|
11414
|
+
"name": "default",
|
11415
|
+
"snapshot": "true",
|
11416
|
+
"skip_rules": {
|
11417
|
+
"wont_fix": [
|
11418
|
+
"region"
|
11419
|
+
],
|
11420
|
+
"will_fix": [
|
11421
|
+
"color-contrast"
|
11422
|
+
]
|
11423
|
+
}
|
11424
|
+
},
|
11425
|
+
{
|
11426
|
+
"preview_path": "primer/beta/clipboard_copy_button/with_tooltip",
|
11427
|
+
"name": "with_tooltip",
|
11428
|
+
"snapshot": "true",
|
11429
|
+
"skip_rules": {
|
11430
|
+
"wont_fix": [
|
11431
|
+
"region"
|
11432
|
+
],
|
11433
|
+
"will_fix": [
|
11434
|
+
"color-contrast"
|
11435
|
+
]
|
11436
|
+
}
|
11437
|
+
}
|
11438
|
+
],
|
11439
|
+
"subcomponents": [
|
11440
|
+
|
11441
|
+
]
|
11442
|
+
},
|
10962
11443
|
{
|
10963
11444
|
"fully_qualified_name": "Primer::Beta::CloseButton",
|
10964
11445
|
"description": "Use `CloseButton` to render an `×` without default button styles.\n\n[0]: https://primer.style/view-components/system-arguments#html-attributes",
|
@@ -11675,13 +12156,7 @@
|
|
11675
12156
|
"name": "tag",
|
11676
12157
|
"type": "Symbol",
|
11677
12158
|
"default": "N/A",
|
11678
|
-
"description": "One of `:a`, `:button`, or `:summary`."
|
11679
|
-
},
|
11680
|
-
{
|
11681
|
-
"name": "wrapper_arguments",
|
11682
|
-
"type": "Hash",
|
11683
|
-
"default": "`{}`",
|
11684
|
-
"description": "Optional keyword arguments to be passed to the wrapper `<div>` tag."
|
12159
|
+
"description": "One of `:a`, `:button`, `:clipboard-copy`, or `:summary`."
|
11685
12160
|
},
|
11686
12161
|
{
|
11687
12162
|
"name": "scheme",
|
@@ -12914,11 +13389,17 @@
|
|
12914
13389
|
"name": "heading",
|
12915
13390
|
"description": "Heading text rendered above the list of items.",
|
12916
13391
|
"parameters": [
|
13392
|
+
{
|
13393
|
+
"name": "component_klass",
|
13394
|
+
"type": "Class",
|
13395
|
+
"default": "N/A",
|
13396
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
13397
|
+
},
|
12917
13398
|
{
|
12918
13399
|
"name": "system_arguments",
|
12919
13400
|
"type": "Hash",
|
12920
13401
|
"default": "N/A",
|
12921
|
-
"description": "The arguments accepted by
|
13402
|
+
"description": "The arguments accepted by `component_klass`."
|
12922
13403
|
}
|
12923
13404
|
]
|
12924
13405
|
}
|
@@ -13925,6 +14406,32 @@
|
|
13925
14406
|
"color-contrast"
|
13926
14407
|
]
|
13927
14408
|
}
|
14409
|
+
},
|
14410
|
+
{
|
14411
|
+
"preview_path": "primer/beta/subhead/large_header",
|
14412
|
+
"name": "large_header",
|
14413
|
+
"snapshot": "false",
|
14414
|
+
"skip_rules": {
|
14415
|
+
"wont_fix": [
|
14416
|
+
"region"
|
14417
|
+
],
|
14418
|
+
"will_fix": [
|
14419
|
+
"color-contrast"
|
14420
|
+
]
|
14421
|
+
}
|
14422
|
+
},
|
14423
|
+
{
|
14424
|
+
"preview_path": "primer/beta/subhead/medium_header",
|
14425
|
+
"name": "medium_header",
|
14426
|
+
"snapshot": "false",
|
14427
|
+
"skip_rules": {
|
14428
|
+
"wont_fix": [
|
14429
|
+
"region"
|
14430
|
+
],
|
14431
|
+
"will_fix": [
|
14432
|
+
"color-contrast"
|
14433
|
+
]
|
14434
|
+
}
|
13928
14435
|
}
|
13929
14436
|
],
|
13930
14437
|
"subcomponents": [
|
@@ -14541,7 +15048,7 @@
|
|
14541
15048
|
"name": "tag",
|
14542
15049
|
"type": "Symbol",
|
14543
15050
|
"default": "`:button`",
|
14544
|
-
"description": "One of `:a`, `:button`, or `:summary`."
|
15051
|
+
"description": "One of `:a`, `:button`, `:clipboard-copy`, or `:summary`."
|
14545
15052
|
},
|
14546
15053
|
{
|
14547
15054
|
"name": "type",
|
@@ -14740,7 +15247,7 @@
|
|
14740
15247
|
"name": "tag",
|
14741
15248
|
"type": "Symbol",
|
14742
15249
|
"default": "N/A",
|
14743
|
-
"description": "One of `:a`, `:button`, or `:summary`."
|
15250
|
+
"description": "One of `:a`, `:button`, `:clipboard-copy`, or `:summary`."
|
14744
15251
|
},
|
14745
15252
|
{
|
14746
15253
|
"name": "type",
|