@patternfly/react-docs 7.6.0-prerelease.6 → 7.6.0-prerelease.8

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 (163) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +12 -13
  3. package/patternfly-docs/generated/components/about-modal/react.js +149 -0
  4. package/patternfly-docs/generated/components/accordion/react.js +262 -0
  5. package/patternfly-docs/generated/components/action-list/react.js +144 -0
  6. package/patternfly-docs/generated/components/alert/react-demos.js +56 -0
  7. package/patternfly-docs/generated/components/alert/react.js +1433 -0
  8. package/patternfly-docs/generated/components/avatar/react.js +166 -0
  9. package/patternfly-docs/generated/components/back-to-top/react-demos.js +60 -0
  10. package/patternfly-docs/generated/components/back-to-top/react.js +77 -0
  11. package/patternfly-docs/generated/components/backdrop/react.js +64 -0
  12. package/patternfly-docs/generated/components/background-image/react.js +62 -0
  13. package/patternfly-docs/generated/components/badge/react.js +97 -0
  14. package/patternfly-docs/generated/components/banner/react-demos.js +57 -0
  15. package/patternfly-docs/generated/components/banner/react.js +148 -0
  16. package/patternfly-docs/generated/components/brand/react.js +142 -0
  17. package/patternfly-docs/generated/components/breadcrumb/react.js +206 -0
  18. package/patternfly-docs/generated/components/button/react-demos.js +57 -0
  19. package/patternfly-docs/generated/components/button/react.js +826 -0
  20. package/patternfly-docs/generated/components/card/react-demos.js +201 -0
  21. package/patternfly-docs/generated/components/card/react.js +1015 -0
  22. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +1350 -0
  23. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +1334 -0
  24. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +1282 -0
  25. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +848 -0
  26. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +192 -0
  27. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +426 -0
  28. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +804 -0
  29. package/patternfly-docs/generated/components/charts/legends/-Victory.js +3230 -0
  30. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +1178 -0
  31. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +525 -0
  32. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +3382 -0
  33. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +377 -0
  34. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +2475 -0
  35. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +538 -0
  36. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +1551 -0
  37. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +4115 -0
  38. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +955 -0
  39. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +1173 -0
  40. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +1166 -0
  41. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +413 -0
  42. package/patternfly-docs/generated/components/chip/react-deprecated.js +323 -0
  43. package/patternfly-docs/generated/components/clipboard-copy/react.js +373 -0
  44. package/patternfly-docs/generated/components/code-block/react.js +148 -0
  45. package/patternfly-docs/generated/components/code-editor/react.js +659 -0
  46. package/patternfly-docs/generated/components/compass/react-demos.js +147 -0
  47. package/patternfly-docs/generated/components/compass/react.js +440 -0
  48. package/patternfly-docs/generated/components/content/react.js +248 -0
  49. package/patternfly-docs/generated/components/data-list/react-demos.js +90 -0
  50. package/patternfly-docs/generated/components/data-list/react.js +709 -0
  51. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +283 -0
  52. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +64 -0
  53. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +83 -0
  54. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +395 -0
  55. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +241 -0
  56. package/patternfly-docs/generated/components/description-list/react-demos.js +58 -0
  57. package/patternfly-docs/generated/components/description-list/react.js +743 -0
  58. package/patternfly-docs/generated/components/divider/react.js +126 -0
  59. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +351 -0
  60. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +184 -0
  61. package/patternfly-docs/generated/components/drag-and-drop/react.js +137 -0
  62. package/patternfly-docs/generated/components/drawer/react.js +598 -0
  63. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +772 -0
  64. package/patternfly-docs/generated/components/dual-list-selector/react.js +594 -0
  65. package/patternfly-docs/generated/components/empty-state/react.js +199 -0
  66. package/patternfly-docs/generated/components/expandable-section/react-demos.js +65 -0
  67. package/patternfly-docs/generated/components/expandable-section/react.js +408 -0
  68. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +52 -0
  69. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +398 -0
  70. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +749 -0
  71. package/patternfly-docs/generated/components/forms/checkbox/react.js +222 -0
  72. package/patternfly-docs/generated/components/forms/form/react.js +1106 -0
  73. package/patternfly-docs/generated/components/forms/form-select/react.js +208 -0
  74. package/patternfly-docs/generated/components/forms/radio/react.js +212 -0
  75. package/patternfly-docs/generated/components/forms/text-area/react.js +160 -0
  76. package/patternfly-docs/generated/components/forms/text-input/react.js +216 -0
  77. package/patternfly-docs/generated/components/helper-text/react-demos.js +180 -0
  78. package/patternfly-docs/generated/components/helper-text/react.js +164 -0
  79. package/patternfly-docs/generated/components/hero/react.js +88 -0
  80. package/patternfly-docs/generated/components/hint/react.js +169 -0
  81. package/patternfly-docs/generated/components/icon/react.js +215 -0
  82. package/patternfly-docs/generated/components/input-group/react.js +182 -0
  83. package/patternfly-docs/generated/components/jump-links/react-demos.js +154 -0
  84. package/patternfly-docs/generated/components/jump-links/react.js +212 -0
  85. package/patternfly-docs/generated/components/label/react-demos.js +57 -0
  86. package/patternfly-docs/generated/components/label/react.js +417 -0
  87. package/patternfly-docs/generated/components/list/react.js +175 -0
  88. package/patternfly-docs/generated/components/login-page/react.js +587 -0
  89. package/patternfly-docs/generated/components/masthead/react-demos.js +79 -0
  90. package/patternfly-docs/generated/components/masthead/react.js +291 -0
  91. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +769 -0
  92. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +665 -0
  93. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +187 -0
  94. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +163 -0
  95. package/patternfly-docs/generated/components/menus/dropdown/react.js +998 -0
  96. package/patternfly-docs/generated/components/menus/menu/react.js +1540 -0
  97. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +747 -0
  98. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +508 -0
  99. package/patternfly-docs/generated/components/menus/select/react-templates.js +257 -0
  100. package/patternfly-docs/generated/components/menus/select/react.js +998 -0
  101. package/patternfly-docs/generated/components/modal/react-deprecated.js +554 -0
  102. package/patternfly-docs/generated/components/modal/react.js +597 -0
  103. package/patternfly-docs/generated/components/navigation/react-demos.js +356 -0
  104. package/patternfly-docs/generated/components/navigation/react.js +409 -0
  105. package/patternfly-docs/generated/components/notification-badge/react.js +196 -0
  106. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +107 -0
  107. package/patternfly-docs/generated/components/notification-drawer/react.js +394 -0
  108. package/patternfly-docs/generated/components/number-input/react.js +210 -0
  109. package/patternfly-docs/generated/components/overflow-menu/react.js +274 -0
  110. package/patternfly-docs/generated/components/page/react-demos.js +149 -0
  111. package/patternfly-docs/generated/components/page/react.js +1352 -0
  112. package/patternfly-docs/generated/components/pagination/react.js +492 -0
  113. package/patternfly-docs/generated/components/panel/react.js +236 -0
  114. package/patternfly-docs/generated/components/popover/react.js +390 -0
  115. package/patternfly-docs/generated/components/progress/react-demos.js +59 -0
  116. package/patternfly-docs/generated/components/progress/react.js +283 -0
  117. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +45 -0
  118. package/patternfly-docs/generated/components/progress-stepper/react.js +219 -0
  119. package/patternfly-docs/generated/components/search-input/react-demos.js +113 -0
  120. package/patternfly-docs/generated/components/search-input/react.js +263 -0
  121. package/patternfly-docs/generated/components/sidebar/react.js +236 -0
  122. package/patternfly-docs/generated/components/simple-list/react.js +200 -0
  123. package/patternfly-docs/generated/components/skeleton/react-demos.js +44 -0
  124. package/patternfly-docs/generated/components/skeleton/react.js +122 -0
  125. package/patternfly-docs/generated/components/skip-to-content/react.js +73 -0
  126. package/patternfly-docs/generated/components/slider/react.js +309 -0
  127. package/patternfly-docs/generated/components/spinner/react.js +111 -0
  128. package/patternfly-docs/generated/components/switch/react.js +163 -0
  129. package/patternfly-docs/generated/components/table/react-demos.js +355 -0
  130. package/patternfly-docs/generated/components/table/react-deprecated.js +1350 -0
  131. package/patternfly-docs/generated/components/table/react.js +3241 -0
  132. package/patternfly-docs/generated/components/tabs/react-demos.js +108 -0
  133. package/patternfly-docs/generated/components/tabs/react.js +1359 -0
  134. package/patternfly-docs/generated/components/text-input-group/react-demos.js +152 -0
  135. package/patternfly-docs/generated/components/text-input-group/react.js +278 -0
  136. package/patternfly-docs/generated/components/tile/react-deprecated.js +242 -0
  137. package/patternfly-docs/generated/components/timestamp/react.js +283 -0
  138. package/patternfly-docs/generated/components/title/react.js +94 -0
  139. package/patternfly-docs/generated/components/toggle-group/react.js +299 -0
  140. package/patternfly-docs/generated/components/toolbar/react-demos.js +66 -0
  141. package/patternfly-docs/generated/components/toolbar/react.js +932 -0
  142. package/patternfly-docs/generated/components/tooltip/react.js +241 -0
  143. package/patternfly-docs/generated/components/tree-view/react.js +429 -0
  144. package/patternfly-docs/generated/components/truncate/react.js +211 -0
  145. package/patternfly-docs/generated/components/wizard/react-demos.js +87 -0
  146. package/patternfly-docs/generated/components/wizard/react-deprecated.js +788 -0
  147. package/patternfly-docs/generated/components/wizard/react.js +986 -0
  148. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +285 -0
  149. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +70 -0
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +506 -0
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +94 -0
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +272 -0
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +87 -0
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +124 -0
  155. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +112 -0
  156. package/patternfly-docs/generated/index.js +1769 -0
  157. package/patternfly-docs/generated/patterns/card-view/react-demos.js +78 -0
  158. package/patternfly-docs/generated/patterns/filters/react-demos.js +141 -0
  159. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +51 -0
  160. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +61 -0
  161. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +124 -0
  162. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +81 -0
  163. package/LICENSE +0 -21
