@patternfly/react-core 6.0.0-alpha.73 → 6.0.0-alpha.74
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 +10 -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/Content/package.json +8 -0
- 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/Tile/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/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/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 +11 -11
- package/dist/esm/components/{Text/Text.d.ts → Content/Content.d.ts} +17 -8
- package/dist/esm/components/Content/Content.d.ts.map +1 -0
- package/dist/esm/components/{Text/Text.js → Content/Content.js} +22 -5
- package/dist/esm/components/Content/Content.js.map +1 -0
- package/dist/esm/components/Content/TextContent.d.ts.map +1 -0
- package/dist/esm/components/Content/TextContent.js.map +1 -0
- package/dist/esm/components/Content/TextList.d.ts.map +1 -0
- package/dist/esm/components/Content/TextList.js.map +1 -0
- package/dist/esm/components/Content/TextListItem.d.ts.map +1 -0
- package/dist/esm/components/Content/TextListItem.js.map +1 -0
- package/dist/esm/components/{Text → Content}/index.d.ts +1 -1
- package/dist/esm/components/Content/index.d.ts.map +1 -0
- package/dist/esm/components/{Text → Content}/index.js +1 -1
- package/dist/esm/components/Content/index.js.map +1 -0
- package/dist/esm/components/Wizard/WizardBody.d.ts +4 -2
- package/dist/esm/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.js +4 -2
- package/dist/esm/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/components/Wizard/WizardFooter.d.ts +6 -3
- package/dist/esm/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardFooter.js +17 -11
- package/dist/esm/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/esm/components/Wizard/WizardHeader.d.ts +3 -1
- package/dist/esm/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardHeader.js +11 -7
- package/dist/esm/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNav.d.ts +3 -1
- package/dist/esm/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardNav.js +5 -3
- package/dist/esm/components/Wizard/WizardNav.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.d.ts +4 -2
- package/dist/esm/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.js +7 -5
- package/dist/esm/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/js/components/{Text/Text.d.ts → Content/Content.d.ts} +17 -8
- package/dist/js/components/Content/Content.d.ts.map +1 -0
- package/dist/js/components/{Text/Text.js → Content/Content.js} +22 -5
- package/dist/js/components/Content/Content.js.map +1 -0
- package/dist/js/components/Content/TextContent.d.ts.map +1 -0
- package/dist/js/components/Content/TextContent.js.map +1 -0
- package/dist/js/components/Content/TextList.d.ts.map +1 -0
- package/dist/js/components/Content/TextList.js.map +1 -0
- package/dist/js/components/Content/TextListItem.d.ts.map +1 -0
- package/dist/js/components/Content/TextListItem.js.map +1 -0
- package/dist/js/components/{Text → Content}/index.d.ts +1 -1
- package/dist/js/components/Content/index.d.ts.map +1 -0
- package/dist/js/components/{Text → Content}/index.js +1 -1
- package/dist/js/components/Content/index.js.map +1 -0
- package/dist/js/components/Wizard/WizardBody.d.ts +4 -2
- package/dist/js/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardBody.js +3 -2
- package/dist/js/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/components/Wizard/WizardFooter.d.ts +6 -3
- package/dist/js/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardFooter.js +17 -11
- package/dist/js/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/js/components/Wizard/WizardHeader.d.ts +3 -1
- package/dist/js/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardHeader.js +10 -7
- package/dist/js/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/js/components/Wizard/WizardNav.d.ts +3 -1
- package/dist/js/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardNav.js +4 -3
- package/dist/js/components/Wizard/WizardNav.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.d.ts +4 -2
- package/dist/js/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.js +6 -5
- package/dist/js/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/components/index.d.ts +1 -1
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +1 -1
- package/dist/js/components/index.js.map +1 -1
- package/dist/umd/assets/{output-rAmU2c74.css → output-HdwVDZgF.css} +1909 -1909
- package/dist/umd/react-core.min.js +3 -3
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/{Text/Text.tsx → Content/Content.tsx} +53 -13
- package/src/components/{Text/__tests__/Text.test.tsx → Content/__tests__/Content.test.tsx} +3 -3
- package/src/components/{Text/__tests__/__snapshots__/Text.test.tsx.snap → Content/__tests__/__snapshots__/Content.test.tsx.snap} +3 -3
- package/src/components/Content/examples/Content.md +64 -0
- package/src/components/{Text/examples/TextBody.tsx → Content/examples/ContentBody.tsx} +1 -1
- package/src/components/{Text/examples/TextDescriptionList.tsx → Content/examples/ContentDescriptionList.tsx} +1 -1
- package/src/components/{Text/examples/TextHeadings.tsx → Content/examples/ContentHeadings.tsx} +1 -1
- package/src/components/{Text/examples/TextOrderedList.tsx → Content/examples/ContentOrderedList.tsx} +1 -1
- package/src/components/{Text/examples/TextPlainList.tsx → Content/examples/ContentPlainList.tsx} +1 -1
- package/src/components/{Text/examples/TextUnorderedList.tsx → Content/examples/ContentUnorderedList.tsx} +1 -1
- package/src/components/{Text/examples/TextVisited.tsx → Content/examples/ContentVisited.tsx} +1 -1
- package/src/components/{Text/examples/TextContentWrapped.tsx → Content/examples/ContentWrapper.tsx} +1 -1
- package/src/components/{Text → Content}/index.ts +1 -1
- package/src/components/Text/examples/Text.md +1 -57
- package/src/components/Wizard/WizardBody.tsx +8 -3
- package/src/components/Wizard/WizardFooter.tsx +13 -6
- package/src/components/Wizard/WizardHeader.tsx +7 -3
- package/src/components/Wizard/WizardNav.tsx +9 -4
- package/src/components/Wizard/WizardNavItem.tsx +12 -4
- package/src/components/Wizard/__tests__/WizardBody.test.tsx +25 -8
- package/src/components/Wizard/__tests__/WizardFooter.test.tsx +9 -0
- package/src/components/Wizard/__tests__/WizardHeader.test.tsx +51 -0
- package/src/components/Wizard/__tests__/WizardNav.test.tsx +46 -0
- package/src/components/Wizard/__tests__/WizardNavItem.test.tsx +61 -0
- package/src/components/index.ts +1 -1
- package/dist/dynamic/components/Text/package.json +0 -8
- package/dist/esm/components/Text/Text.d.ts.map +0 -1
- package/dist/esm/components/Text/Text.js.map +0 -1
- package/dist/esm/components/Text/TextContent.d.ts.map +0 -1
- package/dist/esm/components/Text/TextContent.js.map +0 -1
- package/dist/esm/components/Text/TextList.d.ts.map +0 -1
- package/dist/esm/components/Text/TextList.js.map +0 -1
- package/dist/esm/components/Text/TextListItem.d.ts.map +0 -1
- package/dist/esm/components/Text/TextListItem.js.map +0 -1
- package/dist/esm/components/Text/index.d.ts.map +0 -1
- package/dist/esm/components/Text/index.js.map +0 -1
- package/dist/js/components/Text/Text.d.ts.map +0 -1
- package/dist/js/components/Text/Text.js.map +0 -1
- package/dist/js/components/Text/TextContent.d.ts.map +0 -1
- package/dist/js/components/Text/TextContent.js.map +0 -1
- package/dist/js/components/Text/TextList.d.ts.map +0 -1
- package/dist/js/components/Text/TextList.js.map +0 -1
- package/dist/js/components/Text/TextListItem.d.ts.map +0 -1
- package/dist/js/components/Text/TextListItem.js.map +0 -1
- package/dist/js/components/Text/index.d.ts.map +0 -1
- package/dist/js/components/Text/index.js.map +0 -1
- /package/dist/esm/components/{Text → Content}/TextContent.d.ts +0 -0
- /package/dist/esm/components/{Text → Content}/TextContent.js +0 -0
- /package/dist/esm/components/{Text → Content}/TextList.d.ts +0 -0
- /package/dist/esm/components/{Text → Content}/TextList.js +0 -0
- /package/dist/esm/components/{Text → Content}/TextListItem.d.ts +0 -0
- /package/dist/esm/components/{Text → Content}/TextListItem.js +0 -0
- /package/dist/js/components/{Text → Content}/TextContent.d.ts +0 -0
- /package/dist/js/components/{Text → Content}/TextContent.js +0 -0
- /package/dist/js/components/{Text → Content}/TextList.d.ts +0 -0
- /package/dist/js/components/{Text → Content}/TextList.js +0 -0
- /package/dist/js/components/{Text → Content}/TextListItem.d.ts +0 -0
- /package/dist/js/components/{Text → Content}/TextListItem.js +0 -0
- /package/src/components/{Text → Content}/TextContent.tsx +0 -0
- /package/src/components/{Text → Content}/TextList.tsx +0 -0
- /package/src/components/{Text → Content}/TextListItem.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/Generated/TextContent.test.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/Generated/TextList.test.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/Generated/TextListItem.test.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/Generated/__snapshots__/TextContent.test.tsx.snap +0 -0
- /package/src/components/{Text → Content}/__tests__/Generated/__snapshots__/TextList.test.tsx.snap +0 -0
- /package/src/components/{Text → Content}/__tests__/Generated/__snapshots__/TextListItem.test.tsx.snap +0 -0
- /package/src/components/{Text → Content}/__tests__/TextContent.test.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/TextList.test.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/TextListItem.test.tsx +0 -0
- /package/src/components/{Text → Content}/__tests__/__snapshots__/TextContent.test.tsx.snap +0 -0
- /package/src/components/{Text → Content}/__tests__/__snapshots__/TextList.test.tsx.snap +0 -0
- /package/src/components/{Text → Content}/__tests__/__snapshots__/TextListItem.test.tsx.snap +0 -0
package/helpers/package.json
CHANGED
package/layouts/package.json
CHANGED
package/next/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.74",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"react": "^17 || ^18",
|
|
65
65
|
"react-dom": "^17 || ^18"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "460bb23f9570b110a396a96b112f43ffdfbe60f1"
|
|
68
68
|
}
|
|
@@ -14,25 +14,53 @@ export enum TextVariants {
|
|
|
14
14
|
a = 'a',
|
|
15
15
|
small = 'small',
|
|
16
16
|
blockquote = 'blockquote',
|
|
17
|
-
pre = 'pre'
|
|
17
|
+
pre = 'pre',
|
|
18
|
+
hr = 'hr',
|
|
19
|
+
ul = 'ul',
|
|
20
|
+
ol = 'ol',
|
|
21
|
+
dl = 'dl',
|
|
22
|
+
li = 'li',
|
|
23
|
+
dt = 'dt',
|
|
24
|
+
dd = 'dd'
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
export interface TextProps extends React.HTMLProps<HTMLElement>, OUIAProps {
|
|
21
|
-
/** The
|
|
22
|
-
component?:
|
|
23
|
-
|
|
28
|
+
/** The content component. If none provided, it will be a 'div' and styling will be applied to all its child components. */
|
|
29
|
+
component?:
|
|
30
|
+
| 'h1'
|
|
31
|
+
| 'h2'
|
|
32
|
+
| 'h3'
|
|
33
|
+
| 'h4'
|
|
34
|
+
| 'h5'
|
|
35
|
+
| 'h6'
|
|
36
|
+
| 'p'
|
|
37
|
+
| 'a'
|
|
38
|
+
| 'small'
|
|
39
|
+
| 'blockquote'
|
|
40
|
+
| 'pre'
|
|
41
|
+
| 'hr'
|
|
42
|
+
| 'ul'
|
|
43
|
+
| 'ol'
|
|
44
|
+
| 'dl'
|
|
45
|
+
| 'li'
|
|
46
|
+
| 'dt'
|
|
47
|
+
| 'dd';
|
|
48
|
+
/** Children rendered within the Content. */
|
|
24
49
|
children?: React.ReactNode;
|
|
25
|
-
/** Additional classes added to the
|
|
50
|
+
/** Additional classes added to the Content. */
|
|
26
51
|
className?: string;
|
|
27
|
-
/**
|
|
52
|
+
/** Modifies the list (ul, ol and dl components) to have plain styling. */
|
|
53
|
+
isPlainList?: boolean;
|
|
54
|
+
/** Flag to indicate the link (or all links within the content) has visited styles applied if the browser determines the link has been visited. */
|
|
28
55
|
isVisitedLink?: boolean;
|
|
29
|
-
/** Value to overwrite the randomly generated data-ouia-component-id
|
|
56
|
+
/** Value to overwrite the randomly generated data-ouia-component-id. */
|
|
30
57
|
ouiaId?: number | string;
|
|
31
58
|
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
|
|
32
59
|
ouiaSafe?: boolean;
|
|
33
60
|
}
|
|
34
61
|
|
|
35
62
|
const componentStyles = {
|
|
63
|
+
div: styles.content,
|
|
36
64
|
h1: styles.contentH1,
|
|
37
65
|
h2: styles.contentH2,
|
|
38
66
|
h3: styles.contentH3,
|
|
@@ -43,29 +71,41 @@ const componentStyles = {
|
|
|
43
71
|
a: styles.contentA,
|
|
44
72
|
small: styles.contentSmall,
|
|
45
73
|
blockquote: styles.contentBlockquote,
|
|
46
|
-
pre: styles.contentPre
|
|
74
|
+
pre: styles.contentPre,
|
|
75
|
+
hr: styles.contentHr,
|
|
76
|
+
ul: styles.contentUl,
|
|
77
|
+
ol: styles.contentOl,
|
|
78
|
+
dl: styles.contentDl,
|
|
79
|
+
li: styles.contentLi,
|
|
80
|
+
dt: styles.contentDt,
|
|
81
|
+
dd: styles.contentDd
|
|
47
82
|
};
|
|
48
83
|
|
|
49
84
|
export const Text: React.FunctionComponent<TextProps> = ({
|
|
50
|
-
children
|
|
85
|
+
children,
|
|
51
86
|
className = '',
|
|
52
|
-
component
|
|
87
|
+
component,
|
|
88
|
+
isPlainList = false,
|
|
53
89
|
isVisitedLink = false,
|
|
54
90
|
ouiaId,
|
|
55
91
|
ouiaSafe = true,
|
|
56
92
|
...props
|
|
57
93
|
}: TextProps) => {
|
|
58
|
-
const
|
|
94
|
+
const wrappingComponent = component ?? 'div';
|
|
95
|
+
const Component: any = wrappingComponent;
|
|
59
96
|
const ouiaProps = useOUIAProps(Text.displayName, ouiaId, ouiaSafe);
|
|
60
97
|
|
|
98
|
+
const isList = ['ul', 'ol', 'dl'].includes(wrappingComponent);
|
|
99
|
+
|
|
61
100
|
return (
|
|
62
101
|
<Component
|
|
63
102
|
{...ouiaProps}
|
|
64
103
|
{...props}
|
|
65
104
|
data-pf-content
|
|
66
105
|
className={css(
|
|
67
|
-
|
|
68
|
-
|
|
106
|
+
componentStyles[wrappingComponent],
|
|
107
|
+
isList && isPlainList && styles.modifiers.plain,
|
|
108
|
+
isVisitedLink && styles.modifiers.visited,
|
|
69
109
|
className
|
|
70
110
|
)}
|
|
71
111
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { Text } from '../
|
|
3
|
+
import { Text } from '../Content';
|
|
4
4
|
|
|
5
5
|
test('Renders without children', () => {
|
|
6
6
|
render(
|
|
@@ -21,9 +21,9 @@ test('Renders with custom class name when className prop is provided', () => {
|
|
|
21
21
|
expect(screen.getByText('Test')).toHaveClass('custom-class');
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
test('Renders as "
|
|
24
|
+
test('Renders as "div" element by default', () => {
|
|
25
25
|
render(<Text>Test</Text>);
|
|
26
|
-
expect(screen.getByText('Test')).toHaveProperty('nodeName', '
|
|
26
|
+
expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DIV');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
test('Renders as "h1" element when component="h1"', () => {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Matches the snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
6
|
-
class="pf-v6-c-content
|
|
5
|
+
<div
|
|
6
|
+
class="pf-v6-c-content"
|
|
7
7
|
data-ouia-component-id="ouia-id"
|
|
8
8
|
data-ouia-component-type="PF6/Text"
|
|
9
9
|
data-ouia-safe="true"
|
|
10
10
|
data-pf-content="true"
|
|
11
11
|
>
|
|
12
12
|
Test
|
|
13
|
-
</
|
|
13
|
+
</div>
|
|
14
14
|
</DocumentFragment>
|
|
15
15
|
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Content
|
|
3
|
+
section: components
|
|
4
|
+
cssPrefix: pf-v5-c-content
|
|
5
|
+
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `<Text>` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote`, and `pre`), as well as the text component suite `<TextList>`, and `<TextListItem>`. `TextContent` may be used as a container for the text components, but nesting them inside `<TextContent>` is not required.
|
|
9
|
+
|
|
10
|
+
You cannot nest other components within `<Text>`, and doing so can cause styling overrides or other conflicts. Instead, you can use the `<Text>` component's properties to achieve the same results.
|
|
11
|
+
|
|
12
|
+
For example, rather than nesting the `<List>` and `<Title>` components within `<Text>`, you should pass `component="h1"` into the `<TextList>` and `<Text>` components. Similarly, when you need to add a divider , rather than passing in a separate `<Divider>` component, you should utilize the `hr` property that `<Text>` supports, which will be styled as a divider.
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Headings
|
|
17
|
+
|
|
18
|
+
```ts file="./ContentHeadings.tsx"
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Body
|
|
23
|
+
|
|
24
|
+
```ts file="./ContentBody.tsx"
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Unordered list
|
|
29
|
+
|
|
30
|
+
```ts file="./ContentUnorderedList.tsx"
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Ordered list
|
|
35
|
+
|
|
36
|
+
```ts file="./ContentOrderedList.tsx"
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Plain list
|
|
41
|
+
|
|
42
|
+
```ts file="./ContentPlainList.tsx"
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Description list
|
|
47
|
+
|
|
48
|
+
```ts file="./ContentDescriptionList.tsx"
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Text components such as Text, TextList, TextListItem can be placed within a TextContent to provide styling for html elements, and additional styling options applied to the children.
|
|
53
|
+
|
|
54
|
+
### Wrapped in TextContent
|
|
55
|
+
|
|
56
|
+
```ts file="./ContentWrapper.tsx"
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Link and visited link
|
|
61
|
+
|
|
62
|
+
```ts file="./ContentVisited.tsx"
|
|
63
|
+
|
|
64
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, TextVariants } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentBody: React.FunctionComponent = () => (
|
|
5
5
|
<>
|
|
6
6
|
<Text component={TextVariants.p}>
|
|
7
7
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextList, TextListVariants, TextListItem, TextListItemVariants } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentDescriptionList: React.FunctionComponent = () => (
|
|
5
5
|
<TextList component={TextListVariants.dl}>
|
|
6
6
|
<TextListItem component={TextListItemVariants.dt}>Web</TextListItem>
|
|
7
7
|
<TextListItem component={TextListItemVariants.dd}>
|
package/src/components/{Text/examples/TextHeadings.tsx → Content/examples/ContentHeadings.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, TextVariants } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentHeadings: React.FunctionComponent = () => (
|
|
5
5
|
<>
|
|
6
6
|
<Text component={TextVariants.h1}>Hello World</Text>
|
|
7
7
|
<Text component={TextVariants.h2}>Second level</Text>
|
package/src/components/{Text/examples/TextOrderedList.tsx → Content/examples/ContentOrderedList.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextList, TextListVariants, TextListItem } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentOrderedList: React.FunctionComponent = () => (
|
|
5
5
|
<TextList component={TextListVariants.ol}>
|
|
6
6
|
<TextListItem>Donec blandit a lorem id convallis.</TextListItem>
|
|
7
7
|
<TextListItem>Cras gravida arcu at diam gravida gravida.</TextListItem>
|
package/src/components/{Text/examples/TextPlainList.tsx → Content/examples/ContentPlainList.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, TextVariants, TextList, TextListVariants, TextListItem } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentPlainList: React.FunctionComponent = () => (
|
|
5
5
|
<>
|
|
6
6
|
<Text component={TextVariants.h3}>Plain unordered list</Text>
|
|
7
7
|
<TextList isPlain>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextList, TextListItem } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentUnorderedList: React.FunctionComponent = () => (
|
|
5
5
|
<TextList>
|
|
6
6
|
<TextListItem>In fermentum leo eu lectus mollis, quis dictum mi aliquet.</TextListItem>
|
|
7
7
|
<TextListItem>Morbi eu nulla lobortis, lobortis est in, fringilla felis.</TextListItem>
|
package/src/components/{Text/examples/TextVisited.tsx → Content/examples/ContentVisited.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextContent, Text, TextVariants } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentVisited: React.FunctionComponent = () => (
|
|
5
5
|
<>
|
|
6
6
|
<TextContent>
|
|
7
7
|
<Text component={TextVariants.h3}>Link example</Text>
|
package/src/components/{Text/examples/TextContentWrapped.tsx → Content/examples/ContentWrapper.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextContent, Text, TextVariants } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const ContentWrapper: React.FunctionComponent = () => (
|
|
5
5
|
<TextContent>
|
|
6
6
|
<Text component={TextVariants.p}>
|
|
7
7
|
Text with a component of type "p" still renders the same when wrapped with a TextContent.
|
|
@@ -5,60 +5,4 @@ cssPrefix: pf-v5-c-content
|
|
|
5
5
|
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
The `<Text>` component
|
|
9
|
-
|
|
10
|
-
You cannot nest other components within `<Text>`, and doing so can cause styling overrides or other conflicts. Instead, you can use the `<Text>` component's properties to achieve the same results.
|
|
11
|
-
|
|
12
|
-
For example, rather than nesting the `<List>` and `<Title>` components within `<Text>`, you should pass `component="h1"` into the `<TextList>` and `<Text>` components. Similarly, when you need to add a divider , rather than passing in a separate `<Divider>` component, you should utilize the `hr` property that `<Text>` supports, which will be styled as a divider.
|
|
13
|
-
|
|
14
|
-
## Examples
|
|
15
|
-
|
|
16
|
-
### Headings
|
|
17
|
-
|
|
18
|
-
```ts file="./TextHeadings.tsx"
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Body
|
|
23
|
-
|
|
24
|
-
```ts file="./TextBody.tsx"
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Unordered list
|
|
29
|
-
|
|
30
|
-
```ts file="./TextUnorderedList.tsx"
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Ordered list
|
|
35
|
-
|
|
36
|
-
```ts file="./TextOrderedList.tsx"
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Plain list
|
|
41
|
-
|
|
42
|
-
```ts file="./TextPlainList.tsx"
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Description list
|
|
47
|
-
|
|
48
|
-
```ts file="./TextDescriptionList.tsx"
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Text components such as Text, TextList, TextListItem can be placed within a TextContent to provide styling for html elements, and additional styling options applied to the children.
|
|
53
|
-
|
|
54
|
-
### Wrapped in TextContent
|
|
55
|
-
|
|
56
|
-
```ts file="./TextContentWrapped.tsx"
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Link and visited link
|
|
61
|
-
|
|
62
|
-
```ts file="./TextVisited.tsx"
|
|
63
|
-
|
|
64
|
-
```
|
|
8
|
+
The `<Text>` component has been renamed to [Content](/components/content).
|
|
@@ -10,9 +10,11 @@ import { getResizeObserver } from '../../helpers/resizeObserver';
|
|
|
10
10
|
* Used as a wrapper for WizardStep content, where the wrapping element is customizable.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export interface WizardBodyProps {
|
|
13
|
+
export interface WizardBodyProps extends React.HTMLProps<HTMLElement> {
|
|
14
14
|
/** Anything that can be rendered in the Wizard body */
|
|
15
15
|
children: React.ReactNode;
|
|
16
|
+
/** Additional classes spread to the wizard body */
|
|
17
|
+
className?: string;
|
|
16
18
|
/** Flag to remove the default body padding */
|
|
17
19
|
hasNoPadding?: boolean;
|
|
18
20
|
/** Adds an accessible name to the wrapper element when the content overflows and renders
|
|
@@ -29,10 +31,12 @@ export interface WizardBodyProps {
|
|
|
29
31
|
|
|
30
32
|
export const WizardBody = ({
|
|
31
33
|
children,
|
|
34
|
+
className,
|
|
32
35
|
hasNoPadding = false,
|
|
33
36
|
'aria-label': ariaLabel,
|
|
34
37
|
'aria-labelledby': ariaLabelledBy,
|
|
35
|
-
component = 'div'
|
|
38
|
+
component = 'div',
|
|
39
|
+
...props
|
|
36
40
|
}: WizardBodyProps) => {
|
|
37
41
|
const [hasScrollbar, setHasScrollbar] = React.useState(false);
|
|
38
42
|
const [previousWidth, setPreviousWidth] = React.useState<number | undefined>(undefined);
|
|
@@ -74,7 +78,8 @@ export const WizardBody = ({
|
|
|
74
78
|
{...(shouldFocusContent && { tabIndex: -1 })}
|
|
75
79
|
{...(component === 'div' && hasScrollbar && { role: 'region' })}
|
|
76
80
|
{...(hasScrollbar && { 'aria-label': defaultAriaLabel, 'aria-labelledby': ariaLabelledBy, tabIndex: 0 })}
|
|
77
|
-
className={css(styles.wizardMain)}
|
|
81
|
+
className={css(styles.wizardMain, className)}
|
|
82
|
+
{...props}
|
|
78
83
|
>
|
|
79
84
|
<div className={css(styles.wizardMainBody, hasNoPadding && styles.modifiers.noPadding)}>{children}</div>
|
|
80
85
|
</WrapperComponent>
|
|
@@ -10,7 +10,7 @@ import { ActionList, ActionListGroup, ActionListItem } from '../ActionList';
|
|
|
10
10
|
* Hosts the standard structure of a footer with ties to the active step so that text for buttons can vary from step to step.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export interface WizardFooterProps {
|
|
13
|
+
export interface WizardFooterProps extends React.HTMLProps<HTMLElement> {
|
|
14
14
|
/** The active step */
|
|
15
15
|
activeStep: WizardStepType;
|
|
16
16
|
/** Next button callback */
|
|
@@ -39,18 +39,23 @@ export interface WizardFooterProps {
|
|
|
39
39
|
backButtonProps?: Omit<WizardFooterButtonProps, 'isDisabled'>;
|
|
40
40
|
/** Additional props for the Cancel button. */
|
|
41
41
|
cancelButtonProps?: WizardFooterButtonProps;
|
|
42
|
+
/** Additional classes spread to the wizard footer */
|
|
43
|
+
className?: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
47
|
* Applies default wizard footer styling any number of child elements.
|
|
46
48
|
*/
|
|
47
49
|
|
|
48
|
-
interface WizardFooterWrapperProps {
|
|
50
|
+
interface WizardFooterWrapperProps extends React.HTMLProps<HTMLElement> {
|
|
49
51
|
children: React.ReactNode;
|
|
52
|
+
className?: string;
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
export const WizardFooterWrapper = ({ children }: WizardFooterWrapperProps) => (
|
|
53
|
-
<footer className={css(styles.wizardFooter)}
|
|
55
|
+
export const WizardFooterWrapper = ({ children, className, ...props }: WizardFooterWrapperProps) => (
|
|
56
|
+
<footer className={css(styles.wizardFooter, className)} {...props}>
|
|
57
|
+
{children}
|
|
58
|
+
</footer>
|
|
54
59
|
);
|
|
55
60
|
|
|
56
61
|
export const WizardFooter = ({ activeStep, ...internalProps }: WizardFooterProps) => {
|
|
@@ -71,9 +76,11 @@ const InternalWizardFooter = ({
|
|
|
71
76
|
cancelButtonText = 'Cancel',
|
|
72
77
|
nextButtonProps,
|
|
73
78
|
backButtonProps,
|
|
74
|
-
cancelButtonProps
|
|
79
|
+
cancelButtonProps,
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
75
82
|
}: Omit<WizardFooterProps, 'activeStep'>) => (
|
|
76
|
-
<WizardFooterWrapper>
|
|
83
|
+
<WizardFooterWrapper className={className} {...props}>
|
|
77
84
|
<ActionList>
|
|
78
85
|
<ActionListGroup>
|
|
79
86
|
{!isBackHidden && (
|
|
@@ -4,7 +4,7 @@ import { css } from '@patternfly/react-styles';
|
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
6
6
|
|
|
7
|
-
export interface WizardHeaderProps {
|
|
7
|
+
export interface WizardHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
8
8
|
/** Callback function called when the X (Close) button is clicked */
|
|
9
9
|
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
10
|
/** Title of the wizard */
|
|
@@ -21,6 +21,8 @@ export interface WizardHeaderProps {
|
|
|
21
21
|
titleId?: string;
|
|
22
22
|
/** id for the description */
|
|
23
23
|
descriptionId?: string;
|
|
24
|
+
/** Additional classes spread to the wizard header */
|
|
25
|
+
className?: string;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export const WizardHeader: React.FunctionComponent<WizardHeaderProps> = ({
|
|
@@ -31,9 +33,11 @@ export const WizardHeader: React.FunctionComponent<WizardHeaderProps> = ({
|
|
|
31
33
|
closeButtonAriaLabel,
|
|
32
34
|
titleId,
|
|
33
35
|
descriptionComponent: Component = 'div',
|
|
34
|
-
descriptionId
|
|
36
|
+
descriptionId,
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
35
39
|
}: WizardHeaderProps) => (
|
|
36
|
-
<div className={css(styles.wizardHeader)}>
|
|
40
|
+
<div className={css(styles.wizardHeader, className)} {...props}>
|
|
37
41
|
{!isCloseHidden && (
|
|
38
42
|
<div className={css(styles.wizardClose)}>
|
|
39
43
|
<Button variant="plain" aria-label={closeButtonAriaLabel} onClick={onClose}>
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
|
|
5
|
-
export interface WizardNavProps {
|
|
5
|
+
export interface WizardNavProps extends Omit<React.HTMLProps<HTMLOListElement>, 'type' | 'ref'> {
|
|
6
6
|
/** children should be WizardNavItem components */
|
|
7
7
|
children?: any;
|
|
8
8
|
/** Aria-label applied to the navigation element */
|
|
@@ -13,6 +13,8 @@ export interface WizardNavProps {
|
|
|
13
13
|
isExpanded?: boolean;
|
|
14
14
|
/** True to return the inner list without the wrapping navigation element */
|
|
15
15
|
isInnerList?: boolean;
|
|
16
|
+
/** Additional classes spread to the wizard nav */
|
|
17
|
+
className?: string;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const WizardNav: React.FunctionComponent<WizardNavProps> = ({
|
|
@@ -20,11 +22,13 @@ export const WizardNav: React.FunctionComponent<WizardNavProps> = ({
|
|
|
20
22
|
'aria-label': ariaLabel,
|
|
21
23
|
'aria-labelledby': ariaLabelledBy,
|
|
22
24
|
isExpanded = false,
|
|
23
|
-
isInnerList = false
|
|
25
|
+
isInnerList = false,
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
24
28
|
}: WizardNavProps) => {
|
|
25
29
|
if (isInnerList) {
|
|
26
30
|
return (
|
|
27
|
-
<ol className={css(styles.wizardNavList)} role="list">
|
|
31
|
+
<ol className={css(styles.wizardNavList, className)} role="list" {...props}>
|
|
28
32
|
{children}
|
|
29
33
|
</ol>
|
|
30
34
|
);
|
|
@@ -32,9 +36,10 @@ export const WizardNav: React.FunctionComponent<WizardNavProps> = ({
|
|
|
32
36
|
|
|
33
37
|
return (
|
|
34
38
|
<nav
|
|
35
|
-
className={css(styles.wizardNav, isExpanded && styles.modifiers.expanded)}
|
|
39
|
+
className={css(styles.wizardNav, isExpanded && styles.modifiers.expanded, className)}
|
|
36
40
|
aria-label={ariaLabel}
|
|
37
41
|
aria-labelledby={ariaLabelledBy}
|
|
42
|
+
{...props}
|
|
38
43
|
>
|
|
39
44
|
<ol className={css(styles.wizardNavList)} role="list">
|
|
40
45
|
{children}
|
|
@@ -8,7 +8,11 @@ import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclam
|
|
|
8
8
|
import { OUIAProps, useOUIAProps } from '../../helpers';
|
|
9
9
|
import { WizardNavItemStatus } from './types';
|
|
10
10
|
|
|
11
|
-
export interface WizardNavItemProps
|
|
11
|
+
export interface WizardNavItemProps
|
|
12
|
+
extends Omit<React.HTMLProps<HTMLLIElement>, 'onClick' | 'id' | 'content' | 'type'>,
|
|
13
|
+
OUIAProps {
|
|
14
|
+
/** Additional classes spread to the wizard nav item */
|
|
15
|
+
className?: string;
|
|
12
16
|
/** Can nest a WizardNav component for substeps */
|
|
13
17
|
children?: React.ReactNode;
|
|
14
18
|
/** The content to display in the navigation item */
|
|
@@ -53,7 +57,9 @@ export const WizardNavItem = ({
|
|
|
53
57
|
status = 'default',
|
|
54
58
|
target,
|
|
55
59
|
ouiaId,
|
|
56
|
-
ouiaSafe = true
|
|
60
|
+
ouiaSafe = true,
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
57
63
|
}: WizardNavItemProps) => {
|
|
58
64
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
59
65
|
const ouiaProps = useOUIAProps(WizardNavItem.displayName, ouiaId, ouiaSafe);
|
|
@@ -72,8 +78,10 @@ export const WizardNavItem = ({
|
|
|
72
78
|
className={css(
|
|
73
79
|
styles.wizardNavItem,
|
|
74
80
|
isExpandable && styles.modifiers.expandable,
|
|
75
|
-
isExpandable && isExpanded && styles.modifiers.expanded
|
|
81
|
+
isExpandable && isExpanded && styles.modifiers.expanded,
|
|
82
|
+
className
|
|
76
83
|
)}
|
|
84
|
+
{...props}
|
|
77
85
|
>
|
|
78
86
|
<NavItemComponent
|
|
79
87
|
{...(NavItemComponent === 'a'
|
|
@@ -97,7 +105,7 @@ export const WizardNavItem = ({
|
|
|
97
105
|
>
|
|
98
106
|
{status === WizardNavItemStatus.Error && (
|
|
99
107
|
<>
|
|
100
|
-
<span className="pf-
|
|
108
|
+
<span className="pf-v6-screen-reader">, {status}</span>
|
|
101
109
|
<span className={css(styles.wizardNavLinkStatusIcon)}>
|
|
102
110
|
<ExclamationCircleIcon />
|
|
103
111
|
</span>
|