@patternfly/documentation-framework 1.0.7 → 1.1.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+ # 1.1.0 (2022-07-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * **doc-framework:** add dark theme toggle for full page examples ([#3056](https://github.com/patternfly/patternfly-org/issues/3056)) ([aab143f](https://github.com/patternfly/patternfly-org/commit/aab143f764e46edafec6f690351e47fe14fa5404))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 1.0.7 (2022-07-11)
7
18
 
8
19
  **Note:** Version bump only for package @patternfly/documentation-framework
@@ -105,3 +105,27 @@
105
105
  .ws-prop-required {
106
106
  color: var(--pf-global--danger-color--100);
107
107
  }
108
+
109
+ .ws-theme-switch-full-page {
110
+ position: fixed;
111
+ right: 0;
112
+ bottom: 0;
113
+ padding: var(--pf-global--spacer--md);
114
+ z-index: var(--pf-global--ZIndex--2xl);
115
+ }
116
+
117
+ .ws-theme-switch-full-page::before {
118
+ position: absolute;
119
+ top: 0;
120
+ left: 0;
121
+ content: "";
122
+ width: 100%;
123
+ height: 100%;
124
+ background-color: var(--pf-global--BackgroundColor--100);
125
+ opacity: 0.8;
126
+ box-shadow: var(--pf-global--BoxShadow--sm);
127
+ }
128
+
129
+ .pf-theme-dark .ws-theme-switch-full-page::before {
130
+ background-color: var(--pf-global--BackgroundColor--300);
131
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useLocation } from '@reach/router';
3
- import { Badge, CodeBlock, CodeBlockCode, debounce } from '@patternfly/react-core';
3
+ import { Badge, CodeBlock, CodeBlockCode, debounce, Switch } from '@patternfly/react-core';
4
4
  import * as reactCoreModule from '@patternfly/react-core';
5
5
  import * as reactTableModule from '@patternfly/react-table';
6
6
  import { css } from '@patternfly/react-styles';
@@ -77,6 +77,8 @@ export const Example = ({
77
77
  liveContext,
78
78
  // Content that appears between h3 and code block to explain example
79
79
  children,
80
+ // Show dark theme switcher on full page examples
81
+ hasDarkThemeSwitcher = process.env.hasDarkThemeSwitcher
80
82
  }) => {
81
83
  if (isFullscreenPreview) {
82
84
  isFullscreen = false;
@@ -136,6 +138,12 @@ export const Example = ({
136
138
  return (
137
139
  <div id={previewId} className={css(className, 'pf-u-h-100')}>
138
140
  {livePreview}
141
+ {hasDarkThemeSwitcher && (
142
+ <div className="ws-theme-switch-full-page">
143
+ <Switch id="ws-theme-switch" label="Dark theme" defaultChecked={false} onChange={() =>
144
+ document.querySelector('html').classList.toggle('pf-theme-dark')} />
145
+ </div>
146
+ )}
139
147
  </div>
140
148
  );
141
149
  }
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": "1.0.7",
4
+ "version": "1.1.0",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -84,5 +84,5 @@
84
84
  "react": "^16.8.0 || ^17.0.0",
85
85
  "react-dom": "^16.8.0 || ^17.0.0"
86
86
  },
87
- "gitHead": "ccfd89d39338d0d9d0c4ba7ccd20daa334c3a6e4"
87
+ "gitHead": "905621ef8bef1a76f866f0d6b30788f49f25c81d"
88
88
  }