@patternfly/documentation-framework 2.0.0-alpha.4 → 2.0.0-alpha.41

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 (52) hide show
  1. package/CHANGELOG.md +350 -0
  2. package/app.js +12 -11
  3. package/components/autoLinkHeader/autoLinkHeader.css +2 -2
  4. package/components/cssVariables/cssSearch.js +3 -4
  5. package/components/cssVariables/cssVariables.css +4 -4
  6. package/components/cssVariables/cssVariables.js +72 -70
  7. package/components/example/example.css +29 -29
  8. package/components/example/example.js +4 -4
  9. package/components/footer/footer.css +15 -15
  10. package/components/footer/footer.js +13 -13
  11. package/components/functionsTable/functionsTable.js +57 -0
  12. package/components/gdprBanner/gdprBanner.css +2 -2
  13. package/components/gdprBanner/gdprBanner.js +3 -3
  14. package/components/inlineAlert/inlineAlert.js +1 -1
  15. package/components/propsTable/propsTable.js +85 -79
  16. package/components/sectionGallery/sectionDataListLayout.js +67 -0
  17. package/components/sectionGallery/sectionGallery.css +44 -0
  18. package/components/sectionGallery/sectionGallery.js +53 -0
  19. package/components/sectionGallery/sectionGalleryLayout.js +37 -0
  20. package/components/sectionGallery/sectionGalleryToolbar.js +30 -0
  21. package/components/sectionGallery/sectionGalleryWrapper.js +89 -0
  22. package/components/sideNav/sideNav.css +12 -12
  23. package/components/sideNav/sideNav.js +12 -5
  24. package/components/tableOfContents/tableOfContents.css +17 -17
  25. package/components/topNav/topNav.css +12 -12
  26. package/helpers/getTitle.js +2 -2
  27. package/layouts/sideNavLayout/sideNavLayout.css +7 -11
  28. package/layouts/sideNavLayout/sideNavLayout.js +57 -40
  29. package/package.json +28 -25
  30. package/pages/404/404.css +2 -2
  31. package/pages/404/index.js +4 -4
  32. package/pages/global-css-variables.md +16 -16
  33. package/pages/red-hat-font.md +1 -1
  34. package/routes.js +19 -5
  35. package/scripts/cli/build.js +6 -0
  36. package/scripts/cli/cli.js +2 -0
  37. package/scripts/cli/generate.js +2 -2
  38. package/scripts/cli/start.js +6 -8
  39. package/scripts/md/parseMD.js +40 -8
  40. package/scripts/md/styled-tags.js +2 -2
  41. package/scripts/tsDocgen.js +119 -91
  42. package/scripts/typeDocGen.js +209 -0
  43. package/scripts/webpack/webpack.base.config.js +34 -32
  44. package/scripts/webpack/webpack.client.config.js +11 -8
  45. package/scripts/webpack/webpack.server.config.js +8 -5
  46. package/scripts/writeScreenshots.js +3 -3
  47. package/templates/html.ejs +1 -3
  48. package/templates/mdx.css +155 -160
  49. package/templates/mdx.js +60 -43
  50. package/templates/patternfly-docs/content/extensions/extension/design-guidelines/design-guidelines.md +2 -0
  51. package/templates/patternfly-docs/content/extensions/extension/examples/basic.md +2 -0
  52. package/versions.json +29 -9
package/templates/mdx.css CHANGED
@@ -5,49 +5,49 @@
5
5
  }
6
6
 
7
7
  .ws-release-notes-toc {
8
- margin-bottom: var(--pf-global--spacer--lg);
8
+ margin-bottom: var(--pf-v5-global--spacer--lg);
9
9
  }
10
10
 
