@patternfly/react-core 5.0.0-alpha.7 → 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 +21 -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/Card/Card.d.ts +1 -1
- package/components/Card/Card.d.ts.map +1 -1
- package/components/Card/Card.js +1 -1
- package/components/Card/Card.js.map +1 -1
- package/components/ClipboardCopy/ClipboardCopy.d.ts +0 -2
- package/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/components/ClipboardCopy/ClipboardCopy.js +1 -7
- package/components/ClipboardCopy/ClipboardCopy.js.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/Card/Card.d.ts +1 -1
- package/dist/esm/components/Card/Card.d.ts.map +1 -1
- package/dist/esm/components/Card/Card.js +1 -1
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +0 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +1 -7
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.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/Card/Card.d.ts +1 -1
- package/dist/js/components/Card/Card.d.ts.map +1 -1
- package/dist/js/components/Card/Card.js +1 -1
- package/dist/js/components/Card/Card.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +0 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +1 -7
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.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/Card/Card.tsx +2 -2
- package/src/components/Card/__tests__/Card.test.tsx +22 -22
- package/src/components/Card/__tests__/__snapshots__/Card.test.tsx.snap +2 -2
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +0 -11
- package/src/components/ClipboardCopy/__tests__/Generated/ClipboardCopy.test.tsx +0 -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;
|
|
@@ -10,7 +10,7 @@ export interface CardProps extends React.HTMLProps<HTMLElement>, OUIAProps {
|
|
|
10
10
|
id?: string;
|
|
11
11
|
/** Additional classes added to the Card */
|
|
12
12
|
className?: string;
|
|
13
|
-
/** Sets the base component to render. defaults to
|
|
13
|
+
/** Sets the base component to render. defaults to div */
|
|
14
14
|
component?: keyof JSX.IntrinsicElements;
|
|
15
15
|
/** Modifies the card to include compact styling. Should not be used with isLarge. */
|
|
16
16
|
isCompact?: boolean;
|
|
@@ -67,7 +67,7 @@ export const Card: React.FunctionComponent<CardProps> = ({
|
|
|
67
67
|
children = null,
|
|
68
68
|
id = '',
|
|
69
69
|
className = '',
|
|
70
|
-
component = '
|
|
70
|
+
component = 'div',
|
|
71
71
|
isCompact = false,
|
|
72
72
|
isSelectable = false,
|
|
73
73
|
isSelectableRaised = false,
|
|
@@ -12,8 +12,8 @@ describe('Card', () => {
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
test('className is added to the root element', () => {
|
|
15
|
-
render(<Card className="extra-class"
|
|
16
|
-
expect(screen.
|
|
15
|
+
render(<Card className="extra-class">card</Card>);
|
|
16
|
+
expect(screen.getByText('card')).toHaveClass('extra-class');
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
test('extra props are spread to the root element', () => {
|
|
@@ -43,70 +43,70 @@ describe('Card', () => {
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
test('card with isSelectable applied ', () => {
|
|
46
|
-
render(<Card isSelectable
|
|
46
|
+
render(<Card isSelectable>selectable card</Card>);
|
|
47
47
|
|
|
48
|
-
const card = screen.
|
|
48
|
+
const card = screen.getByText('selectable card');
|
|
49
49
|
expect(card).toHaveClass('pf-m-selectable');
|
|
50
50
|
expect(card).toHaveAttribute('tabindex', '0');
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
test('card with isSelectable and isSelected applied ', () => {
|
|
54
|
-
render(<Card isSelectable isSelected
|
|
54
|
+
render(<Card isSelectable isSelected>selected and selectable card</Card>);
|
|
55
55
|
|
|
56
|
-
const card = screen.
|
|
56
|
+
const card = screen.getByText('selected and selectable card');
|
|
57
57
|
expect(card).toHaveClass('pf-m-selectable');
|
|
58
58
|
expect(card).toHaveClass('pf-m-selected');
|
|
59
59
|
expect(card).toHaveAttribute('tabindex', '0');
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
test('card with only isSelected applied - not change', () => {
|
|
63
|
-
render(<Card isSelected
|
|
63
|
+
render(<Card isSelected>selected card</Card>);
|
|
64
64
|
|
|
65
|
-
const card = screen.
|
|
65
|
+
const card = screen.getByText('selected card');
|
|
66
66
|
expect(card).not.toHaveClass('pf-m-selected');
|
|
67
67
|
expect(card.getAttribute('tabindex')).toBeNull();
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
test('card with isDisabledRaised applied', () => {
|
|
71
|
-
render(<Card isDisabledRaised
|
|
72
|
-
expect(screen.
|
|
71
|
+
render(<Card isDisabledRaised>disabled raised card</Card>);
|
|
72
|
+
expect(screen.getByText('disabled raised card')).toHaveClass('pf-m-non-selectable-raised');
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
test('card with isSelectableRaised applied - not change', () => {
|
|
76
|
-
render(<Card isSelectableRaised
|
|
76
|
+
render(<Card isSelectableRaised>raised selectable card</Card>);
|
|
77
77
|
|
|
78
|
-
const card = screen.
|
|
78
|
+
const card = screen.getByText('raised selectable card');
|
|
79
79
|
expect(card).toHaveClass('pf-m-selectable-raised');
|
|
80
80
|
expect(card).toHaveAttribute('tabindex', '0');
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
test('card with isSelectableRaised and isSelected applied ', () => {
|
|
84
|
-
render(<Card isSelected isSelectableRaised
|
|
84
|
+
render(<Card isSelected isSelectableRaised>raised selected card</Card>);
|
|
85
85
|
|
|
86
|
-
const card = screen.
|
|
86
|
+
const card = screen.getByText('raised selected card');
|
|
87
87
|
expect(card).toHaveClass('pf-m-selectable-raised');
|
|
88
88
|
expect(card).toHaveClass('pf-m-selected-raised');
|
|
89
89
|
expect(card).toHaveAttribute('tabindex', '0');
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
test('card with isFlat applied', () => {
|
|
93
|
-
render(<Card isFlat
|
|
94
|
-
expect(screen.
|
|
93
|
+
render(<Card isFlat>flat card</Card>);
|
|
94
|
+
expect(screen.getByText('flat card')).toHaveClass('pf-m-flat');
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
test('card with isExpanded applied', () => {
|
|
98
|
-
render(<Card isExpanded
|
|
99
|
-
expect(screen.
|
|
98
|
+
render(<Card isExpanded>expanded card</Card>);
|
|
99
|
+
expect(screen.getByText('expanded card')).toHaveClass('pf-m-expanded');
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
test('card with isRounded applied', () => {
|
|
103
|
-
render(<Card isRounded
|
|
104
|
-
expect(screen.
|
|
103
|
+
render(<Card isRounded>rounded card</Card>);
|
|
104
|
+
expect(screen.getByText('rounded card')).toHaveClass('pf-m-rounded');
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
test('card with isLarge applied', () => {
|
|
108
|
-
render(<Card isLarge
|
|
109
|
-
expect(screen.
|
|
108
|
+
render(<Card isLarge>large card</Card>);
|
|
109
|
+
expect(screen.getByText('large card')).toHaveClass('pf-m-display-lg');
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
test('card warns when isLarge and isCompact', () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Card card with isCompact applied 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
5
|
+
<div
|
|
6
6
|
class="pf-c-card pf-m-compact"
|
|
7
7
|
data-ouia-component-id="OUIA-Generated-Card-6"
|
|
8
8
|
data-ouia-component-type="PF4/Card"
|
|
@@ -14,7 +14,7 @@ exports[`Card card with isCompact applied 1`] = `
|
|
|
14
14
|
|
|
15
15
|
exports[`Card renders with PatternFly Core styles 1`] = `
|
|
16
16
|
<DocumentFragment>
|
|
17
|
-
<
|
|
17
|
+
<div
|
|
18
18
|
class="pf-c-card"
|
|
19
19
|
data-ouia-component-id="OUIA-Generated-Card-1"
|
|
20
20
|
data-ouia-component-type="PF4/Card"
|
|
@@ -69,8 +69,6 @@ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>
|
|
|
69
69
|
exitDelay?: number;
|
|
70
70
|
/** Delay in ms before the tooltip appears. */
|
|
71
71
|
entryDelay?: number;
|
|
72
|
-
/** @deprecated Delay in ms before the tooltip message switch to hover tip. */
|
|
73
|
-
switchDelay?: number;
|
|
74
72
|
/** A function that is triggered on clicking the copy button. */
|
|
75
73
|
onCopy?: (event: React.ClipboardEvent<HTMLDivElement>, text?: React.ReactNode) => void;
|
|
76
74
|
/** A function that is triggered on changing the text. */
|
|
@@ -97,14 +95,6 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
|
|
|
97
95
|
expanded: this.props.isExpanded,
|
|
98
96
|
copied: false
|
|
99
97
|
};
|
|
100
|
-
|
|
101
|
-
if (this.props.switchDelay !== undefined) {
|
|
102
|
-
// eslint-disable-next-line no-console
|
|
103
|
-
console.warn(
|
|
104
|
-
'ClipboardCopy: switchDelay prop has been deprecated. ' +
|
|
105
|
-
'The tooltip message will switch back to the hover tip as soon as the tooltip is hidden.'
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
98
|
}
|
|
109
99
|
|
|
110
100
|
static defaultProps: PickOptional<ClipboardCopyProps> = {
|
|
@@ -156,7 +146,6 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
|
|
|
156
146
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
157
147
|
isExpanded,
|
|
158
148
|
onChange, // Don't pass to <div>
|
|
159
|
-
switchDelay,
|
|
160
149
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
161
150
|
isReadOnly,
|
|
162
151
|
isCode,
|
|
@@ -23,7 +23,6 @@ it('ClipboardCopy should match snapshot (auto-generated)', () => {
|
|
|
23
23
|
maxWidth={"'150px'"}
|
|
24
24
|
exitDelay={1600}
|
|
25
25
|
entryDelay={100}
|
|
26
|
-
switchDelay={2000}
|
|
27
26
|
onCopy={(event: React.ClipboardEvent<HTMLDivElement>, text?: React.ReactNode) => {
|
|
28
27
|
const clipboard = event.currentTarget.parentElement;
|
|
29
28
|
const el = document.createElement('input');
|
|
@@ -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
|
);
|