@patternfly/react-core 4.191.6 → 4.192.3

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/esm/components/DataList/DataListCheck.d.ts +1 -1
  3. package/dist/esm/components/DataList/DataListCheck.d.ts.map +1 -1
  4. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -1
  5. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  6. package/dist/esm/components/Modal/ModalBoxCloseButton.js +2 -2
  7. package/dist/esm/components/Modal/ModalBoxCloseButton.js.map +1 -1
  8. package/dist/esm/components/Modal/ModalContent.js +1 -1
  9. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  10. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  11. package/dist/esm/components/Select/Select.js +2 -2
  12. package/dist/esm/components/Select/Select.js.map +1 -1
  13. package/dist/esm/components/Select/SelectOption.d.ts +2 -0
  14. package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
  15. package/dist/esm/components/Select/SelectOption.js +70 -48
  16. package/dist/esm/components/Select/SelectOption.js.map +1 -1
  17. package/dist/esm/components/Truncate/Truncate.d.ts +21 -0
  18. package/dist/esm/components/Truncate/Truncate.d.ts.map +1 -0
  19. package/dist/esm/components/Truncate/Truncate.js +34 -0
  20. package/dist/esm/components/Truncate/Truncate.js.map +1 -0
  21. package/dist/esm/components/Truncate/index.d.ts +2 -0
  22. package/dist/esm/components/Truncate/index.d.ts.map +1 -0
  23. package/dist/esm/components/Truncate/index.js +2 -0
  24. package/dist/esm/components/Truncate/index.js.map +1 -0
  25. package/dist/esm/components/index.d.ts +1 -0
  26. package/dist/esm/components/index.d.ts.map +1 -1
  27. package/dist/esm/components/index.js +1 -0
  28. package/dist/esm/components/index.js.map +1 -1
  29. package/dist/js/components/DataList/DataListCheck.d.ts +1 -1
  30. package/dist/js/components/DataList/DataListCheck.d.ts.map +1 -1
  31. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -1
  32. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  33. package/dist/js/components/Modal/ModalBoxCloseButton.js +2 -2
  34. package/dist/js/components/Modal/ModalBoxCloseButton.js.map +1 -1
  35. package/dist/js/components/Modal/ModalContent.js +1 -1
  36. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  37. package/dist/js/components/Select/Select.d.ts.map +1 -1
  38. package/dist/js/components/Select/Select.js +2 -2
  39. package/dist/js/components/Select/Select.js.map +1 -1
  40. package/dist/js/components/Select/SelectOption.d.ts +2 -0
  41. package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
  42. package/dist/js/components/Select/SelectOption.js +70 -48
  43. package/dist/js/components/Select/SelectOption.js.map +1 -1
  44. package/dist/js/components/Truncate/Truncate.d.ts +21 -0
  45. package/dist/js/components/Truncate/Truncate.d.ts.map +1 -0
  46. package/dist/js/components/Truncate/Truncate.js +38 -0
  47. package/dist/js/components/Truncate/Truncate.js.map +1 -0
  48. package/dist/js/components/Truncate/index.d.ts +2 -0
  49. package/dist/js/components/Truncate/index.d.ts.map +1 -0
  50. package/dist/js/components/Truncate/index.js +5 -0
  51. package/dist/js/components/Truncate/index.js.map +1 -0
  52. package/dist/js/components/index.d.ts +1 -0
  53. package/dist/js/components/index.d.ts.map +1 -1
  54. package/dist/js/components/index.js +1 -0
  55. package/dist/js/components/index.js.map +1 -1
  56. package/dist/umd/react-core.css +59 -6
  57. package/dist/umd/react-core.js +1002 -940
  58. package/dist/umd/react-core.min.css +59 -6
  59. package/dist/umd/react-core.min.js +2 -2
  60. package/index.d.ts +4 -0
  61. package/package.json +6 -6
  62. package/src/components/BackToTop/examples/BackToTop.css +3 -3
  63. package/src/components/BackToTop/examples/BackToTop.md +2 -6
  64. package/src/components/BackToTop/examples/BackToTopBasic.tsx +4 -0
  65. package/src/components/Backdrop/examples/Backdrop.md +3 -12
  66. package/src/components/Backdrop/examples/BackdropBasic.tsx +4 -0
  67. package/src/components/Backdrop/examples/BackdropSpinner.tsx +10 -0
  68. package/src/components/BackgroundImage/examples/BackgroundImage.md +2 -21
  69. package/src/components/BackgroundImage/examples/BackgroundImageBasic.tsx +15 -0
  70. package/src/components/Badge/examples/Badge.md +3 -24
  71. package/src/components/Badge/examples/BadgeRead.tsx +19 -0
  72. package/src/components/Badge/examples/BadgeUnread.tsx +8 -0
  73. package/src/components/Banner/examples/Banner.md +1 -14
  74. package/src/components/Banner/examples/BannerBasic.tsx +16 -0
  75. package/src/components/Brand/examples/Brand.md +3 -5
  76. package/src/components/Brand/examples/BrandBasic.tsx +5 -0
  77. package/src/components/Breadcrumb/examples/Breadcrumb.md +4 -105
  78. package/src/components/Breadcrumb/examples/BreadcrumbBasic.tsx +13 -0
  79. package/src/components/Breadcrumb/examples/BreadcrumbDropdown.tsx +53 -0
  80. package/src/components/Breadcrumb/examples/BreadcrumbWithHeading.tsx +12 -0
  81. package/src/components/Breadcrumb/examples/BreadcrumbWithoutHomeLink.tsx +15 -0
  82. package/src/components/Button/examples/ButtonAriaDisabled.tsx +33 -37
  83. package/src/components/Button/examples/ButtonCallToAction.tsx +8 -6
  84. package/src/components/Button/examples/ButtonDisabled.tsx +33 -37
  85. package/src/components/Button/examples/ButtonInlineSpanLink.tsx +2 -2
  86. package/src/components/Button/examples/ButtonLinks.tsx +6 -6
  87. package/src/components/Button/examples/ButtonProgress.tsx +8 -5
  88. package/src/components/Button/examples/ButtonSmall.tsx +9 -7
  89. package/src/components/Button/examples/ButtonTypes.tsx +4 -6
  90. package/src/components/Button/examples/ButtonVariations.tsx +31 -36
  91. package/src/components/DataList/DataListCheck.tsx +1 -1
  92. package/src/components/Modal/ModalBoxCloseButton.tsx +11 -2
  93. package/src/components/Modal/ModalContent.tsx +1 -1
  94. package/src/components/Modal/examples/Modal.md +3 -200
  95. package/src/components/Modal/examples/ModalWithForm.tsx +209 -0
  96. package/src/components/Select/Select.tsx +2 -1
  97. package/src/components/Select/SelectOption.tsx +188 -133
  98. package/src/components/Truncate/Truncate.tsx +63 -0
  99. package/src/components/Truncate/__tests__/Truncate.test.tsx +18 -0
  100. package/src/components/Truncate/__tests__/__snapshots__/Truncate.test.tsx.snap +58 -0
  101. package/src/components/Truncate/examples/Truncate.md +59 -0
  102. package/src/components/Truncate/examples/TruncateExamples.css +9 -0
  103. package/src/components/Truncate/index.ts +1 -0
  104. package/src/components/index.ts +1 -0
  105. package/src/demos/Tabs/NestedTabsDemo.js +3 -3
  106. package/src/demos/Tabs.md +4 -0
  107. package/src/demos/examples/Tabs/GrayTabs.tsx +158 -0
