Skip to content

Commit 2d1fba8

Browse files
committed
rebase and add modifiers to toolbar
1 parent ea9e15f commit 2d1fba8

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

packages/react-core/src/components/Masthead/__tests__/__snapshots__/Masthead.test.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ exports[`Masthead verify inset2xl inset breakpoints 1`] = `
9393
}
9494
>
9595
<header
96-
className="pf-c-masthead"
96+
className="pf-c-masthead pf-m-inset-2xl pf-m-inset-2xl-on-sm pf-m-inset-2xl-on-md pf-m-inset-2xl-on-lg pf-m-inset-2xl-on-xl pf-m-inset-2xl-on-2xl"
9797
>
9898
test
9999
</header>
@@ -135,7 +135,7 @@ exports[`Masthead verify insetLg inset breakpoints 1`] = `
135135
}
136136
>
137137
<header
138-
className="pf-c-masthead"
138+
className="pf-c-masthead pf-m-inset-lg pf-m-inset-lg-on-sm pf-m-inset-lg-on-md pf-m-inset-lg-on-lg pf-m-inset-lg-on-xl pf-m-inset-lg-on-2xl"
139139
>
140140
test
141141
</header>
@@ -156,7 +156,7 @@ exports[`Masthead verify insetMd inset breakpoints 1`] = `
156156
}
157157
>
158158
<header
159-
className="pf-c-masthead"
159+
className="pf-c-masthead pf-m-inset-md pf-m-inset-md-on-sm pf-m-inset-md-on-md pf-m-inset-md-on-lg pf-m-inset-md-on-xl pf-m-inset-md-on-2xl"
160160
>
161161
test
162162
</header>
@@ -177,7 +177,7 @@ exports[`Masthead verify insetNone inset breakpoints 1`] = `
177177
}
178178
>
179179
<header
180-
className="pf-c-masthead"
180+
className="pf-c-masthead pf-m-inset-none pf-m-inset-none-on-sm pf-m-inset-none-on-md pf-m-inset-none-on-lg pf-m-inset-none-on-xl pf-m-inset-none-on-2xl"
181181
>
182182
test
183183
</header>
@@ -198,7 +198,7 @@ exports[`Masthead verify insetSm inset breakpoints 1`] = `
198198
}
199199
>
200200
<header
201-
className="pf-c-masthead"
201+
className="pf-c-masthead pf-m-inset-sm pf-m-inset-sm-on-sm pf-m-inset-sm-on-md pf-m-inset-sm-on-lg pf-m-inset-sm-on-xl pf-m-inset-sm-on-2xl"
202202
>
203203
test
204204
</header>
@@ -219,7 +219,7 @@ exports[`Masthead verify insetXl inset breakpoints 1`] = `
219219
}
220220
>
221221
<header
222-
className="pf-c-masthead"
222+
className="pf-c-masthead pf-m-inset-xl pf-m-inset-xl-on-sm pf-m-inset-xl-on-md pf-m-inset-xl-on-lg pf-m-inset-xl-on-xl pf-m-inset-xl-on-2xl"
223223
>
224224
test
225225
</header>

packages/react-core/src/components/Toolbar/Toolbar.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export interface ToolbarProps extends React.HTMLProps<HTMLDivElement>, OUIAProps
2424
children?: React.ReactNode;
2525
/** Id of the data toolbar */
2626
id?: string;
27+
/** Flag indicating the toolbar height should expand to the full height of the container */
28+
isFullHeight?: boolean;
29+
/** Flag indicating the toolbar is static */
30+
isStatic?: boolean;
2731
/** Flag indicating the toolbar should use the Page insets */
2832
usePageInsets?: boolean;
2933
/** Insets at various breakpoints. */
@@ -113,6 +117,8 @@ export class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
113117
toggleIsExpanded,
114118
className,
115119
children,
120+
isFullHeight,
121+
isStatic,
116122
inset,
117123
usePageInsets,
118124
ouiaId,
@@ -130,6 +136,8 @@ export class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
130136
<div
131137
className={css(
132138
styles.toolbar,
139+
isFullHeight && styles.modifiers.fullHeight,
140+
isStatic && styles.modifiers.static,
133141
usePageInsets && styles.modifiers.pageInsets,
134142
formatBreakpointMods(inset, styles),
135143
className

packages/react-core/src/demos/Masthead.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class BasicMasthead extends React.Component {
149149
</MastheadBrand>
150150
</MastheadMain>
151151
<MastheadContent>
152-
<Toolbar id="toolbar">
152+
<Toolbar id="toolbar" isFullHeight isStatic>
153153
<ToolbarContent>
154154
<ToolbarItem>
155155
<ContextSelector

0 commit comments

Comments
 (0)