diff --git a/.changeset/early-timers-speak.md b/.changeset/early-timers-speak.md new file mode 100644 index 00000000000..41ccecac220 --- /dev/null +++ b/.changeset/early-timers-speak.md @@ -0,0 +1,43 @@ +--- +'@primer/react': major +--- + +Remove components from draft bundle + +* Move UnderlineNav2 (draft) to the main bundle + +```diff +- import {UnderlineNav} from '@primer/react/drafts' ++ import {UnderlineNav} from '@primer/react' +``` + +.... +* Remove TreeView from drafts + +```diff +- import {TreeView} from '@primer/react/drafts' ++ import {TreeView} from '@primer/react' +``` + +* Remove SegmentedControl from drafts + +```diff +- import {SegmentedControl} from '@primer/react/drafts' ++ import {SegmentedControl} from '@primer/react' +``` + +* Remove NavList from drafts + +```diff +- import {NavList} from '@primer/react/drafts' ++ import {NavList} from '@primer/react' +``` + +* Remove SplitPageLayout from drafts + +```diff +- import {SplitPageLayout} from '@primer/react/drafts' ++ import {SplitPageLayout} from '@primer/react' +``` + + diff --git a/docs/components/ThemeReferenceTree.js b/docs/components/ThemeReferenceTree.js index 5391eb8d821..a7366b1c5a1 100644 --- a/docs/components/ThemeReferenceTree.js +++ b/docs/components/ThemeReferenceTree.js @@ -1,6 +1,5 @@ import React, {useState} from 'react' -import {Box, Text} from '@primer/react' -import {TreeView} from '@primer/react/drafts' +import {Box, Text, TreeView} from '@primer/react' export default function ThemeReferenceTree({themeData}) { return ( diff --git a/docs/content/TreeView.mdx b/docs/content/TreeView.mdx index 45c4e9ce6d9..6ffa9d7ae4e 100644 --- a/docs/content/TreeView.mdx +++ b/docs/content/TreeView.mdx @@ -117,7 +117,7 @@ import {TreeView} from '@primer/react' ```jsx import {Link, useMatch, useResolvedPath, navigate} from 'react-router-dom' -import {TreeView} from '@primer/react/drafts' +import {TreeView} from '@primer/react' function TreeLinkItem({id, to, children}) { const resolved = useResolvedPath(to) diff --git a/docs/content/UnderlineNav.mdx b/docs/content/UnderlineNav.mdx index 6d08f5bbe64..6bbf93489c7 100644 --- a/docs/content/UnderlineNav.mdx +++ b/docs/content/UnderlineNav.mdx @@ -1,32 +1,194 @@ --- -componentId: underline_nav title: UnderlineNav +componentId: underline_nav status: Alpha +a11yReviewed: true +description: Use an underlined nav to allow tab like navigation with overflow behaviour in your UI. source: https://github.com/primer/react/tree/main/src/UnderlineNav +storybook: '/react/storybook/?path=/story/components-underlinenav--playground' --- import data from '../../src/UnderlineNav/UnderlineNav.docs.json' -Use the UnderlineNav component to style navigation with a minimal underlined selected state, typically used for navigation placed at the top of the page. +```js +import {UnderlineNav} from '@primer/react' +``` -## Deprecation +## Examples -UnderlineNav is deprecated and will be replaced by the draft `UnderlineNav` in the next major release. See [the draft UnderlineNav's docs](/drafts/UnderlineNav2) for more details. +### Simple -**Attention:** Make sure to properly label your `UnderlineNav` with an `aria-label` to provide context about the type of navigation contained in `UnderlineNav`. +```jsx live drafts + + Code + Issues + Pull Requests + +``` -## Examples +### With Icons -```jsx live - - - Home - - Documentation - Support +```jsx live drafts + + + Code + + + Issues + + + Pull Requests + + Discussions + + Actions + + + Projects + ``` +### Overflow Behaviour + +Component first hides icons if they present to optimize for space and show as many items as possible. If there is still an overflow, it will display the items that don't fit in the `More` menu. + +```javascript noinline live drafts +const Navigation = () => { + const items = [ + {navigation: 'Code', icon: CodeIcon}, + {navigation: 'Issues', icon: IssueOpenedIcon, counter: 120}, + {navigation: 'Pull Requests', icon: GitPullRequestIcon, counter: 13}, + {navigation: 'Discussions', icon: CommentDiscussionIcon, counter: 5}, + {navigation: 'Actions', icon: PlayIcon, counter: 4}, + {navigation: 'Projects', icon: ProjectIcon, counter: 9}, + {navigation: 'Insights', icon: GraphIcon}, + {navigation: 'Settings', icon: GearIcon, counter: 10}, + {navigation: 'Security', icon: ShieldLockIcon}, + ] + const [selectedIndex, setSelectedIndex] = React.useState(0) + return ( + + + {items.map((item, index) => ( + { + setSelectedIndex(index) + e.preventDefault() + }} + counter={item.counter} + > + {item.navigation} + + ))} + + + ) +} +render() +``` + +### Loading State For Counters + +```jsx live drafts + + + Code + + Issues + Pull Requests + +``` + +### With React Router + +```jsx +import {Link, useMatch, useResolvedPath} from 'react-router-dom' +import {UnderlineNav} from '@primer/react' + +function UnderlineNavItem({to, children, ...rest}) { + const resolved = useResolvedPath(to) + const isCurrent = useMatch({path: resolved.pathname, end: true}) + return ( + + {children} + + ) +} + +const Navigation = () => { + return ( + + + Code + + + Issues + + Pull Requests + + ) +} +``` + +### With Next.js + +```jsx +import {useRouter} from 'next/router' +import Link from 'next/link' +import {UnderlineNav} from '@primer/react' + +function UnderlineNavItem({href, children, ...rest}) { + const router = useRouter() + const isCurrent = typeof href === 'string' ? router.asPath === href : router.pathname === href.pathname + return ( + + {children} + + ) +} + +const Navigation = () => { + return ( + + + Code + + + Issues + + Pull Requests + + ) +} +``` + ## Props + +## Status + + diff --git a/docs/content/deprecated/UnderlineNav.mdx b/docs/content/deprecated/UnderlineNav.mdx new file mode 100644 index 00000000000..efecffd117f --- /dev/null +++ b/docs/content/deprecated/UnderlineNav.mdx @@ -0,0 +1,31 @@ +--- +componentId: legacy_underline_nav +title: UnderlineNav (legacy) +status: Deprecated +--- + +import data from '../../../src/deprecated/UnderlineNav/UnderlineNav.docs.json' + +Use the UnderlineNav component to style navigation with a minimal underlined selected state, typically used for navigation placed at the top of the page. + +## Deprecation + +Use [the new version of UnderlineNav](/UnderlineNav) with design and accessibility updates. + +**Attention:** Make sure to properly label your `UnderlineNav` with an `aria-label` to provide context about the type of navigation contained in `UnderlineNav`. + +## Examples + +```jsx live + + + Home + + Documentation + Support + +``` + +## Props + + diff --git a/docs/content/drafts/PageHeader.mdx b/docs/content/drafts/PageHeader.mdx index 94befffe4d0..40891f04462 100644 --- a/docs/content/drafts/PageHeader.mdx +++ b/docs/content/drafts/PageHeader.mdx @@ -162,20 +162,20 @@ import {PageHeader} from '@primer/react/drafts' Pull request title - - + + Conversation - - + + Commits - - + + Checks - - + + Files Changes - - + + ``` diff --git a/docs/content/drafts/UnderlineNav2.mdx b/docs/content/drafts/UnderlineNav2.mdx deleted file mode 100644 index 63d5937497f..00000000000 --- a/docs/content/drafts/UnderlineNav2.mdx +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: UnderlineNav v2 -componentId: underline_nav_2 -status: Draft -a11yReviewed: true -description: Use an underlined nav to allow tab like navigation with overflow behaviour in your UI. -source: https://github.com/primer/react/tree/main/src/UnderlineNav2 -storybook: '/react/storybook/?path=/story/drafts-components-underlinenav--playground' ---- - -import data from '../../../src/UnderlineNav2/UnderlineNav2.docs.json' - -```js -import {UnderlineNav} from '@primer/react/drafts' -``` - -## Examples - -### Simple - -```jsx live drafts - - Code - Issues - Pull Requests - -``` - -### With Icons - -```jsx live drafts - - - Code - - - Issues - - - Pull Requests - - Discussions - - Actions - - - Projects - - -``` - -### Overflow Behaviour - -Component first hides icons if they present to optimize for space and show as many items as possible. If there is still an overflow, it will display the items that don't fit in the `More` menu. - -```javascript noinline live drafts -const Navigation = () => { - const items = [ - {navigation: 'Code', icon: CodeIcon}, - {navigation: 'Issues', icon: IssueOpenedIcon, counter: 120}, - {navigation: 'Pull Requests', icon: GitPullRequestIcon, counter: 13}, - {navigation: 'Discussions', icon: CommentDiscussionIcon, counter: 5}, - {navigation: 'Actions', icon: PlayIcon, counter: 4}, - {navigation: 'Projects', icon: ProjectIcon, counter: 9}, - {navigation: 'Insights', icon: GraphIcon}, - {navigation: 'Settings', icon: GearIcon, counter: 10}, - {navigation: 'Security', icon: ShieldLockIcon}, - ] - const [selectedIndex, setSelectedIndex] = React.useState(0) - return ( - - - {items.map((item, index) => ( - { - setSelectedIndex(index) - e.preventDefault() - }} - counter={item.counter} - > - {item.navigation} - - ))} - - - ) -} -render() -``` - -### Loading State For Counters - -```jsx live drafts - - - Code - - Issues - Pull Requests - -``` - -### With React Router - -```jsx -import {Link, useMatch, useResolvedPath} from 'react-router-dom' -import {UnderlineNav} from '@primer/react/drafts' - -function UnderlineNavItem({to, children, ...rest}) { - const resolved = useResolvedPath(to) - const isCurrent = useMatch({path: resolved.pathname, end: true}) - return ( - - {children} - - ) -} - -const Navigation = () => { - return ( - - - Code - - - Issues - - Pull Requests - - ) -} -``` - -### With Next.js - -```jsx -import {useRouter} from 'next/router' -import Link from 'next/link' -import {UnderlineNav} from '@primer/react/drafts' - -function UnderlineNavItem({href, children, ...rest}) { - const router = useRouter() - const isCurrent = typeof href === 'string' ? router.asPath === href : router.pathname === href.pathname - return ( - - {children} - - ) -} - -const Navigation = () => { - return ( - - - Code - - - Issues - - Pull Requests - - ) -} -``` - -## Props - - - -## Status - - diff --git a/docs/content/theme-reference.mdx b/docs/content/theme-reference.mdx index b9fdf6c7c0b..1821917d7d5 100644 --- a/docs/content/theme-reference.mdx +++ b/docs/content/theme-reference.mdx @@ -3,8 +3,7 @@ title: Theme Reference description: The default theme object for Primer React components --- -import {theme} from '@primer/react' -import {TreeView} from '@primer/react/drafts' +import {theme, TreeView} from '@primer/react' import ThemeReferenceTree from '../components/ThemeReferenceTree' Colors in this theme object are imported from [Primer Primitives](https://primer.style/primitives/colors). diff --git a/docs/src/@primer/gatsby-theme-doctocat/nav.yml b/docs/src/@primer/gatsby-theme-doctocat/nav.yml index 1d72a4742d2..975b34163f6 100644 --- a/docs/src/@primer/gatsby-theme-doctocat/nav.yml +++ b/docs/src/@primer/gatsby-theme-doctocat/nav.yml @@ -162,8 +162,6 @@ url: /drafts/MarkdownEditor - title: MarkdownViewer url: /drafts/MarkdownViewer - - title: UnderlineNav v2 - url: /drafts/UnderlineNav2 - title: PageHeader url: /drafts/PageHeader - title: Hidden @@ -182,3 +180,5 @@ url: /deprecated/FilterList - title: SideNav url: /deprecated/SideNav + - title: UnderlineNav + url: /deprecated/UnderlineNav diff --git a/e2e/components/UnderlineNav--deprecated.test.ts b/e2e/components/UnderlineNav--deprecated.test.ts index c0518ec495e..7e686c49934 100644 --- a/e2e/components/UnderlineNav--deprecated.test.ts +++ b/e2e/components/UnderlineNav--deprecated.test.ts @@ -8,7 +8,7 @@ test.describe('UnderlineNav--deprecated', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'components-underlinenav--default', + id: 'deprecated-components-underlinenav--default', globals: { colorScheme: theme, }, @@ -20,7 +20,7 @@ test.describe('UnderlineNav--deprecated', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'components-underlinenav--default', + id: 'deprecated-components-underlinenav--default', globals: { colorScheme: theme, }, @@ -36,7 +36,7 @@ test.describe('UnderlineNav--deprecated', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'components-underlinenav--playground', + id: 'deprecated-components-underlinenav--playground', globals: { colorScheme: theme, }, @@ -48,7 +48,7 @@ test.describe('UnderlineNav--deprecated', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'components-underlinenav--playground', + id: 'deprecated-components-underlinenav--playground', globals: { colorScheme: theme, }, @@ -64,7 +64,7 @@ test.describe('UnderlineNav--deprecated', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'components-underlinenav-features--actions', + id: 'deprecated-components-underlinenav-features--actions', globals: { colorScheme: theme, }, @@ -76,7 +76,7 @@ test.describe('UnderlineNav--deprecated', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'components-underlinenav-features--actions', + id: 'deprecated-components-underlinenav-features--actions', globals: { colorScheme: theme, }, diff --git a/e2e/components/UnderlineNav.test.ts b/e2e/components/UnderlineNav.test.ts index 341bae11433..84b3ed7ed44 100644 --- a/e2e/components/UnderlineNav.test.ts +++ b/e2e/components/UnderlineNav.test.ts @@ -9,7 +9,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-examples--profile-page', + id: 'components-underlinenav-examples--profile-page', globals: { colorScheme: theme, }, @@ -21,7 +21,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-examples--profile-page', + id: 'components-underlinenav-examples--profile-page', globals: { colorScheme: theme, }, @@ -43,7 +43,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-examples--pull-request-page', + id: 'components-underlinenav-examples--pull-request-page', globals: { colorScheme: theme, }, @@ -55,7 +55,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-examples--pull-request-page', + id: 'components-underlinenav-examples--pull-request-page', globals: { colorScheme: theme, }, @@ -82,7 +82,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-examples--repos-page', + id: 'components-underlinenav-examples--repos-page', globals: { colorScheme: theme, }, @@ -94,7 +94,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-examples--repos-page', + id: 'components-underlinenav-examples--repos-page', globals: { colorScheme: theme, }, @@ -116,7 +116,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--counters-loading-state', + id: 'components-underlinenav-features--counters-loading-state', globals: { colorScheme: theme, }, @@ -128,7 +128,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--counters-loading-state', + id: 'components-underlinenav-features--counters-loading-state', globals: { colorScheme: theme, }, @@ -150,7 +150,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--default', + id: 'components-underlinenav-features--default', globals: { colorScheme: theme, }, @@ -162,7 +162,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--default', + id: 'components-underlinenav-features--default', globals: { colorScheme: theme, }, @@ -184,7 +184,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', globals: { colorScheme: theme, }, @@ -196,7 +196,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', globals: { colorScheme: theme, }, @@ -218,7 +218,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--with-counter-labels', + id: 'components-underlinenav-features--with-counter-labels', globals: { colorScheme: theme, }, @@ -230,7 +230,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--with-counter-labels', + id: 'components-underlinenav-features--with-counter-labels', globals: { colorScheme: theme, }, @@ -252,7 +252,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--with-icons', + id: 'components-underlinenav-features--with-icons', globals: { colorScheme: theme, }, @@ -264,7 +264,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--with-icons', + id: 'components-underlinenav-features--with-icons', globals: { colorScheme: theme, }, @@ -286,7 +286,7 @@ test.describe('UnderlineNav', () => { test.describe(theme, () => { test('Overflow interaction @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', globals: { colorScheme: theme, }, @@ -310,7 +310,7 @@ test.describe('UnderlineNav', () => { test('Hide icons when there is not enough space to display all list items @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', globals: { colorScheme: theme, }, @@ -328,7 +328,7 @@ test.describe('UnderlineNav', () => { test('Keep selected item visible @vrt', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', globals: { colorScheme: theme, }, @@ -376,7 +376,7 @@ test.describe('UnderlineNav', () => { test('axe @aat', async ({page}) => { await visit(page, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', globals: { colorScheme: theme, }, diff --git a/examples/nextjs/src/components/Navigation.js b/examples/nextjs/src/components/Navigation.js index 05663bbc6b3..dcc76073652 100644 --- a/examples/nextjs/src/components/Navigation.js +++ b/examples/nextjs/src/components/Navigation.js @@ -11,7 +11,7 @@ import { ShieldLockIcon, } from '@primer/octicons-react' import React from 'react' -import {UnderlineNav} from '@primer/react/drafts' +import {UnderlineNav} from '@primer/react' import {useRouter} from 'next/router' import Link from 'next/link' diff --git a/script/generate-e2e-tests.js b/script/generate-e2e-tests.js index 00133bdd98b..a9bbb358ff6 100644 --- a/script/generate-e2e-tests.js +++ b/script/generate-e2e-tests.js @@ -1250,35 +1250,35 @@ const components = new Map([ { stories: [ { - id: 'drafts-components-underlinenav-examples--profile-page', + id: 'components-underlinenav-examples--profile-page', name: 'Profile Page', }, { - id: 'drafts-components-underlinenav-examples--pull-request-page', + id: 'components-underlinenav-examples--pull-request-page', name: 'Pull Request Page', }, { - id: 'drafts-components-underlinenav-examples--repos-page', + id: 'components-underlinenav-examples--repos-page', name: 'Repos Page', }, { - id: 'drafts-components-underlinenav-features--counters-loading-state', + id: 'components-underlinenav-features--counters-loading-state', name: 'Counters Loading State', }, { - id: 'drafts-components-underlinenav-features--default', + id: 'components-underlinenav-features--default', name: 'Default', }, { - id: 'drafts-components-underlinenav-features--overflow-template', + id: 'components-underlinenav-features--overflow-template', name: 'Overflow Template', }, { - id: 'drafts-components-underlinenav-features--with-counter-labels', + id: 'components-underlinenav-features--with-counter-labels', name: 'With Counter Labels', }, { - id: 'drafts-components-underlinenav-features--with-icons', + id: 'components-underlinenav-features--with-icons', name: 'With Icons', }, ], @@ -1458,15 +1458,15 @@ const components = new Map([ { stories: [ { - id: 'components-underlinenav--default', + id: 'deprecated-components-underlinenav--default', name: 'Default', }, { - id: 'components-underlinenav--playground', + id: 'deprecated-components-underlinenav--playground', name: 'Playground', }, { - id: 'components-underlinenav-features--actions', + id: 'deprecated-components-underlinenav-features--actions', name: 'Actions', }, ], diff --git a/src/PageHeader/PageHeader.examples.stories.tsx b/src/PageHeader/PageHeader.examples.stories.tsx index 18435daae55..0ffbeed35c1 100644 --- a/src/PageHeader/PageHeader.examples.stories.tsx +++ b/src/PageHeader/PageHeader.examples.stories.tsx @@ -14,7 +14,7 @@ import { import {PageHeader} from './PageHeader' import {Hidden} from '../Hidden' -import {UnderlineNav} from '../UnderlineNav2' +import {UnderlineNav} from '../UnderlineNav' const meta: Meta = { title: 'Drafts/Components/PageHeader/Examples', diff --git a/src/PageHeader/PageHeader.features.stories.tsx b/src/PageHeader/PageHeader.features.stories.tsx index 3c56b9f7a5a..dd53d63727d 100644 --- a/src/PageHeader/PageHeader.features.stories.tsx +++ b/src/PageHeader/PageHeader.features.stories.tsx @@ -1,6 +1,6 @@ import React from 'react' import {Meta} from '@storybook/react' -import {IconButton, Breadcrumbs, Text, Link, Button, Box, Label, UnderlineNav2} from '..' +import {IconButton, Breadcrumbs, Text, Link, Button, Box, Label, UnderlineNav} from '..' import { PencilIcon, SidebarExpandIcon, @@ -147,20 +147,20 @@ export const WithNavigationSlot = () => ( Pull request title - - + + Conversation - - + + Commits - - + + Checks - - + + Files Changes - - + + diff --git a/src/PageHeader/PageHeader.stories.tsx b/src/PageHeader/PageHeader.stories.tsx index bb4fbd8332b..5762e7090fa 100644 --- a/src/PageHeader/PageHeader.stories.tsx +++ b/src/PageHeader/PageHeader.stories.tsx @@ -1,7 +1,7 @@ import React from 'react' import {Meta, Story} from '@storybook/react' import {Button, IconButton, Breadcrumbs, Link, Text, StateLabel, BranchName, Box} from '..' -import {UnderlineNav} from '../UnderlineNav2' +import {UnderlineNav} from '../UnderlineNav' import Label from '../Label' import { KebabHorizontalIcon, diff --git a/src/UnderlineNav2/LoadingCounter.tsx b/src/UnderlineNav/LoadingCounter.tsx similarity index 100% rename from src/UnderlineNav2/LoadingCounter.tsx rename to src/UnderlineNav/LoadingCounter.tsx diff --git a/src/UnderlineNav2/UnderlineNav.Item.stories.tsx b/src/UnderlineNav/UnderlineNav.Item.stories.tsx similarity index 94% rename from src/UnderlineNav2/UnderlineNav.Item.stories.tsx rename to src/UnderlineNav/UnderlineNav.Item.stories.tsx index 109fc393589..1680fe134a0 100644 --- a/src/UnderlineNav2/UnderlineNav.Item.stories.tsx +++ b/src/UnderlineNav/UnderlineNav.Item.stories.tsx @@ -6,7 +6,7 @@ import {CodeIcon, GitPullRequestIcon, PeopleIcon} from '@primer/octicons-react' import {OcticonArgType} from '../utils/story-helpers' export default { - title: 'Drafts/Components/UnderlineNav/UnderlineNav.Item', + title: 'Components/UnderlineNav/UnderlineNav.Item', component: UnderlineNavItem, decorators: [ Story => { diff --git a/src/UnderlineNav2/UnderlineNav.devonly.stories.tsx b/src/UnderlineNav/UnderlineNav.devonly.stories.tsx similarity index 90% rename from src/UnderlineNav2/UnderlineNav.devonly.stories.tsx rename to src/UnderlineNav/UnderlineNav.devonly.stories.tsx index e1e6fcd3824..92271cd3330 100644 --- a/src/UnderlineNav2/UnderlineNav.devonly.stories.tsx +++ b/src/UnderlineNav/UnderlineNav.devonly.stories.tsx @@ -3,7 +3,7 @@ import {Meta} from '@storybook/react' import {UnderlineNav} from './index' export default { - title: 'Drafts/Components/UnderlineNav/DevOnly', + title: 'Components/UnderlineNav/DevOnly', } as Meta export const IllegalState = () => { diff --git a/src/UnderlineNav/UnderlineNav.docs.json b/src/UnderlineNav/UnderlineNav.docs.json index 349c1d6b8a0..33f307eb029 100644 --- a/src/UnderlineNav/UnderlineNav.docs.json +++ b/src/UnderlineNav/UnderlineNav.docs.json @@ -1,29 +1,34 @@ { - "id": "underline_nav", + "id": "drafts_underline_nav2", "name": "UnderlineNav", - "status": "alpha", - "a11yReviewed": false, + "status": "draft", + "a11yReviewed": true, "stories": [], "props": [ { - "name": "actions", - "type": "React.ReactNode", - "description": "Place another element, such as a button, to the opposite side of the navigation items." + "name": "afterSelect", + "type": "(event) => void", + "defaultValue": "", + "description": "The handler that gets called when a nav link child is selected" }, { - "name": "align", - "type": "'right'", - "description": "Use `right` to have navigation items aligned right." + "name": "aria-label", + "type": "string", + "defaultValue": "", + "description": "A unique name for the rendered 'nav' landmark. It will also be used to label the arrow\nbuttons that control the scroll behaviour on coarse pointer devices. (I.e.\n'Scroll ${aria-label} left/right')\n" }, { - "name": "full", - "type": "boolean", - "description": "Used to make navigation fill the width of the container." + "name": "children", + "type": "UnderlineNav.Item[]", + "defaultValue": "", + "required": true, + "description": "" }, { - "name": "aria-label", - "type": "string", - "description": "Used to set the `aria-label` on the top level `