@patternfly/react-core 5.0.0-alpha.8 → 5.0.0-alpha.9
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 +11 -0
- package/components/BackToTop/BackToTop.d.ts +1 -1
- package/components/BackToTop/BackToTop.d.ts.map +1 -1
- package/components/Button/Button.d.ts +1 -1
- package/components/Button/Button.d.ts.map +1 -1
- package/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/components/CodeBlock/CodeBlock.js +2 -2
- package/components/CodeBlock/CodeBlock.js.map +1 -1
- package/components/Dropdown/DropdownToggleCheckbox.d.ts.map +1 -1
- package/components/Dropdown/DropdownToggleCheckbox.js +1 -1
- package/components/Dropdown/DropdownToggleCheckbox.js.map +1 -1
- package/components/Icon/Icon.d.ts.map +1 -1
- package/components/Icon/Icon.js +1 -1
- package/components/Icon/Icon.js.map +1 -1
- package/components/Menu/MenuGroup.d.ts +1 -1
- package/components/Menu/MenuGroup.d.ts.map +1 -1
- package/components/Menu/MenuInput.d.ts +1 -1
- package/components/Menu/MenuInput.d.ts.map +1 -1
- package/components/Menu/MenuItem.d.ts +1 -1
- package/components/Menu/MenuItemAction.d.ts +1 -1
- package/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/components/MenuToggle/MenuToggle.d.ts +1 -1
- package/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/components/NotificationBadge/NotificationBadge.d.ts +0 -2
- package/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/components/NotificationBadge/NotificationBadge.js +1 -1
- package/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/components/Select/SelectMenu.d.ts +1 -0
- package/components/Select/SelectMenu.d.ts.map +1 -1
- package/components/Select/SelectMenu.js.map +1 -1
- package/components/Spinner/Spinner.d.ts +1 -3
- package/components/Spinner/Spinner.d.ts.map +1 -1
- package/components/Spinner/Spinner.js +3 -6
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/Tabs/Tab.d.ts +1 -1
- package/components/Tabs/Tab.d.ts.map +1 -1
- package/components/Tabs/TabContent.d.ts +1 -1
- package/components/Tabs/TabContent.d.ts.map +1 -1
- package/components/TextArea/TextArea.d.ts +1 -1
- package/components/TextArea/TextArea.d.ts.map +1 -1
- package/components/TextInput/TextInput.d.ts +1 -1
- package/components/TextInput/TextInput.d.ts.map +1 -1
- package/components/TextInputGroup/TextInputGroupMain.d.ts +2 -2
- package/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/components/TextInputGroup/TextInputGroupMain.js +2 -1
- package/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/esm/components/BackToTop/BackToTop.d.ts +1 -1
- package/dist/esm/components/BackToTop/BackToTop.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.d.ts +1 -1
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/esm/components/CodeBlock/CodeBlock.js +2 -2
- package/dist/esm/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/esm/components/Dropdown/DropdownToggleCheckbox.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/DropdownToggleCheckbox.js +1 -1
- package/dist/esm/components/Dropdown/DropdownToggleCheckbox.js.map +1 -1
- package/dist/esm/components/Icon/Icon.d.ts.map +1 -1
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Menu/MenuGroup.d.ts +1 -1
- package/dist/esm/components/Menu/MenuGroup.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuInput.d.ts +1 -1
- package/dist/esm/components/Menu/MenuInput.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts +1 -1
- package/dist/esm/components/Menu/MenuItemAction.d.ts +1 -1
- package/dist/esm/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts +0 -2
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/esm/components/Select/SelectMenu.d.ts +1 -0
- package/dist/esm/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectMenu.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.d.ts +1 -3
- package/dist/esm/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +3 -6
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Tabs/Tab.d.ts +1 -1
- package/dist/esm/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabContent.d.ts +1 -1
- package/dist/esm/components/Tabs/TabContent.d.ts.map +1 -1
- package/dist/esm/components/TextArea/TextArea.d.ts +1 -1
- package/dist/esm/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/esm/components/TextInput/TextInput.d.ts +1 -1
- package/dist/esm/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +2 -2
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +2 -1
- package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/js/components/BackToTop/BackToTop.d.ts +1 -1
- package/dist/js/components/BackToTop/BackToTop.d.ts.map +1 -1
- package/dist/js/components/Button/Button.d.ts +1 -1
- package/dist/js/components/Button/Button.d.ts.map +1 -1
- package/dist/js/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/js/components/CodeBlock/CodeBlock.js +2 -2
- package/dist/js/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggleCheckbox.d.ts.map +1 -1
- package/dist/js/components/Dropdown/DropdownToggleCheckbox.js +1 -1
- package/dist/js/components/Dropdown/DropdownToggleCheckbox.js.map +1 -1
- package/dist/js/components/Icon/Icon.d.ts.map +1 -1
- package/dist/js/components/Icon/Icon.js +1 -1
- package/dist/js/components/Icon/Icon.js.map +1 -1
- package/dist/js/components/Menu/MenuGroup.d.ts +1 -1
- package/dist/js/components/Menu/MenuGroup.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuInput.d.ts +1 -1
- package/dist/js/components/Menu/MenuInput.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts +1 -1
- package/dist/js/components/Menu/MenuItemAction.d.ts +1 -1
- package/dist/js/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts +0 -2
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/js/components/Select/SelectMenu.d.ts +1 -0
- package/dist/js/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/js/components/Select/SelectMenu.js.map +1 -1
- package/dist/js/components/Spinner/Spinner.d.ts +1 -3
- package/dist/js/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/js/components/Spinner/Spinner.js +3 -6
- package/dist/js/components/Spinner/Spinner.js.map +1 -1
- package/dist/js/components/Tabs/Tab.d.ts +1 -1
- package/dist/js/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabContent.d.ts +1 -1
- package/dist/js/components/Tabs/TabContent.d.ts.map +1 -1
- package/dist/js/components/TextArea/TextArea.d.ts +1 -1
- package/dist/js/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/js/components/TextInput/TextInput.d.ts +1 -1
- package/dist/js/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +2 -2
- package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js +2 -2
- package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +2 -2
- package/src/components/BackToTop/BackToTop.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/CodeBlock/CodeBlock.tsx +5 -3
- package/src/components/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +0 -7
- package/src/components/Dropdown/DropdownToggleCheckbox.tsx +0 -1
- package/src/components/Icon/Icon.tsx +1 -5
- package/src/components/Icon/examples/IconCustomProgress.tsx +1 -1
- package/src/components/Menu/MenuGroup.tsx +1 -1
- package/src/components/Menu/MenuInput.tsx +1 -1
- package/src/components/Menu/MenuItemAction.tsx +1 -1
- package/src/components/MenuToggle/MenuToggle.tsx +1 -1
- package/src/components/NotificationBadge/NotificationBadge.tsx +1 -4
- package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +0 -7
- package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +3 -67
- package/src/components/Select/SelectMenu.tsx +1 -0
- package/src/components/Spinner/Spinner.tsx +16 -31
- package/src/components/Spinner/__tests__/Spinner.test.tsx +1 -7
- package/src/components/Spinner/__tests__/__snapshots__/Spinner.test.tsx.snap +0 -21
- package/src/components/Spinner/examples/SpinnerBasic.tsx +1 -1
- package/src/components/Spinner/examples/SpinnerCustomSize.tsx +1 -1
- package/src/components/Spinner/examples/SpinnerInline.tsx +5 -5
- package/src/components/Spinner/examples/SpinnerSizeVariations.tsx +4 -4
- package/src/components/Tabs/Tab.tsx +1 -1
- package/src/components/Tabs/TabContent.tsx +1 -1
- package/src/components/TextArea/TextArea.tsx +1 -1
- package/src/components/TextInput/TextInput.tsx +1 -1
- package/src/components/TextInputGroup/TextInputGroupMain.tsx +8 -2
- package/src/components/Toolbar/ToolbarGroup.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.9",
|
|
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",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8 || ^17 || ^18",
|
|
71
71
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "81e9bbe05401ce5c3a1acf80765ed713ec5402a0"
|
|
74
74
|
}
|
|
@@ -10,7 +10,7 @@ interface BackToTopProps extends React.DetailedHTMLProps<React.HTMLProps<HTMLDiv
|
|
|
10
10
|
className?: string;
|
|
11
11
|
/** Title to appear in back to top button. */
|
|
12
12
|
title?: string;
|
|
13
|
-
/** Forwarded ref */
|
|
13
|
+
/** @hide Forwarded ref */
|
|
14
14
|
innerRef?: React.Ref<any>;
|
|
15
15
|
/** Selector for the scrollable element to spy on. Not passing a selector defaults to spying on window scroll events. */
|
|
16
16
|
scrollableSelector?: string;
|
|
@@ -80,7 +80,7 @@ export interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'r
|
|
|
80
80
|
tabIndex?: number;
|
|
81
81
|
/** Adds danger styling to secondary or link button variants */
|
|
82
82
|
isDanger?: boolean;
|
|
83
|
-
/** Forwarded ref */
|
|
83
|
+
/** @hide Forwarded ref */
|
|
84
84
|
innerRef?: React.Ref<any>;
|
|
85
85
|
/** Adds count number to button */
|
|
86
86
|
countOptions?: BadgeCountObject;
|
|
@@ -18,9 +18,11 @@ export const CodeBlock: React.FunctionComponent<CodeBlockProps> = ({
|
|
|
18
18
|
...props
|
|
19
19
|
}: CodeBlockProps) => (
|
|
20
20
|
<div className={css(styles.codeBlock, className)} {...props}>
|
|
21
|
-
|
|
22
|
-
<div className={css(styles.
|
|
23
|
-
|
|
21
|
+
{actions && (
|
|
22
|
+
<div className={css(styles.codeBlockHeader)}>
|
|
23
|
+
<div className={css(styles.codeBlockActions)}>{actions}</div>
|
|
24
|
+
</div>
|
|
25
|
+
)}
|
|
24
26
|
<div className={css(styles.codeBlockContent)}>{children}</div>
|
|
25
27
|
</div>
|
|
26
28
|
);
|
|
@@ -39,11 +39,7 @@ export const Icon: React.FunctionComponent<IconComponentProps> = ({
|
|
|
39
39
|
defaultProgressArialabel = 'Loading...',
|
|
40
40
|
...props
|
|
41
41
|
}: IconComponentProps) => {
|
|
42
|
-
const _progressIcon = progressIcon
|
|
43
|
-
progressIcon
|
|
44
|
-
) : (
|
|
45
|
-
<Spinner diameter="1em" isSVG aria-label={defaultProgressArialabel} />
|
|
46
|
-
);
|
|
42
|
+
const _progressIcon = progressIcon ?? <Spinner diameter="1em" aria-label={defaultProgressArialabel} />;
|
|
47
43
|
|
|
48
44
|
return (
|
|
49
45
|
<span
|
|
@@ -16,7 +16,7 @@ export const IconProgress: React.FunctionComponent = () => {
|
|
|
16
16
|
name="toggle-icon-progress-custom"
|
|
17
17
|
/>
|
|
18
18
|
</div>
|
|
19
|
-
<Icon isInProgress={isInProgress} progressIcon={<Spinner diameter="2em"
|
|
19
|
+
<Icon isInProgress={isInProgress} progressIcon={<Spinner diameter="2em" aria-label="Loading..." />}>
|
|
20
20
|
<CheckCircleIcon />
|
|
21
21
|
</Icon>
|
|
22
22
|
</React.Fragment>
|
|
@@ -11,7 +11,7 @@ export interface MenuGroupProps extends Omit<React.HTMLProps<HTMLElement>, 'labe
|
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
/** ID for title label */
|
|
13
13
|
titleId?: string;
|
|
14
|
-
/** Forwarded ref */
|
|
14
|
+
/** @hide Forwarded ref */
|
|
15
15
|
innerRef?: React.Ref<any>;
|
|
16
16
|
/** Group label heading level. Default is h1. */
|
|
17
17
|
labelHeadingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
@@ -5,7 +5,7 @@ import { css } from '@patternfly/react-styles';
|
|
|
5
5
|
export interface MenuInputProps extends React.HTMLProps<HTMLElement> {
|
|
6
6
|
/** Items within input */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
/** Forwarded ref */
|
|
8
|
+
/** @hide Forwarded ref */
|
|
9
9
|
innerRef?: React.Ref<any>;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ export interface MenuItemActionProps extends Omit<React.HTMLProps<HTMLButtonElem
|
|
|
19
19
|
isDisabled?: boolean;
|
|
20
20
|
/** Identifies the action item in the onActionClick on the Menu */
|
|
21
21
|
actionId?: any;
|
|
22
|
-
/** Forwarded ref */
|
|
22
|
+
/** @hide Forwarded ref */
|
|
23
23
|
innerRef?: React.Ref<any>;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -41,7 +41,7 @@ export interface MenuToggleProps
|
|
|
41
41
|
icon?: React.ReactNode;
|
|
42
42
|
/** Optional badge rendered inside the toggle, after the children content */
|
|
43
43
|
badge?: BadgeProps | React.ReactNode;
|
|
44
|
-
/** Forwarded ref */
|
|
44
|
+
/** @hide Forwarded ref */
|
|
45
45
|
innerRef?: React.Ref<MenuToggleElement>;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -28,16 +28,13 @@ export interface NotificationBadgeProps extends Omit<ButtonProps, 'variant'> {
|
|
|
28
28
|
* notification badge.
|
|
29
29
|
*/
|
|
30
30
|
isExpanded?: boolean;
|
|
31
|
-
/** @deprecated Use the variant prop instead - Adds styling to the notification badge to indicate it has been read. */
|
|
32
|
-
isRead?: boolean;
|
|
33
31
|
/** Determines the variant of the notification badge. */
|
|
34
32
|
variant?: NotificationBadgeVariant | 'read' | 'unread' | 'attention';
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
export const NotificationBadge: React.FunctionComponent<NotificationBadgeProps> = ({
|
|
38
|
-
isRead,
|
|
39
36
|
children,
|
|
40
|
-
variant =
|
|
37
|
+
variant = NotificationBadgeVariant.read,
|
|
41
38
|
count = 0,
|
|
42
39
|
attentionIcon = <AttentionBellIcon />,
|
|
43
40
|
icon = <BellIcon />,
|
|
@@ -2,13 +2,6 @@ import { NotificationBadge } from '../NotificationBadge';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
4
|
|
|
5
|
-
Object.values([true, false]).forEach(isRead => {
|
|
6
|
-
test(`${isRead} NotificationBadge`, () => {
|
|
7
|
-
const { asFragment } = render(<NotificationBadge isRead={isRead} />);
|
|
8
|
-
expect(asFragment()).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
|
|
12
5
|
Object.values([true, false]).forEach(attentionVariant => {
|
|
13
6
|
test(`${attentionVariant} NotificationBadge needs attention`, () => {
|
|
14
7
|
const { asFragment } = render(
|
package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap
CHANGED
|
@@ -6,7 +6,7 @@ exports[`NotificationBadge count 1`] = `
|
|
|
6
6
|
aria-disabled="false"
|
|
7
7
|
aria-expanded="false"
|
|
8
8
|
class="pf-c-button pf-m-plain"
|
|
9
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
9
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-3"
|
|
10
10
|
data-ouia-component-type="PF4/Button"
|
|
11
11
|
data-ouia-safe="true"
|
|
12
12
|
type="button"
|
|
@@ -37,45 +37,13 @@ exports[`NotificationBadge count 1`] = `
|
|
|
37
37
|
</DocumentFragment>
|
|
38
38
|
`;
|
|
39
39
|
|
|
40
|
-
exports[`false NotificationBadge 1`] = `
|
|
41
|
-
<DocumentFragment>
|
|
42
|
-
<button
|
|
43
|
-
aria-disabled="false"
|
|
44
|
-
aria-expanded="false"
|
|
45
|
-
class="pf-c-button pf-m-plain"
|
|
46
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-2"
|
|
47
|
-
data-ouia-component-type="PF4/Button"
|
|
48
|
-
data-ouia-safe="true"
|
|
49
|
-
type="button"
|
|
50
|
-
>
|
|
51
|
-
<span
|
|
52
|
-
class="pf-c-notification-badge pf-m-unread"
|
|
53
|
-
>
|
|
54
|
-
<svg
|
|
55
|
-
aria-hidden="true"
|
|
56
|
-
fill="currentColor"
|
|
57
|
-
height="1em"
|
|
58
|
-
role="img"
|
|
59
|
-
style="vertical-align: -0.125em;"
|
|
60
|
-
viewBox="0 0 896 1024"
|
|
61
|
-
width="1em"
|
|
62
|
-
>
|
|
63
|
-
<path
|
|
64
|
-
d="M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z"
|
|
65
|
-
/>
|
|
66
|
-
</svg>
|
|
67
|
-
</span>
|
|
68
|
-
</button>
|
|
69
|
-
</DocumentFragment>
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
40
|
exports[`false NotificationBadge needs attention 1`] = `
|
|
73
41
|
<DocumentFragment>
|
|
74
42
|
<button
|
|
75
43
|
aria-disabled="false"
|
|
76
44
|
aria-expanded="false"
|
|
77
45
|
class="pf-c-button pf-m-plain"
|
|
78
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
46
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-2"
|
|
79
47
|
data-ouia-component-type="PF4/Button"
|
|
80
48
|
data-ouia-safe="true"
|
|
81
49
|
type="button"
|
|
@@ -89,45 +57,13 @@ exports[`false NotificationBadge needs attention 1`] = `
|
|
|
89
57
|
</DocumentFragment>
|
|
90
58
|
`;
|
|
91
59
|
|
|
92
|
-
exports[`true NotificationBadge 1`] = `
|
|
93
|
-
<DocumentFragment>
|
|
94
|
-
<button
|
|
95
|
-
aria-disabled="false"
|
|
96
|
-
aria-expanded="false"
|
|
97
|
-
class="pf-c-button pf-m-plain"
|
|
98
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
99
|
-
data-ouia-component-type="PF4/Button"
|
|
100
|
-
data-ouia-safe="true"
|
|
101
|
-
type="button"
|
|
102
|
-
>
|
|
103
|
-
<span
|
|
104
|
-
class="pf-c-notification-badge pf-m-read"
|
|
105
|
-
>
|
|
106
|
-
<svg
|
|
107
|
-
aria-hidden="true"
|
|
108
|
-
fill="currentColor"
|
|
109
|
-
height="1em"
|
|
110
|
-
role="img"
|
|
111
|
-
style="vertical-align: -0.125em;"
|
|
112
|
-
viewBox="0 0 896 1024"
|
|
113
|
-
width="1em"
|
|
114
|
-
>
|
|
115
|
-
<path
|
|
116
|
-
d="M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z"
|
|
117
|
-
/>
|
|
118
|
-
</svg>
|
|
119
|
-
</span>
|
|
120
|
-
</button>
|
|
121
|
-
</DocumentFragment>
|
|
122
|
-
`;
|
|
123
|
-
|
|
124
60
|
exports[`true NotificationBadge needs attention 1`] = `
|
|
125
61
|
<DocumentFragment>
|
|
126
62
|
<button
|
|
127
63
|
aria-disabled="false"
|
|
128
64
|
aria-expanded="false"
|
|
129
65
|
class="pf-c-button pf-m-plain"
|
|
130
|
-
data-ouia-component-id="OUIA-Generated-Button-plain-
|
|
66
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
131
67
|
data-ouia-component-type="PF4/Button"
|
|
132
68
|
data-ouia-safe="true"
|
|
133
69
|
type="button"
|
|
@@ -40,6 +40,7 @@ export interface SelectMenuProps extends Omit<React.HTMLProps<HTMLElement>, 'che
|
|
|
40
40
|
keyHandler?: (index: number, innerIndex: number, position: string) => void;
|
|
41
41
|
/** Flag indicating select has an inline text input for filtering */
|
|
42
42
|
hasInlineFilter?: boolean;
|
|
43
|
+
/** @hide forwarded ref */
|
|
43
44
|
innerRef?: any;
|
|
44
45
|
/** Content rendered in the footer of the select menu */
|
|
45
46
|
footer?: React.ReactNode;
|
|
@@ -9,15 +9,13 @@ export enum spinnerSize {
|
|
|
9
9
|
xl = 'xl'
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export interface SpinnerProps extends
|
|
12
|
+
export interface SpinnerProps extends React.SVGProps<SVGSVGElement> {
|
|
13
13
|
/** Additional classes added to the Spinner. */
|
|
14
14
|
className?: string;
|
|
15
15
|
/** Size variant of progress. */
|
|
16
16
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
17
17
|
/** Text describing that current loading status or progress */
|
|
18
18
|
'aria-valuetext'?: string;
|
|
19
|
-
/** Whether to use an SVG (new) rather than a span (old) */
|
|
20
|
-
isSVG?: boolean;
|
|
21
19
|
/** Diameter of spinner set as CSS variable */
|
|
22
20
|
diameter?: string;
|
|
23
21
|
/** @beta Indicates the spinner is inline and the size should inherit the text font size. This will override the size prop. */
|
|
@@ -33,37 +31,24 @@ export const Spinner: React.FunctionComponent<SpinnerProps> = ({
|
|
|
33
31
|
className = '',
|
|
34
32
|
size = 'xl',
|
|
35
33
|
'aria-valuetext': ariaValueText = 'Loading...',
|
|
36
|
-
isSVG = true,
|
|
37
34
|
diameter,
|
|
38
35
|
isInline = false,
|
|
39
36
|
'aria-label': ariaLabel,
|
|
40
37
|
'aria-labelledBy': ariaLabelledBy,
|
|
41
38
|
...props
|
|
42
|
-
}: SpinnerProps) =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{isSVG ? (
|
|
58
|
-
<circle className={styles.spinnerPath} cx="50" cy="50" r="45" fill="none" />
|
|
59
|
-
) : (
|
|
60
|
-
<React.Fragment>
|
|
61
|
-
<span className={css(styles.spinnerClipper)} />
|
|
62
|
-
<span className={css(styles.spinnerLeadBall)} />
|
|
63
|
-
<span className={css(styles.spinnerTailBall)} />
|
|
64
|
-
</React.Fragment>
|
|
65
|
-
)}
|
|
66
|
-
</Component>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
39
|
+
}: SpinnerProps) => (
|
|
40
|
+
<svg
|
|
41
|
+
className={css(styles.spinner, isInline ? styles.modifiers.inline : styles.modifiers[size], className)}
|
|
42
|
+
role="progressbar"
|
|
43
|
+
aria-valuetext={ariaValueText}
|
|
44
|
+
viewBox="0 0 100 100"
|
|
45
|
+
{...(diameter && { style: { ['--pf-c-spinner--diameter']: diameter } as React.CSSProperties })}
|
|
46
|
+
{...(ariaLabel && { 'aria-label': ariaLabel })}
|
|
47
|
+
{...(ariaLabelledBy && { 'aria-labelledBy': ariaLabelledBy })}
|
|
48
|
+
{...(!ariaLabel && !ariaLabelledBy && { 'aria-label': 'Contents' })}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
<circle className={styles.spinnerPath} cx="50" cy="50" r="45" fill="none" />
|
|
52
|
+
</svg>
|
|
53
|
+
);
|
|
69
54
|
Spinner.displayName = 'Spinner';
|
|
@@ -25,10 +25,4 @@ test('large spinner', () => {
|
|
|
25
25
|
test('extra large spinner', () => {
|
|
26
26
|
const { asFragment } = render(<Spinner size="xl" />);
|
|
27
27
|
expect(asFragment()).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test('non-SVG spinner', () => {
|
|
31
|
-
const { asFragment } = render(<Spinner isSVG={false} />)
|
|
32
|
-
|
|
33
|
-
expect(asFragment()).toMatchSnapshot();
|
|
34
|
-
})
|
|
28
|
+
});
|
|
@@ -60,27 +60,6 @@ exports[`medium spinner 1`] = `
|
|
|
60
60
|
</DocumentFragment>
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
|
-
exports[`non-SVG spinner 1`] = `
|
|
64
|
-
<DocumentFragment>
|
|
65
|
-
<span
|
|
66
|
-
aria-label="Contents"
|
|
67
|
-
aria-valuetext="Loading..."
|
|
68
|
-
class="pf-c-spinner pf-m-xl"
|
|
69
|
-
role="progressbar"
|
|
70
|
-
>
|
|
71
|
-
<span
|
|
72
|
-
class="pf-c-spinner__clipper"
|
|
73
|
-
/>
|
|
74
|
-
<span
|
|
75
|
-
class="pf-c-spinner__lead-ball"
|
|
76
|
-
/>
|
|
77
|
-
<span
|
|
78
|
-
class="pf-c-spinner__tail-ball"
|
|
79
|
-
/>
|
|
80
|
-
</span>
|
|
81
|
-
</DocumentFragment>
|
|
82
|
-
`;
|
|
83
|
-
|
|
84
63
|
exports[`simple spinner 1`] = `
|
|
85
64
|
<DocumentFragment>
|
|
86
65
|
<svg
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Spinner } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
|
-
export const SpinnerBasic: React.FunctionComponent = () => <Spinner
|
|
4
|
+
export const SpinnerBasic: React.FunctionComponent = () => <Spinner aria-label="Contents of the basic example" />;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { Spinner } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const SpinnerCustomSize: React.FunctionComponent = () => (
|
|
5
|
-
<Spinner
|
|
5
|
+
<Spinner diameter="80px" aria-label="Contents of the custom size example" />
|
|
6
6
|
);
|
|
@@ -6,23 +6,23 @@ export const SpinnerInline: React.FunctionComponent = () => (
|
|
|
6
6
|
<TextContent>
|
|
7
7
|
<Text component="h1">
|
|
8
8
|
Heading
|
|
9
|
-
<Spinner isInline
|
|
9
|
+
<Spinner isInline aria-label="Spinner in a heading" />
|
|
10
10
|
</Text>
|
|
11
11
|
<Text component="p">
|
|
12
12
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed hendrerit nisi in cursus maximus.
|
|
13
13
|
</Text>
|
|
14
14
|
<Text component="h2">
|
|
15
15
|
Second level
|
|
16
|
-
<Spinner isInline
|
|
16
|
+
<Spinner isInline aria-label="spinner in a subheading" />
|
|
17
17
|
</Text>
|
|
18
18
|
<Text component="p">
|
|
19
19
|
Curabitur accumsan turpis pharetra blandit. Quisque condimentum maximus mi,{' '}
|
|
20
|
-
<Spinner isInline
|
|
21
|
-
|
|
20
|
+
<Spinner isInline aria-label="Spinner in a paragraph" /> sit amet commodo arcu rutrum id. Proin pretium urna vel
|
|
21
|
+
cursus venenatis. Suspendisse potenti.
|
|
22
22
|
</Text>
|
|
23
23
|
<small>
|
|
24
24
|
Sometimes you need small text
|
|
25
|
-
<Spinner isInline
|
|
25
|
+
<Spinner isInline aria-label="Spinner in a small element" />
|
|
26
26
|
</small>
|
|
27
27
|
</TextContent>
|
|
28
28
|
</React.Fragment>
|
|
@@ -3,9 +3,9 @@ import { Spinner } from '@patternfly/react-core';
|
|
|
3
3
|
|
|
4
4
|
export const SpinnerSizeVariations: React.FunctionComponent = () => (
|
|
5
5
|
<React.Fragment>
|
|
6
|
-
<Spinner
|
|
7
|
-
<Spinner
|
|
8
|
-
<Spinner
|
|
9
|
-
<Spinner
|
|
6
|
+
<Spinner size="sm" aria-label="Contents of the small example" />
|
|
7
|
+
<Spinner size="md" aria-label="Contents of the medium example" />
|
|
8
|
+
<Spinner size="lg" aria-label="Contents of the large example" />
|
|
9
|
+
<Spinner size="xl" aria-label="Contents of the extra large example" />
|
|
10
10
|
</React.Fragment>
|
|
11
11
|
);
|
|
@@ -33,7 +33,7 @@ export interface TabProps
|
|
|
33
33
|
isAriaDisabled?: boolean;
|
|
34
34
|
/** Events to prevent when the button is in an aria-disabled state */
|
|
35
35
|
inoperableEvents?: string[];
|
|
36
|
-
/** Forwarded ref */
|
|
36
|
+
/** @hide Forwarded ref */
|
|
37
37
|
innerRef?: React.Ref<any>;
|
|
38
38
|
/** Optional Tooltip rendered to a Tab. Should be <Tooltip> with appropriate props for proper rendering. */
|
|
39
39
|
tooltip?: React.ReactElement<any>;
|
|
@@ -15,7 +15,7 @@ export interface TabContentProps extends Omit<React.HTMLProps<HTMLElement>, 'ref
|
|
|
15
15
|
activeKey?: number | string;
|
|
16
16
|
/** uniquely identifies the controlling Tab if used outside Tabs component */
|
|
17
17
|
eventKey?: number | string;
|
|
18
|
-
/** Callback for the section ref */
|
|
18
|
+
/** @hide Callback for the section ref */
|
|
19
19
|
innerRef?: React.Ref<any>;
|
|
20
20
|
/** id passed from parent to identify the content section */
|
|
21
21
|
id: string;
|
|
@@ -44,7 +44,7 @@ export interface TextAreaProps extends Omit<HTMLProps<HTMLTextAreaElement>, 'onC
|
|
|
44
44
|
resizeOrientation?: 'horizontal' | 'vertical' | 'both';
|
|
45
45
|
/** Custom flag to show that the text area requires an associated id or aria-label. */
|
|
46
46
|
'aria-label'?: string;
|
|
47
|
-
/** A reference object to attach to the text area. */
|
|
47
|
+
/** @hide A reference object to attach to the text area. */
|
|
48
48
|
innerRef?: React.RefObject<any>;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -61,7 +61,7 @@ export interface TextInputProps
|
|
|
61
61
|
value?: string | number;
|
|
62
62
|
/** Aria-label. The text input requires an associated id or aria-label. */
|
|
63
63
|
'aria-label'?: string;
|
|
64
|
-
/** A reference object to attach to the text input box. */
|
|
64
|
+
/** @hide A reference object to attach to the text input box. */
|
|
65
65
|
innerRef?: React.RefObject<any>;
|
|
66
66
|
/** Trim text on left */
|
|
67
67
|
isLeftTruncated?: boolean;
|
|
@@ -37,13 +37,13 @@ export interface TextInputGroupMainProps extends Omit<React.HTMLProps<HTMLDivEle
|
|
|
37
37
|
value?: string | number;
|
|
38
38
|
/** Placeholder value for the input */
|
|
39
39
|
placeholder?: string;
|
|
40
|
-
/** A reference object to attach to the input box */
|
|
40
|
+
/** @hide A reference object to attach to the input box */
|
|
41
41
|
innerRef?: React.RefObject<any>;
|
|
42
42
|
/** Name for the input */
|
|
43
43
|
name?: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const TextInputGroupMainBase: React.FunctionComponent<TextInputGroupMainProps> = ({
|
|
47
47
|
children,
|
|
48
48
|
className,
|
|
49
49
|
icon,
|
|
@@ -99,4 +99,10 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
|
|
|
99
99
|
);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
export const TextInputGroupMain = React.forwardRef(
|
|
103
|
+
(props: TextInputGroupMainProps, ref: React.Ref<HTMLInputElement>) => (
|
|
104
|
+
<TextInputGroupMainBase innerRef={ref as React.MutableRefObject<any>} {...props} />
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
|
|
102
108
|
TextInputGroupMain.displayName = 'TextInputGroupMain';
|
|
@@ -49,7 +49,7 @@ export interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
49
49
|
};
|
|
50
50
|
/** Content to be rendered inside the data toolbar group */
|
|
51
51
|
children?: React.ReactNode;
|
|
52
|
-
/** Reference to pass to this group if it has .pf-m-chip-container modifier */
|
|
52
|
+
/** @hide Reference to pass to this group if it has .pf-m-chip-container modifier */
|
|
53
53
|
innerRef?: React.RefObject<any>;
|
|
54
54
|
}
|
|
55
55
|
|