@patternfly/documentation-framework 5.1.6 → 5.1.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 5.1.8 (2023-08-25)
7
+
8
+ **Note:** Version bump only for package @patternfly/documentation-framework
9
+
10
+
11
+
12
+
13
+
14
+ ## 5.1.7 (2023-08-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * added rtl switch to fullpage examples ([#3719](https://github.com/patternfly/patternfly-org/issues/3719)) ([fc1f9ba](https://github.com/patternfly/patternfly-org/commit/fc1f9bacab352cf2db7418ae98b2f3c98cd47302))
20
+
21
+
22
+
23
+
24
+
6
25
  ## 5.1.6 (2023-08-24)
7
26
 
8
27
  **Note:** Version bump only for package @patternfly/documentation-framework
@@ -110,21 +110,18 @@
110
110
  color: var(--pf-v5-global--danger-color--100);
111
111
  }
112
112
 
113
- .ws-theme-switch-full-page {
113
+ .ws-full-page-utils {
114
114
  position: fixed;
115
115
  right: 0;
116
116
  bottom: 0;
117
- padding: var(--pf-v5-global--spacer--md);
117
+ padding: var(--pf-v5-global--spacer--lg);
118
118
  z-index: var(--pf-v5-global--ZIndex--2xl);
119
119
  }
120
120
 
121
- .ws-theme-switch-full-page::before {
121
+ .ws-full-page-utils::before {
122
122
  position: absolute;
123
- top: 0;
124
- left: 0;
123
+ inset: 0;
125
124
  content: "";
126
- width: 100%;
127
- height: 100%;
128
125
  background-color: var(--pf-v5-global--BackgroundColor--100);
129
126
  opacity: 0.8;
130
127
  box-shadow: var(--pf-v5-global--BoxShadow--sm);
@@ -133,3 +130,11 @@
133
130
  .pf-v5-theme-dark .ws-theme-switch-full-page::before {
134
131
  background-color: var(--pf-v5-global--BackgroundColor--300);
135
132
  }
133
+
134
+ .ws-dir-rtl {
135
+ direction: rtl;
136
+ }
137
+
138
+ .ws-dir-ltr {
139
+ direction: ltr;
140
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useLocation } from '@reach/router';
3
- import { Button, CodeBlock, CodeBlockCode, debounce, Label, Switch, Tooltip } from '@patternfly/react-core';
3
+ import { Button, CodeBlock, Flex, CodeBlockCode, debounce, Label, Switch, Tooltip } from '@patternfly/react-core';
4
4
  import * as reactCoreModule from '@patternfly/react-core';
5
5
  import * as reactCoreNextModule from '@patternfly/react-core/next';
6
6
  import * as reactCoreDeprecatedModule from '@patternfly/react-core/deprecated';
@@ -86,6 +86,8 @@ export const Example = ({
86
86
  children,
87
87
  // Show dark theme switcher on full page examples
88
88
  hasDarkThemeSwitcher = process.env.hasDarkThemeSwitcher,
89
+ // Show dark theme switcher on full page examples
90
+ hasRTLSwitcher = process.env.hasRTLSwitcher,
89
91
  // Map of relative imports matched to their npm package import path (passed to Codesandbox)
90
92
  relativeImports,
91
93
  // md file location in node_modules, used to resolve relative import paths in examples
@@ -158,11 +160,17 @@ export const Example = ({
158
160
  return (
159
161
  <div id={previewId} className={css(className, 'pf-v5-u-h-100')}>
160
162
  {livePreview}
161
- {hasDarkThemeSwitcher && (
162
- <div className="ws-theme-switch-full-page">
163
- <Switch id="ws-theme-switch" label="Dark theme" defaultChecked={false} onChange={() =>
164
- document.querySelector('html').classList.toggle('pf-v5-theme-dark')} />
165
- </div>
163
+ {(hasDarkThemeSwitcher || hasRTLSwitcher) && (
164
+ <Flex direction={{ default: 'column' }} gap={{ default: 'gapLg' }} className="ws-full-page-utils ws-dir-ltr">
165
+ {hasDarkThemeSwitcher && (
166
+ <Switch id="ws-theme-switch" label="Dark theme" defaultChecked={false} onChange={() =>
167
+ document.querySelector('html').classList.toggle('pf-v5-theme-dark')} />
168
+ )}
169
+ {hasRTLSwitcher && (
170
+ <Switch id="ws-rtl-switch" label="RTL" defaultChecked={false} onChange={() =>
171
+ document.querySelector('html').classList.toggle('ws-dir-rtl')} />
172
+ )}
173
+ </Flex>
166
174
  )}
167
175
  </div>
168
176
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly/documentation-framework",
3
3
  "description": "A framework to build documentation for PatternFly.",
4
- "version": "5.1.6",
4
+ "version": "5.1.8",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -17,7 +17,7 @@
17
17
  "@babel/plugin-transform-react-jsx": "7.17.12",
18
18
  "@babel/preset-env": "7.18.2",
19
19
  "@mdx-js/util": "1.6.16",
20
- "@patternfly/ast-helpers": "^1.1.6",
20
+ "@patternfly/ast-helpers": "^1.1.8",
21
21
  "@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
22
22
  "autoprefixer": "9.8.6",
23
23
  "babel-loader": "9.1.2",
@@ -87,5 +87,5 @@
87
87
  "react": "^17.0.0 || ^18.0.0",
88
88
  "react-dom": "^17.0.0 || ^18.0.0"
89
89
  },
90
- "gitHead": "4aad9ee28cb00c779a8d750651e9e2750a51e197"
90
+ "gitHead": "879afbbc4e8dd1ec97c4923004783307d4fb78b1"
91
91
  }
@@ -13,6 +13,7 @@ module.exports = (_env, argv) => {
13
13
  hasFooter = false,
14
14
  hasVersionSwitcher = false,
15
15
  hasDesignGuidelines = false,
16
+ hasRTLSwitcher = false,
16
17
  hasDarkThemeSwitcher = false,
17
18
  componentsData = {},
18
19
  sideNavItems = [],
@@ -143,6 +144,7 @@ module.exports = (_env, argv) => {
143
144
  'process.env.hasVersionSwitcher': JSON.stringify(hasVersionSwitcher),
144
145
  'process.env.hasDesignGuidelines': JSON.stringify(hasDesignGuidelines),
145
146
  'process.env.hasDarkThemeSwitcher': JSON.stringify(hasDarkThemeSwitcher),
147
+ 'process.env.hasRTLSwitcher': JSON.stringify(hasRTLSwitcher),
146
148
  'process.env.componentsData': JSON.stringify(componentsData),
147
149
  'process.env.sideNavItems': JSON.stringify(sideNavItems),
148
150
  'process.env.topNavItems': JSON.stringify(topNavItems),
package/templates/mdx.js CHANGED
@@ -125,8 +125,8 @@ const MDXChildTemplate = ({
125
125
  <AutoLinkHeader size="h2" className="ws-h2" id="css-variables">
126
126
  {cssVarsTitle}
127
127
  </AutoLinkHeader>
128
- {cssPrefix.map(prefix => (
129
- <CSSVariables autoLinkHeader={cssPrefix.length > 1} prefix={prefix} />
128
+ {cssPrefix.map((prefix, index) => (
129
+ <CSSVariables key={index} autoLinkHeader={cssPrefix.length > 1} prefix={prefix} />
130
130
  ))}
131
131
  </React.Fragment>
132
132
  )}