Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/forty-squids-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@primer/react": minor
---

TreeView promoted to [beta](https://primer.style/contribute/component-lifecycle#beta) status. You can now import it from the main bundle instead of `/drafts`:

```diff
- import {TreeView} from '@primer/react/drafts'
+ import {TreeView} from '@primer/react'
```
28 changes: 17 additions & 11 deletions docs/content/TreeView.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
---
title: TreeView
componentId: tree_view
status: Draft
status: Beta
description: A hierarchical list of items where nested items can be expanded and collapsed.
a11yReviewed: true
source: https://github.com/primer/react/tree/main/src/TreeView
storybook: '/react/storybook?path=/story/components-treeview'
---

import data from '../../src/TreeView/TreeView.docs.json'

```js
import {TreeView} from '@primer/react/drafts'
import {TreeView} from '@primer/react'
```

## Examples
Expand Down Expand Up @@ -280,15 +283,18 @@ See [Storybook](https://primer.style/react/storybook?path=/story/components-tree
<ComponentChecklist
items={{
propsDocumented: true,
noUnnecessaryDeps: false,
adaptsToThemes: false,
adaptsToScreenSizes: false,
fullTestCoverage: false,
usedInProduction: false,
usageExamplesDocumented: false,
hasStorybookStories: false,
designReviewed: false,
a11yReviewed: false,
noUnnecessaryDeps: true,
adaptsToThemes: true,
adaptsToScreenSizes: true,
fullTestCoverage: true,
visualRegressionCoverage: true,
noAxeViolations: true,
usedInProduction: true,
usageExamplesDocumented: true,
hasStorybookStories: true,
designReviewed: true,
a11yReviewed: true,
noPerfRegression: true,
stableApi: false,
addressedApiFeedback: false,
hasDesignGuidelines: false,
Expand Down
4 changes: 2 additions & 2 deletions docs/src/@primer/gatsby-theme-doctocat/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
url: /Token
- title: Tooltip
url: /Tooltip
- title: TreeView
url: /TreeView
- title: Truncate
url: /Truncate
- title: UnderlineNav
Expand All @@ -164,8 +166,6 @@
url: /drafts/MarkdownEditor
- title: MarkdownViewer
url: /drafts/MarkdownViewer
- title: TreeView
url: /TreeView
- title: UnderlineNav v2
url: /drafts/UnderlineNav2
- title: PageHeader
Expand Down
4 changes: 2 additions & 2 deletions docs/src/component-checklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export function ComponentChecklist({items}) {
Component has robust unit test coverage (100% where achievable).
</Checklist.Item>
<Checklist.Item checked={items.visualRegressionCoverage}>
The component has visual regression coverage of its default and interactive states.
Component has visual regression coverage of its default and interactive states.
</Checklist.Item>
<Checklist.Item checked={items.noAxeViolations}>
The component does not introduce any axe violations.
Component does not introduce any axe violations.
</Checklist.Item>
<Checklist.Item checked={items.a11yReviewed}>
Component has been manually reviewed by the accessibility team and any resulting issues have been addressed.
Expand Down
4 changes: 2 additions & 2 deletions generated/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -4287,8 +4287,8 @@
"tree_view": {
"id": "tree_view",
"name": "TreeView",
"status": "draft",
"a11yReviewed": false,
"status": "beta",
"a11yReviewed": true,
"stories": [
"components-treeview-features--files",
"components-treeview-features--files-changed"
Expand Down
11 changes: 4 additions & 7 deletions src/TreeView/TreeView.docs.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"id": "tree_view",
"name": "TreeView",
"status": "draft",
"a11yReviewed": false,
"stories": [
"components-treeview-features--files",
"components-treeview-features--files-changed"
],
"status": "beta",
"a11yReviewed": true,
"stories": ["components-treeview-features--files", "components-treeview-features--files-changed"],
"props": [
{
"name": "children",
Expand Down Expand Up @@ -146,4 +143,4 @@
]
}
]
}
}
1 change: 1 addition & 0 deletions src/__tests__/__snapshots__/exports.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exports[`@primer/react should not update exports without a semver change 1`] = `
"ToggleSwitch",
"Token",
"Tooltip",
"TreeView",
"Truncate",
"UnderlineNav",
"UnderlineNav2",
Expand Down
3 changes: 1 addition & 2 deletions src/drafts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export {default as Hidden} from '../Hidden'

export * from './hooks'

export * from '../TreeView'

// TODO: Remove these components from the drafts bundle in the next major release
export * from '../TreeView'
export * from '../NavList'
export * from '../SegmentedControl'
export * from '../SplitPageLayout'
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ export type {CheckboxProps} from './Checkbox'
export {default as Textarea} from './Textarea'
export type {TextareaProps} from './Textarea'

export {TreeView} from './TreeView'
export type {
TreeViewProps,
TreeViewItemProps,
TreeViewSubTreeProps,
TreeViewVisualProps,
TreeViewErrorDialogProps,
} from './TreeView'

export {UnderlineNav as UnderlineNav2} from './UnderlineNav2'

export {SSRProvider, useSSRSafeId} from './utils/ssr'
Expand Down