@patternfly/quickstarts 2.4.2 → 5.0.0-prerelease.0

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 (207) hide show
  1. package/README.md +32 -23
  2. package/dist/ConsoleInternal/components/markdown-view.d.ts +19 -19
  3. package/dist/ConsoleInternal/components/utils/camel-case-wrap.d.ts +6 -6
  4. package/dist/ConsoleInternal/components/utils/index.d.ts +3 -3
  5. package/dist/ConsoleInternal/components/utils/router.d.ts +9 -9
  6. package/dist/ConsoleInternal/components/utils/status-box.d.ts +20 -20
  7. package/dist/ConsoleInternal/module/k8s/types.d.ts +42 -42
  8. package/dist/ConsoleShared/index.d.ts +1 -1
  9. package/dist/ConsoleShared/src/components/index.d.ts +7 -7
  10. package/dist/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.d.ts +13 -13
  11. package/dist/ConsoleShared/src/components/markdown-extensions/accordion-extension.d.ts +7 -7
  12. package/dist/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.d.ts +6 -6
  13. package/dist/ConsoleShared/src/components/markdown-extensions/admonition-extension.d.ts +7 -7
  14. package/dist/ConsoleShared/src/components/markdown-extensions/code-extension.d.ts +7 -7
  15. package/dist/ConsoleShared/src/components/markdown-extensions/const.d.ts +5 -5
  16. package/dist/ConsoleShared/src/components/markdown-extensions/index.d.ts +7 -7
  17. package/dist/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +7 -7
  18. package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +7 -7
  19. package/dist/ConsoleShared/src/components/markdown-extensions/utils.d.ts +1 -1
  20. package/dist/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.d.ts +7 -7
  21. package/dist/ConsoleShared/src/components/markdown-highlight-extension/highlight-consts.d.ts +4 -4
  22. package/dist/ConsoleShared/src/components/markdown-highlight-extension/index.d.ts +1 -1
  23. package/dist/ConsoleShared/src/components/modal/Modal.d.ts +9 -9
  24. package/dist/ConsoleShared/src/components/modal/index.d.ts +1 -1
  25. package/dist/ConsoleShared/src/components/popper/Portal.d.ts +8 -7
  26. package/dist/ConsoleShared/src/components/popper/SimplePopper.d.ts +6 -3
  27. package/dist/ConsoleShared/src/components/popper/index.d.ts +2 -2
  28. package/dist/ConsoleShared/src/components/spotlight/InteractiveSpotlight.d.ts +7 -7
  29. package/dist/ConsoleShared/src/components/spotlight/Spotlight.d.ts +7 -7
  30. package/dist/ConsoleShared/src/components/spotlight/StaticSpotlight.d.ts +7 -7
  31. package/dist/ConsoleShared/src/components/spotlight/index.d.ts +1 -1
  32. package/dist/ConsoleShared/src/components/status/GenericStatus.d.ts +12 -11
  33. package/dist/ConsoleShared/src/components/status/NotStartedIcon.d.ts +3 -2
  34. package/dist/ConsoleShared/src/components/status/PopoverStatus.d.ts +13 -12
  35. package/dist/ConsoleShared/src/components/status/Status.d.ts +11 -11
  36. package/dist/ConsoleShared/src/components/status/StatusIconAndText.d.ts +8 -8
  37. package/dist/ConsoleShared/src/components/status/icons.d.ts +9 -9
  38. package/dist/ConsoleShared/src/components/status/index.d.ts +1 -1
  39. package/dist/ConsoleShared/src/components/status/statuses.d.ts +5 -5
  40. package/dist/ConsoleShared/src/components/status/types.d.ts +9 -7
  41. package/dist/ConsoleShared/src/components/utils/FallbackImg.d.ts +9 -9
  42. package/dist/ConsoleShared/src/components/utils/index.d.ts +1 -1
  43. package/dist/ConsoleShared/src/constants/index.d.ts +1 -1
  44. package/dist/ConsoleShared/src/constants/ui.d.ts +1 -1
  45. package/dist/ConsoleShared/src/hooks/index.d.ts +6 -6
  46. package/dist/ConsoleShared/src/hooks/scroll.d.ts +8 -8
  47. package/dist/ConsoleShared/src/hooks/useBoundingClientRect.d.ts +3 -1
  48. package/dist/ConsoleShared/src/hooks/useEventListener.d.ts +1 -1
  49. package/dist/ConsoleShared/src/hooks/useForceRender.d.ts +4 -4
  50. package/dist/ConsoleShared/src/hooks/useResizeObserver.d.ts +1 -1
  51. package/dist/ConsoleShared/src/hooks/useScrollShadows.d.ts +7 -7
  52. package/dist/ConsoleShared/src/index.d.ts +4 -4
  53. package/dist/ConsoleShared/src/utils/index.d.ts +1 -1
  54. package/dist/ConsoleShared/src/utils/useCombineRefs.d.ts +2 -2
  55. package/dist/HelpTopicDrawer.d.ts +33 -32
  56. package/dist/HelpTopicPanelContent.d.ts +11 -11
  57. package/dist/QuickStartCatalogPage.d.ts +14 -14
  58. package/dist/QuickStartCloseModal.d.ts +8 -8
  59. package/dist/QuickStartController.d.ts +10 -10
  60. package/dist/QuickStartDrawer.d.ts +62 -62
  61. package/dist/QuickStartMarkdownView.d.ts +9 -9
  62. package/dist/QuickStartPanelContent.d.ts +15 -15
  63. package/dist/catalog/Catalog/QuickStartCatalogHeader.d.ts +6 -6
  64. package/dist/catalog/Catalog/QuickStartCatalogSection.d.ts +5 -5
  65. package/dist/catalog/Catalog/QuickStartCatalogToolbar.d.ts +5 -5
  66. package/dist/catalog/Catalog/index.d.ts +3 -3
  67. package/dist/catalog/QuickStartCatalog.d.ts +8 -8
  68. package/dist/catalog/QuickStartTile.d.ts +11 -11
  69. package/dist/catalog/QuickStartTileDescription.d.ts +8 -8
  70. package/dist/catalog/QuickStartTileFooter.d.ts +8 -8
  71. package/dist/catalog/QuickStartTileFooterExternal.d.ts +8 -8
  72. package/dist/catalog/QuickStartTileHeader.d.ts +12 -12
  73. package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +10 -10
  74. package/dist/catalog/Toolbar/QuickStartCatalogFilterItems.d.ts +31 -31
  75. package/dist/catalog/index.d.ts +9 -9
  76. package/dist/controller/QuickStartConclusion.d.ts +12 -12
  77. package/dist/controller/QuickStartContent.d.ts +14 -14
  78. package/dist/controller/QuickStartFooter.d.ts +14 -14
  79. package/dist/controller/QuickStartIntroduction.d.ts +12 -12
  80. package/dist/controller/QuickStartTaskHeader.d.ts +15 -15
  81. package/dist/controller/QuickStartTaskHeaderList.d.ts +10 -10
  82. package/dist/controller/QuickStartTaskReview.d.ts +10 -10
  83. package/dist/controller/QuickStartTasks.d.ts +12 -12
  84. package/dist/data/mocks/json/explore-pipeline-quickstart.d.ts +2 -2
  85. package/dist/data/mocks/json/explore-serverless-quickstart.d.ts +2 -2
  86. package/dist/data/mocks/json/monitor-sampleapp-quickstart.d.ts +2 -2
  87. package/dist/data/mocks/json/tour-icons.d.ts +2 -2
  88. package/dist/data/quick-start-test-data.d.ts +2 -2
  89. package/dist/data/test-utils.d.ts +8 -7
  90. package/dist/index.d.ts +16 -16
  91. package/dist/index.es.js +2346 -2391
  92. package/dist/index.es.js.map +1 -1
  93. package/dist/index.js +2346 -2390
  94. package/dist/index.js.map +1 -1
  95. package/dist/patternfly-docs/quick-starts/examples/Basic.jsx +1 -1
  96. package/dist/patternfly-docs/quick-starts/examples/HelpTopic.jsx +2 -4
  97. package/dist/patternfly-global.css +752 -1110
  98. package/dist/patternfly-nested.css +8784 -9605
  99. package/dist/quickstarts-base.css +188 -188
  100. package/dist/quickstarts-full.es.js +19627 -10887
  101. package/dist/quickstarts-full.es.js.map +1 -1
  102. package/dist/quickstarts-standalone.css +216 -219
  103. package/dist/quickstarts-standalone.min.css +4 -4
  104. package/dist/quickstarts-vendor.css +71 -71
  105. package/dist/quickstarts.css +259 -259
  106. package/dist/quickstarts.min.css +1 -1
  107. package/dist/styles/patternfly-global-entry.d.ts +1 -1
  108. package/dist/styles/patternfly-nested-entry.d.ts +1 -1
  109. package/dist/styles/quickstarts-standalone-entry.d.ts +1 -1
  110. package/dist/styles/vendor-entry.d.ts +1 -1
  111. package/dist/utils/PluralResolver.d.ts +16 -10
  112. package/dist/utils/asciidoc-procedure-parser.d.ts +12 -12
  113. package/dist/utils/const.d.ts +6 -6
  114. package/dist/utils/help-topic-context.d.ts +23 -23
  115. package/dist/utils/help-topic-types.d.ts +13 -13
  116. package/dist/utils/quick-start-context.d.ts +81 -81
  117. package/dist/utils/quick-start-types.d.ts +60 -58
  118. package/dist/utils/quick-start-utils.d.ts +10 -10
  119. package/dist/utils/useLocalStorage.d.ts +1 -1
  120. package/package.json +17 -13
  121. package/src/ConsoleInternal/components/_icon-and-text.scss +2 -2
  122. package/src/ConsoleInternal/components/catalog/_catalog.scss +20 -20
  123. package/src/ConsoleInternal/components/markdown-view.tsx +23 -52
  124. package/src/ConsoleInternal/components/utils/_status-box.scss +1 -1
  125. package/src/ConsoleInternal/components/utils/camel-case-wrap.tsx +3 -3
  126. package/src/ConsoleInternal/components/utils/router.ts +0 -2
  127. package/src/ConsoleInternal/components/utils/status-box.tsx +8 -46
  128. package/src/ConsoleInternal/module/k8s/types.ts +6 -6
  129. package/src/ConsoleShared/src/components/layout/PageLayout.scss +10 -10
  130. package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +13 -11
  131. package/src/ConsoleShared/src/components/markdown-extensions/accordion-extension.tsx +3 -4
  132. package/src/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.tsx +7 -7
  133. package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +4 -4
  134. package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +1 -3
  135. package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +5 -5
  136. package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +8 -8
  137. package/src/ConsoleShared/src/components/markdown-extensions/showdown-extension.scss +5 -5
  138. package/src/ConsoleShared/src/components/markdown-extensions/utils.ts +1 -3
  139. package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +7 -6
  140. package/src/ConsoleShared/src/components/popper/Portal.tsx +6 -4
  141. package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +7 -5
  142. package/src/ConsoleShared/src/components/spotlight/InteractiveSpotlight.tsx +2 -2
  143. package/src/ConsoleShared/src/components/spotlight/Spotlight.tsx +2 -2
  144. package/src/ConsoleShared/src/components/spotlight/StaticSpotlight.tsx +3 -3
  145. package/src/ConsoleShared/src/components/spotlight/spotlight.scss +4 -4
  146. package/src/ConsoleShared/src/components/status/GenericStatus.tsx +1 -0
  147. package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +20 -23
  148. package/src/ConsoleShared/src/components/status/Status.tsx +2 -2
  149. package/src/ConsoleShared/src/components/status/icons.tsx +17 -55
  150. package/src/ConsoleShared/src/components/status/statuses.tsx +1 -17
  151. package/src/ConsoleShared/src/components/status/types.ts +3 -2
  152. package/src/ConsoleShared/src/components/utils/FallbackImg.tsx +2 -2
  153. package/src/ConsoleShared/src/hooks/useResizeObserver.ts +5 -6
  154. package/src/ConsoleShared/src/utils/useCombineRefs.ts +2 -3
  155. package/src/HelpTopicDrawer.tsx +6 -14
  156. package/src/HelpTopicPanelContent.tsx +57 -49
  157. package/src/QuickStartCatalogPage.tsx +19 -14
  158. package/src/QuickStartCloseModal.tsx +2 -2
  159. package/src/QuickStartController.tsx +3 -5
  160. package/src/QuickStartDrawer.scss +1 -1
  161. package/src/QuickStartDrawer.tsx +2 -2
  162. package/src/QuickStartMarkdownView.tsx +4 -4
  163. package/src/QuickStartPanelContent.scss +8 -8
  164. package/src/QuickStartPanelContent.tsx +8 -9
  165. package/src/catalog/Catalog/QuickStartCatalogHeader.tsx +2 -2
  166. package/src/catalog/Catalog/QuickStartCatalogSection.tsx +2 -2
  167. package/src/catalog/Catalog/QuickStartCatalogToolbar.tsx +2 -2
  168. package/src/catalog/QuickStartCatalog.scss +1 -1
  169. package/src/catalog/QuickStartCatalog.tsx +2 -2
  170. package/src/catalog/QuickStartTile.tsx +20 -15
  171. package/src/catalog/QuickStartTileDescription.scss +4 -4
  172. package/src/catalog/QuickStartTileDescription.tsx +2 -2
  173. package/src/catalog/QuickStartTileFooter.tsx +2 -2
  174. package/src/catalog/QuickStartTileFooterExternal.tsx +2 -2
  175. package/src/catalog/QuickStartTileHeader.scss +5 -5
  176. package/src/catalog/QuickStartTileHeader.tsx +2 -2
  177. package/src/catalog/Toolbar/QuickStartCatalogFilter.scss +9 -9
  178. package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +1 -3
  179. package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +49 -30
  180. package/src/controller/QuickStartConclusion.tsx +3 -3
  181. package/src/controller/QuickStartContent.scss +2 -2
  182. package/src/controller/QuickStartContent.tsx +2 -2
  183. package/src/controller/QuickStartFooter.scss +3 -3
  184. package/src/controller/QuickStartFooter.tsx +6 -10
  185. package/src/controller/QuickStartIntroduction.scss +7 -7
  186. package/src/controller/QuickStartIntroduction.tsx +5 -7
  187. package/src/controller/QuickStartTaskHeader.scss +15 -15
  188. package/src/controller/QuickStartTaskHeader.tsx +14 -12
  189. package/src/controller/QuickStartTaskHeaderList.scss +1 -1
  190. package/src/controller/QuickStartTaskHeaderList.tsx +3 -5
  191. package/src/controller/QuickStartTaskReview.scss +7 -7
  192. package/src/controller/QuickStartTaskReview.tsx +2 -2
  193. package/src/controller/QuickStartTasks.scss +13 -13
  194. package/src/controller/QuickStartTasks.tsx +2 -2
  195. package/src/controller/__tests__/QuickStartTaskHeader.spec.tsx +4 -17
  196. package/src/styles/_base.scss +5 -5
  197. package/src/styles/_dark-custom-override.scss +28 -28
  198. package/src/styles/legacy-bootstrap/_variables.scss +7 -7
  199. package/src/styles/patternfly-global.scss +6 -6
  200. package/src/styles/patternfly-nested.scss +1 -1
  201. package/src/utils/PluralResolver.ts +29 -23
  202. package/src/utils/asciidoc-procedure-parser.ts +2 -4
  203. package/src/utils/help-topic-context.tsx +3 -5
  204. package/src/utils/help-topic-types.ts +4 -4
  205. package/src/utils/quick-start-context.tsx +8 -12
  206. package/src/utils/quick-start-types.ts +15 -14
  207. package/src/utils/quick-start-utils.ts +2 -6
