primer_view_components 0.9.0 → 0.11.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 +78 -0
- data/app/assets/javascripts/app/components/primer/primer.d.ts +1 -1
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_bar/item.rb +7 -4
- data/app/components/primer/alpha/action_bar.rb +2 -2
- data/app/components/primer/alpha/action_bar_element.js +2 -2
- data/app/components/primer/alpha/action_bar_element.ts +2 -2
- data/app/components/primer/alpha/action_menu/action_menu_element.js +170 -85
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +206 -80
- data/app/components/primer/alpha/action_menu/list.rb +0 -2
- data/app/components/primer/alpha/check_box_group.rb +2 -0
- data/app/components/primer/alpha/dialog/header.rb +12 -0
- data/app/components/primer/alpha/dialog.rb +1 -1
- data/app/components/primer/alpha/nav_list/divider.rb +2 -5
- data/app/components/primer/alpha/nav_list/group.rb +2 -98
- data/app/components/primer/alpha/nav_list/heading.rb +2 -27
- data/app/components/primer/alpha/nav_list/item.rb +2 -147
- data/app/components/primer/alpha/nav_list.rb +2 -205
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +1 -7
- data/app/components/primer/alpha/overlay.rb +6 -4
- data/app/components/primer/alpha/radio_button_group.rb +2 -0
- data/app/components/primer/alpha/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.json +4 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +18 -3
- data/app/components/primer/alpha/tooltip.rb +3 -1
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.json +2 -0
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +11 -3
- data/app/components/primer/beta/icon_button.html.erb +1 -1
- data/app/components/primer/beta/icon_button.rb +8 -1
- data/app/components/primer/beta/link.css +1 -1
- data/app/components/primer/beta/link.css.json +1 -0
- data/app/components/primer/beta/link.css.map +1 -1
- data/app/components/primer/beta/link.pcss +5 -0
- data/app/components/primer/beta/link.rb +2 -2
- data/app/components/primer/beta/nav_list/divider.rb +14 -0
- data/app/components/primer/beta/nav_list/group.rb +107 -0
- data/app/components/primer/beta/nav_list/heading.rb +36 -0
- data/app/components/primer/beta/nav_list/item.rb +156 -0
- data/app/components/primer/beta/nav_list.rb +212 -0
- data/app/components/primer/focus_group.js +30 -4
- data/app/components/primer/focus_group.ts +29 -2
- data/app/components/primer/primer.d.ts +1 -1
- data/app/components/primer/primer.js +1 -1
- data/app/components/primer/primer.ts +1 -1
- data/app/helpers/primer/form_helper.rb +10 -0
- data/lib/primer/deprecations.yml +20 -0
- data/lib/primer/forms/check_box_group.html.erb +3 -0
- data/lib/primer/forms/dsl/check_box_group_input.rb +1 -5
- data/lib/primer/forms/dsl/check_box_input.rb +5 -0
- data/lib/primer/forms/dsl/radio_button_input.rb +5 -0
- data/lib/primer/forms/form_control.html.erb +1 -4
- data/lib/primer/forms/radio_button_group.html.erb +3 -0
- data/lib/primer/forms/utils.rb +2 -0
- data/lib/primer/forms/validation_message.html.erb +4 -0
- data/lib/primer/forms/validation_message.rb +14 -0
- data/lib/primer/forms.rb +16 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/component_manifest.rb +4 -0
- data/previews/primer/alpha/action_menu_preview/with_actions.html.erb +5 -4
- data/previews/primer/alpha/action_menu_preview.rb +4 -1
- data/previews/primer/alpha/check_box_group_preview.rb +13 -0
- data/previews/primer/alpha/dialog_preview/with_header.html.erb +5 -0
- data/previews/primer/alpha/dialog_preview.rb +17 -0
- data/previews/primer/alpha/overlay_preview.rb +1 -1
- data/previews/primer/alpha/radio_button_group_preview.rb +13 -0
- data/previews/primer/alpha/radio_button_preview.rb +1 -1
- data/previews/primer/alpha/text_field_preview/input_group_leading_action_menu.html.erb +21 -0
- data/previews/primer/alpha/text_field_preview/input_group_leading_button.html.erb +18 -0
- data/previews/primer/alpha/text_field_preview/input_group_trailing_button.html.erb +18 -0
- data/previews/primer/alpha/text_field_preview.rb +21 -0
- data/previews/primer/beta/button_preview.rb +1 -1
- data/previews/primer/{alpha → beta}/nav_list_preview/trailing_action.html.erb +1 -1
- data/previews/primer/{alpha → beta}/nav_list_preview.rb +5 -5
- data/static/arguments.json +194 -7
- data/static/audited_at.json +5 -0
- data/static/classes.json +3 -0
- data/static/constants.json +23 -0
- data/static/info_arch.json +1015 -527
- data/static/previews.json +85 -7
- data/static/statuses.json +10 -5
- metadata +23 -11
- /data/app/assets/javascripts/app/components/primer/{alpha → beta}/nav_list.d.ts +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list/group.html.erb +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list/item.html.erb +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.d.ts +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.html.erb +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.js +0 -0
- /data/app/components/primer/{alpha → beta}/nav_list.ts +0 -0
data/static/info_arch.json
CHANGED
@@ -139,7 +139,18 @@
|
|
139
139
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/item.rb",
|
140
140
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/item/default/",
|
141
141
|
"parameters": [
|
142
|
-
|
142
|
+
{
|
143
|
+
"name": "item_content",
|
144
|
+
"type": "String",
|
145
|
+
"default": "N/A",
|
146
|
+
"description": "The content to render inside the item."
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"name": "item_arguments",
|
150
|
+
"type": "Hash",
|
151
|
+
"default": "N/A",
|
152
|
+
"description": "{{link_to_system_arguments_docs}}"
|
153
|
+
}
|
143
154
|
],
|
144
155
|
"slots": [
|
145
156
|
|
@@ -2686,6 +2697,18 @@
|
|
2686
2697
|
"default": "N/A",
|
2687
2698
|
"description": "A string describing the field and what sorts of input it expects. Displayed below the group."
|
2688
2699
|
},
|
2700
|
+
{
|
2701
|
+
"name": "invalid",
|
2702
|
+
"type": "Boolean",
|
2703
|
+
"default": "N/A",
|
2704
|
+
"description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect."
|
2705
|
+
},
|
2706
|
+
{
|
2707
|
+
"name": "validation_message",
|
2708
|
+
"type": "String",
|
2709
|
+
"default": "N/A",
|
2710
|
+
"description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object."
|
2711
|
+
},
|
2689
2712
|
{
|
2690
2713
|
"name": "label_arguments",
|
2691
2714
|
"type": "Hash",
|
@@ -2743,6 +2766,19 @@
|
|
2743
2766
|
]
|
2744
2767
|
}
|
2745
2768
|
},
|
2769
|
+
{
|
2770
|
+
"preview_path": "primer/alpha/check_box_group/invalid",
|
2771
|
+
"name": "invalid",
|
2772
|
+
"snapshot": "false",
|
2773
|
+
"skip_rules": {
|
2774
|
+
"wont_fix": [
|
2775
|
+
"region"
|
2776
|
+
],
|
2777
|
+
"will_fix": [
|
2778
|
+
"color-contrast"
|
2779
|
+
]
|
2780
|
+
}
|
2781
|
+
},
|
2746
2782
|
{
|
2747
2783
|
"preview_path": "primer/alpha/check_box_group/with_caption",
|
2748
2784
|
"name": "with_caption",
|
@@ -2896,7 +2932,7 @@
|
|
2896
2932
|
"name": "system_arguments",
|
2897
2933
|
"type": "Hash",
|
2898
2934
|
"default": "N/A",
|
2899
|
-
"description": "{{
|
2935
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::Dialog::Header{{/link_to_component}}."
|
2900
2936
|
}
|
2901
2937
|
]
|
2902
2938
|
},
|
@@ -2980,6 +3016,19 @@
|
|
2980
3016
|
]
|
2981
3017
|
}
|
2982
3018
|
},
|
3019
|
+
{
|
3020
|
+
"preview_path": "primer/alpha/dialog/with_header",
|
3021
|
+
"name": "with_header",
|
3022
|
+
"snapshot": "false",
|
3023
|
+
"skip_rules": {
|
3024
|
+
"wont_fix": [
|
3025
|
+
"region"
|
3026
|
+
],
|
3027
|
+
"will_fix": [
|
3028
|
+
"color-contrast"
|
3029
|
+
]
|
3030
|
+
}
|
3031
|
+
},
|
2983
3032
|
{
|
2984
3033
|
"preview_path": "primer/alpha/dialog/with_footer",
|
2985
3034
|
"name": "with_footer",
|
@@ -3074,6 +3123,12 @@
|
|
3074
3123
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dialog/header.rb",
|
3075
3124
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/dialog/header/default/",
|
3076
3125
|
"parameters": [
|
3126
|
+
{
|
3127
|
+
"name": "id",
|
3128
|
+
"type": "String",
|
3129
|
+
"default": "N/A",
|
3130
|
+
"description": "The HTML element's ID value."
|
3131
|
+
},
|
3077
3132
|
{
|
3078
3133
|
"name": "title",
|
3079
3134
|
"type": "String",
|
@@ -3098,6 +3153,12 @@
|
|
3098
3153
|
"default": "`false`",
|
3099
3154
|
"description": "Visually hide the `title` while maintaining a label for assistive technologies."
|
3100
3155
|
},
|
3156
|
+
{
|
3157
|
+
"name": "variant",
|
3158
|
+
"type": "Symbol",
|
3159
|
+
"default": "`:medium`",
|
3160
|
+
"description": "One of `:large` or `:medium`."
|
3161
|
+
},
|
3101
3162
|
{
|
3102
3163
|
"name": "system_arguments",
|
3103
3164
|
"type": "Hash",
|
@@ -4845,13 +4906,13 @@
|
|
4845
4906
|
},
|
4846
4907
|
{
|
4847
4908
|
"fully_qualified_name": "Primer::Alpha::NavList",
|
4848
|
-
"description": "
|
4909
|
+
"description": "",
|
4849
4910
|
"accessibility_docs": null,
|
4850
4911
|
"is_form_component": false,
|
4851
4912
|
"is_published": true,
|
4852
4913
|
"requires_js": true,
|
4853
4914
|
"component": "NavList",
|
4854
|
-
"status": "
|
4915
|
+
"status": "deprecated",
|
4855
4916
|
"a11y_reviewed": true,
|
4856
4917
|
"short_name": "NavList",
|
4857
4918
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list.rb",
|
@@ -4873,7 +4934,7 @@
|
|
4873
4934
|
"slots": [
|
4874
4935
|
{
|
4875
4936
|
"name": "heading",
|
4876
|
-
"description": "The heading for the list at large. Accepts the arguments accepted by {{#link_to_component}}Primer::
|
4937
|
+
"description": "The heading for the list at large. Accepts the arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Heading{{/link_to_component}}.",
|
4877
4938
|
"parameters": [
|
4878
4939
|
|
4879
4940
|
]
|
@@ -4887,269 +4948,203 @@
|
|
4887
4948
|
}
|
4888
4949
|
],
|
4889
4950
|
"methods": [
|
4951
|
+
|
4952
|
+
],
|
4953
|
+
"previews": [
|
4954
|
+
|
4955
|
+
],
|
4956
|
+
"subcomponents": [
|
4890
4957
|
{
|
4891
|
-
"
|
4892
|
-
"description": "
|
4958
|
+
"fully_qualified_name": "Primer::Alpha::NavList::Item",
|
4959
|
+
"description": "",
|
4960
|
+
"accessibility_docs": null,
|
4961
|
+
"is_form_component": false,
|
4962
|
+
"is_published": true,
|
4963
|
+
"requires_js": true,
|
4964
|
+
"component": "NavList::Item",
|
4965
|
+
"status": "deprecated",
|
4966
|
+
"a11y_reviewed": false,
|
4967
|
+
"short_name": "NavListItem",
|
4968
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/item.rb",
|
4969
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/item/default/",
|
4893
4970
|
"parameters": [
|
4894
4971
|
{
|
4895
|
-
"name": "
|
4896
|
-
"type": "
|
4897
|
-
"default": "`
|
4898
|
-
"description": "The
|
4972
|
+
"name": "selected_item_id",
|
4973
|
+
"type": "Symbol",
|
4974
|
+
"default": "`nil`",
|
4975
|
+
"description": "The ID of the currently selected list item. Used internally."
|
4976
|
+
},
|
4977
|
+
{
|
4978
|
+
"name": "selected_by_ids",
|
4979
|
+
"type": "Array<Symbol>",
|
4980
|
+
"default": "`[]`",
|
4981
|
+
"description": "The list of IDs that select this item. In other words, if the `selected_item_id` attribute on the parent `NavList` is set to one of these IDs, the item will appear selected."
|
4982
|
+
},
|
4983
|
+
{
|
4984
|
+
"name": "expanded",
|
4985
|
+
"type": "Boolean",
|
4986
|
+
"default": "`false`",
|
4987
|
+
"description": "Whether this item shows (expands) or hides (collapses) its list of sub items."
|
4988
|
+
},
|
4989
|
+
{
|
4990
|
+
"name": "sub_item",
|
4991
|
+
"type": "Boolean",
|
4992
|
+
"default": "`false`",
|
4993
|
+
"description": "Whether or not this item is nested under a parent item. Used internally."
|
4899
4994
|
},
|
4900
4995
|
{
|
4901
4996
|
"name": "system_arguments",
|
4902
4997
|
"type": "Hash",
|
4903
4998
|
"default": "N/A",
|
4904
|
-
"description": "
|
4999
|
+
"description": "{{link_to_system_arguments_docs}}"
|
4905
5000
|
}
|
4906
|
-
]
|
4907
|
-
|
4908
|
-
{
|
4909
|
-
"name": "with_avatar_item",
|
4910
|
-
"description": "Adds an avatar item to the list. Avatar items are a convenient way to accessibly add an item with a leading avatar image.",
|
4911
|
-
"parameters": [
|
4912
|
-
{
|
4913
|
-
"name": "src",
|
4914
|
-
"type": "String",
|
4915
|
-
"default": "N/A",
|
4916
|
-
"description": "The source url of the avatar image."
|
4917
|
-
},
|
5001
|
+
],
|
5002
|
+
"slots": [
|
4918
5003
|
{
|
4919
|
-
"name": "
|
4920
|
-
"
|
4921
|
-
"
|
4922
|
-
|
5004
|
+
"name": "items",
|
5005
|
+
"description": null,
|
5006
|
+
"parameters": [
|
5007
|
+
{
|
5008
|
+
"name": "system_arguments",
|
5009
|
+
"type": "Hash",
|
5010
|
+
"default": "N/A",
|
5011
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList::Item{{/link_to_component}}."
|
5012
|
+
}
|
5013
|
+
]
|
4923
5014
|
},
|
4924
5015
|
{
|
4925
|
-
"name": "
|
4926
|
-
"
|
4927
|
-
"
|
4928
|
-
|
5016
|
+
"name": "description",
|
5017
|
+
"description": "Description content that complements the item's label. See `ActionList`'s `description_scheme` argument\nfor layout options.",
|
5018
|
+
"parameters": [
|
5019
|
+
|
5020
|
+
]
|
4929
5021
|
},
|
4930
5022
|
{
|
4931
|
-
"name": "
|
4932
|
-
"
|
4933
|
-
"
|
4934
|
-
|
5023
|
+
"name": "leading_visual",
|
5024
|
+
"description": "An icon, avatar, SVG, or custom content that will render to the left 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 an SVG, call the `with_leading_visual_svg` method.\n\nTo render custom content, call the `with_leading_visual_content` method and pass a block that returns a string.",
|
5025
|
+
"parameters": [
|
5026
|
+
|
5027
|
+
]
|
4935
5028
|
},
|
4936
5029
|
{
|
4937
|
-
"name": "
|
4938
|
-
"
|
4939
|
-
"
|
4940
|
-
|
5030
|
+
"name": "trailing_visual",
|
5031
|
+
"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```",
|
5032
|
+
"parameters": [
|
5033
|
+
|
5034
|
+
]
|
4941
5035
|
},
|
4942
5036
|
{
|
4943
|
-
"name": "
|
4944
|
-
"
|
4945
|
-
"
|
4946
|
-
|
5037
|
+
"name": "trailing_action",
|
5038
|
+
"description": "A button rendered after the trailing icon that can be used to show a menu, activate\na dialog, etc.",
|
5039
|
+
"parameters": [
|
5040
|
+
{
|
5041
|
+
"name": "system_arguments",
|
5042
|
+
"type": "Hash",
|
5043
|
+
"default": "N/A",
|
5044
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
5045
|
+
}
|
5046
|
+
]
|
4947
5047
|
},
|
4948
5048
|
{
|
4949
|
-
"name": "
|
4950
|
-
"
|
4951
|
-
"
|
4952
|
-
|
5049
|
+
"name": "tooltip",
|
5050
|
+
"description": "`Tooltip` that appears on mouse hover or keyboard focus over the trailing action button. Use tooltips sparingly and as\na last resort. **Important:** This tooltip defaults to `type: :description`. In a few scenarios, `type: :label` may be\nmore appropriate. Consult the {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}} documentation for more information.",
|
5051
|
+
"parameters": [
|
5052
|
+
{
|
5053
|
+
"name": "type",
|
5054
|
+
"type": "Symbol",
|
5055
|
+
"default": "`:description`",
|
5056
|
+
"description": "One of `:description` or `:label`."
|
5057
|
+
},
|
5058
|
+
{
|
5059
|
+
"name": "system_arguments",
|
5060
|
+
"type": "Hash",
|
5061
|
+
"default": "N/A",
|
5062
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}}."
|
5063
|
+
}
|
5064
|
+
]
|
4953
5065
|
}
|
5066
|
+
],
|
5067
|
+
"methods": [
|
5068
|
+
|
5069
|
+
],
|
5070
|
+
"previews": [
|
5071
|
+
|
5072
|
+
],
|
5073
|
+
"subcomponents": [
|
5074
|
+
|
4954
5075
|
]
|
4955
5076
|
},
|
4956
5077
|
{
|
4957
|
-
"
|
4958
|
-
"description": "
|
5078
|
+
"fully_qualified_name": "Primer::Alpha::NavList::Heading",
|
5079
|
+
"description": "",
|
5080
|
+
"accessibility_docs": null,
|
5081
|
+
"is_form_component": false,
|
5082
|
+
"is_published": true,
|
5083
|
+
"requires_js": false,
|
5084
|
+
"component": "NavList::Heading",
|
5085
|
+
"status": "deprecated",
|
5086
|
+
"a11y_reviewed": false,
|
5087
|
+
"short_name": "NavListHeading",
|
5088
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/heading.rb",
|
5089
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/heading/default/",
|
4959
5090
|
"parameters": [
|
4960
5091
|
{
|
4961
|
-
"name": "
|
4962
|
-
"type": "
|
5092
|
+
"name": "title",
|
5093
|
+
"type": "String",
|
4963
5094
|
"default": "N/A",
|
4964
|
-
"description": "The
|
4965
|
-
}
|
4966
|
-
]
|
4967
|
-
},
|
4968
|
-
{
|
4969
|
-
"name": "with_divider",
|
4970
|
-
"description": "Adds a divider to the list. Dividers visually separate items and groups.",
|
4971
|
-
"parameters": [
|
5095
|
+
"description": "The text content of the heading."
|
5096
|
+
},
|
4972
5097
|
{
|
4973
|
-
"name": "
|
4974
|
-
"type": "
|
4975
|
-
"default": "
|
4976
|
-
"description": "The
|
4977
|
-
}
|
4978
|
-
]
|
4979
|
-
},
|
4980
|
-
{
|
4981
|
-
"name": "build_item",
|
4982
|
-
"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.",
|
4983
|
-
"parameters": [
|
5098
|
+
"name": "id",
|
5099
|
+
"type": "String",
|
5100
|
+
"default": "`self.class.generate_id`",
|
5101
|
+
"description": "The value of the ID HTML attribute. Auto-generated by default."
|
5102
|
+
},
|
4984
5103
|
{
|
4985
|
-
"name": "
|
4986
|
-
"type": "
|
4987
|
-
"default": "`
|
4988
|
-
"description": "The
|
5104
|
+
"name": "heading_level",
|
5105
|
+
"type": "Integer",
|
5106
|
+
"default": "`2`",
|
5107
|
+
"description": "The heading level, i.e. 2 for an `<h2>`, 3 for an `<h3>`, etc."
|
4989
5108
|
},
|
4990
5109
|
{
|
4991
5110
|
"name": "system_arguments",
|
4992
5111
|
"type": "Hash",
|
4993
5112
|
"default": "N/A",
|
4994
|
-
"description": "
|
5113
|
+
"description": "{{link_to_system_arguments_docs}}"
|
4995
5114
|
}
|
5115
|
+
],
|
5116
|
+
"slots": [
|
5117
|
+
|
5118
|
+
],
|
5119
|
+
"methods": [
|
5120
|
+
|
5121
|
+
],
|
5122
|
+
"previews": [
|
5123
|
+
|
5124
|
+
],
|
5125
|
+
"subcomponents": [
|
5126
|
+
|
4996
5127
|
]
|
4997
5128
|
},
|
4998
5129
|
{
|
4999
|
-
"
|
5000
|
-
"description": "
|
5001
|
-
"parameters": [
|
5002
|
-
{
|
5003
|
-
"name": "src",
|
5004
|
-
"type": "String",
|
5005
|
-
"default": "N/A",
|
5006
|
-
"description": "The source url of the avatar image."
|
5007
|
-
},
|
5008
|
-
{
|
5009
|
-
"name": "username",
|
5010
|
-
"type": "String",
|
5011
|
-
"default": "N/A",
|
5012
|
-
"description": "The username associated with the avatar."
|
5013
|
-
},
|
5014
|
-
{
|
5015
|
-
"name": "full_name",
|
5016
|
-
"type": "String",
|
5017
|
-
"default": "`nil`",
|
5018
|
-
"description": "Optional. The user's full name."
|
5019
|
-
},
|
5020
|
-
{
|
5021
|
-
"name": "full_name_scheme",
|
5022
|
-
"type": "Symbol",
|
5023
|
-
"default": "`:block`",
|
5024
|
-
"description": "Optional. How to display the user's full name. One of `:block` or `:inline`."
|
5025
|
-
},
|
5026
|
-
{
|
5027
|
-
"name": "component_klass",
|
5028
|
-
"type": "Class",
|
5029
|
-
"default": "`Primer::Alpha::NavList::Item`",
|
5030
|
-
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::NavList::Item{{/link_to_component}}"
|
5031
|
-
},
|
5032
|
-
{
|
5033
|
-
"name": "avatar_arguments",
|
5034
|
-
"type": "Hash",
|
5035
|
-
"default": "`{}`",
|
5036
|
-
"description": "Optional. The arguments accepted by {{#link_to_component}}Primer::Beta::Avatar{{/link_to_component}}"
|
5037
|
-
},
|
5038
|
-
{
|
5039
|
-
"name": "system_arguments",
|
5040
|
-
"type": "Hash",
|
5041
|
-
"default": "N/A",
|
5042
|
-
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Alpha::NavList::Item{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
5043
|
-
}
|
5044
|
-
]
|
5045
|
-
},
|
5046
|
-
{
|
5047
|
-
"name": "render_outer_list?",
|
5048
|
-
"description": "Lists that contain top-level items (i.e. items outside of a group) should be wrapped in a <ul>",
|
5049
|
-
"parameters": [
|
5050
|
-
|
5051
|
-
]
|
5052
|
-
}
|
5053
|
-
],
|
5054
|
-
"previews": [
|
5055
|
-
{
|
5056
|
-
"preview_path": "primer/alpha/nav_list/playground",
|
5057
|
-
"name": "playground",
|
5058
|
-
"snapshot": "false",
|
5059
|
-
"skip_rules": {
|
5060
|
-
"wont_fix": [
|
5061
|
-
"region"
|
5062
|
-
],
|
5063
|
-
"will_fix": [
|
5064
|
-
"color-contrast"
|
5065
|
-
]
|
5066
|
-
}
|
5067
|
-
},
|
5068
|
-
{
|
5069
|
-
"preview_path": "primer/alpha/nav_list/default",
|
5070
|
-
"name": "default",
|
5071
|
-
"snapshot": "true",
|
5072
|
-
"skip_rules": {
|
5073
|
-
"wont_fix": [
|
5074
|
-
"region"
|
5075
|
-
],
|
5076
|
-
"will_fix": [
|
5077
|
-
"color-contrast"
|
5078
|
-
]
|
5079
|
-
}
|
5080
|
-
},
|
5081
|
-
{
|
5082
|
-
"preview_path": "primer/alpha/nav_list/top_level_items",
|
5083
|
-
"name": "top_level_items",
|
5084
|
-
"snapshot": "false",
|
5085
|
-
"skip_rules": {
|
5086
|
-
"wont_fix": [
|
5087
|
-
"region"
|
5088
|
-
],
|
5089
|
-
"will_fix": [
|
5090
|
-
"color-contrast"
|
5091
|
-
]
|
5092
|
-
}
|
5093
|
-
},
|
5094
|
-
{
|
5095
|
-
"preview_path": "primer/alpha/nav_list/show_more_item",
|
5096
|
-
"name": "show_more_item",
|
5097
|
-
"snapshot": "true",
|
5098
|
-
"skip_rules": {
|
5099
|
-
"wont_fix": [
|
5100
|
-
"region"
|
5101
|
-
],
|
5102
|
-
"will_fix": [
|
5103
|
-
"color-contrast"
|
5104
|
-
]
|
5105
|
-
}
|
5106
|
-
},
|
5107
|
-
{
|
5108
|
-
"preview_path": "primer/alpha/nav_list/trailing_action",
|
5109
|
-
"name": "trailing_action",
|
5110
|
-
"snapshot": "true",
|
5111
|
-
"skip_rules": {
|
5112
|
-
"wont_fix": [
|
5113
|
-
"region"
|
5114
|
-
],
|
5115
|
-
"will_fix": [
|
5116
|
-
"color-contrast"
|
5117
|
-
]
|
5118
|
-
}
|
5119
|
-
}
|
5120
|
-
],
|
5121
|
-
"subcomponents": [
|
5122
|
-
{
|
5123
|
-
"fully_qualified_name": "Primer::Alpha::NavList::Heading",
|
5124
|
-
"description": "The heading placed above a `NavList`'s items.\n\nSee {{#link_to_component}}Primer::Alpha::NavList{{/link_to_component}} for usage examples.",
|
5130
|
+
"fully_qualified_name": "Primer::Alpha::NavList::Divider",
|
5131
|
+
"description": "",
|
5125
5132
|
"accessibility_docs": null,
|
5126
5133
|
"is_form_component": false,
|
5127
5134
|
"is_published": true,
|
5128
5135
|
"requires_js": false,
|
5129
|
-
"component": "NavList::
|
5130
|
-
"status": "
|
5136
|
+
"component": "NavList::Divider",
|
5137
|
+
"status": "deprecated",
|
5131
5138
|
"a11y_reviewed": false,
|
5132
|
-
"short_name": "
|
5133
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/
|
5134
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/
|
5139
|
+
"short_name": "NavListDivider",
|
5140
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/divider.rb",
|
5141
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/divider/default/",
|
5135
5142
|
"parameters": [
|
5136
5143
|
{
|
5137
|
-
"name": "
|
5138
|
-
"type": "
|
5139
|
-
"default": "
|
5140
|
-
"description": "
|
5141
|
-
},
|
5142
|
-
{
|
5143
|
-
"name": "id",
|
5144
|
-
"type": "String",
|
5145
|
-
"default": "`self.class.generate_id`",
|
5146
|
-
"description": "The value of the ID HTML attribute. Auto-generated by default."
|
5147
|
-
},
|
5148
|
-
{
|
5149
|
-
"name": "heading_level",
|
5150
|
-
"type": "Integer",
|
5151
|
-
"default": "`2`",
|
5152
|
-
"description": "The heading level, i.e. 2 for an `<h2>`, 3 for an `<h3>`, etc."
|
5144
|
+
"name": "scheme",
|
5145
|
+
"type": "Symbol",
|
5146
|
+
"default": "`:subtle`",
|
5147
|
+
"description": "Display a background color if scheme is `filled`."
|
5153
5148
|
},
|
5154
5149
|
{
|
5155
5150
|
"name": "system_arguments",
|
@@ -5162,34 +5157,7 @@
|
|
5162
5157
|
|
5163
5158
|
],
|
5164
5159
|
"methods": [
|
5165
|
-
{
|
5166
|
-
"name": "title",
|
5167
|
-
"description": "Returns the value of attribute title.",
|
5168
|
-
"parameters": [
|
5169
|
-
|
5170
|
-
]
|
5171
|
-
},
|
5172
|
-
{
|
5173
|
-
"name": "id",
|
5174
|
-
"description": "Returns the value of attribute id.",
|
5175
|
-
"parameters": [
|
5176
|
-
|
5177
|
-
]
|
5178
|
-
},
|
5179
|
-
{
|
5180
|
-
"name": "heading_level",
|
5181
|
-
"description": "Returns the value of attribute heading_level.",
|
5182
|
-
"parameters": [
|
5183
|
-
|
5184
|
-
]
|
5185
|
-
},
|
5186
|
-
{
|
5187
|
-
"name": "system_arguments",
|
5188
|
-
"description": "Returns the value of attribute system_arguments.",
|
5189
|
-
"parameters": [
|
5190
5160
|
|
5191
|
-
]
|
5192
|
-
}
|
5193
5161
|
],
|
5194
5162
|
"previews": [
|
5195
5163
|
|
@@ -5199,42 +5167,24 @@
|
|
5199
5167
|
]
|
5200
5168
|
},
|
5201
5169
|
{
|
5202
|
-
"fully_qualified_name": "Primer::Alpha::NavList::
|
5203
|
-
"description": "
|
5170
|
+
"fully_qualified_name": "Primer::Alpha::NavList::Group",
|
5171
|
+
"description": "",
|
5204
5172
|
"accessibility_docs": null,
|
5205
5173
|
"is_form_component": false,
|
5206
5174
|
"is_published": true,
|
5207
5175
|
"requires_js": true,
|
5208
|
-
"component": "NavList::
|
5209
|
-
"status": "
|
5210
|
-
"a11y_reviewed":
|
5211
|
-
"short_name": "
|
5212
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/
|
5213
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/
|
5176
|
+
"component": "NavList::Group",
|
5177
|
+
"status": "deprecated",
|
5178
|
+
"a11y_reviewed": true,
|
5179
|
+
"short_name": "NavListGroup",
|
5180
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/group.rb",
|
5181
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/group/default/",
|
5214
5182
|
"parameters": [
|
5215
5183
|
{
|
5216
5184
|
"name": "selected_item_id",
|
5217
5185
|
"type": "Symbol",
|
5218
5186
|
"default": "`nil`",
|
5219
|
-
"description": "The ID of the currently selected
|
5220
|
-
},
|
5221
|
-
{
|
5222
|
-
"name": "selected_by_ids",
|
5223
|
-
"type": "Array<Symbol>",
|
5224
|
-
"default": "`[]`",
|
5225
|
-
"description": "The list of IDs that select this item. In other words, if the `selected_item_id` attribute on the parent `NavList` is set to one of these IDs, the item will appear selected."
|
5226
|
-
},
|
5227
|
-
{
|
5228
|
-
"name": "expanded",
|
5229
|
-
"type": "Boolean",
|
5230
|
-
"default": "`false`",
|
5231
|
-
"description": "Whether this item shows (expands) or hides (collapses) its list of sub items."
|
5232
|
-
},
|
5233
|
-
{
|
5234
|
-
"name": "sub_item",
|
5235
|
-
"type": "Boolean",
|
5236
|
-
"default": "`false`",
|
5237
|
-
"description": "Whether or not this item is nested under a parent item. Used internally."
|
5187
|
+
"description": "The ID of the currently selected item. Used internally."
|
5238
5188
|
},
|
5239
5189
|
{
|
5240
5190
|
"name": "system_arguments",
|
@@ -5245,244 +5195,62 @@
|
|
5245
5195
|
],
|
5246
5196
|
"slots": [
|
5247
5197
|
{
|
5248
|
-
"name": "
|
5249
|
-
"description":
|
5198
|
+
"name": "show_more_item",
|
5199
|
+
"description": "A special \"show more\" list item that appears at the bottom of the group. Clicking\nthe item will fetch the next page of results from the URL passed in the `src` argument\nand append the resulting chunk of HTML to the group.",
|
5250
5200
|
"parameters": [
|
5201
|
+
{
|
5202
|
+
"name": "src",
|
5203
|
+
"type": "String",
|
5204
|
+
"default": "N/A",
|
5205
|
+
"description": "The URL to query for additional pages of list items."
|
5206
|
+
},
|
5207
|
+
{
|
5208
|
+
"name": "pages",
|
5209
|
+
"type": "Integer",
|
5210
|
+
"default": "N/A",
|
5211
|
+
"description": "The total number of pages in the result set."
|
5212
|
+
},
|
5213
|
+
{
|
5214
|
+
"name": "component_klass",
|
5215
|
+
"type": "Class",
|
5216
|
+
"default": "N/A",
|
5217
|
+
"description": "A component class to use instead of the default `Primer::Beta::NavList::Item` class."
|
5218
|
+
},
|
5251
5219
|
{
|
5252
5220
|
"name": "system_arguments",
|
5253
5221
|
"type": "Hash",
|
5254
5222
|
"default": "N/A",
|
5255
|
-
"description": "The arguments accepted by {{#link_to_component}}Primer::
|
5223
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}."
|
5256
5224
|
}
|
5257
5225
|
]
|
5258
5226
|
},
|
5259
5227
|
{
|
5260
|
-
"name": "
|
5261
|
-
"description": "
|
5228
|
+
"name": "items",
|
5229
|
+
"description": "Items.",
|
5262
5230
|
"parameters": [
|
5263
|
-
|
5231
|
+
{
|
5232
|
+
"name": "system_arguments",
|
5233
|
+
"type": "Hash",
|
5234
|
+
"default": "N/A",
|
5235
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}."
|
5236
|
+
}
|
5264
5237
|
]
|
5265
5238
|
},
|
5266
5239
|
{
|
5267
|
-
"name": "
|
5268
|
-
"description": "
|
5240
|
+
"name": "heading",
|
5241
|
+
"description": "Heading text rendered above the list of items.",
|
5269
5242
|
"parameters": [
|
5270
|
-
|
5271
|
-
|
5272
|
-
|
5273
|
-
|
5274
|
-
|
5275
|
-
|
5276
|
-
"parameters": [
|
5277
|
-
|
5278
|
-
]
|
5279
|
-
},
|
5280
|
-
{
|
5281
|
-
"name": "trailing_action",
|
5282
|
-
"description": "A button rendered after the trailing icon that can be used to show a menu, activate\na dialog, etc.",
|
5283
|
-
"parameters": [
|
5284
|
-
{
|
5285
|
-
"name": "system_arguments",
|
5286
|
-
"type": "Hash",
|
5287
|
-
"default": "N/A",
|
5288
|
-
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
5289
|
-
}
|
5290
|
-
]
|
5291
|
-
},
|
5292
|
-
{
|
5293
|
-
"name": "tooltip",
|
5294
|
-
"description": "`Tooltip` that appears on mouse hover or keyboard focus over the trailing action button. Use tooltips sparingly and as\na last resort. **Important:** This tooltip defaults to `type: :description`. In a few scenarios, `type: :label` may be\nmore appropriate. Consult the {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}} documentation for more information.",
|
5295
|
-
"parameters": [
|
5296
|
-
{
|
5297
|
-
"name": "type",
|
5298
|
-
"type": "Symbol",
|
5299
|
-
"default": "`:description`",
|
5300
|
-
"description": "One of `:description` or `:label`."
|
5301
|
-
},
|
5302
|
-
{
|
5303
|
-
"name": "system_arguments",
|
5304
|
-
"type": "Hash",
|
5305
|
-
"default": "N/A",
|
5306
|
-
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}}."
|
5307
|
-
}
|
5308
|
-
]
|
5309
|
-
}
|
5310
|
-
],
|
5311
|
-
"methods": [
|
5312
|
-
{
|
5313
|
-
"name": "selected_by_ids",
|
5314
|
-
"description": "Returns the value of attribute selected_by_ids.",
|
5315
|
-
"parameters": [
|
5316
|
-
|
5317
|
-
]
|
5318
|
-
},
|
5319
|
-
{
|
5320
|
-
"name": "sub_item",
|
5321
|
-
"description": "Returns the value of attribute sub_item.",
|
5322
|
-
"parameters": [
|
5323
|
-
|
5324
|
-
]
|
5325
|
-
},
|
5326
|
-
{
|
5327
|
-
"name": "sub_item?",
|
5328
|
-
"description": "Returns the value of attribute sub_item.\nWhether or not this item is nested under a parent item.",
|
5329
|
-
"parameters": [
|
5330
|
-
|
5331
|
-
]
|
5332
|
-
},
|
5333
|
-
{
|
5334
|
-
"name": "expand!",
|
5335
|
-
"description": "Cause this item to show its list of sub items when rendered.",
|
5336
|
-
"parameters": [
|
5337
|
-
|
5338
|
-
]
|
5339
|
-
},
|
5340
|
-
{
|
5341
|
-
"name": "item_active?",
|
5342
|
-
"description": "Normally it would be easier to simply ask each item for its active status, eg.\nitems.any?(&:active?), but unfortunately the view context is not set on each\nitem until _after_ the parent's before_render, etc methods have been called.\nThis means helper methods like current_page? will blow up with an error, since\n`helpers` is simply an alias for the view context (i.e. an instance of\nActionView::Base). Since we know the view context for the parent object must\nbe set before `before_render` is invoked, we can call helper methods here in\nthe parent and bypass the problem entirely. Maybe not the most OO approach,\nbut it works.",
|
5343
|
-
"parameters": [
|
5344
|
-
|
5345
|
-
]
|
5346
|
-
}
|
5347
|
-
],
|
5348
|
-
"previews": [
|
5349
|
-
|
5350
|
-
],
|
5351
|
-
"subcomponents": [
|
5352
|
-
|
5353
|
-
]
|
5354
|
-
},
|
5355
|
-
{
|
5356
|
-
"fully_qualified_name": "Primer::Alpha::NavList::Divider",
|
5357
|
-
"description": "Separator with optional text rendered above groups or between individual items.",
|
5358
|
-
"accessibility_docs": null,
|
5359
|
-
"is_form_component": false,
|
5360
|
-
"is_published": true,
|
5361
|
-
"requires_js": false,
|
5362
|
-
"component": "NavList::Divider",
|
5363
|
-
"status": "alpha",
|
5364
|
-
"a11y_reviewed": false,
|
5365
|
-
"short_name": "NavListDivider",
|
5366
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/divider.rb",
|
5367
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/divider/default/",
|
5368
|
-
"parameters": [
|
5369
|
-
{
|
5370
|
-
"name": "scheme",
|
5371
|
-
"type": "Symbol",
|
5372
|
-
"default": "`:subtle`",
|
5373
|
-
"description": "Display a background color if scheme is `filled`."
|
5374
|
-
},
|
5375
|
-
{
|
5376
|
-
"name": "system_arguments",
|
5377
|
-
"type": "Hash",
|
5378
|
-
"default": "N/A",
|
5379
|
-
"description": "{{link_to_system_arguments_docs}}"
|
5380
|
-
}
|
5381
|
-
],
|
5382
|
-
"slots": [
|
5383
|
-
|
5384
|
-
],
|
5385
|
-
"methods": [
|
5386
|
-
|
5387
|
-
],
|
5388
|
-
"previews": [
|
5389
|
-
|
5390
|
-
],
|
5391
|
-
"subcomponents": [
|
5392
|
-
|
5393
|
-
]
|
5394
|
-
},
|
5395
|
-
{
|
5396
|
-
"fully_qualified_name": "Primer::Alpha::NavList::Group",
|
5397
|
-
"description": "A logical grouping of navigation links with an optional heading.\n\nSee {{#link_to_component}}Primer::Alpha::NavList{{/link_to_component}} for usage examples.",
|
5398
|
-
"accessibility_docs": null,
|
5399
|
-
"is_form_component": false,
|
5400
|
-
"is_published": true,
|
5401
|
-
"requires_js": true,
|
5402
|
-
"component": "NavList::Group",
|
5403
|
-
"status": "alpha",
|
5404
|
-
"a11y_reviewed": true,
|
5405
|
-
"short_name": "NavListGroup",
|
5406
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/group.rb",
|
5407
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/group/default/",
|
5408
|
-
"parameters": [
|
5409
|
-
{
|
5410
|
-
"name": "selected_item_id",
|
5411
|
-
"type": "Symbol",
|
5412
|
-
"default": "`nil`",
|
5413
|
-
"description": "The ID of the currently selected item. Used internally."
|
5414
|
-
},
|
5415
|
-
{
|
5416
|
-
"name": "system_arguments",
|
5417
|
-
"type": "Hash",
|
5418
|
-
"default": "N/A",
|
5419
|
-
"description": "{{link_to_system_arguments_docs}}"
|
5420
|
-
}
|
5421
|
-
],
|
5422
|
-
"slots": [
|
5423
|
-
{
|
5424
|
-
"name": "show_more_item",
|
5425
|
-
"description": "A special \"show more\" list item that appears at the bottom of the group. Clicking\nthe item will fetch the next page of results from the URL passed in the `src` argument\nand append the resulting chunk of HTML to the group.",
|
5426
|
-
"parameters": [
|
5427
|
-
{
|
5428
|
-
"name": "src",
|
5429
|
-
"type": "String",
|
5430
|
-
"default": "N/A",
|
5431
|
-
"description": "The URL to query for additional pages of list items."
|
5432
|
-
},
|
5433
|
-
{
|
5434
|
-
"name": "pages",
|
5435
|
-
"type": "Integer",
|
5436
|
-
"default": "N/A",
|
5437
|
-
"description": "The total number of pages in the result set."
|
5438
|
-
},
|
5439
|
-
{
|
5440
|
-
"name": "component_klass",
|
5441
|
-
"type": "Class",
|
5442
|
-
"default": "N/A",
|
5443
|
-
"description": "A component class to use instead of the default `Primer::Alpha::NavList::Item` class."
|
5444
|
-
},
|
5445
|
-
{
|
5446
|
-
"name": "system_arguments",
|
5447
|
-
"type": "Hash",
|
5448
|
-
"default": "N/A",
|
5449
|
-
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::NavList::Item{{/link_to_component}}."
|
5450
|
-
}
|
5451
|
-
]
|
5452
|
-
},
|
5453
|
-
{
|
5454
|
-
"name": "items",
|
5455
|
-
"description": "Items.",
|
5456
|
-
"parameters": [
|
5457
|
-
{
|
5458
|
-
"name": "system_arguments",
|
5459
|
-
"type": "Hash",
|
5460
|
-
"default": "N/A",
|
5461
|
-
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::NavList::Item{{/link_to_component}}."
|
5462
|
-
}
|
5463
|
-
]
|
5464
|
-
},
|
5465
|
-
{
|
5466
|
-
"name": "heading",
|
5467
|
-
"description": "Heading text rendered above the list of items.",
|
5468
|
-
"parameters": [
|
5469
|
-
{
|
5470
|
-
"name": "system_arguments",
|
5471
|
-
"type": "Hash",
|
5472
|
-
"default": "N/A",
|
5473
|
-
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
5474
|
-
}
|
5243
|
+
{
|
5244
|
+
"name": "system_arguments",
|
5245
|
+
"type": "Hash",
|
5246
|
+
"default": "N/A",
|
5247
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
5248
|
+
}
|
5475
5249
|
]
|
5476
5250
|
}
|
5477
5251
|
],
|
5478
5252
|
"methods": [
|
5479
|
-
{
|
5480
|
-
"name": "expand!",
|
5481
|
-
"description": "Cause this group to show its list of sub items when rendered.\n:nocov:",
|
5482
|
-
"parameters": [
|
5483
5253
|
|
5484
|
-
]
|
5485
|
-
}
|
5486
5254
|
],
|
5487
5255
|
"previews": [
|
5488
5256
|
|
@@ -6341,6 +6109,18 @@
|
|
6341
6109
|
"default": "N/A",
|
6342
6110
|
"description": "A string describing the field and what sorts of input it expects. Displayed below the group."
|
6343
6111
|
},
|
6112
|
+
{
|
6113
|
+
"name": "invalid",
|
6114
|
+
"type": "Boolean",
|
6115
|
+
"default": "N/A",
|
6116
|
+
"description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect."
|
6117
|
+
},
|
6118
|
+
{
|
6119
|
+
"name": "validation_message",
|
6120
|
+
"type": "String",
|
6121
|
+
"default": "N/A",
|
6122
|
+
"description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object."
|
6123
|
+
},
|
6344
6124
|
{
|
6345
6125
|
"name": "label_arguments",
|
6346
6126
|
"type": "Hash",
|
@@ -6398,6 +6178,19 @@
|
|
6398
6178
|
]
|
6399
6179
|
}
|
6400
6180
|
},
|
6181
|
+
{
|
6182
|
+
"preview_path": "primer/alpha/radio_button_group/invalid",
|
6183
|
+
"name": "invalid",
|
6184
|
+
"snapshot": "true",
|
6185
|
+
"skip_rules": {
|
6186
|
+
"wont_fix": [
|
6187
|
+
"region"
|
6188
|
+
],
|
6189
|
+
"will_fix": [
|
6190
|
+
"color-contrast"
|
6191
|
+
]
|
6192
|
+
}
|
6193
|
+
},
|
6401
6194
|
{
|
6402
6195
|
"preview_path": "primer/alpha/radio_button_group/with_caption",
|
6403
6196
|
"name": "with_caption",
|
@@ -8117,38 +7910,77 @@
|
|
8117
7910
|
"color-contrast"
|
8118
7911
|
]
|
8119
7912
|
}
|
8120
|
-
}
|
8121
|
-
],
|
8122
|
-
"subcomponents": [
|
8123
|
-
|
8124
|
-
]
|
8125
|
-
},
|
8126
|
-
{
|
8127
|
-
"fully_qualified_name": "Primer::Alpha::ToggleSwitch",
|
8128
|
-
"description": "The ToggleSwitch component is a button that toggles between two boolean states. It is meant to be used for\nsettings that should cause an immediate update. If configured with a \"src\" attribute, the component will\nmake a POST request containing data of the form \"value: 0 | 1\".",
|
8129
|
-
"accessibility_docs": null,
|
8130
|
-
"is_form_component": false,
|
8131
|
-
"is_published": true,
|
8132
|
-
"requires_js": true,
|
8133
|
-
"component": "ToggleSwitch",
|
8134
|
-
"status": "alpha",
|
8135
|
-
"a11y_reviewed": false,
|
8136
|
-
"short_name": "ToggleSwitch",
|
8137
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/toggle_switch.rb",
|
8138
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/toggle_switch/default/",
|
8139
|
-
"parameters": [
|
8140
|
-
{
|
8141
|
-
"name": "src",
|
8142
|
-
"type": "String",
|
8143
|
-
"default": "`nil`",
|
8144
|
-
"description": "The URL to POST to when the toggle switch is toggled. If `nil`, the toggle switch will not make any requests."
|
8145
7913
|
},
|
8146
7914
|
{
|
8147
|
-
"
|
8148
|
-
"
|
8149
|
-
"
|
8150
|
-
"
|
8151
|
-
|
7915
|
+
"preview_path": "primer/alpha/text_field/input_group_leading_button",
|
7916
|
+
"name": "input_group_leading_button",
|
7917
|
+
"snapshot": "true",
|
7918
|
+
"skip_rules": {
|
7919
|
+
"wont_fix": [
|
7920
|
+
"region"
|
7921
|
+
],
|
7922
|
+
"will_fix": [
|
7923
|
+
"color-contrast"
|
7924
|
+
]
|
7925
|
+
}
|
7926
|
+
},
|
7927
|
+
{
|
7928
|
+
"preview_path": "primer/alpha/text_field/input_group_trailing_button",
|
7929
|
+
"name": "input_group_trailing_button",
|
7930
|
+
"snapshot": "true",
|
7931
|
+
"skip_rules": {
|
7932
|
+
"wont_fix": [
|
7933
|
+
"region"
|
7934
|
+
],
|
7935
|
+
"will_fix": [
|
7936
|
+
"color-contrast"
|
7937
|
+
]
|
7938
|
+
}
|
7939
|
+
},
|
7940
|
+
{
|
7941
|
+
"preview_path": "primer/alpha/text_field/input_group_leading_action_menu",
|
7942
|
+
"name": "input_group_leading_action_menu",
|
7943
|
+
"snapshot": "true",
|
7944
|
+
"skip_rules": {
|
7945
|
+
"wont_fix": [
|
7946
|
+
"region"
|
7947
|
+
],
|
7948
|
+
"will_fix": [
|
7949
|
+
"color-contrast"
|
7950
|
+
]
|
7951
|
+
}
|
7952
|
+
}
|
7953
|
+
],
|
7954
|
+
"subcomponents": [
|
7955
|
+
|
7956
|
+
]
|
7957
|
+
},
|
7958
|
+
{
|
7959
|
+
"fully_qualified_name": "Primer::Alpha::ToggleSwitch",
|
7960
|
+
"description": "The ToggleSwitch component is a button that toggles between two boolean states. It is meant to be used for\nsettings that should cause an immediate update. If configured with a \"src\" attribute, the component will\nmake a POST request containing data of the form \"value: 0 | 1\".",
|
7961
|
+
"accessibility_docs": null,
|
7962
|
+
"is_form_component": false,
|
7963
|
+
"is_published": true,
|
7964
|
+
"requires_js": true,
|
7965
|
+
"component": "ToggleSwitch",
|
7966
|
+
"status": "alpha",
|
7967
|
+
"a11y_reviewed": false,
|
7968
|
+
"short_name": "ToggleSwitch",
|
7969
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/toggle_switch.rb",
|
7970
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/toggle_switch/default/",
|
7971
|
+
"parameters": [
|
7972
|
+
{
|
7973
|
+
"name": "src",
|
7974
|
+
"type": "String",
|
7975
|
+
"default": "`nil`",
|
7976
|
+
"description": "The URL to POST to when the toggle switch is toggled. If `nil`, the toggle switch will not make any requests."
|
7977
|
+
},
|
7978
|
+
{
|
7979
|
+
"name": "csrf_token",
|
7980
|
+
"type": "String",
|
7981
|
+
"default": "`nil`",
|
7982
|
+
"description": "A CSRF token that will be sent to the server as \"authenticity_token\" when the toggle switch is toggled. Unused if `src` is `nil`."
|
7983
|
+
},
|
8152
7984
|
{
|
8153
7985
|
"name": "checked",
|
8154
7986
|
"type": "Boolean",
|
@@ -8395,7 +8227,13 @@
|
|
8395
8227
|
|
8396
8228
|
],
|
8397
8229
|
"methods": [
|
8230
|
+
{
|
8231
|
+
"name": "id",
|
8232
|
+
"description": "Returns the value of attribute id.",
|
8233
|
+
"parameters": [
|
8398
8234
|
|
8235
|
+
]
|
8236
|
+
}
|
8399
8237
|
],
|
8400
8238
|
"previews": [
|
8401
8239
|
{
|
@@ -12151,7 +11989,7 @@
|
|
12151
11989
|
{
|
12152
11990
|
"name": "underline",
|
12153
11991
|
"type": "Boolean",
|
12154
|
-
"default": "`
|
11992
|
+
"default": "`false`",
|
12155
11993
|
"description": "Whether or not to underline the link."
|
12156
11994
|
},
|
12157
11995
|
{
|
@@ -12334,6 +12172,656 @@
|
|
12334
12172
|
|
12335
12173
|
]
|
12336
12174
|
},
|
12175
|
+
{
|
12176
|
+
"fully_qualified_name": "Primer::Beta::NavList",
|
12177
|
+
"description": "`NavList` provides a simple way to render side navigation, i.e. navigation\nthat appears to the left or right side of some main content. Each group in a\nnav list is a list of links.\n\nNav list groups can contain sub items. Rather than navigating to a URL, groups\nwith sub items expand and collapse on click. To indicate this functionality, the\ngroup will automatically render with a trailing chevron icon that changes direction\nwhen the group expands and collapses.\n\nNav list items appear visually active when selected. Each nav item must have one\nor more ID values that determine which item will appear selected. Use the\n`selected_item_id` argument to select the appropriate item.",
|
12178
|
+
"accessibility_docs": null,
|
12179
|
+
"is_form_component": false,
|
12180
|
+
"is_published": true,
|
12181
|
+
"requires_js": true,
|
12182
|
+
"component": "NavList",
|
12183
|
+
"status": "beta",
|
12184
|
+
"a11y_reviewed": true,
|
12185
|
+
"short_name": "NavList",
|
12186
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list.rb",
|
12187
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/default/",
|
12188
|
+
"parameters": [
|
12189
|
+
{
|
12190
|
+
"name": "selected_item_id",
|
12191
|
+
"type": "Symbol",
|
12192
|
+
"default": "`nil`",
|
12193
|
+
"description": "The ID of the currently selected item. The default is `nil`, meaning no item is selected."
|
12194
|
+
},
|
12195
|
+
{
|
12196
|
+
"name": "system_arguments",
|
12197
|
+
"type": "Hash",
|
12198
|
+
"default": "N/A",
|
12199
|
+
"description": "{{link_to_system_arguments_docs}}"
|
12200
|
+
}
|
12201
|
+
],
|
12202
|
+
"slots": [
|
12203
|
+
{
|
12204
|
+
"name": "heading",
|
12205
|
+
"description": "The heading for the list at large. Accepts the arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Heading{{/link_to_component}}.",
|
12206
|
+
"parameters": [
|
12207
|
+
|
12208
|
+
]
|
12209
|
+
},
|
12210
|
+
{
|
12211
|
+
"name": "items",
|
12212
|
+
"description": "Items. Items can be individual items, dividers, or groups. See the documentation for `#with_item`, `#with_divider`, and `#with_group` respectively for more information.",
|
12213
|
+
"parameters": [
|
12214
|
+
|
12215
|
+
]
|
12216
|
+
}
|
12217
|
+
],
|
12218
|
+
"methods": [
|
12219
|
+
{
|
12220
|
+
"name": "with_item",
|
12221
|
+
"description": "Adds an item to the list.",
|
12222
|
+
"parameters": [
|
12223
|
+
{
|
12224
|
+
"name": "component_klass",
|
12225
|
+
"type": "Class",
|
12226
|
+
"default": "`Primer::Beta::NavList::Item`",
|
12227
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}"
|
12228
|
+
},
|
12229
|
+
{
|
12230
|
+
"name": "system_arguments",
|
12231
|
+
"type": "Hash",
|
12232
|
+
"default": "N/A",
|
12233
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
12234
|
+
}
|
12235
|
+
]
|
12236
|
+
},
|
12237
|
+
{
|
12238
|
+
"name": "with_avatar_item",
|
12239
|
+
"description": "Adds an avatar item to the list. Avatar items are a convenient way to accessibly add an item with a leading avatar image.",
|
12240
|
+
"parameters": [
|
12241
|
+
{
|
12242
|
+
"name": "src",
|
12243
|
+
"type": "String",
|
12244
|
+
"default": "N/A",
|
12245
|
+
"description": "The source url of the avatar image."
|
12246
|
+
},
|
12247
|
+
{
|
12248
|
+
"name": "username",
|
12249
|
+
"type": "String",
|
12250
|
+
"default": "N/A",
|
12251
|
+
"description": "The username associated with the avatar."
|
12252
|
+
},
|
12253
|
+
{
|
12254
|
+
"name": "full_name",
|
12255
|
+
"type": "String",
|
12256
|
+
"default": "`nil`",
|
12257
|
+
"description": "Optional. The user's full name."
|
12258
|
+
},
|
12259
|
+
{
|
12260
|
+
"name": "full_name_scheme",
|
12261
|
+
"type": "Symbol",
|
12262
|
+
"default": "`:block`",
|
12263
|
+
"description": "Optional. How to display the user's full name. One of `:block` or `:inline`."
|
12264
|
+
},
|
12265
|
+
{
|
12266
|
+
"name": "component_klass",
|
12267
|
+
"type": "Class",
|
12268
|
+
"default": "`Primer::Beta::NavList::Item`",
|
12269
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}"
|
12270
|
+
},
|
12271
|
+
{
|
12272
|
+
"name": "avatar_arguments",
|
12273
|
+
"type": "Hash",
|
12274
|
+
"default": "`{}`",
|
12275
|
+
"description": "Optional. The arguments accepted by {{#link_to_component}}Primer::Beta::Avatar{{/link_to_component}}"
|
12276
|
+
},
|
12277
|
+
{
|
12278
|
+
"name": "system_arguments",
|
12279
|
+
"type": "Hash",
|
12280
|
+
"default": "N/A",
|
12281
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
12282
|
+
}
|
12283
|
+
]
|
12284
|
+
},
|
12285
|
+
{
|
12286
|
+
"name": "with_group",
|
12287
|
+
"description": "Adds a group to the list. A group is a list of links and a (required) heading.",
|
12288
|
+
"parameters": [
|
12289
|
+
{
|
12290
|
+
"name": "system_arguments",
|
12291
|
+
"type": "Hash",
|
12292
|
+
"default": "N/A",
|
12293
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Group{{/link_to_component}}."
|
12294
|
+
}
|
12295
|
+
]
|
12296
|
+
},
|
12297
|
+
{
|
12298
|
+
"name": "with_divider",
|
12299
|
+
"description": "Adds a divider to the list. Dividers visually separate items and groups.",
|
12300
|
+
"parameters": [
|
12301
|
+
{
|
12302
|
+
"name": "system_arguments",
|
12303
|
+
"type": "Hash",
|
12304
|
+
"default": "N/A",
|
12305
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Divider{{/link_to_component}}."
|
12306
|
+
}
|
12307
|
+
]
|
12308
|
+
},
|
12309
|
+
{
|
12310
|
+
"name": "build_item",
|
12311
|
+
"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.",
|
12312
|
+
"parameters": [
|
12313
|
+
{
|
12314
|
+
"name": "component_klass",
|
12315
|
+
"type": "Class",
|
12316
|
+
"default": "`Primer::Beta::NavList::Item`",
|
12317
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}"
|
12318
|
+
},
|
12319
|
+
{
|
12320
|
+
"name": "system_arguments",
|
12321
|
+
"type": "Hash",
|
12322
|
+
"default": "N/A",
|
12323
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
12324
|
+
}
|
12325
|
+
]
|
12326
|
+
},
|
12327
|
+
{
|
12328
|
+
"name": "build_avatar_item",
|
12329
|
+
"description": "Builds a new avatar item but does not add it to the list. Avatar items\nare a convenient way to accessibly add an item with a leading avatar\nimage. Use this method instead of the `#with_avatar_item` slot if you\nneed to render an avatar item outside the context of a list, eg. if\nrendering additional items to append to an existing list, perhaps via\na separate HTTP request.",
|
12330
|
+
"parameters": [
|
12331
|
+
{
|
12332
|
+
"name": "src",
|
12333
|
+
"type": "String",
|
12334
|
+
"default": "N/A",
|
12335
|
+
"description": "The source url of the avatar image."
|
12336
|
+
},
|
12337
|
+
{
|
12338
|
+
"name": "username",
|
12339
|
+
"type": "String",
|
12340
|
+
"default": "N/A",
|
12341
|
+
"description": "The username associated with the avatar."
|
12342
|
+
},
|
12343
|
+
{
|
12344
|
+
"name": "full_name",
|
12345
|
+
"type": "String",
|
12346
|
+
"default": "`nil`",
|
12347
|
+
"description": "Optional. The user's full name."
|
12348
|
+
},
|
12349
|
+
{
|
12350
|
+
"name": "full_name_scheme",
|
12351
|
+
"type": "Symbol",
|
12352
|
+
"default": "`:block`",
|
12353
|
+
"description": "Optional. How to display the user's full name. One of `:block` or `:inline`."
|
12354
|
+
},
|
12355
|
+
{
|
12356
|
+
"name": "component_klass",
|
12357
|
+
"type": "Class",
|
12358
|
+
"default": "`Primer::Beta::NavList::Item`",
|
12359
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}"
|
12360
|
+
},
|
12361
|
+
{
|
12362
|
+
"name": "avatar_arguments",
|
12363
|
+
"type": "Hash",
|
12364
|
+
"default": "`{}`",
|
12365
|
+
"description": "Optional. The arguments accepted by {{#link_to_component}}Primer::Beta::Avatar{{/link_to_component}}"
|
12366
|
+
},
|
12367
|
+
{
|
12368
|
+
"name": "system_arguments",
|
12369
|
+
"type": "Hash",
|
12370
|
+
"default": "N/A",
|
12371
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
12372
|
+
}
|
12373
|
+
]
|
12374
|
+
},
|
12375
|
+
{
|
12376
|
+
"name": "render_outer_list?",
|
12377
|
+
"description": "Lists that contain top-level items (i.e. items outside of a group) should be wrapped in a <ul>",
|
12378
|
+
"parameters": [
|
12379
|
+
|
12380
|
+
]
|
12381
|
+
}
|
12382
|
+
],
|
12383
|
+
"previews": [
|
12384
|
+
{
|
12385
|
+
"preview_path": "primer/beta/nav_list/playground",
|
12386
|
+
"name": "playground",
|
12387
|
+
"snapshot": "false",
|
12388
|
+
"skip_rules": {
|
12389
|
+
"wont_fix": [
|
12390
|
+
"region"
|
12391
|
+
],
|
12392
|
+
"will_fix": [
|
12393
|
+
"color-contrast"
|
12394
|
+
]
|
12395
|
+
}
|
12396
|
+
},
|
12397
|
+
{
|
12398
|
+
"preview_path": "primer/beta/nav_list/default",
|
12399
|
+
"name": "default",
|
12400
|
+
"snapshot": "true",
|
12401
|
+
"skip_rules": {
|
12402
|
+
"wont_fix": [
|
12403
|
+
"region"
|
12404
|
+
],
|
12405
|
+
"will_fix": [
|
12406
|
+
"color-contrast"
|
12407
|
+
]
|
12408
|
+
}
|
12409
|
+
},
|
12410
|
+
{
|
12411
|
+
"preview_path": "primer/beta/nav_list/top_level_items",
|
12412
|
+
"name": "top_level_items",
|
12413
|
+
"snapshot": "false",
|
12414
|
+
"skip_rules": {
|
12415
|
+
"wont_fix": [
|
12416
|
+
"region"
|
12417
|
+
],
|
12418
|
+
"will_fix": [
|
12419
|
+
"color-contrast"
|
12420
|
+
]
|
12421
|
+
}
|
12422
|
+
},
|
12423
|
+
{
|
12424
|
+
"preview_path": "primer/beta/nav_list/show_more_item",
|
12425
|
+
"name": "show_more_item",
|
12426
|
+
"snapshot": "true",
|
12427
|
+
"skip_rules": {
|
12428
|
+
"wont_fix": [
|
12429
|
+
"region"
|
12430
|
+
],
|
12431
|
+
"will_fix": [
|
12432
|
+
"color-contrast"
|
12433
|
+
]
|
12434
|
+
}
|
12435
|
+
},
|
12436
|
+
{
|
12437
|
+
"preview_path": "primer/beta/nav_list/trailing_action",
|
12438
|
+
"name": "trailing_action",
|
12439
|
+
"snapshot": "true",
|
12440
|
+
"skip_rules": {
|
12441
|
+
"wont_fix": [
|
12442
|
+
"region"
|
12443
|
+
],
|
12444
|
+
"will_fix": [
|
12445
|
+
"color-contrast"
|
12446
|
+
]
|
12447
|
+
}
|
12448
|
+
}
|
12449
|
+
],
|
12450
|
+
"subcomponents": [
|
12451
|
+
{
|
12452
|
+
"fully_qualified_name": "Primer::Beta::NavList::Heading",
|
12453
|
+
"description": "The heading placed above a `NavList`'s items.\n\nSee {{#link_to_component}}Primer::Beta::NavList{{/link_to_component}} for usage examples.",
|
12454
|
+
"accessibility_docs": null,
|
12455
|
+
"is_form_component": false,
|
12456
|
+
"is_published": true,
|
12457
|
+
"requires_js": false,
|
12458
|
+
"component": "NavList::Heading",
|
12459
|
+
"status": "alpha",
|
12460
|
+
"a11y_reviewed": false,
|
12461
|
+
"short_name": "NavListHeading",
|
12462
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/heading.rb",
|
12463
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/heading/default/",
|
12464
|
+
"parameters": [
|
12465
|
+
{
|
12466
|
+
"name": "title",
|
12467
|
+
"type": "String",
|
12468
|
+
"default": "N/A",
|
12469
|
+
"description": "The text content of the heading."
|
12470
|
+
},
|
12471
|
+
{
|
12472
|
+
"name": "id",
|
12473
|
+
"type": "String",
|
12474
|
+
"default": "`self.class.generate_id`",
|
12475
|
+
"description": "The value of the ID HTML attribute. Auto-generated by default."
|
12476
|
+
},
|
12477
|
+
{
|
12478
|
+
"name": "heading_level",
|
12479
|
+
"type": "Integer",
|
12480
|
+
"default": "`2`",
|
12481
|
+
"description": "The heading level, i.e. 2 for an `<h2>`, 3 for an `<h3>`, etc."
|
12482
|
+
},
|
12483
|
+
{
|
12484
|
+
"name": "system_arguments",
|
12485
|
+
"type": "Hash",
|
12486
|
+
"default": "N/A",
|
12487
|
+
"description": "{{link_to_system_arguments_docs}}"
|
12488
|
+
}
|
12489
|
+
],
|
12490
|
+
"slots": [
|
12491
|
+
|
12492
|
+
],
|
12493
|
+
"methods": [
|
12494
|
+
{
|
12495
|
+
"name": "title",
|
12496
|
+
"description": "Returns the value of attribute title.",
|
12497
|
+
"parameters": [
|
12498
|
+
|
12499
|
+
]
|
12500
|
+
},
|
12501
|
+
{
|
12502
|
+
"name": "id",
|
12503
|
+
"description": "Returns the value of attribute id.",
|
12504
|
+
"parameters": [
|
12505
|
+
|
12506
|
+
]
|
12507
|
+
},
|
12508
|
+
{
|
12509
|
+
"name": "heading_level",
|
12510
|
+
"description": "Returns the value of attribute heading_level.",
|
12511
|
+
"parameters": [
|
12512
|
+
|
12513
|
+
]
|
12514
|
+
},
|
12515
|
+
{
|
12516
|
+
"name": "system_arguments",
|
12517
|
+
"description": "Returns the value of attribute system_arguments.",
|
12518
|
+
"parameters": [
|
12519
|
+
|
12520
|
+
]
|
12521
|
+
}
|
12522
|
+
],
|
12523
|
+
"previews": [
|
12524
|
+
|
12525
|
+
],
|
12526
|
+
"subcomponents": [
|
12527
|
+
|
12528
|
+
]
|
12529
|
+
},
|
12530
|
+
{
|
12531
|
+
"fully_qualified_name": "Primer::Beta::NavList::Item",
|
12532
|
+
"description": "Items are rendered as styled links. They can optionally include leading and/or trailing visuals,\nsuch as icons, avatars, and counters. Items are selected by ID. IDs can be specified via the\n`selected_item_ids` argument, which accepts a list of valid IDs for the item. Items can also\nthemselves contain sub items. Sub items are rendered collapsed by default.",
|
12533
|
+
"accessibility_docs": null,
|
12534
|
+
"is_form_component": false,
|
12535
|
+
"is_published": true,
|
12536
|
+
"requires_js": true,
|
12537
|
+
"component": "NavList::Item",
|
12538
|
+
"status": "alpha",
|
12539
|
+
"a11y_reviewed": false,
|
12540
|
+
"short_name": "NavListItem",
|
12541
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/item.rb",
|
12542
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/item/default/",
|
12543
|
+
"parameters": [
|
12544
|
+
{
|
12545
|
+
"name": "selected_item_id",
|
12546
|
+
"type": "Symbol",
|
12547
|
+
"default": "`nil`",
|
12548
|
+
"description": "The ID of the currently selected list item. Used internally."
|
12549
|
+
},
|
12550
|
+
{
|
12551
|
+
"name": "selected_by_ids",
|
12552
|
+
"type": "Array<Symbol>",
|
12553
|
+
"default": "`[]`",
|
12554
|
+
"description": "The list of IDs that select this item. In other words, if the `selected_item_id` attribute on the parent `NavList` is set to one of these IDs, the item will appear selected."
|
12555
|
+
},
|
12556
|
+
{
|
12557
|
+
"name": "expanded",
|
12558
|
+
"type": "Boolean",
|
12559
|
+
"default": "`false`",
|
12560
|
+
"description": "Whether this item shows (expands) or hides (collapses) its list of sub items."
|
12561
|
+
},
|
12562
|
+
{
|
12563
|
+
"name": "sub_item",
|
12564
|
+
"type": "Boolean",
|
12565
|
+
"default": "`false`",
|
12566
|
+
"description": "Whether or not this item is nested under a parent item. Used internally."
|
12567
|
+
},
|
12568
|
+
{
|
12569
|
+
"name": "system_arguments",
|
12570
|
+
"type": "Hash",
|
12571
|
+
"default": "N/A",
|
12572
|
+
"description": "{{link_to_system_arguments_docs}}"
|
12573
|
+
}
|
12574
|
+
],
|
12575
|
+
"slots": [
|
12576
|
+
{
|
12577
|
+
"name": "items",
|
12578
|
+
"description": null,
|
12579
|
+
"parameters": [
|
12580
|
+
{
|
12581
|
+
"name": "system_arguments",
|
12582
|
+
"type": "Hash",
|
12583
|
+
"default": "N/A",
|
12584
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList::Item{{/link_to_component}}."
|
12585
|
+
}
|
12586
|
+
]
|
12587
|
+
},
|
12588
|
+
{
|
12589
|
+
"name": "description",
|
12590
|
+
"description": "Description content that complements the item's label. See `ActionList`'s `description_scheme` argument\nfor layout options.",
|
12591
|
+
"parameters": [
|
12592
|
+
|
12593
|
+
]
|
12594
|
+
},
|
12595
|
+
{
|
12596
|
+
"name": "leading_visual",
|
12597
|
+
"description": "An icon, avatar, SVG, or custom content that will render to the left 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 an SVG, call the `with_leading_visual_svg` method.\n\nTo render custom content, call the `with_leading_visual_content` method and pass a block that returns a string.",
|
12598
|
+
"parameters": [
|
12599
|
+
|
12600
|
+
]
|
12601
|
+
},
|
12602
|
+
{
|
12603
|
+
"name": "trailing_visual",
|
12604
|
+
"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```",
|
12605
|
+
"parameters": [
|
12606
|
+
|
12607
|
+
]
|
12608
|
+
},
|
12609
|
+
{
|
12610
|
+
"name": "trailing_action",
|
12611
|
+
"description": "A button rendered after the trailing icon that can be used to show a menu, activate\na dialog, etc.",
|
12612
|
+
"parameters": [
|
12613
|
+
{
|
12614
|
+
"name": "system_arguments",
|
12615
|
+
"type": "Hash",
|
12616
|
+
"default": "N/A",
|
12617
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
12618
|
+
}
|
12619
|
+
]
|
12620
|
+
},
|
12621
|
+
{
|
12622
|
+
"name": "tooltip",
|
12623
|
+
"description": "`Tooltip` that appears on mouse hover or keyboard focus over the trailing action button. Use tooltips sparingly and as\na last resort. **Important:** This tooltip defaults to `type: :description`. In a few scenarios, `type: :label` may be\nmore appropriate. Consult the {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}} documentation for more information.",
|
12624
|
+
"parameters": [
|
12625
|
+
{
|
12626
|
+
"name": "type",
|
12627
|
+
"type": "Symbol",
|
12628
|
+
"default": "`:description`",
|
12629
|
+
"description": "One of `:description` or `:label`."
|
12630
|
+
},
|
12631
|
+
{
|
12632
|
+
"name": "system_arguments",
|
12633
|
+
"type": "Hash",
|
12634
|
+
"default": "N/A",
|
12635
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::Tooltip{{/link_to_component}}."
|
12636
|
+
}
|
12637
|
+
]
|
12638
|
+
}
|
12639
|
+
],
|
12640
|
+
"methods": [
|
12641
|
+
{
|
12642
|
+
"name": "selected_by_ids",
|
12643
|
+
"description": "Returns the value of attribute selected_by_ids.",
|
12644
|
+
"parameters": [
|
12645
|
+
|
12646
|
+
]
|
12647
|
+
},
|
12648
|
+
{
|
12649
|
+
"name": "sub_item",
|
12650
|
+
"description": "Returns the value of attribute sub_item.",
|
12651
|
+
"parameters": [
|
12652
|
+
|
12653
|
+
]
|
12654
|
+
},
|
12655
|
+
{
|
12656
|
+
"name": "sub_item?",
|
12657
|
+
"description": "Returns the value of attribute sub_item.\nWhether or not this item is nested under a parent item.",
|
12658
|
+
"parameters": [
|
12659
|
+
|
12660
|
+
]
|
12661
|
+
},
|
12662
|
+
{
|
12663
|
+
"name": "expand!",
|
12664
|
+
"description": "Cause this item to show its list of sub items when rendered.",
|
12665
|
+
"parameters": [
|
12666
|
+
|
12667
|
+
]
|
12668
|
+
},
|
12669
|
+
{
|
12670
|
+
"name": "item_active?",
|
12671
|
+
"description": "Normally it would be easier to simply ask each item for its active status, eg.\nitems.any?(&:active?), but unfortunately the view context is not set on each\nitem until _after_ the parent's before_render, etc methods have been called.\nThis means helper methods like current_page? will blow up with an error, since\n`helpers` is simply an alias for the view context (i.e. an instance of\nActionView::Base). Since we know the view context for the parent object must\nbe set before `before_render` is invoked, we can call helper methods here in\nthe parent and bypass the problem entirely. Maybe not the most OO approach,\nbut it works.",
|
12672
|
+
"parameters": [
|
12673
|
+
|
12674
|
+
]
|
12675
|
+
}
|
12676
|
+
],
|
12677
|
+
"previews": [
|
12678
|
+
|
12679
|
+
],
|
12680
|
+
"subcomponents": [
|
12681
|
+
|
12682
|
+
]
|
12683
|
+
},
|
12684
|
+
{
|
12685
|
+
"fully_qualified_name": "Primer::Beta::NavList::Divider",
|
12686
|
+
"description": "Separator with optional text rendered above groups or between individual items.",
|
12687
|
+
"accessibility_docs": null,
|
12688
|
+
"is_form_component": false,
|
12689
|
+
"is_published": true,
|
12690
|
+
"requires_js": false,
|
12691
|
+
"component": "NavList::Divider",
|
12692
|
+
"status": "alpha",
|
12693
|
+
"a11y_reviewed": false,
|
12694
|
+
"short_name": "NavListDivider",
|
12695
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/divider.rb",
|
12696
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/divider/default/",
|
12697
|
+
"parameters": [
|
12698
|
+
{
|
12699
|
+
"name": "scheme",
|
12700
|
+
"type": "Symbol",
|
12701
|
+
"default": "`:subtle`",
|
12702
|
+
"description": "Display a background color if scheme is `filled`."
|
12703
|
+
},
|
12704
|
+
{
|
12705
|
+
"name": "system_arguments",
|
12706
|
+
"type": "Hash",
|
12707
|
+
"default": "N/A",
|
12708
|
+
"description": "{{link_to_system_arguments_docs}}"
|
12709
|
+
}
|
12710
|
+
],
|
12711
|
+
"slots": [
|
12712
|
+
|
12713
|
+
],
|
12714
|
+
"methods": [
|
12715
|
+
|
12716
|
+
],
|
12717
|
+
"previews": [
|
12718
|
+
|
12719
|
+
],
|
12720
|
+
"subcomponents": [
|
12721
|
+
|
12722
|
+
]
|
12723
|
+
},
|
12724
|
+
{
|
12725
|
+
"fully_qualified_name": "Primer::Beta::NavList::Group",
|
12726
|
+
"description": "A logical grouping of navigation links with an optional heading.\n\nSee {{#link_to_component}}Primer::Beta::NavList{{/link_to_component}} for usage examples.",
|
12727
|
+
"accessibility_docs": null,
|
12728
|
+
"is_form_component": false,
|
12729
|
+
"is_published": true,
|
12730
|
+
"requires_js": true,
|
12731
|
+
"component": "NavList::Group",
|
12732
|
+
"status": "alpha",
|
12733
|
+
"a11y_reviewed": true,
|
12734
|
+
"short_name": "NavListGroup",
|
12735
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/group.rb",
|
12736
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/group/default/",
|
12737
|
+
"parameters": [
|
12738
|
+
{
|
12739
|
+
"name": "selected_item_id",
|
12740
|
+
"type": "Symbol",
|
12741
|
+
"default": "`nil`",
|
12742
|
+
"description": "The ID of the currently selected item. Used internally."
|
12743
|
+
},
|
12744
|
+
{
|
12745
|
+
"name": "system_arguments",
|
12746
|
+
"type": "Hash",
|
12747
|
+
"default": "N/A",
|
12748
|
+
"description": "{{link_to_system_arguments_docs}}"
|
12749
|
+
}
|
12750
|
+
],
|
12751
|
+
"slots": [
|
12752
|
+
{
|
12753
|
+
"name": "show_more_item",
|
12754
|
+
"description": "A special \"show more\" list item that appears at the bottom of the group. Clicking\nthe item will fetch the next page of results from the URL passed in the `src` argument\nand append the resulting chunk of HTML to the group.",
|
12755
|
+
"parameters": [
|
12756
|
+
{
|
12757
|
+
"name": "src",
|
12758
|
+
"type": "String",
|
12759
|
+
"default": "N/A",
|
12760
|
+
"description": "The URL to query for additional pages of list items."
|
12761
|
+
},
|
12762
|
+
{
|
12763
|
+
"name": "pages",
|
12764
|
+
"type": "Integer",
|
12765
|
+
"default": "N/A",
|
12766
|
+
"description": "The total number of pages in the result set."
|
12767
|
+
},
|
12768
|
+
{
|
12769
|
+
"name": "component_klass",
|
12770
|
+
"type": "Class",
|
12771
|
+
"default": "N/A",
|
12772
|
+
"description": "A component class to use instead of the default `Primer::Beta::NavList::Item` class."
|
12773
|
+
},
|
12774
|
+
{
|
12775
|
+
"name": "system_arguments",
|
12776
|
+
"type": "Hash",
|
12777
|
+
"default": "N/A",
|
12778
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}."
|
12779
|
+
}
|
12780
|
+
]
|
12781
|
+
},
|
12782
|
+
{
|
12783
|
+
"name": "items",
|
12784
|
+
"description": "Items.",
|
12785
|
+
"parameters": [
|
12786
|
+
{
|
12787
|
+
"name": "system_arguments",
|
12788
|
+
"type": "Hash",
|
12789
|
+
"default": "N/A",
|
12790
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::NavList::Item{{/link_to_component}}."
|
12791
|
+
}
|
12792
|
+
]
|
12793
|
+
},
|
12794
|
+
{
|
12795
|
+
"name": "heading",
|
12796
|
+
"description": "Heading text rendered above the list of items.",
|
12797
|
+
"parameters": [
|
12798
|
+
{
|
12799
|
+
"name": "system_arguments",
|
12800
|
+
"type": "Hash",
|
12801
|
+
"default": "N/A",
|
12802
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList::Heading{{/link_to_component}}."
|
12803
|
+
}
|
12804
|
+
]
|
12805
|
+
}
|
12806
|
+
],
|
12807
|
+
"methods": [
|
12808
|
+
{
|
12809
|
+
"name": "expand!",
|
12810
|
+
"description": "Cause this group to show its list of sub items when rendered.\n:nocov:",
|
12811
|
+
"parameters": [
|
12812
|
+
|
12813
|
+
]
|
12814
|
+
}
|
12815
|
+
],
|
12816
|
+
"previews": [
|
12817
|
+
|
12818
|
+
],
|
12819
|
+
"subcomponents": [
|
12820
|
+
|
12821
|
+
]
|
12822
|
+
}
|
12823
|
+
]
|
12824
|
+
},
|
12337
12825
|
{
|
12338
12826
|
"fully_qualified_name": "Primer::Beta::Octicon",
|
12339
12827
|
"description": "`Octicon` renders an {{link_to_octicons}} with {{link_to_system_arguments_docs}}.\n`Octicon` can also be rendered with the `primer_octicon` helper, which accepts the same arguments.",
|