@@ -1,43 +1,39 @@
1
1
  import React from 'react';
2
- import { Button, Flex } from '@patternfly/react-core';
2
+ import { Button } from '@patternfly/react-core';
3
3
  import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
4
4
  import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
5
5
 
6
6
  export const ButtonDisabled: React.FunctionComponent = () => (
7
- <Flex direction={{ default: 'column' }}>
8
- <Flex>
9
- <Button isDisabled>Primary disabled</Button>
10
- <Button isDisabled>Secondary disabled</Button>
11
- <Button variant="secondary" isDanger isDisabled>
12
- Danger secondary disabled
13
- </Button>
14
- <Button isDisabled variant="tertiary">
15
- Tertiary disabled
16
- </Button>
17
- <Button isDisabled variant="danger">
18
- Danger disabled
19
- </Button>
20
- <Button isDisabled variant="warning">
21
- Warning disabled
22
- </Button>
23
- </Flex>
24
-
25
- <Flex>
26
- <Button isDisabled variant="link" icon={<PlusCircleIcon />}>
27
- Link disabled
28
- </Button>
29
- <Button isDisabled variant="link" isInline>
30
- Inline link disabled
31
- </Button>
32
- <Button variant="link" isDanger isDisabled>
33
- Danger link disabled
34
- </Button>
35
- <Button isDisabled variant="plain" aria-label="Action">
36
- <TimesIcon />
37
- </Button>
38
- <Button isDisabled variant="control">
39
- Control disabled
40
- </Button>
41
- </Flex>
42
- </Flex>
7
+ <React.Fragment>
8
+ <Button isDisabled>Primary disabled</Button> <Button isDisabled>Secondary disabled</Button>{' '}
9
+ <Button variant="secondary" isDanger isDisabled>
10
+ Danger secondary disabled
11
+ </Button>{' '}
12
+ <Button isDisabled variant="tertiary">
13
+ Tertiary disabled
14
+ </Button>{' '}
15
+ <Button isDisabled variant="danger">
16
+ Danger disabled
17
+ </Button>{' '}
18
+ <Button isDisabled variant="warning">
19
+ Warning disabled
20
+ </Button>
21
+ <br />
22
+ <br />
23
+ <Button isDisabled variant="link" icon={<PlusCircleIcon />}>
24
+ Link disabled
25
+ </Button>{' '}
26
+ <Button isDisabled variant="link" isInline>
27
+ Inline link disabled
28
+ </Button>{' '}
29
+ <Button variant="link" isDanger isDisabled>
30
+ Danger link disabled
31
+ </Button>{' '}
32
+ <Button isDisabled variant="plain" aria-label="Action">
33
+ <TimesIcon />
34
+ </Button>{' '}
35
+ <Button isDisabled variant="control">
36
+ Control disabled
37
+ </Button>
38
+ </React.Fragment>
43
39
  );