11
- .ws-release-notes-toc .pf-c-card {
11
+ .ws-release-notes-toc .pf-v5-c-card {
12
12
  height: 100%;
13
13
  }
14
14
 
15
- .ws-release-notes-toc .pf-c-card__title {
16
- padding-bottom: var(--pf-global--spacer--xs);
15
+ .ws-release-notes-toc .pf-v5-c-card__title {
16
+ padding-bottom: var(--pf-v5-global--spacer--xs);
17
17
  }
18
18
 
19
- .ws-release-notes-toc .pf-c-card__title .pf-c-title {
19
+ .ws-release-notes-toc .pf-v5-c-card__title .pf-v5-c-title {
20
20
  display: inline;
21
21
  }
22
22
 
23
- .ws-release-notes-toc .pf-c-card__title a {
24
- margin-right: var(--pf-global--spacer--sm);
23
+ .ws-release-notes-toc .pf-v5-c-card__title a {
24
+ margin-right: var(--pf-v5-global--spacer--sm);
25
25
  }
26
26
 
27
- .ws-release-notes-toc .pf-c-card__title .pf-c-badge {
27
+ .ws-release-notes-toc .pf-v5-c-card__title .pf-v5-c-badge {
28
28
  vertical-align: text-top;
29
29
  }
30
30
 
31
- .ws-release-notes-toc .pf-c-card__body {
31
+ .ws-release-notes-toc .pf-v5-c-card__body {
32
32
  color: #72767B;
33
33
  font-family: RedHatText;
34
- font-size: var(--pf-global--FontSize--md);
34
+ font-size: var(--pf-v5-global--FontSize--md);
35
35
  font-weight: 400;
36
36
  line-height: 1.5;
37
37
  }
38
38
 
39
39
  .ws-code {
40
40
  display: inline-block;
41
- background-color: var(--pf-global--BackgroundColor--100);
42
- padding: 1px var(--pf-global--spacer--sm);
43
- border: var(--pf-global--BorderWidth--sm) solid var(--pf-global--BorderColor--300);
41
+ background-color: var(--pf-v5-global--BackgroundColor--100);
42
+ padding: 1px var(--pf-v5-global--spacer--sm);
43
+ border: var(--pf-v5-global--BorderWidth--sm) solid var(--pf-v5-global--BorderColor--300);
44
44
  white-space: pre-wrap;
45
- font-size: var(--pf-global--FontSize--sm);
46
- font-family: var(--pf-global--FontFamily--monospace);
45
+ font-size: var(--pf-v5-global--FontSize--sm);
46
+ font-family: var(--pf-v5-global--FontFamily--monospace);
47
47
  }
48
48
 
49
49
  .ws-p + .ws-code {
50
- margin-bottom: var(--pf-c-content--MarginBottom);
50
+ margin-bottom: var(--pf-v5-c-content--MarginBottom);
51
51
  }
52
52
 
53
53
  /* Table styles */
@@ -78,86 +78,86 @@
78
78
  }
79
79
 
80
80
  /*
81
- * Copied from pf-c-content.
81
+ * Copied from pf-v5-c-content.
82
82
  */
83
83
  :root {
84
- --pf-c-content--MarginBottom: var(--pf-global--spacer--md);
85
- --pf-c-content--LineHeight: var(--pf-global--LineHeight--md);
86
- --pf-c-content--FontSize: var(--pf-global--FontSize--md);
87
- --pf-c-content--FontWeight: var(--pf-global--FontWeight--normal);
88
- --pf-c-content--Color: var(--pf-global--Color--100);
89
- --pf-c-content--heading--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);
90
- --pf-c-content--h1--MarginTop: var(--pf-global--spacer--lg);
91
- --pf-c-content--h1--MarginBottom: var(--pf-global--spacer--sm);
92
- --pf-c-content--h1--LineHeight: var(--pf-global--LineHeight--sm);
93
- --pf-c-content--h1--FontSize: var(--pf-global--FontSize--2xl);
94
- --pf-c-content--h1--FontWeight: var(--pf-global--FontWeight--normal);
95
- --pf-c-content--h2--MarginTop: var(--pf-global--spacer--lg);
96
- --pf-c-content--h2--MarginBottom: var(--pf-global--spacer--sm);
97
- --pf-c-content--h2--LineHeight: var(--pf-global--LineHeight--sm);
98
- --pf-c-content--h2--FontSize: var(--pf-global--FontSize--xl);
99
- --pf-c-content--h2--FontWeight: var(--pf-global--FontWeight--normal);
100
- --pf-c-content--h3--MarginTop: var(--pf-global--spacer--lg);
101
- --pf-c-content--h3--MarginBottom: var(--pf-global--spacer--sm);
102
- --pf-c-content--h3--LineHeight: var(--pf-global--LineHeight--md);
103
- --pf-c-content--h3--FontSize: var(--pf-global--FontSize--lg);
104
- --pf-c-content--h3--FontWeight: var(--pf-global--FontWeight--normal);
105
- --pf-c-content--h4--MarginTop: var(--pf-global--spacer--lg);
106
- --pf-c-content--h4--MarginBottom: var(--pf-global--spacer--sm);
107
- --pf-c-content--h4--LineHeight: var(--pf-global--LineHeight--md);
108
- --pf-c-content--h4--FontSize: var(--pf-global--FontSize--md);
109
- --pf-c-content--h4--FontWeight: var(--pf-global--FontWeight--semi-bold);
110
- --pf-c-content--h5--MarginTop: var(--pf-global--spacer--lg);
111
- --pf-c-content--h5--MarginBottom: var(--pf-global--spacer--sm);
112
- --pf-c-content--h5--LineHeight: var(--pf-global--LineHeight--md);
113
- --pf-c-content--h5--FontSize: var(--pf-global--FontSize--md);
114
- --pf-c-content--h5--FontWeight: var(--pf-global--FontWeight--semi-bold);
115
- --pf-c-content--h6--MarginTop: var(--pf-global--spacer--lg);
116
- --pf-c-content--h6--MarginBottom: var(--pf-global--spacer--sm);
117
- --pf-c-content--h6--LineHeight: var(--pf-global--LineHeight--md);
118
- --pf-c-content--h6--FontSize: var(--pf-global--FontSize--md);
119
- --pf-c-content--h6--FontWeight: var(--pf-global--FontWeight--semi-bold);
120
- --pf-c-content--small--MarginBottom: var(--pf-global--spacer--md);
121
- --pf-c-content--small--LineHeight: var(--pf-global--LineHeight--md);
122
- --pf-c-content--small--FontSize: var(--pf-global--FontSize--sm);
123
- --pf-c-content--small--Color: var(--pf-global--Color--200);
124
- --pf-c-content--small--FontWeight: var(--pf-global--FontWeight--semi-bold);
125
- --pf-c-content--a--Color: var(--pf-global--link--Color);
126
- --pf-c-content--a--TextDecoration: var(--pf-global--link--TextDecoration);
127
- --pf-c-content--a--hover--Color: var(--pf-global--link--Color--hover);
128
- --pf-c-content--a--hover--TextDecoration: var(--pf-global--link--TextDecoration--hover);
129
- --pf-c-content--blockquote--PaddingTop: var(--pf-global--spacer--md);
130
- --pf-c-content--blockquote--PaddingRight: var(--pf-global--spacer--md);
131
- --pf-c-content--blockquote--PaddingBottom: var(--pf-global--spacer--md);
132
- --pf-c-content--blockquote--PaddingLeft: var(--pf-global--spacer--md);
133
- --pf-c-content--blockquote--FontWeight: var(--pf-global--FontWeight--light);
134
- --pf-c-content--blockquote--Color: var(--pf-global--Color--200);
135
- --pf-c-content--blockquote--BorderLeftColor: var(--pf-global--BorderColor--100);
136
- --pf-c-content--blockquote--BorderLeftWidth: var(--pf-global--BorderWidth--lg);
137
- --pf-c-content--ol--PaddingLeft: var(--pf-global--spacer--lg);
138
- --pf-c-content--ol--MarginTop: var(--pf-global--spacer--md);
139
- --pf-c-content--ol--MarginLeft: var(--pf-global--spacer--lg);
140
- --pf-c-content--ol--nested--MarginTop: var(--pf-global--spacer--sm);
141
- --pf-c-content--ol--nested--MarginLeft: var(--pf-global--spacer--sm);
142
- --pf-c-content--ul--PaddingLeft: var(--pf-global--spacer--lg);
143
- --pf-c-content--ul--MarginTop: var(--pf-global--spacer--md);
144
- --pf-c-content--ul--MarginLeft: var(--pf-global--spacer--lg);
145
- --pf-c-content--ul--nested--MarginTop: var(--pf-global--spacer--sm);
146
- --pf-c-content--ul--nested--MarginLeft: var(--pf-global--spacer--sm);
147
- --pf-c-content--ul--ListStyle: var(--pf-global--ListStyle);
148
- --pf-c-content--li--MarginTop: var(--pf-global--spacer--sm);
149
- --pf-c-content--dl--ColumnGap: var(--pf-global--spacer--2xl);
150
- --pf-c-content--dl--RowGap: var(--pf-global--spacer--md);
151
- --pf-c-content--dt--FontWeight: var(--pf-global--FontWeight--semi-bold);
152
- --pf-c-content--dt--MarginTop: var(--pf-global--spacer--md);
153
- --pf-c-content--dt--sm--MarginTop: 0;
154
- --pf-c-content--hr--Height: var(--pf-global--BorderWidth--sm);
155
- --pf-c-content--hr--BackgroundColor: var(--pf-global--BorderColor--100);
156
- font-size: var(--pf-c-content--FontSize);
157
- line-height: var(--pf-c-content--LineHeight);
158
- color: var(--pf-c-content--Color); }
84
+ --pf-v5-c-content--MarginBottom: var(--pf-v5-global--spacer--md);
85
+ --pf-v5-c-content--LineHeight: var(--pf-v5-global--LineHeight--md);
86
+ --pf-v5-c-content--FontSize: var(--pf-v5-global--FontSize--md);
87
+ --pf-v5-c-content--FontWeight: var(--pf-v5-global--FontWeight--normal);
88
+ --pf-v5-c-content--Color: var(--pf-v5-global--Color--100);
89
+ --pf-v5-c-content--heading--FontFamily: var(--pf-v5-global--FontFamily--heading--sans-serif);
90
+ --pf-v5-c-content--h1--MarginTop: var(--pf-v5-global--spacer--lg);
91
+ --pf-v5-c-content--h1--MarginBottom: var(--pf-v5-global--spacer--sm);
92
+ --pf-v5-c-content--h1--LineHeight: var(--pf-v5-global--LineHeight--sm);
93
+ --pf-v5-c-content--h1--FontSize: var(--pf-v5-global--FontSize--2xl);
94
+ --pf-v5-c-content--h1--FontWeight: var(--pf-v5-global--FontWeight--normal);
95
+ --pf-v5-c-content--h2--MarginTop: var(--pf-v5-global--spacer--lg);
96
+ --pf-v5-c-content--h2--MarginBottom: var(--pf-v5-global--spacer--sm);
97
+ --pf-v5-c-content--h2--LineHeight: var(--pf-v5-global--LineHeight--sm);
98
+ --pf-v5-c-content--h2--FontSize: var(--pf-v5-global--FontSize--xl);
99
+ --pf-v5-c-content--h2--FontWeight: var(--pf-v5-global--FontWeight--normal);
100
+ --pf-v5-c-content--h3--MarginTop: var(--pf-v5-global--spacer--lg);
101
+ --pf-v5-c-content--h3--MarginBottom: var(--pf-v5-global--spacer--sm);
102
+ --pf-v5-c-content--h3--LineHeight: var(--pf-v5-global--LineHeight--md);
103
+ --pf-v5-c-content--h3--FontSize: var(--pf-v5-global--FontSize--lg);
104
+ --pf-v5-c-content--h3--FontWeight: var(--pf-v5-global--FontWeight--normal);
105
+ --pf-v5-c-content--h4--MarginTop: var(--pf-v5-global--spacer--lg);
106
+ --pf-v5-c-content--h4--MarginBottom: var(--pf-v5-global--spacer--sm);
107
+ --pf-v5-c-content--h4--LineHeight: var(--pf-v5-global--LineHeight--md);
108
+ --pf-v5-c-content--h4--FontSize: var(--pf-v5-global--FontSize--md);
109
+ --pf-v5-c-content--h4--FontWeight: var(--pf-v5-global--FontWeight--semi-bold);
110
+ --pf-v5-c-content--h5--MarginTop: var(--pf-v5-global--spacer--lg);
111
+ --pf-v5-c-content--h5--MarginBottom: var(--pf-v5-global--spacer--sm);
112
+ --pf-v5-c-content--h5--LineHeight: var(--pf-v5-global--LineHeight--md);
113
+ --pf-v5-c-content--h5--FontSize: var(--pf-v5-global--FontSize--md);
114
+ --pf-v5-c-content--h5--FontWeight: var(--pf-v5-global--FontWeight--semi-bold);
115
+ --pf-v5-c-content--h6--MarginTop: var(--pf-v5-global--spacer--lg);
116
+ --pf-v5-c-content--h6--MarginBottom: var(--pf-v5-global--spacer--sm);
117
+ --pf-v5-c-content--h6--LineHeight: var(--pf-v5-global--LineHeight--md);
118
+ --pf-v5-c-content--h6--FontSize: var(--pf-v5-global--FontSize--md);
119
+ --pf-v5-c-content--h6--FontWeight: var(--pf-v5-global--FontWeight--semi-bold);
120
+ --pf-v5-c-content--small--MarginBottom: var(--pf-v5-global--spacer--md);
121
+ --pf-v5-c-content--small--LineHeight: var(--pf-v5-global--LineHeight--md);
122
+ --pf-v5-c-content--small--FontSize: var(--pf-v5-global--FontSize--sm);
123
+ --pf-v5-c-content--small--Color: var(--pf-v5-global--Color--200);
124
+ --pf-v5-c-content--small--FontWeight: var(--pf-v5-global--FontWeight--semi-bold);
125
+ --pf-v5-c-content--a--Color: var(--pf-v5-global--link--Color);
126
+ --pf-v5-c-content--a--TextDecoration: var(--pf-v5-global--link--TextDecoration);
127
+ --pf-v5-c-content--a--hover--Color: var(--pf-v5-global--link--Color--hover);
128
+ --pf-v5-c-content--a--hover--TextDecoration: var(--pf-v5-global--link--TextDecoration--hover);
129
+ --pf-v5-c-content--blockquote--PaddingTop: var(--pf-v5-global--spacer--md);
130
+ --pf-v5-c-content--blockquote--PaddingRight: var(--pf-v5-global--spacer--md);
131
+ --pf-v5-c-content--blockquote--PaddingBottom: var(--pf-v5-global--spacer--md);
132
+ --pf-v5-c-content--blockquote--PaddingLeft: var(--pf-v5-global--spacer--md);
133
+ --pf-v5-c-content--blockquote--FontWeight: var(--pf-v5-global--FontWeight--light);
134
+ --pf-v5-c-content--blockquote--Color: var(--pf-v5-global--Color--200);
135
+ --pf-v5-c-content--blockquote--BorderLeftColor: var(--pf-v5-global--BorderColor--100);
136
+ --pf-v5-c-content--blockquote--BorderLeftWidth: var(--pf-v5-global--BorderWidth--lg);
137
+ --pf-v5-c-content--ol--PaddingLeft: var(--pf-v5-global--spacer--lg);
138
+ --pf-v5-c-content--ol--MarginTop: var(--pf-v5-global--spacer--md);
139
+ --pf-v5-c-content--ol--MarginLeft: var(--pf-v5-global--spacer--lg);
140
+ --pf-v5-c-content--ol--nested--MarginTop: var(--pf-v5-global--spacer--sm);
141
+ --pf-v5-c-content--ol--nested--MarginLeft: var(--pf-v5-global--spacer--sm);
142
+ --pf-v5-c-content--ul--PaddingLeft: var(--pf-v5-global--spacer--lg);
143
+ --pf-v5-c-content--ul--MarginTop: var(--pf-v5-global--spacer--md);
144
+ --pf-v5-c-content--ul--MarginLeft: var(--pf-v5-global--spacer--lg);
145
+ --pf-v5-c-content--ul--nested--MarginTop: var(--pf-v5-global--spacer--sm);
146
+ --pf-v5-c-content--ul--nested--MarginLeft: var(--pf-v5-global--spacer--sm);
147
+ --pf-v5-c-content--ul--ListStyle: var(--pf-v5-global--ListStyle);
148
+ --pf-v5-c-content--li--MarginTop: var(--pf-v5-global--spacer--sm);
149
+ --pf-v5-c-content--dl--ColumnGap: var(--pf-v5-global--spacer--2xl);
150
+ --pf-v5-c-content--dl--RowGap: var(--pf-v5-global--spacer--md);
151
+ --pf-v5-c-content--dt--FontWeight: var(--pf-v5-global--FontWeight--semi-bold);
152
+ --pf-v5-c-content--dt--MarginTop: var(--pf-v5-global--spacer--md);
153
+ --pf-v5-c-content--dt--sm--MarginTop: 0;
154
+ --pf-v5-c-content--hr--Height: var(--pf-v5-global--BorderWidth--sm);
155
+ --pf-v5-c-content--hr--BackgroundColor: var(--pf-v5-global--BorderColor--100);
156
+ font-size: var(--pf-v5-c-content--FontSize);
157
+ line-height: var(--pf-v5-c-content--LineHeight);
158
+ color: var(--pf-v5-c-content--Color); }
159
159
  .ws-li + li {
160
- margin-top: var(--pf-c-content--li--MarginTop); }
160
+ margin-top: var(--pf-v5-c-content--li--MarginTop); }
161
161
  .ws-p:not(:last-child),
162
162
  .ws-dl:not(:last-child),
163
163
  .ws-ol:not(:last-child),
@@ -168,7 +168,7 @@
168
168
  .ws-hr:not(:last-child),
169
169
  .ws-table:not(:last-child),
170
170
  .ws-content-table:not(:last-child) {
171
- margin-bottom: var(--pf-c-content--MarginBottom); }
171
+ margin-bottom: var(--pf-v5-c-content--MarginBottom); }
172
172
  .ws-h1,
173
173
  .ws-h2,
174
174
  .ws-h3,
@@ -176,104 +176,104 @@
176
176
  .ws-h5,
177
177
  .ws-h6 {
178
178
  margin: 0;
179
- font-family: var(--pf-c-content--heading--FontFamily); }
179
+ font-family: var(--pf-v5-c-content--heading--FontFamily); }
180
180
  .ws-ol,
