@@ -3,11 +3,13 @@ import {
33 type PageHeaderProps as PrimerPageHeaderProps ,
44 type PageHeaderTitleProps as PrimerPageHeaderTitleProps ,
55 type PageHeaderActionsProps as PrimerPageHeaderActionsProps ,
6+ type PageHeaderTitleAreaProps as PrimerPageHeaderTitleAreaProps ,
67} from '@primer/react'
78import styled from 'styled-components'
89import { sx , type SxProp } from '../sx'
910import type { ForwardRefComponent } from '../polymorphic'
1011import { Box } from './Box'
12+ import type { PropsWithChildren } from 'react'
1113
1214type PageHeaderProps = PrimerPageHeaderProps & SxProp
1315
@@ -35,7 +37,7 @@ function PageHeaderActions({sx, ...rest}: PageHeaderActionsProps) {
3537 return < Box { ...rest } as = { PrimerPageHeader . Actions } style = { style } sx = { sx } />
3638}
3739
38- type PageHeaderTitleProps = PrimerPageHeaderTitleProps & SxProp
40+ type PageHeaderTitleProps = PropsWithChildren < PrimerPageHeaderTitleProps > & SxProp
3941
4042type CSSCustomProperties = {
4143 [ key : `--${string } `] : string | number
@@ -63,9 +65,29 @@ function PageHeaderTitle({sx, ...rest}: PageHeaderTitleProps) {
6365 return < Box { ...rest } as = { PrimerPageHeader . Title } style = { style } sx = { sx } />
6466}
6567
68+ type PageHeaderTitleAreaProps = PropsWithChildren < PrimerPageHeaderTitleAreaProps > & SxProp
69+
70+ const PageHeaderTitleArea : ForwardRefComponent < 'div' , PageHeaderTitleAreaProps > = styled (
71+ PrimerPageHeader . TitleArea ,
72+ ) . withConfig < PageHeaderTitleAreaProps > ( {
73+ shouldForwardProp : prop => prop !== 'sx' ,
74+ } ) `
75+ ${ sx }
76+ `
77+
6678const PageHeader = Object . assign ( PageHeaderImpl , {
6779 Actions : PageHeaderActions ,
6880 Title : PageHeaderTitle ,
81+ TitleArea : PageHeaderTitleArea ,
82+ ContextArea : PrimerPageHeader . ContextArea ,
83+ ContextAreaActions : PrimerPageHeader . ContextAreaActions ,
84+ TrailingVisual : PrimerPageHeader . TrailingVisual ,
85+ Description : PrimerPageHeader . Description ,
86+ ContextBar : PrimerPageHeader . ContextBar ,
87+ LeadingAction : PrimerPageHeader . LeadingAction ,
88+ Breadcrumbs : PrimerPageHeader . Breadcrumbs ,
89+ LeadingVisual : PrimerPageHeader . LeadingVisual ,
90+ TrailingAction : PrimerPageHeader . TrailingAction ,
6991} )
7092
7193export { PageHeader }
0 commit comments