@@ -13,7 +13,7 @@ const handleKeydown = (event: React.KeyboardEvent<HTMLButtonElement>) => {
13
13
  };
14
14
 
15
15
  export const ButtonInlineSpanLink: React.FunctionComponent = () => (
16
- <>
16
+ <React.Fragment>
17
17
  <p>
18
18
  Lorem ipsum dolor sit amet, consectetur adipiscing elit.
19
19
  <Button variant="link" isInline component="span">
@@ -32,5 +32,5 @@ export const ButtonInlineSpanLink: React.FunctionComponent = () => (
32
32
  </Button>
33
33
  Pressing the Enter or Space keys on the inline link as span above demonstrates this by triggering an alert.
34
34
  </p>
35
- </>
35
+ </React.Fragment>
36
36
  );
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
- import { Button, Flex } from '@patternfly/react-core';
2
+ import { Button } from '@patternfly/react-core';
3
3
 
4
4
  export const ButtonLinks: React.FunctionComponent = () => (
5
- <Flex>
5
+ <React.Fragment>
6
6
  <Button component="a" href="https://pf4.patternfly.org/" target="_blank" variant="primary">
7
7
  Link to core docs
8
- </Button>
8
+ </Button>{' '}
9
9
  <Button component="a" href="https://pf4.patternfly.org/" target="_blank" variant="secondary">
10
10
  Secondary link to core docs
11
- </Button>
11
+ </Button>{' '}
12
12
  <Button isDisabled component="a" href="https://pf4.patternfly.org/" target="_blank" variant="tertiary">
13
13
  Tertiary link to core docs
14
- </Button>
14
+ </Button>{' '}
15
15
  <Button component="a" href="https://pf4.patternfly.org/contribution/#modifiers" variant="link">
16
16
  Jump to modifiers in contribution guidelines
17
17
  </Button>
18
- </Flex>
18
+ </React.Fragment>
19
19
  );
@@ -1,22 +1,23 @@
1
1
  import React from 'react';
2
- import { Button, Flex } from '@patternfly/react-core';
2
+ import { Button } from '@patternfly/react-core';
3
3
 
4
4
  export const ButtonProgress: React.FunctionComponent = () => {
5
5
  const [isPrimaryLoading, setIsPrimaryLoading] = React.useState<boolean>(true);
6
6
  const [isSecondaryLoading, setIsSecondaryLoading] = React.useState<boolean>(true);
7
7
 
8
8
  return (
9
- <Flex>
9
+ <React.Fragment>
10
10
  <Button
11
+ spinnerAriaValueText={isPrimaryLoading ? 'Loading' : undefined}
11
12
  isLoading={isPrimaryLoading}
12
13
  variant="primary"
13
14
  onClick={() => setIsPrimaryLoading(!isPrimaryLoading)}
14
15
  {...(isPrimaryLoading && { spinnerAriaValueText: 'Loading' })}
15
16
  >
16
17
  {isPrimaryLoading ? 'Click to stop loading' : 'Click to start loading'}
17
- </Button>
18
-
18
+ </Button>{' '}
19
19
  <Button
20
+ spinnerAriaValueText={isSecondaryLoading ? 'Loading' : undefined}
20
21
  isLoading={isSecondaryLoading}
21
22
  variant="secondary"
22
23
  onClick={() => setIsSecondaryLoading(!isSecondaryLoading)}
@@ -24,6 +25,8 @@ export const ButtonProgress: React.FunctionComponent = () => {
24
25
  >
25
26
  {isSecondaryLoading ? 'Click to stop loading' : 'Click to start loading'}
26
27
  </Button>
27
- </Flex>
28
+ <br />
29
+ <br />
30
+ </React.Fragment>
28
31
  );
29
32
  };
@@ -1,22 +1,24 @@
1
1
  import React from 'react';
2
- import { Button, Flex } from '@patternfly/react-core';
2
+ import { Button } from '@patternfly/react-core';
3
3
 
4
4
  export const ButtonSmall: React.FunctionComponent = () => (
5
- <Flex>
5
+ <React.Fragment>
6
6
  <Button variant="primary" isSmall>
7
7
  Primary
8
- </Button>
8
+ </Button>{' '}
9
9
  <Button variant="secondary" isSmall>
10
10
  Secondary
11
- </Button>
11
+ </Button>{' '}
12
12
  <Button variant="tertiary" isSmall>
13
13
  Tertiary
14
- </Button>
14
+ </Button>{' '}
15
15
  <Button variant="danger" isSmall>
16
16
  Danger
17
- </Button>
17
+ </Button>{' '}
18
18
  <Button variant="warning" isSmall>
19
19
  Warning
20
20
  </Button>
21
- </Flex>
21
+ <br />
22
+ <br />
23
+ </React.Fragment>
22
24
  );
@@ -1,10 +1,8 @@
1
1
  import React from 'react';
2
- import { Button, Flex } from '@patternfly/react-core';
2
+ import { Button } from '@patternfly/react-core';
3
3
 
4
4
  export const ButtonTypes: React.FunctionComponent = () => (
5
- <Flex>
6
- <Button type="submit">Submit</Button>
7
- <Button type="reset">Reset</Button>
8
- <Button>Default</Button>
9
- </Flex>
5
+ <React.Fragment>
6
+ <Button type="submit">Submit</Button> <Button type="reset">Reset</Button> <Button>Default</Button>
7
+ </React.Fragment>
10
8
  );
@@ -1,47 +1,42 @@
1
1
  import React from 'react';
2
- import { Button, Flex } from '@patternfly/react-core';
2
+ import { Button } from '@patternfly/react-core';
3
3
  import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
4
4
  import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
5
5
  import ExternalLinkSquareAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-square-alt-icon';
6
6
  import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
7
7
 
8
8
  export const ButtonVariations: React.FunctionComponent = () => (
9
- <Flex direction={{ default: 'column' }} alignItems={{ default: 'alignItemsFlexStart' }}>
10
- <Flex>
11
- <Button variant="primary">Primary</Button>
12
- <Button variant="secondary">Secondary</Button>
13
- <Button variant="secondary" isDanger>
14
- Danger Secondary
15
- </Button>
16
- <Button variant="tertiary">Tertiary</Button>
17
- <Button variant="danger">Danger</Button>
18
- <Button variant="warning">Warning</Button>
19
- </Flex>
20
-
21
- <Flex>
22
- <Button variant="link" icon={<PlusCircleIcon />}>
23
- Link
24
- </Button>
25
- <Button variant="link" icon={<ExternalLinkSquareAltIcon />} iconPosition="right">
26
- Link
27
- </Button>
28
- <Button variant="link" isInline>
29
- Inline link
30
- </Button>
31
- <Button variant="link" isDanger>
32
- Danger link
33
- </Button>
34
- </Flex>
35
-
9
+ <React.Fragment>
10
+ <Button variant="primary">Primary</Button> <Button variant="secondary">Secondary</Button>{' '}
11
+ <Button variant="secondary" isDanger>
12
+ Danger Secondary
13
+ </Button>{' '}
14
+ <Button variant="tertiary">Tertiary</Button> <Button variant="danger">Danger</Button>{' '}
15
+ <Button variant="warning">Warning</Button>
16
+ <br />
17
+ <br />
18
+ <Button variant="link" icon={<PlusCircleIcon />}>
19
+ Link
20
+ </Button>{' '}
21
+ <Button variant="link" icon={<ExternalLinkSquareAltIcon />} iconPosition="right">
22
+ Link
23
+ </Button>{' '}
24
+ <Button variant="link" isInline>
25
+ Inline link
26
+ </Button>{' '}
27
+ <Button variant="link" isDanger>
28
+ Danger link
29
+ </Button>
30
+ <br />
31
+ <br />
36
32
  <Button variant="plain" aria-label="Action">
37
33
  <TimesIcon />
38
34
  </Button>
39
-
40
- <Flex>
41
- <Button variant="control">Control</Button>
42
- <Button variant="control" aria-label="Copy">
43
- <CopyIcon />
44
- </Button>
45
- </Flex>
46
- </Flex>
35
+ <br />
36
+ <br />
37
+ <Button variant="control">Control</Button>{' '}
38
+ <Button variant="control" aria-label="Copy">
39
+ <CopyIcon />
40
+ </Button>
41
+ </React.Fragment>
47
42
  );
@@ -11,7 +11,7 @@ export interface DataListCheckProps extends Omit<React.HTMLProps<HTMLInputElemen
11
11
  isDisabled?: boolean;
12
12
  /** Flag to show if the DataList checkbox is checked */
13
13
  isChecked?: boolean;
14
- /** Alternate Flag to show if the DataList checkbox is checked */
14
+ /** Flag to set default value of DataList checkbox when it is uncontrolled by React state */
15
15
  checked?: boolean;
16
16
  /** A callback for when the DataList checkbox selection changes */
17
17
  onChange?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { Button } from '../Button';
3
3
  import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
4
+ import { OUIAProps } from '../../helpers';
4
5
 
5
- export interface ModalBoxCloseButtonProps {
6
+ export interface ModalBoxCloseButtonProps extends OUIAProps {
6
7
  /** Additional classes added to the close button */
7
8
  className?: string;
8
9
  /** A callback for when the close button is clicked */
@@ -12,9 +13,17 @@ export interface ModalBoxCloseButtonProps {
12
13
  export const ModalBoxCloseButton: React.FunctionComponent<ModalBoxCloseButtonProps> = ({
13
14
  className = '',
14
15
  onClose = () => undefined as any,
16
+ ouiaId,
15
17
  ...props
16
18
  }: ModalBoxCloseButtonProps) => (
17
- <Button className={className} variant="plain" onClick={onClose} aria-label="Close" {...props}>
19
+ <Button
20
+ className={className}
21
+ variant="plain"
22
+ onClick={onClose}
23
+ aria-label="Close"
24
+ {...(ouiaId && { ouiaId: `${ouiaId}-${ModalBoxCloseButton.displayName}` })}
25
+ {...props}
26
+ >
18
27
  <TimesIcon />
19
28
  </Button>
20
29
  );
@@ -162,7 +162,7 @@ export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
162
162
  aria-describedby={ariaDescribedby || (hasNoBodyWrapper ? null : descriptorId)}
163
163
  {...getOUIAProps(ModalContent.displayName, ouiaId, ouiaSafe)}
164
164
  >
165
- {showClose && <ModalBoxCloseButton onClose={onClose} />}
165
+ {showClose && <ModalBoxCloseButton onClose={onClose} ouiaId={ouiaId} />}
166
166
  {modalBoxHeader}
167
167
  {modalBody}
168
168
  {modalBoxFooter}
@@ -866,203 +866,6 @@ class HelpModal extends React.Component {
866
866
 
867
867
  ### With form
868
868
 
869
- ```js
870
- import React from 'react';
871
- import { Modal, ModalVariant, Button, Form, FormGroup, HelpIcon, Popover, TextInput } from '@patternfly/react-core';
872
-
873
- FormModal = () => {
874
- const [isModalOpen, setModalOpen] = React.useState(false);
875
- const [nameValue, setNameValue] = React.useState("");
876
- const [emailValue, setEmailValue] = React.useState("");
877
- const [addressValue, setAddressValue] = React.useState("");
878
-
879
- handleModalToggle = () => {
880
- setModalOpen(!isModalOpen);
881
- };
882
-
883
- handleNameInputChange = value => {
884
- setNameValue(value);
885
- };
886
-
887
- handleEmailInputChange = value => {
888
- setEmailValue(value);
889
- };
890
- handleAddressInputChange = value => {
891
- setAddressValue(value);
892
- };
893
-
894
-
895
- return (
896
- <React.Fragment>
897
- <Button variant="primary" onClick={handleModalToggle}>
898
- Show modal
899
- </Button>
900
- <Modal
901
- variant={ModalVariant.small}
902
- title="Create account"
903
- description="Enter your personal information below to create an account."
904
- isOpen={isModalOpen}
905
- onClose={handleModalToggle}
906
- actions={[
907
- <Button key="create" variant="primary" form="modal-with-form-form" onClick={this.handleModalToggle}>
908
- Confirm
909
- </Button>,
910
- <Button key="cancel" variant="link" onClick={this.handleModalToggle}>
911
- Cancel
912
- </Button>
913
- ]}
914
- >
915
- <Form id="modal-with-form-form">
916
- <FormGroup
917
- label="Name"
918
- labelIcon={
919
- <Popover
920
- headerContent={
921
- <div>
922
- The
923
- <a href="https://schema.org/name" target="_blank">
924
- name
925
- </a>
926
- of a
927
- <a href="https://schema.org/Person" target="_blank">
928
- Person
929
- </a>
930
- </div>
931
- }
932
- bodyContent={
933
- <div>
934
- Often composed of
935
- <a href="https://schema.org/givenName" target="_blank">
936
- givenName
937
- </a>
938
- and
939
- <a href="https://schema.org/familyName" target="_blank">
940
- familyName
941
- </a>
942
- .
943
- </div>
944
- }
945
- >
946
- <button
947
- type="button"
948
- aria-label="More info for name field"
949
- onClick={e => e.preventDefault()}
950
- aria-describedby="modal-with-form-form-name"
951
- className="pf-c-form__group-label-help"
952
- >
953
- <HelpIcon noVerticalAlign />
954
- </button>
955
- </Popover>
956
- }
957
- isRequired
958
- fieldId="modal-with-form-form-name">
959
- <TextInput
960
- isRequired
961
- type="email"
962
- id="modal-with-form-form-name"
963
- name="modal-with-form-form-name"
964
- value={nameValue}
965
- onChange={handleNameInputChange}
966
- />
967
- </FormGroup>
968
- <FormGroup
969
- label="E-mail"
970
- labelIcon={
971
- <Popover
972
- headerContent={
973
- <div>
974
- The
975
- <a href="https://schema.org/email" target="_blank">
976
- e-mail
977
- </a>
978
- of a
979
- <a href="https://schema.org/Person" target="_blank">
980
- person
981
- </a>
982
- </div>
983
- }
984
- bodyContent={
985
- <div>
986
- Valid
987
- <a href="https://schema.org/email" target="_blank">
988
- e-mail
989
- </a>
990
- address.
991
- </div>
992
- }
993
- >
994
- <button
995
- type="button"
996
- aria-label="More info for e-mail field"
997
- onClick={e => e.preventDefault()}
998
- aria-describedby="modal-with-form-form-email"
999
- className="pf-c-form__group-label-help"
1000
- >
1001
- <HelpIcon noVerticalAlign />
1002
- </button>
1003
- </Popover>
1004
- }
1005
- isRequired
1006
- fieldId="modal-with-form-form-email">
1007
- <TextInput
1008
- isRequired
1009
- type="email"
1010
- id="modal-with-form-form-email"
1011
- name="modal-with-form-form-email"
1012
- value={emailValue}
1013
- onChange={handleEmailInputChange}
1014
- />
1015
- </FormGroup>
1016
- <FormGroup
1017
- label="Address"
1018
- labelIcon={
1019
- <Popover
1020
- headerContent={
1021
- <div>
1022
- The
1023
- <a href="https://schema.org/address" target="_blank">
1024
- adress
1025
- </a>
1026
- of a
1027
- <a href="https://schema.org/Person" target="_blank">
1028
- person
1029
- </a>
1030
- </div>
1031
- }
1032
- bodyContent={
1033
- <div>
1034
- Valid
1035
- <a href="https://schema.org/PostalAddress" target="_blank">
1036
- postal address.
1037
- </a>
1038
- </div>
1039
- }
1040
- >
1041
- <button
1042
- type="button"
1043
- aria-label="More info for address field"
1044
- onClick={e => e.preventDefault()}
1045
- aria-describedby="modal-with-form-form-address"
1046
- className="pf-c-form__group-label-help"
1047
- >
1048
- <HelpIcon noVerticalAlign />
1049
- </button>
1050
- </Popover>
1051
- }
1052
- isRequired
1053
- fieldId="modal-with-form-form-address">
1054
- <TextInput
1055
- isRequired
1056
- type="email"
1057
- id="modal-with-form-form-address"
1058
- name="modal-with-form-form-address"
1059
- value={addressValue}
1060
- onChange={handleAddressInputChange}
1061
- />
1062
- </FormGroup>
1063
- </Form>
1064
- </Modal>
1065
- </React.Fragment>
1066
- );
1067
- };
1068
- ```
869
+ ```ts file="ModalWithForm.tsx"
870
+
871
+ ```