@patternfly/react-core 6.0.0-alpha.55 → 6.0.0-alpha.57
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/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/Text/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/favorites/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/next/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/next/components/Modal/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/Form/FormGroupLabelHelp.d.ts +3 -1
- package/dist/esm/components/Form/FormGroupLabelHelp.d.ts.map +1 -1
- package/dist/esm/components/Form/FormGroupLabelHelp.js +14 -3
- package/dist/esm/components/Form/FormGroupLabelHelp.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +5 -5
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts +5 -5
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts +5 -5
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +1 -1
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/js/components/Form/FormGroupLabelHelp.d.ts +3 -1
- package/dist/js/components/Form/FormGroupLabelHelp.d.ts.map +1 -1
- package/dist/js/components/Form/FormGroupLabelHelp.js +14 -4
- package/dist/js/components/Form/FormGroupLabelHelp.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts +5 -5
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.d.ts +5 -5
- package/dist/js/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts +5 -5
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/js/demos/DashboardHeader.js +1 -1
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/umd/react-core.min.js +2 -2
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Button/examples/ButtonInlineSpanLink.tsx +3 -3
- package/src/components/Form/FormGroupLabelHelp.tsx +40 -6
- package/src/components/Form/examples/FormBasic.tsx +3 -1
- package/src/components/Form/examples/FormGroupLabelInfo.tsx +3 -1
- package/src/components/Form/examples/FormLimitWidth.tsx +3 -1
- package/src/components/Modal/examples/ModalWithForm.tsx +9 -3
- package/src/components/Toolbar/ToolbarGroup.tsx +5 -5
- package/src/components/Toolbar/ToolbarItem.tsx +5 -5
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +5 -5
- package/src/components/Toolbar/examples/ToolbarStacked.tsx +1 -1
- package/src/demos/CardView/examples/CardView.tsx +1 -1
- package/src/demos/DashboardHeader.tsx +1 -1
- package/src/demos/DataList/examples/DataListBasic.tsx +1 -1
- package/src/demos/NotificationDrawer/examples/NotificationDrawerBasic.tsx +1 -1
- package/src/demos/NotificationDrawer/examples/NotificationDrawerGrouped.tsx +1 -1
- package/src/demos/RTL/examples/PaginatedTable.jsx +1 -1
- package/src/demos/RTL/examples/PaginatedTable.tsx +1 -1
- package/src/demos/SearchInput/SearchInput.md +2 -2
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +1 -1
- package/src/demos/examples/Nav/NavFlyout.tsx +1 -1
- package/src/demos/examples/Nav/NavHorizontal.tsx +1 -1
- package/src/demos/examples/Nav/NavHorizontalWithSubnav.tsx +1 -1
- package/src/demos/examples/Nav/NavManual.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionBreadcrumb.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionGroup.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionGroupAlternate.tsx +1 -1
- package/src/demos/examples/PasswordStrength/PasswordStrengthDemo.tsx +8 -2
- package/src/demos/examples/PrimaryDetail/PrimaryDetailCardView.tsx +1 -1
- package/src/demos/examples/Toolbar/ConsoleLogViewerToolbar.tsx +2 -2
- package/src/next/components/Modal/examples/ModalWithForm.tsx +9 -3
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.0.0-alpha.
|
|
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.0.0-alpha.56","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.0.0-alpha.
|
|
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.0.0-alpha.56","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.0.0-alpha.
|
|
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.0.0-alpha.56","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.57",
|
|
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",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react": "^17 || ^18",
|
|
75
75
|
"react-dom": "^17 || ^18"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "b2e46fefe688b2809ccf36e1ca575867a0c82a78"
|
|
78
78
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button } from '@patternfly/react-core';
|
|
2
|
+
import { Button, KeyTypes } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
const handleKeydown = (event: React.KeyboardEvent<HTMLButtonElement>) => {
|
|
5
5
|
const { key } = event;
|
|
6
|
-
const isEnterKey: boolean = key ===
|
|
7
|
-
const isEnterOrSpaceKey: boolean = isEnterKey || key ===
|
|
6
|
+
const isEnterKey: boolean = key === KeyTypes.Enter;
|
|
7
|
+
const isEnterOrSpaceKey: boolean = isEnterKey || key === KeyTypes.Space;
|
|
8
8
|
|
|
9
9
|
if (isEnterOrSpaceKey) {
|
|
10
10
|
event.preventDefault();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, ButtonProps } from '../Button';
|
|
3
3
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
4
|
+
import { KeyTypes } from '../../helpers/constants';
|
|
4
5
|
|
|
5
6
|
/** A help button to be passed to the FormGroup's labelHelp property. This should be wrapped or linked
|
|
6
7
|
* to our Popover component.
|
|
@@ -10,15 +11,48 @@ export interface FormGroupLabelHelpProps extends ButtonProps {
|
|
|
10
11
|
'aria-label': string;
|
|
11
12
|
/** Additional classes added to the help button. */
|
|
12
13
|
className?: string;
|
|
14
|
+
/** @hide Forwarded ref */
|
|
15
|
+
innerRef?: React.Ref<HTMLSpanElement>;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
const FormGroupLabelHelpBase: React.FunctionComponent<FormGroupLabelHelpProps> = ({
|
|
16
19
|
'aria-label': ariaLabel,
|
|
17
20
|
className,
|
|
21
|
+
innerRef,
|
|
18
22
|
...props
|
|
19
|
-
}) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
23
|
+
}) => {
|
|
24
|
+
const ref = React.useRef<HTMLSpanElement>(null);
|
|
25
|
+
const buttonRef = innerRef || ref;
|
|
26
|
+
|
|
27
|
+
const isMutableRef = (ref: React.Ref<HTMLSpanElement>): ref is React.MutableRefObject<HTMLSpanElement> =>
|
|
28
|
+
typeof ref === 'object' && ref !== null && 'current' in ref && ref.current !== undefined;
|
|
29
|
+
|
|
30
|
+
const handleKeyDown = (event: React.KeyboardEvent<HTMLSpanElement>) => {
|
|
31
|
+
if ([KeyTypes.Space, KeyTypes.Enter].includes(event.key) && isMutableRef(buttonRef) && buttonRef.current) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
buttonRef.current.click();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Button
|
|
39
|
+
component="span"
|
|
40
|
+
isInline
|
|
41
|
+
ref={buttonRef}
|
|
42
|
+
onKeyDown={handleKeyDown}
|
|
43
|
+
aria-label={ariaLabel}
|
|
44
|
+
className={className}
|
|
45
|
+
variant="plain"
|
|
46
|
+
hasNoPadding
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
<QuestionCircleIcon />
|
|
50
|
+
</Button>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const FormGroupLabelHelp = React.forwardRef((props: FormGroupLabelHelpProps, ref: React.Ref<any>) => (
|
|
55
|
+
<FormGroupLabelHelpBase innerRef={ref} {...props} />
|
|
56
|
+
));
|
|
57
|
+
|
|
24
58
|
FormGroupLabelHelp.displayName = 'FormGroupLabelHelp';
|
|
@@ -18,6 +18,7 @@ export const FormBasic: React.FunctionComponent = () => {
|
|
|
18
18
|
const [name, setName] = React.useState('');
|
|
19
19
|
const [email, setEmail] = React.useState('');
|
|
20
20
|
const [phone, setPhone] = React.useState('');
|
|
21
|
+
const labelHelpRef = React.useRef(null);
|
|
21
22
|
|
|
22
23
|
const handleNameChange = (_event, name: string) => {
|
|
23
24
|
setName(name);
|
|
@@ -37,6 +38,7 @@ export const FormBasic: React.FunctionComponent = () => {
|
|
|
37
38
|
label="Full name"
|
|
38
39
|
labelHelp={
|
|
39
40
|
<Popover
|
|
41
|
+
triggerRef={labelHelpRef}
|
|
40
42
|
headerContent={
|
|
41
43
|
<div>
|
|
42
44
|
The{' '}
|
|
@@ -63,7 +65,7 @@ export const FormBasic: React.FunctionComponent = () => {
|
|
|
63
65
|
</div>
|
|
64
66
|
}
|
|
65
67
|
>
|
|
66
|
-
<FormGroupLabelHelp aria-label="More info for name field" />
|
|
68
|
+
<FormGroupLabelHelp ref={labelHelpRef} aria-label="More info for name field" />
|
|
67
69
|
</Popover>
|
|
68
70
|
}
|
|
69
71
|
isRequired
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
export const FormGroupLabelInfo: React.FunctionComponent = () => {
|
|
14
14
|
const [name, setName] = React.useState('');
|
|
15
|
+
const labelHelpRef = React.useRef(null);
|
|
15
16
|
|
|
16
17
|
const handleNameChange = (_event, name: string) => {
|
|
17
18
|
setName(name);
|
|
@@ -24,6 +25,7 @@ export const FormGroupLabelInfo: React.FunctionComponent = () => {
|
|
|
24
25
|
labelInfo="Additional label info"
|
|
25
26
|
labelHelp={
|
|
26
27
|
<Popover
|
|
28
|
+
triggerRef={labelHelpRef}
|
|
27
29
|
headerContent={
|
|
28
30
|
<div>
|
|
29
31
|
The{' '}
|
|
@@ -50,7 +52,7 @@ export const FormGroupLabelInfo: React.FunctionComponent = () => {
|
|
|
50
52
|
</div>
|
|
51
53
|
}
|
|
52
54
|
>
|
|
53
|
-
<FormGroupLabelHelp aria-label="More info for name field" />
|
|
55
|
+
<FormGroupLabelHelp ref={labelHelpRef} aria-label="More info for name field" />
|
|
54
56
|
</Popover>
|
|
55
57
|
}
|
|
56
58
|
isRequired
|
|
@@ -18,6 +18,7 @@ export const FormLimitWidth: React.FunctionComponent = () => {
|
|
|
18
18
|
const [name, setName] = React.useState('');
|
|
19
19
|
const [email, setEmail] = React.useState('');
|
|
20
20
|
const [phone, setPhone] = React.useState('');
|
|
21
|
+
const labelHelpRef = React.useRef(null);
|
|
21
22
|
|
|
22
23
|
const handleNameChange = (_event, name: string) => {
|
|
23
24
|
setName(name);
|
|
@@ -37,6 +38,7 @@ export const FormLimitWidth: React.FunctionComponent = () => {
|
|
|
37
38
|
label="Full name"
|
|
38
39
|
labelHelp={
|
|
39
40
|
<Popover
|
|
41
|
+
triggerRef={labelHelpRef}
|
|
40
42
|
headerContent={
|
|
41
43
|
<div>
|
|
42
44
|
The{' '}
|
|
@@ -63,7 +65,7 @@ export const FormLimitWidth: React.FunctionComponent = () => {
|
|
|
63
65
|
</div>
|
|
64
66
|
}
|
|
65
67
|
>
|
|
66
|
-
<FormGroupLabelHelp aria-label="More info for name field" />
|
|
68
|
+
<FormGroupLabelHelp ref={labelHelpRef} aria-label="More info for name field" />
|
|
67
69
|
</Popover>
|
|
68
70
|
}
|
|
69
71
|
isRequired
|
|
@@ -15,6 +15,9 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
15
15
|
const [nameValue, setNameValue] = React.useState('');
|
|
16
16
|
const [emailValue, setEmailValue] = React.useState('');
|
|
17
17
|
const [addressValue, setAddressValue] = React.useState('');
|
|
18
|
+
const nameLabelHelpRef = React.useRef(null);
|
|
19
|
+
const emailLabelHelpRef = React.useRef(null);
|
|
20
|
+
const addressLabelHelpRef = React.useRef(null);
|
|
18
21
|
|
|
19
22
|
const handleModalToggle = (_event: KeyboardEvent | React.MouseEvent) => {
|
|
20
23
|
setModalOpen(!isModalOpen);
|
|
@@ -56,6 +59,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
56
59
|
label="Name"
|
|
57
60
|
labelHelp={
|
|
58
61
|
<Popover
|
|
62
|
+
triggerRef={nameLabelHelpRef}
|
|
59
63
|
headerContent={
|
|
60
64
|
<div>
|
|
61
65
|
The
|
|
@@ -82,7 +86,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
82
86
|
</div>
|
|
83
87
|
}
|
|
84
88
|
>
|
|
85
|
-
<FormGroupLabelHelp aria-label="More info for name field" />
|
|
89
|
+
<FormGroupLabelHelp ref={nameLabelHelpRef} aria-label="More info for name field" />
|
|
86
90
|
</Popover>
|
|
87
91
|
}
|
|
88
92
|
isRequired
|
|
@@ -101,6 +105,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
101
105
|
label="E-mail"
|
|
102
106
|
labelHelp={
|
|
103
107
|
<Popover
|
|
108
|
+
triggerRef={emailLabelHelpRef}
|
|
104
109
|
headerContent={
|
|
105
110
|
<div>
|
|
106
111
|
The
|
|
@@ -123,7 +128,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
123
128
|
</div>
|
|
124
129
|
}
|
|
125
130
|
>
|
|
126
|
-
<FormGroupLabelHelp aria-label="More info for e-mail field" />
|
|
131
|
+
<FormGroupLabelHelp ref={emailLabelHelpRef} aria-label="More info for e-mail field" />
|
|
127
132
|
</Popover>
|
|
128
133
|
}
|
|
129
134
|
isRequired
|
|
@@ -142,6 +147,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
142
147
|
label="Address"
|
|
143
148
|
labelHelp={
|
|
144
149
|
<Popover
|
|
150
|
+
triggerRef={addressLabelHelpRef}
|
|
145
151
|
headerContent={
|
|
146
152
|
<div>
|
|
147
153
|
The
|
|
@@ -163,7 +169,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
163
169
|
</div>
|
|
164
170
|
}
|
|
165
171
|
>
|
|
166
|
-
<FormGroupLabelHelp aria-label="More info for address field" />
|
|
172
|
+
<FormGroupLabelHelp ref={addressLabelHelpRef} aria-label="More info for address field" />
|
|
167
173
|
</Popover>
|
|
168
174
|
}
|
|
169
175
|
isRequired
|
|
@@ -24,11 +24,11 @@ export interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>,
|
|
|
24
24
|
};
|
|
25
25
|
/** Applies to a child of a flex layout, and aligns that child (and any adjacent children on the other side of it) to one side of the main axis */
|
|
26
26
|
align?: {
|
|
27
|
-
default?: '
|
|
28
|
-
md?: '
|
|
29
|
-
lg?: '
|
|
30
|
-
xl?: '
|
|
31
|
-
'2xl'?: '
|
|
27
|
+
default?: 'alignEnd' | 'alignStart';
|
|
28
|
+
md?: 'alignEnd' | 'alignStart';
|
|
29
|
+
lg?: 'alignEnd' | 'alignStart';
|
|
30
|
+
xl?: 'alignEnd' | 'alignStart';
|
|
31
|
+
'2xl'?: 'alignEnd' | 'alignStart';
|
|
32
32
|
};
|
|
33
33
|
/** Vertical alignment of children */
|
|
34
34
|
alignItems?: 'start' | 'center' | 'baseline' | 'default';
|
|
@@ -28,11 +28,11 @@ export interface ToolbarItemProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
28
28
|
};
|
|
29
29
|
/** Applies to a child of a flex layout, and aligns that child (and any adjacent children on the other side of it) to one side of the main axis */
|
|
30
30
|
align?: {
|
|
31
|
-
default?: '
|
|
32
|
-
md?: '
|
|
33
|
-
lg?: '
|
|
34
|
-
xl?: '
|
|
35
|
-
'2xl'?: '
|
|
31
|
+
default?: 'alignEnd' | 'alignStart';
|
|
32
|
+
md?: 'alignEnd' | 'alignStart';
|
|
33
|
+
lg?: 'alignEnd' | 'alignStart';
|
|
34
|
+
xl?: 'alignEnd' | 'alignStart';
|
|
35
|
+
'2xl'?: 'alignEnd' | 'alignStart';
|
|
36
36
|
};
|
|
37
37
|
/** Vertical alignment of children */
|
|
38
38
|
alignItems?: 'start' | 'center' | 'baseline' | 'default';
|
|
@@ -29,11 +29,11 @@ export interface ToolbarToggleGroupProps extends ToolbarGroupProps {
|
|
|
29
29
|
};
|
|
30
30
|
/** Alignment at various breakpoints. */
|
|
31
31
|
alignment?: {
|
|
32
|
-
default?: '
|
|
33
|
-
md?: '
|
|
34
|
-
lg?: '
|
|
35
|
-
xl?: '
|
|
36
|
-
'2xl'?: '
|
|
32
|
+
default?: 'alignEnd' | 'alignStart';
|
|
33
|
+
md?: 'alignEnd' | 'alignStart';
|
|
34
|
+
lg?: 'alignEnd' | 'alignStart';
|
|
35
|
+
xl?: 'alignEnd' | 'alignStart';
|
|
36
|
+
'2xl'?: 'alignEnd' | 'alignStart';
|
|
37
37
|
};
|
|
38
38
|
/** Spacers at various breakpoints. */
|
|
39
39
|
spacer?: {
|
|
@@ -275,7 +275,7 @@ export const ToolbarStacked: React.FunctionComponent = () => {
|
|
|
275
275
|
<DropdownList>{splitButtonDropdownItems}</DropdownList>
|
|
276
276
|
</Dropdown>
|
|
277
277
|
</ToolbarItem>
|
|
278
|
-
<ToolbarItem variant="pagination" align={{ default: '
|
|
278
|
+
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
|
|
279
279
|
<Pagination
|
|
280
280
|
itemCount={37}
|
|
281
281
|
perPage={perPage}
|
|
@@ -442,7 +442,7 @@ export const CardViewBasic: React.FunctionComponent = () => {
|
|
|
442
442
|
</OverflowMenuControl>
|
|
443
443
|
</OverflowMenu>
|
|
444
444
|
</ToolbarItem>
|
|
445
|
-
<ToolbarItem variant="pagination" align={{ default: '
|
|
445
|
+
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
|
|
446
446
|
{renderPagination()}
|
|
447
447
|
</ToolbarItem>
|
|
448
448
|
</React.Fragment>
|
|
@@ -100,7 +100,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
100
100
|
<ToolbarContent>
|
|
101
101
|
<ToolbarGroup
|
|
102
102
|
variant="icon-button-group"
|
|
103
|
-
align={{ default: '
|
|
103
|
+
align={{ default: 'alignEnd' }}
|
|
104
104
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
105
105
|
>
|
|
106
106
|
{notificationBadge ?? (
|
|
@@ -67,7 +67,7 @@ export const DataListBasic: React.FunctionComponent = () => {
|
|
|
67
67
|
</OverflowMenuControl>
|
|
68
68
|
</OverflowMenu>
|
|
69
69
|
</ToolbarItem>
|
|
70
|
-
<ToolbarItem variant="pagination" align={{ default: '
|
|
70
|
+
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
|
|
71
71
|
{renderPagination()}
|
|
72
72
|
</ToolbarItem>
|
|
73
73
|
</React.Fragment>
|
|
@@ -176,7 +176,7 @@ export const NotificationDrawerBasic: React.FunctionComponent = () => {
|
|
|
176
176
|
const headerToolbar = (
|
|
177
177
|
<Toolbar isFullHeight>
|
|
178
178
|
<ToolbarContent>
|
|
179
|
-
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: '
|
|
179
|
+
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: 'alignEnd' }}>
|
|
180
180
|
<ToolbarGroup variant="icon-button-group">
|
|
181
181
|
<ToolbarItem visibility={{ default: 'visible' }} selected={isDrawerExpanded}>
|
|
182
182
|
<NotificationBadge
|
|
@@ -226,7 +226,7 @@ export const NotificationDrawerGrouped: React.FunctionComponent = () => {
|
|
|
226
226
|
const headerToolbar = (
|
|
227
227
|
<Toolbar isFullHeight>
|
|
228
228
|
<ToolbarContent>
|
|
229
|
-
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: '
|
|
229
|
+
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: 'alignEnd' }}>
|
|
230
230
|
<ToolbarGroup variant="icon-button-group">
|
|
231
231
|
<ToolbarItem visibility={{ default: 'visible' }} selected={isDrawerExpanded}>
|
|
232
232
|
<NotificationBadge
|
|
@@ -341,7 +341,7 @@ export const PaginatedTableAction = () => {
|
|
|
341
341
|
<ToolbarContent>
|
|
342
342
|
<ToolbarGroup
|
|
343
343
|
variant="icon-button-group"
|
|
344
|
-
align={{ default: '
|
|
344
|
+
align={{ default: 'alignEnd' }}
|
|
345
345
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
346
346
|
>
|
|
347
347
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
@@ -365,7 +365,7 @@ export const PaginatedTableAction: React.FunctionComponent = () => {
|
|
|
365
365
|
<ToolbarContent>
|
|
366
366
|
<ToolbarGroup
|
|
367
367
|
variant="icon-button-group"
|
|
368
|
-
align={{ default: '
|
|
368
|
+
align={{ default: 'alignEnd' }}
|
|
369
369
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
370
370
|
>
|
|
371
371
|
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
@@ -128,9 +128,9 @@ SearchAutocomplete = () => {
|
|
|
128
128
|
event.preventDefault(); // by default, the up and down arrow keys scroll the window
|
|
129
129
|
// the tab, enter, and space keys will close the menu, and the tab key will move browser
|
|
130
130
|
// focus forward one element (by default)
|
|
131
|
-
} else if (event.key === 'Tab' || event.key === 'Enter' || event.key === '
|
|
131
|
+
} else if (event.key === 'Tab' || event.key === 'Enter' || event.key === ' ') {
|
|
132
132
|
setIsAutocompleteOpen(false);
|
|
133
|
-
if (event.key === 'Enter' || event.key === '
|
|
133
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
134
134
|
event.preventDefault();
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -382,7 +382,7 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
382
382
|
<ToolbarContent>
|
|
383
383
|
<ToolbarGroup
|
|
384
384
|
variant="icon-button-group"
|
|
385
|
-
align={{ default: '
|
|
385
|
+
align={{ default: 'alignEnd' }}
|
|
386
386
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
387
387
|
>
|
|
388
388
|
<ToolbarItem>
|
|
@@ -129,7 +129,7 @@ export const NavFlyout: React.FunctionComponent = () => {
|
|
|
129
129
|
<ToolbarContent>
|
|
130
130
|
<ToolbarGroup
|
|
131
131
|
variant="icon-button-group"
|
|
132
|
-
align={{ default: '
|
|
132
|
+
align={{ default: 'alignEnd' }}
|
|
133
133
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
134
134
|
>
|
|
135
135
|
<ToolbarItem>
|
|
@@ -108,7 +108,7 @@ export const NavHorizontal: React.FunctionComponent = () => {
|
|
|
108
108
|
<ToolbarItem isOverflowContainer>{PageNav}</ToolbarItem>
|
|
109
109
|
<ToolbarGroup
|
|
110
110
|
variant="icon-button-group"
|
|
111
|
-
align={{ default: '
|
|
111
|
+
align={{ default: 'alignEnd' }}
|
|
112
112
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
113
113
|
>
|
|
114
114
|
<ToolbarItem>
|
|
@@ -157,7 +157,7 @@ export const NavHorizontalWithSubnav: React.FunctionComponent = () => {
|
|
|
157
157
|
<ToolbarItem isOverflowContainer>{PageNav}</ToolbarItem>
|
|
158
158
|
<ToolbarGroup
|
|
159
159
|
variant="icon-button-group"
|
|
160
|
-
align={{ default: '
|
|
160
|
+
align={{ default: 'alignEnd' }}
|
|
161
161
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
162
162
|
>
|
|
163
163
|
<ToolbarItem>
|
|
@@ -124,7 +124,7 @@ export const NavManual: React.FunctionComponent = () => {
|
|
|
124
124
|
<ToolbarContent>
|
|
125
125
|
<ToolbarGroup
|
|
126
126
|
variant="icon-button-group"
|
|
127
|
-
align={{ default: '
|
|
127
|
+
align={{ default: 'alignEnd' }}
|
|
128
128
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
129
129
|
>
|
|
130
130
|
<ToolbarItem>
|
|
@@ -120,7 +120,7 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
120
120
|
<ToolbarContent>
|
|
121
121
|
<ToolbarGroup
|
|
122
122
|
variant="icon-button-group"
|
|
123
|
-
align={{ default: '
|
|
123
|
+
align={{ default: 'alignEnd' }}
|
|
124
124
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
125
125
|
>
|
|
126
126
|
<ToolbarItem>
|
|
@@ -120,7 +120,7 @@ export const PageStickySectionGroup: React.FunctionComponent = () => {
|
|
|
120
120
|
<ToolbarContent>
|
|
121
121
|
<ToolbarGroup
|
|
122
122
|
variant="icon-button-group"
|
|
123
|
-
align={{ default: '
|
|
123
|
+
align={{ default: 'alignEnd' }}
|
|
124
124
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
125
125
|
>
|
|
126
126
|
<ToolbarItem>
|
|
@@ -112,7 +112,7 @@ export const PageStickySectionGroupAlternate: React.FunctionComponent = () => {
|
|
|
112
112
|
<ToolbarContent>
|
|
113
113
|
<ToolbarGroup
|
|
114
114
|
variant="icon-button-group"
|
|
115
|
-
align={{ default: '
|
|
115
|
+
align={{ default: 'alignEnd' }}
|
|
116
116
|
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
|
|
117
117
|
>
|
|
118
118
|
<ToolbarItem>
|
|
@@ -89,9 +89,15 @@ export const PasswordStrengthDemo: React.FunctionComponent = () => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
+
const labelHelpRef = React.useRef(null);
|
|
93
|
+
|
|
92
94
|
const iconPopover = (
|
|
93
|
-
<Popover
|
|
94
|
-
|
|
95
|
+
<Popover
|
|
96
|
+
triggerRef={labelHelpRef}
|
|
97
|
+
headerContent={<div>Password Requirements</div>}
|
|
98
|
+
bodyContent={<div>Password rules</div>}
|
|
99
|
+
>
|
|
100
|
+
<FormGroupLabelHelp ref={labelHelpRef} aria-label="More info for name field" />
|
|
95
101
|
</Popover>
|
|
96
102
|
);
|
|
97
103
|
|
|
@@ -479,7 +479,7 @@ export const PrimaryDetailCardView: React.FunctionComponent = () => {
|
|
|
479
479
|
<DropdownList>{toolbarKebabDropdownItems}</DropdownList>
|
|
480
480
|
</Dropdown>
|
|
481
481
|
</ToolbarItem>
|
|
482
|
-
<ToolbarItem variant="pagination" align={{ default: '
|
|
482
|
+
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
|
|
483
483
|
{renderPagination()}
|
|
484
484
|
</ToolbarItem>
|
|
485
485
|
</React.Fragment>
|
|
@@ -475,8 +475,8 @@ export const ConsoleLogViewerToolbar: React.FC = () => {
|
|
|
475
475
|
|
|
476
476
|
const items = (
|
|
477
477
|
<React.Fragment>
|
|
478
|
-
<ToolbarGroup align={{ default: '
|
|
479
|
-
<ToolbarGroup align={{ default: '
|
|
478
|
+
<ToolbarGroup align={{ default: 'alignStart' }}>{leftAlignedItems}</ToolbarGroup>
|
|
479
|
+
<ToolbarGroup align={{ default: 'alignEnd' }}>{rightAlignedItems}</ToolbarGroup>
|
|
480
480
|
</React.Fragment>
|
|
481
481
|
);
|
|
482
482
|
|
|
@@ -7,6 +7,9 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
7
7
|
const [nameValue, setNameValue] = React.useState('');
|
|
8
8
|
const [emailValue, setEmailValue] = React.useState('');
|
|
9
9
|
const [addressValue, setAddressValue] = React.useState('');
|
|
10
|
+
const nameLabelHelpRef = React.useRef(null);
|
|
11
|
+
const emailLabelHelpRef = React.useRef(null);
|
|
12
|
+
const addressLabelHelpRef = React.useRef(null);
|
|
10
13
|
|
|
11
14
|
const handleModalToggle = (_event: KeyboardEvent | React.MouseEvent) => {
|
|
12
15
|
setModalOpen(!isModalOpen);
|
|
@@ -47,6 +50,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
47
50
|
label="Name"
|
|
48
51
|
labelHelp={
|
|
49
52
|
<Popover
|
|
53
|
+
triggerRef={nameLabelHelpRef}
|
|
50
54
|
headerContent={
|
|
51
55
|
<div>
|
|
52
56
|
The
|
|
@@ -73,7 +77,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
73
77
|
</div>
|
|
74
78
|
}
|
|
75
79
|
>
|
|
76
|
-
<FormGroupLabelHelp aria-label="More info for name field" />
|
|
80
|
+
<FormGroupLabelHelp ref={nameLabelHelpRef} aria-label="More info for name field" />
|
|
77
81
|
</Popover>
|
|
78
82
|
}
|
|
79
83
|
isRequired
|
|
@@ -92,6 +96,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
92
96
|
label="E-mail"
|
|
93
97
|
labelHelp={
|
|
94
98
|
<Popover
|
|
99
|
+
triggerRef={emailLabelHelpRef}
|
|
95
100
|
headerContent={
|
|
96
101
|
<div>
|
|
97
102
|
The
|
|
@@ -114,7 +119,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
114
119
|
</div>
|
|
115
120
|
}
|
|
116
121
|
>
|
|
117
|
-
<FormGroupLabelHelp aria-label="More info for e-mail field" />
|
|
122
|
+
<FormGroupLabelHelp ref={emailLabelHelpRef} aria-label="More info for e-mail field" />
|
|
118
123
|
</Popover>
|
|
119
124
|
}
|
|
120
125
|
isRequired
|
|
@@ -133,6 +138,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
133
138
|
label="Address"
|
|
134
139
|
labelHelp={
|
|
135
140
|
<Popover
|
|
141
|
+
triggerRef={addressLabelHelpRef}
|
|
136
142
|
headerContent={
|
|
137
143
|
<div>
|
|
138
144
|
The
|
|
@@ -154,7 +160,7 @@ export const ModalWithForm: React.FunctionComponent = () => {
|
|
|
154
160
|
</div>
|
|
155
161
|
}
|
|
156
162
|
>
|
|
157
|
-
<FormGroupLabelHelp aria-label="More info for address field" />
|
|
163
|
+
<FormGroupLabelHelp ref={addressLabelHelpRef} aria-label="More info for address field" />
|
|
158
164
|
</Popover>
|
|
159
165
|
}
|
|
160
166
|
isRequired
|