@@ -0,0 +1,390 @@
1
+ import React from 'react';
2
+ import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
+ import { useRef, useState } from 'react';
4
+ import RhUiNotificationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-notification-fill-icon';
5
+ import RhUiInformationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-information-fill-icon';
6
+ import RhUiCheckCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-check-circle-fill-icon';
7
+ import RhUiWarningFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-warning-fill-icon';
8
+ import RhUiErrorFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-error-fill-icon';
9
+ import RhUiAttentionBellFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-attention-bell-fill-icon';
10
+ const pageData = {
11
+ "id": "Popover",
12
+ "section": "components",
13
+ "subsection": "",
14
+ "deprecated": false,
15
+ "template": false,
16
+ "beta": false,
17
+ "demo": false,
18
+ "newImplementationLink": false,
19
+ "source": "react",
20
+ "tabName": null,
21
+ "slug": "/components/popover/react",
22
+ "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/Popover/examples/Popover.md",
23
+ "relPath": "packages/react-core/src/components/Popover/examples/Popover.md",
24
+ "propComponents": [
25
+ {
26
+ "name": "Popover",
27
+ "description": "The main popover component. The following properties can also be passed into another component\nthat has a property specifically for passing in popover properties.",
28
+ "props": [
29
+ {
30
+ "name": "alertSeverityScreenReaderText",
31
+ "type": "string",
32
+ "description": "Text announced by screen reader when alert severity variant is set to indicate\nseverity level."
33
+ },
34
+ {
35
+ "name": "alertSeverityVariant",
36
+ "type": "'custom' | 'info' | 'warning' | 'success' | 'danger'",
37
+ "description": "Severity variants for an alert popover. This modifies the color of the header to\nmatch the severity."
38
+ },
39
+ {
40
+ "name": "animationDuration",
41
+ "type": "number",
42
+ "description": "The duration of the CSS fade transition animation.",
43
+ "defaultValue": "300"
44
+ },
45
+ {
46
+ "name": "appendTo",
47
+ "type": "HTMLElement | ((ref?: HTMLElement) => HTMLElement) | 'inline'",
48
+ "description": "The element to append the popover to. Defaults to \"inline\".",
49
+ "defaultValue": "() => document.body"
50
+ },
51
+ {
52
+ "name": "aria-label",
53
+ "type": "string",
54
+ "description": "Accessible label for the popover, required when header is not present.",
55
+ "defaultValue": "''"
56
+ },
57
+ {
58
+ "name": "bodyContent",
59
+ "type": "React.ReactNode | ((hide: () => void) => React.ReactNode)",
60
+ "description": "Body content of the popover. If you want to close the popover after an action within the\nbody content, you can use the isVisible prop for manual control, or you can provide a\nfunction which will receive a callback as an argument to hide the popover, i.e.\nbodyContent={hide => <Button onClick={() => hide()}>Close</Button>}",
61
+ "required": true
62
+ },
63
+ {
64
+ "name": "children",
65
+ "type": "ReactElement<any>",
66
+ "description": "The trigger reference element to which the popover is relatively placed to. If you cannot wrap\nthe element with the Popover, you can use the triggerRef prop instead.\nUsage: <Popover><Button>Reference</Button></Popover>"
67
+ },
68
+ {
69
+ "name": "className",
70
+ "type": "string",
71
+ "description": "Additional classes added to the popover.",
72
+ "defaultValue": "''"
73
+ },
74
+ {
75
+ "name": "closeBtnAriaLabel",
76
+ "type": "string",
77
+ "description": "Accessible label for the close button.",
78
+ "defaultValue": "'Close'"
79
+ },
80
+ {
81
+ "name": "distance",
82
+ "type": "number",
83
+ "description": "Distance of the popover to its target. Defaults to 25.",
84
+ "defaultValue": "25"
85
+ },
86
+ {
87
+ "name": "elementToFocus",
88
+ "type": "HTMLElement | SVGElement | string",
89
+ "description": "The element to focus when the popover becomes visible. By default the first\nfocusable element will receive focus."
90
+ },
91
+ {
92
+ "name": "enableFlip",
93
+ "type": "boolean",
94
+ "description": "If true, tries to keep the popover in view by flipping it if necessary.\nIf the position is set to 'auto', this prop is ignored.",
95
+ "defaultValue": "true"
96
+ },
97
+ {
98
+ "name": "flipBehavior",
99
+ "type": "| 'flip'\n| (\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end'\n )[]",
100
+ "description": "The desired position to flip the popover to if the initial position is not possible.\nBy setting this prop to 'flip' it attempts to flip the popover to the opposite side if\nthere is no space.\nYou can also pass an array of positions that determines the flip order. It should contain\nthe initial position followed by alternative positions if that position is unavailable.\nExample: Initial position is 'top'. Button with popover is in the top right corner.\n'flipBehavior' is set to ['top', 'right', 'left']. Since there is no space to the top, it\nchecks if right is available. There's also no space to the right, so it finally shows the\npopover on the left.",
101
+ "defaultValue": "[\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'top-start',\n 'top-end',\n 'bottom-start',\n 'bottom-end',\n 'left-start',\n 'left-end',\n 'right-start',\n 'right-end'\n]"
102
+ },
103
+ {
104
+ "name": "footerContent",
105
+ "type": "React.ReactNode | ((hide: () => void) => React.ReactNode)",
106
+ "description": "Footer content of the popover. If you want to close the popover after an action within the\nfooter content, you can use the isVisible prop for manual control, or you can provide a\nfunction which will receive a callback as an argument to hide the popover, i.e.\nfooterContent={hide => <Button onClick={() => hide()}>Close</Button>}",
107
+ "defaultValue": "null"
108
+ },
109
+ {
110
+ "name": "hasAutoWidth",
111
+ "type": "boolean",
112
+ "description": "Removes fixed-width and allows width to be defined by contents.",
113
+ "defaultValue": "false"
114
+ },
115
+ {
116
+ "name": "hasNoPadding",
117
+ "type": "boolean",
118
+ "description": "Allows content to touch edges of popover container.",
119
+ "defaultValue": "false"
120
+ },
121
+ {
122
+ "name": "headerComponent",
123
+ "type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
124
+ "description": "Sets the heading level to use for the popover header. Defaults to h6.",
125
+ "defaultValue": "'h6'"
126
+ },
127
+ {
128
+ "name": "headerContent",
129
+ "type": "React.ReactNode | ((hide: () => void) => React.ReactNode)",
130
+ "description": "Simple header content to be placed within a title. If you want to close the popover after\nan action within the header content, you can use the isVisible prop for manual control,\nor you can provide a function which will receive a callback as an argument to hide the\npopover, i.e. headerContent={hide => <Button onClick={() => hide()}>Close</Button>}",
131
+ "defaultValue": "null"
132
+ },
133
+ {
134
+ "name": "headerIcon",
135
+ "type": "React.ReactNode",
136
+ "description": "Icon to be displayed in the popover header. *",
137
+ "defaultValue": "null"
138
+ },
139
+ {
140
+ "name": "hideOnOutsideClick",
141
+ "type": "boolean",
142
+ "description": "Hides the popover when a click occurs outside (only works if isVisible is not controlled\nby the user).",
143
+ "defaultValue": "true"
144
+ },
145
+ {
146
+ "name": "id",
147
+ "type": "string",
148
+ "description": "Id used as part of the various popover elements (popover-${id}-header/body/footer)."
149
+ },
150
+ {
151
+ "name": "isVisible",
152
+ "type": "boolean",
153
+ "description": "True to show the popover programmatically. Used in conjunction with the shouldClose prop.\nBy default, the popover child element handles click events automatically. If you want to\ncontrol this programmatically, the popover will not auto-close if the close button is\nclicked, the escape key is used, or if a click occurs outside the popover. Instead, the\nconsumer is responsible for closing the popover themselves by adding a callback listener\nfor the shouldClose prop.",
154
+ "defaultValue": "null"
155
+ },
156
+ {
157
+ "name": "maxWidth",
158
+ "type": "string",
159
+ "description": "Maximum width of the popover (default 18.75rem).",
160
+ "defaultValue": "popoverMaxWidth && popoverMaxWidth.value"
161
+ },
162
+ {
163
+ "name": "minWidth",
164
+ "type": "string",
165
+ "description": "Minimum width of the popover (default 6.25rem).",
166
+ "defaultValue": "popoverMinWidth && popoverMinWidth.value"
167
+ },
168
+ {
169
+ "name": "onHidden",
170
+ "type": "() => void",
171
+ "description": "Lifecycle function invoked when the popover has fully transitioned out.",
172
+ "defaultValue": "(): void => null"
173
+ },
174
+ {
175
+ "name": "onHide",
176
+ "type": "(event: MouseEvent | KeyboardEvent) => void",
177
+ "description": "Lifecycle function invoked when the popover begins to transition out.",
178
+ "defaultValue": "(): void => null"
179
+ },
180
+ {
181
+ "name": "onMount",
182
+ "type": "() => void",
183
+ "description": "Lifecycle function invoked when the popover has been mounted to the DOM.",
184
+ "defaultValue": "(): void => null"
185
+ },
186
+ {
187
+ "name": "onShow",
188
+ "type": "(event: MouseEvent | KeyboardEvent) => void",
189
+ "description": "Lifecycle function invoked when the popover begins to transition in.",
190
+ "defaultValue": "(): void => null"
191
+ },
192
+ {
193
+ "name": "onShown",
194
+ "type": "() => void",
195
+ "description": "Lifecycle function invoked when the popover has fully transitioned in.",
196
+ "defaultValue": "(): void => null"
197
+ },
198
+ {
199
+ "name": "position",
200
+ "type": "| PopoverPosition\n| 'auto'\n| 'top'\n| 'bottom'\n| 'left'\n| 'right'\n| 'top-start'\n| 'top-end'\n| 'bottom-start'\n| 'bottom-end'\n| 'left-start'\n| 'left-end'\n| 'right-start'\n| 'right-end'",
201
+ "description": "Popover position. Note: With the enableFlip property set to true, it will change the\nposition if there is not enough space for the starting position. The behavior of where it\nflips to can be controlled through the flipBehavior property.",
202
+ "defaultValue": "'top'"
203
+ },
204
+ {
205
+ "name": "shouldClose",
206
+ "type": "(event: MouseEvent | KeyboardEvent, hideFunction?: () => void) => void",
207
+ "description": "Callback function that is only invoked when isVisible is also controlled. Called when the\npopover close button is clicked, the enter key was used on it, or the escape key is used.",
208
+ "defaultValue": "(): void => null"
209
+ },
210
+ {
211
+ "name": "shouldOpen",
212
+ "type": "(event: MouseEvent | KeyboardEvent, showFunction?: () => void) => void",
213
+ "description": "Callback function that is only invoked when isVisible is also controlled. Called when the\nenter key is used on the focused trigger.",
214
+ "defaultValue": "(): void => null"
215
+ },
216
+ {
217
+ "name": "showClose",
218
+ "type": "boolean",
219
+ "description": "Flag indicating whether the close button should be shown.",
220
+ "defaultValue": "true"
221
+ },
222
+ {
223
+ "name": "triggerAction",
224
+ "type": "'click' | 'hover'",
225
+ "description": "Sets an interaction to open popover, defaults to \"click\"",
226
+ "defaultValue": "'click'"
227
+ },
228
+ {
229
+ "name": "triggerRef",
230
+ "type": "HTMLElement | (() => HTMLElement) | React.RefObject<any>",
231
+ "description": "The trigger reference element to which the popover is relatively placed to. If you can wrap the\nelement with the popover, you can use the children prop instead, or both props together.\nWhen passed along with the trigger prop, the div element that wraps the trigger will be removed.\nUsage: <Popover triggerRef={() => document.getElementById('reference-element')} />"
232
+ },
233
+ {
234
+ "name": "withFocusTrap",
235
+ "type": "boolean",
236
+ "description": "Whether to trap focus in the popover."
237
+ },
238
+ {
239
+ "name": "zIndex",
240
+ "type": "number",
241
+ "description": "The z-index of the popover.",
242
+ "defaultValue": "9999"
243
+ }
244
+ ]
245
+ }
246
+ ],
247
+ "cssPrefix": [
248
+ "pf-v6-c-popover"
249
+ ],
250
+ "examples": [
251
+ "Basic",
252
+ "Hoverable",
253
+ "Close popover from content (controlled)",
254
+ "Close popover from content (uncontrolled)",
255
+ "Without header/footer/close and no padding",
256
+ "Width auto",
257
+ "Popover react ref",
258
+ "Popover selector ref",
259
+ "Advanced",
260
+ "Popover with icon in the title",
261
+ "Alert popover",
262
+ "Custom focus"
263
+ ]
264
+ };
265
+ pageData.liveContext = {
266
+ useRef,
267
+ useState,
268
+ RhUiNotificationFillIcon,
269
+ RhUiInformationFillIcon,
270
+ RhUiCheckCircleFillIcon,
271
+ RhUiWarningFillIcon,
272
+ RhUiErrorFillIcon,
273
+ RhUiAttentionBellFillIcon
274
+ };
275
+ pageData.examples = {
276
+ 'Basic': props =>
277
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverBasic: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Basic popover\"\n headerContent={<div>Popover header</div>}\n bodyContent={<div>Popovers are triggered by click rather than hover.</div>}\n footerContent=\"Popover footer\"\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n);\n","title":"Basic","lang":"ts","className":""}}>
278
+
279
+ </Example>,
280
+ 'Hoverable': props =>
281
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverHover: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <Popover\n triggerAction=\"hover\"\n aria-label=\"Hoverable popover\"\n headerContent={<div>Popover header</div>}\n bodyContent={<div>This popover opens on hover.</div>}\n footerContent=\"Popover footer\"\n >\n <Button disabled>Hover to trigger popover</Button>\n </Popover>\n </div>\n);\n","title":"Hoverable","lang":"ts","className":""}}>
282
+
283
+ </Example>,
284
+ 'Close popover from content (controlled)': props =>
285
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverCloseControlled: React.FunctionComponent = () => {\n const [isVisible, setIsVisible] = useState(false);\n\n return (\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Popover with button in the body that can close it\"\n isVisible={isVisible}\n shouldOpen={(_event, _fn) => setIsVisible(true)}\n shouldClose={(_event, _fn) => setIsVisible(false)}\n headerContent={<div>Popover header</div>}\n bodyContent={\n <div>\n <div>A controlled popover can be closed by updating its isVisible state after some user interaction.</div>\n <div>\n <button onClick={() => setIsVisible(false)}>Close popover</button>\n </div>\n </div>\n }\n footerContent=\"Popover footer\"\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n );\n};\n","title":"Close popover from content (controlled)","lang":"ts","className":""}}>
286
+
287
+ </Example>,
288
+ 'Close popover from content (uncontrolled)': props =>
289
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverCloseUncontrolled: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Uncontrolled popover with button in the body that can close it\"\n headerContent={<div>Popover header</div>}\n bodyContent={(hide) => (\n <div>\n <div>\n All the content props (headerContent, bodyContent, footerContent) can take a function which the popover\n component passes the hide function to which can be used to close the popover after some user interaction.\n </div>\n <div>\n <button onClick={hide}>Close popover</button>\n </div>\n </div>\n )}\n footerContent=\"Popover footer\"\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n);\n","title":"Close popover from content (uncontrolled)","lang":"ts","className":""}}>
290
+
291
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
292
+ {`Note: If you use the isVisible prop, either refer to the example above or if you want to use the hide callback from the content then be sure to keep isVisible in-sync.`}
293
+ </p>
294
+ </Example>,
295
+ 'Without header/footer/close and no padding': props =>
296
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverWithoutHeaderFooterCloseNoPadding: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Popover with no header, footer, close button, and padding\"\n hasNoPadding\n showClose={false}\n bodyContent={() => (\n <div>\n This popover has no padding and is intended for use with content that has its own spacing and should touch the\n edges of the popover container.\n </div>\n )}\n withFocusTrap={false /* no focusable content in this example */}\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n);\n","title":"Without header/footer/close and no padding","lang":"ts","className":""}}>
297
+
298
+ </Example>,
299
+ 'Width auto': props =>
300
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverWidthAuto: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Popover with auto-width\"\n hasAutoWidth\n bodyContent={() => <div>Removes fixed-width and allows width to be defined by contents</div>}\n appendTo={() => document.body}\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n);\n","title":"Width auto","lang":"ts","className":""}}>
301
+
302
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
303
+ {`Here the popover goes over the navigation, so the prop `}
304
+
305
+ <code {...{"className":"ws-code "}}>
306
+ {`appendTo`}
307
+ </code>
308
+ {` is set to the documents body.`}
309
+ </p>
310
+ </Example>,
311
+ 'Popover react ref': props =>
312
+ <Example {...pageData} {...props} {...{"code":"import { useRef } from 'react';\nimport { Popover } from '@patternfly/react-core';\n\nexport const PopoverReactRef: React.FunctionComponent = () => {\n const popoverRef = useRef<HTMLButtonElement>(null);\n\n return (\n <div style={{ margin: '50px' }}>\n <button ref={popoverRef}>Popover attached via react ref</button>\n <Popover\n aria-label=\"Popover with react reference example\"\n headerContent={<div>Popover header</div>}\n bodyContent={\n <div>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.\n </div>\n }\n footerContent=\"Popover footer\"\n triggerRef={popoverRef}\n />\n </div>\n );\n};\n","title":"Popover react ref","lang":"ts","className":""}}>
313
+
314
+ </Example>,
315
+ 'Popover selector ref': props =>
316
+ <Example {...pageData} {...props} {...{"code":"import { Popover } from '@patternfly/react-core';\n\nexport const PopoverSelectorRef: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <button id=\"popover-selector\">Popover attached via selector ref</button>\n <Popover\n aria-label=\"Popover with selector reference example\"\n headerContent={<div>Popover header</div>}\n bodyContent={\n <div>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.\n </div>\n }\n footerContent=\"Popover footer\"\n triggerRef={() => document.getElementById('popover-selector') as HTMLButtonElement}\n />\n </div>\n);\n","title":"Popover selector ref","lang":"ts","className":""}}>
317
+
318
+ </Example>,
319
+ 'Advanced': props =>
320
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Popover, PopoverPosition, Checkbox, Button } from '@patternfly/react-core';\n\nexport const PopoverAdvanced: React.FunctionComponent = () => {\n const [position, setPosition] = useState(PopoverPosition.auto);\n const [show, setShow] = useState(false);\n const [keepInViewChecked, setKeepInViewChecked] = useState(true);\n\n const handleKeepInViewChange = (checked: boolean) => {\n setKeepInViewChecked(checked);\n };\n\n const handleProgrammaticChange = (checked: boolean) => {\n setShow(checked);\n };\n\n const shouldClose = (_event, _fn) => {\n setShow(false);\n };\n\n const shouldOpen = (_event, _fn) => {\n setShow(true);\n };\n\n return (\n <>\n <div>\n <span style={{ paddingRight: '10px' }}>Popover position</span>\n <select\n aria-label=\"Popover position\"\n onChange={(event) => {\n setPosition(event.target.value as PopoverPosition);\n }}\n >\n {Object.values(PopoverPosition).map((position) => (\n <option key={position} value={position}>\n {position}\n </option>\n ))}\n </select>\n <Checkbox\n label=\"Flip popover if the position falls outside the view\"\n isChecked={keepInViewChecked}\n onChange={(_event, checked) => handleKeepInViewChange(checked)}\n aria-label=\"Keep in view\"\n id=\"popover-advanced-check-1\"\n />\n <Checkbox\n label=\"Toggle popover from outside\"\n isChecked={show}\n onChange={(_event, checked) => handleProgrammaticChange(checked)}\n aria-label=\"Toggle popover from outside\"\n id=\"popover-advanced-check-2\"\n />\n </div>\n\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Advanced popover usages example\"\n position={position}\n hideOnOutsideClick={false}\n isVisible={show}\n shouldClose={shouldClose}\n shouldOpen={shouldOpen}\n enableFlip={keepInViewChecked}\n headerContent={<div>Popover header</div>}\n bodyContent={\n <div>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.\n </div>\n }\n footerContent=\"Popover footer\"\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n </>\n );\n};\n","title":"Advanced","lang":"ts","className":""}}>
321
+
322
+ </Example>,
323
+ 'Popover with icon in the title': props =>
324
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\nimport RhUiAttentionBellFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-attention-bell-fill-icon';\n\nexport const PopoverWithIconInTheTitle: React.FunctionComponent = () => (\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Popover with icon in the title example\"\n headerContent=\"Popover with icon\"\n headerIcon={<RhUiAttentionBellFillIcon />}\n bodyContent={<div>Popovers are triggered by click rather than hover.</div>}\n footerContent=\"Popover footer\"\n appendTo={() => document.body}\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n);\n","title":"Popover with icon in the title","lang":"ts","className":""}}>
325
+
326
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
327
+ {`Here the popover goes over the navigation, so the prop `}
328
+
329
+ <code {...{"className":"ws-code "}}>
330
+ {`appendTo`}
331
+ </code>
332
+ {` is set to the documents body.`}
333
+ </p>
334
+ </Example>,
335
+ 'Alert popover': props =>
336
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Popover, Button } from '@patternfly/react-core';\nimport RhUiNotificationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-notification-fill-icon';\nimport RhUiInformationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-information-fill-icon';\nimport RhUiCheckCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-check-circle-fill-icon';\nimport RhUiWarningFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-warning-fill-icon';\nimport RhUiErrorFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-error-fill-icon';\n\nexport const AlertPopover: React.FunctionComponent = () => {\n const [alertSeverityVariant, setAlertSeverityVariant] = useState('default');\n\n const alertIcons = {\n custom: <RhUiNotificationFillIcon />,\n info: <RhUiInformationFillIcon />,\n success: <RhUiCheckCircleFillIcon />,\n warning: <RhUiWarningFillIcon />,\n danger: <RhUiErrorFillIcon />\n };\n\n return (\n <>\n <div>\n <span style={{ paddingRight: '10px' }}>Alert variant:</span>\n <select aria-label=\"Popover alert type\" onChange={(event) => setAlertSeverityVariant(event.target.value)}>\n <option value=\"custom\">custom</option>\n <option value=\"info\">info</option>\n <option value=\"success\">success</option>\n <option value=\"warning\">warning</option>\n <option value=\"danger\">danger</option>\n </select>\n </div>\n <div style={{ margin: '50px' }}>\n <Popover\n aria-label=\"Alert popover\"\n alertSeverityVariant={alertSeverityVariant as 'custom' | 'info' | 'warning' | 'success' | 'danger'}\n headerContent=\"Default popover title\"\n headerIcon={alertIcons[alertSeverityVariant]}\n headerComponent=\"h1\"\n bodyContent={<div>Popovers are triggered by click rather than hover.</div>}\n footerContent=\"Popover footer\"\n appendTo={() => document.body}\n >\n <Button>Toggle popover</Button>\n </Popover>\n </div>\n </>\n );\n};\n","title":"Alert popover","lang":"ts","className":""}}>
337
+
338
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
339
+ {`Here the popover goes over the navigation, so the prop `}
340
+
341
+ <code {...{"className":"ws-code "}}>
342
+ {`appendTo`}
343
+ </code>
344
+ {` is set to the documents body.`}
345
+ </p>
346
+ </Example>,
347
+ 'Custom focus': props =>
348
+ <Example {...pageData} {...props} {...{"code":"import { Popover, Button } from '@patternfly/react-core';\n\nexport const PopoverCustomFocus: React.FunctionComponent = () => (\n <Popover\n elementToFocus=\"#popover-cancel-button\"\n showClose={false}\n aria-label=\"Popover with custom focus\"\n headerContent={<div>Popover header</div>}\n bodyContent={\n <div>\n Lorem ipsum dolor sit amet, consectetur adipisicing elit.{' '}\n <Button\n // Preventing default click behavior for example purposes only\n onClick={(event: React.MouseEvent) => event.preventDefault()}\n component=\"a\"\n isInline\n variant=\"link\"\n href=\"#basic\"\n >\n View the basic example\n </Button>\n </div>\n }\n footerContent={(hide) => (\n <Button onClick={hide} variant=\"secondary\" id=\"popover-cancel-button\">\n Cancel\n </Button>\n )}\n >\n <Button>Toggle popover with custom focus</Button>\n </Popover>\n);\n","title":"Custom focus","lang":"ts","className":""}}>
349
+
350
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
351
+ {`Use the `}
352
+
353
+ <code {...{"className":"ws-code "}}>
354
+ {`elementToFocus`}
355
+ </code>
356
+ {` property to customize which element inside the Popover receives focus when opened.`}
357
+ </p>
358
+ </Example>
359
+ };
360
+
361
+ const Component = () => (
362
+ <React.Fragment>
363
+ <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
364
+ {`Examples`}
365
+ </AutoLinkHeader>
366
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
367
+ {`By default, the `}
368
+ <code {...{"className":"ws-code "}}>
369
+ {`appendTo`}
370
+ </code>
371
+ {` prop of the popover will append to the document body in order to avoid the popover content not being fully visible. Another option is to increase the z-index of the element the popover is appended to to be higher than the z-index of the element that is hiding the popover.`}
372
+ </p>
373
+ {React.createElement(pageData.examples["Basic"])}
374
+ {React.createElement(pageData.examples["Hoverable"])}
375
+ {React.createElement(pageData.examples["Close popover from content (controlled)"])}
376
+ {React.createElement(pageData.examples["Close popover from content (uncontrolled)"])}
377
+ {React.createElement(pageData.examples["Without header/footer/close and no padding"])}
378
+ {React.createElement(pageData.examples["Width auto"])}
379
+ {React.createElement(pageData.examples["Popover react ref"])}
380
+ {React.createElement(pageData.examples["Popover selector ref"])}
381
+ {React.createElement(pageData.examples["Advanced"])}
382
+ {React.createElement(pageData.examples["Popover with icon in the title"])}
383
+ {React.createElement(pageData.examples["Alert popover"])}
384
+ {React.createElement(pageData.examples["Custom focus"])}
385
+ </React.Fragment>
386
+ );
387
+ Component.displayName = 'ComponentsPopoverReactDocs';
388
+ Component.pageData = pageData;
389
+
390
+ export default Component;
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
+ import { useState } from 'react';
4
+ import accessibilityStyles from '@patternfly/react-styles/css/utilities/Accessibility/accessibility';
5
+ const pageData = {
6
+ "id": "Progress",
7
+ "section": "components",
8
+ "subsection": "",
9
+ "deprecated": false,
10
+ "template": false,
11
+ "beta": false,
12
+ "demo": false,
13
+ "newImplementationLink": false,
14
+ "source": "react-demos",
15
+ "tabName": null,
16
+ "slug": "/components/progress/react-demos",
17
+ "sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/demos/ProgressDemo.md",
18
+ "relPath": "packages/react-core/src/demos/ProgressDemo.md",
19
+ "examples": [
20
+ "Basic",
21
+ "With only increasing progress"
22
+ ]
23
+ };
24
+ pageData.liveContext = {
25
+ useState,
26
+ accessibilityStyles
27
+ };
28
+ pageData.examples = {
29
+ 'Basic': props =>
30
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Progress, Button, Stack, StackItem } from '@patternfly/react-core';\nimport accessibilityStyles from '@patternfly/react-styles/css/utilities/Accessibility/accessibility';\n\nexport const ProgressBasic: React.FunctionComponent = () => {\n const [currentValue, setCurrentValue] = useState(0);\n\n const onProgressUpdate = (nextValue) => {\n setCurrentValue(nextValue);\n };\n\n return (\n <Stack>\n <StackItem>\n <Button onClick={() => onProgressUpdate(currentValue - 10)} isDisabled={currentValue === 0}>\n Decrease value\n </Button>{' '}\n <Button onClick={() => onProgressUpdate(currentValue + 10)} isDisabled={currentValue === 100}>\n Increase value\n </Button>\n <br />\n <br />\n </StackItem>\n <StackItem>\n <div className={accessibilityStyles.screenReader} aria-live=\"polite\">\n {`Progress value is ${currentValue}%.`}\n </div>\n <Progress value={currentValue} title=\"Title\" />\n </StackItem>\n </Stack>\n );\n};\n","title":"Basic","lang":"ts","className":""}}>
31
+
32
+ </Example>,
33
+ 'With only increasing progress': props =>
34
+ <Example {...pageData} {...props} {...{"code":"import { useState } from 'react';\nimport { Progress, Button, Stack, StackItem } from '@patternfly/react-core';\n\nexport const ProgressWithOnlyIncreasing: React.FunctionComponent = () => {\n const [currentValue, setCurrentValue] = useState(0);\n\n const onProgressUpdate = (nextValue) => {\n if (nextValue > currentValue) {\n setCurrentValue(nextValue);\n }\n };\n\n return (\n <Stack>\n <StackItem>\n <Button onClick={() => onProgressUpdate(currentValue - 10)} isDisabled={currentValue === 0}>\n Decrease value\n </Button>{' '}\n <Button onClick={() => onProgressUpdate(currentValue + 10)} isDisabled={currentValue === 100}>\n Increase value\n </Button>\n <br />\n <br />\n </StackItem>\n <StackItem>\n <div className={accessibilityStyles.screenReader} aria-live=\"polite\">\n {`Progress value is ${currentValue}%.`}\n </div>\n <Progress value={currentValue} title=\"Title\" />\n </StackItem>\n </Stack>\n );\n};\n","title":"With only increasing progress","lang":"ts","className":""}}>
35
+
36
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
37
+ {`Sometimes a progress bar should only show increases to progress state. In this case, before the next value is set it should be checked against the current progress. The `}
38
+
39
+ <code {...{"className":"ws-code "}}>
40
+ {`Decrease progress`}
41
+ </code>
42
+ {` button attempts to set a lower progress value, simulating an update to a progress state that isn't desired, but won't change the progress state due to this check.`}
43
+ </p>
44
+ </Example>
45
+ };
46
+
47
+ const Component = () => (
48
+ <React.Fragment>
49
+ <AutoLinkHeader {...{"id":"demos","headingLevel":"h2","className":"ws-title ws-h2"}}>
50
+ {`Demos`}
51
+ </AutoLinkHeader>
52
+ {React.createElement(pageData.examples["Basic"])}
53
+ {React.createElement(pageData.examples["With only increasing progress"])}
54
+ </React.Fragment>
55
+ );
56
+ Component.displayName = 'ComponentsProgressReactDemosDocs';
57
+ Component.pageData = pageData;
58
+
59
+ export default Component;