181
181
  .ws-ul {
182
182
  margin: 0; }
183
183
  .ws-h1 {
184
- margin-bottom: var(--pf-c-content--h1--MarginBottom);
185
- font-size: var(--pf-c-content--h1--FontSize);
186
- font-weight: var(--pf-c-content--h1--FontWeight);
187
- line-height: var(--pf-c-content--h1--LineHeight); }
184
+ margin-bottom: var(--pf-v5-c-content--h1--MarginBottom);
185
+ font-size: var(--pf-v5-c-content--h1--FontSize);
186
+ font-weight: var(--pf-v5-c-content--h1--FontWeight);
187
+ line-height: var(--pf-v5-c-content--h1--LineHeight); }
188
188
  .ws-h1:not(:first-child) {
189
- margin-top: var(--pf-c-content--h1--MarginTop); }
189
+ margin-top: var(--pf-v5-c-content--h1--MarginTop); }
190
190
  .ws-h2 {
191
- margin-bottom: var(--pf-c-content--h2--MarginBottom);
192
- font-size: var(--pf-c-content--h2--FontSize);
193
- font-weight: var(--pf-c-content--h2--FontWeight);
194
- line-height: var(--pf-c-content--h2--LineHeight); }
191
+ margin-bottom: var(--pf-v5-c-content--h2--MarginBottom);
192
+ font-size: var(--pf-v5-c-content--h2--FontSize);
193
+ font-weight: var(--pf-v5-c-content--h2--FontWeight);
194
+ line-height: var(--pf-v5-c-content--h2--LineHeight); }
195
195
  .ws-h2:not(:first-child) {
196
- margin-top: var(--pf-c-content--h2--MarginTop); }
196
+ margin-top: var(--pf-v5-c-content--h2--MarginTop); }
197
197
  .ws-h3 {
198
- margin-bottom: var(--pf-c-content--h3--MarginBottom);
199
- font-size: var(--pf-c-content--h3--FontSize);
200
- font-weight: var(--pf-c-content--h3--FontWeight);
201
- line-height: var(--pf-c-content--h3--LineHeight); }
198
+ margin-bottom: var(--pf-v5-c-content--h3--MarginBottom);
199
+ font-size: var(--pf-v5-c-content--h3--FontSize);
200
+ font-weight: var(--pf-v5-c-content--h3--FontWeight);
201
+ line-height: var(--pf-v5-c-content--h3--LineHeight); }
202
202
  .ws-h3:not(:first-child) {
203
- margin-top: var(--pf-c-content--h3--MarginTop); }
203
+ margin-top: var(--pf-v5-c-content--h3--MarginTop); }
204
204
  .ws-h4 {
205
- margin-bottom: var(--pf-c-content--h4--MarginBottom);
206
- font-size: var(--pf-c-content--h4--FontSize);
207
- font-weight: var(--pf-c-content--h4--FontWeight);
208
- line-height: var(--pf-c-content--h4--LineHeight); }
205
+ margin-bottom: var(--pf-v5-c-content--h4--MarginBottom);
206
+ font-size: var(--pf-v5-c-content--h4--FontSize);
207
+ font-weight: var(--pf-v5-c-content--h4--FontWeight);
208
+ line-height: var(--pf-v5-c-content--h4--LineHeight); }
209
209
  .ws-h4:not(:first-child) {
210
- margin-top: var(--pf-c-content--h4--MarginTop); }
210
+ margin-top: var(--pf-v5-c-content--h4--MarginTop); }
211
211
  .ws-h5 {
212
- margin-bottom: var(--pf-c-content--h5--MarginBottom);
213
- font-size: var(--pf-c-content--h5--FontSize);
214
- font-weight: var(--pf-c-content--h5--FontWeight);
215
- line-height: var(--pf-c-content--h5--LineHeight); }
212
+ margin-bottom: var(--pf-v5-c-content--h5--MarginBottom);
213
+ font-size: var(--pf-v5-c-content--h5--FontSize);
214
+ font-weight: var(--pf-v5-c-content--h5--FontWeight);
215
+ line-height: var(--pf-v5-c-content--h5--LineHeight); }
216
216
  .ws-h5:not(:first-child) {
217
- margin-top: var(--pf-c-content--h5--MarginTop); }
217
+ margin-top: var(--pf-v5-c-content--h5--MarginTop); }
218
218
  .ws-h6 {
219
- margin-bottom: var(--pf-c-content--h6--MarginBottom);
220
- font-size: var(--pf-c-content--h6--FontSize);
221
- font-weight: var(--pf-c-content--h6--FontWeight);
222
- line-height: var(--pf-c-content--h6--LineHeight); }
219
+ margin-bottom: var(--pf-v5-c-content--h6--MarginBottom);
220
+ font-size: var(--pf-v5-c-content--h6--FontSize);
221
+ font-weight: var(--pf-v5-c-content--h6--FontWeight);
222
+ line-height: var(--pf-v5-c-content--h6--LineHeight); }
223
223
  .ws-h6:not(:first-child) {
224
- margin-top: var(--pf-c-content--h6--MarginTop); }
224
+ margin-top: var(--pf-v5-c-content--h6--MarginTop); }
225
225
  .ws-small {
226
226
  display: block;
227
- font-size: var(--pf-c-content--small--FontSize);
228
- line-height: var(--pf-c-content--small--LineHeight);
229
- color: var(--pf-c-content--small--Color); }
227
+ font-size: var(--pf-v5-c-content--small--FontSize);
228
+ line-height: var(--pf-v5-c-content--small--LineHeight);
229
+ color: var(--pf-v5-c-content--small--Color); }
230
230
  .ws-small:not(:last-child) {
231
- margin-bottom: var(--pf-c-content--small--MarginBottom); }
231
+ margin-bottom: var(--pf-v5-c-content--small--MarginBottom); }
232
232
  .ws-blockquote {
233
- padding: var(--pf-c-content--blockquote--PaddingTop) var(--pf-c-content--blockquote--PaddingRight) var(--pf-c-content--blockquote--PaddingBottom) var(--pf-c-content--blockquote--PaddingLeft);
234
- font-weight: var(--pf-c-content--blockquote--FontWeight);
235
- color: var(--pf-c-content--blockquote--Color);
236
- border-left: var(--pf-c-content--blockquote--BorderLeftWidth) solid var(--pf-c-content--blockquote--BorderLeftColor); }
233
+ padding: var(--pf-v5-c-content--blockquote--PaddingTop) var(--pf-v5-c-content--blockquote--PaddingRight) var(--pf-v5-c-content--blockquote--PaddingBottom) var(--pf-v5-c-content--blockquote--PaddingLeft);
234
+ font-weight: var(--pf-v5-c-content--blockquote--FontWeight);
235
+ color: var(--pf-v5-c-content--blockquote--Color);
236
+ border-left: var(--pf-v5-c-content--blockquote--BorderLeftWidth) solid var(--pf-v5-c-content--blockquote--BorderLeftColor); }
237
237
  .ws-hr {
238
- height: var(--pf-c-content--hr--Height);
239
- background-color: var(--pf-c-content--hr--BackgroundColor);
238
+ height: var(--pf-v5-c-content--hr--Height);
239
+ background-color: var(--pf-v5-c-content--hr--BackgroundColor);
240
240
  border: none; }
