@patternfly/react-core 6.5.0-prerelease.21 → 6.5.0-prerelease.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Compass/package.json +1 -1
- package/dist/dynamic/components/Content/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hero/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Tile/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +8 -0
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +4 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/Compass/Compass.d.ts +5 -3
- package/dist/esm/components/Compass/Compass.d.ts.map +1 -1
- package/dist/esm/components/Compass/Compass.js +3 -3
- package/dist/esm/components/Compass/Compass.js.map +1 -1
- package/dist/esm/components/Compass/CompassContent.d.ts +1 -1
- package/dist/esm/components/Compass/CompassContent.js +1 -1
- package/dist/esm/components/Compass/CompassContent.js.map +1 -1
- package/dist/esm/components/Compass/CompassMainHeader.d.ts +4 -4
- package/dist/esm/components/Compass/CompassMainHeaderContent.d.ts +2 -2
- package/dist/esm/components/Compass/CompassMainHeaderTitle.d.ts +2 -2
- package/dist/esm/components/Compass/CompassMainHeaderToolbar.d.ts +2 -2
- package/dist/esm/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js +7 -1
- package/dist/esm/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/esm/components/Form/FormGroup.d.ts.map +1 -1
- package/dist/esm/components/Form/FormGroup.js +1 -1
- package/dist/esm/components/Form/FormGroup.js.map +1 -1
- package/dist/esm/components/Masthead/Masthead.d.ts +2 -0
- package/dist/esm/components/Masthead/Masthead.d.ts.map +1 -1
- package/dist/esm/components/Masthead/Masthead.js +2 -2
- package/dist/esm/components/Masthead/Masthead.js.map +1 -1
- package/dist/esm/components/Nav/Nav.d.ts +2 -2
- package/dist/esm/components/Nav/Nav.d.ts.map +1 -1
- package/dist/esm/components/Nav/Nav.js +1 -1
- package/dist/esm/components/Nav/Nav.js.map +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts +5 -1
- package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavItem.js +8 -6
- package/dist/esm/components/Nav/NavItem.js.map +1 -1
- package/dist/esm/components/Page/Page.d.ts +2 -0
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/Page.js +3 -3
- package/dist/esm/components/Page/Page.js.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.js +2 -2
- package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavInternal.js +3 -3
- package/dist/esm/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +8 -0
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +4 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/Compass/Compass.d.ts +5 -3
- package/dist/js/components/Compass/Compass.d.ts.map +1 -1
- package/dist/js/components/Compass/Compass.js +3 -3
- package/dist/js/components/Compass/Compass.js.map +1 -1
- package/dist/js/components/Compass/CompassContent.d.ts +1 -1
- package/dist/js/components/Compass/CompassContent.js +1 -1
- package/dist/js/components/Compass/CompassContent.js.map +1 -1
- package/dist/js/components/Compass/CompassMainHeader.d.ts +4 -4
- package/dist/js/components/Compass/CompassMainHeaderContent.d.ts +2 -2
- package/dist/js/components/Compass/CompassMainHeaderTitle.d.ts +2 -2
- package/dist/js/components/Compass/CompassMainHeaderToolbar.d.ts +2 -2
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts.map +1 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js +7 -1
- package/dist/js/components/Drawer/DrawerPanelContent.js.map +1 -1
- package/dist/js/components/Form/FormGroup.d.ts.map +1 -1
- package/dist/js/components/Form/FormGroup.js +1 -1
- package/dist/js/components/Form/FormGroup.js.map +1 -1
- package/dist/js/components/Masthead/Masthead.d.ts +2 -0
- package/dist/js/components/Masthead/Masthead.d.ts.map +1 -1
- package/dist/js/components/Masthead/Masthead.js +2 -2
- package/dist/js/components/Masthead/Masthead.js.map +1 -1
- package/dist/js/components/Nav/Nav.d.ts +2 -2
- package/dist/js/components/Nav/Nav.d.ts.map +1 -1
- package/dist/js/components/Nav/Nav.js +1 -1
- package/dist/js/components/Nav/Nav.js.map +1 -1
- package/dist/js/components/Nav/NavItem.d.ts +5 -1
- package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/js/components/Nav/NavItem.js +7 -6
- package/dist/js/components/Nav/NavItem.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts +2 -0
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/Page.js +3 -3
- package/dist/js/components/Page/Page.js.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.js +2 -2
- package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavInternal.js +3 -3
- package/dist/js/components/Wizard/WizardNavInternal.js.map +1 -1
- package/dist/umd/assets/{output-Bhl00hr4.css → output-ClqppqYH.css} +16187 -15964
- package/dist/umd/react-core.min.js +5 -5
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +7 -7
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +16 -1
- package/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx +72 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopy.test.tsx.snap +1 -1
- package/src/components/Compass/Compass.tsx +46 -30
- package/src/components/Compass/CompassContent.tsx +2 -2
- package/src/components/Compass/CompassMainHeader.tsx +4 -4
- package/src/components/Compass/CompassMainHeaderContent.tsx +2 -2
- package/src/components/Compass/CompassMainHeaderTitle.tsx +2 -2
- package/src/components/Compass/CompassMainHeaderToolbar.tsx +2 -2
- package/src/components/Compass/__tests__/Compass.test.tsx +10 -0
- package/src/components/Compass/__tests__/__snapshots__/Compass.test.tsx.snap +1 -1
- package/src/components/Compass/__tests__/__snapshots__/CompassContent.test.tsx.snap +1 -1
- package/src/components/Compass/examples/Compass.md +16 -15
- package/src/components/Compass/examples/CompassDockLayout.tsx +25 -0
- package/src/components/Compass/examples/compass.css +16 -4
- package/src/components/Drawer/DrawerPanelContent.tsx +7 -0
- package/src/components/Drawer/__tests__/DrawerPanelContent.test.tsx +20 -0
- package/src/components/Drawer/__tests__/Generated/__snapshots__/DrawerPanelContent.test.tsx.snap +1 -0
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap +2 -0
- package/src/components/Drawer/examples/Drawer.md +1 -1
- package/src/components/Drawer/examples/DrawerAdditionalSectionAboveContent.tsx +1 -1
- package/src/components/Drawer/examples/DrawerBasic.tsx +1 -1
- package/src/components/Drawer/examples/DrawerBasicInline.tsx +1 -1
- package/src/components/Drawer/examples/DrawerBasicPill.tsx +1 -1
- package/src/components/Drawer/examples/DrawerBreakpoint.tsx +1 -1
- package/src/components/Drawer/examples/DrawerInlinePanelEnd.tsx +1 -1
- package/src/components/Drawer/examples/DrawerInlinePanelStart.tsx +1 -1
- package/src/components/Drawer/examples/DrawerModifiedContentPadding.tsx +1 -1
- package/src/components/Drawer/examples/DrawerModifiedPanelPadding.tsx +1 -1
- package/src/components/Drawer/examples/DrawerPanelBottom.tsx +1 -1
- package/src/components/Drawer/examples/DrawerPanelEnd.tsx +1 -1
- package/src/components/Drawer/examples/DrawerPanelStart.tsx +1 -1
- package/src/components/Drawer/examples/DrawerPillInline.tsx +1 -1
- package/src/components/Drawer/examples/DrawerResizableAtEnd.tsx +1 -1
- package/src/components/Drawer/examples/DrawerResizableAtStart.tsx +1 -1
- package/src/components/Drawer/examples/DrawerResizableOnBottom.tsx +1 -1
- package/src/components/Drawer/examples/DrawerResizableOnInline.tsx +1 -1
- package/src/components/Drawer/examples/DrawerStatic.tsx +1 -1
- package/src/components/Dropdown/examples/Dropdown.md +13 -1
- package/src/components/Dropdown/examples/DropdownWithSplit.tsx +97 -0
- package/src/components/Form/FormGroup.tsx +1 -2
- package/src/components/Form/__tests__/__snapshots__/FormGroup.test.tsx.snap +1 -1
- package/src/components/LoginPage/__tests__/__snapshots__/LoginForm.test.tsx.snap +6 -6
- package/src/components/Masthead/Masthead.tsx +4 -0
- package/src/components/Masthead/__tests__/Masthead.test.tsx +25 -1
- package/src/components/Nav/Nav.tsx +3 -2
- package/src/components/Nav/NavItem.tsx +27 -3
- package/src/components/Nav/__tests__/Nav.test.tsx +15 -0
- package/src/components/Page/Page.tsx +5 -1
- package/src/components/Page/__tests__/Page.test.tsx +17 -0
- package/src/components/Toolbar/Toolbar.tsx +4 -0
- package/src/components/Toolbar/__tests__/Toolbar.test.tsx +34 -1
- package/src/components/Wizard/WizardNavInternal.tsx +3 -3
- package/src/components/Wizard/__tests__/Wizard.test.tsx +39 -0
- package/src/demos/Compass/Compass.md +40 -0
- package/src/demos/Compass/examples/CompassDockDemo.tsx +215 -0
- package/src/demos/Page.md +12 -1
- package/src/demos/assets/PF-IconLogo-color.svg +17 -0
- package/src/demos/examples/Page/PageDockedNav.tsx +259 -0
- package/src/layouts/Bullseye/examples/bullseye.css +2 -2
- package/src/layouts/Flex/examples/flex.css +3 -3
- package/src/layouts/Gallery/examples/gallery.css +2 -2
- package/src/layouts/Grid/examples/grid.css +2 -2
- package/src/layouts/Level/examples/level.css +4 -4
- package/src/layouts/Split/examples/split.css +2 -2
- package/src/layouts/Stack/examples/stack.css +4 -4
- /package/src/{components → demos}/Compass/examples/CompassDemo.tsx +0 -0
|
@@ -40,6 +40,8 @@ export interface ToolbarProps extends React.HTMLProps<HTMLDivElement>, OUIAProps
|
|
|
40
40
|
isStatic?: boolean;
|
|
41
41
|
/** Flag indicating the toolbar should stick to the top of its container */
|
|
42
42
|
isSticky?: boolean;
|
|
43
|
+
/** @beta Flag indicating the toolbar has a vertical orientation */
|
|
44
|
+
isVertical?: boolean;
|
|
43
45
|
/** Insets at various breakpoints. */
|
|
44
46
|
inset?: {
|
|
45
47
|
default?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';
|
|
@@ -143,6 +145,7 @@ class Toolbar extends Component<ToolbarProps, ToolbarState> {
|
|
|
143
145
|
isStatic,
|
|
144
146
|
inset,
|
|
145
147
|
isSticky,
|
|
148
|
+
isVertical,
|
|
146
149
|
ouiaId,
|
|
147
150
|
numberOfFiltersText,
|
|
148
151
|
customLabelGroupContent,
|
|
@@ -167,6 +170,7 @@ class Toolbar extends Component<ToolbarProps, ToolbarState> {
|
|
|
167
170
|
isFullHeight && styles.modifiers.fullHeight,
|
|
168
171
|
isStatic && styles.modifiers.static,
|
|
169
172
|
isSticky && styles.modifiers.sticky,
|
|
173
|
+
isVertical && styles.modifiers.vertical,
|
|
170
174
|
formatBreakpointMods(inset, styles, '', getBreakpoint(width)),
|
|
171
175
|
colorVariant === 'primary' && styles.modifiers.primary,
|
|
172
176
|
colorVariant === 'secondary' && styles.modifiers.secondary,
|
|
@@ -54,7 +54,7 @@ describe('Toolbar', () => {
|
|
|
54
54
|
</ToolbarContent>
|
|
55
55
|
</Toolbar>
|
|
56
56
|
);
|
|
57
|
-
expect(screen.getByTestId('toolbar')).not.toHaveClass(
|
|
57
|
+
expect(screen.getByTestId('toolbar')).not.toHaveClass(styles.modifiers.noPadding);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
it(`should render toolbar with ${styles.modifiers.noPadding} class when hasNoPadding is true`, () => {
|
|
@@ -205,4 +205,37 @@ describe('Toolbar', () => {
|
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
207
|
});
|
|
208
|
+
|
|
209
|
+
it(`Renders toolbar without ${styles.modifiers.vertical} by default`, () => {
|
|
210
|
+
render(
|
|
211
|
+
<Toolbar data-testid="Toolbar-test-is-not-vertical">
|
|
212
|
+
<ToolbarContent>
|
|
213
|
+
<ToolbarItem>Test</ToolbarItem>
|
|
214
|
+
<ToolbarItem>Test 2</ToolbarItem>
|
|
215
|
+
<ToolbarItem variant="separator" />
|
|
216
|
+
<ToolbarItem>Test 3 </ToolbarItem>
|
|
217
|
+
</ToolbarContent>
|
|
218
|
+
</Toolbar>
|
|
219
|
+
);
|
|
220
|
+
expect(screen.getByTestId('Toolbar-test-is-not-vertical')).not.toHaveClass(styles.modifiers.vertical);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('Renders with class ${styles.modifiers.vertical} when isVertical is true', () => {
|
|
224
|
+
const items = (
|
|
225
|
+
<Fragment>
|
|
226
|
+
<ToolbarItem>Test</ToolbarItem>
|
|
227
|
+
<ToolbarItem>Test 2</ToolbarItem>
|
|
228
|
+
<ToolbarItem variant="separator" />
|
|
229
|
+
<ToolbarItem>Test 3 </ToolbarItem>
|
|
230
|
+
</Fragment>
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
render(
|
|
234
|
+
<Toolbar id="toolbar" isVertical data-testid="Toolbar-test-is-vertical">
|
|
235
|
+
<ToolbarContent>{items}</ToolbarContent>
|
|
236
|
+
</Toolbar>
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
expect(screen.getByTestId('Toolbar-test-is-vertical')).toHaveClass(styles.modifiers.vertical);
|
|
240
|
+
});
|
|
208
241
|
});
|
|
@@ -48,7 +48,7 @@ export const WizardNavInternal = ({
|
|
|
48
48
|
let firstSubStepIndex: number;
|
|
49
49
|
let hasActiveChild = false;
|
|
50
50
|
|
|
51
|
-
const subNavItems = step.subStepIds?.map((subStepId,
|
|
51
|
+
const subNavItems = step.subStepIds?.map((subStepId, _subStepIndex) => {
|
|
52
52
|
const subStep = steps.find((step) => step.id === subStepId);
|
|
53
53
|
const hasVisitedNextStep = steps.some((step) => step.index > subStep.index && step.isVisited);
|
|
54
54
|
const isSubStepDisabled =
|
|
@@ -66,8 +66,8 @@ export const WizardNavInternal = ({
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
// Store the first sub-step index so that when its parent is clicked, the first sub-step is focused
|
|
70
|
-
if (
|
|
69
|
+
// Store the first visible sub-step index so that when its parent is clicked, the first sub-step is focused
|
|
70
|
+
if (firstSubStepIndex === undefined) {
|
|
71
71
|
firstSubStepIndex = subStep.index;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -627,3 +627,42 @@ test('onStepChange skips over disabled or hidden steps and substeps', async () =
|
|
|
627
627
|
WizardStepChangeScope.Back
|
|
628
628
|
);
|
|
629
629
|
});
|
|
630
|
+
|
|
631
|
+
test('clicking parent step navigates to first visible sub-step when first sub-step is hidden', async () => {
|
|
632
|
+
const user = userEvent.setup();
|
|
633
|
+
const onStepChange = jest.fn();
|
|
634
|
+
|
|
635
|
+
render(
|
|
636
|
+
<Wizard onStepChange={onStepChange}>
|
|
637
|
+
<WizardStep id="step-1" name="Test step 1" />
|
|
638
|
+
<WizardStep
|
|
639
|
+
id="step-2"
|
|
640
|
+
name="Test step 2"
|
|
641
|
+
steps={[
|
|
642
|
+
<WizardStep id="step2-sub1" name="Hidden sub step" isHidden />,
|
|
643
|
+
<WizardStep id="step2-sub2" name="Visible sub step 1" />,
|
|
644
|
+
<WizardStep id="step2-sub3" name="Visible sub step 2" />
|
|
645
|
+
]}
|
|
646
|
+
/>
|
|
647
|
+
<WizardStep id="step-3" name="Test step 3" />
|
|
648
|
+
</Wizard>
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
// Navigate to step 3 first
|
|
652
|
+
await user.click(screen.getByRole('button', { name: 'Test step 3' }));
|
|
653
|
+
expect(onStepChange).toHaveBeenCalledWith(
|
|
654
|
+
null,
|
|
655
|
+
expect.objectContaining({ id: 'step-3' }),
|
|
656
|
+
expect.objectContaining({ id: 'step-1' }),
|
|
657
|
+
WizardStepChangeScope.Nav
|
|
658
|
+
);
|
|
659
|
+
|
|
660
|
+
// Click on parent step 2 - should navigate to the first VISIBLE sub-step (step2-sub2), not crash
|
|
661
|
+
await user.click(screen.getByRole('button', { name: 'Test step 2' }));
|
|
662
|
+
expect(onStepChange).toHaveBeenCalledWith(
|
|
663
|
+
null,
|
|
664
|
+
expect.objectContaining({ id: 'step2-sub2' }),
|
|
665
|
+
expect.objectContaining({ id: 'step-3' }),
|
|
666
|
+
WizardStepChangeScope.Nav
|
|
667
|
+
);
|
|
668
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Compass
|
|
3
|
+
section: AI
|
|
4
|
+
subsection: Generative UIs
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import { useRef, useState } from 'react';
|
|
8
|
+
import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
|
|
9
|
+
import OutlinedPlusSquare from '@patternfly/react-icons/dist/esm/icons/outlined-plus-square-icon';
|
|
10
|
+
import OutlinedCopy from '@patternfly/react-icons/dist/esm/icons/outlined-copy-icon';
|
|
11
|
+
import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon';
|
|
12
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
13
|
+
import FolderIcon from '@patternfly/react-icons/dist/esm/icons/folder-icon';
|
|
14
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
15
|
+
import CloudIcon from '@patternfly/react-icons/dist/esm/icons/cloud-icon';
|
|
16
|
+
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
17
|
+
import imgAvatar from '../assets/avatarImg.svg';
|
|
18
|
+
import pfLogo from '../assets/PF-IconLogo-color.svg';
|
|
19
|
+
|
|
20
|
+
## Demos
|
|
21
|
+
|
|
22
|
+
### Compass layout
|
|
23
|
+
|
|
24
|
+
This demo showcases an implementation of the following Compass features:
|
|
25
|
+
|
|
26
|
+
- Middle navigation in the `header`, featuring top-level primary tabs and a secondary container for sub-tabs.
|
|
27
|
+
- Vertical sidebars utilizing `<ActionList>` groups with buttons that use the `isCircle` prop.
|
|
28
|
+
- A custom gradient background in the `<Hero>`, visible in dark mode.
|
|
29
|
+
- Background images that automatically adapt to both light and dark modes.
|
|
30
|
+
- A `footer` section containing the `<CompassMessageBar>`, that could be used for AI text input.
|
|
31
|
+
|
|
32
|
+
```ts isFullscreen file="./examples/CompassDemo.tsx"
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Docked nav demo
|
|
37
|
+
|
|
38
|
+
```ts isFullscreen file="./examples/CompassDockDemo.tsx"
|
|
39
|
+
|
|
40
|
+
```
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Compass,
|
|
4
|
+
CompassContent,
|
|
5
|
+
CompassMainHeader,
|
|
6
|
+
CompassPanel,
|
|
7
|
+
Title,
|
|
8
|
+
NavItem,
|
|
9
|
+
NavList,
|
|
10
|
+
Nav,
|
|
11
|
+
Brand,
|
|
12
|
+
MastheadLogo,
|
|
13
|
+
MastheadBrand,
|
|
14
|
+
MastheadContent,
|
|
15
|
+
MastheadMain,
|
|
16
|
+
Masthead,
|
|
17
|
+
Toolbar,
|
|
18
|
+
ToolbarContent,
|
|
19
|
+
ToolbarItem,
|
|
20
|
+
ToolbarGroup,
|
|
21
|
+
Dropdown,
|
|
22
|
+
DropdownList,
|
|
23
|
+
MenuToggle,
|
|
24
|
+
DropdownItem,
|
|
25
|
+
Button,
|
|
26
|
+
ButtonVariant,
|
|
27
|
+
Avatar,
|
|
28
|
+
Tooltip,
|
|
29
|
+
Divider
|
|
30
|
+
} from '@patternfly/react-core';
|
|
31
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
32
|
+
import FolderIcon from '@patternfly/react-icons/dist/esm/icons/folder-icon';
|
|
33
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
34
|
+
import CloudIcon from '@patternfly/react-icons/dist/esm/icons/cloud-icon';
|
|
35
|
+
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
36
|
+
import pfLogo from '../../assets/PF-IconLogo-color.svg';
|
|
37
|
+
import imgAvatar from '../../assets/avatarImg.svg';
|
|
38
|
+
|
|
39
|
+
interface NavOnSelectProps {
|
|
40
|
+
groupId: number | string;
|
|
41
|
+
itemId: number | string;
|
|
42
|
+
to: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const CompassDockDemo: React.FunctionComponent = () => {
|
|
46
|
+
const [activeItem, setActiveItem] = useState<number>(0);
|
|
47
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
48
|
+
|
|
49
|
+
const onNavSelect = (_event: React.FormEvent<HTMLInputElement>, selectedItem: NavOnSelectProps) => {
|
|
50
|
+
typeof selectedItem.itemId === 'number' && setActiveItem(selectedItem.itemId);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const onDropdownToggle = () => {
|
|
54
|
+
setIsDropdownOpen((prevIsOpen) => !prevIsOpen);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const onDropdownSelect = () => {
|
|
58
|
+
setIsDropdownOpen(false);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const userDropdownItems = [
|
|
62
|
+
<>
|
|
63
|
+
<DropdownItem key="group 2 profile">My profile</DropdownItem>
|
|
64
|
+
<DropdownItem key="group 2 user">User management</DropdownItem>
|
|
65
|
+
<DropdownItem key="group 2 logout">Logout</DropdownItem>
|
|
66
|
+
</>
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const navItem1Ref = useRef<HTMLAnchorElement>(null);
|
|
70
|
+
const navItem2Ref = useRef<HTMLAnchorElement>(null);
|
|
71
|
+
const navItem3Ref = useRef<HTMLAnchorElement>(null);
|
|
72
|
+
const navItem4Ref = useRef<HTMLAnchorElement>(null);
|
|
73
|
+
const settingsRef = useRef<HTMLButtonElement>(null);
|
|
74
|
+
const helpRef = useRef<HTMLButtonElement>(null);
|
|
75
|
+
const userMenuRef = useRef<HTMLButtonElement>(null);
|
|
76
|
+
|
|
77
|
+
const dockContent = (
|
|
78
|
+
<Masthead id="icon-router-link" variant="docked">
|
|
79
|
+
<MastheadMain>
|
|
80
|
+
<MastheadBrand>
|
|
81
|
+
<MastheadLogo component={(props) => <a {...props} href="#" />}>
|
|
82
|
+
<Brand src={pfLogo} alt="PatternFly" heights={{ default: '37px' }} />
|
|
83
|
+
</MastheadLogo>
|
|
84
|
+
</MastheadBrand>
|
|
85
|
+
</MastheadMain>
|
|
86
|
+
<Divider />
|
|
87
|
+
<MastheadContent>
|
|
88
|
+
<Toolbar id="toolbar" isVertical>
|
|
89
|
+
<ToolbarContent>
|
|
90
|
+
<ToolbarItem>
|
|
91
|
+
<Nav onSelect={onNavSelect} variant="docked" aria-label="Icon global" ouiaId="IconNav">
|
|
92
|
+
<NavList>
|
|
93
|
+
<NavItem
|
|
94
|
+
key="nav-icon-link1"
|
|
95
|
+
preventDefault
|
|
96
|
+
id="nav-icon-link1"
|
|
97
|
+
to="#nav-icon-link1"
|
|
98
|
+
itemId={0}
|
|
99
|
+
isActive={activeItem === 0}
|
|
100
|
+
icon={<CubeIcon />}
|
|
101
|
+
anchorRef={navItem1Ref}
|
|
102
|
+
aria-label="Link 1"
|
|
103
|
+
/>
|
|
104
|
+
<NavItem
|
|
105
|
+
key="nav-icon-link2"
|
|
106
|
+
preventDefault
|
|
107
|
+
id="nav-icon-link2"
|
|
108
|
+
to="#nav-icon-link2"
|
|
109
|
+
itemId={1}
|
|
110
|
+
isActive={activeItem === 1}
|
|
111
|
+
icon={<FolderIcon />}
|
|
112
|
+
anchorRef={navItem2Ref}
|
|
113
|
+
aria-label="Link 2"
|
|
114
|
+
/>
|
|
115
|
+
<NavItem
|
|
116
|
+
key="nav-icon-link3"
|
|
117
|
+
preventDefault
|
|
118
|
+
id="nav-icon-link3"
|
|
119
|
+
to="#nav-icon-link3"
|
|
120
|
+
itemId={2}
|
|
121
|
+
isActive={activeItem === 2}
|
|
122
|
+
icon={<CloudIcon />}
|
|
123
|
+
anchorRef={navItem3Ref}
|
|
124
|
+
aria-label="Link 3"
|
|
125
|
+
/>
|
|
126
|
+
<NavItem
|
|
127
|
+
key="nav-icon-link4"
|
|
128
|
+
preventDefault
|
|
129
|
+
id="nav-icon-link4"
|
|
130
|
+
to="#nav-icon-link4"
|
|
131
|
+
itemId={3}
|
|
132
|
+
isActive={activeItem === 3}
|
|
133
|
+
icon={<CodeIcon />}
|
|
134
|
+
anchorRef={navItem4Ref}
|
|
135
|
+
aria-label="Link 4"
|
|
136
|
+
/>
|
|
137
|
+
</NavList>
|
|
138
|
+
</Nav>
|
|
139
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem1Ref} content="Link 1"></Tooltip>
|
|
140
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem2Ref} content="Link 2"></Tooltip>
|
|
141
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem3Ref} content="Link 3"></Tooltip>
|
|
142
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem4Ref} content="Link 4"></Tooltip>
|
|
143
|
+
</ToolbarItem>
|
|
144
|
+
<ToolbarGroup
|
|
145
|
+
variant="action-group-plain"
|
|
146
|
+
align={{ default: 'alignEnd' }}
|
|
147
|
+
gap={{ default: 'gapNone', md: 'gapMd' }}
|
|
148
|
+
>
|
|
149
|
+
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
150
|
+
<ToolbarItem>
|
|
151
|
+
<Tooltip aria="none" aria-live="off" triggerRef={settingsRef} content="Settings">
|
|
152
|
+
<Button ref={settingsRef} aria-label="Settings" isSettings variant="plain" />
|
|
153
|
+
</Tooltip>
|
|
154
|
+
</ToolbarItem>
|
|
155
|
+
<ToolbarItem>
|
|
156
|
+
<Tooltip aria="none" aria-live="off" triggerRef={helpRef} content="Help">
|
|
157
|
+
<Button
|
|
158
|
+
ref={helpRef}
|
|
159
|
+
aria-label="Help"
|
|
160
|
+
variant={ButtonVariant.plain}
|
|
161
|
+
icon={<QuestionCircleIcon />}
|
|
162
|
+
/>
|
|
163
|
+
</Tooltip>
|
|
164
|
+
</ToolbarItem>
|
|
165
|
+
</ToolbarGroup>
|
|
166
|
+
</ToolbarGroup>
|
|
167
|
+
<ToolbarItem>
|
|
168
|
+
<Dropdown
|
|
169
|
+
isOpen={isDropdownOpen}
|
|
170
|
+
shouldFocusToggleOnSelect
|
|
171
|
+
onSelect={onDropdownSelect}
|
|
172
|
+
onOpenChange={(isOpen: boolean) => setIsDropdownOpen(isOpen)}
|
|
173
|
+
toggle={{
|
|
174
|
+
toggleNode: (
|
|
175
|
+
<Tooltip content="User menu" aria="none" aria-live="off" triggerRef={userMenuRef}>
|
|
176
|
+
<MenuToggle
|
|
177
|
+
ref={userMenuRef}
|
|
178
|
+
onClick={onDropdownToggle}
|
|
179
|
+
isExpanded={isDropdownOpen}
|
|
180
|
+
icon={<Avatar src={imgAvatar} alt="" size="sm" />}
|
|
181
|
+
variant="plain"
|
|
182
|
+
aria-label="User menu"
|
|
183
|
+
/>
|
|
184
|
+
</Tooltip>
|
|
185
|
+
),
|
|
186
|
+
toggleRef: userMenuRef
|
|
187
|
+
}}
|
|
188
|
+
>
|
|
189
|
+
<DropdownList>{userDropdownItems}</DropdownList>
|
|
190
|
+
</Dropdown>
|
|
191
|
+
</ToolbarItem>
|
|
192
|
+
</ToolbarContent>
|
|
193
|
+
</Toolbar>
|
|
194
|
+
</MastheadContent>
|
|
195
|
+
</Masthead>
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const mainContent = (
|
|
199
|
+
<>
|
|
200
|
+
<CompassMainHeader title={<Title headingLevel="h1">Content title</Title>} />
|
|
201
|
+
<CompassContent>
|
|
202
|
+
<CompassPanel>Content</CompassPanel>
|
|
203
|
+
</CompassContent>
|
|
204
|
+
</>
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<Compass
|
|
209
|
+
dock={dockContent}
|
|
210
|
+
main={mainContent}
|
|
211
|
+
backgroundSrcDark="/assets/images/pf-background.svg"
|
|
212
|
+
backgroundSrcLight="/assets/images/pf-background.svg"
|
|
213
|
+
/>
|
|
214
|
+
);
|
|
215
|
+
};
|
package/src/demos/Page.md
CHANGED
|
@@ -3,7 +3,7 @@ id: Page
|
|
|
3
3
|
section: components
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { useState } from 'react';
|
|
6
|
+
import { useState, useRef, useEffect } from 'react';
|
|
7
7
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
8
8
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
9
9
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
@@ -13,7 +13,12 @@ import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
|
13
13
|
import AttentionBellIcon from '@patternfly/react-icons/dist/esm/icons/attention-bell-icon';
|
|
14
14
|
import LightbulbIcon from '@patternfly/react-icons/dist/esm/icons/lightbulb-icon';
|
|
15
15
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
16
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
17
|
+
import FolderIcon from '@patternfly/react-icons/dist/esm/icons/folder-icon';
|
|
18
|
+
import CloudIcon from '@patternfly/react-icons/dist/esm/icons/cloud-icon';
|
|
19
|
+
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
16
20
|
import pfLogo from '@patternfly/react-core/src/demos/assets/PF-HorizontalLogo-Color.svg';
|
|
21
|
+
import pfIconLogo from '@patternfly/react-core/src/demos/assets/PF-IconLogo-color.svg';
|
|
17
22
|
|
|
18
23
|
- All examples set the `isManagedSidebar` prop on the Page component to have the sidebar automatically close for smaller screen widths. You can also manually control this behavior by not adding the `isManagedSidebar` prop and instead:
|
|
19
24
|
|
|
@@ -49,3 +54,9 @@ When adding a context selector/perspective switcher in a `PageSidebar`, you must
|
|
|
49
54
|
```ts file='./examples/Page/PageContextSelector.tsx' isFullscreen
|
|
50
55
|
|
|
51
56
|
```
|
|
57
|
+
|
|
58
|
+
### Docked nav
|
|
59
|
+
|
|
60
|
+
```ts file='./examples/Page/PageDockedNav.tsx' isFullscreen
|
|
61
|
+
|
|
62
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="158px" height="158px" viewBox="0 0 158 158" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>PF-IconLogo-color </title>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-1">
|
|
6
|
+
<stop stop-color="#2B9AF3" offset="0%"></stop>
|
|
7
|
+
<stop stop-color="#73BCF7" stop-opacity="0.502212631" offset="100%"></stop>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
<g id="PF-IconLogo-color" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
11
|
+
<g id="Logo">
|
|
12
|
+
<path d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z" id="Rectangle-Copy-17" fill="#0066CC"></path>
|
|
13
|
+
<path d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z" id="Path-2" fill="url(#linearGradient-1)"></path>
|
|
14
|
+
<path d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z" id="Path-2" fill="url(#linearGradient-1)" transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "></path>
|
|
15
|
+
</g>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|