Skip to content

Commit

Permalink
Export PageLayout from main bundle (#1882)
Browse files Browse the repository at this point in the history
* Export PageLayout from main bundle

* Create odd-apes-guess.md

* Add PageLayout to sidenav

* Update .changeset/odd-apes-guess.md

Co-authored-by: Rez <rezrah@github.com>

* Update PageLayout docs

Co-authored-by: Rez <rezrah@github.com>
  • Loading branch information
colebemis and rezrah authored Feb 24, 2022
1 parent 310e655 commit df75752
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
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

0 comments on commit df75752

Please sign in to comment.