@@ -8,9 +8,17 @@ import compassBackgroundImageDark from '@patternfly/react-tokens/dist/esm/c_comp
88export interface CompassProps extends React . HTMLProps < HTMLDivElement > {
99 /** Additional classes added to the Compass. */
1010 className ?: string ;
11+ /** The horizontal masthead content (e.g. <Masthead />). This masthead will only render when dock content is passed and only at mobile viewports. */
12+ masthead ?: React . ReactNode ;
1113 /** Content of the docked navigation area of the layout */
1214 dock ?: React . ReactNode ;
13- /** Content placed at the top of the layout */
15+ /** @beta Flag indicating the docked nav is expanded on mobile. Only applies when dock content is passed. */
16+ isDockExpanded ?: boolean ;
17+ /** @beta Flag indicating the docked nav should display text on desktop. Only applies when dock content is passed, and
18+ * will handle toggling the visibility of the text in individual isDocked components.
19+ */
20+ isDockTextExpanded ?: boolean ;
21+ /** Content placed at the top of the compass layout */
1422 header ?: React . ReactNode ;
1523 /** Flag indicating if the header is expanded */
1624 isHeaderExpanded ?: boolean ;
@@ -40,7 +48,10 @@ export interface CompassProps extends React.HTMLProps<HTMLDivElement> {
4048
4149export const Compass : React . FunctionComponent < CompassProps > = ( {
4250 className,
51+ masthead,
4352 dock,
53+ isDockExpanded,
54+ isDockTextExpanded,
4455 header,
4556 isHeaderExpanded = true ,
4657 sidebarStart,
@@ -72,7 +83,18 @@ export const Compass: React.FunctionComponent<CompassProps> = ({
7283 { ...props }
7384 style = { { ...props . style , ...backgroundImageStyles } }
7485 >
75- { dock && < div className = { css ( `${ styles . compass } __dock` ) } > { dock } </ div > }
86+ { dock && masthead }
87+ { dock && (
88+ < div
89+ className = { css (
90+ `${ styles . compass } __dock` ,
91+ isDockExpanded && styles . modifiers . expanded ,
92+ isDockTextExpanded && styles . modifiers . textExpanded
93+ ) }
94+ >
95+ { dock }
96+ </ div >
97+ ) }
7698 { header && (
7799 < div
78100 className = { css ( styles . compassHeader , isHeaderExpanded && 'pf-m-expanded' ) }
0 commit comments