241
241
  .ws-ol {
242
- padding-left: var(--pf-c-content--ol--PaddingLeft);
243
- margin-top: var(--pf-c-content--ol--MarginTop);
244
- margin-left: var(--pf-c-content--ol--MarginLeft); }
242
+ padding-left: var(--pf-v5-c-content--ol--PaddingLeft);
243
+ margin-top: var(--pf-v5-c-content--ol--MarginTop);
244
+ margin-left: var(--pf-v5-c-content--ol--MarginLeft); }
245
245
  .ws-ol ul {
246
- --pf-c-content--ul--MarginTop: var(--pf-c-content--ul--nested--MarginTop);
247
- --pf-c-content--ul--MarginLeft: var(--pf-c-content--ul--nested--MarginLeft); }
246
+ --pf-v5-c-content--ul--MarginTop: var(--pf-v5-c-content--ul--nested--MarginTop);
247
+ --pf-v5-c-content--ul--MarginLeft: var(--pf-v5-c-content--ul--nested--MarginLeft); }
248
248
  .ws-ol ol {
249
- --pf-c-content--ol--MarginTop: var(--pf-c-content--ol--nested--MarginTop);
250
- --pf-c-content--ol--MarginLeft: var(--pf-c-content--ol--nested--MarginLeft); }
249
+ --pf-v5-c-content--ol--MarginTop: var(--pf-v5-c-content--ol--nested--MarginTop);
250
+ --pf-v5-c-content--ol--MarginLeft: var(--pf-v5-c-content--ol--nested--MarginLeft); }
251
251
  .ws-ul {
252
- padding-left: var(--pf-c-content--ul--PaddingLeft);
253
- margin-top: var(--pf-c-content--ul--MarginTop);
254
- margin-left: var(--pf-c-content--ul--MarginLeft);
255
- list-style: var(--pf-c-content--ul--ListStyle); }
252
+ padding-left: var(--pf-v5-c-content--ul--PaddingLeft);
253
+ margin-top: var(--pf-v5-c-content--ul--MarginTop);
254
+ margin-left: var(--pf-v5-c-content--ul--MarginLeft);
255
+ list-style: var(--pf-v5-c-content--ul--ListStyle); }
256
256
  .ws-ul ul {
257
- --pf-c-content--ul--MarginTop: var(--pf-c-content--ul--nested--MarginTop);
258
- --pf-c-content--ul--MarginLeft: var(--pf-c-content--ul--nested--MarginLeft); }
257
+ --pf-v5-c-content--ul--MarginTop: var(--pf-v5-c-content--ul--nested--MarginTop);
258
+ --pf-v5-c-content--ul--MarginLeft: var(--pf-v5-c-content--ul--nested--MarginLeft); }
259
259
  .ws-ul ol {
260
- --pf-c-content--ol--MarginTop: var(--pf-c-content--ol--nested--MarginTop);
261
- --pf-c-content--ol--MarginLeft: var(--pf-c-content--ol--nested--MarginLeft); }
260
+ --pf-v5-c-content--ol--MarginTop: var(--pf-v5-c-content--ol--nested--MarginTop);
261
+ --pf-v5-c-content--ol--MarginLeft: var(--pf-v5-c-content--ol--nested--MarginLeft); }
262
262
  .ws-dl {
263
263
  display: grid;
264
264
  grid-template-columns: 1fr; }
