@patternfly/documentation-framework 5.2.26 → 5.3.1

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,28 @@
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.3.1 (2023-11-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **react-drag-drop:** add react-drag-drop to latest version ([#3801](https://github.com/patternfly/patternfly-org/issues/3801)) ([bbf20d4](https://github.com/patternfly/patternfly-org/commit/bbf20d4406303441a534c5fc9bd4667f72e55850))
12
+
13
+
14
+
15
+
16
+
17
+ # 5.3.0 (2023-11-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * **dark-theme:** replace dark theme switcher with toggle group ([#3788](https://github.com/patternfly/patternfly-org/issues/3788)) ([0bf3c62](https://github.com/patternfly/patternfly-org/commit/0bf3c62484bc288386a9620fcb89c38da5d260af))
23
+
24
+
25
+
26
+
27
+
6
28
  ## 5.2.26 (2023-10-30)
7
29
 
8
30
  **Note:** Version bump only for package @patternfly/documentation-framework
@@ -42,3 +42,9 @@
42
42
  --pf-v5-c-switch__input--not-checked__label--Color: var(--pf-v5-global--Color--100);
43
43
  --pf-v5-c-switch__input--checked__label--Color: var(--pf-v5-global--Color--100);
44
44
  }
45
+
46
+ .ws-masthead .pf-v5-c-toggle-group {
47
+ --pf-v5-c-toggle-group__button--m-selected--BackgroundColor: var(--pf-v5-global--palette--blue-400);
48
+ --pf-v5-c-toggle-group__button--focus--BackgroundColor: transparent;
49
+ --pf-v5-c-toggle-group__button--hover--BackgroundColor: transparent;
50
+ }
@@ -10,6 +10,7 @@ import {
10
10
  DropdownGroup,
11
11
  DropdownList,
12
12
  Divider,
13
+ Icon,
13
14
  Masthead,
14
15
  MastheadToggle,
15
16
  MastheadMain,
@@ -23,10 +24,14 @@ import {
23
24
  ToolbarItem,
24
25
  SkipToContent,
25
26
  Switch,
26
- SearchInput
27
+ SearchInput,
28
+ ToggleGroup,
29
+ ToggleGroupItem
27
30
  } from '@patternfly/react-core';
28
31
  import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
29
32
  import GithubIcon from '@patternfly/react-icons/dist/esm/icons/github-icon';
33
+ import MoonIcon from '@patternfly/react-icons/dist/esm/icons/moon-icon';
34
+ import SunIcon from '@patternfly/react-icons/dist/esm/icons/sun-icon';
30
35
  import { SideNav, TopNav, GdprBanner } from '../../components';
31
36
  import staticVersions from '../../versions.json';
32
37
  import v5Logo from '../PF-HorizontalLogo-Reverse.svg';
@@ -50,6 +55,7 @@ const HeaderTools = ({
50
55
  const [isDropdownOpen, setDropdownOpen] = useState(false);
51
56
  const [searchValue, setSearchValue] = React.useState('');
52
57
  const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
58
+ const [isDarkTheme, setIsDarkTheme] = React.useState(false);
53
59
 
54
60
  const getDropdownItem = (version, isLatest = false) => (
55
61
  <DropdownItem itemId={version.name} key={version.name} to={isLatest ? '/' : `/${version.name}`}>
@@ -65,6 +71,12 @@ const HeaderTools = ({
65
71
  setIsSearchExpanded(!isSearchExpanded);
66
72
  };
67
73
 
74
+ const toggleDarkTheme = (_evt, selected) => {
75
+ const darkThemeToggleClicked = !selected === isDarkTheme
76
+ document.querySelector('html').classList.toggle('pf-v5-theme-dark', darkThemeToggleClicked);
77
+ setIsDarkTheme(darkThemeToggleClicked);
78
+ };
79
+
68
80
  useEffect(() => {
69
81
  // reattach algolia to input each time search is expanded
70
82
  if (hasSearch && isSearchExpanded) {
@@ -86,8 +98,10 @@ const HeaderTools = ({
86
98
  >
87
99
  {hasDarkThemeSwitcher && (
88
100
  <ToolbarItem>
89
- <Switch id="ws-theme-switch" label="Dark theme" defaultChecked={false} onChange={() =>
90
- document.querySelector('html').classList.toggle('pf-v5-theme-dark')} />
101
+ <ToggleGroup aria-label="Dark theme toggle group">
102
+ <ToggleGroupItem aria-label="light theme toggle" icon={<Icon size="md"><SunIcon /></Icon>} isSelected={!isDarkTheme} onChange={toggleDarkTheme} />
103
+ <ToggleGroupItem aria-label="dark theme toggle" icon={<Icon size="md"><MoonIcon /></Icon>} isSelected={isDarkTheme} onChange={toggleDarkTheme} />
104
+ </ToggleGroup>
91
105
  </ToolbarItem>
92
106
  )}
93
107
  {hasRTLSwitcher && (
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.2.26",
4
+ "version": "5.3.1",
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.2.26",
20
+ "@patternfly/ast-helpers": "^1.3.1",
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": "7eb15ac41be70c983a914eaed7805d9b2dd08870"
90
+ "gitHead": "87583d31a161c8cbda53256bbc8500db2c5c0c2d"
91
91
  }
package/versions.json CHANGED
@@ -33,6 +33,7 @@
33
33
  "@patternfly/react-icons": "5.0.0",
34
34
  "@patternfly/react-styles": "5.0.0",
35
35
  "@patternfly/react-table": "5.0.0",
36
+ "@patternfly/react-drag-drop": "5.0.0-alpha.0",
36
37
  "@patternfly/react-tokens": "5.0.0",
37
38
  "@patternfly/react-catalog-view-extension": "5.0.0",
38
39
  "@patternfly/react-console": "5.0.0",