@openproject/primer-view-components 0.71.0 → 0.72.0-rc.ce1a1c88d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/javascripts/components/primer/open_project/filterable_tree_view.d.ts +2 -2
- package/app/assets/javascripts/components/primer/primer.d.ts +4 -4
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +1 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/{open_project → alpha}/skeleton_box.css.json +1 -1
- package/app/components/primer/{open_project → alpha}/tree_view/tree_view_include_fragment_element.js +0 -1
- package/app/components/primer/{open_project → alpha}/tree_view.css +1 -1
- package/app/components/primer/{open_project → alpha}/tree_view.css.json +1 -3
- package/app/components/primer/beta/breadcrumbs.css +1 -1
- package/app/components/primer/beta/breadcrumbs.css.json +0 -1
- package/app/components/primer/beta/progress_bar.css +1 -1
- package/app/components/primer/open_project/filterable_tree_view.d.ts +2 -2
- package/app/components/primer/open_project/filterable_tree_view.js +2 -2
- package/app/components/primer/primer.d.ts +4 -4
- package/app/components/primer/primer.js +4 -4
- package/package.json +2 -2
- package/static/arguments.json +456 -0
- package/static/audited_at.json +17 -17
- package/static/classes.json +5 -5
- package/static/constants.json +101 -0
- package/static/info_arch.json +1398 -44
- package/static/previews.json +94 -13
- package/static/statuses.json +17 -0
- /package/app/assets/javascripts/components/primer/{open_project → alpha}/tree_view/tree_view.d.ts +0 -0
- /package/app/assets/javascripts/components/primer/{open_project → alpha}/tree_view/tree_view_icon_pair_element.d.ts +0 -0
- /package/app/assets/javascripts/components/primer/{open_project → alpha}/tree_view/tree_view_include_fragment_element.d.ts +0 -0
- /package/app/assets/javascripts/components/primer/{open_project → alpha}/tree_view/tree_view_roving_tab_index.d.ts +0 -0
- /package/app/assets/javascripts/components/primer/{open_project → alpha}/tree_view/tree_view_sub_tree_node_element.d.ts +0 -0
- /package/app/components/primer/{open_project → alpha}/skeleton_box.css +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view.d.ts +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view.js +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_icon_pair_element.d.ts +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_icon_pair_element.js +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_include_fragment_element.d.ts +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_roving_tab_index.d.ts +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_roving_tab_index.js +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_sub_tree_node_element.d.ts +0 -0
- /package/app/components/primer/{open_project → alpha}/tree_view/tree_view_sub_tree_node_element.js +0 -0
package/static/info_arch.json
CHANGED
|
@@ -4478,6 +4478,148 @@
|
|
|
4478
4478
|
}
|
|
4479
4479
|
]
|
|
4480
4480
|
},
|
|
4481
|
+
{
|
|
4482
|
+
"fully_qualified_name": "Primer::Alpha::FileTreeView",
|
|
4483
|
+
"description": "",
|
|
4484
|
+
"accessibility_docs": null,
|
|
4485
|
+
"is_form_component": false,
|
|
4486
|
+
"is_published": true,
|
|
4487
|
+
"requires_js": false,
|
|
4488
|
+
"component": "FileTreeView",
|
|
4489
|
+
"status": "alpha",
|
|
4490
|
+
"a11y_reviewed": false,
|
|
4491
|
+
"short_name": "FileTreeView",
|
|
4492
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/file_tree_view.rb",
|
|
4493
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/file_tree_view/default/",
|
|
4494
|
+
"parameters": [
|
|
4495
|
+
{
|
|
4496
|
+
"name": "node_variant",
|
|
4497
|
+
"type": "Symbol",
|
|
4498
|
+
"default": "`:div`",
|
|
4499
|
+
"description": "The variant to use for this node. One of `:anchor`, `:button`, or `:div`."
|
|
4500
|
+
},
|
|
4501
|
+
{
|
|
4502
|
+
"name": "form_arguments",
|
|
4503
|
+
"type": "Hash",
|
|
4504
|
+
"default": "`{}`",
|
|
4505
|
+
"description": "These arguments allow the selections made within a `TreeView` to be submitted to the server as part of a Rails form. 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."
|
|
4506
|
+
},
|
|
4507
|
+
{
|
|
4508
|
+
"name": "system_arguments",
|
|
4509
|
+
"type": "Hash",
|
|
4510
|
+
"default": "N/A",
|
|
4511
|
+
"description": "{{link_to_system_arguments_docs}}."
|
|
4512
|
+
}
|
|
4513
|
+
],
|
|
4514
|
+
"slots": [
|
|
4515
|
+
{
|
|
4516
|
+
"name": "nodes",
|
|
4517
|
+
"description": null,
|
|
4518
|
+
"parameters": []
|
|
4519
|
+
}
|
|
4520
|
+
],
|
|
4521
|
+
"methods": [],
|
|
4522
|
+
"previews": [
|
|
4523
|
+
{
|
|
4524
|
+
"preview_path": "primer/alpha/file_tree_view/default",
|
|
4525
|
+
"name": "default",
|
|
4526
|
+
"snapshot": "interactive",
|
|
4527
|
+
"skip_rules": {
|
|
4528
|
+
"wont_fix": [
|
|
4529
|
+
"region"
|
|
4530
|
+
],
|
|
4531
|
+
"will_fix": [
|
|
4532
|
+
"color-contrast"
|
|
4533
|
+
]
|
|
4534
|
+
}
|
|
4535
|
+
},
|
|
4536
|
+
{
|
|
4537
|
+
"preview_path": "primer/alpha/file_tree_view/playground",
|
|
4538
|
+
"name": "playground",
|
|
4539
|
+
"snapshot": "false",
|
|
4540
|
+
"skip_rules": {
|
|
4541
|
+
"wont_fix": [
|
|
4542
|
+
"region"
|
|
4543
|
+
],
|
|
4544
|
+
"will_fix": [
|
|
4545
|
+
"color-contrast"
|
|
4546
|
+
]
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
],
|
|
4550
|
+
"subcomponents": [
|
|
4551
|
+
{
|
|
4552
|
+
"fully_qualified_name": "Primer::Alpha::FileTreeView::FileNode",
|
|
4553
|
+
"description": "",
|
|
4554
|
+
"accessibility_docs": null,
|
|
4555
|
+
"is_form_component": false,
|
|
4556
|
+
"is_published": true,
|
|
4557
|
+
"requires_js": false,
|
|
4558
|
+
"component": "FileTreeView::FileNode",
|
|
4559
|
+
"status": "alpha",
|
|
4560
|
+
"a11y_reviewed": false,
|
|
4561
|
+
"short_name": "FileTreeViewFileNode",
|
|
4562
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/file_tree_view/file_node.rb",
|
|
4563
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/file_tree_view/file_node/default/",
|
|
4564
|
+
"parameters": [],
|
|
4565
|
+
"slots": [
|
|
4566
|
+
{
|
|
4567
|
+
"name": "leading_visual",
|
|
4568
|
+
"description": null,
|
|
4569
|
+
"parameters": []
|
|
4570
|
+
},
|
|
4571
|
+
{
|
|
4572
|
+
"name": "leading_action",
|
|
4573
|
+
"description": null,
|
|
4574
|
+
"parameters": []
|
|
4575
|
+
},
|
|
4576
|
+
{
|
|
4577
|
+
"name": "trailing_visual",
|
|
4578
|
+
"description": null,
|
|
4579
|
+
"parameters": []
|
|
4580
|
+
}
|
|
4581
|
+
],
|
|
4582
|
+
"methods": [],
|
|
4583
|
+
"previews": [],
|
|
4584
|
+
"subcomponents": []
|
|
4585
|
+
},
|
|
4586
|
+
{
|
|
4587
|
+
"fully_qualified_name": "Primer::Alpha::FileTreeView::DirectoryNode",
|
|
4588
|
+
"description": "",
|
|
4589
|
+
"accessibility_docs": null,
|
|
4590
|
+
"is_form_component": false,
|
|
4591
|
+
"is_published": true,
|
|
4592
|
+
"requires_js": false,
|
|
4593
|
+
"component": "FileTreeView::DirectoryNode",
|
|
4594
|
+
"status": "alpha",
|
|
4595
|
+
"a11y_reviewed": false,
|
|
4596
|
+
"short_name": "FileTreeViewDirectoryNode",
|
|
4597
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/file_tree_view/directory_node.rb",
|
|
4598
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/file_tree_view/directory_node/default/",
|
|
4599
|
+
"parameters": [],
|
|
4600
|
+
"slots": [
|
|
4601
|
+
{
|
|
4602
|
+
"name": "leading_visual",
|
|
4603
|
+
"description": null,
|
|
4604
|
+
"parameters": []
|
|
4605
|
+
},
|
|
4606
|
+
{
|
|
4607
|
+
"name": "leading_action",
|
|
4608
|
+
"description": null,
|
|
4609
|
+
"parameters": []
|
|
4610
|
+
},
|
|
4611
|
+
{
|
|
4612
|
+
"name": "trailing_visual",
|
|
4613
|
+
"description": null,
|
|
4614
|
+
"parameters": []
|
|
4615
|
+
}
|
|
4616
|
+
],
|
|
4617
|
+
"methods": [],
|
|
4618
|
+
"previews": [],
|
|
4619
|
+
"subcomponents": []
|
|
4620
|
+
}
|
|
4621
|
+
]
|
|
4622
|
+
},
|
|
4481
4623
|
{
|
|
4482
4624
|
"fully_qualified_name": "Primer::Alpha::FormButton",
|
|
4483
4625
|
"description": "A button input rendered using the HTML `<button type=\"button\">` tag.\n\nThis component wraps the Primer button component and supports the same slots and arguments.",
|
|
@@ -8331,6 +8473,71 @@
|
|
|
8331
8473
|
}
|
|
8332
8474
|
]
|
|
8333
8475
|
},
|
|
8476
|
+
{
|
|
8477
|
+
"fully_qualified_name": "Primer::Alpha::SkeletonBox",
|
|
8478
|
+
"description": "A SkeletonBox provides a placeholder for non-text, non-Avatar elements (e.g., hero images)\nthat are still loading. You can adjust width and height to match the content's dimensions.",
|
|
8479
|
+
"accessibility_docs": null,
|
|
8480
|
+
"is_form_component": false,
|
|
8481
|
+
"is_published": true,
|
|
8482
|
+
"requires_js": false,
|
|
8483
|
+
"component": "SkeletonBox",
|
|
8484
|
+
"status": "alpha",
|
|
8485
|
+
"a11y_reviewed": false,
|
|
8486
|
+
"short_name": "SkeletonBox",
|
|
8487
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/skeleton_box.rb",
|
|
8488
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/skeleton_box/default/",
|
|
8489
|
+
"parameters": [
|
|
8490
|
+
{
|
|
8491
|
+
"name": "height",
|
|
8492
|
+
"type": "String",
|
|
8493
|
+
"default": "`nil`",
|
|
8494
|
+
"description": "Any valid CSS height."
|
|
8495
|
+
},
|
|
8496
|
+
{
|
|
8497
|
+
"name": "width",
|
|
8498
|
+
"type": "String",
|
|
8499
|
+
"default": "`nil`",
|
|
8500
|
+
"description": "Any valid CSS width."
|
|
8501
|
+
},
|
|
8502
|
+
{
|
|
8503
|
+
"name": "system_arguments",
|
|
8504
|
+
"type": "Hash",
|
|
8505
|
+
"default": "N/A",
|
|
8506
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
8507
|
+
}
|
|
8508
|
+
],
|
|
8509
|
+
"slots": [],
|
|
8510
|
+
"methods": [],
|
|
8511
|
+
"previews": [
|
|
8512
|
+
{
|
|
8513
|
+
"preview_path": "primer/alpha/skeleton_box/default",
|
|
8514
|
+
"name": "default",
|
|
8515
|
+
"snapshot": "false",
|
|
8516
|
+
"skip_rules": {
|
|
8517
|
+
"wont_fix": [
|
|
8518
|
+
"region"
|
|
8519
|
+
],
|
|
8520
|
+
"will_fix": [
|
|
8521
|
+
"color-contrast"
|
|
8522
|
+
]
|
|
8523
|
+
}
|
|
8524
|
+
},
|
|
8525
|
+
{
|
|
8526
|
+
"preview_path": "primer/alpha/skeleton_box/playground",
|
|
8527
|
+
"name": "playground",
|
|
8528
|
+
"snapshot": "false",
|
|
8529
|
+
"skip_rules": {
|
|
8530
|
+
"wont_fix": [
|
|
8531
|
+
"region"
|
|
8532
|
+
],
|
|
8533
|
+
"will_fix": [
|
|
8534
|
+
"color-contrast"
|
|
8535
|
+
]
|
|
8536
|
+
}
|
|
8537
|
+
}
|
|
8538
|
+
],
|
|
8539
|
+
"subcomponents": []
|
|
8540
|
+
},
|
|
8334
8541
|
{
|
|
8335
8542
|
"fully_qualified_name": "Primer::Alpha::Stack",
|
|
8336
8543
|
"description": "Stack is a layout component that creates responsive horizontal and vertical flows.",
|
|
@@ -10220,94 +10427,1235 @@
|
|
|
10220
10427
|
"subcomponents": []
|
|
10221
10428
|
},
|
|
10222
10429
|
{
|
|
10223
|
-
"fully_qualified_name": "Primer::Alpha::
|
|
10224
|
-
"description": "Use `UnderlineNav` to style navigation links with a minimal\nunderlined selected state, typically placed at the top\nof the page.\n\nFor panel navigation, use {{#link_to_component}}Primer::Alpha::UnderlinePanels{{/link_to_component}} instead.",
|
|
10225
|
-
"accessibility_docs":
|
|
10430
|
+
"fully_qualified_name": "Primer::Alpha::TreeView",
|
|
10431
|
+
"description": "TreeView is a hierarchical list of items that may have a parent-child relationship where children\ncan be toggled into view by expanding or collapsing their parent item.\n\n## Terminology\n\nConsider the following tree structure:\n\nsrc\n├ button.rb\n└ action_list\n ├ item.rb\n └ header.rb\n\n1. **Node**. A node is an item in the tree. Nodes can either be \"leaf\" nodes (i.e. have no children), or \"sub-tree\"\nnodes, which do have children. In the example above, button.rb, item.rb, and header.rb are all leaf nodes, while\naction_list is a sub-tree node.\n2. **Path**. A node's path is like its ID. It's an array of strings containing the current node's label and all the\nlabels of its ancestors, in order. In the example above, header.rb's path is [\"src\", \"action_list\", \"header.rb\"].\n\n## Static nodes\n\nThe `TreeView` component allows items to be provided statically or loaded dynamically from the server.\nProviding items statically is done using the `leaf` and `sub_tree` slots:\n\n```erb\n<%= render(Primer::Alpha::TreeView.new) do |tree| %>\n <% tree.with_sub_tree(label: \"Directory\") do |sub_tree| %>\n <% sub_tree.with_leaf(label: \"File 1\")\n <% end %>\n <% tree.with_leaf(label: \"File 2\") %>\n<% end %>\n```\n\n## Dynamic nodes\n\nTree nodes can also be fetched dynamically from the server and will require creating a Rails controller action\nto respond with the list of nodes. Unlike other Primer components, `TreeView` allows the programmer to specify\nloading behavior on a per-sub-tree basis, i.e. each sub-tree must specify how its nodes are loaded. To load nodes\ndynamically for a given sub-tree, configure it with either a loading spinner or a loading skeleton, and provide\nthe URL to fetch nodes from:\n\n```erb\n<%= render(Primer::Alpha::TreeView.new) do |tree| %>\n <% tree.with_sub_tree(label: \"Directory\") do |sub_tree| %>\n <% sub_tree.with_loading_spinner(src: primer_view_components.tree_view_items_path) %>\n <% end %>\n<% end %>\n```\n\nDefine a controller action to serve the list of nodes. The `TreeView` component automatically includes the\nsub-tree's path as a GET parameter, encoded as a JSON array.\n\n```ruby\nclass TreeViewItemsController < ApplicationController\n def show\n @path = JSON.parse(params[:path])\n @results = get_tree_items(starting_at: path)\n end\nend\n```\n\nResponses must be HTML fragments, eg. have a content type of `text/html+fragment`. This content type isn't\navailable by default in Rails, so you may have to register it eg. in an initializer:\n\n```ruby\nMime::Type.register(\"text/fragment+html\", :html_fragment)\n```\n\nRender a `Primer::Alpha::TreeView::SubTree` in the action's template, tree_view_items/show.html_fragment.erb:\n\n```erb\n<%= render(Primer::Alpha::TreeView::SubTree.new(path: @path, node_variant: :div)) do |tree| %>\n <% tree.with_leaf(...) %>\n <% tree.with_sub_tree(...) do |sub_tree| %>\n ...\n <% end %>\n<% end %>\n```\n\n## Multi-select mode\n\nPassing `select_variant: :multiple` to both sub-tree and leaf nodes will add a check box to the left of the node's\nlabel. These check boxes behave according to the value of a second argument, `select_strategy:`.\n\nThe default select strategy, `:descendants`, will cause all child nodes to be checked when the node is checked.\nThis includes both sub-tree and leaf nodes. When the node is unchecked, all child nodes will also be unchecked.\nUnchecking a child node of a checked parent will cause the parent to enter a mixed or indeterminate state, which\nis represented by a horizontal line icon instead of a check mark. This icon indicates that some children are\nchecked, but not all.\n\nA secondary select strategy, `:self`, is provided to allow disabling the automatic checking of child nodes. When\n`select_strategy: :self` is specified, checking sub-tree nodes does not check child nodes, and sub-tree nodes\ncannot enter a mixed or indeterminate state.\n\nNodes can be checked via the keyboard by pressing the space key.\n\n## Node tags\n\n`TreeView`s support three different node variants, `:anchor`, `:button`, and `:div` (the default), which controls\nwhich HTML tag is used to construct the nodes. The `:anchor` and `:button` variants correspond to `<a>` and\n`<button>` tags respectively, which are browser-native elements. Anchors and buttons can be activated (i.e.\n\"clicked\") using the mouse or keyboard via the enter or space keys. The node variant must be the same for all\nnodes in the tree, and is therefore specified at the root level, eg. `TreeView.new(node_variant: :anchor)`.\n\nTrees with node variants other than `:div` cannot have check boxes, i.e. cannot be put into multi-select mode.\n\nTrees with node variants other than `:div` do not emit the `treeViewNodeActivated` or `treeViewBeforeNodeActivated`\nevents, since it is assumed any behavior associated with these variants is user- or browser-defined.\n\n## Interaction behavior matrix\n\n|Interaction |Select variant|Tag |Result |\n|:---------------|:-------------|:------------|:--------------------------|\n|Enter/space |none |div |Expands/collapses |\n|Enter/space |none |anchor/button|Activates anchor/button |\n|Enter/space |multiple |div |Checks or unchecks |\n|Enter/space |multiple |anchor/button|N/A (not allowed) |\n|Left/right arrow|none |div |Expands/collapses |\n|Left/right arrow|none |anchor/button|Expands/collapses |\n|Left/right arrow|multiple |div |Expands/collapses |\n|Left/right arrow|multiple |anchor/button|N/A (not allowed) |\n|Click |none |div |Expands/collapses |\n|Click |multiple |div |Checks or unchecks |\n|Click |multiple |anchor/button|N/A (not allowed) |\n\n## JavaScript API\n\n`TreeView`s render a `<tree-view>` custom element that exposes behavior to the client.\n\n|Name |Notes |\n|:-----------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|\n|`getNodePath(node: Element): string[]` |Returns the path to the given node. |\n|`getNodeType(node: Element): TreeViewNodeType | null` |Returns either `\"leaf\"` or `\"sub-tree\"`. |\n|`markCurrentAtPath(path: string[])` |Marks the node as the \"current\" node, which appears visually distinct from other nodes. |\n|`get currentNode(): HTMLLIElement | null` |Returns the current node. |\n|`expandAtPath(path: string[])` |Expands the sub-tree at `path`. |\n|`collapseAtPath(path: string[])` |Collapses the sub-tree at `path`. |\n|`toggleAtPath(path: string[])` |If the sub-tree at `path` is collapsed, this function expands it, and vice-versa. |\n|`checkAtPath(path: string[])` |If the node at `path` has a checkbox, this function checks it. |\n|`uncheckAtPath(path: string[])` |If the node at `path` has a checkbox, this function unchecks it. |\n|`toggleCheckedAtPath(path: string[])` |If the sub-tree at `path` is checked, this function unchecks it, and vice-versa. |\n|`checkedValueAtPath(path: string[]): TreeViewCheckedValue` |Returns `\"true\"` (all child nodes are checked), `\"false\"` (no child nodes are checked), or `\"mixed\"` (some child nodes are checked, some are not).|\n|`nodeAtPath(path: string[], selector?: string): Element | null` |Returns the node for the given `path`, either a leaf node or sub-tree node. |\n|`subTreeAtPath(path: string[]): TreeViewSubTreeNodeElement | null`|Returns the sub-tree at the given `path`, if it exists. |\n|`leafAtPath(path: string[]): HTMLLIElement | null` |Returns the leaf node at the given `path`, if it exists. |\n|`getNodeCheckedValue(node: Element): TreeViewCheckedValue` |The same as `checkedValueAtPath`, but accepts a node instead of a path. |\n\n### Events\n\nThe events enumerated below include node information by way of the `TreeViewNodeInfo` object, which has the\nfollowing signature:\n\n```typescript\ntype TreeViewNodeType = 'leaf' | 'sub-tree'\ntype TreeViewCheckedValue = 'true' | 'false' | 'mixed'\n\ntype TreeViewNodeInfo = {\n node: Element\n type: TreeViewNodeType\n path: string[]\n checkedValue: TreeViewCheckedValue\n previousCheckedValue: TreeViewCheckedValue\n}\n```\n\n|Name |Type |Bubbles |Cancelable |\n|:----------------------------|:------------------------------------------|:-------|:----------|\n|`treeViewNodeActivated` |`CustomEvent<TreeViewNodeInfo>` |Yes |No |\n|`treeViewBeforeNodeActivated`|`CustomEvent<TreeViewNodeInfo>` |Yes |Yes |\n|`treeViewNodeExpanded` |`CustomEvent<TreeViewNodeInfo>>` |Yes |No |\n|`treeViewNodeCollapsed` |`CustomEvent<TreeViewNodeInfo>>` |Yes |No |\n|`treeViewNodeChecked` |`CustomEvent<TreeViewNodeInfo[]>` |Yes |Yes |\n|`treeViewBeforeNodeChecked` |`CustomEvent<TreeViewNodeInfo[]>` |Yes |No |\n\n_Item activation_\n\nThe `<tree-view>` element fires an `treeViewNodeActivated` event whenever a node is activated (eg. clicked)\nvia the mouse or keyboard.\n\nThe `treeViewBeforeNodeActivated` event fires before a node is activated. Canceling this event will prevent the\nnode from being activated.\n\n```typescript\ndocument.querySelector(\"select-panel\").addEventListener(\n \"treeViewBeforeNodeActivated\",\n (event: CustomEvent<TreeViewNodeInfo>) => {\n event.preventDefault() // Cancel the event to prevent activation (eg. expanding/collapsing)\n }\n)\n```\n\n_Item checking/unchecking_\n\nThe `tree-view` element fires a `treeViewNodeChecked` event whenever a node is checked or unchecked.\n\nThe `treeViewBeforeNodeChecked` event fires before a node is checked or unchecked. Canceling this event will\nprevent the check/uncheck operation.\n\n```typescript\ndocument.querySelector(\"select-panel\").addEventListener(\n \"treeViewBeforeNodeChecked\",\n (event: CustomEvent<TreeViewNodeInfo[]>) => {\n event.preventDefault() // Cancel the event to prevent activation (eg. expanding/collapsing)\n }\n)\n```\n\nBecause checking or unchecking a sub-tree results in the checking or unchecking of all its children recursively,\nboth the `treeViewNodeChecked` and `treeViewBeforeNodeChecked` events provide an array of `TreeViewNodeInfo`\nobjects, which contain entries for every modified node in the tree.",
|
|
10432
|
+
"accessibility_docs": null,
|
|
10226
10433
|
"is_form_component": false,
|
|
10227
10434
|
"is_published": true,
|
|
10228
10435
|
"requires_js": false,
|
|
10229
|
-
"component": "
|
|
10436
|
+
"component": "TreeView",
|
|
10230
10437
|
"status": "alpha",
|
|
10231
10438
|
"a11y_reviewed": false,
|
|
10232
|
-
"short_name": "
|
|
10233
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/
|
|
10234
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/
|
|
10439
|
+
"short_name": "TreeView",
|
|
10440
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view.rb",
|
|
10441
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/default/",
|
|
10235
10442
|
"parameters": [
|
|
10236
10443
|
{
|
|
10237
|
-
"name": "
|
|
10238
|
-
"type": "Symbol",
|
|
10239
|
-
"default": "`:nav`",
|
|
10240
|
-
"description": "One of `:div` or `:nav`."
|
|
10241
|
-
},
|
|
10242
|
-
{
|
|
10243
|
-
"name": "label",
|
|
10244
|
-
"type": "String",
|
|
10245
|
-
"default": "N/A",
|
|
10246
|
-
"description": "Sets an `aria-label` that helps assistive technology users understand the purpose of the links, and distinguish it from similar elements."
|
|
10247
|
-
},
|
|
10248
|
-
{
|
|
10249
|
-
"name": "align",
|
|
10444
|
+
"name": "node_variant",
|
|
10250
10445
|
"type": "Symbol",
|
|
10251
|
-
"default": "`:
|
|
10252
|
-
"description": "One of `:
|
|
10446
|
+
"default": "`:div`",
|
|
10447
|
+
"description": "The variant to use for this node. One of `:anchor`, `:button`, or `:div`."
|
|
10253
10448
|
},
|
|
10254
10449
|
{
|
|
10255
|
-
"name": "
|
|
10450
|
+
"name": "form_arguments",
|
|
10256
10451
|
"type": "Hash",
|
|
10257
10452
|
"default": "`{}`",
|
|
10258
|
-
"description": "
|
|
10453
|
+
"description": "These arguments allow the selections made within a `TreeView` to be submitted to the server as part of a Rails form. 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."
|
|
10259
10454
|
},
|
|
10260
10455
|
{
|
|
10261
10456
|
"name": "system_arguments",
|
|
10262
10457
|
"type": "Hash",
|
|
10263
10458
|
"default": "N/A",
|
|
10264
|
-
"description": "{{link_to_system_arguments_docs}}"
|
|
10459
|
+
"description": "{{link_to_system_arguments_docs}}."
|
|
10265
10460
|
}
|
|
10266
10461
|
],
|
|
10267
10462
|
"slots": [
|
|
10268
10463
|
{
|
|
10269
|
-
"name": "
|
|
10270
|
-
"description":
|
|
10464
|
+
"name": "nodes",
|
|
10465
|
+
"description": null,
|
|
10466
|
+
"parameters": []
|
|
10467
|
+
}
|
|
10468
|
+
],
|
|
10469
|
+
"methods": [
|
|
10470
|
+
{
|
|
10471
|
+
"name": "with_leaf",
|
|
10472
|
+
"description": "Adds an leaf node to the tree. Leaf nodes are nodes that do not have children.",
|
|
10271
10473
|
"parameters": [
|
|
10272
10474
|
{
|
|
10273
|
-
"name": "
|
|
10274
|
-
"type": "
|
|
10475
|
+
"name": "component_klass",
|
|
10476
|
+
"type": "Class",
|
|
10275
10477
|
"default": "N/A",
|
|
10276
|
-
"description": "
|
|
10478
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::TreeView::LeafNode{{/link_to_component}}"
|
|
10277
10479
|
},
|
|
10278
10480
|
{
|
|
10279
10481
|
"name": "system_arguments",
|
|
10280
10482
|
"type": "Hash",
|
|
10281
10483
|
"default": "N/A",
|
|
10282
|
-
"description": "{{
|
|
10484
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Alpha::TreeView::LeafNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
|
10283
10485
|
}
|
|
10284
|
-
]
|
|
10486
|
+
],
|
|
10487
|
+
"return_types": []
|
|
10285
10488
|
},
|
|
10286
10489
|
{
|
|
10287
|
-
"name": "
|
|
10288
|
-
"description": "
|
|
10490
|
+
"name": "with_sub_tree",
|
|
10491
|
+
"description": "Adds a sub-tree node to the tree. Sub-trees are nodes that have children, which can be both leaf nodes and other sub-trees.",
|
|
10289
10492
|
"parameters": [
|
|
10290
10493
|
{
|
|
10291
|
-
"name": "
|
|
10292
|
-
"type": "
|
|
10293
|
-
"default": "
|
|
10294
|
-
"description": "
|
|
10494
|
+
"name": "component_klass",
|
|
10495
|
+
"type": "Class",
|
|
10496
|
+
"default": "N/A",
|
|
10497
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::TreeView::SubTreeNode{{/link_to_component}}"
|
|
10295
10498
|
},
|
|
10296
10499
|
{
|
|
10297
10500
|
"name": "system_arguments",
|
|
10298
10501
|
"type": "Hash",
|
|
10299
10502
|
"default": "N/A",
|
|
10300
|
-
"description": "{{
|
|
10503
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Alpha::TreeView::SubTreeNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
|
10301
10504
|
}
|
|
10302
|
-
]
|
|
10505
|
+
],
|
|
10506
|
+
"return_types": []
|
|
10507
|
+
},
|
|
10508
|
+
{
|
|
10509
|
+
"name": "node_variant",
|
|
10510
|
+
"description": "Returns the value of attribute node_variant.",
|
|
10511
|
+
"parameters": [],
|
|
10512
|
+
"return_types": []
|
|
10303
10513
|
}
|
|
10304
10514
|
],
|
|
10305
|
-
"methods": [],
|
|
10306
10515
|
"previews": [
|
|
10307
10516
|
{
|
|
10308
|
-
"preview_path": "primer/alpha/
|
|
10309
|
-
"name": "
|
|
10310
|
-
"snapshot": "
|
|
10517
|
+
"preview_path": "primer/alpha/tree_view/default",
|
|
10518
|
+
"name": "default",
|
|
10519
|
+
"snapshot": "interactive",
|
|
10520
|
+
"skip_rules": {
|
|
10521
|
+
"wont_fix": [
|
|
10522
|
+
"region"
|
|
10523
|
+
],
|
|
10524
|
+
"will_fix": [
|
|
10525
|
+
"color-contrast"
|
|
10526
|
+
]
|
|
10527
|
+
}
|
|
10528
|
+
},
|
|
10529
|
+
{
|
|
10530
|
+
"preview_path": "primer/alpha/tree_view/playground",
|
|
10531
|
+
"name": "playground",
|
|
10532
|
+
"snapshot": "false",
|
|
10533
|
+
"skip_rules": {
|
|
10534
|
+
"wont_fix": [
|
|
10535
|
+
"region"
|
|
10536
|
+
],
|
|
10537
|
+
"will_fix": [
|
|
10538
|
+
"color-contrast"
|
|
10539
|
+
]
|
|
10540
|
+
}
|
|
10541
|
+
},
|
|
10542
|
+
{
|
|
10543
|
+
"preview_path": "primer/alpha/tree_view/empty",
|
|
10544
|
+
"name": "empty",
|
|
10545
|
+
"snapshot": "interactive",
|
|
10546
|
+
"skip_rules": {
|
|
10547
|
+
"wont_fix": [
|
|
10548
|
+
"region"
|
|
10549
|
+
],
|
|
10550
|
+
"will_fix": [
|
|
10551
|
+
"color-contrast"
|
|
10552
|
+
]
|
|
10553
|
+
}
|
|
10554
|
+
},
|
|
10555
|
+
{
|
|
10556
|
+
"preview_path": "primer/alpha/tree_view/loading_failure",
|
|
10557
|
+
"name": "loading_failure",
|
|
10558
|
+
"snapshot": "interactive",
|
|
10559
|
+
"skip_rules": {
|
|
10560
|
+
"wont_fix": [
|
|
10561
|
+
"region"
|
|
10562
|
+
],
|
|
10563
|
+
"will_fix": [
|
|
10564
|
+
"color-contrast"
|
|
10565
|
+
]
|
|
10566
|
+
}
|
|
10567
|
+
},
|
|
10568
|
+
{
|
|
10569
|
+
"preview_path": "primer/alpha/tree_view/loading_spinner",
|
|
10570
|
+
"name": "loading_spinner",
|
|
10571
|
+
"snapshot": "interactive",
|
|
10572
|
+
"skip_rules": {
|
|
10573
|
+
"wont_fix": [
|
|
10574
|
+
"region"
|
|
10575
|
+
],
|
|
10576
|
+
"will_fix": [
|
|
10577
|
+
"color-contrast"
|
|
10578
|
+
]
|
|
10579
|
+
}
|
|
10580
|
+
},
|
|
10581
|
+
{
|
|
10582
|
+
"preview_path": "primer/alpha/tree_view/loading_skeleton",
|
|
10583
|
+
"name": "loading_skeleton",
|
|
10584
|
+
"snapshot": "interactive",
|
|
10585
|
+
"skip_rules": {
|
|
10586
|
+
"wont_fix": [
|
|
10587
|
+
"region"
|
|
10588
|
+
],
|
|
10589
|
+
"will_fix": [
|
|
10590
|
+
"color-contrast"
|
|
10591
|
+
]
|
|
10592
|
+
}
|
|
10593
|
+
},
|
|
10594
|
+
{
|
|
10595
|
+
"preview_path": "primer/alpha/tree_view/async_alpha",
|
|
10596
|
+
"name": "async_alpha",
|
|
10597
|
+
"snapshot": "false",
|
|
10598
|
+
"skip_rules": {
|
|
10599
|
+
"wont_fix": [
|
|
10600
|
+
"region"
|
|
10601
|
+
],
|
|
10602
|
+
"will_fix": [
|
|
10603
|
+
"color-contrast"
|
|
10604
|
+
]
|
|
10605
|
+
}
|
|
10606
|
+
},
|
|
10607
|
+
{
|
|
10608
|
+
"preview_path": "primer/alpha/tree_view/leaf_node_playground",
|
|
10609
|
+
"name": "leaf_node_playground",
|
|
10610
|
+
"snapshot": "false",
|
|
10611
|
+
"skip_rules": {
|
|
10612
|
+
"wont_fix": [
|
|
10613
|
+
"region"
|
|
10614
|
+
],
|
|
10615
|
+
"will_fix": [
|
|
10616
|
+
"color-contrast"
|
|
10617
|
+
]
|
|
10618
|
+
}
|
|
10619
|
+
},
|
|
10620
|
+
{
|
|
10621
|
+
"preview_path": "primer/alpha/tree_view/links",
|
|
10622
|
+
"name": "links",
|
|
10623
|
+
"snapshot": "false",
|
|
10624
|
+
"skip_rules": {
|
|
10625
|
+
"wont_fix": [
|
|
10626
|
+
"region"
|
|
10627
|
+
],
|
|
10628
|
+
"will_fix": [
|
|
10629
|
+
"color-contrast"
|
|
10630
|
+
]
|
|
10631
|
+
}
|
|
10632
|
+
},
|
|
10633
|
+
{
|
|
10634
|
+
"preview_path": "primer/alpha/tree_view/buttons",
|
|
10635
|
+
"name": "buttons",
|
|
10636
|
+
"snapshot": "false",
|
|
10637
|
+
"skip_rules": {
|
|
10638
|
+
"wont_fix": [
|
|
10639
|
+
"region"
|
|
10640
|
+
],
|
|
10641
|
+
"will_fix": [
|
|
10642
|
+
"color-contrast"
|
|
10643
|
+
]
|
|
10644
|
+
}
|
|
10645
|
+
},
|
|
10646
|
+
{
|
|
10647
|
+
"preview_path": "primer/alpha/tree_view/auto_expansion",
|
|
10648
|
+
"name": "auto_expansion",
|
|
10649
|
+
"snapshot": "false",
|
|
10650
|
+
"skip_rules": {
|
|
10651
|
+
"wont_fix": [
|
|
10652
|
+
"region"
|
|
10653
|
+
],
|
|
10654
|
+
"will_fix": [
|
|
10655
|
+
"color-contrast"
|
|
10656
|
+
]
|
|
10657
|
+
}
|
|
10658
|
+
},
|
|
10659
|
+
{
|
|
10660
|
+
"preview_path": "primer/alpha/tree_view/form_input",
|
|
10661
|
+
"name": "form_input",
|
|
10662
|
+
"snapshot": "false",
|
|
10663
|
+
"skip_rules": {
|
|
10664
|
+
"wont_fix": [
|
|
10665
|
+
"region"
|
|
10666
|
+
],
|
|
10667
|
+
"will_fix": [
|
|
10668
|
+
"color-contrast"
|
|
10669
|
+
]
|
|
10670
|
+
}
|
|
10671
|
+
}
|
|
10672
|
+
],
|
|
10673
|
+
"subcomponents": [
|
|
10674
|
+
{
|
|
10675
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::Visual",
|
|
10676
|
+
"description": "A `TreeView` visual, either leading or trailing.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
10677
|
+
"accessibility_docs": null,
|
|
10678
|
+
"is_form_component": false,
|
|
10679
|
+
"is_published": true,
|
|
10680
|
+
"requires_js": false,
|
|
10681
|
+
"component": "TreeView::Visual",
|
|
10682
|
+
"status": "alpha",
|
|
10683
|
+
"a11y_reviewed": false,
|
|
10684
|
+
"short_name": "TreeViewVisual",
|
|
10685
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/visual.rb",
|
|
10686
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/visual/default/",
|
|
10687
|
+
"parameters": [
|
|
10688
|
+
{
|
|
10689
|
+
"name": "id",
|
|
10690
|
+
"type": "String",
|
|
10691
|
+
"default": "N/A",
|
|
10692
|
+
"description": "This visual's HTML ID."
|
|
10693
|
+
},
|
|
10694
|
+
{
|
|
10695
|
+
"name": "visual",
|
|
10696
|
+
"type": "ViewComponent::Base",
|
|
10697
|
+
"default": "N/A",
|
|
10698
|
+
"description": "A renderable component like an instance of {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}} to render as the visual."
|
|
10699
|
+
},
|
|
10700
|
+
{
|
|
10701
|
+
"name": "label",
|
|
10702
|
+
"type": "String",
|
|
10703
|
+
"default": "`nil`",
|
|
10704
|
+
"description": "Text describing this visual that will be visible only to screen readers."
|
|
10705
|
+
}
|
|
10706
|
+
],
|
|
10707
|
+
"slots": [],
|
|
10708
|
+
"methods": [],
|
|
10709
|
+
"previews": [],
|
|
10710
|
+
"subcomponents": []
|
|
10711
|
+
},
|
|
10712
|
+
{
|
|
10713
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::SubTreeContainer",
|
|
10714
|
+
"description": "This component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
10715
|
+
"accessibility_docs": null,
|
|
10716
|
+
"is_form_component": false,
|
|
10717
|
+
"is_published": true,
|
|
10718
|
+
"requires_js": false,
|
|
10719
|
+
"component": "TreeView::SubTreeContainer",
|
|
10720
|
+
"status": "alpha",
|
|
10721
|
+
"a11y_reviewed": false,
|
|
10722
|
+
"short_name": "TreeViewSubTreeContainer",
|
|
10723
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/sub_tree_container.rb",
|
|
10724
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/sub_tree_container/default/",
|
|
10725
|
+
"parameters": [
|
|
10726
|
+
{
|
|
10727
|
+
"name": "path",
|
|
10728
|
+
"type": "Array<String>",
|
|
10729
|
+
"default": "N/A",
|
|
10730
|
+
"description": "The path to this node."
|
|
10731
|
+
},
|
|
10732
|
+
{
|
|
10733
|
+
"name": "expanded",
|
|
10734
|
+
"type": "Boolean",
|
|
10735
|
+
"default": "`false`",
|
|
10736
|
+
"description": "Whether or not this sub-tree node renders expanded."
|
|
10737
|
+
},
|
|
10738
|
+
{
|
|
10739
|
+
"name": "system_arguments",
|
|
10740
|
+
"type": "Hash",
|
|
10741
|
+
"default": "N/A",
|
|
10742
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
10743
|
+
}
|
|
10744
|
+
],
|
|
10745
|
+
"slots": [],
|
|
10746
|
+
"methods": [
|
|
10747
|
+
{
|
|
10748
|
+
"name": "path",
|
|
10749
|
+
"description": "The path to this node",
|
|
10750
|
+
"parameters": [],
|
|
10751
|
+
"return_types": [
|
|
10752
|
+
"Array<String>"
|
|
10753
|
+
]
|
|
10754
|
+
},
|
|
10755
|
+
{
|
|
10756
|
+
"name": "expanded",
|
|
10757
|
+
"description": "Whether or not this sub-tree node renders expanded.",
|
|
10758
|
+
"parameters": [],
|
|
10759
|
+
"return_types": [
|
|
10760
|
+
"Boolean"
|
|
10761
|
+
]
|
|
10762
|
+
},
|
|
10763
|
+
{
|
|
10764
|
+
"name": "expanded?",
|
|
10765
|
+
"description": "Whether or not this sub-tree node renders expanded.",
|
|
10766
|
+
"parameters": [],
|
|
10767
|
+
"return_types": [
|
|
10768
|
+
"Boolean"
|
|
10769
|
+
]
|
|
10770
|
+
}
|
|
10771
|
+
],
|
|
10772
|
+
"previews": [],
|
|
10773
|
+
"subcomponents": []
|
|
10774
|
+
},
|
|
10775
|
+
{
|
|
10776
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::SubTree",
|
|
10777
|
+
"description": "A `TreeView` sub-tree.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
10778
|
+
"accessibility_docs": null,
|
|
10779
|
+
"is_form_component": false,
|
|
10780
|
+
"is_published": true,
|
|
10781
|
+
"requires_js": false,
|
|
10782
|
+
"component": "TreeView::SubTree",
|
|
10783
|
+
"status": "alpha",
|
|
10784
|
+
"a11y_reviewed": false,
|
|
10785
|
+
"short_name": "TreeViewSubTree",
|
|
10786
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/sub_tree.rb",
|
|
10787
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/sub_tree/default/",
|
|
10788
|
+
"parameters": [
|
|
10789
|
+
{
|
|
10790
|
+
"name": "node_variant",
|
|
10791
|
+
"type": "Symbol",
|
|
10792
|
+
"default": "N/A",
|
|
10793
|
+
"description": "The variant to use for this node. One of `:anchor`, `:button`, or `:div`."
|
|
10794
|
+
},
|
|
10795
|
+
{
|
|
10796
|
+
"name": "system_arguments",
|
|
10797
|
+
"type": "Hash",
|
|
10798
|
+
"default": "N/A",
|
|
10799
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::SubTreeContainer{{/link_to_component}}."
|
|
10800
|
+
}
|
|
10801
|
+
],
|
|
10802
|
+
"slots": [
|
|
10803
|
+
{
|
|
10804
|
+
"name": "nodes",
|
|
10805
|
+
"description": null,
|
|
10806
|
+
"parameters": []
|
|
10807
|
+
},
|
|
10808
|
+
{
|
|
10809
|
+
"name": "loader",
|
|
10810
|
+
"description": null,
|
|
10811
|
+
"parameters": []
|
|
10812
|
+
},
|
|
10813
|
+
{
|
|
10814
|
+
"name": "no_items_message",
|
|
10815
|
+
"description": "The message to display if this sub-tree contains no children.",
|
|
10816
|
+
"parameters": []
|
|
10817
|
+
}
|
|
10818
|
+
],
|
|
10819
|
+
"methods": [
|
|
10820
|
+
{
|
|
10821
|
+
"name": "with_leaf",
|
|
10822
|
+
"description": "Adds an leaf node to the tree. Leaf nodes are nodes that do not have children.",
|
|
10823
|
+
"parameters": [
|
|
10824
|
+
{
|
|
10825
|
+
"name": "component_klass",
|
|
10826
|
+
"type": "Class",
|
|
10827
|
+
"default": "N/A",
|
|
10828
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::TreeView::LeafNode{{/link_to_component}}"
|
|
10829
|
+
},
|
|
10830
|
+
{
|
|
10831
|
+
"name": "system_arguments",
|
|
10832
|
+
"type": "Hash",
|
|
10833
|
+
"default": "N/A",
|
|
10834
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Alpha::TreeView::LeafNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
|
10835
|
+
}
|
|
10836
|
+
],
|
|
10837
|
+
"return_types": []
|
|
10838
|
+
},
|
|
10839
|
+
{
|
|
10840
|
+
"name": "with_sub_tree",
|
|
10841
|
+
"description": "Adds a sub-tree node to the tree. Sub-trees are nodes that have children, which can be both leaf nodes and other sub-trees.",
|
|
10842
|
+
"parameters": [
|
|
10843
|
+
{
|
|
10844
|
+
"name": "component_klass",
|
|
10845
|
+
"type": "Class",
|
|
10846
|
+
"default": "N/A",
|
|
10847
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::Alpha::TreeView::SubTreeNode{{/link_to_component}}"
|
|
10848
|
+
},
|
|
10849
|
+
{
|
|
10850
|
+
"name": "system_arguments",
|
|
10851
|
+
"type": "Hash",
|
|
10852
|
+
"default": "N/A",
|
|
10853
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::Alpha::TreeView::SubTreeNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
|
10854
|
+
}
|
|
10855
|
+
],
|
|
10856
|
+
"return_types": []
|
|
10857
|
+
},
|
|
10858
|
+
{
|
|
10859
|
+
"name": "with_loading_spinner",
|
|
10860
|
+
"description": "Adds a loader to this sub-tree that displays a skeleton animation while nodes are fetched from the server.",
|
|
10861
|
+
"parameters": [
|
|
10862
|
+
{
|
|
10863
|
+
"name": "system_arguments",
|
|
10864
|
+
"type": "Hash",
|
|
10865
|
+
"default": "N/A",
|
|
10866
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::SkeletonLoader{{/link_to_component}}."
|
|
10867
|
+
}
|
|
10868
|
+
],
|
|
10869
|
+
"return_types": []
|
|
10870
|
+
},
|
|
10871
|
+
{
|
|
10872
|
+
"name": "node_variant",
|
|
10873
|
+
"description": "Returns the value of attribute node_variant.",
|
|
10874
|
+
"parameters": [],
|
|
10875
|
+
"return_types": []
|
|
10876
|
+
}
|
|
10877
|
+
],
|
|
10878
|
+
"previews": [],
|
|
10879
|
+
"subcomponents": []
|
|
10880
|
+
},
|
|
10881
|
+
{
|
|
10882
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::SpinnerLoader",
|
|
10883
|
+
"description": "Renders a loading spinner for a `TreeView` sub-tree node.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
10884
|
+
"accessibility_docs": null,
|
|
10885
|
+
"is_form_component": false,
|
|
10886
|
+
"is_published": true,
|
|
10887
|
+
"requires_js": false,
|
|
10888
|
+
"component": "TreeView::SpinnerLoader",
|
|
10889
|
+
"status": "alpha",
|
|
10890
|
+
"a11y_reviewed": false,
|
|
10891
|
+
"short_name": "TreeViewSpinnerLoader",
|
|
10892
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/spinner_loader.rb",
|
|
10893
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/spinner_loader/default/",
|
|
10894
|
+
"parameters": [
|
|
10895
|
+
{
|
|
10896
|
+
"name": "src",
|
|
10897
|
+
"type": "String",
|
|
10898
|
+
"default": "N/A",
|
|
10899
|
+
"description": "The URL to fetch nodes from."
|
|
10900
|
+
},
|
|
10901
|
+
{
|
|
10902
|
+
"name": "system_arguments",
|
|
10903
|
+
"type": "Hash",
|
|
10904
|
+
"default": "N/A",
|
|
10905
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::SubTreeContainer{{/link_to_component}}."
|
|
10906
|
+
}
|
|
10907
|
+
],
|
|
10908
|
+
"slots": [
|
|
10909
|
+
{
|
|
10910
|
+
"name": "loading_failure_message",
|
|
10911
|
+
"description": "The failure message that appears if loading nodes from the server fails.",
|
|
10912
|
+
"parameters": [
|
|
10913
|
+
{
|
|
10914
|
+
"name": "system_arguments",
|
|
10915
|
+
"type": "Hash",
|
|
10916
|
+
"default": "N/A",
|
|
10917
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::LoadingFailureMessage{{/link_to_component}}."
|
|
10918
|
+
}
|
|
10919
|
+
]
|
|
10920
|
+
}
|
|
10921
|
+
],
|
|
10922
|
+
"methods": [],
|
|
10923
|
+
"previews": [],
|
|
10924
|
+
"subcomponents": []
|
|
10925
|
+
},
|
|
10926
|
+
{
|
|
10927
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::SkeletonLoader",
|
|
10928
|
+
"description": "Renders a loading skeleton for a `TreeView` sub-tree node.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
10929
|
+
"accessibility_docs": null,
|
|
10930
|
+
"is_form_component": false,
|
|
10931
|
+
"is_published": true,
|
|
10932
|
+
"requires_js": false,
|
|
10933
|
+
"component": "TreeView::SkeletonLoader",
|
|
10934
|
+
"status": "alpha",
|
|
10935
|
+
"a11y_reviewed": false,
|
|
10936
|
+
"short_name": "TreeViewSkeletonLoader",
|
|
10937
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/skeleton_loader.rb",
|
|
10938
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/skeleton_loader/default/",
|
|
10939
|
+
"parameters": [
|
|
10940
|
+
{
|
|
10941
|
+
"name": "src",
|
|
10942
|
+
"type": "String",
|
|
10943
|
+
"default": "N/A",
|
|
10944
|
+
"description": "The URL to fetch nodes from."
|
|
10945
|
+
},
|
|
10946
|
+
{
|
|
10947
|
+
"name": "count",
|
|
10948
|
+
"type": "Integer",
|
|
10949
|
+
"default": "`3`",
|
|
10950
|
+
"description": "The number of skeleton nodes to render."
|
|
10951
|
+
},
|
|
10952
|
+
{
|
|
10953
|
+
"name": "system_arguments",
|
|
10954
|
+
"type": "Hash",
|
|
10955
|
+
"default": "N/A",
|
|
10956
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::SubTreeContainer{{/link_to_component}}."
|
|
10957
|
+
}
|
|
10958
|
+
],
|
|
10959
|
+
"slots": [
|
|
10960
|
+
{
|
|
10961
|
+
"name": "loading_failure_message",
|
|
10962
|
+
"description": "The failure message that appears if loading nodes from the server fails.",
|
|
10963
|
+
"parameters": [
|
|
10964
|
+
{
|
|
10965
|
+
"name": "system_arguments",
|
|
10966
|
+
"type": "Hash",
|
|
10967
|
+
"default": "N/A",
|
|
10968
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::LoadingFailureMessage{{/link_to_component}}."
|
|
10969
|
+
}
|
|
10970
|
+
]
|
|
10971
|
+
}
|
|
10972
|
+
],
|
|
10973
|
+
"methods": [],
|
|
10974
|
+
"previews": [],
|
|
10975
|
+
"subcomponents": []
|
|
10976
|
+
},
|
|
10977
|
+
{
|
|
10978
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::Node",
|
|
10979
|
+
"description": "A generic `TreeView` node.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
10980
|
+
"accessibility_docs": null,
|
|
10981
|
+
"is_form_component": false,
|
|
10982
|
+
"is_published": true,
|
|
10983
|
+
"requires_js": false,
|
|
10984
|
+
"component": "TreeView::Node",
|
|
10985
|
+
"status": "alpha",
|
|
10986
|
+
"a11y_reviewed": false,
|
|
10987
|
+
"short_name": "TreeViewNode",
|
|
10988
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/node.rb",
|
|
10989
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/node/default/",
|
|
10990
|
+
"parameters": [
|
|
10991
|
+
{
|
|
10992
|
+
"name": "path",
|
|
10993
|
+
"type": "Array<String>",
|
|
10994
|
+
"default": "N/A",
|
|
10995
|
+
"description": "The node's \"path,\" i.e. this node's label and the labels of all its ancestors. This node should be reachable by traversing the tree following this path."
|
|
10996
|
+
},
|
|
10997
|
+
{
|
|
10998
|
+
"name": "node_variant",
|
|
10999
|
+
"type": "Symbol",
|
|
11000
|
+
"default": "N/A",
|
|
11001
|
+
"description": "The node variant to use for the node's content, i.e. the `:button` or `:div`. One of `:anchor`, `:button`, or `:div`."
|
|
11002
|
+
},
|
|
11003
|
+
{
|
|
11004
|
+
"name": "href",
|
|
11005
|
+
"type": "String",
|
|
11006
|
+
"default": "`nil`",
|
|
11007
|
+
"description": "The URL to use as the `href` attribute for this node. If set to a truthy value, the `tag:` parameter is ignored and assumed to be `:a`."
|
|
11008
|
+
},
|
|
11009
|
+
{
|
|
11010
|
+
"name": "current",
|
|
11011
|
+
"type": "Boolean",
|
|
11012
|
+
"default": "`false`",
|
|
11013
|
+
"description": "Whether or not this node is the current node. The current node is styled differently than regular nodes and is the first element that receives focus when tabbing to the `TreeView` component."
|
|
11014
|
+
},
|
|
11015
|
+
{
|
|
11016
|
+
"name": "select_variant",
|
|
11017
|
+
"type": "Symbol",
|
|
11018
|
+
"default": "`:none`",
|
|
11019
|
+
"description": "Controls the type of checkbox that appears. One of `:multiple` or `:none`."
|
|
11020
|
+
},
|
|
11021
|
+
{
|
|
11022
|
+
"name": "checked",
|
|
11023
|
+
"type": "Boolean | String",
|
|
11024
|
+
"default": "`false`",
|
|
11025
|
+
"description": "The checked state of the node's checkbox. One of `false`, `mixed`, or `true`."
|
|
11026
|
+
},
|
|
11027
|
+
{
|
|
11028
|
+
"name": "disabled",
|
|
11029
|
+
"type": "Boolean",
|
|
11030
|
+
"default": "`false`",
|
|
11031
|
+
"description": "Whether or not the node can be activated. Passing `false` here will cause the node to appear visually disabled but it is still keyboard-focusable."
|
|
11032
|
+
},
|
|
11033
|
+
{
|
|
11034
|
+
"name": "value",
|
|
11035
|
+
"type": "String",
|
|
11036
|
+
"default": "`nil`",
|
|
11037
|
+
"description": "If this node is checked, this value will be sent to the server on form submission."
|
|
11038
|
+
},
|
|
11039
|
+
{
|
|
11040
|
+
"name": "content_arguments",
|
|
11041
|
+
"type": "Hash",
|
|
11042
|
+
"default": "N/A",
|
|
11043
|
+
"description": "Arguments attached to the node's content, i.e the `<button>` or `<a>` element. {{link_to_system_arguments_docs}}"
|
|
11044
|
+
}
|
|
11045
|
+
],
|
|
11046
|
+
"slots": [
|
|
11047
|
+
{
|
|
11048
|
+
"name": "leading_action",
|
|
11049
|
+
"description": "Generic leading action slot",
|
|
11050
|
+
"parameters": []
|
|
11051
|
+
},
|
|
11052
|
+
{
|
|
11053
|
+
"name": "leading_visual",
|
|
11054
|
+
"description": "Generic leading visual slot",
|
|
11055
|
+
"parameters": []
|
|
11056
|
+
},
|
|
11057
|
+
{
|
|
11058
|
+
"name": "trailing_visual",
|
|
11059
|
+
"description": "Generic trailing visual slot",
|
|
11060
|
+
"parameters": []
|
|
11061
|
+
},
|
|
11062
|
+
{
|
|
11063
|
+
"name": "toggle",
|
|
11064
|
+
"description": "Generic toggle button slot",
|
|
11065
|
+
"parameters": []
|
|
11066
|
+
},
|
|
11067
|
+
{
|
|
11068
|
+
"name": "text_content",
|
|
11069
|
+
"description": "Generic text content slot (for node's label)",
|
|
11070
|
+
"parameters": []
|
|
11071
|
+
}
|
|
11072
|
+
],
|
|
11073
|
+
"methods": [
|
|
11074
|
+
{
|
|
11075
|
+
"name": "current",
|
|
11076
|
+
"description": "Wether or not this node is the current node.",
|
|
11077
|
+
"parameters": [],
|
|
11078
|
+
"return_types": [
|
|
11079
|
+
"Boolean"
|
|
11080
|
+
]
|
|
11081
|
+
},
|
|
11082
|
+
{
|
|
11083
|
+
"name": "current?",
|
|
11084
|
+
"description": "Wether or not this node is the current node.",
|
|
11085
|
+
"parameters": [],
|
|
11086
|
+
"return_types": [
|
|
11087
|
+
"Boolean"
|
|
11088
|
+
]
|
|
11089
|
+
},
|
|
11090
|
+
{
|
|
11091
|
+
"name": "checked",
|
|
11092
|
+
"description": "This node's checked state.",
|
|
11093
|
+
"parameters": [],
|
|
11094
|
+
"return_types": [
|
|
11095
|
+
"String"
|
|
11096
|
+
]
|
|
11097
|
+
},
|
|
11098
|
+
{
|
|
11099
|
+
"name": "select_variant",
|
|
11100
|
+
"description": "This node's select variant (i.e. check box variant).",
|
|
11101
|
+
"parameters": [],
|
|
11102
|
+
"return_types": [
|
|
11103
|
+
"Symbol"
|
|
11104
|
+
]
|
|
11105
|
+
},
|
|
11106
|
+
{
|
|
11107
|
+
"name": "node_variant",
|
|
11108
|
+
"description": "This node's variant, eg. `:button`, `:div`, etc.",
|
|
11109
|
+
"parameters": [],
|
|
11110
|
+
"return_types": [
|
|
11111
|
+
"Symbol"
|
|
11112
|
+
]
|
|
11113
|
+
},
|
|
11114
|
+
{
|
|
11115
|
+
"name": "disabled",
|
|
11116
|
+
"description": "Whether or not this node is disabled, i.e. cannot be activated.",
|
|
11117
|
+
"parameters": [],
|
|
11118
|
+
"return_types": [
|
|
11119
|
+
"Boolean"
|
|
11120
|
+
]
|
|
11121
|
+
},
|
|
11122
|
+
{
|
|
11123
|
+
"name": "disabled?",
|
|
11124
|
+
"description": "Whether or not this node is disabled, i.e. cannot be activated.",
|
|
11125
|
+
"parameters": [],
|
|
11126
|
+
"return_types": [
|
|
11127
|
+
"Boolean"
|
|
11128
|
+
]
|
|
11129
|
+
},
|
|
11130
|
+
{
|
|
11131
|
+
"name": "level",
|
|
11132
|
+
"description": "The numeric depth of this node.",
|
|
11133
|
+
"parameters": [],
|
|
11134
|
+
"return_types": [
|
|
11135
|
+
"Integer"
|
|
11136
|
+
]
|
|
11137
|
+
},
|
|
11138
|
+
{
|
|
11139
|
+
"name": "merge_system_arguments!",
|
|
11140
|
+
"description": "Merges the given arguments into the current hash of system arguments provided when the component was\ninitially constructed. This method can be used to add additional arguments just before rendering.",
|
|
11141
|
+
"parameters": [
|
|
11142
|
+
{
|
|
11143
|
+
"name": "other_arguments",
|
|
11144
|
+
"type": "Hash",
|
|
11145
|
+
"default": "N/A",
|
|
11146
|
+
"description": "The other hash of system arguments to merge into the current one."
|
|
11147
|
+
}
|
|
11148
|
+
],
|
|
11149
|
+
"return_types": []
|
|
11150
|
+
}
|
|
11151
|
+
],
|
|
11152
|
+
"previews": [],
|
|
11153
|
+
"subcomponents": []
|
|
11154
|
+
},
|
|
11155
|
+
{
|
|
11156
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::LoadingFailureMessage",
|
|
11157
|
+
"description": "A `TreeView` loading failure message.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
11158
|
+
"accessibility_docs": null,
|
|
11159
|
+
"is_form_component": false,
|
|
11160
|
+
"is_published": true,
|
|
11161
|
+
"requires_js": false,
|
|
11162
|
+
"component": "TreeView::LoadingFailureMessage",
|
|
11163
|
+
"status": "alpha",
|
|
11164
|
+
"a11y_reviewed": false,
|
|
11165
|
+
"short_name": "TreeViewLoadingFailureMessage",
|
|
11166
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/loading_failure_message.rb",
|
|
11167
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/loading_failure_message/default/",
|
|
11168
|
+
"parameters": [
|
|
11169
|
+
{
|
|
11170
|
+
"name": "text",
|
|
11171
|
+
"type": "String",
|
|
11172
|
+
"default": "`Something went wrong`",
|
|
11173
|
+
"description": "The failure message to display."
|
|
11174
|
+
},
|
|
11175
|
+
{
|
|
11176
|
+
"name": "retry_button_label",
|
|
11177
|
+
"type": "String",
|
|
11178
|
+
"default": "`Retry`",
|
|
11179
|
+
"description": "The text shown on the retry button."
|
|
11180
|
+
},
|
|
11181
|
+
{
|
|
11182
|
+
"name": "system_arguments",
|
|
11183
|
+
"type": "Hash",
|
|
11184
|
+
"default": "N/A",
|
|
11185
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
11186
|
+
}
|
|
11187
|
+
],
|
|
11188
|
+
"slots": [],
|
|
11189
|
+
"methods": [],
|
|
11190
|
+
"previews": [],
|
|
11191
|
+
"subcomponents": []
|
|
11192
|
+
},
|
|
11193
|
+
{
|
|
11194
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::LeadingAction",
|
|
11195
|
+
"description": "The leading action for `TreeView` nodes.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
11196
|
+
"accessibility_docs": null,
|
|
11197
|
+
"is_form_component": false,
|
|
11198
|
+
"is_published": true,
|
|
11199
|
+
"requires_js": false,
|
|
11200
|
+
"component": "TreeView::LeadingAction",
|
|
11201
|
+
"status": "alpha",
|
|
11202
|
+
"a11y_reviewed": false,
|
|
11203
|
+
"short_name": "TreeViewLeadingAction",
|
|
11204
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/leading_action.rb",
|
|
11205
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/leading_action/default/",
|
|
11206
|
+
"parameters": [
|
|
11207
|
+
{
|
|
11208
|
+
"name": "action",
|
|
11209
|
+
"type": "ViewComponent::Base",
|
|
11210
|
+
"default": "N/A",
|
|
11211
|
+
"description": "A component or other renderable to use as the action button etc."
|
|
11212
|
+
}
|
|
11213
|
+
],
|
|
11214
|
+
"slots": [],
|
|
11215
|
+
"methods": [],
|
|
11216
|
+
"previews": [],
|
|
11217
|
+
"subcomponents": []
|
|
11218
|
+
},
|
|
11219
|
+
{
|
|
11220
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::IconPair",
|
|
11221
|
+
"description": "A pair of icons for a `TreeView` sub-tree that displays distinct icons when the sub-tree is\nexpanded and collapsed.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
11222
|
+
"accessibility_docs": null,
|
|
11223
|
+
"is_form_component": false,
|
|
11224
|
+
"is_published": true,
|
|
11225
|
+
"requires_js": false,
|
|
11226
|
+
"component": "TreeView::IconPair",
|
|
11227
|
+
"status": "alpha",
|
|
11228
|
+
"a11y_reviewed": false,
|
|
11229
|
+
"short_name": "TreeViewIconPair",
|
|
11230
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/icon_pair.rb",
|
|
11231
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/icon_pair/default/",
|
|
11232
|
+
"parameters": [
|
|
11233
|
+
{
|
|
11234
|
+
"name": "expanded",
|
|
11235
|
+
"type": "Boolean",
|
|
11236
|
+
"default": "`false`",
|
|
11237
|
+
"description": "If true, the expanded icon is shown and the collapsed icon is hidden, etc."
|
|
11238
|
+
},
|
|
11239
|
+
{
|
|
11240
|
+
"name": "system_arguments",
|
|
11241
|
+
"type": "Hash",
|
|
11242
|
+
"default": "N/A",
|
|
11243
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
11244
|
+
}
|
|
11245
|
+
],
|
|
11246
|
+
"slots": [
|
|
11247
|
+
{
|
|
11248
|
+
"name": "expanded_icon",
|
|
11249
|
+
"description": "The expanded icon.",
|
|
11250
|
+
"parameters": [
|
|
11251
|
+
{
|
|
11252
|
+
"name": "system_arguments",
|
|
11253
|
+
"type": "Hash",
|
|
11254
|
+
"default": "N/A",
|
|
11255
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Icon{{/link_to_component}}."
|
|
11256
|
+
}
|
|
11257
|
+
]
|
|
11258
|
+
},
|
|
11259
|
+
{
|
|
11260
|
+
"name": "collapsed_icon",
|
|
11261
|
+
"description": "The collapsed icon.",
|
|
11262
|
+
"parameters": [
|
|
11263
|
+
{
|
|
11264
|
+
"name": "system_arguments",
|
|
11265
|
+
"type": "Hash",
|
|
11266
|
+
"default": "N/A",
|
|
11267
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Icon{{/link_to_component}}."
|
|
11268
|
+
}
|
|
11269
|
+
]
|
|
11270
|
+
}
|
|
11271
|
+
],
|
|
11272
|
+
"methods": [
|
|
11273
|
+
{
|
|
11274
|
+
"name": "expanded",
|
|
11275
|
+
"description": "Whether or not this icon is expanded.",
|
|
11276
|
+
"parameters": [],
|
|
11277
|
+
"return_types": [
|
|
11278
|
+
"Boolean"
|
|
11279
|
+
]
|
|
11280
|
+
},
|
|
11281
|
+
{
|
|
11282
|
+
"name": "expanded?",
|
|
11283
|
+
"description": "Whether or not this icon is expanded.",
|
|
11284
|
+
"parameters": [],
|
|
11285
|
+
"return_types": [
|
|
11286
|
+
"Boolean"
|
|
11287
|
+
]
|
|
11288
|
+
}
|
|
11289
|
+
],
|
|
11290
|
+
"previews": [],
|
|
11291
|
+
"subcomponents": []
|
|
11292
|
+
},
|
|
11293
|
+
{
|
|
11294
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::Icon",
|
|
11295
|
+
"description": "An icon for a `TreeView` node.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
11296
|
+
"accessibility_docs": null,
|
|
11297
|
+
"is_form_component": false,
|
|
11298
|
+
"is_published": true,
|
|
11299
|
+
"requires_js": false,
|
|
11300
|
+
"component": "TreeView::Icon",
|
|
11301
|
+
"status": "alpha",
|
|
11302
|
+
"a11y_reviewed": false,
|
|
11303
|
+
"short_name": "TreeViewIcon",
|
|
11304
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/icon.rb",
|
|
11305
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/icon/default/",
|
|
11306
|
+
"parameters": [
|
|
11307
|
+
{
|
|
11308
|
+
"name": "system_arguments",
|
|
11309
|
+
"type": "Hash",
|
|
11310
|
+
"default": "N/A",
|
|
11311
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}."
|
|
11312
|
+
}
|
|
11313
|
+
],
|
|
11314
|
+
"slots": [],
|
|
11315
|
+
"methods": [],
|
|
11316
|
+
"previews": [],
|
|
11317
|
+
"subcomponents": []
|
|
11318
|
+
},
|
|
11319
|
+
{
|
|
11320
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::LeafNode",
|
|
11321
|
+
"description": "A `TreeView` leaf node.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
11322
|
+
"accessibility_docs": null,
|
|
11323
|
+
"is_form_component": false,
|
|
11324
|
+
"is_published": true,
|
|
11325
|
+
"requires_js": false,
|
|
11326
|
+
"component": "TreeView::LeafNode",
|
|
11327
|
+
"status": "alpha",
|
|
11328
|
+
"a11y_reviewed": false,
|
|
11329
|
+
"short_name": "TreeViewLeafNode",
|
|
11330
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/leaf_node.rb",
|
|
11331
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/leaf_node/default/",
|
|
11332
|
+
"parameters": [
|
|
11333
|
+
{
|
|
11334
|
+
"name": "label",
|
|
11335
|
+
"type": "String",
|
|
11336
|
+
"default": "N/A",
|
|
11337
|
+
"description": "The node's label, i.e. it's textual content."
|
|
11338
|
+
},
|
|
11339
|
+
{
|
|
11340
|
+
"name": "system_arguments",
|
|
11341
|
+
"type": "Hash",
|
|
11342
|
+
"default": "N/A",
|
|
11343
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Node{{/link_to_component}}."
|
|
11344
|
+
}
|
|
11345
|
+
],
|
|
11346
|
+
"slots": [
|
|
11347
|
+
{
|
|
11348
|
+
"name": "leading_visual",
|
|
11349
|
+
"description": null,
|
|
11350
|
+
"parameters": []
|
|
11351
|
+
},
|
|
11352
|
+
{
|
|
11353
|
+
"name": "leading_action",
|
|
11354
|
+
"description": null,
|
|
11355
|
+
"parameters": []
|
|
11356
|
+
},
|
|
11357
|
+
{
|
|
11358
|
+
"name": "trailing_visual",
|
|
11359
|
+
"description": null,
|
|
11360
|
+
"parameters": []
|
|
11361
|
+
}
|
|
11362
|
+
],
|
|
11363
|
+
"methods": [
|
|
11364
|
+
{
|
|
11365
|
+
"name": "with_leading_visual_icon",
|
|
11366
|
+
"description": "Adds a leading visual icon rendered to the left of the node's label.",
|
|
11367
|
+
"parameters": [
|
|
11368
|
+
{
|
|
11369
|
+
"name": "label",
|
|
11370
|
+
"type": "String",
|
|
11371
|
+
"default": "`nil`",
|
|
11372
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
|
11373
|
+
},
|
|
11374
|
+
{
|
|
11375
|
+
"name": "system_arguments",
|
|
11376
|
+
"type": "Hash",
|
|
11377
|
+
"default": "N/A",
|
|
11378
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Icon{{/link_to_component}}."
|
|
11379
|
+
}
|
|
11380
|
+
],
|
|
11381
|
+
"return_types": []
|
|
11382
|
+
},
|
|
11383
|
+
{
|
|
11384
|
+
"name": "with_leading_action_button",
|
|
11385
|
+
"description": "Adds a leading action rendered to the left of the node's label and any leading visuals or checkboxes.",
|
|
11386
|
+
"parameters": [
|
|
11387
|
+
{
|
|
11388
|
+
"name": "system_arguments",
|
|
11389
|
+
"type": "Hash",
|
|
11390
|
+
"default": "N/A",
|
|
11391
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
|
11392
|
+
}
|
|
11393
|
+
],
|
|
11394
|
+
"return_types": []
|
|
11395
|
+
},
|
|
11396
|
+
{
|
|
11397
|
+
"name": "with_trailing_visual_icon",
|
|
11398
|
+
"description": "Adds a trailing visual icon rendered to the right of the node's label.",
|
|
11399
|
+
"parameters": [
|
|
11400
|
+
{
|
|
11401
|
+
"name": "label",
|
|
11402
|
+
"type": "String",
|
|
11403
|
+
"default": "`nil`",
|
|
11404
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
|
11405
|
+
},
|
|
11406
|
+
{
|
|
11407
|
+
"name": "system_arguments",
|
|
11408
|
+
"type": "Hash",
|
|
11409
|
+
"default": "N/A",
|
|
11410
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Icon{{/link_to_component}}."
|
|
11411
|
+
}
|
|
11412
|
+
],
|
|
11413
|
+
"return_types": []
|
|
11414
|
+
}
|
|
11415
|
+
],
|
|
11416
|
+
"previews": [],
|
|
11417
|
+
"subcomponents": []
|
|
11418
|
+
},
|
|
11419
|
+
{
|
|
11420
|
+
"fully_qualified_name": "Primer::Alpha::TreeView::SubTreeNode",
|
|
11421
|
+
"description": "A `TreeView` sub-tree node.\n\nThis component is part of the {{#link_to_component}}Primer::Alpha::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
|
11422
|
+
"accessibility_docs": null,
|
|
11423
|
+
"is_form_component": false,
|
|
11424
|
+
"is_published": true,
|
|
11425
|
+
"requires_js": false,
|
|
11426
|
+
"component": "TreeView::SubTreeNode",
|
|
11427
|
+
"status": "alpha",
|
|
11428
|
+
"a11y_reviewed": false,
|
|
11429
|
+
"short_name": "TreeViewSubTreeNode",
|
|
11430
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tree_view/sub_tree_node.rb",
|
|
11431
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tree_view/sub_tree_node/default/",
|
|
11432
|
+
"parameters": [
|
|
11433
|
+
{
|
|
11434
|
+
"name": "label",
|
|
11435
|
+
"type": "String",
|
|
11436
|
+
"default": "N/A",
|
|
11437
|
+
"description": "The node's label, i.e. it's textual content."
|
|
11438
|
+
},
|
|
11439
|
+
{
|
|
11440
|
+
"name": "path",
|
|
11441
|
+
"type": "Array<String>",
|
|
11442
|
+
"default": "N/A",
|
|
11443
|
+
"description": "The node's \"path,\" i.e. this node's label and the labels of all its ancestors. This node should be reachable by traversing the tree following this path."
|
|
11444
|
+
},
|
|
11445
|
+
{
|
|
11446
|
+
"name": "node_variant",
|
|
11447
|
+
"type": "Symbol",
|
|
11448
|
+
"default": "N/A",
|
|
11449
|
+
"description": "The variant to use for this node. One of `:anchor`, `:button`, or `:div`."
|
|
11450
|
+
},
|
|
11451
|
+
{
|
|
11452
|
+
"name": "sub_tree_component_klass",
|
|
11453
|
+
"type": "Class",
|
|
11454
|
+
"default": "`SubTree`",
|
|
11455
|
+
"description": "The class to use for the sub-tree instead of the default {{#link_to_component}}Primer::Alpha::TreeView::SubTree{{/link_to_component}}"
|
|
11456
|
+
},
|
|
11457
|
+
{
|
|
11458
|
+
"name": "expanded",
|
|
11459
|
+
"type": "Boolean",
|
|
11460
|
+
"default": "`false`",
|
|
11461
|
+
"description": "Whether or not this sub-tree should be rendered expanded."
|
|
11462
|
+
},
|
|
11463
|
+
{
|
|
11464
|
+
"name": "select_strategy",
|
|
11465
|
+
"type": "Symbol",
|
|
11466
|
+
"default": "`:mixed_descendants`",
|
|
11467
|
+
"description": "What should happen when this sub-tree node is checked. One of `:descendants`, `:mixed_descendants`, or `:self`."
|
|
11468
|
+
},
|
|
11469
|
+
{
|
|
11470
|
+
"name": "system_arguments",
|
|
11471
|
+
"type": "Hash",
|
|
11472
|
+
"default": "N/A",
|
|
11473
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Node{{/link_to_component}}."
|
|
11474
|
+
}
|
|
11475
|
+
],
|
|
11476
|
+
"slots": [
|
|
11477
|
+
{
|
|
11478
|
+
"name": "leading_visual",
|
|
11479
|
+
"description": null,
|
|
11480
|
+
"parameters": []
|
|
11481
|
+
},
|
|
11482
|
+
{
|
|
11483
|
+
"name": "leading_action",
|
|
11484
|
+
"description": null,
|
|
11485
|
+
"parameters": []
|
|
11486
|
+
},
|
|
11487
|
+
{
|
|
11488
|
+
"name": "trailing_visual",
|
|
11489
|
+
"description": null,
|
|
11490
|
+
"parameters": []
|
|
11491
|
+
}
|
|
11492
|
+
],
|
|
11493
|
+
"methods": [
|
|
11494
|
+
{
|
|
11495
|
+
"name": "with_leading_visual_icon",
|
|
11496
|
+
"description": "Adds a leading visual icon rendered to the left of the node's label.",
|
|
11497
|
+
"parameters": [
|
|
11498
|
+
{
|
|
11499
|
+
"name": "label",
|
|
11500
|
+
"type": "String",
|
|
11501
|
+
"default": "`nil`",
|
|
11502
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
|
11503
|
+
},
|
|
11504
|
+
{
|
|
11505
|
+
"name": "system_arguments",
|
|
11506
|
+
"type": "Hash",
|
|
11507
|
+
"default": "N/A",
|
|
11508
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Icon{{/link_to_component}}."
|
|
11509
|
+
}
|
|
11510
|
+
],
|
|
11511
|
+
"return_types": []
|
|
11512
|
+
},
|
|
11513
|
+
{
|
|
11514
|
+
"name": "with_leading_visual_icons",
|
|
11515
|
+
"description": "Adds a pair of leading visual icon rendered to the left of the node's label.",
|
|
11516
|
+
"parameters": [
|
|
11517
|
+
{
|
|
11518
|
+
"name": "label",
|
|
11519
|
+
"type": "String",
|
|
11520
|
+
"default": "`nil`",
|
|
11521
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
|
11522
|
+
},
|
|
11523
|
+
{
|
|
11524
|
+
"name": "system_arguments",
|
|
11525
|
+
"type": "Hash",
|
|
11526
|
+
"default": "N/A",
|
|
11527
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::IconPair{{/link_to_component}}."
|
|
11528
|
+
}
|
|
11529
|
+
],
|
|
11530
|
+
"return_types": []
|
|
11531
|
+
},
|
|
11532
|
+
{
|
|
11533
|
+
"name": "with_leading_action_button",
|
|
11534
|
+
"description": "Adds a leading action rendered to the left of the node's label and any leading visuals or checkboxes.",
|
|
11535
|
+
"parameters": [
|
|
11536
|
+
{
|
|
11537
|
+
"name": "system_arguments",
|
|
11538
|
+
"type": "Hash",
|
|
11539
|
+
"default": "N/A",
|
|
11540
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
|
11541
|
+
}
|
|
11542
|
+
],
|
|
11543
|
+
"return_types": []
|
|
11544
|
+
},
|
|
11545
|
+
{
|
|
11546
|
+
"name": "with_trailing_visual_icon",
|
|
11547
|
+
"description": "Adds a trailing visual icon rendered to the right of the node's label.",
|
|
11548
|
+
"parameters": [
|
|
11549
|
+
{
|
|
11550
|
+
"name": "label",
|
|
11551
|
+
"type": "String",
|
|
11552
|
+
"default": "`nil`",
|
|
11553
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
|
11554
|
+
},
|
|
11555
|
+
{
|
|
11556
|
+
"name": "system_arguments",
|
|
11557
|
+
"type": "Hash",
|
|
11558
|
+
"default": "N/A",
|
|
11559
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::TreeView::Icon{{/link_to_component}}."
|
|
11560
|
+
}
|
|
11561
|
+
],
|
|
11562
|
+
"return_types": []
|
|
11563
|
+
}
|
|
11564
|
+
],
|
|
11565
|
+
"previews": [],
|
|
11566
|
+
"subcomponents": []
|
|
11567
|
+
}
|
|
11568
|
+
]
|
|
11569
|
+
},
|
|
11570
|
+
{
|
|
11571
|
+
"fully_qualified_name": "Primer::Alpha::UnderlineNav",
|
|
11572
|
+
"description": "Use `UnderlineNav` to style navigation links with a minimal\nunderlined selected state, typically placed at the top\nof the page.\n\nFor panel navigation, use {{#link_to_component}}Primer::Alpha::UnderlinePanels{{/link_to_component}} instead.",
|
|
11573
|
+
"accessibility_docs": "- By default, `UnderlineNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See {{#link_to_component}}Primer::Alpha::Navigation::Tab{{/link_to_component}} for additional\n accessibility considerations.",
|
|
11574
|
+
"is_form_component": false,
|
|
11575
|
+
"is_published": true,
|
|
11576
|
+
"requires_js": false,
|
|
11577
|
+
"component": "UnderlineNav",
|
|
11578
|
+
"status": "alpha",
|
|
11579
|
+
"a11y_reviewed": false,
|
|
11580
|
+
"short_name": "UnderlineNav",
|
|
11581
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/underline_nav.rb",
|
|
11582
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/underline_nav/default/",
|
|
11583
|
+
"parameters": [
|
|
11584
|
+
{
|
|
11585
|
+
"name": "tag",
|
|
11586
|
+
"type": "Symbol",
|
|
11587
|
+
"default": "`:nav`",
|
|
11588
|
+
"description": "One of `:div` or `:nav`."
|
|
11589
|
+
},
|
|
11590
|
+
{
|
|
11591
|
+
"name": "label",
|
|
11592
|
+
"type": "String",
|
|
11593
|
+
"default": "N/A",
|
|
11594
|
+
"description": "Sets an `aria-label` that helps assistive technology users understand the purpose of the links, and distinguish it from similar elements."
|
|
11595
|
+
},
|
|
11596
|
+
{
|
|
11597
|
+
"name": "align",
|
|
11598
|
+
"type": "Symbol",
|
|
11599
|
+
"default": "`:left`",
|
|
11600
|
+
"description": "One of `:left` or `:right`. - Defaults to left"
|
|
11601
|
+
},
|
|
11602
|
+
{
|
|
11603
|
+
"name": "body_arguments",
|
|
11604
|
+
"type": "Hash",
|
|
11605
|
+
"default": "`{}`",
|
|
11606
|
+
"description": "{{link_to_system_arguments_docs}} for the body wrapper."
|
|
11607
|
+
},
|
|
11608
|
+
{
|
|
11609
|
+
"name": "system_arguments",
|
|
11610
|
+
"type": "Hash",
|
|
11611
|
+
"default": "N/A",
|
|
11612
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
11613
|
+
}
|
|
11614
|
+
],
|
|
11615
|
+
"slots": [
|
|
11616
|
+
{
|
|
11617
|
+
"name": "tabs",
|
|
11618
|
+
"description": "Use the tabs to list page links.",
|
|
11619
|
+
"parameters": [
|
|
11620
|
+
{
|
|
11621
|
+
"name": "selected",
|
|
11622
|
+
"type": "Boolean",
|
|
11623
|
+
"default": "N/A",
|
|
11624
|
+
"description": "Whether the tab is selected."
|
|
11625
|
+
},
|
|
11626
|
+
{
|
|
11627
|
+
"name": "system_arguments",
|
|
11628
|
+
"type": "Hash",
|
|
11629
|
+
"default": "N/A",
|
|
11630
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
11631
|
+
}
|
|
11632
|
+
]
|
|
11633
|
+
},
|
|
11634
|
+
{
|
|
11635
|
+
"name": "actions",
|
|
11636
|
+
"description": "Use actions for a call to action.",
|
|
11637
|
+
"parameters": [
|
|
11638
|
+
{
|
|
11639
|
+
"name": "tag",
|
|
11640
|
+
"type": "Symbol",
|
|
11641
|
+
"default": "`:div`",
|
|
11642
|
+
"description": "One of `:div` or `:span`."
|
|
11643
|
+
},
|
|
11644
|
+
{
|
|
11645
|
+
"name": "system_arguments",
|
|
11646
|
+
"type": "Hash",
|
|
11647
|
+
"default": "N/A",
|
|
11648
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
11649
|
+
}
|
|
11650
|
+
]
|
|
11651
|
+
}
|
|
11652
|
+
],
|
|
11653
|
+
"methods": [],
|
|
11654
|
+
"previews": [
|
|
11655
|
+
{
|
|
11656
|
+
"preview_path": "primer/alpha/underline_nav/playground",
|
|
11657
|
+
"name": "playground",
|
|
11658
|
+
"snapshot": "false",
|
|
10311
11659
|
"skip_rules": {
|
|
10312
11660
|
"wont_fix": [
|
|
10313
11661
|
"region"
|
|
@@ -15764,6 +17112,12 @@
|
|
|
15764
17112
|
"default": "`false`",
|
|
15765
17113
|
"description": "Removes the `title` attribute provided on the element by default."
|
|
15766
17114
|
},
|
|
17115
|
+
{
|
|
17116
|
+
"name": "aria_hidden",
|
|
17117
|
+
"type": "Boolean",
|
|
17118
|
+
"default": "`nil`",
|
|
17119
|
+
"description": "Set if the element is hidden or not."
|
|
17120
|
+
},
|
|
15767
17121
|
{
|
|
15768
17122
|
"name": "system_arguments",
|
|
15769
17123
|
"type": "Hash",
|