265
265
  @media screen and (min-width: 576px) {
266
266
  .ws-dl {
267
267
  grid-template: auto / auto 1fr;
268
- grid-column-gap: var(--pf-c-content--dl--ColumnGap);
269
- grid-row-gap: var(--pf-c-content--dl--RowGap); } }
268
+ grid-column-gap: var(--pf-v5-c-content--dl--ColumnGap);
269
+ grid-row-gap: var(--pf-v5-c-content--dl--RowGap); } }
270
270
  .ws-dt {
271
- font-weight: var(--pf-c-content--dt--FontWeight); }
271
+ font-weight: var(--pf-v5-c-content--dt--FontWeight); }
272
272
  .ws-dt:not(:first-child) {
273
- margin-top: var(--pf-c-content--dt--MarginTop); }
273
+ margin-top: var(--pf-v5-c-content--dt--MarginTop); }
274
274
  @media screen and (min-width: 576px) {
275
275
  .ws-dt:not(:first-child) {
276
- --pf-c-content--dt--MarginTop: var(--pf-c-content--dt--sm--MarginTop); } }
276
+ --pf-v5-c-content--dt--MarginTop: var(--pf-v5-c-content--dt--sm--MarginTop); } }
277
277
  @media screen and (min-width: 576px) {
278
278
  .ws-dt {
279
279
  grid-column: 1; } }
