Skip to content

Export PageLayout from main bundle #1882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 24, 2022
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
12 changes: 12 additions & 0 deletions .changeset/odd-apes-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@primer/react": major
---

`PageLayout` is being graduated from the `drafts` bundle to the `main` bundle.

To upgrade, rewrite your imports accordingly:

```diff
- import {PageLayout} from '@primer/react/drafts'
+ import {PageLayout} from '@primer/react'
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ storybook: https://primer.style/react/storybook?path=/story/layout-pagelayout--p
---

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

## Examples
Expand All @@ -20,7 +20,7 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo

### Default

```jsx live drafts
```jsx live
<PageLayout>
<PageLayout.Header>
<Placeholder label="Header" height={64} />
Expand All @@ -39,7 +39,7 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo

### With dividers

```jsx live drafts
```jsx live
<PageLayout>
<PageLayout.Header divider="line">
<Placeholder label="Header" height={64} />
Expand All @@ -58,7 +58,7 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo

### With pane on left

```jsx live drafts
```jsx live
<PageLayout>
<PageLayout.Header>
<Placeholder label="Header" height={64} />
Expand All @@ -77,7 +77,7 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo

### With condensed spacing

```jsx live drafts
```jsx live
<PageLayout padding="condensed" rowGap="condensed" columnGap="condensed">
<PageLayout.Header>
<Placeholder label="Header" height={64} />
Expand All @@ -96,7 +96,7 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo

### Without header or footer

```jsx live drafts
```jsx live
<PageLayout>
<PageLayout.Content>
<Placeholder label="Content" height={240} />
Expand Down
2 changes: 2 additions & 0 deletions docs/src/@primer/gatsby-theme-doctocat/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
url: /Overlay
- title: Pagehead
url: /Pagehead
- title: PageLayout
url: /PageLayout
- title: Pagination
url: /Pagination
- title: PointerBox
Expand Down
1 change: 0 additions & 1 deletion src/drafts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ export * from '../Button2'
export * from '../ActionMenu2'
export * from '../DropdownMenu2'
export * from '../Label2'
export * from '../PageLayout'
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ export type {ThemeProviderProps} from './ThemeProvider'
// Layout
export {default as Box} from './Box'
export type {BoxProps} from './Box'
export {PageLayout} from './PageLayout'
export type {
PageLayoutProps,
PageLayoutHeaderProps,
PageLayoutContentProps,
PageLayoutPaneProps,
PageLayoutFooterProps
} from './PageLayout'

// Hooks
export {default as useDetails} from './hooks/useDetails'
Expand Down