@patternfly/react-core 6.4.1-prerelease.8 → 6.5.0-prerelease.1
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 +12 -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 -0
- 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/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/dynamic-modules.json +8 -0
- package/dist/esm/components/ActionList/ActionList.d.ts +2 -0
- package/dist/esm/components/ActionList/ActionList.d.ts.map +1 -1
- package/dist/esm/components/ActionList/ActionList.js +2 -2
- package/dist/esm/components/ActionList/ActionList.js.map +1 -1
- package/dist/esm/components/Button/Button.d.ts +2 -0
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Compass/Compass.d.ts +34 -0
- package/dist/esm/components/Compass/Compass.d.ts.map +1 -0
- package/dist/esm/components/Compass/Compass.js +25 -0
- package/dist/esm/components/Compass/Compass.js.map +1 -0
- package/dist/esm/components/Compass/CompassContent.d.ts +15 -0
- package/dist/esm/components/Compass/CompassContent.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassContent.js +16 -0
- package/dist/esm/components/Compass/CompassContent.js.map +1 -0
- package/dist/esm/components/Compass/CompassHeader.d.ts +12 -0
- package/dist/esm/components/Compass/CompassHeader.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassHeader.js +6 -0
- package/dist/esm/components/Compass/CompassHeader.js.map +1 -0
- package/dist/esm/components/Compass/CompassHero.d.ts +26 -0
- package/dist/esm/components/Compass/CompassHero.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassHero.js +47 -0
- package/dist/esm/components/Compass/CompassHero.js.map +1 -0
- package/dist/esm/components/Compass/CompassMainHeader.d.ts +14 -0
- package/dist/esm/components/Compass/CompassMainHeader.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassMainHeader.js +13 -0
- package/dist/esm/components/Compass/CompassMainHeader.js.map +1 -0
- package/dist/esm/components/Compass/CompassMessageBar.d.ts +10 -0
- package/dist/esm/components/Compass/CompassMessageBar.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassMessageBar.js +10 -0
- package/dist/esm/components/Compass/CompassMessageBar.js.map +1 -0
- package/dist/esm/components/Compass/CompassPanel.d.ts +22 -0
- package/dist/esm/components/Compass/CompassPanel.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassPanel.js +10 -0
- package/dist/esm/components/Compass/CompassPanel.js.map +1 -0
- package/dist/esm/components/Compass/index.d.ts +8 -0
- package/dist/esm/components/Compass/index.d.ts.map +1 -0
- package/dist/esm/components/Compass/index.js +8 -0
- package/dist/esm/components/Compass/index.js.map +1 -0
- package/dist/esm/components/Menu/Menu.d.ts +0 -1
- package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/Menu/Menu.js +5 -8
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts +2 -0
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +3 -2
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts +2 -0
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -2
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/js/components/ActionList/ActionList.d.ts +2 -0
- package/dist/js/components/ActionList/ActionList.d.ts.map +1 -1
- package/dist/js/components/ActionList/ActionList.js +2 -2
- package/dist/js/components/ActionList/ActionList.js.map +1 -1
- package/dist/js/components/Button/Button.d.ts +2 -0
- package/dist/js/components/Button/Button.d.ts.map +1 -1
- package/dist/js/components/Button/Button.js +2 -2
- package/dist/js/components/Button/Button.js.map +1 -1
- package/dist/js/components/Compass/Compass.d.ts +34 -0
- package/dist/js/components/Compass/Compass.d.ts.map +1 -0
- package/dist/js/components/Compass/Compass.js +29 -0
- package/dist/js/components/Compass/Compass.js.map +1 -0
- package/dist/js/components/Compass/CompassContent.d.ts +15 -0
- package/dist/js/components/Compass/CompassContent.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassContent.js +20 -0
- package/dist/js/components/Compass/CompassContent.js.map +1 -0
- package/dist/js/components/Compass/CompassHeader.d.ts +12 -0
- package/dist/js/components/Compass/CompassHeader.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassHeader.js +11 -0
- package/dist/js/components/Compass/CompassHeader.js.map +1 -0
- package/dist/js/components/Compass/CompassHero.d.ts +26 -0
- package/dist/js/components/Compass/CompassHero.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassHero.js +51 -0
- package/dist/js/components/Compass/CompassHero.js.map +1 -0
- package/dist/js/components/Compass/CompassMainHeader.d.ts +14 -0
- package/dist/js/components/Compass/CompassMainHeader.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassMainHeader.js +17 -0
- package/dist/js/components/Compass/CompassMainHeader.js.map +1 -0
- package/dist/js/components/Compass/CompassMessageBar.d.ts +10 -0
- package/dist/js/components/Compass/CompassMessageBar.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassMessageBar.js +14 -0
- package/dist/js/components/Compass/CompassMessageBar.js.map +1 -0
- package/dist/js/components/Compass/CompassPanel.d.ts +22 -0
- package/dist/js/components/Compass/CompassPanel.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassPanel.js +14 -0
- package/dist/js/components/Compass/CompassPanel.js.map +1 -0
- package/dist/js/components/Compass/index.d.ts +8 -0
- package/dist/js/components/Compass/index.d.ts.map +1 -0
- package/dist/js/components/Compass/index.js +11 -0
- package/dist/js/components/Compass/index.js.map +1 -0
- package/dist/js/components/Menu/Menu.d.ts +0 -1
- package/dist/js/components/Menu/Menu.d.ts.map +1 -1
- package/dist/js/components/Menu/Menu.js +5 -8
- package/dist/js/components/Menu/Menu.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts +2 -0
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +3 -2
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +2 -0
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +3 -2
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/index.d.ts +1 -0
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +1 -0
- package/dist/js/components/index.js.map +1 -1
- package/dist/styles/assets/images/RHAiExperienceIcon.svg +27 -0
- package/dist/styles/assets/images/RHAutomationsLogo.svg +96 -0
- package/dist/styles/assets/images/RHServerStackIcon.svg +16 -0
- package/dist/styles/assets/images/compass--hero-bg.png +0 -0
- package/dist/styles/assets/images/compass--rh-wallpaper-dark.png +0 -0
- package/dist/styles/assets/images/compass--rh-wallpaper-light.png +0 -0
- package/dist/styles/assets/images/compass--wallpaper-dark.png +0 -0
- package/dist/styles/assets/images/compass--wallpaper-light.png +0 -0
- package/dist/styles/base-no-reset.css +51 -0
- package/dist/styles/base.css +51 -0
- package/dist/umd/assets/{output-CyRsIwqr.css → output-COsUhzfR.css} +17583 -17291
- package/dist/umd/react-core.min.js +2 -2
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +6 -6
- package/src/components/ActionList/ActionList.tsx +12 -1
- package/src/components/ActionList/__tests__/ActionList.test.tsx +12 -0
- package/src/components/ActionList/examples/ActionList.md +6 -0
- package/src/components/ActionList/examples/ActionListVertical.tsx +46 -0
- package/src/components/Alert/examples/Alert.md +26 -275
- package/src/components/Alert/examples/AlertCustomIcons.tsx +17 -0
- package/src/components/Alert/examples/AlertExpandable.tsx +36 -0
- package/src/components/Alert/examples/AlertInlineVariants.tsx +12 -0
- package/src/components/Alert/examples/AlertInlineVariations.tsx +45 -0
- package/src/components/Alert/examples/AlertPlainInlineVariants.tsx +12 -0
- package/src/components/Alert/examples/AlertPlainInlineVariations.tsx +7 -0
- package/src/components/Alert/examples/AlertStaticLiveRegion.tsx +29 -0
- package/src/components/Alert/examples/AlertTimeout.tsx +45 -0
- package/src/components/Alert/examples/AlertTruncated.tsx +28 -0
- package/src/components/Alert/examples/AlertVariants.tsx +12 -0
- package/src/components/Alert/examples/AlertVariations.tsx +43 -0
- package/src/components/Button/Button.tsx +4 -0
- package/src/components/Button/__tests__/Button.test.tsx +5 -0
- package/src/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +1 -1
- package/src/components/Button/examples/Button.md +8 -0
- package/src/components/Button/examples/ButtonCircle.tsx +63 -0
- package/src/components/Compass/Compass.tsx +107 -0
- package/src/components/Compass/CompassContent.tsx +42 -0
- package/src/components/Compass/CompassHeader.tsx +21 -0
- package/src/components/Compass/CompassHero.tsx +87 -0
- package/src/components/Compass/CompassMainHeader.tsx +43 -0
- package/src/components/Compass/CompassMessageBar.tsx +21 -0
- package/src/components/Compass/CompassPanel.tsx +51 -0
- package/src/components/Compass/__tests__/Compass.test.tsx +172 -0
- package/src/components/Compass/__tests__/CompassContent.test.tsx +46 -0
- package/src/components/Compass/__tests__/CompassHeader.test.tsx +56 -0
- package/src/components/Compass/__tests__/CompassHero.test.tsx +150 -0
- package/src/components/Compass/__tests__/CompassMainHeader.test.tsx +90 -0
- package/src/components/Compass/__tests__/CompassMessageBar.test.tsx +41 -0
- package/src/components/Compass/__tests__/CompassPanel.test.tsx +86 -0
- package/src/components/Compass/__tests__/__snapshots__/Compass.test.tsx.snap +104 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassContent.test.tsx.snap +40 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassHeader.test.tsx.snap +27 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassHero.test.tsx.snap +18 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassMainHeader.test.tsx.snap +42 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassMessageBar.test.tsx.snap +13 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassPanel.test.tsx.snap +25 -0
- package/src/components/Compass/examples/Compass.md +38 -0
- package/src/components/Compass/examples/CompassBasic.tsx +33 -0
- package/src/components/Compass/examples/CompassDemo.tsx +151 -0
- package/src/components/Compass/examples/compass.css +11 -0
- package/src/components/Compass/index.ts +7 -0
- package/src/components/Menu/Menu.tsx +1 -6
- package/src/components/MenuToggle/MenuToggle.tsx +5 -1
- package/src/components/MenuToggle/__tests__/MenuToggle.test.tsx +20 -0
- package/src/components/MenuToggle/examples/MenuToggle.md +18 -0
- package/src/components/MenuToggle/examples/MenuTogglePlainCircle.tsx +11 -0
- package/src/components/Tabs/Tabs.tsx +5 -0
- package/src/components/index.ts +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Alert, AlertActionCloseButton, AlertActionLink } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertInlineVariations: React.FunctionComponent = () => (
|
|
5
|
+
<Fragment>
|
|
6
|
+
<Alert
|
|
7
|
+
isInline
|
|
8
|
+
variant="success"
|
|
9
|
+
title="Success alert title"
|
|
10
|
+
actionLinks={
|
|
11
|
+
<Fragment>
|
|
12
|
+
<AlertActionLink component="a" href="#">
|
|
13
|
+
View details
|
|
14
|
+
</AlertActionLink>
|
|
15
|
+
<AlertActionLink // eslint-disable-next-line no-console
|
|
16
|
+
onClick={() => console.log('Clicked on Ignore')}
|
|
17
|
+
>
|
|
18
|
+
Ignore
|
|
19
|
+
</AlertActionLink>
|
|
20
|
+
</Fragment>
|
|
21
|
+
}
|
|
22
|
+
>
|
|
23
|
+
<p>Success alert description. This should tell the user more information about the alert.</p>
|
|
24
|
+
</Alert>
|
|
25
|
+
<Alert isInline variant="success" title="Success alert title">
|
|
26
|
+
<p>
|
|
27
|
+
Success alert description. This should tell the user more information about the alert.{' '}
|
|
28
|
+
<a href="#">This is a link.</a>
|
|
29
|
+
</p>
|
|
30
|
+
</Alert>
|
|
31
|
+
<Alert
|
|
32
|
+
isInline
|
|
33
|
+
variant="success"
|
|
34
|
+
title="Success alert title"
|
|
35
|
+
// eslint-disable-next-line no-console
|
|
36
|
+
actionClose={<AlertActionCloseButton onClose={() => console.log('Clicked the close button')} />}
|
|
37
|
+
>
|
|
38
|
+
<p>Short alert description.</p>
|
|
39
|
+
</Alert>
|
|
40
|
+
<Alert isInline variant="success" title="div success alert title" component="div" />
|
|
41
|
+
<Alert isInline variant="success" title="h6 Success alert title" component="h6">
|
|
42
|
+
<p>Short alert description.</p>
|
|
43
|
+
</Alert>
|
|
44
|
+
</Fragment>
|
|
45
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Alert } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertPlainInlineVariants: React.FunctionComponent = () => (
|
|
5
|
+
<Fragment>
|
|
6
|
+
<Alert variant="custom" isInline isPlain title="Custom inline alert title" />
|
|
7
|
+
<Alert variant="info" isInline isPlain title="Info inline alert title" />
|
|
8
|
+
<Alert variant="success" isInline isPlain title="Success inline alert title" />
|
|
9
|
+
<Alert variant="warning" isInline isPlain title="Warning inline alert title" />
|
|
10
|
+
<Alert variant="danger" isInline isPlain title="Danger inline alert title" />
|
|
11
|
+
</Fragment>
|
|
12
|
+
);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Alert } from '@patternfly/react-core';
|
|
2
|
+
|
|
3
|
+
export const AlertPlainInlineVariations: React.FunctionComponent = () => (
|
|
4
|
+
<Alert isInline isPlain variant="success" title="Success alert title">
|
|
5
|
+
<p>Success alert description. This should tell the user more information about the alert.</p>
|
|
6
|
+
</Alert>
|
|
7
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Alert, AlertActionCloseButton } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertStaticLiveRegion: React.FunctionComponent = () => (
|
|
5
|
+
<Fragment>
|
|
6
|
+
<Alert
|
|
7
|
+
isLiveRegion
|
|
8
|
+
variant="info"
|
|
9
|
+
title="Default live region configuration"
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
actionClose={<AlertActionCloseButton onClose={() => console.log('Clicked the close button')} />}
|
|
12
|
+
>
|
|
13
|
+
This alert uses the recommended <code>isLiveRegion</code> prop to automatically set ARIA attributes and CSS
|
|
14
|
+
classes.
|
|
15
|
+
</Alert>
|
|
16
|
+
<Alert
|
|
17
|
+
aria-live="assertive"
|
|
18
|
+
aria-relevant="additions text"
|
|
19
|
+
aria-atomic="true"
|
|
20
|
+
variant="info"
|
|
21
|
+
title="Customized live region"
|
|
22
|
+
// eslint-disable-next-line no-console
|
|
23
|
+
actionClose={<AlertActionCloseButton onClose={() => console.log('Clicked the close button')} />}
|
|
24
|
+
>
|
|
25
|
+
You can alternatively omit the <code>isLiveRegion</code> prop to specify ARIA attributes and CSS manually on the
|
|
26
|
+
containing element.
|
|
27
|
+
</Alert>
|
|
28
|
+
</Fragment>
|
|
29
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Fragment, useState } from 'react';
|
|
2
|
+
import { Alert, AlertActionLink, AlertGroup, Button } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertTimeout: React.FunctionComponent = () => {
|
|
5
|
+
const [alerts, setAlerts] = useState<React.ReactNode[]>([]);
|
|
6
|
+
const [newAlertKey, setNewAlertKey] = useState<number>(0);
|
|
7
|
+
|
|
8
|
+
const onClick = () => {
|
|
9
|
+
const timeout = 8000;
|
|
10
|
+
setNewAlertKey((key) => key + 1);
|
|
11
|
+
setAlerts((prevAlerts) => [
|
|
12
|
+
<Alert
|
|
13
|
+
title="Default timeout Alert"
|
|
14
|
+
timeout={timeout}
|
|
15
|
+
actionLinks={
|
|
16
|
+
<Fragment>
|
|
17
|
+
<AlertActionLink component="a" href="#">
|
|
18
|
+
View details
|
|
19
|
+
</AlertActionLink>
|
|
20
|
+
<AlertActionLink // eslint-disable-next-line no-console
|
|
21
|
+
onClick={() => console.log('Clicked on Ignore')}
|
|
22
|
+
>
|
|
23
|
+
Ignore
|
|
24
|
+
</AlertActionLink>
|
|
25
|
+
</Fragment>
|
|
26
|
+
}
|
|
27
|
+
key={newAlertKey}
|
|
28
|
+
>
|
|
29
|
+
This alert will dismiss after {`${timeout / 1000} seconds`}
|
|
30
|
+
</Alert>,
|
|
31
|
+
...prevAlerts
|
|
32
|
+
]);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Fragment>
|
|
37
|
+
<Button variant="secondary" onClick={onClick}>
|
|
38
|
+
Add alert
|
|
39
|
+
</Button>
|
|
40
|
+
<AlertGroup hasAnimations isLiveRegion>
|
|
41
|
+
{alerts}
|
|
42
|
+
</AlertGroup>
|
|
43
|
+
</Fragment>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Alert } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertTruncated: React.FunctionComponent = () => (
|
|
5
|
+
<Fragment>
|
|
6
|
+
<Alert
|
|
7
|
+
variant="info"
|
|
8
|
+
truncateTitle={1}
|
|
9
|
+
title={`
|
|
10
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque cursus enim fringilla tincidunt. Proin lobortis aliquam dictum. Nam vel ullamcorper nulla, nec blandit dolor. Vivamus pellentesque neque justo, nec accumsan nulla rhoncus id. Suspendisse mollis, tortor quis faucibus volutpat, sem leo fringilla turpis, ac lacinia augue metus in nulla. Cras vestibulum lacinia orci. Pellentesque sodales consequat interdum. Sed porttitor tincidunt metus nec iaculis. Pellentesque non commodo justo. Morbi feugiat rhoncus neque, vitae facilisis diam aliquam nec. Sed dapibus vitae quam at tristique. Nunc vel commodo mi. Mauris et rhoncus leo.
|
|
11
|
+
`}
|
|
12
|
+
/>
|
|
13
|
+
<Alert
|
|
14
|
+
variant="warning"
|
|
15
|
+
truncateTitle={2}
|
|
16
|
+
title={`
|
|
17
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque cursus enim fringilla tincidunt. Proin lobortis aliquam dictum. Nam vel ullamcorper nulla, nec blandit dolor. Vivamus pellentesque neque justo, nec accumsan nulla rhoncus id. Suspendisse mollis, tortor quis faucibus volutpat, sem leo fringilla turpis, ac lacinia augue metus in nulla. Cras vestibulum lacinia orci. Pellentesque sodales consequat interdum. Sed porttitor tincidunt metus nec iaculis. Pellentesque non commodo justo. Morbi feugiat rhoncus neque, vitae facilisis diam aliquam nec. Sed dapibus vitae quam at tristique. Nunc vel commodo mi. Mauris et rhoncus leo.
|
|
18
|
+
`}
|
|
19
|
+
/>
|
|
20
|
+
<Alert
|
|
21
|
+
variant="danger"
|
|
22
|
+
truncateTitle={3}
|
|
23
|
+
title={`
|
|
24
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque cursus enim fringilla tincidunt. Proin lobortis aliquam dictum. Nam vel ullamcorper nulla, nec blandit dolor. Vivamus pellentesque neque justo, nec accumsan nulla rhoncus id. Suspendisse mollis, tortor quis faucibus volutpat, sem leo fringilla turpis, ac lacinia augue metus in nulla. Cras vestibulum lacinia orci. Pellentesque sodales consequat interdum. Sed porttitor tincidunt metus nec iaculis. Pellentesque non commodo justo. Morbi feugiat rhoncus neque, vitae facilisis diam aliquam nec. Sed dapibus vitae quam at tristique. Nunc vel commodo mi. Mauris et rhoncus leo.
|
|
25
|
+
`}
|
|
26
|
+
/>
|
|
27
|
+
</Fragment>
|
|
28
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Alert } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertVariants: React.FunctionComponent = () => (
|
|
5
|
+
<Fragment>
|
|
6
|
+
<Alert title="Custom alert title" ouiaId="CustomAlert" />
|
|
7
|
+
<Alert variant="info" title="Info alert title" ouiaId="InfoAlert" />
|
|
8
|
+
<Alert variant="success" title="Success alert title" ouiaId="SuccessAlert" />
|
|
9
|
+
<Alert variant="warning" title="Warning alert title" ouiaId="WarningAlert" />
|
|
10
|
+
<Alert variant="danger" title="Danger alert title" ouiaId="DangerAlert" />
|
|
11
|
+
</Fragment>
|
|
12
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Alert, AlertActionCloseButton, AlertActionLink } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const AlertVariations: React.FunctionComponent = () => (
|
|
5
|
+
<Fragment>
|
|
6
|
+
<Alert
|
|
7
|
+
variant="success"
|
|
8
|
+
title="Success alert title"
|
|
9
|
+
actionLinks={
|
|
10
|
+
<Fragment>
|
|
11
|
+
<AlertActionLink component="a" href="#">
|
|
12
|
+
View details
|
|
13
|
+
</AlertActionLink>
|
|
14
|
+
<AlertActionLink // eslint-disable-next-line no-console
|
|
15
|
+
onClick={() => console.log('Clicked on Ignore')}
|
|
16
|
+
>
|
|
17
|
+
Ignore
|
|
18
|
+
</AlertActionLink>
|
|
19
|
+
</Fragment>
|
|
20
|
+
}
|
|
21
|
+
>
|
|
22
|
+
<p>Success alert description. This should tell the user more information about the alert.</p>
|
|
23
|
+
</Alert>
|
|
24
|
+
<Alert variant="success" title="Success alert title">
|
|
25
|
+
<p>
|
|
26
|
+
Success alert description. This should tell the user more information about the alert.{' '}
|
|
27
|
+
<a href="#">This is a link.</a>
|
|
28
|
+
</p>
|
|
29
|
+
</Alert>
|
|
30
|
+
<Alert
|
|
31
|
+
variant="success"
|
|
32
|
+
title="Success alert title"
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
actionClose={<AlertActionCloseButton onClose={() => console.log('Clicked the close button')} />}
|
|
35
|
+
>
|
|
36
|
+
<p>Short alert description.</p>
|
|
37
|
+
</Alert>
|
|
38
|
+
<Alert variant="success" title="div success alert title" component="div" />
|
|
39
|
+
<Alert variant="success" title="h6 Success alert title" component="h6">
|
|
40
|
+
<p>Short alert description.</p>
|
|
41
|
+
</Alert>
|
|
42
|
+
</Fragment>
|
|
43
|
+
);
|
|
@@ -107,6 +107,8 @@ export interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'r
|
|
|
107
107
|
isHamburger?: boolean;
|
|
108
108
|
/** Adjusts and animates the hamburger icon to indicate what will happen upon clicking the button. */
|
|
109
109
|
hamburgerVariant?: 'expand' | 'collapse';
|
|
110
|
+
/** @beta Flag indicating the button is a circle button. Intended for buttons that only contain an icon.. */
|
|
111
|
+
isCircle?: boolean;
|
|
110
112
|
/** @hide Forwarded ref */
|
|
111
113
|
innerRef?: React.Ref<any>;
|
|
112
114
|
/** Adds count number to button */
|
|
@@ -131,6 +133,7 @@ const ButtonBase: React.FunctionComponent<ButtonProps> = ({
|
|
|
131
133
|
isSettings,
|
|
132
134
|
isHamburger,
|
|
133
135
|
hamburgerVariant,
|
|
136
|
+
isCircle,
|
|
134
137
|
spinnerAriaValueText,
|
|
135
138
|
spinnerAriaLabelledBy,
|
|
136
139
|
spinnerAriaLabel,
|
|
@@ -261,6 +264,7 @@ const ButtonBase: React.FunctionComponent<ButtonProps> = ({
|
|
|
261
264
|
variant === ButtonVariant.stateful && styles.modifiers[state],
|
|
262
265
|
size === ButtonSize.sm && styles.modifiers.small,
|
|
263
266
|
size === ButtonSize.lg && styles.modifiers.displayLg,
|
|
267
|
+
isCircle && styles.modifiers.circle,
|
|
264
268
|
className
|
|
265
269
|
)}
|
|
266
270
|
disabled={isButtonElement ? isDisabled : null}
|
|
@@ -214,6 +214,11 @@ test(`Renders without class ${styles.modifiers.progress} when isLoading = false
|
|
|
214
214
|
expect(screen.getByRole('button')).not.toHaveClass(styles.modifiers.progress);
|
|
215
215
|
});
|
|
216
216
|
|
|
217
|
+
test(`Renders with class ${styles.modifiers.circle} when isCircle is true`, () => {
|
|
218
|
+
render(<Button isCircle>Circle Button</Button>);
|
|
219
|
+
expect(screen.getByRole('button')).toHaveClass(styles.modifiers.circle);
|
|
220
|
+
});
|
|
221
|
+
|
|
217
222
|
test(`Renders custom icon with class ${styles.modifiers.inProgress} when isLoading = true and icon is present`, () => {
|
|
218
223
|
render(
|
|
219
224
|
<Button variant="plain" isLoading aria-label="Upload" spinnerAriaValueText="Loading" icon={<div>ICON</div>} />
|
|
@@ -5,7 +5,7 @@ exports[`Renders basic button 1`] = `
|
|
|
5
5
|
<button
|
|
6
6
|
aria-label="basic button"
|
|
7
7
|
class="pf-v6-c-button pf-m-primary"
|
|
8
|
-
data-ouia-component-id="OUIA-Generated-Button-primary-
|
|
8
|
+
data-ouia-component-id="OUIA-Generated-Button-primary-67"
|
|
9
9
|
data-ouia-component-type="PF6/Button"
|
|
10
10
|
data-ouia-safe="true"
|
|
11
11
|
type="button"
|
|
@@ -138,6 +138,14 @@ Stateful buttons are ideal for displaying the state of notifications. Use `varia
|
|
|
138
138
|
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
+
### Circle buttons
|
|
142
|
+
|
|
143
|
+
Pass `isCircle` to a button to modify its styling from simply rounded corners to complete circles. Circle buttons are intended for buttons that only contain an icon and adequate accessible naming.
|
|
144
|
+
|
|
145
|
+
```ts file="./ButtonCircle.tsx"
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
|
|
141
149
|
## Animated examples
|
|
142
150
|
|
|
143
151
|
The following `<Button>` implementations have animations built into them. When using one of the following implementations, the `icon` property will be overridden due to the animations needing specific icons internally.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Button, Flex } from '@patternfly/react-core';
|
|
2
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
3
|
+
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
|
|
4
|
+
import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
|
|
5
|
+
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
6
|
+
import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
|
|
7
|
+
|
|
8
|
+
interface LoadingPropsType {
|
|
9
|
+
spinnerAriaValueText: string;
|
|
10
|
+
spinnerAriaLabelledBy?: string;
|
|
11
|
+
spinnerAriaLabel?: string;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ButtonCircle: React.FunctionComponent = () => {
|
|
16
|
+
const [isUploading, setIsUploading] = useState<boolean>(false);
|
|
17
|
+
|
|
18
|
+
const uploadingProps = {} as LoadingPropsType;
|
|
19
|
+
uploadingProps.spinnerAriaValueText = 'Loading circle variant example';
|
|
20
|
+
uploadingProps.spinnerAriaLabel = 'Uploading circle variant example data';
|
|
21
|
+
uploadingProps.isLoading = isUploading;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Flex columnGap={{ default: 'columnGapSm' }}>
|
|
25
|
+
<Button isCircle icon={<PlusCircleIcon />} aria-label="Add primary circle variant example" />
|
|
26
|
+
<Button
|
|
27
|
+
variant="secondary"
|
|
28
|
+
isCircle
|
|
29
|
+
icon={<PlusCircleIcon />}
|
|
30
|
+
aria-label="Add secondary circle variant example"
|
|
31
|
+
/>
|
|
32
|
+
<Button variant="tertiary" isCircle icon={<PlusCircleIcon />} aria-label="Add tertiary circle variant example" />
|
|
33
|
+
<Button variant="danger" isCircle icon={<PlusCircleIcon />} aria-label="Add danger circle variant example" />
|
|
34
|
+
<Button variant="warning" isCircle icon={<PlusCircleIcon />} aria-label="Add warning circle variant example" />
|
|
35
|
+
<Button variant="link" isCircle icon={<PlusCircleIcon />} aria-label="Add link circle variant example" />
|
|
36
|
+
<Button variant="control" isCircle icon={<CopyIcon />} aria-label="Copy control circle variant example" />
|
|
37
|
+
<Button variant="plain" isCircle icon={<TimesIcon />} aria-label="Remove plain circle variant example" />
|
|
38
|
+
<Button variant="stateful" isCircle icon={<BellIcon />} aria-label="Stateful unread circle variant example" />
|
|
39
|
+
<Button
|
|
40
|
+
variant="stateful"
|
|
41
|
+
state="read"
|
|
42
|
+
isCircle
|
|
43
|
+
icon={<BellIcon />}
|
|
44
|
+
aria-label="Stateful read circle variant example"
|
|
45
|
+
/>
|
|
46
|
+
<Button
|
|
47
|
+
variant="stateful"
|
|
48
|
+
state="attention"
|
|
49
|
+
isCircle
|
|
50
|
+
icon={<BellIcon />}
|
|
51
|
+
aria-label="Stateful attention circle variant example"
|
|
52
|
+
/>
|
|
53
|
+
<Button
|
|
54
|
+
variant="plain"
|
|
55
|
+
isCircle
|
|
56
|
+
{...(!isUploading && { 'aria-label': 'Upload circle variant example' })}
|
|
57
|
+
onClick={() => setIsUploading(!isUploading)}
|
|
58
|
+
icon={<UploadIcon />}
|
|
59
|
+
{...uploadingProps}
|
|
60
|
+
/>
|
|
61
|
+
</Flex>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Drawer, DrawerContent, DrawerProps } from '../Drawer';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Compass/compass';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
|
|
5
|
+
import compassBackgroundImageLight from '@patternfly/react-tokens/dist/esm/c_compass_BackgroundImage_light';
|
|
6
|
+
import compassBackgroundImageDark from '@patternfly/react-tokens/dist/esm/c_compass_BackgroundImage_dark';
|
|
7
|
+
|
|
8
|
+
export interface CompassProps extends React.HTMLProps<HTMLDivElement> {
|
|
9
|
+
/** Additional classes added to the compass. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Content placed at the top of the layout */
|
|
12
|
+
header?: React.ReactNode;
|
|
13
|
+
/** Flag indicating if the header is expanded */
|
|
14
|
+
isHeaderExpanded?: boolean;
|
|
15
|
+
/** Content placed at the horizontal start of the layout, before the main content */
|
|
16
|
+
sidebarStart?: React.ReactNode;
|
|
17
|
+
/** Flag indicating if the start sidebar is expanded */
|
|
18
|
+
isSidebarStartExpanded?: boolean;
|
|
19
|
+
/** Content placed at the center of the layout */
|
|
20
|
+
main?: React.ReactNode;
|
|
21
|
+
/** Content placed at the horizontal end of the layout, after the main content */
|
|
22
|
+
sidebarEnd?: React.ReactNode;
|
|
23
|
+
/** Flag indicating if the end sidebar is expanded */
|
|
24
|
+
isSidebarEndExpanded?: boolean;
|
|
25
|
+
/** Content placed at the bottom of the layout */
|
|
26
|
+
footer?: React.ReactNode;
|
|
27
|
+
/** Flag indicating if the footer is expanded */
|
|
28
|
+
isFooterExpanded?: boolean;
|
|
29
|
+
/** Content rendered in an optional drawer wrapping the layout */
|
|
30
|
+
drawerContent?: React.ReactNode;
|
|
31
|
+
/** Additional props passed to the drawer */
|
|
32
|
+
drawerProps?: DrawerProps;
|
|
33
|
+
/** Light theme background image path of the compass */
|
|
34
|
+
backgroundSrcLight?: string;
|
|
35
|
+
/** Dark theme background image path of the compass */
|
|
36
|
+
backgroundSrcDark?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Compass: React.FunctionComponent<CompassProps> = ({
|
|
40
|
+
className,
|
|
41
|
+
header,
|
|
42
|
+
isHeaderExpanded = true,
|
|
43
|
+
sidebarStart,
|
|
44
|
+
isSidebarStartExpanded = true,
|
|
45
|
+
main,
|
|
46
|
+
sidebarEnd,
|
|
47
|
+
isSidebarEndExpanded = true,
|
|
48
|
+
footer,
|
|
49
|
+
isFooterExpanded = true,
|
|
50
|
+
drawerContent,
|
|
51
|
+
drawerProps,
|
|
52
|
+
backgroundSrcLight,
|
|
53
|
+
backgroundSrcDark,
|
|
54
|
+
...props
|
|
55
|
+
}) => {
|
|
56
|
+
const hasDrawer = drawerContent !== undefined;
|
|
57
|
+
|
|
58
|
+
const backgroundImageStyles: { [key: string]: string } = {};
|
|
59
|
+
if (backgroundSrcLight) {
|
|
60
|
+
backgroundImageStyles[compassBackgroundImageLight.name] = `url(${backgroundSrcLight})`;
|
|
61
|
+
}
|
|
62
|
+
if (backgroundSrcDark) {
|
|
63
|
+
backgroundImageStyles[compassBackgroundImageDark.name] = `url(${backgroundSrcDark})`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const compassContent = (
|
|
67
|
+
<div className={css(styles.compass, className)} {...props} style={{ ...props.style, ...backgroundImageStyles }}>
|
|
68
|
+
<div
|
|
69
|
+
className={css(styles.compassHeader, isHeaderExpanded && 'pf-m-expanded')}
|
|
70
|
+
{...(!isHeaderExpanded && { inert: 'true' })}
|
|
71
|
+
>
|
|
72
|
+
{header}
|
|
73
|
+
</div>
|
|
74
|
+
<div
|
|
75
|
+
className={css(styles.compassSidebar, styles.modifiers.start, isSidebarStartExpanded && 'pf-m-expanded')}
|
|
76
|
+
{...(!isSidebarStartExpanded && { inert: 'true' })}
|
|
77
|
+
>
|
|
78
|
+
{sidebarStart}
|
|
79
|
+
</div>
|
|
80
|
+
<div className={css(styles.compassMain)}>{main}</div>
|
|
81
|
+
<div
|
|
82
|
+
className={css(styles.compassSidebar, styles.modifiers.end, isSidebarEndExpanded && 'pf-m-expanded')}
|
|
83
|
+
{...(!isSidebarEndExpanded && { inert: 'true' })}
|
|
84
|
+
>
|
|
85
|
+
{sidebarEnd}
|
|
86
|
+
</div>
|
|
87
|
+
<div
|
|
88
|
+
className={css(styles.compassFooter, isFooterExpanded && 'pf-m-expanded')}
|
|
89
|
+
{...(!isFooterExpanded && { inert: 'true' })}
|
|
90
|
+
>
|
|
91
|
+
{footer}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
if (hasDrawer) {
|
|
97
|
+
return (
|
|
98
|
+
<Drawer {...drawerProps}>
|
|
99
|
+
<DrawerContent panelContent={drawerContent}>{compassContent}</DrawerContent>
|
|
100
|
+
</Drawer>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return compassContent;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
Compass.displayName = 'Compass';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Drawer, DrawerContent, DrawerProps } from '../Drawer';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Compass/compass';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
|
|
5
|
+
interface CompassContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** Content of the main compass area. Typically one or more CompassPanel components. */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** Additional classes added to the CompassContent */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Content rendered in an optional drawer wrapping the CompassContent */
|
|
11
|
+
drawerContent?: React.ReactNode;
|
|
12
|
+
/** Additional props passed to the drawer */
|
|
13
|
+
drawerProps?: DrawerProps;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const CompassContent: React.FunctionComponent<CompassContentProps> = ({
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
drawerProps,
|
|
20
|
+
drawerContent,
|
|
21
|
+
...props
|
|
22
|
+
}) => {
|
|
23
|
+
const hasDrawer = drawerContent !== undefined;
|
|
24
|
+
|
|
25
|
+
const compassContent = (
|
|
26
|
+
<div className={css(styles.compassContent, className)} {...props}>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
if (hasDrawer) {
|
|
32
|
+
return (
|
|
33
|
+
<Drawer {...drawerProps}>
|
|
34
|
+
<DrawerContent panelContent={drawerContent}>{compassContent}</DrawerContent>
|
|
35
|
+
</Drawer>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return compassContent;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
CompassContent.displayName = 'CompassContent';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styles from '@patternfly/react-styles/css/components/Compass/compass';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
|
|
4
|
+
interface CompassHeaderProps {
|
|
5
|
+
/** Content of the logo area */
|
|
6
|
+
logo?: React.ReactNode;
|
|
7
|
+
/** Content of the navigation area */
|
|
8
|
+
nav?: React.ReactNode;
|
|
9
|
+
/** Content of the profile area */
|
|
10
|
+
profile?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const CompassHeader: React.FunctionComponent<CompassHeaderProps> = ({ logo, nav, profile }) => (
|
|
14
|
+
<>
|
|
15
|
+
<div className={css(`${styles.compass}__logo`)}>{logo}</div>
|
|
16
|
+
<div className={css(styles.compassNav)}>{nav}</div>
|
|
17
|
+
<div className={css(styles.compassProfile)}>{profile}</div>
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CompassHeader.displayName = 'CompassHeader';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import styles from '@patternfly/react-styles/css/components/Compass/compass';
|
|
2
|
+
import { css } from '@patternfly/react-styles';
|
|
3
|
+
|
|
4
|
+
import compassHeroBackgroundImageLight from '@patternfly/react-tokens/dist/esm/c_compass__hero_BackgroundImage_light';
|
|
5
|
+
import compassHeroBackgroundImageDark from '@patternfly/react-tokens/dist/esm/c_compass__hero_BackgroundImage_dark';
|
|
6
|
+
import compassHeroGradientStop1Light from '@patternfly/react-tokens/dist/esm/c_compass__hero_gradient_stop_1_light';
|
|
7
|
+
import compassHeroGradientStop2Light from '@patternfly/react-tokens/dist/esm/c_compass__hero_gradient_stop_2_light';
|
|
8
|
+
import compassHeroGradientStop3Light from '@patternfly/react-tokens/dist/esm/c_compass__hero_gradient_stop_3_light';
|
|
9
|
+
import compassHeroGradientStop1Dark from '@patternfly/react-tokens/dist/esm/c_compass__hero_gradient_stop_1_dark';
|
|
10
|
+
import compassHeroGradientStop2Dark from '@patternfly/react-tokens/dist/esm/c_compass__hero_gradient_stop_2_dark';
|
|
11
|
+
import compassHeroGradientStop3Dark from '@patternfly/react-tokens/dist/esm/c_compass__hero_gradient_stop_3_dark';
|
|
12
|
+
|
|
13
|
+
interface CompassHeroProps extends Omit<React.HTMLProps<HTMLDivElement>, 'content'> {
|
|
14
|
+
/** Content of the hero */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** Additional classes added to the hero */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Light theme background image path of the hero */
|
|
19
|
+
backgroundSrcLight?: string;
|
|
20
|
+
/** Dark theme background image path of the hero */
|
|
21
|
+
backgroundSrcDark?: string;
|
|
22
|
+
/** Light theme gradient of the hero */
|
|
23
|
+
gradientLight?: {
|
|
24
|
+
stop1?: string;
|
|
25
|
+
stop2?: string;
|
|
26
|
+
stop3?: string;
|
|
27
|
+
};
|
|
28
|
+
/** Dark theme gradient of the hero */
|
|
29
|
+
gradientDark?: {
|
|
30
|
+
stop1?: string;
|
|
31
|
+
stop2?: string;
|
|
32
|
+
stop3?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const CompassHero: React.FunctionComponent<CompassHeroProps> = ({
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
backgroundSrcLight,
|
|
40
|
+
backgroundSrcDark,
|
|
41
|
+
gradientLight,
|
|
42
|
+
gradientDark,
|
|
43
|
+
...props
|
|
44
|
+
}) => {
|
|
45
|
+
const backgroundImageStyles: { [key: string]: string } = {};
|
|
46
|
+
if (backgroundSrcLight) {
|
|
47
|
+
backgroundImageStyles[compassHeroBackgroundImageLight.name] = `url(${backgroundSrcLight})`;
|
|
48
|
+
}
|
|
49
|
+
if (backgroundSrcDark) {
|
|
50
|
+
backgroundImageStyles[compassHeroBackgroundImageDark.name] = `url(${backgroundSrcDark})`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (gradientLight) {
|
|
54
|
+
if (gradientLight.stop1) {
|
|
55
|
+
backgroundImageStyles[compassHeroGradientStop1Light.name] = gradientLight.stop1;
|
|
56
|
+
}
|
|
57
|
+
if (gradientLight.stop2) {
|
|
58
|
+
backgroundImageStyles[compassHeroGradientStop2Light.name] = gradientLight.stop2;
|
|
59
|
+
}
|
|
60
|
+
if (gradientLight.stop3) {
|
|
61
|
+
backgroundImageStyles[compassHeroGradientStop3Light.name] = gradientLight.stop3;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (gradientDark) {
|
|
65
|
+
if (gradientDark.stop1) {
|
|
66
|
+
backgroundImageStyles[compassHeroGradientStop1Dark.name] = gradientDark.stop1;
|
|
67
|
+
}
|
|
68
|
+
if (gradientDark.stop2) {
|
|
69
|
+
backgroundImageStyles[compassHeroGradientStop2Dark.name] = gradientDark.stop2;
|
|
70
|
+
}
|
|
71
|
+
if (gradientDark.stop3) {
|
|
72
|
+
backgroundImageStyles[compassHeroGradientStop3Dark.name] = gradientDark.stop3;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={css(styles.compassPanel, styles.compassHero, className)}
|
|
79
|
+
style={{ ...props.style, ...backgroundImageStyles }}
|
|
80
|
+
{...props}
|
|
81
|
+
>
|
|
82
|
+
<div className={css(styles.compassHeroBody)}>{children}</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
CompassHero.displayName = 'CompassHero';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Flex, FlexItem } from '../../layouts/Flex';
|
|
2
|
+
import { CompassPanel } from './CompassPanel';
|
|
3
|
+
import styles from '@patternfly/react-styles/css/components/Compass/compass';
|
|
4
|
+
import { css } from '@patternfly/react-styles';
|
|
5
|
+
|
|
6
|
+
interface CompassMainHeaderProps extends Omit<React.HTMLProps<HTMLDivElement>, 'title'> {
|
|
7
|
+
/** Additional classes added to the main header */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Styled title. If title or toolbar is provided, the children will be ignored. */
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** Styled toolbar. If title or toolbar is provided, the children will be ignored. */
|
|
12
|
+
toolbar?: React.ReactNode;
|
|
13
|
+
/** Custom main header content. To opt into a default styling, use the title and toolbar props instead. */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const CompassMainHeader: React.FunctionComponent<CompassMainHeaderProps> = ({
|
|
18
|
+
className,
|
|
19
|
+
title,
|
|
20
|
+
toolbar,
|
|
21
|
+
children,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const _content =
|
|
25
|
+
title !== undefined || toolbar !== undefined ? (
|
|
26
|
+
<CompassPanel>
|
|
27
|
+
<Flex alignItems={{ default: 'alignItemsCenter' }}>
|
|
28
|
+
<FlexItem grow={{ default: 'grow' }}>{title}</FlexItem>
|
|
29
|
+
{toolbar && <FlexItem>{toolbar}</FlexItem>}
|
|
30
|
+
</Flex>
|
|
31
|
+
</CompassPanel>
|
|
32
|
+
) : (
|
|
33
|
+
children
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div className={css(`${styles.compass}__main-header`, className)} {...props}>
|
|
38
|
+
{_content}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
CompassMainHeader.displayName = 'CompassMainHeader';
|