diff --git a/.changeset/fast-countries-remain.md b/.changeset/fast-countries-remain.md new file mode 100644 index 00000000000..221132c666e --- /dev/null +++ b/.changeset/fast-countries-remain.md @@ -0,0 +1,5 @@ +--- +"@primer/react": major +--- + +v38: Move Banner to main export diff --git a/e2e/components/Banner.test.ts b/e2e/components/Banner.test.ts index 44d13bbbb5e..97f10fd7f50 100644 --- a/e2e/components/Banner.test.ts +++ b/e2e/components/Banner.test.ts @@ -6,68 +6,68 @@ import {viewports} from '../test-helpers/viewports' const stories: Array<{title: string; id: string; viewports?: Array}> = [ { title: 'Default', - id: 'experimental-components-banner--default', + id: 'components-banner--default', viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], }, { title: 'Critical', - id: 'experimental-components-banner-features--critical', + id: 'components-banner-features--critical', }, { title: 'Dismiss', - id: 'experimental-components-banner-features--dismiss', + id: 'components-banner-features--dismiss', }, { title: 'Dismiss With Actions', - id: 'experimental-components-banner-features--dismiss-with-actions', + id: 'components-banner-features--dismiss-with-actions', }, { title: 'Info', - id: 'experimental-components-banner-features--info', + id: 'components-banner-features--info', }, { title: 'Success', - id: 'experimental-components-banner-features--success', + id: 'components-banner-features--success', }, { title: 'Upsell', - id: 'experimental-components-banner-features--upsell', + id: 'components-banner-features--upsell', }, { title: 'Warning', - id: 'experimental-components-banner-features--warning', + id: 'components-banner-features--warning', }, { title: 'WithActions', - id: 'experimental-components-banner-features--with-actions', + id: 'components-banner-features--with-actions', viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], }, { title: 'WithHiddenTitle', - id: 'experimental-components-banner-features--with-hidden-title', + id: 'components-banner-features--with-hidden-title', }, { title: 'WithHiddenTitleAndActions', - id: 'experimental-components-banner-features--with-hidden-title-and-actions', + id: 'components-banner-features--with-hidden-title-and-actions', viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], }, { title: 'DismissibleWithHiddenTitleAndActions', - id: 'experimental-components-banner-features--dismissible-with-hidden-title-and-actions', + id: 'components-banner-features--dismissible-with-hidden-title-and-actions', viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], }, { title: 'DismissibleWithHiddenTitleAndSecondaryAction', - id: 'experimental-components-banner-features--dismissible-with-hidden-title-and-secondary-action', + id: 'components-banner-features--dismissible-with-hidden-title-and-secondary-action', viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], }, { title: 'InSidebar', - id: 'experimental-components-banner-examples--in-sidebar', + id: 'components-banner-examples--in-sidebar', }, { title: 'Multiline', - id: 'experimental-components-banner-examples--multiline', + id: 'components-banner-examples--multiline', viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], }, ] diff --git a/packages/react/src/Banner/Banner.docs.json b/packages/react/src/Banner/Banner.docs.json index 5d132979d17..a527b3465e7 100644 --- a/packages/react/src/Banner/Banner.docs.json +++ b/packages/react/src/Banner/Banner.docs.json @@ -3,52 +3,52 @@ "name": "Banner", "status": "alpha", "a11yReviewed": "2025-01-08", - "importPath": "@primer/react/experimental", + "importPath": "@primer/react", "stories": [ { - "id": "experimental-components-banner--default" + "id": "components-banner--default" }, { - "id": "experimental-components-banner-features--critical" + "id": "components-banner-features--critical" }, { - "id": "experimental-components-banner-features--info" + "id": "components-banner-features--info" }, { - "id": "experimental-components-banner-features--success" + "id": "components-banner-features--success" }, { - "id": "experimental-components-banner-features--upsell" + "id": "components-banner-features--upsell" }, { - "id": "experimental-components-banner-features--warning" + "id": "components-banner-features--warning" }, { - "id": "experimental-components-banner-features--dismiss" + "id": "components-banner-features--dismiss" }, { - "id": "experimental-components-banner-features--dismiss-with-actions" + "id": "components-banner-features--dismiss-with-actions" }, { - "id": "experimental-components-banner-features--with-hidden-title" + "id": "components-banner-features--with-hidden-title" }, { - "id": "experimental-components-banner-features--with-hidden-title-and-actions" + "id": "components-banner-features--with-hidden-title-and-actions" }, { - "id": "experimental-components-banner-features--dismissible-with-hidden-title-and-actions" + "id": "components-banner-features--dismissible-with-hidden-title-and-actions" }, { - "id": "experimental-components-banner-features--dismissible-with-hidden-title-and-secondary-action" + "id": "components-banner-features--dismissible-with-hidden-title-and-secondary-action" }, { - "id": "experimental-components-banner-features--with-actions" + "id": "components-banner-features--with-actions" }, { - "id": "experimental-components-banner-features--custom-icon" + "id": "components-banner-features--custom-icon" }, { - "id": "experimental-components-banner-examples--with-announcement" + "id": "components-banner-examples--with-announcement" } ], "props": [ diff --git a/packages/react/src/Banner/Banner.examples.stories.tsx b/packages/react/src/Banner/Banner.examples.stories.tsx index f487a3bb6bb..e2282fcb9d8 100644 --- a/packages/react/src/Banner/Banner.examples.stories.tsx +++ b/packages/react/src/Banner/Banner.examples.stories.tsx @@ -12,7 +12,7 @@ import {useFocus} from '../internal/hooks/useFocus' import {PageLayout} from '../PageLayout' const meta = { - title: 'Experimental/Components/Banner/Examples', + title: 'Components/Banner/Examples', component: Banner, } satisfies Meta diff --git a/packages/react/src/Banner/Banner.features.stories.tsx b/packages/react/src/Banner/Banner.features.stories.tsx index 24edfc027af..3b9ffbe8829 100644 --- a/packages/react/src/Banner/Banner.features.stories.tsx +++ b/packages/react/src/Banner/Banner.features.stories.tsx @@ -5,7 +5,7 @@ import {Banner} from '../Banner' import Link from '../Link' const meta = { - title: 'Experimental/Components/Banner/Features', + title: 'Components/Banner/Features', component: Banner, } satisfies Meta diff --git a/packages/react/src/Banner/Banner.figma.tsx b/packages/react/src/Banner/Banner.figma.tsx index 4d37825e424..6b0ea658c27 100644 --- a/packages/react/src/Banner/Banner.figma.tsx +++ b/packages/react/src/Banner/Banner.figma.tsx @@ -1,4 +1,4 @@ -import {Banner} from '../../src/experimental/' +import {Banner} from '../../src/' import figma from '@figma/code-connect' const componentProps = { diff --git a/packages/react/src/Banner/Banner.stories.tsx b/packages/react/src/Banner/Banner.stories.tsx index e8c60aa7026..4a52e80cf63 100644 --- a/packages/react/src/Banner/Banner.stories.tsx +++ b/packages/react/src/Banner/Banner.stories.tsx @@ -5,7 +5,7 @@ import {PageLayout} from '../PageLayout' import {action} from 'storybook/actions' const meta = { - title: 'Experimental/Components/Banner', + title: 'Components/Banner', component: Banner, } satisfies Meta diff --git a/packages/react/src/Button/Button.examples.stories.tsx b/packages/react/src/Button/Button.examples.stories.tsx index 34261b60616..b3401ef6577 100644 --- a/packages/react/src/Button/Button.examples.stories.tsx +++ b/packages/react/src/Button/Button.examples.stories.tsx @@ -2,7 +2,7 @@ import React from 'react' import type {Meta} from '@storybook/react-vite' import {Button} from '.' import {DownloadIcon} from '@primer/octicons-react' -import {Banner} from '../experimental' +import {Banner} from '../Banner' import {AriaStatus, AriaAlert} from '../live-region' const meta: Meta = { diff --git a/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap index c7db44a1990..67c307ac4c9 100644 --- a/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap @@ -27,6 +27,8 @@ exports[`@primer/react > should not update exports without a semver change 1`] = "type AvatarProps", "AvatarStack", "type AvatarStackProps", + "Banner", + "type BannerProps", "BaseStyles", "type BaseStylesProps", "type BetterCssProperties", @@ -255,8 +257,6 @@ exports[`@primer/react/experimental > should not update exports without a semver "type AriaAlertProps", "AriaStatus", "type AriaStatusProps", - "Banner", - "type BannerProps", "Blankslate", "type BlankslateProps", "ButtonBase", diff --git a/packages/react/src/experimental/index.ts b/packages/react/src/experimental/index.ts index eac14c85f6e..d4eca5848d6 100644 --- a/packages/react/src/experimental/index.ts +++ b/packages/react/src/experimental/index.ts @@ -14,9 +14,6 @@ export type {BlankslateProps} from '../Blankslate' export {ButtonBase} from '../Button' export type {ButtonBaseProps} from '../Button' -export {Banner} from '../Banner' -export type {BannerProps} from '../Banner' - export {DataTable, Table, createColumnHelper} from '../DataTable' export type { DataTableProps, diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index a1e066b265d..6f7e27d7a2e 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -74,6 +74,8 @@ export {default as Avatar} from './Avatar' export type {AvatarProps} from './Avatar' export {default as AvatarStack} from './AvatarStack' export type {AvatarStackProps} from './AvatarStack' +export {Banner} from './Banner' +export type {BannerProps} from './Banner' export {default as BranchName} from './BranchName' export type {BranchNameProps} from './BranchName'