@patternfly/documentation-framework 6.0.0-alpha.103 → 6.0.0-alpha.104

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
+ # 6.0.0-alpha.104 (2024-09-25)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **search:** add search bar back in ([#4199](https://github.com/patternfly/patternfly-org/issues/4199)) ([f8e7ec8](https://github.com/patternfly/patternfly-org/commit/f8e7ec8281b95b683e168f3ca74400747ac10fcc))
12
+
13
+
14
+
15
+
16
+
6
17
  # 6.0.0-alpha.103 (2024-09-25)
7
18
 
8
19
 
@@ -4,7 +4,6 @@ import {
4
4
  Page,
5
5
  PageSidebar,
6
6
  PageSidebarBody,
7
- Brand,
8
7
  Dropdown,
9
8
  DropdownItem,
10
9
  DropdownGroup,
@@ -24,7 +23,7 @@ import {
24
23
  ToolbarItem,
25
24
  SkipToContent,
26
25
  Switch,
27
- // SearchInput,
26
+ SearchInput,
28
27
  ToggleGroup,
29
28
  ToggleGroupItem,
30
29
  MastheadLogo,
@@ -51,17 +50,14 @@ const HeaderTools = ({
51
50
  isDarkTheme,
52
51
  setIsDarkTheme,
53
52
  }) => {
54
- const initialVersion = staticVersions.Releases.find(
55
- (release) => release.latest
56
- );
57
53
  const latestVersion = versions.Releases.find((version) => version.latest);
58
54
  const previousReleases = Object.values(versions.Releases).filter(
59
55
  (version) => !version.hidden && !version.latest
60
56
  );
61
- // const hasSearch = algolia;
57
+ const hasSearch = algolia;
62
58
  const [isDropdownOpen, setDropdownOpen] = useState(false);
63
- // const [searchValue, setSearchValue] = React.useState('');
64
- // const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
59
+ const [searchValue, setSearchValue] = React.useState('');
60
+ const [isSearchExpanded, setIsSearchExpanded] = React.useState(false);
65
61
 
66
62
  const getDropdownItem = (version, isLatest = false) => (
67
63
  <DropdownItem
@@ -73,13 +69,13 @@ const HeaderTools = ({
73
69
  </DropdownItem>
74
70
  );
75
71
 
76
- // const onChange = (_evt, value) => {
77
- // setSearchValue(value);
78
- // };
72
+ const onChange = (_evt, value) => {
73
+ setSearchValue(value);
74
+ };
79
75
 
80
- // const onToggleExpand = (_evt, isSearchExpanded) => {
81
- // setIsSearchExpanded(!isSearchExpanded);
82
- // };
76
+ const onToggleExpand = (_evt, isSearchExpanded) => {
77
+ setIsSearchExpanded(!isSearchExpanded);
78
+ };
83
79
 
84
80
  const toggleDarkTheme = (_evt, selected) => {
85
81
  const darkThemeToggleClicked = !selected === isDarkTheme;
@@ -89,12 +85,12 @@ const HeaderTools = ({
89
85
  setIsDarkTheme(darkThemeToggleClicked);
90
86
  };
91
87
 
92
- // useEffect(() => {
93
- // // reattach algolia to input each time search is expanded
94
- // if (hasSearch && isSearchExpanded) {
95
- // attachDocSearch(algolia, '.ws-global-search .pf-v6-c-text-input-group__text-input', 1000);
96
- // }
97
- // }, [isSearchExpanded])
88
+ useEffect(() => {
89
+ // reattach algolia to input each time search is expanded
90
+ if (hasSearch && isSearchExpanded) {
91
+ attachDocSearch(algolia, '.ws-global-search .pf-v6-c-text-input-group__text-input', 1000);
92
+ }
93
+ }, [isSearchExpanded])
98
94
 
99
95
  return (
100
96
  <Toolbar isFullHeight>
@@ -133,7 +129,7 @@ const HeaderTools = ({
133
129
  />
134
130
  </ToolbarItem>
135
131
  )}
136
- {/* {hasSearch && (
132
+ {hasSearch && (
137
133
  <ToolbarItem>
138
134
  <SearchInput
139
135
  className="ws-global-search"
@@ -144,7 +140,7 @@ const HeaderTools = ({
144
140
  expandableInput={{ isExpanded: isSearchExpanded, onToggleExpand, toggleAriaLabel: 'Expandable search input toggle' }}
145
141
  />
146
142
  </ToolbarItem>
147
- )} */}
143
+ )}
148
144
  <ToolbarItem>
149
145
  <Button
150
146
  component="a"
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": "6.0.0-alpha.103",
4
+ "version": "6.0.0-alpha.104",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -13,7 +13,7 @@
13
13
  "@babel/preset-env": "^7.24.3",
14
14
  "@babel/preset-react": "^7.24.1",
15
15
  "@mdx-js/util": "1.6.16",
16
- "@patternfly/ast-helpers": "^1.4.0-alpha.92",
16
+ "@patternfly/ast-helpers": "^1.4.0-alpha.93",
17
17
  "@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
18
18
  "autoprefixer": "9.8.6",
19
19
  "babel-loader": "^9.1.3",
@@ -80,5 +80,5 @@
80
80
  "react": "^17.0.0 || ^18.0.0",
81
81
  "react-dom": "^17.0.0 || ^18.0.0"
82
82
  },
83
- "gitHead": "92fe1cf59ba49bda2eed035ee1e983fd7022ae07"
83
+ "gitHead": "e806e6551edc3c1446322d89976c3feef2352861"
84
84
  }