@@ -297,11 +297,6 @@
297
297
  max-width: 832px;
298
298
  }
299
299
 
300
- .ws-mdx-content-katacoda {
301
- flex-grow: 1;
302
- padding: 0;
303
- }
304
-
305
300
  /* Overlay the footer */
306
301
  .ws-back-to-top {
307
302
  z-index: 2;
package/templates/mdx.js CHANGED
@@ -7,12 +7,14 @@ import { CSSVariables, PropsTable, TableOfContents, Link, AutoLinkHeader, Inline
7
7
  import { capitalize, getTitle, slugger, trackEvent } from '../helpers';
8
8
  import './mdx.css';
9
9
  import { convertToReactComponent } from '@patternfly/ast-helpers';
10
+ import { FunctionsTable } from '../components/functionsTable/functionsTable';
10
11
 
11
12
  const MDXChildTemplate = ({
12
13
  Component,
13
14
  source,
14
15
  toc = [],
15
- index = 0
16
+ index = 0,
17
+ id
16
18
  }) => {
17
19
  const {
18
20
  propComponents = [],
@@ -20,8 +22,7 @@ const MDXChildTemplate = ({
20
22
  cssPrefix = [],
21
23
  optIn,
22
24
  beta,
23
- katacodaBroken,
24
- katacodaLayout
25
+ functionDocumentation = []
25
26
  } = Component.getPageData();
26
27
  const cssVarsTitle = cssPrefix.length > 0 && 'CSS variables';
27
28
  const propsTitle = propComponents.length > 0 && 'Props';
@@ -59,23 +60,27 @@ const MDXChildTemplate = ({
59
60
  To learn more about the process, visit our <Link to="/get-started/about#beta-components">about page</Link> or our <a href="https://github.com/patternfly/patternfly-org/tree/main/beta-component-promotion">Beta components</a> page on GitHub.
60
61
  </InlineAlert>
61
62
  )}
62
- {katacodaBroken && (
63
- <InlineAlert variant="warning" title="Down for maintenance">
64
- The embedded version of our tutorials are broken, but you can still access our tutorials on <a href="https://www.katacoda.com/patternfly">Katacoda.com <ExternalLinkAltIcon /></a>.
65
- </InlineAlert>
66
- )}
67
63
  </React.Fragment>
68
64
  );
65
+ console.log(id);
69
66
  // Create dynamic component for @reach/router
70
67
  const ChildComponent = () => (
71
- <div className="pf-u-display-flex ws-mdx-child-template">
68
+ <div className="pf-v5-u-display-flex ws-mdx-child-template">
72
69
  {toc.length > 1 && (
73
70
  <TableOfContents items={toc} />
74
71
  )}
75
- <div className={katacodaLayout? "ws-mdx-content-katacoda" : "ws-mdx-content"}>
76
- <div className={katacodaLayout ? "" : "ws-mdx-content-content"}>
72
+ <div className="ws-mdx-content">
73
+ <div className={id === 'All components' ? "" : "ws-mdx-content-content"}>
77
74
  {InlineAlerts}
78
75
  <Component />
76
+ {functionDocumentation.length > 0 && (
77
+ <React.Fragment>
78
+ <AutoLinkHeader size="h2" className="ws-h2" id="functions">
79
+ Functions
80
+ </AutoLinkHeader>
81
+ <FunctionsTable functionDescriptions={functionDocumentation}/>
82
+ </React.Fragment>
83
+ )}
79
84
  {propsTitle && (
80
85
  <React.Fragment>
81
86
  <AutoLinkHeader size="h2" className="ws-h2" id="props">
@@ -100,7 +105,7 @@ const MDXChildTemplate = ({
100
105
  <CSSVariables prefix={cssPrefix} />
101
106
  </React.Fragment>
102
107
  )}
103
- {!katacodaLayout && sourceLink && (
108
+ {sourceLink && (
104
109
  <React.Fragment>
105
110
  <br />
106
111
  <a href={sourceLink} target="_blank" onClick={() => trackEvent('view_source_click', 'click_event', source.toUpperCase())}>View source on GitHub</a>
@@ -121,7 +126,15 @@ export const MDXTemplate = ({
121
126
  id,
122
127
  componentsData
123
128
  }) => {
124
- const sourceKeys = sources.map(v => v.source);
129
+ // Build obj mapping source names to text displayed on tabs
130
+ const tabNames = sources.reduce((acc, curSrc) => {
131
+ const { source, tabName } = curSrc;
132
+ // use tabName for tab name if present, otherwise default to source
133
+ const tabLinkText = tabName || capitalize(source.replace('html', 'HTML').replace(/-/g, ' '));
134
+ acc[source] = tabLinkText;
135
+ return acc;
136
+ }, {});
137
+ const sourceKeys = Object.keys(tabNames);
125
138
  const isSinglePage = sourceKeys.length === 1;
126
139
 
127
140
  let isDevResources, isComponent, isExtension, isChart, isDemo, isLayout, isUtility;
@@ -159,7 +172,6 @@ export const MDXTemplate = ({
159
172
  (e) => e.includes("pages") || e.includes("training")
160
173
  );
161
174
  const { pathname } = useLocation();
162
- const { katacodaLayout } = sources[0].Component.getPageData();
163
175
  let activeSource = pathname.replace(/\/$/, '').split('/').pop();
164
176
  // get summary text, convert to JSX to display above tabs on component pages
165
177
  const componentDasherized = id.split(' ').join('-').toLowerCase();
@@ -192,6 +204,14 @@ export const MDXTemplate = ({
192
204
  return "pf-m-light-100";
193
205
  };
194
206
 
207
+ const showTabs = (
208
+ (!isSinglePage && !hideTabName) ||
209
+ isComponent ||
210
+ isUtility ||
211
+ isDemo
212
+ );
213
+
214
+ console.log(id);
195
215
  return (
196
216
  <React.Fragment>
197
217
  <PageGroup>
@@ -201,40 +221,37 @@ export const MDXTemplate = ({
201
221
  isWidthLimited
202
222
  >
203
223
  <TextContent>
204
- {!katacodaLayout && <Title headingLevel='h1' size='4xl' id="ws-page-title">{title}</Title>}
205
- {isComponent && summary && (<SummaryComponent />)}
224
+ <Title headingLevel='h1' size='4xl' id="ws-page-title">{title}</Title>
225
+ {isComponent && summary && (<SummaryComponent />)}
206
226
  </TextContent>
207
227
  </PageSection>
208
- {((!isSinglePage && !hideTabName) ||
209
- isComponent ||
210
- isUtility ||
211
- isDemo) && (
212
- <PageSection id="ws-sticky-nav-tabs" stickyOnBreakpoint={{'default':'top'}} type="tabs">
213
- <div className="pf-c-tabs pf-m-page-insets pf-m-no-border-bottom">
214
- <ul className="pf-c-tabs__list">
215
- {sourceKeys.map((source, index) => (
216
- <li
217
- key={source}
218
- className={css(
219
- 'pf-c-tabs__item',
220
- activeSource === source && 'pf-m-current'
221
- )}
222
- // Send clicked tab name for analytics
223
- onClick={() => trackEvent('tab_click', 'click_event', source.toUpperCase())}
224
- >
225
- <Link className="pf-c-tabs__link" to={`${path}${index === 0 ? '' : '/' + source}`}>
226
- {capitalize(source.replace('html', 'HTML').replace(/-/g, ' '))}
227
- </Link>
228
- </li>
229
- ))}
230
- </ul>
231
- </div>
232
- </PageSection>
228
+ { showTabs && (
229
+ <PageSection id="ws-sticky-nav-tabs" stickyOnBreakpoint={{'default':'top'}} type="tabs">
230
+ <div className="pf-v5-c-tabs pf-m-page-insets pf-m-no-border-bottom">
231
+ <ul className="pf-v5-c-tabs__list">
232
+ {sourceKeys.map((source, index) => (
233
+ <li
234
+ key={source}
235
+ className={css(
236
+ 'pf-v5-c-tabs__item',
237
+ activeSource === source && 'pf-m-current'
238
+ )}
239
+ // Send clicked tab name for analytics
240
+ onClick={() => trackEvent('tab_click', 'click_event', source.toUpperCase())}
241
+ >
242
+ <Link className="pf-v5-c-tabs__link" to={`${path}${index === 0 ? '' : '/' + source}`}>
243
+ {tabNames[source]}
244
+ </Link>
245
+ </li>
246
+ ))}
247
+ </ul>
248
+ </div>
249
+ </PageSection>
233
250
  )}
234
251
  <PageSection id="main-content" isFilled className="pf-m-light-100">
235
- {isSinglePage && <MDXChildTemplate {...sources[0]} />}
252
+ {isSinglePage && <MDXChildTemplate {...sources[0]} id={id}/>}
236
253
  {!isSinglePage && (
237
- <Router className="pf-u-h-100" primary={false}>
254
+ <Router className="pf-v5-u-h-100" primary={false}>
238
255
  {sources
239
256
  .map((source, index) => {
240
257
  source.index = index;
@@ -7,6 +7,8 @@ section: extensions
7
7
  id: My extension
8
8
  # Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
9
9
  source: design-guidelines
10
+ # Optional custom text to display in tab in place of source
11
+ tabName: My custom tab-name
10
12
  ---
11
13
 
12
14
  Design guidelines intro
@@ -7,6 +7,8 @@ section: extensions
7
7
  id: My extension
8
8
  # Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
9
9
  source: react
10
+ # Optional custom text to display in tab in place of source
11
+ tabName: My custom tab-name
10
12
  # If you use typescript, the name of the interface to display props for
11
13
  # These are found through the sourceProps function provdided in patternfly-docs.source.js
12
14
  # Can also pass object { component: string, source: string } allowing to specify the source