Skip to content

Commit

Permalink
Merge branch 'main' into button-type-check
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcosta7 committed Oct 25, 2022
2 parents 45d5ec3 + e03b5e4 commit cc79c6c
Show file tree
Hide file tree
Showing 29 changed files with 1,290 additions and 1,091 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-melons-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

TreeView: Add aria-atomic attribute to live region
5 changes: 5 additions & 0 deletions .changeset/eleven-countries-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Add support for dynamic aria-expanded support on TreeView.Item
5 changes: 5 additions & 0 deletions .changeset/olive-sloths-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

TreeView: Fix scroll behavior when focus changes
5 changes: 5 additions & 0 deletions .changeset/polite-dodos-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

UnderlineNav2: Add support and docs for react router configuration
5 changes: 5 additions & 0 deletions .changeset/popular-taxis-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

TreeView: Improve performance when rendering lots of items
5 changes: 5 additions & 0 deletions .changeset/tender-turtles-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

TreeView: Add support for a skeleton state with the TreeView.SubTree `count` prop
5 changes: 5 additions & 0 deletions .changeset/tough-lobsters-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

TreeView: Add `TreeView.ErrorDialog` component
5 changes: 5 additions & 0 deletions .changeset/tough-peas-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

UnderlineNav2: Add string type to the `counter` prop and display loading counter for all
5 changes: 5 additions & 0 deletions .changeset/witty-apples-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

UnderlineNav2: Deprecate coarse input detection and its scroll behaviour
97 changes: 63 additions & 34 deletions docs/content/TreeView.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ description: A hierarchical list of items where nested items can be expanded and

```jsx live drafts
<Box sx={{maxWidth: 400}}>
<nav aria-label="File navigation">
<TreeView aria-label="File navigation">
<nav aria-label="Files">
<TreeView aria-label="Files">
<TreeView.Item>
<TreeView.LeadingVisual>
<TreeView.DirectoryIcon />
Expand Down Expand Up @@ -57,8 +57,8 @@ description: A hierarchical list of items where nested items can be expanded and

```jsx live drafts
<Box sx={{maxWidth: 400}}>
<nav aria-label="File navigation">
<TreeView aria-label="File navigation">
<nav aria-label="Files">
<TreeView aria-label="Files">
<TreeView.LinkItem href="#">
<TreeView.LeadingVisual>
<TreeView.DirectoryIcon />
Expand Down Expand Up @@ -113,8 +113,8 @@ function ControlledTreeView() {
return (
<Box sx={{display: 'grid', gap: 2, maxWidth: 400}}>
<Button onClick={() => setExpanded(!expanded)}>{expanded ? 'Collapse' : 'Expand'}</Button>
<nav aria-label="File navigation">
<TreeView aria-label="File navigation">
<nav aria-label="Files">
<TreeView aria-label="Files">
<TreeView.Item expanded={expanded} onExpandedChange={setExpanded}>
src
<TreeView.SubTree>
Expand All @@ -139,8 +139,8 @@ To render stateful visuals, pass a render function to `TreeView.LeadingVisual` o

```jsx live drafts
<Box sx={{maxWidth: 400}}>
<nav aria-label="File navigation">
<TreeView aria-label="File navigation">
<nav aria-label="Files">
<TreeView aria-label="Files">
<TreeView.Item>
<TreeView.LeadingVisual>
{({isExpanded}) => (isExpanded ? <FileDirectoryOpenFillIcon /> : <FileDirectoryFillIcon />)}
Expand All @@ -162,8 +162,8 @@ Since stateful directory icons are a common use case for TreeView, we provide a

```jsx live drafts
<Box sx={{maxWidth: 400}}>
<nav aria-label="File navigation">
<TreeView aria-label="File navigation">
<nav aria-label="Files">
<TreeView aria-label="Files">
<TreeView.Item>
<TreeView.LeadingVisual>
<TreeView.DirectoryIcon />
Expand Down Expand Up @@ -272,6 +272,42 @@ See [Storybook](https://primer.style/react/storybook?path=/story/components-tree
{/* <PropsTableSxRow /> */}
</PropsTable>

### TreeView.LeadingVisual

<PropsTable>
<PropsTableRow
name="children"
type={`| React.ReactNode
| (props: {isExpanded: boolean}) => React.ReactNode`}
/>
<PropsTableRow
name="label"
type="string"
description="Provide an accessible label for the leading visual. This is not necessary for decorative visuals"
/>
{/* <PropsTableSxRow /> */}
</PropsTable>

### TreeView.TrailingVisual

<PropsTable>
<PropsTableRow
name="children"
type={`| React.ReactNode
| (props: {isExpanded: boolean}) => React.ReactNode`}
/>
<PropsTableRow
name="label"
type="string"
description="Provide an accessible label for the trailing visual. This is not necessary for decorative visuals"
/>
{/* <PropsTableSxRow /> */}
</PropsTable>

### TreeView.DirectoryIcon

<PropsTable>{/* <PropsTableSxRow /> */}</PropsTable>

### TreeView.SubTree

<PropsTable>
Expand Down Expand Up @@ -307,45 +343,38 @@ See [Storybook](https://primer.style/react/storybook?path=/story/components-tree
</>
}
/>
{/* <PropsTableSxRow /> */}
</PropsTable>

### TreeView.LeadingVisual

<PropsTable>
<PropsTableRow
name="children"
type={`| React.ReactNode
| (props: {isExpanded: boolean}) => React.ReactNode`}
name="count"
type="number"
description="The number of items expected to be in the subtree. When in the loading state, the subtree will render a skeleton loading placeholder with the specified count of items"
/>
<PropsTableRow
name="label"
type="string"
description="Provide an accessible label for the leading visual. This is not necessary for decorative visuals"
/>
{/* <PropsTableSxRow /> */}
<PropsTableSxRow />
</PropsTable>

### TreeView.TrailingVisual
### TreeView.ErrorDialog

<PropsTable>
<PropsTableRow
name="children"
type={`| React.ReactNode
| (props: {isExpanded: boolean}) => React.ReactNode`}
type="React.ReactNode"
required
description="The content of the dialog. This is usually a message explaining the error."
/>
<PropsTableRow
name="label"
name="title"
type="string"
description="Provide an accessible label for the trailing visual. This is not necessary for decorative visuals"
defaultValue="'Error'"
description="The title of the dialog. This is usually a short description of the error."
/>
<PropsTableRow
name="onRetry"
type="() => void"
description="Event handler called when the user clicks the retry button."
/>
<PropsTableRow name="onDismiss" type="() => void" description="Event handler called when the dialog is dismissed." />
{/* <PropsTableSxRow /> */}
</PropsTable>

### TreeView.DirectoryIcon

<PropsTable>{/* <PropsTableSxRow /> */}</PropsTable>

## Status

<ComponentChecklist
Expand Down
Loading

0 comments on commit cc79c6c

Please sign in to comment.