@patternfly/react-core 6.3.1-prerelease.15 → 6.3.1-prerelease.17
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/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 +1 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts +4 -19
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.d.ts +4 -17
- package/dist/esm/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuContainer.js.map +1 -1
- package/dist/esm/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItemAction.js +1 -2
- package/dist/esm/components/Menu/MenuItemAction.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +4 -25
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Tabs/OverflowTab.d.ts +4 -25
- package/dist/esm/components/Tabs/OverflowTab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/OverflowTab.js.map +1 -1
- package/dist/esm/helpers/Popper/Popper.d.ts +24 -20
- package/dist/esm/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/helpers/Popper/Popper.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +4 -19
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/Menu/MenuContainer.d.ts +4 -17
- package/dist/js/components/Menu/MenuContainer.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuContainer.js.map +1 -1
- package/dist/js/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItemAction.js +1 -2
- package/dist/js/components/Menu/MenuItemAction.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +4 -25
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Tabs/OverflowTab.d.ts +4 -25
- package/dist/js/components/Tabs/OverflowTab.d.ts.map +1 -1
- package/dist/js/components/Tabs/OverflowTab.js.map +1 -1
- package/dist/js/helpers/Popper/Popper.d.ts +24 -20
- package/dist/js/helpers/Popper/Popper.d.ts.map +1 -1
- package/dist/js/helpers/Popper/Popper.js.map +1 -1
- package/dist/umd/assets/{output-BwG6uaWN.css → output-YHAJASF9.css} +18987 -18987
- package/dist/umd/react-core.min.js +1 -1
- 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/Dropdown/Dropdown.tsx +4 -20
- package/src/components/Dropdown/examples/Dropdown.md +2 -2
- package/src/components/Menu/MenuContainer.tsx +4 -17
- package/src/components/Menu/MenuItemAction.tsx +3 -2
- package/src/components/Menu/examples/Menu.md +3 -3
- package/src/components/Select/Select.tsx +4 -26
- package/src/components/Select/examples/Select.md +1 -1
- package/src/components/Tabs/OverflowTab.tsx +4 -26
- package/src/components/Tabs/examples/Tabs.md +27 -27
- package/src/helpers/Popper/Popper.tsx +25 -20
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.3.1-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.3.1-prerelease.16","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.3.1-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.3.1-prerelease.16","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.3.1-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.3.1-prerelease.16","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.3.1-prerelease.
|
|
3
|
+
"version": "6.3.1-prerelease.17",
|
|
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",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18 || ^19",
|
|
64
64
|
"react-dom": "^17 || ^18 || ^19"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "989ce1313673f6ce063852f1fb03158e8e8c738b"
|
|
67
67
|
}
|
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
import { forwardRef, useEffect, useRef } from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import { Menu, MenuContent, MenuProps } from '../Menu';
|
|
4
|
-
import { Popper } from '../../helpers/Popper/Popper';
|
|
4
|
+
import { Popper, PopperOptions } from '../../helpers/Popper/Popper';
|
|
5
5
|
import { useOUIAProps, OUIAProps, onToggleArrowKeydownDefault } from '../../helpers';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
direction?: 'up' | 'down';
|
|
10
|
-
/** Horizontal position of the popper */
|
|
11
|
-
position?: 'right' | 'left' | 'center' | 'start' | 'end';
|
|
12
|
-
/** Custom width of the popper. If the value is "trigger", it will set the width to the dropdown toggle's width */
|
|
13
|
-
width?: string | 'trigger';
|
|
14
|
-
/** Minimum width of the popper. If the value is "trigger", it will set the min width to the dropdown toggle's width */
|
|
15
|
-
minWidth?: string | 'trigger';
|
|
16
|
-
/** Maximum width of the popper. If the value is "trigger", it will set the max width to the dropdown toggle's width */
|
|
17
|
-
maxWidth?: string | 'trigger';
|
|
18
|
-
/** Enable to flip the popper when it reaches the boundary */
|
|
19
|
-
enableFlip?: boolean;
|
|
20
|
-
/** The container to append the popper to. Defaults to document.body. */
|
|
21
|
-
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
22
|
-
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
23
|
-
preventOverflow?: boolean;
|
|
24
|
-
}
|
|
7
|
+
/** @deprecated Use PopperOptions instead */
|
|
8
|
+
export type DropdownPopperProps = PopperOptions;
|
|
25
9
|
|
|
26
10
|
export interface DropdownToggleProps {
|
|
27
11
|
/** Dropdown toggle node. */
|
|
@@ -66,7 +50,7 @@ export interface DropdownProps extends MenuProps, OUIAProps {
|
|
|
66
50
|
/** z-index of the dropdown menu */
|
|
67
51
|
zIndex?: number;
|
|
68
52
|
/** Additional properties to pass to the Popper */
|
|
69
|
-
popperProps?:
|
|
53
|
+
popperProps?: PopperOptions;
|
|
70
54
|
/** Height of the dropdown menu */
|
|
71
55
|
menuHeight?: string;
|
|
72
56
|
/** Maximum height of dropdown menu */
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { onToggleArrowKeydownDefault, Popper } from '../../helpers';
|
|
3
|
+
import type { PopperOptions } from '../../helpers/Popper/Popper';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
direction?: 'up' | 'down';
|
|
7
|
-
/** Horizontal position of the popper */
|
|
8
|
-
position?: 'right' | 'left' | 'center' | 'start' | 'end';
|
|
9
|
-
/** Custom width of the popper. If the value is "trigger", it will set the width to the dropdown toggle's width */
|
|
10
|
-
width?: string | 'trigger';
|
|
11
|
-
/** Minimum width of the popper. If the value is "trigger", it will set the min width to the dropdown toggle's width */
|
|
12
|
-
minWidth?: string | 'trigger';
|
|
13
|
-
/** Maximum width of the popper. If the value is "trigger", it will set the max width to the dropdown toggle's width */
|
|
14
|
-
maxWidth?: string | 'trigger';
|
|
15
|
-
/** Enable to flip the popper when it reaches the boundary */
|
|
16
|
-
enableFlip?: boolean;
|
|
17
|
-
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
18
|
-
preventOverflow?: boolean;
|
|
19
|
-
}
|
|
5
|
+
/** @deprecated Use PopperOptions instead */
|
|
6
|
+
export type MenuPopperProps = PopperOptions;
|
|
20
7
|
|
|
21
8
|
export interface MenuContainerProps {
|
|
22
9
|
/** Menu to be rendered */
|
|
@@ -39,7 +26,7 @@ export interface MenuContainerProps {
|
|
|
39
26
|
/** z-index of the dropdown menu */
|
|
40
27
|
zIndex?: number;
|
|
41
28
|
/** Additional properties to pass to the Popper */
|
|
42
|
-
popperProps?:
|
|
29
|
+
popperProps?: PopperOptions;
|
|
43
30
|
/** @beta Flag indicating the first menu item should be focused after opening the dropdown. */
|
|
44
31
|
shouldFocusFirstItemOnOpen?: boolean;
|
|
45
32
|
/** Flag indicating if scroll on focus of the first menu item should occur. */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Menu/menu';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
|
-
import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon';
|
|
5
4
|
import { MenuContext, MenuItemContext } from './MenuContext';
|
|
6
5
|
import { Button } from '../Button';
|
|
7
6
|
export interface MenuItemActionProps extends React.HTMLProps<HTMLDivElement> {
|
|
@@ -60,9 +59,11 @@ const MenuItemActionBase: React.FunctionComponent<MenuItemActionProps> = ({
|
|
|
60
59
|
ref={innerRef}
|
|
61
60
|
role="menuitem"
|
|
62
61
|
variant="plain"
|
|
62
|
+
isFavorite={isFavorited !== null}
|
|
63
|
+
isFavorited={isFavorited ?? false}
|
|
63
64
|
tabIndex={-1}
|
|
64
65
|
isDisabled={isDisabled || isDisabledContext}
|
|
65
|
-
icon={
|
|
66
|
+
icon={isFavorited === null ? icon : undefined}
|
|
66
67
|
/>
|
|
67
68
|
</div>
|
|
68
69
|
);
|
|
@@ -14,8 +14,8 @@ propComponents:
|
|
|
14
14
|
'MenuSearchInput',
|
|
15
15
|
'MenuGroup',
|
|
16
16
|
'MenuContainer',
|
|
17
|
-
'
|
|
18
|
-
'
|
|
17
|
+
'TooltipProps',
|
|
18
|
+
'PopperOptions'
|
|
19
19
|
]
|
|
20
20
|
ouia: true
|
|
21
21
|
---
|
|
@@ -241,4 +241,4 @@ Router links can be used for in-app linking in React environments to prevent pag
|
|
|
241
241
|
>
|
|
242
242
|
{...Link Content}
|
|
243
243
|
</MenuItem>
|
|
244
|
-
```
|
|
244
|
+
```
|
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
import { forwardRef, useEffect, useRef } from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import { Menu, MenuContent, MenuProps } from '../Menu';
|
|
4
|
-
import { Popper } from '../../helpers/Popper/Popper';
|
|
4
|
+
import { Popper, PopperOptions } from '../../helpers/Popper/Popper';
|
|
5
5
|
import { getOUIAProps, OUIAProps, getDefaultOUIAId, onToggleArrowKeydownDefault } from '../../helpers';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
direction?: 'up' | 'down';
|
|
10
|
-
/** Horizontal position of the popper */
|
|
11
|
-
position?: 'right' | 'left' | 'center' | 'start' | 'end';
|
|
12
|
-
/** Custom width of the popper. If the value is "trigger", it will set the width to the select toggle's width */
|
|
13
|
-
width?: string | 'trigger';
|
|
14
|
-
/** Minimum width of the popper. If the value is "trigger", it will set the min width to the select toggle's width */
|
|
15
|
-
minWidth?: string | 'trigger';
|
|
16
|
-
/** Maximum width of the popper. If the value is "trigger", it will set the max width to the select toggle's width */
|
|
17
|
-
maxWidth?: string | 'trigger';
|
|
18
|
-
/** Enable to flip the popper when it reaches the boundary */
|
|
19
|
-
enableFlip?: boolean;
|
|
20
|
-
/** The container to append the select to. Defaults to document.body.
|
|
21
|
-
* If your select is being cut off you can append it to an element higher up the DOM tree.
|
|
22
|
-
* Some examples:
|
|
23
|
-
* appendTo="inline"
|
|
24
|
-
* appendTo={() => document.body}
|
|
25
|
-
* appendTo={document.getElementById('target')}
|
|
26
|
-
*/
|
|
27
|
-
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
28
|
-
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
29
|
-
preventOverflow?: boolean;
|
|
30
|
-
}
|
|
7
|
+
/** @deprecated Use PopperOptions instead */
|
|
8
|
+
export type SelectPopperProps = PopperOptions;
|
|
31
9
|
|
|
32
10
|
export interface SelectToggleProps {
|
|
33
11
|
/** Select toggle node. */
|
|
@@ -75,7 +53,7 @@ export interface SelectProps extends MenuProps, OUIAProps {
|
|
|
75
53
|
/** Determines the accessible role of the select. For a checkbox select pass in "menu". */
|
|
76
54
|
role?: string;
|
|
77
55
|
/** Additional properties to pass to the popper */
|
|
78
|
-
popperProps?:
|
|
56
|
+
popperProps?: PopperOptions;
|
|
79
57
|
/** Height of the select menu */
|
|
80
58
|
menuHeight?: string;
|
|
81
59
|
/** Maximum height of select menu */
|
|
@@ -4,7 +4,7 @@ section: components
|
|
|
4
4
|
subsection: menus
|
|
5
5
|
cssPrefix: pf-v6-c-select
|
|
6
6
|
propComponents:
|
|
7
|
-
['Select', 'SelectOption', 'SelectGroup', 'SelectList', 'MenuToggle', 'SelectToggleProps', '
|
|
7
|
+
['Select', 'SelectOption', 'SelectGroup', 'SelectList', 'MenuToggle', 'SelectToggleProps', 'PopperOptions']
|
|
8
8
|
ouia: true
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -2,36 +2,14 @@ import { Fragment, useContext, useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Tabs/tabs';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
5
|
-
import { Popper } from '../../helpers';
|
|
5
|
+
import { Popper, PopperOptions } from '../../helpers';
|
|
6
6
|
import { Menu, MenuContent, MenuList, MenuItem } from '../Menu';
|
|
7
7
|
import { TabsContext } from './TabsContext';
|
|
8
8
|
import { TabProps } from './Tab';
|
|
9
9
|
import { TabTitleText } from './TabTitleText';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
direction?: 'up' | 'down';
|
|
14
|
-
/** Horizontal position of the popper */
|
|
15
|
-
position?: 'right' | 'left' | 'center' | 'start' | 'end';
|
|
16
|
-
/** Custom width of the popper. If the value is "trigger", it will set the width to the select toggle's width */
|
|
17
|
-
width?: string | 'trigger';
|
|
18
|
-
/** Minimum width of the popper. If the value is "trigger", it will set the min width to the select toggle's width */
|
|
19
|
-
minWidth?: string | 'trigger';
|
|
20
|
-
/** Maximum width of the popper. If the value is "trigger", it will set the max width to the select toggle's width */
|
|
21
|
-
maxWidth?: string | 'trigger';
|
|
22
|
-
/** Enable to flip the popper when it reaches the boundary */
|
|
23
|
-
enableFlip?: boolean;
|
|
24
|
-
/** The container to append the select to. Defaults to document.body.
|
|
25
|
-
* If your select is being cut off you can append it to an element higher up the DOM tree.
|
|
26
|
-
* Some examples:
|
|
27
|
-
* appendTo="inline"
|
|
28
|
-
* appendTo={() => document.body}
|
|
29
|
-
* appendTo={document.getElementById('target')}
|
|
30
|
-
*/
|
|
31
|
-
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
32
|
-
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
|
|
33
|
-
preventOverflow?: boolean;
|
|
34
|
-
}
|
|
11
|
+
/** @deprecated Use PopperOptions instead */
|
|
12
|
+
export type HorizontalOverflowPopperProps = PopperOptions;
|
|
35
13
|
|
|
36
14
|
export interface OverflowTabProps extends React.HTMLProps<HTMLLIElement> {
|
|
37
15
|
/** Additional classes added to the overflow tab */
|
|
@@ -51,7 +29,7 @@ export interface OverflowTabProps extends React.HTMLProps<HTMLLIElement> {
|
|
|
51
29
|
/** Time in ms to wait before firing the toggles' focus event. Defaults to 0 */
|
|
52
30
|
focusTimeoutDelay?: number;
|
|
53
31
|
/** Additional props to spread to the popper menu. */
|
|
54
|
-
popperProps?:
|
|
32
|
+
popperProps?: PopperOptions;
|
|
55
33
|
}
|
|
56
34
|
|
|
57
35
|
export const OverflowTab: React.FunctionComponent<OverflowTabProps> = ({
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
id: Tabs
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-v6-c-tabs
|
|
5
|
-
propComponents: ['Tabs', 'Tab', 'TabContent', 'TabContentBody', 'TabTitleText', 'TabTitleIcon', 'HorizontalOverflowObject', '
|
|
5
|
+
propComponents: ['Tabs', 'Tab', 'TabContent', 'TabContentBody', 'TabTitleText', 'TabTitleIcon', 'HorizontalOverflowObject', 'TabAction', 'PopperOptions']
|
|
6
6
|
ouia: true
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -22,16 +22,16 @@ import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
|
22
22
|
|
|
23
23
|
A `<Tabs>` component contains multiple `<Tab>` components that may be used to navigate between sets of content within a page.
|
|
24
24
|
|
|
25
|
-
You can adjust a tab in the following ways:
|
|
25
|
+
You can adjust a tab in the following ways:
|
|
26
26
|
|
|
27
27
|
- To label a tab with text, pass a `<TabTitleText>` component into the `title` property of a `<Tab>`.
|
|
28
|
-
- To disable a tab, use the `isDisabled` property. Tabs using `isDisabled` are not perceivable or operable by users navigating via assistive technologies.
|
|
28
|
+
- To disable a tab, use the `isDisabled` property. Tabs using `isDisabled` are not perceivable or operable by users navigating via assistive technologies.
|
|
29
29
|
- To disable a tab, but keep it perceivable to assistive technology users, use the `isAriaDisabled` property. If a disabled tab has a tooltip, use this property instead of `isDisabled`.
|
|
30
|
-
- To add a tooltip to an aria-disabled tab, use the `tooltip` property.
|
|
30
|
+
- To add a tooltip to an aria-disabled tab, use the `tooltip` property.
|
|
31
31
|
|
|
32
|
-
Tabs can be styled as 'default' or 'boxed':
|
|
32
|
+
Tabs can be styled as 'default' or 'boxed':
|
|
33
33
|
|
|
34
|
-
- Default tabs do not have any borders and use a bottom line to distinguish between a selected tab, a hovered tab, and an inactive tab.
|
|
34
|
+
- Default tabs do not have any borders and use a bottom line to distinguish between a selected tab, a hovered tab, and an inactive tab.
|
|
35
35
|
- Boxed tabs are outlined to emphasize the area that a tab spans. To preview boxed tabs in the following examples, select the 'isBox' checkbox, which sets the `isBox` property to true.
|
|
36
36
|
|
|
37
37
|
```ts file="./TabsDefault.tsx"
|
|
@@ -39,7 +39,7 @@ Tabs can be styled as 'default' or 'boxed':
|
|
|
39
39
|
|
|
40
40
|
### Boxed secondary tabs
|
|
41
41
|
|
|
42
|
-
To change the background color of boxed tabs or the tab content, use the `variant` property.
|
|
42
|
+
To change the background color of boxed tabs or the tab content, use the `variant` property.
|
|
43
43
|
|
|
44
44
|
Toggle the tab color by selecting the 'Tabs secondary variant' checkbox in the following example.
|
|
45
45
|
|
|
@@ -50,14 +50,14 @@ Toggle the tab color by selecting the 'Tabs secondary variant' checkbox in the f
|
|
|
50
50
|
|
|
51
51
|
Vertical tabs are placed on the left-hand side of a page or container and may appear in both 'default' and 'boxed' tab variations.
|
|
52
52
|
|
|
53
|
-
To style tabs vertically, use the `isVertical` property.
|
|
53
|
+
To style tabs vertically, use the `isVertical` property.
|
|
54
54
|
|
|
55
55
|
```ts file="./TabsVertical.tsx"
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Vertical expandable tabs
|
|
59
59
|
|
|
60
|
-
Vertical tabs can be made expandable to save space. Users can select the caret to expand a menu and switch between tabs.
|
|
60
|
+
Vertical tabs can be made expandable to save space. Users can select the caret to expand a menu and switch between tabs.
|
|
61
61
|
|
|
62
62
|
Expandable tabs can be enabled at different breakpoints. The following example passes `expandable={{ default: 'expandable', md: 'nonExpandable', lg: 'expandable' }}` into the `<Tabs>` component.
|
|
63
63
|
|
|
@@ -75,14 +75,14 @@ To flag the default expanded state for uncontrolled tabs, use the `defaultIsExpa
|
|
|
75
75
|
|
|
76
76
|
### Default overflow tabs
|
|
77
77
|
|
|
78
|
-
By default, overflow is applied when there are too many tabs for the width of the container they are in. This overflow can be navigated by side-scrolling within the tabs section, or by selecting the left and right arrows.
|
|
78
|
+
By default, overflow is applied when there are too many tabs for the width of the container they are in. This overflow can be navigated by side-scrolling within the tabs section, or by selecting the left and right arrows.
|
|
79
79
|
|
|
80
80
|
```ts file="./TabsDefaultOverflow.tsx"
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
### Horizontal overflow tabs
|
|
84
84
|
|
|
85
|
-
Horizontal overflow can be used instead of the default application. To navigate horizontal overflow tabs users can select the last tab, labeled “more”, to see the overflowed content.
|
|
85
|
+
Horizontal overflow can be used instead of the default application. To navigate horizontal overflow tabs users can select the last tab, labeled “more”, to see the overflowed content.
|
|
86
86
|
|
|
87
87
|
To enable horizontal overflow, use the `isOverflowHorizontal` property.
|
|
88
88
|
|
|
@@ -102,7 +102,7 @@ The tooltip should also have the `id` property passed in. The value of `id` shou
|
|
|
102
102
|
|
|
103
103
|
### Uncontrolled tabs
|
|
104
104
|
|
|
105
|
-
To allow the `<Tabs>` component to manage setting the active tab and displaying correct content itself, use uncontrolled tabs, as shown in the following example.
|
|
105
|
+
To allow the `<Tabs>` component to manage setting the active tab and displaying correct content itself, use uncontrolled tabs, as shown in the following example.
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
```ts file="./TabsUncontrolled.tsx"
|
|
@@ -124,7 +124,7 @@ To adjust the left padding of tabs, use the `usePageInsets` property. This prope
|
|
|
124
124
|
|
|
125
125
|
### With icons and text
|
|
126
126
|
|
|
127
|
-
You can render different content in the `title` property of a tab to add icons and text.
|
|
127
|
+
You can render different content in the `title` property of a tab to add icons and text.
|
|
128
128
|
|
|
129
129
|
To add an icon to a tab, pass a `<TabTitleIcon>` component that contains the icon of your choice into the `title`. To use an icon alongside styled text, keep the text in the `<TabTitleText>` component.
|
|
130
130
|
|
|
@@ -133,53 +133,53 @@ To add an icon to a tab, pass a `<TabTitleIcon>` component that contains the ico
|
|
|
133
133
|
|
|
134
134
|
### Subtabs
|
|
135
135
|
|
|
136
|
-
Use subtabs within other components, like modals. Subtabs have less visually prominent styling.
|
|
136
|
+
Use subtabs within other components, like modals. Subtabs have less visually prominent styling.
|
|
137
137
|
|
|
138
|
-
To apply subtab styling to tabs, use the `isSubtab` property.
|
|
138
|
+
To apply subtab styling to tabs, use the `isSubtab` property.
|
|
139
139
|
|
|
140
140
|
```ts file="./TabsSubtabs.tsx"
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
### Filled tabs with icons
|
|
144
144
|
|
|
145
|
-
To allow tabs to fill the available width of the page section, use the `isFilled` property.
|
|
145
|
+
To allow tabs to fill the available width of the page section, use the `isFilled` property.
|
|
146
146
|
|
|
147
147
|
```ts file="./TabsFilledWithIcons.tsx"
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
### Tabs linked to nav elements
|
|
151
151
|
|
|
152
|
-
To let tabs link to nav elements, pass `{TabsComponent.nav}` into the `component` property.
|
|
152
|
+
To let tabs link to nav elements, pass `{TabsComponent.nav}` into the `component` property.
|
|
153
153
|
|
|
154
|
-
Nav tabs should use the `href` property to link the tab to the URL of another page or page section. A tab with an `href` will render as an `<a>` instead of a `<button>`.
|
|
154
|
+
Nav tabs should use the `href` property to link the tab to the URL of another page or page section. A tab with an `href` will render as an `<a>` instead of a `<button>`.
|
|
155
155
|
|
|
156
156
|
```ts file="./TabsNav.tsx"
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
### Subtabs linked to nav elements
|
|
160
160
|
|
|
161
|
-
Subtabs can also link to nav elements.
|
|
161
|
+
Subtabs can also link to nav elements.
|
|
162
162
|
|
|
163
163
|
```ts file="./TabsNavSubtab.tsx"
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
### With separate content
|
|
167
167
|
|
|
168
|
-
If a `<TabContent>` component is defined outside of a `<Tabs>` component, use the `tabContentRef` and `tabContentId` properties
|
|
168
|
+
If a `<TabContent>` component is defined outside of a `<Tabs>` component, use the `tabContentRef` and `tabContentId` properties
|
|
169
169
|
|
|
170
170
|
```ts file="./TabsSeparateContent.tsx"
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
### With tab content with body and padding
|
|
174
174
|
|
|
175
|
-
To add a content body to a `<TabContent>` component, pass a `<TabContentBody>`. To add padding to the body section, use the `hasPadding` property.
|
|
175
|
+
To add a content body to a `<TabContent>` component, pass a `<TabContentBody>`. To add padding to the body section, use the `hasPadding` property.
|
|
176
176
|
|
|
177
177
|
```ts file="./TabsContentWithBodyPadding.tsx"
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
### Children mounting on click
|
|
181
181
|
|
|
182
|
-
To mount tab children (add to the DOM) when a tab is clicked, use the `mountOnEnter` property.
|
|
182
|
+
To mount tab children (add to the DOM) when a tab is clicked, use the `mountOnEnter` property.
|
|
183
183
|
|
|
184
184
|
Note that this property does not create the tab children until the tab is clicked, so they are not preloaded into the DOM.
|
|
185
185
|
|
|
@@ -197,30 +197,30 @@ To unmount tab children (remove from the DOM) when they are no longer visible, u
|
|
|
197
197
|
|
|
198
198
|
You may control tabs from outside of the tabs component. For example, select the "Hide tab 2" button below to make "Tab item 2" invisible.
|
|
199
199
|
|
|
200
|
-
The tab its content should only be mounted when the tab is visible.
|
|
200
|
+
The tab its content should only be mounted when the tab is visible.
|
|
201
201
|
|
|
202
202
|
```ts file="./TabsToggledSeparateContent.tsx"
|
|
203
203
|
```
|
|
204
204
|
|
|
205
205
|
### Dynamic tabs
|
|
206
206
|
|
|
207
|
-
To enable closeable tabs, pass the `onClose` property to the `<Tabs>` component. To enable a button that adds new tabs, pass the `onAdd` property to `<Tabs>`.
|
|
207
|
+
To enable closeable tabs, pass the `onClose` property to the `<Tabs>` component. To enable a button that adds new tabs, pass the `onAdd` property to `<Tabs>`.
|
|
208
208
|
|
|
209
209
|
```ts file="./TabsDynamic.tsx"
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
### With help action popover
|
|
213
213
|
|
|
214
|
-
You may add a help action to a tab to provide users with additional context in a popover.
|
|
214
|
+
You may add a help action to a tab to provide users with additional context in a popover.
|
|
215
215
|
|
|
216
|
-
To render an action beside the tab content, use the `actions` property of a `<Tab>`. Pass a popover and a `<TabsAction>` component into the `actions` property.
|
|
216
|
+
To render an action beside the tab content, use the `actions` property of a `<Tab>`. Pass a popover and a `<TabsAction>` component into the `actions` property.
|
|
217
217
|
|
|
218
218
|
```ts file="./TabsHelp.tsx"
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
### With help and close actions
|
|
222
222
|
|
|
223
|
-
To add multiple actions to a tab, create a `<TabAction>` component for each action.
|
|
223
|
+
To add multiple actions to a tab, create a `<TabAction>` component for each action.
|
|
224
224
|
|
|
225
225
|
The following example passes in both help popover and close actions.
|
|
226
226
|
|
|
@@ -47,24 +47,8 @@ const getOppositePlacement = (placement: Placement): any =>
|
|
|
47
47
|
export const getOpacityTransition = (animationDuration: number) =>
|
|
48
48
|
`opacity ${animationDuration}ms cubic-bezier(.54, 1.5, .38, 1.11)`;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* Trigger reference element to which the popper is relatively placed to.
|
|
53
|
-
*/
|
|
54
|
-
trigger?: React.ReactNode;
|
|
55
|
-
/**
|
|
56
|
-
* A reference to the trigger reference element that can be passed instead of or along
|
|
57
|
-
* with the trigger prop. When passed along with the trigger prop, the div element that
|
|
58
|
-
* wraps the trigger will be removed.
|
|
59
|
-
*/
|
|
60
|
-
triggerRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
|
|
61
|
-
/** The popper (menu/tooltip/popover) element */
|
|
62
|
-
popper: React.ReactElement<any>;
|
|
63
|
-
/**
|
|
64
|
-
* Reference to the popper (menu/tooltip/popover) element.
|
|
65
|
-
* Passing this prop will remove the wrapper div element from the popper.
|
|
66
|
-
*/
|
|
67
|
-
popperRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
|
|
50
|
+
/** Properties of Popper that can be used to customize its behavior. */
|
|
51
|
+
export interface PopperOptions {
|
|
68
52
|
/** popper direction */
|
|
69
53
|
direction?: 'up' | 'down';
|
|
70
54
|
/** popper position */
|
|
@@ -81,8 +65,6 @@ export interface PopperProps {
|
|
|
81
65
|
appendTo?: HTMLElement | (() => HTMLElement) | 'inline';
|
|
82
66
|
/** z-index of the popper element */
|
|
83
67
|
zIndex?: number;
|
|
84
|
-
/** True to make the popper visible */
|
|
85
|
-
isVisible?: boolean;
|
|
86
68
|
/**
|
|
87
69
|
* Map class names to positions, for example:
|
|
88
70
|
* {
|
|
@@ -179,6 +161,29 @@ export interface PopperProps {
|
|
|
179
161
|
preventOverflow?: boolean;
|
|
180
162
|
}
|
|
181
163
|
|
|
164
|
+
/** Extends PopperOptions */
|
|
165
|
+
export interface PopperProps extends PopperOptions {
|
|
166
|
+
/**
|
|
167
|
+
* Trigger reference element to which the popper is relatively placed to.
|
|
168
|
+
*/
|
|
169
|
+
trigger?: React.ReactNode;
|
|
170
|
+
/**
|
|
171
|
+
* A reference to the trigger reference element that can be passed instead of or along
|
|
172
|
+
* with the trigger prop. When passed along with the trigger prop, the div element that
|
|
173
|
+
* wraps the trigger will be removed.
|
|
174
|
+
*/
|
|
175
|
+
triggerRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
|
|
176
|
+
/** The popper (menu/tooltip/popover) element */
|
|
177
|
+
popper: React.ReactElement<any>;
|
|
178
|
+
/**
|
|
179
|
+
* Reference to the popper (menu/tooltip/popover) element.
|
|
180
|
+
* Passing this prop will remove the wrapper div element from the popper.
|
|
181
|
+
*/
|
|
182
|
+
popperRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
|
|
183
|
+
/** True to make the popper visible */
|
|
184
|
+
isVisible?: boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
182
187
|
export const Popper: React.FunctionComponent<PopperProps> = ({
|
|
183
188
|
trigger,
|
|
184
189
|
popper,
|