@@ -2,10 +2,10 @@ import * as React from 'react';
2
2
  import { useEventListener } from '../../hooks';
3
3
  import { ACCORDION_MARKDOWN_BUTTON_ID, ACCORDION_MARKDOWN_CONTENT_ID } from './const';
4
4
 
5
- type AccordionShowdownComponentProps = {
5
+ interface AccordionShowdownComponentProps {
6
6
  buttonElement: HTMLElement;
7
7
  contentElement: HTMLElement;
8
- };
8
+ }
9
9
 
10
10
  const AccordionShowdownHandler: React.FC<AccordionShowdownComponentProps> = ({
11
11
  buttonElement,
@@ -16,9 +16,9 @@ const AccordionShowdownHandler: React.FC<AccordionShowdownComponentProps> = ({
16
16
  const handleClick = () => {
17
17
  const expandedModifier = 'pf-m-expanded';
18
18
 
19
- buttonElement.className = `pf-c-accordion__toggle ${!expanded ? expandedModifier : ''}`;
19
+ buttonElement.className = `pf-v5-c-accordion__toggle ${!expanded ? expandedModifier : ''}`;
20
20
  contentElement.hidden = expanded;
21
- contentElement.className = `pf-c-accordion__expanded-content ${
21
+ contentElement.className = `pf-v5-c-accordion__expanded-content ${
22
22
  !expanded ? expandedModifier : ''
23
23
  }`;
24
24
  setExpanded(!expanded);
@@ -29,9 +29,9 @@ const AccordionShowdownHandler: React.FC<AccordionShowdownComponentProps> = ({
29
29
  return <></>;
30
30
  };
31
31
 
32
- type accordionRenderExtensionProps = {
33
- docContext: HTMLDocument;
34
- };
32
+ interface accordionRenderExtensionProps {
33
+ docContext: Document;
34
+ }
35
35
 
36
36
  const AccordionRenderExtension: React.FC<accordionRenderExtensionProps> = ({ docContext }) => {
37
37
  const buttonElements = docContext.querySelectorAll(`[id ^= ${ACCORDION_MARKDOWN_BUTTON_ID}]`);
@@ -23,9 +23,9 @@ const admonitionToAlertVariantMap = {
23
23
  [AdmonitionType.WARNING]: { variant: 'warning' },
24
24
  };
25
25
 
26
- const useAdmonitionShowdownExtension = () => {
26
+ const useAdmonitionShowdownExtension = () =>
27
27
  // const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
28
- return React.useMemo(
28
+ React.useMemo(
29
29
  () => ({
30
30
  type: 'lang',
31
31
  regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
@@ -61,7 +61,7 @@ const useAdmonitionShowdownExtension = () => {
61
61
  },
62
62
  }),
63
63
  [],
64
- );
65
- };
64
+ )
65
+ ;
66
66
 
67
67
  export default useAdmonitionShowdownExtension;
@@ -4,8 +4,7 @@ import { renderToStaticMarkup } from 'react-dom/server';
4
4
  import { CodeBlock } from '@patternfly/react-core';
5
5
  import './showdown-extension.scss';
6
6
 
7
- const useCodeShowdownExtension = () => {
8
- return React.useMemo(
7
+ const useCodeShowdownExtension = () => React.useMemo(
9
8
  () => ({
10
9
  type: 'output',
11
10
  regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
@@ -20,6 +19,5 @@ const useCodeShowdownExtension = () => {
20
19
  }),
21
20
  [],
22
21
  );
23
- };
24
22
 
25
23
  export default useCodeShowdownExtension;
@@ -17,11 +17,11 @@ const useInlineCopyClipboardShowdownExtension = () => {
17
17
  return text;
18
18
  }
19
19
  return removeTemplateWhitespace(
20
- `<span class="pf-c-clipboard-copy pf-m-inline">
21
- <span class="pf-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${groupId}">${group}</span>
22
- <span class="pf-c-clipboard-copy__actions">
23
- <span class="pf-c-clipboard-copy__actions-item">
24
- <button class="pf-c-button pf-m-plain" aria-label="${getResource(
20
+ `<span class="pf-v5-c-clipboard-copy pf-m-inline">
21
+ <span class="pf-v5-c-clipboard-copy__text" ${MARKDOWN_SNIPPET_ID}="${groupId}">${group}</span>
22
+ <span class="pf-v5-c-clipboard-copy__actions">
23
+ <span class="pf-v5-c-clipboard-copy__actions-item">
24
+ <button class="pf-v5-c-button pf-m-plain" aria-label="${getResource(
25
25
  'Copy to clipboard',
26
26
  )}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
27
27
  ${renderToStaticMarkup(<CopyIcon />)}
@@ -16,11 +16,11 @@ const useMultilineCopyClipboardShowdownExtension = () => {
16
16
  if (!group || isNaN(groupId)) {
17
17
  return text;
18
18
  }
19
- return `<div class="pf-c-code-block">
20
- <div class="pf-c-code-block__header">
21
- <div class="pf-c-code-block__actions">
22
- <div class="pf-c-code-block__actions-item">
23
- <button class="pf-c-button pf-m-plain" type="button" aria-label="${getResource(
19
+ return `<div class="pf-v5-c-code-block">
20
+ <div class="pf-v5-c-code-block__header">
21
+ <div class="pf-v5-c-code-block__actions">
22
+ <div class="pf-v5-c-code-block__actions-item">
23
+ <button class="pf-v5-c-button pf-m-plain" type="button" aria-label="${getResource(
24
24
  'Copy to clipboard',
25
25
  )}" ${MARKDOWN_COPY_BUTTON_ID}="${groupId}">
26
26
  ${renderToStaticMarkup(<CopyIcon />)}
@@ -28,9 +28,9 @@ const useMultilineCopyClipboardShowdownExtension = () => {
28
28
  </div>
29
29
  </div>
30
30
  </div>
31
- <div class="pf-c-code-block__content">
32
- <pre class="pf-c-code-block__pre pfext-code-block__pre">
33
- <code class="pf-c-code-block__code"
31
+ <div class="pf-v5-c-code-block__content">
32
+ <pre class="pf-v5-c-code-block__pre pfext-code-block__pre">
33
+ <code class="pf-v5-c-code-block__code"
34
34
  ${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code>
35
35
  </pre>
36
36
  </div>
@@ -33,18 +33,18 @@
33
33
  }
34
34
 
35
35
  .pfext-markdown-admonition {
36
- &.pf-c-alert {
36
+ &.pf-v5-c-alert {
37
37
  // add margins to match design
38
- margin: var(--pf-global--spacer--md) 0;
39
- .pf-c-alert__title {
38
+ margin: var(--pf-v5-global--spacer--md) 0;
39
+ .pf-v5-c-alert__title {
40
40
  // remove margins from markdown css
41
41
  margin-top: 0;
42
42
  margin-bottom: 0;
43
43
  // lift PF style specificity to override markdown css
44
- font-weight: var(--pf-c-alert__title--FontWeight);
44
+ font-weight: var(--pf-v5-c-alert__title--FontWeight);
45
45
  font-family: inherit;
46
46
  line-height: inherit;
47
- color: var(--pf-c-alert__title--Color);
47
+ color: var(--pf-v5-c-alert__title--Color);
48
48
  word-break: break-word;
49
49
  }
50
50
  }
@@ -1,3 +1 @@
1
- export const removeTemplateWhitespace = (template: string): string => {
2
- return template.replace(/>(?:\s|\n)+</g, '><');
3
- };
1
+ export const removeTemplateWhitespace = (template: string): string => template.replace(/>(?:\s|\n)+</g, '><');
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { Spotlight } from '../spotlight';
3
3
 
4
- type MarkdownHighlightExtensionProps = {
5
- docContext: HTMLDocument;
4
+ interface MarkdownHighlightExtensionProps {
5
+ docContext: Document;
6
6
  rootSelector: string;
7
- };
7
+ }
8
8
  const MarkdownHighlightExtension: React.FC<MarkdownHighlightExtensionProps> = ({
9
9
  docContext,
10
10
  rootSelector,
@@ -36,9 +36,10 @@ const MarkdownHighlightExtension: React.FC<MarkdownHighlightExtensionProps> = ({
36
36
  e.preventDefault();
37
37
  const classes = e.target.getAttribute('class').split(' ');
38
38
  let highlightId;
39
- for (let i = 0; i < classes.length; i++) {
40
- if (classes[0].startsWith('data-highlight__')) {
41
- highlightId = classes[0].split('__')[1];
39
+
40
+ for (const className of classes) {
41
+ if (className.startsWith('data-highlight__')) {
42
+ highlightId = className.split('__')[1];
42
43
  break;
43
44
  }
44
45
  }
@@ -1,19 +1,21 @@
1
+ import { useIsomorphicLayoutEffect } from '@patternfly/react-core';
1
2
  import * as React from 'react';
2
3
  import * as ReactDOM from 'react-dom';
3
4
 
4
5
  type GetContainer = Element | null | undefined | (() => Element);
5
6
 
6
- type PortalProps = {
7
+ interface PortalProps {
8
+ children: React.ReactNode;
7
9
  container?: GetContainer;
8
- };
10
+ }
9
11
 
10
12
  const getContainer = (container: GetContainer): Element | null | undefined =>
11
13
  typeof container === 'function' ? container() : container;
12
14
 
13
- const Portal: React.FC<PortalProps> = ({ children, container }) => {
15
+ const Portal = ({ children, container }: PortalProps) => {
14
16
  const [containerNode, setContainerNode] = React.useState<Element>();
15
17
 
16
- React.useLayoutEffect(() => {
18
+ useIsomorphicLayoutEffect(() => {
17
19
  setContainerNode(getContainer(container) || document.body);
18
20
  }, [container]);
19
21
 
@@ -1,7 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import Portal from './Portal';
3
3
 
4
- const SimplePopper: React.FC = ({ children }) => {
4
+ interface SimplePopperProps {
5
+ children: React.ReactNode;
6
+ }
7
+
8
+ const SimplePopper = ({ children }: SimplePopperProps) => {
5
9
  const openProp = true;
6
10
  const nodeRef = React.useRef<Element>();
7
11
  const popperRef = React.useRef(null);
@@ -62,11 +66,9 @@ const SimplePopper: React.FC = ({ children }) => {
62
66
  initialize();
63
67
  }, [initialize]);
64
68
 
65
- React.useEffect(() => {
66
- return () => {
69
+ React.useEffect(() => () => {
67
70
  destroy();
68
- };
69
- }, [destroy]);
71
+ }, [destroy]);
70
72
 
71
73
  React.useEffect(() => {
72
74
  if (!isOpen) {
@@ -2,9 +2,9 @@ import './spotlight.scss';
2
2
  import * as React from 'react';
3
3
  import { Portal, SimplePopper } from '../popper';
4
4
 
5
- type InteractiveSpotlightProps = {
5
+ interface InteractiveSpotlightProps {
6
6
  element: Element;
7
- };
7
+ }
8
8
 
9
9
  const isInViewport = (elementToCheck: Element) => {
10
10
  const rect = elementToCheck.getBoundingClientRect();
@@ -2,10 +2,10 @@ import * as React from 'react';
2
2
  import InteractiveSpotlight from './InteractiveSpotlight';
3
3
  import StaticSpotlight from './StaticSpotlight';
4
4
 
5
- type SpotlightProps = {
5
+ interface SpotlightProps {
6
6
  selector: string;
7
7
  interactive?: boolean;
8
- };
8
+ }
9
9
 
10
10
  const Spotlight: React.FC<SpotlightProps> = ({ selector, interactive }) => {
11
11
  // if target element is a hidden one return null
@@ -3,9 +3,9 @@ import * as React from 'react';
3
3
  import { useBoundingClientRect } from '../../hooks';
4
4
  import Portal from '../popper/Portal';
5
5
 
6
- type StaticSpotlightProps = {
6
+ interface StaticSpotlightProps {
7
7
  element: Element;
8
- };
8
+ }
9
9
 
10
10
  const StaticSpotlight: React.FC<StaticSpotlightProps> = ({ element }) => {
11
11
  const clientRect = useBoundingClientRect(element as HTMLElement);
@@ -19,7 +19,7 @@ const StaticSpotlight: React.FC<StaticSpotlightProps> = ({ element }) => {
19
19
  : {};
20
20
  return clientRect ? (
21
21
  <Portal>
22
- <div className="pf-c-backdrop pfext-spotlight__with-backdrop">
22
+ <div className="pf-v5-c-backdrop pfext-spotlight__with-backdrop">
23
23
  <div
24
24
  className="pfext-spotlight pfext-spotlight__element-highlight-noanimate"
25
25
  style={style}
@@ -36,14 +36,14 @@
36
36
  mix-blend-mode: hard-light;
37
37
  }
38
38
  &__element-highlight-noanimate {
39
- border: var(--pf-global--BorderWidth--xl) solid var(--pf-global--palette--blue-200);
40
- background-color: var(--pf-global--palette--black-500);
39
+ border: var(--pf-v5-global--BorderWidth--xl) solid var(--pf-v5-global--palette--blue-200);
40
+ background-color: var(--pf-v5-global--palette--black-500);
41
41
  z-index: 9999;
42
42
  }
43
43
  &__element-highlight-animate {
44
44
  pointer-events: none;
45
45
  position: absolute;
46
- box-shadow: inset 0px 0px 0px 4px var(--pf-global--palette--blue-200);
46
+ box-shadow: inset 0px 0px 0px 4px var(--pf-v5-global--palette--blue-200);
47
47
  opacity: 0;
48
48
  animation: 0.4s pfext-spotlight-fade-in 0s ease-in-out, 5s pfext-spotlight-fade-out 12.8s ease-in-out;
49
49
  animation-fill-mode: forwards;
@@ -56,7 +56,7 @@
56
56
  bottom: 0;
57
57
  animation: 1.2s pfext-spotlight-expand 1.6s ease-out;
58
58
  animation-fill-mode: forwards;
59
- outline: 4px solid var(--pf-global--palette--blue-200);
59
+ outline: 4px solid var(--pf-v5-global--palette--blue-200);
60
60
  outline-offset: -4px;
61
61
  }
62
62
  }
@@ -26,6 +26,7 @@ const GenericStatus: React.FC<GenericStatusProps> = (props) => {
26
26
 
27
27
  type GenericStatusProps = StatusComponentProps & {
28
28
  Icon: React.ComponentType<{ title?: string }>;
29
+ children?: React.ReactNode;
29
30
  popoverTitle?: string;
30
31
  noTooltip?: boolean;
31
32
  };
@@ -5,38 +5,35 @@ const PopoverStatus: React.FC<PopoverStatusProps> = ({
5
5
  hideHeader,
6
6
  children,
7
7
  isVisible = null,
8
- shouldClose = null,
9
8
  statusBody,
10
9
  title,
11
10
  onHide,
12
11
  onShow,
13
- }) => {
14
- return (
15
- <Popover
16
- position={PopoverPosition.right}
17
- headerContent={hideHeader ? null : title}
18
- bodyContent={children}
19
- aria-label={title}
20
- onHide={onHide}
21
- onShow={onShow}
22
- isVisible={isVisible}
23
- shouldClose={shouldClose}
24
- >
25
- <Button variant="link" isInline>
26
- {statusBody}
27
- </Button>
28
- </Popover>
29
- );
30
- };
12
+ }) => (
13
+ <Popover
14
+ position={PopoverPosition.right}
15
+ headerContent={hideHeader ? null : title}
16
+ bodyContent={children}
17
+ aria-label={title}
18
+ onHide={onHide}
19
+ onShow={onShow}
20
+ isVisible={isVisible}
21
+ >
22
+ <Button variant="link" isInline>
23
+ {statusBody}
24
+ </Button>
25
+ </Popover>
26
+ );
31
27
 
32
- type PopoverStatusProps = {
28
+ interface PopoverStatusProps {
29
+ children: React.ReactNode;
33
30
  statusBody: React.ReactNode;
34
- onHide?: () => void;
35
- onShow?: () => void;
31
+ onHide?: (event: MouseEvent | KeyboardEvent) => void;
32
+ onShow?: (event: MouseEvent | KeyboardEvent) => void;
36
33
  title?: string;
37
34
  hideHeader?: boolean;
38
35
  isVisible?: boolean;
39
36
  shouldClose?: (hideFunction: any) => void;
40
- };
37
+ }
41
38
 
42
39
  export default PopoverStatus;
@@ -29,9 +29,9 @@ export const StatusIcon: React.FC<StatusIconProps> = ({ status }) => (
29
29
  <Status status={status} iconOnly />
30
30
  );
31
31
 
32
- type StatusIconProps = {
32
+ interface StatusIconProps {
33
33
  status: string;
34
- };
34
+ }
35
35
 
36
36
  type StatusProps = StatusComponentProps & {
37
37
  status: string;
@@ -1,23 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
3
3
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
4
- // import ExclamationTriangleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon';
5
4
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
6
- import { global_danger_color_100 as dangerColor } from '@patternfly/react-tokens/dist/js/global_danger_color_100';
7
- // import { global_default_color_200 as blueDefaultColor } from '@patternfly/react-tokens/dist/js/global_default_color_200';
8
- // import { global_disabled_color_100 as disabledColor } from '@patternfly/react-tokens/dist/js/global_disabled_color_100';
9
- import { global_palette_blue_300 as blueInfoColor } from '@patternfly/react-tokens/dist/js/global_palette_blue_300';
10
- import { global_palette_green_500 as okColor } from '@patternfly/react-tokens/dist/js/global_palette_green_500';
11
- // import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
5
+ import dangerColor from '@patternfly/react-tokens/dist/esm/global_danger_color_100';
6
+ import blueInfoColor from '@patternfly/react-tokens/dist/esm/global_palette_blue_300';
7
+ import okColor from '@patternfly/react-tokens/dist/esm/global_palette_green_500';
8
+ import { Icon } from '@patternfly/react-core';
12
9
 
13
10
  export const GreenCheckCircleIcon: React.FC<ColoredIconProps> = ({ className, title, size }) => (
14
- <CheckCircleIcon
15
- data-test="success-icon"
16
- size={size}
17
- color={okColor.value}
18
- className={className}
19
- title={title}
20
- />
11
+ <Icon size={size}>
12
+ <CheckCircleIcon
13
+ data-test="success-icon"
14
+ color={okColor.value}
15
+ className={className}
16
+ title={title}
17
+ />
18
+ </Icon>
21
19
  );
22
20
 
23
21
  export const RedExclamationCircleIcon: React.FC<ColoredIconProps> = ({
@@ -25,53 +23,17 @@ export const RedExclamationCircleIcon: React.FC<ColoredIconProps> = ({
25
23
  title,
26
24
  size,
27
25
  }) => (
28
- <ExclamationCircleIcon
29
- size={size}
30
- color={dangerColor.value}
31
- className={className}
32
- title={title}
33
- />
26
+ <Icon size={size}>
27
+ <ExclamationCircleIcon color={dangerColor.value} className={className} title={title} />
28
+ </Icon>
34
29
  );
35
30
 
36
- // export const YellowExclamationTriangleIcon: React.FC<ColoredIconProps> = ({
37
- // className,
38
- // title,
39
- // size,
40
- // }) => (
41
- // <ExclamationTriangleIcon
42
- // size={size}
43
- // color={warningColor.value}
44
- // className={className}
45
- // title={title}
46
- // />
47
- // );
48
-
49
31
  export const BlueInfoCircleIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
50
32
  <InfoCircleIcon color={blueInfoColor.value} className={className} title={title} />
51
33
  );
52
34
 
53
- // export const GrayUnknownIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
54
- // <UnknownIcon color={disabledColor.value} className={className} title={title} />
55
- // );
56
-
57
- // export const BlueSyncIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
58
- // <SyncAltIcon color={blueInfoColor.value} className={className} title={title} />
59
- // );
60
-
61
- // export const RedResourcesFullIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
62
- // <ResourcesFullIcon color={dangerColor.value} className={className} title={title} />
63
- // );
64
-
65
- // export const YellowResourcesAlmostFullIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
66
- // <ResourcesAlmostFullIcon color={warningColor.value} className={className} title={title} />
67
- // );
68
-
69
- // export const BlueArrowCircleUpIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
70
- // <ArrowCircleUpIcon color={blueDefaultColor.value} className={className} title={title} />
71
- // );
72
-
73
- export type ColoredIconProps = {
35
+ export interface ColoredIconProps {
74
36
  className?: string;
75
37
  title?: string;
76
38
  size?: 'sm' | 'md' | 'lg' | 'xl';
77
- };
39
+ }
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
- // import HourglassHalfIcon from '@patternfly/react-icons/dist/js/icons/hourglass-half-icon';
3
- // import InProgressIcon from '@patternfly/react-icons/dist/js/icons/in-progress-icon';
2
+
4
3
  import GenericStatus from './GenericStatus';
5
4
  import { BlueInfoCircleIcon, GreenCheckCircleIcon, RedExclamationCircleIcon } from './icons';
6
5
  import { StatusComponentProps } from './types';
@@ -15,22 +14,7 @@ export const InfoStatus: React.FC<StatusComponentProps> = (props) => (
15
14
  );
16
15
  InfoStatus.displayName = 'InfoStatus';
17
16
 
18
- // export const PendingStatus: React.FC<StatusComponentProps> = (props) => (
19
- // <GenericStatus {...props} Icon={HourglassHalfIcon} title={props.title || 'Pending'} />
20
- // );
21
- // PendingStatus.displayName = 'PendingStatus';
22
-
23
- // export const ProgressStatus: React.FC<StatusComponentProps> = (props) => (
24
- // <GenericStatus {...props} Icon={InProgressIcon} title={props.title || 'In progress'} />
25
- // );
26
- // ProgressStatus.displayName = 'ProgressStatus';
27
-
28
17
  export const SuccessStatus: React.FC<StatusComponentProps> = (props) => (
29
18
  <GenericStatus {...props} Icon={GreenCheckCircleIcon} title={props.title || 'Healthy'} />
30
19
  );
31
20
  SuccessStatus.displayName = 'SuccessStatus';
32
-
33
- // export const WarningStatus: React.FC<StatusComponentProps> = (props) => (
34
- // <GenericStatus {...props} Icon={YellowExclamationTriangleIcon} title={props.title || 'Warning'} />
35
- // );
36
- // WarningStatus.displayName = 'WarningStatus';
@@ -1,7 +1,8 @@
1
- export type StatusComponentProps = {
1
+ export interface StatusComponentProps {
2
+ children?: React.ReactNode;
2
3
  title?: string;
3
4
  iconOnly?: boolean;
4
5
  noTooltip?: boolean;
5
6
  className?: string;
6
7
  popoverTitle?: string;
7
- };
8
+ }
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
 
3
- type FallbackImgProps = {
3
+ interface FallbackImgProps {
4
4
  src: string;
5
5
  alt?: string;
6
6
  className?: string;
7
7
  fallback?: React.ReactNode;
8
- };
8
+ }
9
9
 
10
10
  const FallbackImg: React.FC<FallbackImgProps> = ({ src, alt, className, fallback }) => {
11
11
  const [isSrcValid, setIsSrcValid] = React.useState<boolean>(true);
@@ -1,15 +1,14 @@
1
- // @ts-nocheck
2
- // TODO: Remove the no-check
3
1
  import * as React from 'react';
4
2
 
5
3
  export const useResizeObserver = (
6
4
  callback: ResizeObserverCallback,
7
5
  targetElement?: HTMLElement | null,
8
- observerOptions: ResizeObserverObserveOptions = undefined,
6
+ observerOptions: ResizeObserverOptions = undefined,
9
7
  ): void => {
10
- const element = React.useMemo(() => targetElement ?? document.querySelector('body'), [
11
- targetElement,
12
- ]);
8
+ const element = React.useMemo(
9
+ () => targetElement ?? document.querySelector('body'),
10
+ [targetElement],
11
+ );
13
12
  React.useEffect(() => {
14
13
  const observer = new ResizeObserver(callback);
15
14
  observer.observe(element, observerOptions);
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
 
3
- export const useCombineRefs = <RefType extends any>(...refs: (React.Ref<RefType> | undefined)[]) =>
3
+ export const useCombineRefs = <RefType>(...refs: (React.Ref<RefType> | undefined)[]) =>
4
4
  React.useCallback(
5
5
  (element: RefType | null): void =>
6
6
  refs.forEach((ref) => {
@@ -12,6 +12,5 @@ export const useCombineRefs = <RefType extends any>(...refs: (React.Ref<RefType>
12
12
  }
13
13
  }
14
14
  }),
15
- // eslint-disable-next-line react-hooks/exhaustive-deps
16
- refs,
15
+ [refs],
17
16
  );
@@ -27,10 +27,11 @@ export interface HelpTopicContainerProps extends React.HTMLProps<HTMLDivElement>
27
27
  */
28
28
  markdown?: {
29
29
  extensions?: any[];
30
- renderExtension?: (docContext: HTMLDocument, rootSelector: string) => React.ReactNode;
30
+ renderExtension?: (docContext: Document, rootSelector: string) => React.ReactNode;
31
31
  };
32
32
  /** additional quick start context props */
33
33
  contextProps?: QuickStartContextValues;
34
+ children?: React.ReactNode;
34
35
  }
35
36
 
36
37
  export const HelpTopicContainer: React.FC<HelpTopicContainerProps> = ({
@@ -48,9 +49,6 @@ export const HelpTopicContainer: React.FC<HelpTopicContainerProps> = ({
48
49
  language,
49
50
  resourceBundle: {
50
51
  ...resourceBundle,
51
- // Start: "Let's go!",
52
- // Continue: 'Resume',
53
- // Restart: 'Start over',
54
52
  },
55
53
  loading,
56
54
  markdown,
@@ -72,14 +70,9 @@ export const HelpTopicContainer: React.FC<HelpTopicContainerProps> = ({
72
70
  }
73
71
  }, [helpTopics, valuesForHelpTopicContext]);
74
72
 
75
- const drawerProps = {
76
- //TODO add extras here?
77
- ...props,
78
- };
79
-
80
73
  return (
81
74
  <HelpTopicContext.Provider value={valuesForHelpTopicContext}>
82
- <HelpTopicDrawer {...drawerProps}>{children}</HelpTopicDrawer>
75
+ <HelpTopicDrawer {...props}>{children}</HelpTopicDrawer>
83
76
  </HelpTopicContext.Provider>
84
77
  );
85
78
  };
@@ -90,9 +83,8 @@ export interface HelpTopicDrawerProps extends React.HTMLProps<HTMLDivElement> {
90
83
  }
91
84
 
92
85
  export const HelpTopicDrawer: React.FC<HelpTopicDrawerProps> = ({ children, ...props }) => {
93
- const { activeHelpTopic, filteredHelpTopics, setActiveHelpTopicByName } = React.useContext<
94
- HelpTopicContextValues
95
- >(HelpTopicContext);
86
+ const { activeHelpTopic, filteredHelpTopics, setActiveHelpTopicByName } =
87
+ React.useContext<HelpTopicContextValues>(HelpTopicContext);
96
88
 
97
89
  const onClose = () => {
98
90
  setActiveHelpTopicByName('');
@@ -116,7 +108,7 @@ export const HelpTopicDrawer: React.FC<HelpTopicDrawerProps> = ({ children, ...p
116
108
  </DrawerContentBody>
117
109
  </DrawerContent>
118
110
  ) : (
119
- <div className="pf-c-drawer__main">{panelContent}</div>
111
+ <div className="pf-v5-c-drawer__main">{panelContent}</div>
120
112
  )}
121
113
  </Drawer>
122
114
  </>